Skip to content

Commit 6305020

Browse files
authored
Merge pull request #2537 from WordPress/feature/update-for-latest-wp
Update list based sniffs for WP 6.8.1
2 parents 5511d78 + 2789358 commit 6305020

14 files changed

+208
-26
lines changed

WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
147147
* Only overrulable constants are listed, i.e. those defined within core within
148148
* a `if ( ! defined() ) {}` wrapper.
149149
*
150-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
150+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
151151
*
152152
* @since 1.0.0
153153
* @since 3.0.0 Renamed from `$whitelisted_core_constants` to `$allowed_core_constants`.
@@ -201,7 +201,7 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
201201
*
202202
* Note: deprecated functions should still be included in this list as plugins may support older WP versions.
203203
*
204-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
204+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
205205
*
206206
* @since 3.0.0.
207207
*
@@ -322,6 +322,13 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
322322
'twentytwenty_get_customizer_css' => true,
323323
'twentytwenty_get_theme_svg' => true,
324324
'twentytwenty_the_theme_svg' => true,
325+
'twentytwentyfive_block_styles' => true,
326+
'twentytwentyfive_editor_style' => true,
327+
'twentytwentyfive_enqueue_styles' => true,
328+
'twentytwentyfive_format_binding' => true,
329+
'twentytwentyfive_pattern_categories' => true,
330+
'twentytwentyfive_post_format_setup' => true,
331+
'twentytwentyfive_register_block_bindings' => true,
325332
'twentytwentyfour_block_styles' => true,
326333
'twentytwentyfour_block_stylesheets' => true,
327334
'twentytwentyfour_pattern_categories' => true,
@@ -358,6 +365,7 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
358365
'wp_notify_postauthor' => true,
359366
'wp_parse_auth_cookie' => true,
360367
'wp_password_change_notification' => true,
368+
'wp_password_needs_rehash' => true,
361369
'wp_rand' => true,
362370
'wp_redirect' => true,
363371
'wp_safe_redirect' => true,
@@ -382,7 +390,7 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
382390
*
383391
* Note: deprecated classes should still be included in this list as plugins may support older WP versions.
384392
*
385-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
393+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
386394
*
387395
* @since 3.0.0.
388396
*

WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final class ValidPostTypeSlugSniff extends AbstractFunctionParameterSniff {
6363
*
6464
* Source: {@link https://developer.wordpress.org/reference/functions/register_post_type/#reserved-post-types}
6565
*
66-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
66+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
6767
*
6868
* @since 2.2.0
6969
*

WordPress/Sniffs/WP/CapabilitiesSniff.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ final class CapabilitiesSniff extends AbstractFunctionParameterSniff {
173173
*
174174
* List is sorted alphabetically.
175175
*
176-
* {@internal To be updated after every major release. Last updated for WordPress 6.1.0.}
176+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
177177
*
178178
* @since 3.0.0
179179
*
@@ -229,6 +229,7 @@ final class CapabilitiesSniff extends AbstractFunctionParameterSniff {
229229
'edit_app_password' => true,
230230
'edit_categories' => true,
231231
'edit_block' => true, // Only seen in tests.
232+
'edit_block_binding' => true,
232233
'edit_blocks' => true, // Alias for 'edit_posts', but supported.
233234
'edit_comment' => true, // Alias, but supported.
234235
'edit_comment_meta' => true,

WordPress/Sniffs/WP/ClassNameCaseSniff.php

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
2525
*
2626
* Note: this list will be enhanced in the class constructor.
2727
*
28-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
28+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
2929
*
3030
* @since 3.0.0
3131
*
@@ -97,6 +97,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
9797
'Text_Diff_Op_delete',
9898
'Text_Diff_Renderer',
9999
'Text_Diff_Renderer_inline',
100+
'Text_Exception',
100101
'Text_MappedDiff',
101102
'Theme_Installer_Skin',
102103
'Theme_Upgrader',
@@ -125,6 +126,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
125126
'WP_Block_Bindings_Source',
126127
'WP_Block_Editor_Context',
127128
'WP_Block_List',
129+
'WP_Block_Metadata_Registry',
128130
'WP_Block_Parser',
129131
'WP_Block_Parser_Block',
130132
'WP_Block_Parser_Frame',
@@ -133,6 +135,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
133135
'WP_Block_Styles_Registry',
134136
'WP_Block_Supports',
135137
'WP_Block_Template',
138+
'WP_Block_Templates_Registry',
136139
'WP_Block_Type',
137140
'WP_Block_Type_Registry',
138141
'WP_Classic_To_Block_Menu_Converter',
@@ -186,6 +189,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
186189
'WP_Duotone',
187190
'WP_Embed',
188191
'WP_Error',
192+
'WP_Exception',
189193
'WP_Fatal_Error_Handler',
190194
'WP_Feed_Cache',
191195
'WP_Feed_Cache_Transient',
@@ -201,10 +205,13 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
201205
'WP_Font_Utils',
202206
'WP_HTML_Active_Formatting_Elements',
203207
'WP_HTML_Attribute_Token',
208+
'WP_HTML_Decoder',
209+
'WP_HTML_Doctype_Info',
204210
'WP_HTML_Open_Elements',
205211
'WP_HTML_Processor',
206212
'WP_HTML_Processor_State',
207213
'WP_HTML_Span',
214+
'WP_HTML_Stack_Event',
208215
'WP_HTML_Tag_Processor',
209216
'WP_HTML_Text_Replacement',
210217
'WP_HTML_Token',
@@ -246,6 +253,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
246253
'WP_Network',
247254
'WP_Network_Query',
248255
'WP_Object_Cache',
256+
'WP_PHPMailer',
249257
'WP_Paused_Extensions_Storage',
250258
'WP_Plugin_Dependencies',
251259
'WP_Plugin_Install_List_Table',
@@ -343,6 +351,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
343351
'WP_Sitemaps_Stylesheet',
344352
'WP_Sitemaps_Taxonomies',
345353
'WP_Sitemaps_Users',
354+
'WP_Speculation_Rules',
346355
'WP_Style_Engine',
347356
'WP_Style_Engine_CSS_Declarations',
348357
'WP_Style_Engine_CSS_Rule',
@@ -364,11 +373,13 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
364373
'WP_Theme_JSON_Resolver',
365374
'WP_Theme_JSON_Schema',
366375
'WP_Themes_List_Table',
376+
'WP_Token_Map',
367377
'WP_Translation_Controller',
368378
'WP_Translation_File',
369379
'WP_Translation_File_MO',
370380
'WP_Translation_File_PHP',
371381
'WP_Translations',
382+
'WP_URL_Pattern_Prefixer',
372383
'WP_Upgrader',
373384
'WP_Upgrader_Skin',
374385
'WP_User',
@@ -412,7 +423,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
412423
*
413424
* Note: this list will be enhanced in the class constructor.
414425
*
415-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
426+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
416427
*
417428
* @since 3.0.0
418429
*
@@ -444,7 +455,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
444455
*
445456
* Note: this list will be enhanced in the class constructor.
446457
*
447-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
458+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
448459
*
449460
* @since 3.1.0
450461
*
@@ -466,7 +477,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
466477
*
467478
* Note: this list will be enhanced in the class constructor.
468479
*
469-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
480+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
470481
*
471482
* @since 3.0.0
472483
*
@@ -502,7 +513,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
502513
*
503514
* Note: this list will be enhanced in the class constructor.
504515
*
505-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
516+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
506517
*
507518
* @since 3.0.0
508519
*
@@ -520,7 +531,7 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
520531
*
521532
* Note: this list will be enhanced in the class constructor.
522533
*
523-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
534+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
524535
*
525536
* @since 3.0.0
526537
*
@@ -664,19 +675,26 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
664675
*
665676
* Note: this list will be enhanced in the class constructor.
666677
*
667-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
678+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
668679
*
669680
* @since 3.0.0
670681
*
671682
* @var string[] The class names in their "proper" case.
672683
* The constructor will add the lowercased class name as a key to each entry.
673684
*/
674685
private $simplepie_classes = array(
675-
// Interfaces.
686+
// Interfaces, SimplePie v1.
676687
'SimplePie_Cache_Base',
677688

678-
// Classes.
689+
// Interfaces, SimplePie v2 (with BC layer in v1).
690+
'SimplePie\Cache\Base',
691+
'SimplePie\Cache\DataCache',
692+
'SimplePie\Cache\NameFilter',
693+
'SimplePie\RegistryAware',
694+
695+
// Classes, SimplePie v1.
679696
'SimplePie',
697+
'SimplePie_Autoloader',
680698
'SimplePie_Author',
681699
'SimplePie_Cache',
682700
'SimplePie_Cache_DB',
@@ -710,6 +728,43 @@ final class ClassNameCaseSniff extends AbstractClassRestrictionsSniff {
710728
'SimplePie_Source',
711729
'SimplePie_XML_Declaration_Parser',
712730
'SimplePie_gzdecode',
731+
732+
// Classes, SimplePie v2 (with BC layer in v1).
733+
'SimplePie\Author',
734+
'SimplePie\Cache',
735+
'SimplePie\Cache\BaseDataCache',
736+
'SimplePie\Cache\CallableNameFilter',
737+
'SimplePie\Cache\DB',
738+
'SimplePie\Cache\File',
739+
'SimplePie\Cache\Memcache',
740+
'SimplePie\Cache\Memcached',
741+
'SimplePie\Cache\MySQL',
742+
'SimplePie\Cache\Psr16',
743+
'SimplePie\Cache\Redis',
744+
'SimplePie\Caption',
745+
'SimplePie\Category',
746+
'SimplePie\Content\Type\Sniffer',
747+
'SimplePie\Copyright',
748+
'SimplePie\Credit',
749+
'SimplePie\Enclosure',
750+
'SimplePie\Exception',
751+
'SimplePie\File',
752+
'SimplePie\Gzdecode',
753+
'SimplePie\HTTP\Parser',
754+
'SimplePie\IRI',
755+
'SimplePie\Item',
756+
'SimplePie\Locator',
757+
'SimplePie\Misc',
758+
'SimplePie\Net\IPv6',
759+
'SimplePie\Parse\Date',
760+
'SimplePie\Parser',
761+
'SimplePie\Rating',
762+
'SimplePie\Registry',
763+
'SimplePie\Restriction',
764+
'SimplePie\Sanitize',
765+
'SimplePie\SimplePie',
766+
'SimplePie\Source',
767+
'SimplePie\XML\Declaration\Parser',
713768
);
714769

715770
/**

WordPress/Sniffs/WP/DeprecatedClassesSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
4141
*
4242
* Version numbers should be fully qualified.
4343
*
44-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
44+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
4545
*
4646
* @var array
4747
*/

WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
4343
* To retrieve a function list for comparison, the following tool is available:
4444
* https://github.com/JDGrimes/wp-deprecated-code-scanner
4545
*
46-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
46+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
4747
*
4848
* @var array
4949
*/
@@ -1529,6 +1529,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
15291529
'version' => '6.3.0',
15301530
),
15311531
'block_core_navigation_submenu_build_css_colors' => array(
1532+
// Verified correct alternative.
15321533
'alt' => 'wp_apply_colors_support()',
15331534
'version' => '6.3.0',
15341535
),
@@ -1545,7 +1546,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
15451546
'version' => '6.3.0',
15461547
),
15471548
'wp_get_duotone_filter_svg' => array(
1548-
'alt' => '',
1549+
'alt' => 'WP_Duotone::get_filter_svg_from_preset()',
15491550
'version' => '6.3.0',
15501551
),
15511552
'wp_get_global_styles_svg_filters' => array(
@@ -1603,11 +1604,11 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16031604
'version' => '6.4.0',
16041605
),
16051606
'_inject_theme_attribute_in_block_template_content' => array(
1606-
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_inject_theme_attribute_in_template_part_block\' )',
1607+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_inject_theme_attribute_in_template_part_block" )',
16071608
'version' => '6.4.0',
16081609
),
16091610
'_remove_theme_attribute_in_block_template_content' => array(
1610-
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_remove_theme_attribute_from_template_part_block\' )',
1611+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_remove_theme_attribute_from_template_part_block" )',
16111612
'version' => '6.4.0',
16121613
),
16131614
'_wp_theme_json_webfonts_handler' => array(
@@ -1635,6 +1636,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16351636
'version' => '6.4.0',
16361637
),
16371638
'wp_update_https_detection_errors' => array(
1639+
// Verified correct alternative.
16381640
'alt' => 'wp_get_https_detection_errors()',
16391641
'version' => '6.4.0',
16401642
),
@@ -1652,6 +1654,60 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16521654
'alt' => 'wp_register_script_module()',
16531655
'version' => '6.5.0',
16541656
),
1657+
1658+
// WP 6.6.0.
1659+
'wp_interactivity_process_directives_of_interactive_blocks' => array(
1660+
'alt' => '',
1661+
'version' => '6.6.0',
1662+
),
1663+
'wp_render_elements_support' => array(
1664+
'alt' => 'wp_render_elements_class_name()',
1665+
'version' => '6.6.0',
1666+
),
1667+
1668+
// WP 6.7.0.
1669+
'current_user_can_for_blog' => array(
1670+
'alt' => 'current_user_can_for_site()',
1671+
'version' => '6.7.0',
1672+
),
1673+
'wp_create_block_style_variation_instance_name' => array(
1674+
'alt' => 'wp_unique_id( $variation . \'--\' )',
1675+
'version' => '6.7.0',
1676+
),
1677+
'wp_enqueue_global_styles_custom_css' => array(
1678+
'alt' => 'wp_enqueue_global_styles()',
1679+
'version' => '6.7.0',
1680+
),
1681+
'wp_get_global_styles_custom_css' => array(
1682+
'alt' => 'wp_get_global_stylesheet() or WP_Theme_JSON::get_styles_for_block()',
1683+
'version' => '6.7.0',
1684+
),
1685+
'wp_init_targeted_link_rel_filters' => array(
1686+
'alt' => '',
1687+
'version' => '6.7.0',
1688+
),
1689+
'wp_remove_targeted_link_rel_filters' => array(
1690+
'alt' => '',
1691+
'version' => '6.7.0',
1692+
),
1693+
'wp_simplepie_autoload' => array(
1694+
'alt' => 'SimplePie_Autoloader',
1695+
'version' => '6.7.0',
1696+
),
1697+
'wp_targeted_link_rel' => array(
1698+
'alt' => '',
1699+
'version' => '6.7.0',
1700+
),
1701+
'wp_targeted_link_rel_callback' => array(
1702+
'alt' => '',
1703+
'version' => '6.7.0',
1704+
),
1705+
1706+
// WP 6.8.0.
1707+
'wp_add_editor_classic_theme_styles' => array(
1708+
'alt' => 'wp_enqueue_classic_theme_styles()',
1709+
'version' => '6.8.0',
1710+
),
16551711
);
16561712

16571713
/**

0 commit comments

Comments
 (0)