Update list based sniffs for WP 7.0.0#2747
Conversation
…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
left a comment
There was a problem hiding this comment.
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.
| 'SimplePie\XML\Declaration\Parser', | ||
| ); | ||
|
|
||
| /** |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
|
Thanks for your review, @jrfnl! I believe I addressed all your remarks and this PR is ready for another check.
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.
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( |
There was a problem hiding this comment.
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).
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 dependenciesWordPress\AiClientDependencies\*), added as a dedicated$aiclient_classesgroup.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.PrefixAllGlobalshas been updated to recognize pluggable functions introduced in WP up to WP 7.0.0.WordPress.WP.ClassNameCasehas been updated to recognize classes introduced in WP up to WP 7.0.0.WordPress.WP.DeprecatedFunctionsnow detects functions deprecated in WordPress up to WP 7.0.0.Additional notes
Previous PR updating list based sniffs: #2652