Use WordPress 7.0 core AI client for Plugin Namer #1195
Open
davidperezgar wants to merge 7 commits intotrunkfrom
Open
Use WordPress 7.0 core AI client for Plugin Namer #1195davidperezgar wants to merge 7 commits intotrunkfrom
davidperezgar wants to merge 7 commits intotrunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Testing notesInstalled PCP on a WordPress version older than 7.0:
Upgraded to WordPress 7.0 beta 2:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the fatal error when running Plugin Check on WordPress 7.0 beta 2 by removing the custom AI Connect integration and using WordPress core’s AI client API (
wp_ai_client_prompt) for the Plugin Namer tool. The plugin no longer depends on external AI connection code that conflicted with core in WP 7.0 beta 2.Fixes #1192
Changes
wp_ai_client_prompt()and related core APIs instead of the previous AI Connect trait. AI execution lives inAI_Check_Names::execute_ai_request()with afunction_exists('wp_ai_client_prompt')check and a clear message when the AI client is not available (WordPress 7.0+ required).includes/Admin/Settings_Page.php,includes/Traits/AI_Connect.php, andassets/js/admin-settings.js. AI is configured in WordPress 7.0+ core settings only; the plugin no longer provides its own AI settings screen.get_ai_config()to validate core AI availability (WP 7.0+,wp_ai_client_prompt, andis_supported_for_text_generation()). Addedrender_ai_notice()to show a notice on the Namer page when AI connectors are not configured.Settings_Page; only the main Admin page and Namer page are registered.Benefits
Testing Instructions
composer lintandcomposer phpstan(if applicable) and fix any reported issues.Checklist