Skip to content

Integrate Plugin Check Namer as standard AI Name Check - #1449

Open
davidperezgar wants to merge 10 commits into
trunkfrom
namer-integrated
Open

Integrate Plugin Check Namer as standard AI Name Check#1449
davidperezgar wants to merge 10 commits into
trunkfrom
namer-integrated

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

Closes #1370

Integrates the standalone Plugin Check Namer tool into Plugin Check as a new AI Name Check, available as a checkbox under the AI settings on the Tools > Plugin Check admin page, in the CLI (--ai-name), and via AJAX.

The check analyzes the plugin's display name (read from its own headers, no extra input required) and reports:

  • Disallowed / generic names (plugin_name_disallowed)
  • Possible naming issues (plugin_name_issue)
  • Possible trademark/ownership issues (plugin_name_trademark_issue)
  • Similarity with existing plugins in the directory (plugin_name_similarity)

Changes

  • Added WordPress\Plugin_Check\Checker\Checks\Plugin_Repo\AI_Name_Check, a new Static_Check registered in Default_Check_Repository under the ai_name slug (Plugin Repo category), reusing the existing AI_Check_Names / AI_Utils traits for the AI analysis logic.
  • Removed the standalone Namer_Page admin page and its dedicated plugin-check-namer.js script, since the functionality now lives inside the main Plugin Check tool.
  • Added Abstract_Check_Runner::set_use_ai_name() / should_use_ai_name() / get_ai_model_preference() so runners (AJAX, CLI) can toggle and expose the new option.
  • Added a --ai-name flag to the wp plugin check CLI command.
  • Added an "AI" section on the admin page with an "Analysis" and a "Name Check" checkbox (labels simplified, without a redundant "Enable" prefix).
  • Fixed a bug where AI Name Check results never appeared in the admin UI: Plugin_Request_Utility::get_runner() was always null during static-check-only AJAX requests (the runner is otherwise only registered via the object-cache.php drop-in used for runtime checks), so AI_Name_Check::run() silently bailed out even when the checkbox was checked. Added Plugin_Request_Utility::set_runner() and register the runner from Admin_AJAX::get_ajax_runner(), reusing that same instance in run_checks().
  • Added AI_Name_Check_Tests covering the new check.

Testing

  • Verified via WP-CLI: wp plugin check <plugin> --checks=ai_name --ai-name --require=./wp-content/plugins/plugin-check/cli.php.
  • Verified in the browser (Tools > Plugin Check admin page) that toggling "Name Check" on/off correctly shows/hides the AI-generated name findings, both with categories selected and with no category selected.
  • Confirmed no PHP fatal errors/notices in debug.log during either flow.

Disclaimer

Part of this PR (code and/or this description) was developed with the assistance of AI (Claude, via GitHub Copilot / Claude Code). All changes have been manually reviewed and tested by a human before submission.

Open WordPress Playground Preview

@github-actions

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ishitaj34 <ishitaj34@git.wordpress.org>
Co-authored-by: davidperezgar <davidperez@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

…ility

The new set_runner() method (added to support AI Name Check in AJAX-only
static check requests) pushed the public method count above PHPMD's
threshold. Suppressing the rule here follows the same pattern already used
in Admin_Page, Settings_Page, Abstract_Check_Runner and Check_Result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate Plugin Check Namer into Plugin Check AI Analysis

2 participants