Make WordPress Core

Opened 5 months ago

Closed 4 weeks ago

Last modified 3 weeks ago

#60700 closed task (blessed) (fixed)

Coding Standards fixes for WP 6.6

Reported by: mukesh27's profile mukesh27 Owned by:
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch has-unit-tests
Focuses: coding-standards Cc:

Description

Previously:

Change History (33)

#1 @SergeyBiryukov
5 months ago

In 57829:

Coding Standards: Update the config for WordPress.PHP.NoSilencedErrors in PHPCS ruleset.

Includes alphabetizing the third party library exclusions section.

Follow-up to [50810], [51658], [57524].

See #60700.

#3 @SergeyBiryukov
5 months ago

In 57833:

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

Follow-up to [1632], [12507].

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

#4 @SergeyBiryukov
5 months ago

In 57847:

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

Follow-up to [20029], [20119], [20144].

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

#5 @SergeyBiryukov
5 months ago

In 57848:

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

Follow-up to [6384], [6456], [6858], [8494], [8961].

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

#6 @SergeyBiryukov
5 months ago

In 57850:

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

Follow-up to [8869], [9207], [23694], [47887].

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

#7 @SergeyBiryukov
5 months ago

In 57857:

Coding Standards: Rename the $postid parameter to $post_id in wp_delete_post().

This matches the parameter name in wp_trash_post() and all the other functions receiving post ID as a parameter.

See #60700.

#8 @SergeyBiryukov
5 months ago

In 57858:

Coding Standards: Rename the remaining $postid instances in wp_delete_post().

Follow-up to [57853], [57857].

See #60700.

#9 @SergeyBiryukov
5 months ago

In 57859:

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

Follow-up to [3880].

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

#10 follow-up: @knutsp
5 months ago

Just wondering. The expression in line 127

$bookmark->link_image && $parsed_args['show_images']

seems to be a boolean, because it contains a boolean operator. How can it ever be identical to an empty string?

#11 @swissspidy
5 months ago

In 57860:

Coding Standards: Rename the $postid parameter to $post_id in `has_meta().

Props mujuonly.
Fixes #60810.
See #60700.

#12 @SergeyBiryukov
5 months ago

In 57867:

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

Follow-up to [4475], [6365], [8706], [9296], [9318], [14141], [15819], [21364], [27802].

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

#13 in reply to: ↑ 10 ; follow-up: @SergeyBiryukov
5 months ago

Replying to knutsp:

Just wondering. The expression in line 127

$bookmark->link_image && $parsed_args['show_images']

seems to be a boolean, because it contains a boolean operator. How can it ever be identical to an empty string?

Unless I'm missing something, the '' !== $bookmark->link_image part should be evaluated first.

#14 in reply to: ↑ 13 @knutsp
5 months ago

Replying to SergeyBiryukov:

Replying to knutsp:

Just wondering. The expression in line 127

$bookmark->link_image && $parsed_args['show_images']

seems to be a boolean, because it contains a boolean operator. How can it ever be identical to an empty string?

Unless I'm missing something, the '' !== $bookmark->link_image part should be evaluated first.

Of course it will. I was missing that.

#15 @SergeyBiryukov
4 months ago

In 57873:

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

Follow-up to [21], [3570], [3845], [8758].

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

#16 @SergeyBiryukov
4 months ago

In 57874:

Coding Standards: Use strict comparison in wp-includes/ms-blogs.php.

Follow-up to [12603], [12948], [13125], [13126], [21480], [21485], [38457], [41625], [43654], [43655], [45794].

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

#17 @SergeyBiryukov
4 months ago

In 57877:

Coding Standards: Use strict comparison in wp-includes/ms-load.php.

Follow-up to [12602], [12688], [12896], [27359], [37475].

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

#18 @SergeyBiryukov
4 months ago

In 57882:

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

Follow-up to [3566], [6387], [10437], [11057], [11387], [16208], [16304], [18195], [20410], [26367], [34947].

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

#19 @SergeyBiryukov
4 months ago

In 57883:

Coding Standards: Use strict comparison in wp-includes/pomo/plural-forms.php.

Follow-up to [41722].

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

#20 @SergeyBiryukov
4 months ago

In 57899:

Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-gd.php.

Follow-up to [22094], [22817], [50810], [57524].

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

#21 @SergeyBiryukov
4 months ago

In 57900:

Coding Standards: Revert [57899] pending test failure investigation.

See #60700.

#22 @SergeyBiryukov
4 months ago

In 57917:

Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-gd.php.

Follow-up to [22094], [22817], [50810], [57524].

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

#23 @SergeyBiryukov
4 months ago

In 57934:

Coding Standards: Use strict comparison in wp-includes/class-wp-image-editor-imagick.php.

Follow-up to [22094].

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

#24 @SergeyBiryukov
4 months ago

In 57990:

Users: Account for returning false from the authenticate filter.

While technically only null, WP_User, or WP_Error should be returned from the authenticate filter, a plugin might return boolean false instead, which would trigger the authentication_failed error prior to [57882].

This commit aims to preserve that behavior in case false is returned.

Follow-up to [57882].

Props johnbillion.
See #60700.

#25 @SergeyBiryukov
3 months ago

In 58119:

Coding Standards: Use strict comparison in wp-includes/nav-menu.php.

Follow-up to [14248], [14285], [14878], [15008], [22235], [23897], [23941], [27150].

Props dhruvang21, aristath, poena, afercia, SergeyBiryukov.
Fixes #61160. See #60700.

#26 @SergeyBiryukov
3 months ago

In 58124:

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

Includes correcting a conditional in _wp_menu_item_classes_by_context() where $parent_item->object, which contains a string like page, was erroneously compared to the queried object's ID. The correct property to compare is $parent_item->object_id.

Follow-up to [14876], [14923], [14942], [15302], [16731], [16742], [22302], [47550], [47557], [47808].

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

#27 @SergeyBiryukov
2 months ago

In 58277:

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

Follow-up to [5017], [5018], [6228], [13494], [15582], [23653], [44941].

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

#28 @SergeyBiryukov
2 months ago

In 58287:

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

Follow-up to [6213], [8296], [8720], [9098], [10204], [10476], [10912], [11644], [11749], [12008], [12036], [13489], [17354], [17832], [18663], [18796], [18937], [22843], [28892], [33356].

Props mujuonly, nihar007, aristath, poena, afercia, SergeyBiryukov.
See #58988, #60700.

#29 @SergeyBiryukov
2 months ago

In 58360:

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

Follow-up to [2718], [7103], [7338], [8857], [9036], [9103], [11807], [11908], [15315], [16901], [17078], [23725], [23735], [44141], [45583].

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

#30 @SergeyBiryukov
2 months ago

In 58366:

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

Follow-up to [12025], [14850], [15641], [20029], [22436], [35738], [36915], [58213].

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

#31 @SergeyBiryukov
8 weeks ago

In 58374:

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

Follow-up to [3724], [5575], [15642], [17202].

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

#32 @hellofromTonya
4 weeks ago

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

The last scheduled RC is happening within <= 1 hour, closing this ticket as fixed.

Thank you everyone for contributing to improving the code to the coding standards :)

#61607 is now open for the 6.7 cycle.

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


3 weeks ago

Note: See TracTickets for help on using tickets.