WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 3 months ago

#52627 closed task (blessed) (fixed)

Coding Standards fixes for WP 5.8

Reported by: SergeyBiryukov Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

Previously:

Change History (62)

#1 @SergeyBiryukov
7 months ago

In 50533:

Coding Standards: Remove some extra whitespace in sanitize_comment_cookies().

See #52627.

#2 @SergeyBiryukov
7 months ago

In 50557:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-upgrader.php.

See #52627.

#3 @SergeyBiryukov
7 months ago

In 50558:

Coding Standards: Use strict comparison for return type checks in a few functions:

  • get_bookmark()
  • get_comment()
  • get_post()
  • get_children()
  • wp_get_recent_posts()
  • wp_get_post_revision()
  • wp_get_nav_menu_items()

Follow-up to [45710] for get_term(), [48507] for wpdb::get_row() and wpdb::get_results().

See #52627.

#4 @SergeyBiryukov
7 months ago

In 50560:

Coding Standards: Add missing semicolon to some endif keywords.

See #52627.

#5 @SergeyBiryukov
7 months ago

In 50561:

Coding Standards: Move some translator comments to the correct place.

Follow-up to [48172].

See #52627.

#6 @SergeyBiryukov
7 months ago

In 50618:

Coding Standards: Remove some extra whitespace in _wp_translate_postdata().

See #52627.

#7 follow-up: @davidbaumwald
7 months ago

In [50631]:

Coding Standards: Removing unnecessary parentheses from require_once in wp-admin/options-privacy.php.

In [47198], parentheses were removed from include and require statements, as they are language constructs, not function calls. However, [50161] introduced a new require_once instance in wp-admin/options-privacy.php. This change removes the unnecessary parentheses.

See #53627.

Last edited 7 months ago by davidbaumwald (previous) (diff)

#8 @davidbaumwald
7 months ago

In 50632:

Coding Standards: Remove some extra whitespace in get_item_schema.

Introduced in [50527].

See #52627.

#9 in reply to: ↑ 7 ; follow-up: @mukesh27
7 months ago

@davidbaumwald Do we need to remove parentheses from here https://github.com/WordPress/WordPress/blob/master/wp-includes/class-requests.php#L146?

Replying to davidbaumwald:

In [50631]:

Coding Standards: Removing unnecessary parentheses from require_once in wp-admin/options-privacy.php.

In [47198], parentheses were removed from include and require statements, as they are language constructs, not function calls. However, [50161] introduced a new require_once instance in wp-admin/options-privacy.php. This change removes the unnecessary parentheses.

See #53627.

#10 in reply to: ↑ 9 @davidbaumwald
7 months ago

Replying to mukesh27:

@davidbaumwald Do we need to remove parentheses from here https://github.com/WordPress/WordPress/blob/master/wp-includes/class-requests.php#L146?

Replying to davidbaumwald:

In [50631]:

Coding Standards: Removing unnecessary parentheses from require_once in wp-admin/options-privacy.php.

In [47198], parentheses were removed from include and require statements, as they are language constructs, not function calls. However, [50161] introduced a new require_once instance in wp-admin/options-privacy.php. This change removes the unnecessary parentheses.

See #53627.

@mukesh27 Good catch, but that's one of the third-party library exclusions. See https://core.trac.wordpress.org/browser/tags/5.7/phpcs.xml.dist#L116

#11 @mukesh27
7 months ago

@davidbaumwald Thanks for the information.

https://github.com/WordPress/WordPress/commits/master/wp-includes/class-requests.php

If you check GitHub history for that file then you found that core developer's changed some code as per new possible updates.

#12 @SergeyBiryukov
7 months ago

In 50652:

Coding Standards: Use strict comparison in wp-admin/includes/class-core-upgrader.php.

See #52627.

#13 @SergeyBiryukov
7 months ago

In 50654:

Coding Standards: Move some translator comments to the correct place.

Follow-up to [46273], [50060], [50117].

See #52627.

#14 @SergeyBiryukov
7 months ago

Since [50060] and [50117] were in 5.7, going to merge [50654] to the 5.7 branch too.

#15 @SergeyBiryukov
7 months ago

In 50655:

Coding Standards: Move some translator comments to the correct place.

Follow-up to [46273], [50060], [50117].

Merges [50654] to the 5.7 branch.
See #52627.

#16 @SergeyBiryukov
7 months ago

In 50657:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-filesystem-*.php.

See #52627.

#17 @SergeyBiryukov
7 months ago

In 50658:

Coding Standards: Give some variables in WP_Importer a more meaningful name.

See #52627.

#18 @SergeyBiryukov
6 months ago

In 50664:

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

See #52627.

#19 @SergeyBiryukov
6 months ago

In 50665:

Coding Standards: Use strict comparison in wp-admin/includes/credits.php.

See #52627.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


6 months ago

#21 @SergeyBiryukov
6 months ago

In 50689:

Coding Standards: Use strict comparison in wp-admin/includes/dashboard.php.

Includes minor code layout fixes for better readability.

See #52627.

#22 @SergeyBiryukov
6 months ago

In 50696:

Coding Standards: Give a variable in wp-admin/themes.php a more meaningful name.

Follow-up to [20029].

See #52627.

#23 @SergeyBiryukov
6 months ago

In 50699:

Coding Standards: Simplify the check for parent terms in export_wp().

This is more consistent with similar checks elsewhere in core.

See #52627.

#24 @SergeyBiryukov
6 months ago

In 50700:

Coding Standards: Use strict comparison in wp-admin/includes/file.php.

Includes minor code layout fixes for better readability.

See #52627.

#25 @SergeyBiryukov
6 months ago

In 50701:

Coding Standards: Rewrite a fragment in request_filesystem_credentials() for clarity and to avoid repetition.

Follow-up to [8540], [8865].

See #52627.

#26 @SergeyBiryukov
6 months ago

In 50706:

Coding Standards: Use strict comparison in wp-admin/includes/class-custom-background.php.

Includes minor code layout fixes for better readability.

See #52627.

#27 @SergeyBiryukov
6 months ago

In 50707:

Coding Standards: Use strict comparison in wp-admin/includes/class-custom-image-header.php.

Includes minor code layout fixes for better readability.

See #52627.

#28 @SergeyBiryukov
6 months ago

In 50759:

Coding Standards: Give a variable in WP_Automatic_Updater::after_core_update() a more meaningful name.

Follow-up to [25841], [25873], [25882].

See #52627.

#29 @SergeyBiryukov
6 months ago

In 50762:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-automatic-updater.php.

Includes minor code layout fixes for better readability.

See #52627.

#30 @SergeyBiryukov
6 months ago

In 50767:

Coding Standards: Use strict comparison in wp-admin/includes/class-walker-nav-menu-edit.php.

See #52627.

#31 @SergeyBiryukov
6 months ago

In 50768:

Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-comments-list-table.php.

  • Rename method argument in WP_Comments_List_Table::floated_admin_avatar() per the naming conventions.
  • Use strict comparison in WP_Comments_List_Table::handle_row_actions().

See #52627.

#32 @SergeyBiryukov
6 months ago

In 50770:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-media-list-table.php.

Includes minor code layout fixes for better readability.

See #52627.

#33 @davidbaumwald
6 months ago

In 50779:

Coding Standards: Fix minor, inline spacing issue in wp-admin/setup-config.php.

See #52627.

#34 @SergeyBiryukov
6 months ago

In 50780:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-terms-list-table.php.

Includes minor code layout fixes for better readability.

See #52627.

#35 @SergeyBiryukov
6 months ago

In 50783:

Coding Standards: Remove loose comparison in wp-admin/includes/plugin-install.php.

This more closely represents how the active installations count is displayed in the Plugin Directory.

See #52627.

#36 @SergeyBiryukov
6 months ago

In 50785:

Coding Standards: Use strict comparison in wp-admin/includes/update-core.php.

Includes minor code layout fixes for better readability.

See #52627.

#37 @SergeyBiryukov
6 months ago

In 50795:

Coding Standards: Fix a precision alignment issue in wp-admin/includes/template.php.

Follow-up to [49223].

See #52627.

This ticket was mentioned in Slack in #core by sergey. View the logs.


6 months ago

#39 @SergeyBiryukov
6 months ago

In 50804:

Coding Standards: Use strict comparison in wp-admin/includes/class-wp-posts-list-table.php.

Includes minor code layout fixes for better readability.

