Skip to content

Update list based sniffs for WP 7.0.0#2747

Open
rodrigoprimo wants to merge 6 commits into
developfrom
update-lists-for-wp-7.0
Open

Update list based sniffs for WP 7.0.0#2747
rodrigoprimo wants to merge 6 commits into
developfrom
update-lists-for-wp-7.0

Conversation

@rodrigoprimo

Copy link
Copy Markdown
Contributor

Description

NamingConventions/PrefixAllGlobals: update the functions list based on WP 7.0.0

Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.

WP/ClassNameCase: update the class lists based on WP 7.0.0

Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.

This includes the classes of the new bundled AI Client library (WordPress\AiClient\* and its dependencies WordPress\AiClientDependencies\*), added as a dedicated $aiclient_classes group.

Includes tests.

WP/DeprecatedFunctions: update the functions list based on WP 7.0.0

Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.

Includes tests.

Various sniffs: update docs to document when the lists were verified against WP Core last

WP 7.0.0 introduced no new deprecated classes, deprecated parameters, deprecated parameter values, reserved post types, pluggable classes/constants, WP time constants or capabilities, so for those sniffs only the "last verified" marker was updated.

Suggested changelog entry

  • WordPress.NamingConventions.PrefixAllGlobals has been updated to recognize pluggable functions introduced in WP up to WP 7.0.0.
  • WordPress.WP.ClassNameCase has been updated to recognize classes introduced in WP up to WP 7.0.0.
  • WordPress.WP.DeprecatedFunctions now detects functions deprecated in WordPress up to WP 7.0.0.

Additional notes

Previous PR updating list based sniffs: #2652

…n WP 7.0.0

Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.
Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.

This includes the classes of the new bundled AI Client library (`WordPress\AiClient\*` and its dependencies `WordPress\AiClientDependencies\*`), added as a dedicated `$aiclient_classes` group.

Includes tests.
Based on a scan of WP Core at commit WordPress/wordpress-develop@26b6802 (the WP 7.0.0 release tag) using a preliminary sniff created for issue #1803.

Includes tests.
…fied against WP Core

WP 7.0.0 introduced no new deprecated classes, deprecated parameters, deprecated parameter values, reserved post types, pluggable classes/constants, WP time constants or capabilities, so for those sniffs only the "last verified" marker was updated.

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for setting this up @rodrigoprimo ! Mostly looking good.

Just as a reminder - this PR should be followed-up by (or combined with) a PR/commit to update the minimum_wp_version, similar to #2656.

And the WIP branch with the utility sniffs upon which this PR has been based also needs an update as otherwise the next update will be much harder to do.

Comment thread WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php
'SimplePie\XML\Declaration\Parser',
);

/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "WP AI Client" an externally maintained package ? If not, this shouldn't be a separate list. However, if it is, some of the underlying code used to create this PR will need updating.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "WP AI Client" an externally maintained package ? If not, this shouldn't be a separate list.

My understanding is that it's externally maintained. The repository is https://github.com/WordPress/php-ai-client.

The tools/php-ai-client/README.md file in wordpress-develop says "Bundles the wordpress/php-ai-client library into WordPress Core at src/wp-includes/php-ai-client/."

The 7.0 dev note describes it the same way: "a provider-agnostic PHP SDK bundled in Core as an external library".

The WP_AI_Client_* classes are not part of the external package. They're the WordPress wrapper layer in wp-includes/ai-client/ that adapts the SDK to WordPress conventions.

However, if it is, some of the underlying code used to create this PR will need updating.

Here are the updates that I made to the code used to create the PR to address this:

rodrigoprimo@dff4738
rodrigoprimo@12d71ad

Comment thread WordPress/Sniffs/WP/ClassNameCaseSniff.php Outdated
Comment thread WordPress/Tests/WP/ClassNameCaseUnitTest.inc Outdated
rodrigoprimo and others added 2 commits July 3, 2026 09:42
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
@rodrigoprimo

Copy link
Copy Markdown
Contributor Author

Thanks for your review, @jrfnl! I believe I addressed all your remarks and this PR is ready for another check.

Just as a reminder - this PR should be followed-up by (or combined with) a PR/commit to update the minimum_wp_version, similar to #2656.

I already have a branch prepared for that. My plan is to create a separate PR once this one is merged, updating the minimum WP version. I should have mentioned this in the PR description.

And the WIP branch with the utility sniffs upon which this PR has been based also needs an update as otherwise the next update will be much harder to do.

I pushed the updates to a branch in my fork: https://github.com/rodrigoprimo/WordPress-Coding-Standards/commits/WIP/1803-update-lists-sniffs/

I made some changes that we need to discuss to see if you agree with them or not.

@jrfnl

jrfnl commented Jul 3, 2026

Copy link
Copy Markdown
Member

Just as a reminder - this PR should be followed-up by (or combined with) a PR/commit to update the minimum_wp_version, similar to #2656.

I already have a branch prepared for that. My plan is to create a separate PR once this one is merged, updating the minimum WP version. I should have mentioned this in the PR description.

👍🏻

And the WIP branch with the utility sniffs upon which this PR has been based also needs an update as otherwise the next update will be much harder to do.

I pushed the updates to a branch in my fork: https://github.com/rodrigoprimo/WordPress-Coding-Standards/commits/WIP/1803-update-lists-sniffs/

I made some changes that we need to discuss to see if you agree with them or not.

Yes please, but let's take that discussion elsewhere as it is not a blocker for this PR.

* @var string[] The class names in their "proper" case.
* The constructor will add the lowercased class name as a key to each entry.
*/
private $aiclient_classes = array(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ PR blocker ⚠️

I just looked at the updates you made to the branch used to extract the info from WP Core and this list as-is, is very far removed from the output of that branch. We need to talk about this before this PR can get merged, as it feels like this list will be very very hard to maintain/update currently (in contrast to the other lists).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants