Make WordPress Core

Opened 3 months ago

Last modified 11 days ago

#60700 new task (blessed)

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 (26)

#1 @SergeyBiryukov
2 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
2 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
2 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
2 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
2 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
2 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
2 months ago

In 57858:

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

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

See #60700.

#9 @SergeyBiryukov
2 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
2 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
2 months ago

In 57860:

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

Props mujuonly.
Fixes #60810.
See #60700.

#12 @SergeyBiryukov
2 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
2 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
2 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
2 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
2 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
8 weeks 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
8 weeks 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
8 weeks 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
7 weeks 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
7 weeks ago

In 57900:

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

See #60700.

#22 @SergeyBiryukov
7 weeks 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
6 weeks 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
5 weeks 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
12 days 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
11 days 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.

Note: See TracTickets for help on using tickets.