diff --git a/composer.json b/composer.json index 13d36a76c..976c4aa04 100644 --- a/composer.json +++ b/composer.json @@ -7,9 +7,8 @@ "php": ">=5.6", "composer/installers": "^v1.12.0 || ^2.2", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", - "wp-coding-standards/wpcs": "dev-develop#fca9d9e as 2.3.0", - "automattic/vipwpcs": "2.3.3", - "cweagans/composer-patches": "^1.7" + "wp-coding-standards/wpcs": "3.0.0", + "automattic/vipwpcs": "dev-develop#64aa799 as 2.3.4" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.1", @@ -39,20 +38,12 @@ "dealerdirect/phpcodesniffer-composer-installer": true, "composer/installers": true, "phpstan/extension-installer": true, - "cweagans/composer-patches": true + "cweagans/composer-patches": false }, "platform": { "php": "5.6.20" } }, - "extra": { - "enable-patching": true, - "patches": { - "automattic/vipwpcs": { - "Fix incompatablity wp-coding-standards/wpcs": "patches/remove-rules.patch" - } - } - }, "autoload": { "psr-4": { "WordPress\\Plugin_Check\\": "includes/" diff --git a/composer.lock b/composer.lock index 565f2040a..90ace644c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,36 +4,38 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bba8b71a73452397be8ca463dcb3388e", + "content-hash": "333a5e08a7ab235faa8f4f04df7604f5", "packages": [ { "name": "automattic/vipwpcs", - "version": "2.3.3", + "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b" + "reference": "64aa799" }, "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/64aa799", + "reference": "64aa799", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7", "php": ">=5.4", - "sirbrillig/phpcs-variable-analysis": "^2.11.1", - "squizlabs/php_codesniffer": "^3.5.5", - "wp-coding-standards/wpcs": "^2.3" + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", + "sirbrillig/phpcs-variable-analysis": "^2.11.17", + "squizlabs/php_codesniffer": "^3.7.2", + "wp-coding-standards/wpcs": "^3.0" }, "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" }, + "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -49,6 +51,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -56,7 +59,7 @@ "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-26T08:01:08+00:00" }, { "name": "composer/installers", @@ -209,85 +212,40 @@ ], "time": "2021-09-13T08:19:44+00:00" }, - { - "name": "cweagans/composer-patches", - "version": "1.7.3", - "source": { - "type": "git", - "url": "https://github.com/cweagans/composer-patches.git", - "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", - "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "~1.0 || ~2.0", - "phpunit/phpunit": "~4.6" - }, - "type": "composer-plugin", - "extra": { - "class": "cweagans\\Composer\\Patches" - }, - "autoload": { - "psr-4": { - "cweagans\\Composer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Cameron Eagans", - "email": "me@cweagans.net" - } - ], - "description": "Provides a way to patch Composer packages.", - "support": { - "issues": "https://github.com/cweagans/composer-patches/issues", - "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" - }, - "time": "2022-12-20T22:53: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/", @@ -303,7 +261,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", @@ -327,28 +285,28 @@ "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": "phpcsstandards/phpcsextra", - "version": "1.0.4", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "029af41e270ae73f10c0e9a1ce376b12da4e4810" + "reference": "98bcdbacbda14b1db85f710b1853125726795bbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/029af41e270ae73f10c0e9a1ce376b12da4e4810", - "reference": "029af41e270ae73f10c0e9a1ce376b12da4e4810", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/98bcdbacbda14b1db85f710b1853125726795bbc", + "reference": "98bcdbacbda14b1db85f710b1853125726795bbc", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.6", + "phpcsstandards/phpcsutils": "^1.0.8", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { @@ -393,20 +351,20 @@ "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, - "time": "2023-06-17T22:57:40+00:00" + "time": "2023-08-26T04:46:45+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.6", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "ba259eaaefac118648e1263919b9530667ffcf01" + "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/ba259eaaefac118648e1263919b9530667ffcf01", - "reference": "ba259eaaefac118648e1263919b9530667ffcf01", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", + "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", "shasum": "" }, "require": { @@ -419,7 +377,7 @@ "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.0.5" + "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -466,20 +424,20 @@ "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", "source": "https://github.com/PHPCSStandards/PHPCSUtils" }, - "time": "2023-05-27T13:39:12+00:00" + "time": "2023-07-16T21:39:41+00:00" }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.16", + "version": "v2.11.17", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88" + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/dc5582dc5a93a235557af73e523c389aac9a8e88", - "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049", + "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049", "shasum": "" }, "require": { @@ -524,7 +482,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-03-31T16:46:32+00:00" + "time": "2023-08-05T23:46:11+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -585,23 +543,26 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "dev-develop", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "fca9d9e" + "reference": "bb792cb331472b82c5d7f28fb9b8ec2d20f68826" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/fca9d9e", - "reference": "fca9d9e", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bb792cb331472b82c5d7f28fb9b8ec2d20f68826", + "reference": "bb792cb331472b82c5d7f28fb9b8ec2d20f68826", "shasum": "" }, "require": { "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.0", - "phpcsstandards/phpcsutils": "^1.0.5", + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { @@ -612,9 +573,9 @@ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { + "ext-iconv": "For improved results", "ext-mbstring": "For improved results" }, - "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -638,7 +599,7 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2023-06-20T15:25:34+00:00" + "time": "2023-08-21T14:28:38+00:00" } ], "packages-dev": [ @@ -2175,16 +2136,16 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.2.0", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "3b7ab767dde017dec9327cc024e9f26fd776a57b" + "reference": "4797791a311c41d213027333e4fcc48073f77df0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/3b7ab767dde017dec9327cc024e9f26fd776a57b", - "reference": "3b7ab767dde017dec9327cc024e9f26fd776a57b", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/4797791a311c41d213027333e4fcc48073f77df0", + "reference": "4797791a311c41d213027333e4fcc48073f77df0", "shasum": "" }, "type": "library", @@ -2219,20 +2180,20 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2023-03-30T01:15:51+00:00" + "time": "2023-08-09T01:26:57+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { @@ -2279,20 +2240,20 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-03-30T23:39:05+00:00" + "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [ { - "package": "wp-coding-standards/wpcs", + "package": "automattic/vipwpcs", "version": "dev-develop", - "alias": "2.3.0", - "alias_normalized": "2.3.0.0" + "alias": "2.3.4", + "alias_normalized": "2.3.4.0" } ], "minimum-stability": "stable", "stability-flags": { - "wp-coding-standards/wpcs": 20 + "automattic/vipwpcs": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/patches/remove-rules.patch b/patches/remove-rules.patch deleted file mode 100644 index 5e2a1a48e..000000000 --- a/patches/remove-rules.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml -index 2ce2511..dd306ca 100644 ---- a/WordPressVIPMinimum/ruleset.xml -+++ b/WordPressVIPMinimum/ruleset.xml -@@ -26,8 +26,6 @@ - - - -- -- - - - diff --git a/tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php b/tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php index 1aa95fed1..a3db7d019 100644 --- a/tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php +++ b/tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php @@ -24,23 +24,23 @@ public function test_run_with_errors() { $this->assertArrayHasKey( 'load.php', $warnings ); $this->assertEquals( 3, $check_result->get_warning_count() ); - // Check for WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn error. + // Check for WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in error. $this->assertArrayHasKey( 24, $warnings['load.php'] ); $this->assertArrayHasKey( 9, $warnings['load.php'][24] ); $this->assertArrayHasKey( 'code', $warnings['load.php'][24][9][0] ); - $this->assertEquals( 'WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn', $warnings['load.php'][24][9][0]['code'] ); + $this->assertEquals( 'WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in', $warnings['load.php'][24][9][0]['code'] ); // Check for WordPress.DB.SlowDBQuery.slow_db_query_meta_query warning. $this->assertArrayHasKey( 27, $warnings['load.php'] ); - $this->assertArrayHasKey( 26, $warnings['load.php'][27] ); - $this->assertArrayHasKey( 'code', $warnings['load.php'][27][26][0] ); - $this->assertEquals( 'WordPress.DB.SlowDBQuery.slow_db_query_meta_query', $warnings['load.php'][27][26][0]['code'] ); + $this->assertArrayHasKey( 9, $warnings['load.php'][27] ); + $this->assertArrayHasKey( 'code', $warnings['load.php'][27][9][0] ); + $this->assertEquals( 'WordPress.DB.SlowDBQuery.slow_db_query_meta_query', $warnings['load.php'][27][9][0]['code'] ); // Check for WordPress.DB.SlowDBQuery.slow_db_query_tax_query warning. $this->assertArrayHasKey( 34, $warnings['load.php'] ); - $this->assertArrayHasKey( 26, $warnings['load.php'][34] ); - $this->assertArrayHasKey( 'code', $warnings['load.php'][34][26][0] ); - $this->assertEquals( 'WordPress.DB.SlowDBQuery.slow_db_query_tax_query', $warnings['load.php'][34][26][0]['code'] ); + $this->assertArrayHasKey( 9, $warnings['load.php'][34] ); + $this->assertArrayHasKey( 'code', $warnings['load.php'][34][9][0] ); + $this->assertEquals( 'WordPress.DB.SlowDBQuery.slow_db_query_tax_query', $warnings['load.php'][34][9][0]['code'] ); } public function test_run_without_errors() {