Make WordPress Core

Opened 6 months ago

Closed 5 weeks ago

#62279 closed task (blessed) (fixed)

Coding Standards fixes for WP 6.8

Reported by: desrosj's profile desrosj Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

Previously:

Change History (85)

#1 @SergeyBiryukov
6 months ago

In 59292:

Coding Standards: Correct alignment in dropdown_cats().

Follow-up to [58284].

See #62279.

This ticket was mentioned in PR #7659 on WordPress/wordpress-develop by @sh4lin.


6 months ago
#2

  • Keywords has-patch added

## Overview

  • This PR will fix the PHPCS WordPress-core standards issues in the deprecated.php file

Trac ticket: https://core.trac.wordpress.org/ticket/62279

This ticket was mentioned in PR #7599 on WordPress/wordpress-develop by @mukesh27.


6 months ago
#3

The PR fix land in 6.8 when the coding standard ticket will be opened for `6.8

Trac ticket: https://core.trac.wordpress.org/ticket/62279

#4 @SergeyBiryukov
6 months ago

In 59328:

Docs: Correct DocBlock formatting in wp-includes/class-wp-theme-json.php.

Follow-up to [52049], [54118], [54162], [55008], [55349], [55959], [55986], [56058], [57496], [58354], [58413].

Props mukesh27, ramonopoly.
See #62279.

@SergeyBiryukov commented on PR #7599:


6 months ago
#5

Thanks for the PR! Merged in r59328.

This ticket was mentioned in PR #7955 on WordPress/wordpress-develop by @sukhendu2002.


5 months ago
#6

This PR will fix the PHPCS WordPress-core standards issues in the atomlib.php file

Trac ticket: https://core.trac.wordpress.org/ticket/62279

#7 @SergeyBiryukov
5 months ago

In 59498:

Coding Standards: Use strict comparison in wp-includes/comment-template.php.

Follow-up to [162], [2685], [4494], [8878], [8961], [55660].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#9 @audrasjb
4 months ago

In 59558:

Coding Standards: Fix a comment indentation issue in script-loader.php.

Follow-up to [58703].

Props mukesh27.
See #62279.

@audrasjb commented on PR #8036:


4 months ago
#10

Thanks for the PR
Committed in https://core.trac.wordpress.org/changeset/59558

#12 @SergeyBiryukov
4 months ago

In 59561:

Coding Standards: Use strict comparison in remove_user_from_blog().

Follow-up to mu:543.

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
See #62279, #62283.

#13 @SergeyBiryukov
4 months ago

In 59562:

Coding Standards: Use strict comparison in get_active_blog_for_user().

Follow-up to mu:804, mu:1918.

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
See #62279, #62283.

#14 @SergeyBiryukov
4 months ago

In 59563:

Coding Standards: Use strict comparison in is_user_spammy().

Follow-up to mu:1640.

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
See #62279, #62283.

#15 @SergeyBiryukov
4 months ago

In 59565:

Coding Standards: Use strict comparison in sanitize_post().

Follow-up to [12062].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#16 @SergeyBiryukov
4 months ago

In 59566:

Coding Standards: Use strict comparison in get_post_ancestors().

Follow-up to [7074], [15758], [21559], [21953].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#17 @SergeyBiryukov
4 months ago

In 59567:

Coding Standards: Use strict comparison in wp_count_attachments().

Follow-up to [54255].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#18 @SergeyBiryukov
4 months ago

In 59572:

Coding Standards: Use strict comparison in _reset_front_page_settings_for_post().

Follow-up to [6337], [25686].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#19 @SergeyBiryukov
4 months ago

In 59573:

Coding Standards: Use strict comparison in wpmu_validate_blog_signup().

Follow-up to mu:8, mu:543, mu:550, mu:1364, mu:1958, [12603], [32733].

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
See #62279, #62283.

#20 @SergeyBiryukov
4 months ago

In 59574:

Coding Standards: Replace loose comparison in wpmu_welcome_notification().

Follow-up to mu:543.

Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov.
Fixes #62283. See #62279.

#21 @SergeyBiryukov
4 months ago

In 59575:

Coding Standards: Use strict comparison in get_pages().

Follow-up to [4180], [49108].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#22 @SergeyBiryukov
4 months ago

In 59584:

Coding Standards: Use strict comparison in wp_check_for_changed_slugs().

Follow-up to [4556], [4637], [34685].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#23 @SergeyBiryukov
4 months ago

In 59593:

Coding Standards: Use strict comparison in wp_check_for_changed_dates().

Follow-up to [42401].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#24 @SergeyBiryukov
4 months ago

In 59596:

Coding Standards: Use strict comparison in get_posts_by_author_sql().

Follow-up to [13576], [25669].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#25 @SergeyBiryukov
4 months ago

In 59597:

Coding Standards: Use strict comparison in wp_check_post_hierarchy_for_loops().

Follow-up to [10129], [15806].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#26 @SergeyBiryukov
4 months ago

In 59599:

Coding Standards: Use strict comparison in get_page_by_path().

Follow-up to [3511], [18541], [19075], [21845].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#27 @SergeyBiryukov
3 months ago

In 59606:

Coding Standards: Use strict comparison in paginate_links().

Follow-up to [4275], [28785].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#28 @SergeyBiryukov
3 months ago

In 59632:

Coding Standards: Use strict comparison in wp_xmlrpc_server::_multisite_getUsersBlogs().

Follow-up to mu:1218, [12852].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#29 @SergeyBiryukov
3 months ago

In 59660:

Coding Standards: Use strict comparison in wp_xmlrpc_server::wp_deleteCategory().

Follow-up to [20157], [32733].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#30 @SergeyBiryukov
3 months ago

In 59663:

Coding Standards: Use strict comparison in wp_xmlrpc_server::pingback_ping().

Follow-up to [2983], [55365].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#31 @SergeyBiryukov
3 months ago

In 59664:

Coding Standards: Rename the $dateCreated variable in wp_xmlrpc_server methods.

This resolves a few WPCS warnings:

Variable "$dateCreated" is not in valid snake_case format, try "$date_created"

Follow-up to [1563], [1659], [5888], [6691], [8543], [19848].

See #62279.

#32 @SergeyBiryukov
3 months ago

In 59665:

Coding Standards: Rename the $isPrimary variable in wp_xmlrpc_server methods.

This resolves a few WPCS warnings:

Variable "$isPrimary" is not in valid snake_case format, try "$is_primary"

Additionally, this commit renames $catids to $cat_ids for consistency.

Follow-up to [1671].

See #62279.

#33 @SergeyBiryukov
3 months ago

In 59672:

Coding Standards: Rename the $errorString variable in wp_xmlrpc_server methods.

This resolves a WPCS warning:

Variable "$errorString" is not in valid snake_case format, try "$error_string"

Follow-up to [5054].

See #62279.

#34 @SergeyBiryukov
3 months ago

In 59680:

Coding Standards: Rename $thisEnclosure variable in wp_xmlrpc_server methods.

This resolves a WPCS warning:

Variable "$thisEnclosure" is not in valid snake_case format, try "$this_enclosure"

Follow-up to [16824], [19848].

See #62279.

#35 @SergeyBiryukov
3 months ago

In 59697:

Coding Standards: Rename the $ID variable in wp_xmlrpc_server methods.

This resolves a WPCS warning:

Variable "$ID" is not in valid snake_case format, try "$i_d"

Follow-up to [28448].

See #62279.

#36 @johnbillion
3 months ago

@SergeyBiryukov The changes to the variables that get compact()ed in [59697] has broken post updates in XML-RPC. Want to take a look?

#37 @SergeyBiryukov
3 months ago

In 59699:

XML-RPC: Correctly pass the ID value to wp_update_post() in ::mw_editPost().

Follow-up to [59697].

Props johnbillion.
See #62279.

#38 @SergeyBiryukov
3 months ago

In 59707:

Coding Standards: Use strict comparison in wp_xmlrpc_server::_insert_post().

Follow-up to [19848].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#39 @SergeyBiryukov
3 months ago

In 59710:

Coding Standards: Use strict comparison in wp_xmlrpc_server::_prepare_comment().

Follow-up to [20856].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#40 @SergeyBiryukov
3 months ago

In 59713:

Coding Standards: Use strict comparison in wp_xmlrpc_server::mw_newPost().

Follow-up to [5281].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#41 @SergeyBiryukov
3 months ago

In 59726:

Coding Standards: Use strict comparison in wp_xmlrpc_server::set_custom_fields().

Follow-up to [40692].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#42 @audrasjb
3 months ago

In 59733:

Coding standards: Remove unused variables from privacy_policy_guide() function.

See #62279.

#43 @SergeyBiryukov
3 months ago

In 59738:

Coding Standards: Use strict comparison in wp_xmlrpc_server::wp_getUsersBlogs().

Includes a micro-optimization to avoid calling get_current_network_id() in a loop.

Follow-up to [8075], [9798], [26120], [38814].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#44 @SergeyBiryukov
3 months ago

In 59748:

Coding Standards: Replace loose comparison in wp_xmlrpc_server::wp_setOptions().

Follow-up to [8114].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#45 @SergeyBiryukov
3 months ago

In 59750:

Coding Standards: Use strict comparison in some legacy media functions.

Follow-up to [7062], [8653], [12188].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#46 @SergeyBiryukov
3 months ago

In 59751:

Coding Standards: Use strict comparison in get_media_item().

Follow-up to [12081], [12351].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#47 @SergeyBiryukov
3 months ago

In 59755:

Coding Standards: Use a more meaningful variable name in WP_List_Table::months_dropdown().

As per the Naming Conventions:

Don't abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

Follow-up to [8646], [15491].

See #62279.

#48 @SergeyBiryukov
3 months ago

In 59767:

Coding Standards: Use strict comparison in media_upload_library_form().

Includes bringing some consistency with a similar fragment in WP_List_Table::months_dropdown().

Follow-up to [3724], [7062], [15491], [59755].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#49 @SergeyBiryukov
3 months ago

In 59774:

Coding Standards: Use strict comparison in wp_get_archives().

Follow-up to [24], [114].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#50 @SergeyBiryukov
3 months ago

In 59792:

Coding Standards: Use strict comparison in WP_Query::the_post() and ::have_posts().

Follow-up to [2716], [2741], [11464].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#51 @SergeyBiryukov
3 months ago

In 59796:

Coding Standards: Use strict comparison in WP_Query::the_comment() and ::have_comments().

Follow-up to [4934].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#52 @SergeyBiryukov
3 months ago

In 59805:

Coding Standards: Correct default values in WP_Comment to match the documented type.

Follow-up to [33891], [48941].

See #62279.

#53 @SergeyBiryukov
2 months ago

In 59816:

Coding Standards: Correct default values in WP_Post to match the documented type.

Follow-up to [22264], [25086].

See #62279.

#54 @SergeyBiryukov
2 months ago

In 59826:

Coding Standards: Use strict comparison in wp_get_comment_status().

Follow-up to [546], [2258], [5666], [47219], [47808].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#55 @SergeyBiryukov
2 months ago

In 59827:

Coding Standards: Use strict comparison in pingback().

Follow-up to [2983], [38852].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#56 @SergeyBiryukov
2 months ago

In 59840:

Coding Standards: Use strict comparison in wp_new_comment_notify_moderator().

Follow-up to [2894], [34106], [34250], [34252], [35339].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#57 @SergeyBiryukov
2 months ago

In 59841:

Coding Standards: Use strict comparison in wp_new_comment_notify_postauthor().

Follow-up to [2894], [34106], [34250], [34545], [36119].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#58 @SergeyBiryukov
2 months ago

In 59852:

Coding Standards: Use strict comparison in wp_delete_comment().

Follow-up to [3271], [47219].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#59 @SergeyBiryukov
2 months ago

In 59860:

Coding Standards: Use strict comparison in get_page_of_comment().

Follow-up to [9367], [9522], [9808].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#61 @peterwilsoncc
2 months ago

In 59862:

Coding Standards: Rename variable in update_meta_cache() for accuracy.

Renames the variable $cache_key to $cache_group in update_meta_cache() for accuracy.

Follow up to [11943].
See #62279.

#63 @SergeyBiryukov
2 months ago

In 59867:

Coding Standards: Use strict comparison in wp_transition_comment_status().

Follow-up to [9195].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#64 @SergeyBiryukov
2 months ago

In 59887:

Coding Standards: Use strict comparison in privacy_ping_filter().

Follow-up to [3548], [3885].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#65 @SergeyBiryukov
8 weeks ago

In 59898:

Coding Standards: Use strict comparison in wp_insert_comment().

Follow-up to [3104], [3193], [3887].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#66 @swissspidy
8 weeks ago

In 59903:

Coding Standards: Revert strict comparison added in [59898].

$comment_approved can be both a string or an integer, so this change had unintended consequences such as breaking WP-CLI tests.

See #62279.

#67 @SergeyBiryukov
8 weeks ago

In 59915:

Coding Standards: Use strict comparison in wp_insert_comment().

Includes type casting $comment_approved to an integer to avoid breaking WP-CLI tests, since the value can be passed as a string.

Follow-up to [3104], [3193], [3887], [59903].

Props swissspidy.
See #62279.

#68 @desrosj
8 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to assigned

Assigning to @SergeyBiryukov as the primary driver for this ticket throughout 6.8 so that he can see any remaining items are wrapped up and this ticket is eventually closed.

#69 @SergeyBiryukov
8 weeks ago

In 59947:

Coding Standards: Fix WPCS issues in get_calendar().

Includes:

  • Using strict comparison and $wpdb::prepare().
  • Removing one-time variables so that $wpdb::prepare() calls are picked up correctly by PHPCS.
  • Bringing consistency to the type of internal variables, i.e. $thismonth and $thisyear are both an integer now.

Follow-up to [508], [509], [510], [716], [933], [12590], [34463], [44809], [47223], [59908].

See #62279.

#70 @SergeyBiryukov
7 weeks ago

In 59953:

Coding Standards: Correct conditional formatting in get_calendar().

Follow-up to [59947].

See #62279.

#71 @SergeyBiryukov
7 weeks ago

In 59957:

Coding Standards: Use strict comparison in check_comment().

Follow-up to [1012], [1737], [48121].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#72 @SergeyBiryukov
7 weeks ago

In 59962:

Coding Standards: Use strict comparison in _fix_attachment_links().

Follow-up to [20308], [58360].

See #62279.

#73 @SergeyBiryukov
7 weeks ago

In 59975:

Coding Standards: Use strict comparison in wp_check_comment_data().

Follow-up to [2894], [28437], [59319].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#74 @SergeyBiryukov
7 weeks ago

In 59976:

Coding Standards: Use strict comparison in WP_Query::get_posts(), take 1.

Follow-up to [4112], [17552], [19918], [20740], [56513], [56656].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#75 @jorbin
6 weeks ago

In 60043:

Coding Standards: Correct alignment in parameters passed to wp_editor.

Follow-up to [59188].

See #29838, #62279.

#76 @jorbin
6 weeks ago

In 60044:

Coding Standards: Fix alignment in WP_REST_Widgets_Controller::prepare_item_for_response.

Follow-up to [59899].

See #56481, 62279.

#77 @jorbin
6 weeks ago

In 60046:

Coding Standards: Fix alignment in locate_block_template.

Follow-up to [59449].

See #62053, #62279.

#78 @jorbin
6 weeks ago

In 60047:

Coding Standards: Fix alignment in WP_Image_Editor_Imagick::thumbnail_image.

Follow-up to [59589].

See #36477, #62279.

#79 @jorbin
6 weeks ago

In 60048:

Coding Standards: Fix alignment in WP_Query::parse_tax_query.

Follow-up to [59766].

See #59516, #62279.

#80 @jorbin
6 weeks ago

In 60049:

Coding Standards: Fix alignment in wp_check_filetype_and_ext.

Follow-up to [59315].

See #62272, #62279.

This ticket was mentioned in PR #8540 on WordPress/wordpress-develop by @jorbin.


6 weeks ago
#81

#82 @SergeyBiryukov
5 weeks ago

In 60069:

Coding Standards: Remove a one-time variable in WP_MS_Sites_List_Table::prepare_items().

This allows the $wpdb::prepare() call to be picked up correctly by PHPCS.

Follow-up to [28712], [55656].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#83 @jorbin
5 weeks ago

In 60071:

Coding Standards: Update commits to ignore for blaming for 6.8

This adds white space only changes made during 6.8 to the list of commits which we instruct git blame to ignore. Excluding them helps to reduce the noise when doing code archaeology.

Follow-up to [53007].

Props jorbin, peterwilsoncc.
See #62279.

#84 @SergeyBiryukov
5 weeks ago

In 60072:

Coding Standards: Remove a one-time variable in WP_Privacy_Requests_Table::get_request_counts().

This allows the $wpdb::prepare() call to be picked up correctly by PHPCS.

Follow-up to [43008], [45448].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

#85 @desrosj
5 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

I've gone and opened #63168 for the 6.9 cycle. If any other issues come up for 6.8, this can be reopened.

Note: See TracTickets for help on using tickets.