From cfb894a3430fd2b1aec40872590f01d2f251389f Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Fri, 9 Jun 2023 16:41:30 +0100 Subject: [PATCH 01/10] create performant wp query check --- composer.json | 3 +- composer.lock | 47 ++++++++++++++++++- .../Performant_WP_Query_Params_Check.php | 31 ++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 includes/Checker/Checks/Performant_WP_Query_Params_Check.php diff --git a/composer.json b/composer.json index c9c319b40..f9bac1270 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "php": ">=5.6", "composer/installers": "^v1.12.0 || ^2.2", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "wp-coding-standards/wpcs": "dev-develop#fca9d9e" + "wp-coding-standards/wpcs": "dev-develop#fca9d9e", + "automattic/vipwpcs": "^0.2.4" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.1", diff --git a/composer.lock b/composer.lock index 94b2c72ae..ab8c298b3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,53 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7fae7df1b98ffeb1dfcfc338d4d5a292", + "content-hash": "da763730545c9ff85569945bd79314b7", "packages": [ + { + "name": "automattic/vipwpcs", + "version": "0.2.4", + "source": { + "type": "git", + "url": "https://github.com/Automattic/VIP-Coding-Standards.git", + "reference": "c74e8861cf3a0db3a3a1633cb9b7854144ec585b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/c74e8861cf3a0db3a3a1633cb9b7854144ec585b", + "reference": "c74e8861cf3a0db3a3a1633cb9b7854144ec585b", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2", + "wp-coding-standards/wpcs": "*" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/Automattic/VIP-Coding-Standards/issues", + "source": "https://github.com/Automattic/VIP-Coding-Standards" + }, + "time": "2018-07-18T16:53:09+00:00" + }, { "name": "composer/installers", "version": "v1.12.0", diff --git a/includes/Checker/Checks/Performant_WP_Query_Params_Check.php b/includes/Checker/Checks/Performant_WP_Query_Params_Check.php new file mode 100644 index 000000000..535aa116c --- /dev/null +++ b/includes/Checker/Checks/Performant_WP_Query_Params_Check.php @@ -0,0 +1,31 @@ + 'php', + 'standard' => 'WordPress,WordPressVIPMinimum', + 'sniffs' => 'WordPress.DB.SlowDBQuery,WordPressVIPMinimum.Performance.WPQueryParams', + ); + } +} From 52f0f6fcb043efd6610d0daf6c19f96d2d974270 Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Fri, 9 Jun 2023 16:41:40 +0100 Subject: [PATCH 02/10] add tests --- ...Performant_WP_Query_Params_Check_Tests.php | 51 +++++++++++++++++++ .../load.php | 42 +++++++++++++++ .../load.php | 27 ++++++++++ 3 files changed, 120 insertions(+) create mode 100644 tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php create mode 100644 tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php create mode 100644 tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php 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 new file mode 100644 index 000000000..25a2c3044 --- /dev/null +++ b/tests/phpunit/Checker/Checks/Performant_WP_Query_Params_Check_Tests.php @@ -0,0 +1,51 @@ +run( $check_result ); + + $errors = $check_result->get_errors(); + $warnings = $check_result->get_warnings(); + + $this->assertNotEmpty( $errors ); + $this->assertArrayHasKey( 'load.php', $errors ); + $this->assertEquals( 2, $check_result->get_error_count() ); + + // Check for WordPress.DB.SlowDBQuery error on Line no 22 and column no at 5. + $this->assertArrayHasKey( 22, $errors['load.php'] ); + $this->assertArrayHasKey( 5, $errors['load.php'][22] ); + $this->assertArrayHasKey( 'code', $errors['load.php'][22][5][0] ); + $this->assertEquals( 'WordPress.DB.SlowDBQuery', $errors['load.php'][22][5][0]['code'] ); + + } + + public function test_run_without_errors() { + $performant_query = new Performant_WP_Query_Params_Check(); + $check_context = new Check_Context( TESTS_PLUGIN_DIR . '/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php' ); + $check_result = new Check_Result( $check_context ); + + $performant_query->run( $check_result ); + + $errors = $check_result->get_errors(); + $warnings = $check_result->get_warnings(); + + $this->assertEmpty( $errors ); + $this->assertEmpty( $warnings ); + $this->assertEquals( 0, $check_result->get_error_count() ); + $this->assertEquals( 0, $check_result->get_warning_count() ); + } +} diff --git a/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php new file mode 100644 index 000000000..0e422fd3e --- /dev/null +++ b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php @@ -0,0 +1,42 @@ + array( 1, 2, 3 ), + 'posts_per_page' => -1, + 'cache_results' => false, + 'meta_key' => 'age', + 'meta_query' => array( + array( + 'key' => 'age', + 'value' => array( 3, 4 ), + 'compare' => 'IN', + ), + ), + 'tax_query' => array( + array( + 'taxonomy' => 'custom_taxonomy_slug', + 'operator' => 'EXISTS', + ), + ), + ) +); diff --git a/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php new file mode 100644 index 000000000..aa5e393d5 --- /dev/null +++ b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php @@ -0,0 +1,27 @@ + 10, + 'post_type' => 'post', + ) +); From eeb27193ab1b3d130bfb659e9ffc78c5ed0afc9e Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Thu, 15 Jun 2023 14:08:17 +0100 Subject: [PATCH 03/10] add check to list of checks --- includes/Checker/Abstract_Check_Runner.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/Checker/Abstract_Check_Runner.php b/includes/Checker/Abstract_Check_Runner.php index a9910176c..22f57a051 100644 --- a/includes/Checker/Abstract_Check_Runner.php +++ b/includes/Checker/Abstract_Check_Runner.php @@ -368,12 +368,13 @@ private function register_checks() { $checks = apply_filters( 'wp_plugin_check_checks', array( - 'i18n_usage' => new Checks\I18n_Usage_Check(), - 'enqueued_scripts_size' => new Checks\Enqueued_Scripts_Size_Check(), - 'code_obfuscation' => new Checks\Code_Obfuscation_Check(), - 'file_type' => new Checks\File_Type_Check(), - 'plugin_header_text_domain' => new Checks\Plugin_Header_Text_Domain_Check(), - 'late_escaping' => new Checks\Late_Escaping_Check(), + 'i18n_usage' => new Checks\I18n_Usage_Check(), + 'enqueued_scripts_size' => new Checks\Enqueued_Scripts_Size_Check(), + 'code_obfuscation' => new Checks\Code_Obfuscation_Check(), + 'file_type' => new Checks\File_Type_Check(), + 'plugin_header_text_domain' => new Checks\Plugin_Header_Text_Domain_Check(), + 'late_escaping' => new Checks\Late_Escaping_Check(), + 'performant_wp_query_params' => new Checks\Late_Escaping_Check(), ) ); From 760a7778f8b867737f090f39f2f85caa04929666 Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Thu, 15 Jun 2023 14:16:21 +0100 Subject: [PATCH 04/10] use Static_Check_UnitTestCase for test file --- .../Checks/Performant_WP_Query_Params_Check_Tests.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 25a2c3044..8b245ec9e 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 @@ -8,8 +8,9 @@ use WordPress\Plugin_Check\Checker\Check_Context; use WordPress\Plugin_Check\Checker\Check_Result; use WordPress\Plugin_Check\Checker\Checks\Performant_WP_Query_Params_Check; +use WordPress\Plugin_Check\Test_Utils\TestCase\Static_Check_UnitTestCase; -class Performant_WP_Query_Params_Check_Tests extends WP_UnitTestCase { +class Performant_WP_Query_Params_Check_Tests extends Static_Check_UnitTestCase { public function test_run_with_errors() { $performant_query = new Performant_WP_Query_Params_Check(); @@ -19,7 +20,6 @@ public function test_run_with_errors() { $performant_query->run( $check_result ); $errors = $check_result->get_errors(); - $warnings = $check_result->get_warnings(); $this->assertNotEmpty( $errors ); $this->assertArrayHasKey( 'load.php', $errors ); @@ -30,7 +30,6 @@ public function test_run_with_errors() { $this->assertArrayHasKey( 5, $errors['load.php'][22] ); $this->assertArrayHasKey( 'code', $errors['load.php'][22][5][0] ); $this->assertEquals( 'WordPress.DB.SlowDBQuery', $errors['load.php'][22][5][0]['code'] ); - } public function test_run_without_errors() { From 286118e0943ae5097ca40d62a351d0a968d4e3cd Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Thu, 15 Jun 2023 16:43:47 +0100 Subject: [PATCH 05/10] update composer dependencies --- composer.json | 6 +- composer.lock | 186 +++++++++++++++----------------------------------- 2 files changed, 57 insertions(+), 135 deletions(-) diff --git a/composer.json b/composer.json index f9bac1270..f2ef1f969 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ "require": { "php": ">=5.6", "composer/installers": "^v1.12.0 || ^2.2", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "wp-coding-standards/wpcs": "dev-develop#fca9d9e", - "automattic/vipwpcs": "^0.2.4" + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "wp-coding-standards/wpcs": "^2.3 | dev-develop#fca9d9e", + "automattic/vipwpcs": "^2.0.0" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.1", diff --git a/composer.lock b/composer.lock index ab8c298b3..380da48f0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,29 +4,35 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "da763730545c9ff85569945bd79314b7", + "content-hash": "c23960355e204640cf88eeefb2ab242c", "packages": [ { "name": "automattic/vipwpcs", - "version": "0.2.4", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "c74e8861cf3a0db3a3a1633cb9b7854144ec585b" + "reference": "4d0612461232b313d06321f1501c3989bd6aecf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/c74e8861cf3a0db3a3a1633cb9b7854144ec585b", - "reference": "c74e8861cf3a0db3a3a1633cb9b7854144ec585b", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/4d0612461232b313d06321f1501c3989bd6aecf9", + "reference": "4d0612461232b313d06321f1501c3989bd6aecf9", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2", - "wp-coding-standards/wpcs": "*" + "php": ">=5.4", + "sirbrillig/phpcs-variable-analysis": "^2.8.3", + "squizlabs/php_codesniffer": "^3.5.5", + "wp-coding-standards/wpcs": "^2.3" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "phpcompatibility/php-compatibility": "^9", + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will manage the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -47,9 +53,10 @@ ], "support": { "issues": "https://github.com/Automattic/VIP-Coding-Standards/issues", - "source": "https://github.com/Automattic/VIP-Coding-Standards" + "source": "https://github.com/Automattic/VIP-Coding-Standards", + "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2018-07-18T16:53:09+00:00" + "time": "2020-09-07T10:45:45+00:00" }, { "name": "composer/installers", @@ -281,141 +288,62 @@ "time": "2023-01-05T11:28:13+00:00" }, { - "name": "phpcsstandards/phpcsextra", - "version": "1.0.3", + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.16", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "7029c051cd310e2e17c6caea3429bfbe290c41ae" + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/7029c051cd310e2e17c6caea3429bfbe290c41ae", - "reference": "7029c051cd310e2e17c6caea3429bfbe290c41ae", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/dc5582dc5a93a235557af73e523c389aac9a8e88", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88", "shasum": "" }, "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0", - "squizlabs/php_codesniffer": "^3.7.1" + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.5", - "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + "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" }, "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-2-Clause" ], "authors": [ { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "description": "A PHPCS sniff to detect problems with variables.", "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", "phpcs", - "standards", "static analysis" ], "support": { - "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", - "source": "https://github.com/PHPCSStandards/PHPCSExtra" - }, - "time": "2023-03-28T17:48:27+00:00" - }, - { - "name": "phpcsstandards/phpcsutils", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/0cfef5193e68e8ff179333d8ae937db62939b656", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656", - "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.7.1 || 4.0.x-dev@dev" - }, - "require-dev": { - "ext-filter": "*", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.3", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3", - "yoast/phpunit-polyfills": "^1.0.1" - }, - "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", - "standards", - "static analysis", - "tokens", - "utility" - ], - "support": { - "docs": "https://phpcsutils.com/", - "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", - "source": "https://github.com/PHPCSStandards/PHPCSUtils" + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-04-17T16:27:27+00:00" + "time": "2023-03-31T16:46:32+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -476,36 +404,31 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "dev-develop", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "fca9d9e" + "reference": "7da1894633f168fe244afc6de00d141f27517b62" }, "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/7da1894633f168fe244afc6de00d141f27517b62", + "reference": "7da1894633f168fe244afc6de00d141f27517b62", "shasum": "" }, "require": { - "ext-filter": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.0", - "phpcsstandards/phpcsutils": "^1.0.5", - "squizlabs/php_codesniffer": "^3.7.2" + "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "ext-mbstring": "For improved results" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, - "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -521,7 +444,6 @@ "keywords": [ "phpcs", "standards", - "static analysis", "wordpress" ], "support": { @@ -529,7 +451,7 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2023-05-01T08:34:06+00:00" + "time": "2020-05-13T23:57:56+00:00" } ], "packages-dev": [ From 51a6aa9e0b49342700daa1e7d338cd15abe0f40f Mon Sep 17 00:00:00 2001 From: jjgrainger Date: Thu, 15 Jun 2023 16:43:53 +0100 Subject: [PATCH 06/10] update tests --- ...Performant_WP_Query_Params_Check_Tests.php | 32 +++++++++++++------ .../load.php | 1 - 2 files changed, 22 insertions(+), 11 deletions(-) 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 8b245ec9e..d6e771488 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 @@ -19,17 +19,29 @@ public function test_run_with_errors() { $performant_query->run( $check_result ); - $errors = $check_result->get_errors(); - - $this->assertNotEmpty( $errors ); - $this->assertArrayHasKey( 'load.php', $errors ); - $this->assertEquals( 2, $check_result->get_error_count() ); + $warnings = $check_result->get_warnings(); - // Check for WordPress.DB.SlowDBQuery error on Line no 22 and column no at 5. - $this->assertArrayHasKey( 22, $errors['load.php'] ); - $this->assertArrayHasKey( 5, $errors['load.php'][22] ); - $this->assertArrayHasKey( 'code', $errors['load.php'][22][5][0] ); - $this->assertEquals( 'WordPress.DB.SlowDBQuery', $errors['load.php'][22][5][0]['code'] ); + $this->assertNotEmpty( $warnings ); + $this->assertArrayHasKey( 'load.php', $warnings ); + $this->assertEquals( 3, $check_result->get_warning_count() ); + + // Check for WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn 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'] ); + + // 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'] ); + + // 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'] ); } public function test_run_without_errors() { diff --git a/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php index 0e422fd3e..5f034d37b 100644 --- a/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php +++ b/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php @@ -24,7 +24,6 @@ 'post__not_in' => array( 1, 2, 3 ), 'posts_per_page' => -1, 'cache_results' => false, - 'meta_key' => 'age', 'meta_query' => array( array( 'key' => 'age', From 5a7e7351039a6da369edbe9575de353207fff8a5 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Fri, 16 Jun 2023 10:50:00 +0530 Subject: [PATCH 07/10] Use UNIT_TESTS_PLUGIN_DIR const in unit tests --- .../Checker/Checks/Performant_WP_Query_Params_Check_Tests.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 d6e771488..d166359cd 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 @@ -14,7 +14,7 @@ class Performant_WP_Query_Params_Check_Tests extends Static_Check_UnitTestCase { public function test_run_with_errors() { $performant_query = new Performant_WP_Query_Params_Check(); - $check_context = new Check_Context( TESTS_PLUGIN_DIR . '/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-errors/load.php' ); + $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-performant-wp-query-params-errors/load.php' ); $check_result = new Check_Result( $check_context ); $performant_query->run( $check_result ); @@ -46,7 +46,7 @@ public function test_run_with_errors() { public function test_run_without_errors() { $performant_query = new Performant_WP_Query_Params_Check(); - $check_context = new Check_Context( TESTS_PLUGIN_DIR . '/tests/phpunit/testdata/plugins/test-plugin-performant-wp-query-params-without-errors/load.php' ); + $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-performant-wp-query-params-without-errors/load.php' ); $check_result = new Check_Result( $check_context ); $performant_query->run( $check_result ); From 73efdd485396960b4726449298219ebd4525d807 Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Tue, 20 Jun 2023 17:51:08 +0100 Subject: [PATCH 08/10] Fix composer update --- composer.json | 4 +- composer.lock | 171 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 162 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 9c1b9a1c7..2022c0037 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "require": { "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": "^2.3 | dev-develop#fca9d9e", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", + "wp-coding-standards/wpcs": "dev-develop#fca9d9e as 2.3.0", "automattic/vipwpcs": "^2.0.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 380da48f0..bb29f3fb2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c23960355e204640cf88eeefb2ab242c", + "content-hash": "550b74033afd67842c239696b9e65b55", "packages": [ { "name": "automattic/vipwpcs", @@ -287,6 +287,142 @@ }, "time": "2023-01-05T11:28:13+00:00" }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "029af41e270ae73f10c0e9a1ce376b12da4e4810" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/029af41e270ae73f10c0e9a1ce376b12da4e4810", + "reference": "029af41e270ae73f10c0e9a1ce376b12da4e4810", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.6", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "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", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "time": "2023-06-17T22:57:40+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "ba259eaaefac118648e1263919b9530667ffcf01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/ba259eaaefac118648e1263919b9530667ffcf01", + "reference": "ba259eaaefac118648e1263919b9530667ffcf01", + "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.7.1 || 4.0.x-dev@dev" + }, + "require-dev": { + "ext-filter": "*", + "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" + }, + "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", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "time": "2023-05-27T13:39:12+00:00" + }, { "name": "sirbrillig/phpcs-variable-analysis", "version": "v2.11.16", @@ -404,31 +540,36 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "fca9d9e" }, "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/fca9d9e", + "reference": "fca9d9e", "shasum": "" }, "require": { + "ext-filter": "*", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "phpcsstandards/phpcsextra": "^1.0", + "phpcsstandards/phpcsutils": "^1.0.5", + "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", + "phpcsstandards/phpcsdevtools": "^1.2.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-mbstring": "For improved results" }, + "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -444,6 +585,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -451,7 +593,7 @@ "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" + "time": "2023-06-20T15:25:34+00:00" } ], "packages-dev": [ @@ -2095,7 +2237,14 @@ "time": "2023-03-30T23:39:05+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "wp-coding-standards/wpcs", + "version": "dev-develop", + "alias": "2.3.0", + "alias_normalized": "2.3.0.0" + } + ], "minimum-stability": "stable", "stability-flags": { "wp-coding-standards/wpcs": 20 From e7f0028a570ca501b8af77e08e59f0070260f889 Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Wed, 21 Jun 2023 11:28:14 +0100 Subject: [PATCH 09/10] Patch VIP GO coding standards to get them to work with wp-coding-standards/wpcs. --- composer.json | 16 ++++-- composer.lock | 99 +++++++++++++++++++++++++++----------- patches/remove-rules.patch | 13 +++++ 3 files changed, 98 insertions(+), 30 deletions(-) create mode 100644 patches/remove-rules.patch diff --git a/composer.json b/composer.json index 2022c0037..13d36a76c 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,10 @@ "require": { "php": ">=5.6", "composer/installers": "^v1.12.0 || ^2.2", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", + "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.0.0" + "automattic/vipwpcs": "2.3.3", + "cweagans/composer-patches": "^1.7" }, "require-dev": { "wp-phpunit/wp-phpunit": "^6.1", @@ -37,12 +38,21 @@ "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "composer/installers": true, - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "cweagans/composer-patches": true }, "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 bb29f3fb2..565f2040a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,36 +4,36 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "550b74033afd67842c239696b9e65b55", + "content-hash": "bba8b71a73452397be8ca463dcb3388e", "packages": [ { "name": "automattic/vipwpcs", - "version": "2.2.0", + "version": "2.3.3", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "4d0612461232b313d06321f1501c3989bd6aecf9" + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/4d0612461232b313d06321f1501c3989bd6aecf9", - "reference": "4d0612461232b313d06321f1501c3989bd6aecf9", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", "shasum": "" }, "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7", "php": ">=5.4", - "sirbrillig/phpcs-variable-analysis": "^2.8.3", + "sirbrillig/phpcs-variable-analysis": "^2.11.1", "squizlabs/php_codesniffer": "^3.5.5", "wp-coding-standards/wpcs": "^2.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "php-parallel-lint/php-console-highlighter": "^0.5", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpcompatibility/php-compatibility": "^9", + "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will manage the PHPCS 'installed_paths' automatically." - }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -56,7 +56,7 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2020-09-07T10:45:45+00:00" + "time": "2021-09-29T16:20:23+00:00" }, { "name": "composer/installers", @@ -209,40 +209,85 @@ ], "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": "v1.0.0", + "version": "v0.7.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", + "php": ">=5.3", "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", - "yoast/phpunit-polyfills": "^1.0" + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -258,7 +303,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -282,10 +327,10 @@ "tests" ], "support": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "phpcsstandards/phpcsextra", diff --git a/patches/remove-rules.patch b/patches/remove-rules.patch new file mode 100644 index 000000000..5e2a1a48e --- /dev/null +++ b/patches/remove-rules.patch @@ -0,0 +1,13 @@ +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 @@ + + + +- +- + + + From d2d2edce4dc8ad758f03790ff634aaac39290289 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Wed, 21 Jun 2023 16:49:42 +0530 Subject: [PATCH 10/10] Apply suggestions from code review --- includes/Checker/Abstract_Check_Runner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Checker/Abstract_Check_Runner.php b/includes/Checker/Abstract_Check_Runner.php index 4f74cbcb8..4e8a2d142 100644 --- a/includes/Checker/Abstract_Check_Runner.php +++ b/includes/Checker/Abstract_Check_Runner.php @@ -376,7 +376,7 @@ private function register_checks() { 'late_escaping' => new Checks\Late_Escaping_Check(), 'plugin_updater' => new Checks\Plugin_Updater_Check(), 'plugin_review_phpcs' => new Checks\Plugin_Review_PHPCS_Check(), - 'performant_wp_query_params' => new Checks\Late_Escaping_Check(), + 'performant_wp_query_params' => new Checks\Performant_WP_Query_Params_Check(), 'enqueued_scripts_in_footer' => new Checks\Enqueued_Scripts_In_Footer_Check(), 'plugin_readme' => new Checks\Plugin_Readme_Check(), 'enqueued_styles_scope' => new Checks\Enqueued_Styles_Scope_Check(),