diff --git a/assets/js/src/settings.js b/assets/js/src/settings.js index 5e6b9da8..476333bd 100644 --- a/assets/js/src/settings.js +++ b/assets/js/src/settings.js @@ -128,29 +128,46 @@ import 'jquery-effects-shake'; } ); - Cache.add_btn.on( 'click', function() { - const newIp = Cache.empty_ip - .clone() - .appendTo( Cache.ip_list_wrap ); - newIp.removeAttr( 'id' ).slideDown( 250 ); - } ); + Cache.add_btn.on( + 'click', + function() { + const newIp = Cache.empty_ip + .clone() + .appendTo( Cache.ip_list_wrap ); + newIp.removeAttr( 'id' ).slideDown( 250 ); + } + ); - $( Cache.ip_list_wrap ).on( 'blur', '.ip.code', function() { - addIp( $( this ).val(), $( this ).next().val(), $( this ) ); - } ); + $( Cache.ip_list_wrap ).on( + 'blur', + '.ip.code', + function() { + addIp( $( this ).val(), $( this ).next().val(), $( this ) ); + } + ); const myipBtn = document.getElementById( 'rsa_myip' ); if ( null !== myipBtn ) { - $( myipBtn ).on( 'click', function() { - $( '.ip.code:last' ).val( $( this ).data( 'myip' ) ).blur(); - } ); + $( myipBtn ).on( + 'click', + function() { + $( '.ip.code:last' ).val( $( this ).data( 'myip' ) ).blur(); + } + ); } - $( Cache.ip_list_wrap ).on( 'click', '.remove_btn', function() { - $( this.parentNode ).slideUp( 250, function() { - $( this ).remove(); - } ); - } ); + $( Cache.ip_list_wrap ).on( + 'click', + '.remove_btn', + function() { + $( this.parentNode ).slideUp( + 250, + function() { + $( this ).remove(); + } + ); + } + ); } function addIp( ip, comment, obj ) { @@ -196,7 +213,9 @@ import 'jquery-effects-shake'; ); } - $( function() { - init(); - } ); + $( + function() { + init(); + } + ); }( window, jQuery ) ); diff --git a/composer.json b/composer.json index fc358467..82fe29c8 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,11 @@ "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "require-dev": { - "10up/phpcs-composer": "dev-master", "phpunit/phpunit": "9.6.33", - "yoast/phpunit-polyfills": "^4.0" + "yoast/phpunit-polyfills": "^4.0", + "wp-coding-standards/wpcs": "^3.0", + "automattic/vipwpcs": "^3.0", + "phpcompatibility/phpcompatibility-wp": "^3.0@dev" }, "scripts": { "test": "phpunit", @@ -22,10 +24,10 @@ "lint": "phpcs --extensions=php -s .", "lint-fix": "phpcbf --extensions=php .", "post-install-cmd": [ - "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator" + "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator restricted-site-access" ], "post-update-cmd": [ - "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator" + "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator restricted-site-access" ] }, "minimum-stability": "dev", @@ -37,16 +39,10 @@ "platform-check": false }, "require": { - "10up/wp-compat-validation-tool": "dev-trunk", + "10up/wp-compat-validation-tool": "0.4.0", "mlocati/ip-lib": "dev-master", "php": ">=7.4" }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/10up/wp-compat-validation-tool.git" - } - ], "extra": { "installer-paths": { "./{$name}/": ["10up/wp-compat-validation-tool"] diff --git a/composer.lock b/composer.lock index dd85ab1c..c1696664 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6fd370623dfabe05dfe3cc2d1cafc786", + "content-hash": "bd6ef2a6a7c8bc05287b1e62d483e407", "packages": [ { "name": "10up/wp-compat-validation-tool", - "version": "dev-trunk", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/10up/wp-compat-validation-tool.git", - "reference": "19a8c7c1d39d3a4c896aeeac8d42edd20b8d2317" + "reference": "803d75864699503da0ff64db9b4ba51ea94a316a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/10up/wp-compat-validation-tool/zipball/803d75864699503da0ff64db9b4ba51ea94a316a", + "reference": "803d75864699503da0ff64db9b4ba51ea94a316a", + "shasum": "" }, "require": { "composer/installers": "^2.2" @@ -26,6 +32,7 @@ "WP_Compat_Validation_Tool\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -39,7 +46,11 @@ ], "description": "Perform PHP and WP version compatibility checks in your plugin.", "homepage": "https://github.com/10up/wp-compat-validation-tool", - "time": "2023-11-09T18:48:23+00:00" + "support": { + "issues": "https://github.com/10up/wp-compat-validation-tool/issues", + "source": "https://github.com/10up/wp-compat-validation-tool/tree/0.4.0" + }, + "time": "2026-05-20T00:33:32+00:00" }, { "name": "composer/installers", @@ -261,73 +272,34 @@ } ], "packages-dev": [ - { - "name": "10up/phpcs-composer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/10up/phpcs-composer.git", - "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/4a2f47d5ed0493836ef33ee2edad32192699fad6", - "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6", - "shasum": "" - }, - "require": { - "automattic/vipwpcs": "^2.3", - "dealerdirect/phpcodesniffer-composer-installer": "*", - "phpcompatibility/phpcompatibility-wp": "^2", - "squizlabs/php_codesniffer": "3.7.1", - "wp-coding-standards/wpcs": "*" - }, - "default-branch": true, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "10up", - "homepage": "https://10up.com/" - } - ], - "description": "10up's PHP CodeSniffer Ruleset", - "support": { - "issues": "https://github.com/10up/phpcs-composer/issues", - "source": "https://github.com/10up/phpcs-composer/tree/2.0.1" - }, - "time": "2023-09-14T12:16:59+00:00" - }, { "name": "automattic/vipwpcs", - "version": "2.3.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6" + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", - "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "sirbrillig/phpcs-variable-analysis": "^2.11.17", - "squizlabs/php_codesniffer": "^3.7.1", - "wp-coding-standards/wpcs": "^2.3" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.11", + "sirbrillig/phpcs-variable-analysis": "^2.11.18", + "squizlabs/php_codesniffer": "^3.9.2", + "wp-coding-standards/wpcs": "^3.1.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7 || ^8 || ^9" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -352,33 +324,33 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2023-08-24T15:11:13+00:00" + "time": "2024-05-10T20:31:09+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.2", "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", + "composer/composer": "^2.2", "ext-json": "*", "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", @@ -397,9 +369,9 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", @@ -407,7 +379,6 @@ } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -428,9 +399,28 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-05-06T08:26:05+00:00" }, { "name": "doctrine/instantiator", @@ -743,33 +733,41 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "version": "10.0.0-alpha2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", + "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.1.2", + "squizlabs/php_codesniffer": "^3.13.3 || ^4.0" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "replace": { + "wimg/php-compatibility": "*" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.3", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.5.32 || ^11.3.3", + "yoast/phpunit-polyfills": "^1.1.5 || ^2.0.5 || ^3.1.0" }, "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev", + "dev-develop": "10.x-dev" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" @@ -791,44 +789,59 @@ } ], "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "homepage": "https://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2019-12-27T09:44:58+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-11-28T11:36:33+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.2", + "version": "2.0.0-alpha2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + "reference": "7a979711c87d8202b52f56c56bd719d09d8ed7f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/7a979711c87d8202b52f56c56bd719d09d8ed7f5", + "reference": "7a979711c87d8202b52f56c56bd719d09d8ed7f5", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0" + "phpcompatibility/php-compatibility": "^10.0@dev" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -856,34 +869,46 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2022-10-25T01:46:02+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-11-29T13:09:49+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", + "version": "3.0.0-alpha2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + "reference": "bd53f24e7528422ac51d64dc8d53e8d4c4a877b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/bd53f24e7528422ac51d64dc8d53e8d4c4a877b3", + "reference": "bd53f24e7528422ac51d64dc8d53e8d4c4a877b3", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "phpcompatibility/php-compatibility": "^10.0@dev", + "phpcompatibility/phpcompatibility-paragonie": "^2.0@dev" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -911,9 +936,205 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2022-10-24T09:00:36+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-12-16T13:35:20+00:00" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "7490cf849d1d68b75705e8eb000e3e89b2eea526" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/7490cf849d1d68b75705e8eb000e3e89b2eea526", + "reference": "7490cf849d1d68b75705e8eb000e3e89b2eea526", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.2.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "default-branch": true, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-04-06T00:54:57+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "0faa84f665c15116bc27ad6afe56e79b2f432f8f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/0faa84f665c15116bc27ad6afe56e79b2f432f8f", + "reference": "0faa84f665c15116bc27ad6afe56e79b2f432f8f", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + }, + "default-branch": true, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "phpcs4", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-04-21T22:07:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2375,27 +2596,24 @@ "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "191ed14c00358f5cb4c286c3e9137510f52ff5c0" + "reference": "bcdfa62fc1c4764a7af0bc7723af9f5cc70447b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/191ed14c00358f5cb4c286c3e9137510f52ff5c0", - "reference": "191ed14c00358f5cb4c286c3e9137510f52ff5c0", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bcdfa62fc1c4764a7af0bc7723af9f5cc70447b0", + "reference": "bcdfa62fc1c4764a7af0bc7723af9f5cc70447b0", "shasum": "" }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.6" + "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", - "phpcsstandards/phpcsdevcs": "^1.1", - "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpstan/phpstan": "^1.7 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0 || ^6.0 || ^7.0" }, - "default-branch": true, "type": "phpcodesniffer-standard", "autoload": { "psr-4": { @@ -2426,20 +2644,20 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-09-13T17:22:00+00:00" + "time": "2026-03-20T22:22:31+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.x-dev", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "fc6c9f7bf8fc4a45498896782cd1ef32c5924f3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/fc6c9f7bf8fc4a45498896782cd1ef32c5924f3d", + "reference": "fc6c9f7bf8fc4a45498896782cd1ef32c5924f3d", "shasum": "" }, "require": { @@ -2449,18 +2667,13 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2468,21 +2681,49 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-04-21T22:11:30+00:00" }, { "name": "theseer/tokenizer", @@ -2536,30 +2777,38 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.4" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -2576,6 +2825,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -2583,7 +2833,13 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2020-05-13T23:57:56+00:00" + "funding": [ + { + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" + } + ], + "time": "2025-11-25T12:08:04+00:00" }, { "name": "yoast/phpunit-polyfills", @@ -2652,9 +2908,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "10up/phpcs-composer": 20, - "10up/wp-compat-validation-tool": 20, - "mlocati/ip-lib": 20 + "mlocati/ip-lib": 20, + "phpcompatibility/phpcompatibility-wp": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index d9cc687f..00000000 --- a/phpcs.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - A custom set of rules to check for the Restricted Site Access project. - - - - - /vendor/* - /10up-lib/* - - - /node_modules/* - - - *.min.js - - - assets - - tests/php/bootstrap.php - - - - - - - - tests - - - - tests - - - - tests - - - - - - \ No newline at end of file diff --git a/phpcs.xml.dist b/phpcs.xml.dist index a21c76d7..6faced3e 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,24 +1,36 @@ + + + + + + + + + - - + + + - - + + + + + + + + - . - ^tests/* - ^vendor/* + + - - - - - + . + */10up-lib/wp-compat-validation-tool/* + */assets/js/build/* + */node_modules/* + */tests/* + */vendor/* diff --git a/restricted_site_access.php b/restricted_site_access.php index ac367b08..6eaebcaa 100644 --- a/restricted_site_access.php +++ b/restricted_site_access.php @@ -18,7 +18,7 @@ return; } -require_once '10up-lib/wp-compat-validation-tool/src/Validator.php'; +require_once __DIR__ . '/10up-lib/wp-compat-validation-tool/src/Validator.php'; $compat_checker = new \RSA_Validator\Validator(); $compat_checker @@ -36,7 +36,7 @@ if ( ! class_exists( 'IPLib\\Factory' ) ) { add_action( 'admin_notices', - function() { + function () { ?>

@@ -67,7 +67,7 @@ class Restricted_Site_Access { /** * Plugin basename. * - * @var array $basename The plugin base name. + * @var string $basename The plugin base name. */ private static $basename; @@ -81,7 +81,7 @@ class Restricted_Site_Access { /** * Settings page slug. * - * @var array $settings_page The settings page slug. + * @var string $settings_page The settings page slug. */ private static $settings_page = 'reading'; @@ -146,7 +146,7 @@ public static function add_actions() { add_action( 'activate_' . self::$basename, array( __CLASS__, 'activation' ), 10, 1 ); add_action( 'deactivate_' . self::$basename, array( __CLASS__, 'deactivation' ), 10, 1 ); - add_action( 'wpmu_new_blog', array( __CLASS__, 'set_defaults' ), 10, 6 ); + add_action( 'wpmu_new_blog', array( __CLASS__, 'set_defaults' ) ); add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_admin_script' ) ); add_action( 'wp_ajax_rsa_notice_dismiss', array( __CLASS__, 'ajax_notice_dismiss' ) ); @@ -156,7 +156,7 @@ public static function add_actions() { add_filter( 'pre_site_option_blog_public', array( __CLASS__, 'pre_option_blog_public' ), 10, 1 ); add_filter( 'application_password_is_api_request', array( __CLASS__, 'is_api_request' ) ); - // Hide admin bar for selected user roles. + // phpcs:ignore WordPressVIPMinimum.UserExperience.AdminBarRemoval.RemovalDetected -- Hide admin bar for selected user roles. add_filter( 'show_admin_bar', array( __CLASS__, 'hide_admin_bar_for_roles' ), 10, 1 ); // Prevent WordPress from auto-resolving 404 URLs. @@ -300,14 +300,9 @@ public static function ajax_notice_dismiss() { /** * Set RSA defaults for new site. * - * @param int $blog_id Blog ID. - * @param int $user_id User ID. - * @param string $domain Site domain. - * @param string $path Site path. - * @param int $site_id Site ID. Only relevant on multi-network installs. - * @param array $meta Meta data. Used to set initial site options. + * @param int $blog_id New site/blog ID. */ - public static function set_defaults( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { + public static function set_defaults( $blog_id ) { if ( 'enforce' === self::get_network_mode() ) { return; } @@ -315,6 +310,7 @@ public static function set_defaults( $blog_id, $user_id, $domain, $path, $site_i $network_options = self::get_options( true ); $blog_public = get_site_option( 'blog_public', 2 ); + // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog -- Only used to set options/change DB prefix. switch_to_blog( $blog_id ); update_option( 'rsa_options', self::sanitize_options( $network_options ) ); update_option( 'blog_public', (int) $blog_public ); @@ -380,7 +376,7 @@ protected static function populate_fields_array() { * @return string */ private static function get_config_network_mode() { - /** + /* * Get the network mode from the RSA_NETWORK_MODE constant. * Only allow 'enforce' or 'default'. */ @@ -395,7 +391,7 @@ private static function get_config_network_mode() { * Get current plugin network mode */ private static function get_network_mode() { - /** + /* * Get the network mode from the RSA_NETWORK_MODE constant. * Only allow 'enforce' or 'default'. */ @@ -560,7 +556,7 @@ public static function restrict_access( $wp ) { $request_uri = self::get_request_uri( $wp ); if ( is_array( $results ) && ! empty( $results ) ) { - /** + /* * This conditional prevents a redirect loop if the redirect URL * belongs to the same domain. */ @@ -581,6 +577,7 @@ public static function restrict_access( $wp ) { if ( ! filter_var( $results['url'], FILTER_VALIDATE_URL ) ) { $results['url'] = home_url( $results['url'] ); } + // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie -- This cookie is necessary to prevent redirection loops, caching handled. setcookie( 'wp-rsa_redirect', self::generate_redirection_cookie( $results['url'] ), 0, $cookie_path ); } } @@ -737,11 +734,11 @@ public static function restrict_access_check( $wp ) { case 2: if ( ! empty( self::$rsa_options['redirect_url'] ) ) { if ( ! empty( self::$rsa_options['redirect_path'] ) ) { - /** + /* * This conditional prevents a redirect loop if the redirect URL * belongs to the same domain. */ - // phpcs:ignore WordPress.Security.NonceVerification.Recommended + // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE -- This cookie is necessary to prevent redirection loops, caching handled. if ( isset( $_COOKIE['wp-rsa_redirect'] ) && self::generate_redirection_cookie( home_url( $request_uri ) ) === $_COOKIE['wp-rsa_redirect'] ) { self::$rsa_options['redirect_url'] = home_url( $request_uri ); } else { @@ -1117,12 +1114,13 @@ public static function enqueue_settings_script() { $script_path = 'assets/js/build/settings.min.js'; $script_asset_path = plugin_dir_path( __FILE__ ) . 'assets/js/build/settings.min.asset.php'; $script_asset = file_exists( $script_asset_path ) + // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable -- file_exists check ensures this is safe. ? require $script_asset_path : array( 'dependencies' => array(), 'version' => filemtime( $script_path ), ); - $script_url = plugins_url( $script_path, __FILE__ ); + $script_url = plugins_url( $script_path, __FILE__ ); wp_enqueue_script( 'rsa-settings', $script_url, $script_asset['dependencies'], $script_asset['version'], true ); @@ -1148,12 +1146,13 @@ public static function enqueue_admin_script() { $script_path = 'assets/js/build/admin.min.js'; $script_asset_path = plugin_dir_path( __FILE__ ) . 'assets/js/build/admin.min.asset.php'; $script_asset = file_exists( $script_asset_path ) + // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable -- file_exists check ensures this is safe. ? require $script_asset_path : array( 'dependencies' => array(), 'version' => filemtime( $script_path ), ); - $script_url = plugins_url( $script_path, __FILE__ ); + $script_url = plugins_url( $script_path, __FILE__ ); wp_enqueue_script( 'rsa-admin', $script_url, $script_asset['dependencies'], $script_asset['version'], true ); @@ -1450,6 +1449,7 @@ public static function blog_privacy_selector() { * @return array Sanitized input */ public static function sanitize_options( $input ) { + $new_input = array(); $new_input['approach'] = (int) $input['approach']; if ( $new_input['approach'] < 1 || $new_input['approach'] > 4 ) { $new_input['approach'] = self::$fields['approach']['default']; @@ -1590,7 +1590,7 @@ public static function settings_field_allowed() {

- +

@@ -1895,6 +1895,7 @@ public static function activation( $network_active ) { $sites = get_sites(); foreach ( $sites as $site ) { + // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog -- Only used to get/set options/change DB prefix. switch_to_blog( $site->blog_id ); if ( ! get_option( 'rsa_activation_version', false ) && ! get_option( 'rsa_options', false ) ) { @@ -1924,6 +1925,7 @@ public static function deactivation( $network_active ) { $sites = get_sites(); foreach ( $sites as $site ) { + // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog -- Only used to get/set options/change DB prefix. switch_to_blog( $site->blog_id ); if ( 2 === (int) get_option( 'blog_public' ) ) { @@ -1953,7 +1955,6 @@ public static function is_network( $plugin ) { } return false; - } /** @@ -2188,7 +2189,7 @@ public static function add_ips( $ips ) { $allowed_ips[] = $ip; $comments[] = $i !== $label ? sanitize_text_field( $label ) : ''; } - $i++; + ++$i; } if ( self::$rsa_options['allowed'] !== $allowed_ips ) { @@ -2279,7 +2280,7 @@ public static function update_ip_or_label( $ip = false, $new_ip = false, $new_la $comments = (array) self::$rsa_options['comment']; $ip_index = -1; - /** + /* * Get the index of the ip address that needs * to be updated. */ @@ -2290,21 +2291,21 @@ public static function update_ip_or_label( $ip = false, $new_ip = false, $new_la } } - /** + /* * Return if `$ip` not found. */ if ( -1 === $ip_index ) { return new WP_Error( 'ip_address_does_not_exist', __( "The IP address doesn't exist.", 'restricted-site-access' ) ); } - /** + /* * Return if the format of `$new_ip` is invalid. */ if ( false !== $new_ip && ! self::is_ip( $new_ip ) ) { return new WP_Error( 'ip_address_is_invalid', __( 'The new IP address format is incorrect.', 'restricted-site-access' ) ); } - /** + /* * Return status code 2 if `$ip` doesn't exist in * `$allowed_ips` array. */ @@ -2312,14 +2313,14 @@ public static function update_ip_or_label( $ip = false, $new_ip = false, $new_la return new WP_Error( 'ip_address_already_exists', __( 'The IP address already exists.', 'restricted-site-access' ) ); } - /** + /* * Add `$new_ip` to the `$allowed_ips` array. */ if ( false !== $new_ip ) { $allowed_ips[ $ip_index ] = $new_ip; } - /** + /* * Add `$new_label` to the `$comments` array. */ if ( false !== $new_label ) { @@ -2390,7 +2391,7 @@ public static function set_ips( $ips ) { $allowed_ips[] = $ip; $comments[] = $i !== $label ? sanitize_text_field( $label ) : ''; } - $i++; + ++$i; } if ( self::$rsa_options['allowed'] !== $allowed_ips ) { @@ -2449,6 +2450,7 @@ function restricted_site_access_uninstall() { $sites = get_sites(); foreach ( $sites as $site ) { + // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog -- Only used to get/set options/change DB prefix. switch_to_blog( $site->blog_id ); if ( 2 === (int) get_option( 'blog_public' ) ) { diff --git a/webpack.config.js b/webpack.config.js index b6518868..b442e773 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,6 @@ const DependencyExtractionWebpackPlugin = require( '@wordpress/dependency-extraction-webpack-plugin' ); -const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); -const path = require( 'path' ); +const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); +const path = require( 'path' ); module.exports = { ...defaultConfig, @@ -15,16 +15,18 @@ module.exports = { }, plugins: [ ...defaultConfig.plugins, - new DependencyExtractionWebpackPlugin( { - requestToExternal( request ) { - if ( 'jquery-effects-shake' === request ) { - return 'jquery-effects-shake'; - } + new DependencyExtractionWebpackPlugin( + { + requestToExternal( request ) { + if ( 'jquery-effects-shake' === request ) { + return 'jquery-effects-shake'; + } - if ( 'jquery-ui-dialog' === request ) { - return 'jquery-ui-dialog'; - } - }, - } ), + if ( 'jquery-ui-dialog' === request ) { + return 'jquery-ui-dialog'; + } + }, + } + ), ], }; diff --git a/wp-cli.php b/wp-cli.php index cdf245d9..e7f6c88b 100644 --- a/wp-cli.php +++ b/wp-cli.php @@ -266,9 +266,8 @@ public function set_mode( $args, $assoc_args ) { * @subcommand set-network-mode * * @param array $args Array with single value of what mode to set. - * @param array $assoc_args Associative arguments. Not used. */ - public function set_network_mode( $args, $assoc_args ) { + public function set_network_mode( $args ) { if ( ! RSA_IS_NETWORK ) { WP_CLI::error( __( 'Cannot set network mode when plugin not activated on network.', 'restricted-site-access' ) ); } @@ -391,7 +390,7 @@ public function ip_list( $args, $assoc_args ) { public function ip_add( $args, $assoc_args ) { $this->setup( $args, $assoc_args ); - /** + /* * The input arguments can be of the form: * wp rsa ip-add 8.8.8.8=Google 9.9.9.9 1.1.1.1=Cloudflare. * @@ -415,9 +414,9 @@ public function ip_add( $args, $assoc_args ) { * ) */ $ips_and_labels_array = array(); - foreach ( $args as $index => $item ) { + foreach ( $args as $item ) { $fragments = explode( '=', $item ); - /** + /* * If the IP doesn't have a corressponding label, * then set label to '[null]:x', where 'x' is an * integer. @@ -434,18 +433,18 @@ public function ip_add( $args, $assoc_args ) { $ips_and_labels_array[] = $structure_ip_label_array; } - /** + /* * Get all whitelisted IPs saved in DB. */ $current_ips = $this->get_current_ips(); - /** + /* * This will only hold those input IP addresses * which are not already whitelisted. */ $filtered_ips_and_labels = array(); - /** + /* * A simple for loop to filter the input IP addresses. */ foreach ( $ips_and_labels_array as $ip_label_pair ) { @@ -457,12 +456,12 @@ public function ip_add( $args, $assoc_args ) { } } - /** + /* * Extract all IP address from the filtered array * as an indexed array. */ $new_ips = array_map( - function( $ip_label_pair ) { + function ( $ip_label_pair ) { return $ip_label_pair['ip']; }, $filtered_ips_and_labels