diff --git a/.gitignore b/.gitignore index ca896325..75cedab8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ screenshots assets/js/build .wp-env.override.json .idea +10up-lib tests/cypress/screenshots tests/cypress/videos diff --git a/composer.json b/composer.json index e842d681..1955ac8e 100644 --- a/composer.json +++ b/composer.json @@ -20,24 +20,36 @@ "test": "phpunit", "test:acceptance": "wpacceptance run", "lint": "phpcs --extensions=php -s .", - "lint-fix": "phpcbf --extensions=php ." + "lint-fix": "phpcbf --extensions=php .", + "post-install-cmd": [ + "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator" + ], + "post-update-cmd": [ + "./10up-lib/wp-compat-validation-tool/replace-namespace.sh RSA_Validator" + ] }, "minimum-stability": "dev", "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "composer/installers": true }, "platform-check": false }, "require": { + "10up/wp-compat-validation-tool": "dev-trunk", "mlocati/ip-lib": "dev-master", - "siddharth/wp-compat-checker": "dev-master", "php": ">=7.4" }, "repositories": [ { "type": "git", - "url": "https://github.com/Sidsector9/wp-compat-checker.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 7befdc0f..85836dbd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,201 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0dd4e7ba0a6791c2cd6062c426a6bff3", + "content-hash": "1c8b0edbac56d1b1b7be0c34d8e31eff", "packages": [ + { + "name": "10up/wp-compat-validation-tool", + "version": "dev-trunk", + "source": { + "type": "git", + "url": "https://github.com/10up/wp-compat-validation-tool.git", + "reference": "bb0d2a3f0e6c9e3df5f95c366abcaeaf2e1a05d3" + }, + "require": { + "composer/installers": "^2.2" + }, + "type": "wordpress-plugin", + "extra": { + "installer-name": "10up-lib/wp-compat-validation-tool" + }, + "autoload": { + "psr-4": { + "WP_Compat_Validation_Tool\\": "src/" + } + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "10up", + "email": "opensource@10up.com", + "homepage": "https://10up.com", + "role": "Developer" + } + ], + "description": "Perform PHP and WP version compatibility checks in your plugin.", + "homepage": "https://github.com/10up/wp-compat-validation-tool", + "time": "2023-10-25T13:12:17+00:00" + }, + { + "name": "composer/installers", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe", + "reference": "2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^5.3", + "symfony/process": "^5" + }, + "default-branch": true, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "2.x-dev" + }, + "plugin-modifies-install-path": true + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "matomo", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "tastyigniter", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/main" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-10-12T12:07:30+00:00" + }, { "name": "mlocati/ip-lib", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/mlocati/ip-lib.git", - "reference": "6fec056ea3ca0657ceec59db64edaa835f119be3" + "reference": "a2c0e36416a814ca164d873da77b19f6e7749aef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mlocati/ip-lib/zipball/6fec056ea3ca0657ceec59db64edaa835f119be3", - "reference": "6fec056ea3ca0657ceec59db64edaa835f119be3", + "url": "https://api.github.com/repos/mlocati/ip-lib/zipball/a2c0e36416a814ca164d873da77b19f6e7749aef", + "reference": "a2c0e36416a814ca164d873da77b19f6e7749aef", "shasum": "" }, "require": { @@ -76,24 +257,7 @@ "type": "other" } ], - "time": "2022-11-04T21:44:49+00:00" - }, - { - "name": "siddharth/wp-compat-checker", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Sidsector9/wp-compat-checker.git", - "reference": "f3293ab4dbe3adde8b3ed5ddb42b7cc10c7b3635" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "WP_Compat_Checker\\": "src/" - } - }, - "time": "2023-08-03T18:38:53+00:00" + "time": "2023-10-16T17:11:38+00:00" } ], "packages-dev": [ @@ -103,12 +267,12 @@ "source": { "type": "git", "url": "https://github.com/10up/phpcs-composer.git", - "reference": "9c085cf0554a0b5311623548663aa9e4d8f52587" + "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/9c085cf0554a0b5311623548663aa9e4d8f52587", - "reference": "9c085cf0554a0b5311623548663aa9e4d8f52587", + "url": "https://api.github.com/repos/10up/phpcs-composer/zipball/4a2f47d5ed0493836ef33ee2edad32192699fad6", + "reference": "4a2f47d5ed0493836ef33ee2edad32192699fad6", "shasum": "" }, "require": { @@ -126,40 +290,41 @@ ], "authors": [ { - "name": "Ephraim Gregor", - "email": "ephraim.gregor@10up.com" + "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/master" + "source": "https://github.com/10up/phpcs-composer/tree/2.0.1" }, - "time": "2023-05-10T22:44:49+00:00" + "time": "2023-09-14T12:16:59+00:00" }, { "name": "automattic/vipwpcs", - "version": "2.3.3", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b" + "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", - "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", + "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7", + "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.1", - "squizlabs/php_codesniffer": "^3.5.5", + "sirbrillig/phpcs-variable-analysis": "^2.11.17", + "squizlabs/php_codesniffer": "^3.7.1", "wp-coding-standards/wpcs": "^2.3" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^0.5", - "php-parallel-lint/php-parallel-lint": "^1.0", + "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" @@ -179,6 +344,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -186,39 +352,42 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2021-09-29T16:20:23+00:00" + "time": "2023-08-24T15:11:13+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", + "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -234,7 +403,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -258,10 +427,10 @@ "tests" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2022-02-04T12:51:07+00:00" + "time": "2023-01-05T11:28:13+00:00" }, { "name": "doctrine/deprecations", @@ -269,12 +438,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "bdaa697ed9c7f5ee2f7d3b5f9c2a6f2519523cd9" + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/bdaa697ed9c7f5ee2f7d3b5f9c2a6f2519523cd9", - "reference": "bdaa697ed9c7f5ee2f7d3b5f9c2a6f2519523cd9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", "shasum": "" }, "require": { @@ -307,9 +476,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.x" + "source": "https://github.com/doctrine/deprecations/tree/1.1.2" }, - "time": "2023-07-29T16:12:19+00:00" + "time": "2023-09-27T20:04:15+00:00" }, { "name": "doctrine/instantiator", @@ -448,12 +617,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "cfc54e30a4f5e5af5f9d9ce86697cfcc5f7e7c24" + "reference": "54103d838734be0499172026525e38cbf6af2711" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/cfc54e30a4f5e5af5f9d9ce86697cfcc5f7e7c24", - "reference": "cfc54e30a4f5e5af5f9d9ce86697cfcc5f7e7c24", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/54103d838734be0499172026525e38cbf6af2711", + "reference": "54103d838734be0499172026525e38cbf6af2711", "shasum": "" }, "require": { @@ -464,7 +633,6 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "default-branch": true, "bin": [ "bin/php-parse" ], @@ -497,7 +665,7 @@ "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/4.x" }, - "time": "2023-07-30T21:38:32+00:00" + "time": "2023-10-03T21:00:18+00:00" }, { "name": "phar-io/manifest", @@ -851,12 +1019,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "7b217217725dc991a0ae7b995041cee1d5019561" + "reference": "c86c8d449b863bdaed15861a32dc4c50f8e3a832" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/7b217217725dc991a0ae7b995041cee1d5019561", - "reference": "7b217217725dc991a0ae7b995041cee1d5019561", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/c86c8d449b863bdaed15861a32dc4c50f8e3a832", + "reference": "c86c8d449b863bdaed15861a32dc4c50f8e3a832", "shasum": "" }, "require": { @@ -907,7 +1075,7 @@ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2023-03-12T10:50:44+00:00" + "time": "2023-10-13T06:34:03+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -915,12 +1083,12 @@ "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "07100e65d09fd50608d649fc656cae1c921a2495" + "reference": "181f43ae2f4afbbdd9426dc0fd8db0444439a033" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/07100e65d09fd50608d649fc656cae1c921a2495", - "reference": "07100e65d09fd50608d649fc656cae1c921a2495", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/181f43ae2f4afbbdd9426dc0fd8db0444439a033", + "reference": "181f43ae2f4afbbdd9426dc0fd8db0444439a033", "shasum": "" }, "require": { @@ -966,7 +1134,7 @@ "issues": "https://github.com/phpDocumentor/TypeResolver/issues", "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.x" }, - "time": "2023-07-20T19:57:33+00:00" + "time": "2023-10-13T06:37:27+00:00" }, { "name": "phpspec/prophecy", @@ -974,12 +1142,12 @@ "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "e0ae0992aafbc5dee4337a700a44a8d04fbd2ccf" + "reference": "098f8850e4bd800b7734c65b2c8c10b28d87f10e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e0ae0992aafbc5dee4337a700a44a8d04fbd2ccf", - "reference": "e0ae0992aafbc5dee4337a700a44a8d04fbd2ccf", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/098f8850e4bd800b7734c65b2c8c10b28d87f10e", + "reference": "098f8850e4bd800b7734c65b2c8c10b28d87f10e", "shasum": "" }, "require": { @@ -1026,6 +1194,7 @@ "keywords": [ "Double", "Dummy", + "dev", "fake", "mock", "spy", @@ -1035,20 +1204,20 @@ "issues": "https://github.com/phpspec/prophecy/issues", "source": "https://github.com/phpspec/prophecy/tree/master" }, - "time": "2023-06-21T12:00:53+00:00" + "time": "2023-08-31T13:58:35+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.23.x-dev", + "version": "1.24.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" + "reference": "bcad8d995980440892759db0c32acae7c8e79442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", - "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", + "reference": "bcad8d995980440892759db0c32acae7c8e79442", "shasum": "" }, "require": { @@ -1065,7 +1234,6 @@ "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -1081,9 +1249,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" }, - "time": "2023-08-03T16:32:59+00:00" + "time": "2023-09-26T12:28:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1091,12 +1259,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9e1baee3a7525530f5600035759ce754a8b3750b" + "reference": "a941554183490e17580945faf64d46bc4faf97e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9e1baee3a7525530f5600035759ce754a8b3750b", - "reference": "9e1baee3a7525530f5600035759ce754a8b3750b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a941554183490e17580945faf64d46bc4faf97e2", + "reference": "a941554183490e17580945faf64d46bc4faf97e2", "shasum": "" }, "require": { @@ -1161,7 +1329,7 @@ "type": "github" } ], - "time": "2023-08-02T09:00:29+00:00" + "time": "2023-10-20T08:36:13+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2477,12 +2645,12 @@ "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "002ae3ab4ca052823c676de4ec7503e96aaf5a35" + "reference": "191ed14c00358f5cb4c286c3e9137510f52ff5c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/002ae3ab4ca052823c676de4ec7503e96aaf5a35", - "reference": "002ae3ab4ca052823c676de4ec7503e96aaf5a35", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/191ed14c00358f5cb4c286c3e9137510f52ff5c0", + "reference": "191ed14c00358f5cb4c286c3e9137510f52ff5c0", "shasum": "" }, "require": { @@ -2528,7 +2696,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-07-19T00:44:18+00:00" + "time": "2023-09-13T17:22:00+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2751,12 +2919,12 @@ "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "f4c425a8aae6c1f2d448289b42311d58af5ff7a4" + "reference": "f1f7e15daf4f0e7225757ff902322df6d47c1385" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/f4c425a8aae6c1f2d448289b42311d58af5ff7a4", - "reference": "f4c425a8aae6c1f2d448289b42311d58af5ff7a4", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/f1f7e15daf4f0e7225757ff902322df6d47c1385", + "reference": "f1f7e15daf4f0e7225757ff902322df6d47c1385", "shasum": "" }, "require": { @@ -2803,14 +2971,14 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-06-06T15:51:44+00:00" + "time": "2023-09-27T10:45:26+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { + "10up/wp-compat-validation-tool": 20, "mlocati/ip-lib": 20, - "siddharth/wp-compat-checker": 20, "10up/phpcs-composer": 20, "yoast/phpunit-polyfills": 20 }, @@ -2820,5 +2988,5 @@ "php": ">=7.4" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.6.0" } diff --git a/restricted_site_access.php b/restricted_site_access.php index ccd69ef3..d12feda1 100644 --- a/restricted_site_access.php +++ b/restricted_site_access.php @@ -14,18 +14,26 @@ */ // Try and include our autoloader. +if ( ! is_readable( __DIR__ . '/10up-lib/wp-compat-validation-tool/src/Validator.php' ) ) { + return; +} + +require_once '10up-lib/wp-compat-validation-tool/src/Validator.php'; + +$compat_checker = new \RSA_Validator\Validator(); +$compat_checker + ->set_plugin_name( 'Restricted Site Access' ) + ->set_php_min_required_version( '7.4' ); + +if ( ! $compat_checker->is_plugin_compatible() ) { + return; +} + if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; +} - $compat_checker = new \WP_Compat_Checker\WP_Compat_Checker(); - $compat_checker - ->set_plugin_name( 'Restricted Site Access' ) - ->set_php_min_required_version( '7.4' ); - - if ( ! $compat_checker->is_plugin_compatible() ) { - return; - } -} elseif ( ! class_exists( 'IPLib\\Factory' ) ) { +if ( ! class_exists( 'IPLib\\Factory' ) ) { add_action( 'admin_notices', function() { diff --git a/tests/php/bootstrap.php b/tests/php/bootstrap.php index 8e6d367b..26b50c06 100644 --- a/tests/php/bootstrap.php +++ b/tests/php/bootstrap.php @@ -32,6 +32,7 @@ public function bootstrap() { // Give access to tests_add_filter() function. require_once $_tests_dir . '/includes/functions.php'; + require_once WP_PLUGIN_DIR . '/10up-lib/wp-compat-validation-tool/src/Validator.php'; /** * Manually load the plugin being tested.