Skip to content

Commit 41717bc

Browse files
authored
Merge pull request #412 from 10up/do/411-wpcs
Follow WP Coding Standards
2 parents f134ca1 + a1e7c93 commit 41717bc

8 files changed

Lines changed: 539 additions & 297 deletions

File tree

assets/js/src/settings.js

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -128,29 +128,46 @@ import 'jquery-effects-shake';
128128
}
129129
);
130130

131-
Cache.add_btn.on( 'click', function() {
132-
const newIp = Cache.empty_ip
133-
.clone()
134-
.appendTo( Cache.ip_list_wrap );
135-
newIp.removeAttr( 'id' ).slideDown( 250 );
136-
} );
131+
Cache.add_btn.on(
132+
'click',
133+
function() {
134+
const newIp = Cache.empty_ip
135+
.clone()
136+
.appendTo( Cache.ip_list_wrap );
137+
newIp.removeAttr( 'id' ).slideDown( 250 );
138+
}
139+
);
137140

138-
$( Cache.ip_list_wrap ).on( 'blur', '.ip.code', function() {
139-
addIp( $( this ).val(), $( this ).next().val(), $( this ) );
140-
} );
141+
$( Cache.ip_list_wrap ).on(
142+
'blur',
143+
'.ip.code',
144+
function() {
145+
addIp( $( this ).val(), $( this ).next().val(), $( this ) );
146+
}
147+
);
141148

142149
const myipBtn = document.getElementById( 'rsa_myip' );
143150
if ( null !== myipBtn ) {
144-
$( myipBtn ).on( 'click', function() {
145-
$( '.ip.code:last' ).val( $( this ).data( 'myip' ) ).blur();
146-
} );
151+
$( myipBtn ).on(
152+
'click',
153+
function() {
154+
$( '.ip.code:last' ).val( $( this ).data( 'myip' ) ).blur();
155+
}
156+
);
147157
}
148158

149-
$( Cache.ip_list_wrap ).on( 'click', '.remove_btn', function() {
150-
$( this.parentNode ).slideUp( 250, function() {
151-
$( this ).remove();
152-
} );
153-
} );
159+
$( Cache.ip_list_wrap ).on(
160+
'click',
161+
'.remove_btn',
162+
function() {
163+
$( this.parentNode ).slideUp(
164+
250,
165+
function() {
166+
$( this ).remove();
167+
}
168+
);
169+
}
170+
);
154171
}
155172

156173
function addIp( ip, comment, obj ) {
@@ -196,7 +213,9 @@ import 'jquery-effects-shake';
196213
);
197214
}
198215

199-
$( function() {
200-
init();
201-
} );
216+
$(
217+
function() {
218+
init();
219+
}
220+
);
202221
}( window, jQuery ) );

composer.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@
1212
"type": "wordpress-plugin",
1313
"license": "GPL-2.0-or-later",
1414
"require-dev": {
15-
"10up/phpcs-composer": "dev-master",
1615
"phpunit/phpunit": "9.6.33",
17-
"yoast/phpunit-polyfills": "^4.0"
16+
"yoast/phpunit-polyfills": "^4.0",
17+
"wp-coding-standards/wpcs": "^3.0",
18+
"automattic/vipwpcs": "^3.0",
19+
"phpcompatibility/phpcompatibility-wp": "^3.0@dev"
1820
},
1921
"scripts": {
2022
"test": "phpunit",
2123
"test:acceptance": "wpacceptance run",
2224
"lint": "phpcs --extensions=php -s .",
2325
"lint-fix": "phpcbf --extensions=php .",
2426
"post-install-cmd": [
25-
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator"
27+
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator restricted-site-access"
2628
],
2729
"post-update-cmd": [
28-
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator"
30+
"./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator restricted-site-access"
2931
]
3032
},
3133
"minimum-stability": "dev",
@@ -37,16 +39,10 @@
3739
"platform-check": false
3840
},
3941
"require": {
40-
"10up/wp-compat-validation-tool": "dev-trunk",
42+
"10up/wp-compat-validation-tool": "0.4.0",
4143
"mlocati/ip-lib": "dev-master",
4244
"php": ">=7.4"
4345
},
44-
"repositories": [
45-
{
46-
"type": "git",
47-
"url": "https://github.com/10up/wp-compat-validation-tool.git"
48-
}
49-
],
5046
"extra": {
5147
"installer-paths": {
5248
"./{$name}/": ["10up/wp-compat-validation-tool"]

0 commit comments

Comments
 (0)