Skip to content

Respect wp_supports_ai() and show notice if AI functionality is disabled in Plugin Check Namer #1222

@raftaar1191

Description

@raftaar1191

The Plugin Check Namer feature relies on the WordPress AI infrastructure. However, WordPress now introduces the wp_supports_ai() function, which allows sites to completely disable AI functionality via the WP_AI_SUPPORT constant or the wp_supports_ai filter.

To ensure compatibility with this mechanism, the Plugin Check Namer tool should check whether AI is supported before initializing AI-related functionality.

This aligns with the approach discussed in WordPress core:

Part of:
https://core.trac.wordpress.org/ticket/64706

Related implementation example:
WordPress/ai#268

Current Behavior

  • The Plugin Check Namer page loads and attempts to initialize AI functionality regardless of whether AI support is enabled or disabled.

Expected Behavior

Before initializing AI-related features, the tool should check:

wp_supports_ai()

If AI support is disabled, the UI should display a notice such as:

AI functionality is disabled on this site. Please enable AI support to use the Plugin Check Namer feature.

The evaluation interface could also be hidden or disabled until AI support is enabled.

Why

wp_supports_ai() allows sites to fully disable AI functionality using:

  • the WP_AI_SUPPORT constant
  • the wp_supports_ai filter

The Plugin Check tool should respect this setting and avoid initializing AI experiments when AI support is disabled.

Benefit

  • Aligns Plugin Check with the new WordPress AI capability controls
  • Prevents confusion when AI features are disabled
  • Ensures consistent behavior with other WordPress AI integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions