Skip to content

Conversation

@davidperezgar
Copy link
Member

@davidperezgar davidperezgar commented Dec 13, 2025

Fixes #1124

This pull request (PR) introduces a new Plugin Check Namer tool that uses AI-powered analysis to help plugin authors evaluate plugin names for potential conflicts, trademark issues, and naming best practices. This PR adapts the Internal Scanner Namer Tool, created by @frantorres, for PCP, enabling authors to use this useful tool.
We are also beginning to implement AI in PCP.

Overview

The Plugin Check Namer tool provides guidance on plugin naming by:

  • Checking for similarity to existing plugins
  • Identifying potential trademark conflicts
  • Evaluating naming conventions and best practices
  • Providing suggestions for improvement

Changes

New Features

1. Plugin Check Namer Tool (includes/Admin/Namer_Page.php)

  • New admin page accessible via Tools → Plugin Check Namer
  • Form interface for entering plugin name and optional author/brand name
  • Real-time AJAX analysis with progress indicators
  • Displays verdict, explanation, and detailed analysis results
  • Shows similar existing plugins and trademarks
  • Token usage tracking and timing information

2. AI Integration (includes/Traits/AI_Check_Names.php)

  • Dual-query AI analysis system:
    • First query: Similar name search
    • Second query: Pre-review analysis with context
  • Support for multiple AI providers (configurable)
  • JSON and markdown response parsing
  • Nuanced verdict system:
    • ❌ Disallowed
    • ⚠️ Issues Found
    • ℹ️ Generally Allowable (when suggestions/trademarks present)
    • ✅ No Issues Detected

3. Author/Brand Name Support

  • Optional author name field to help brands that own their trademark
  • AI recognizes brand ownership to avoid unnecessary name change suggestions
  • Integrated into AI prompt with specific instructions

4. Settings Page (includes/Admin/Settings_Page.php)

  • AI provider configuration (OpenAI, Anthropic, etc.)
  • API key management
  • Model selection
  • Secure credential storage

5. AI Connection Trait (includes/Traits/AI_Connect.php)

  • Reusable AI client connection logic
  • Support for structured output
  • Error handling and retry logic
  • Token usage tracking

New Files Added

  • includes/Admin/Namer_Page.php - Main namer tool page (565 lines)
  • includes/Admin/Settings_Page.php - Settings page for AI configuration (610 lines)
  • includes/Traits/AI_Check_Names.php - AI analysis logic (789 lines)
  • includes/Traits/AI_Connect.php - AI connection handling (337 lines)
  • assets/js/plugin-check-namer.js - Frontend JavaScript (404 lines)
  • assets/js/admin-settings.js - Settings page JavaScript (157 lines)
  • prompts/ai-check-similar-name.md - Similar name search prompt
  • prompts/ai-check-prereview.md - Pre-review analysis prompt
  • prompts/ai-check-prereview-output.md - Output format specification
  • tests/phpunit/tests/Traits/AI_Check_Names_Tests.php - Unit tests (400 lines)

Modified Files

  • includes/Plugin_Main.php - Added hooks for new admin pages
  • assets/css/plugin-check-admin.css - Added styles for namer tool (72 new lines)
  • composer.json & composer.lock - Added AI client dependencies
  • .typos.toml - Updated typo configuration
  • phpmd.xml - Updated PHP Mess Detector configuration

Technical Details

Architecture

  1. Two-Stage AI Analysis:

    • Stage 1: Similar name search to find potential conflicts
    • Stage 2: Pre-review analysis using results from stage 1 as context
  2. Response Parsing:

    • Primary: JSON parsing for structured output
    • Fallback: Markdown format parsing
    • Error handling for unparseable responses
  3. Security:

    • Nonce verification for AJAX requests
    • Capability checks (manage_options)
    • Input sanitization
    • Secure API key storage

Verdict Logic

The verdict system provides nuanced feedback:

  • Disallowed: Explicitly disallowed names
  • Issues Found: Specific issues detected (naming, owner, description)
  • Generally Allowable: Suggestions or trademarks present but no blocking issues
  • No Issues Detected: Clear approval

User Experience

  • Informative notes about the analysis process
  • Real-time feedback with loading indicators
  • Detailed explanations for each verdict
  • Suggestions for improvement when applicable
  • Similar plugins and trademarks displayed with context

Testing

  • ✅ Unit tests for AI_Check_Names trait (400+ lines)
  • ✅ JavaScript linting passes
  • ✅ PHP linting passes
  • ✅ PHPStan analysis passes
  • ✅ Manual testing of all features

Dependencies

  • Added AI client SDK via Composer
  • Requires AI provider API key configuration
  • Supports multiple AI providers and models

Notes

  • The tool provides guidance only and is not definitive
  • All plugin name decisions are subject to final review by the Plugins team
  • AI analysis may take a few seconds due to dual-query system
  • Token usage is tracked and displayed for transparency

@davidperezgar davidperezgar marked this pull request as ready for review December 16, 2025 22:52
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

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: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: ernilambar <nilambar@git.wordpress.org>

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

@davidperezgar davidperezgar added this to the 1.8.0 milestone Dec 20, 2025
@davidperezgar davidperezgar changed the title Feature Request Add name quality checker Add Plugin Check Namer Tool Dec 24, 2025
@@ -0,0 +1,53 @@
# Evaluating Plugin Name Confusability for the WordPress.org Plugin Review Team
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Evaluating Plugin Name Confusability for the WordPress.org Plugin Review Team
# Evaluating Plugin Name Confusability for the WordPress.org Plugins Team

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.

Feature Request: Add Name-Quality Checker for Plugin Trademarks & Confusing Similarity

3 participants