From fa653fc0496613b145534aa4280e1fd245deb631 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 14:25:36 -0300 Subject: [PATCH 1/6] Coding Standards: Remove stale `phpcs:ignore` annotations in `deprecated.php` Remove `PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore` annotations from `__ngettext()` and `__ngettext_noop()`. Since PHPCompatibility 9.3.2, the `ReservedFunctionNames` sniff skips functions that have a `@deprecated` tag in their docblock, making these annotations unnecessary. See PHPCompatibility/PHPCompatibility 917. --- src/wp-includes/deprecated.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php index 11dc214cd0ed5..df8e9b020124a 100644 --- a/src/wp-includes/deprecated.php +++ b/src/wp-includes/deprecated.php @@ -1820,7 +1820,7 @@ function _nc( $single, $plural, $number, $domain = 'default' ) { * @deprecated 2.8.0 Use _n() * @see _n() */ -function __ngettext( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore +function __ngettext( ...$args ) { _deprecated_function( __FUNCTION__, '2.8.0', '_n()' ); return _n( ...$args ); } @@ -1832,7 +1832,7 @@ function __ngettext( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameR * @deprecated 2.8.0 Use _n_noop() * @see _n_noop() */ -function __ngettext_noop( ...$args ) { // phpcs:ignore PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore +function __ngettext_noop( ...$args ) { _deprecated_function( __FUNCTION__, '2.8.0', '_n_noop()' ); return _n_noop( ...$args ); From a27a47f7b36f007f8643e7344e5cd20c1dfdbb1c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 14:43:16 -0300 Subject: [PATCH 2/6] Coding Standards: Remove stale `phpcs:ignore` annotation in `WP_REST_Font_Collections_Controller` Remove the `VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable` annotation from `get_items_permissions_check()`. The VariableAnalysis standard is not installed in WordPress Core. The annotation was probably carried over from Gutenberg, where VariableAnalysis is part of the PHPCS configuration, when the font library was merged into Core. --- .../endpoints/class-wp-rest-font-collections-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php index 9e0edd2adf455..ff1051fbd07ac 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php @@ -337,7 +337,7 @@ public function get_collection_params() { * * @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise. */ - public function get_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable + public function get_items_permissions_check( $request ) { if ( current_user_can( 'edit_theme_options' ) ) { return true; } From 1c314236fff85e32c8fa5848196d0b3abb44370d Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 14:51:27 -0300 Subject: [PATCH 3/6] Coding Standards: Remove stale `WPThemeReview` annotations in Twenty Twenty-One Remove three `WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound` annotations. The WPThemeReview standard is not installed in WordPress Core. I believe these annotations were carried over from the upstream Twenty Twenty-One repository when the theme was imported into Core in 4b90066592. --- .../classes/class-twenty-twenty-one-customize.php | 2 +- .../classes/class-twenty-twenty-one-dark-mode.php | 2 +- .../themes/twentytwentyone/inc/template-functions.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php index 3ed6b637af698..53db8dffb216f 100644 --- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php +++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php @@ -113,7 +113,7 @@ public function register( $wp_customize ) { // Background color. // Include the custom control class. - require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-color-control.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-color-control.php' ); // Register the custom control. $wp_customize->register_control_type( 'Twenty_Twenty_One_Customize_Color_Control' ); diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php index c5643ade65da4..d5672c4054f3c 100644 --- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php +++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php @@ -137,7 +137,7 @@ public function customizer_controls( $wp_customize ) { } // Custom notice control. - require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-notice-control.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once get_theme_file_path( 'classes/class-twenty-twenty-one-customize-notice-control.php' ); $wp_customize->add_setting( 'respect_user_color_preference_notice', diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index 689b1e22c9814..1fd3b0e15f434 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -335,7 +335,7 @@ function twenty_twenty_one_get_non_latin_css( $type = 'front-end' ) { // Include file if function doesn't exist. if ( ! function_exists( 'twenty_twenty_one_generate_css' ) ) { - require_once get_theme_file_path( 'inc/custom-css.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound + require_once get_theme_file_path( 'inc/custom-css.php' ); } // Return the specified styles. From 10ed8a500776627ca4ac9d87f0cc1703b9e2a529 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 15:03:47 -0300 Subject: [PATCH 4/6] Coding Standards: Remove stale `WPCS` inline comments in Twenty Nineteen The `// WPCS: XSS OK.` comments use a legacy annotation format no longer recognized by PHPCS. This format was introduced in WPCS 0.4.0, deprecated in WPCS 2.0.0 (see WordPress/WordPress-Coding-Standards 1580), and support was fully removed in WPCS 3.0.0 (see WordPress/WordPress-Coding-Standards 1908) in favor of the PHPCS native `phpcs:ignore` annotations. Additionally, the `WordPress.Security.EscapeOutput` sniff these comments reference is part of the `WordPress-Extra` standard, not the `WordPress-Core` standard used in this repository. --- src/wp-content/themes/twentynineteen/inc/template-tags.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentynineteen/inc/template-tags.php b/src/wp-content/themes/twentynineteen/inc/template-tags.php index 44e180785cb56..63e9f78e1b505 100644 --- a/src/wp-content/themes/twentynineteen/inc/template-tags.php +++ b/src/wp-content/themes/twentynineteen/inc/template-tags.php @@ -92,7 +92,7 @@ function twentynineteen_entry_footer() { /* translators: Hidden accessibility text. */ __( 'Posted in', 'twentynineteen' ), $categories_list - ); // WPCS: XSS OK. + ); } $tags_list = get_the_tag_list( '', wp_get_list_item_separator() ); @@ -104,7 +104,7 @@ function twentynineteen_entry_footer() { /* translators: Hidden accessibility text. */ __( 'Tags:', 'twentynineteen' ), $tags_list - ); // WPCS: XSS OK. + ); } } From e0072c2f5cf18eb91215ba986dfff6fabfcbc8c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 15:11:07 -0300 Subject: [PATCH 5/6] Coding Standards: Remove stale `phpcs:disable` in Twenty Twenty SVG icons The `CapitalPDangit` sniff does not check array keys. --- .../themes/twentytwenty/classes/class-twentytwenty-svg-icons.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php index a87bf84db244c..946045e982347 100644 --- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php +++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php @@ -327,7 +327,6 @@ public static function get_social_link_svg( $uri ) { 'whatsapp' => ' ', - // phpcs:disable WordPress.WP.CapitalPDangit.Misspelled 'wordpress' => '', 'yelp' => '', From 5405ccbf11539af1796e7b4e0817bbeb92ab335c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Wed, 11 Feb 2026 15:21:32 -0300 Subject: [PATCH 6/6] Coding Standards: Remove `phpcs:ignore` annotations for sniffs not checked in this repository The `phpcs.xml.dist` configuration uses the `WordPress-Core` standard. These annotations reference sniffs that are part of `WordPress-Extra`, which is not included: - `WordPress.Security.EscapeOutput` - `WordPress.Security.NonceVerification` - `WordPress.WP.AlternativeFunctions` - `WordPress.PHP.DevelopmentFunctions` - `WordPress.PHP.IniSet` Some of these annotations were carried over from upstream theme repositories or external plugins. If in the future there is a decision to add `WordPress-Extra`, I think it makes sense to evaluate each error/warning to decide what should be ignored and what should not. --- .../classes/class-twentytwenty-walker-comment.php | 6 +++--- src/wp-content/themes/twentytwenty/comments.php | 2 +- .../themes/twentytwenty/inc/custom-css.php | 2 +- src/wp-content/themes/twentytwenty/inc/svg-icons.php | 2 +- .../themes/twentytwenty/inc/template-tags.php | 6 +++--- src/wp-content/themes/twentytwenty/searchform.php | 2 +- .../twentytwenty/template-parts/content-cover.php | 4 ++-- .../twentytwenty/template-parts/entry-header.php | 2 +- .../twentytwenty/template-parts/featured-image.php | 2 +- .../template-parts/footer-menus-widgets.php | 2 +- .../twentytwenty/template-parts/pagination.php | 2 +- src/wp-content/themes/twentytwentyone/image.php | 2 +- .../themes/twentytwentyone/inc/back-compat.php | 2 +- .../themes/twentytwentyone/inc/custom-css.php | 2 +- .../twentytwentyone/inc/template-functions.php | 2 +- .../themes/twentytwentyone/inc/template-tags.php | 12 ++++++------ src/wp-content/themes/twentytwentyone/searchform.php | 2 +- .../template-parts/header/site-branding.php | 2 +- .../template-parts/header/site-nav.php | 4 ++-- .../l10n/class-wp-translation-file-mo.php | 2 +- tests/phpunit/includes/build-visual-html-tree.php | 3 --- tests/phpunit/tests/template.php | 2 +- 22 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php index eb2ec8efe55a6..8012677ce8e76 100644 --- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php +++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-comment.php @@ -37,7 +37,7 @@ protected function html5_comment( $comment, $depth, $args ) { $tag = ( 'div' === $args['style'] ) ? 'div' : 'li'; ?> - < id="comment-" has_children ? 'parent' : '', $comment ); ?>> + < id="comment-" has_children ? 'parent' : '', $comment ); ?>>