See #52627.

#40 @SergeyBiryukov
6 months ago

In 50805:

Coding Standards: Fix a whitespace at end of line issue in wp-admin/includes/class-wp-comments-list-table.php.

Includes minor code layout fixes for better readability.

See #52627.

#41 @SergeyBiryukov
5 months ago

In 50832:

Coding Standards: Use strict comparison in wp-admin/includes/screen.php.

See #52627.

This ticket was mentioned in Slack in #core by david.baumwald. View the logs.


5 months ago

#43 @SergeyBiryukov
5 months ago

In 51047:

Coding Standards: Use strict comparison in wp-includes/class-wp-customize-nav-menus.php.

See #52627.

#44 @SergeyBiryukov
5 months ago

In 51070:

Coding Standards: Simplify the logic in WP_Widget::get_field_name() and ::get_field_id().

Includes minor code layout fixes for better readability.

Follow-up to [41292], [50953], [50961].

Props 5ubliminal, solarissmoke, tamlyn, jdgrimes, jorbin, stevenkword, drebbits.web, westonruter, jipmoors, justinahinon, helen, lukecarbis, Mte90, hellofromTonya, SergeyBiryukov.
See #16773, #52627.

#45 @SergeyBiryukov
4 months ago

In 51075:

Coding Standards: Use strict comparison in wp-admin/options-media.php.

See #52627.

#46 @desrosj
4 months ago

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

Today is beta 1 day. Since coding standards updates usually touch code, I'm going to close this out.

If there are any more changes required between now and the actual 5.8 release, this can be referenced and reopened if necessary.

#47 @SergeyBiryukov
4 months ago

In 51154:

Coding Standards: Remove a one-time $message variable in some _doing_it_wrong() calls.

This brings some consistency with most other calls.

Follow-up to [23378], [25605], [34745], [36219], [44108], [46111], [48156].

See #52627.

#48 @SergeyBiryukov
4 months ago

In 51155:

Coding Standards: Remove a one-time $message variable in WordPress version requirement notices for bundled themes.

This makes the formatting of these messages more consistent.

Follow-up to [23816], [51154].

See #52627.

#49 @SergeyBiryukov
4 months ago

In 51158:

Coding Standards: Use consistent formatting for _wp_posts_page_notice() and _wp_block_editor_posts_page_notice().

Remove redundant casting to int for post ID, which is always an integer.

Follow-up to [51116].

See #45537, #52627.

#50 @SergeyBiryukov
4 months ago

In 51160:

I18N: Remove redundant default text domain parameter in some __() calls.

Follow-up to [43919], [44262], [48141], [50259].

See #52627.

#51 @SergeyBiryukov
4 months ago

In 51178:

Coding Standards: Bring some consistency to HTML formatting in wp-admin/comment.php.

See #52627.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


4 months ago

#53 @SergeyBiryukov
4 months ago

In 51287:

Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests.

Follow-up to [50959], [50960], [50967].

See #52627.

#54 @SergeyBiryukov
4 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to merge [51287] to the 5.8 branch.

#55 @desrosj
4 months ago

  • Keywords commit dev-reviewed added

#56 @desrosj
4 months ago

  • Owner set to desrosj
  • Resolution set to fixed
  • Status changed from reopened to closed

In 51305:

Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests.

Follow-up to [50959], [50960], [50967].

Props SergeyBiryukov.
Merges [51287] to the 5.8 branch.
Fixes #52627.

#57 @SergeyBiryukov
3 months ago

In 51400:

Bundled Themes: Correct comment formatting in inc/block-patterns.php.

Follow-up to [51045], [51103].

Props kapilpaul.
See #53359, #52627.

#58 @SergeyBiryukov
3 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to merge [51400] to the 5.8 branch.

#59 @desrosj
3 months ago

In 51406:

Bundled Themes: Correct comment formatting in inc/block-patterns.php.

Follow-up to [51045], [51103].

Props kapilpaul, SergeyBiryukov.
See #53359, #52627.

#60 @desrosj
3 months ago

With the final RC due out tomorrow (RC3), today is the final day to consider any further adjustments for backporting.

#61 @desrosj
3 months ago

  • Keywords fixed-major commit dev-reviewed removed

#62 @desrosj
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.