Skip to content

Connectors: Fix AI plugin settings page link to use the ai-wp-admin slug#11614

Open
itzmekhokan wants to merge 2 commits intoWordPress:trunkfrom
itzmekhokan:fix/65073
Open

Connectors: Fix AI plugin settings page link to use the ai-wp-admin slug#11614
itzmekhokan wants to merge 2 commits intoWordPress:trunkfrom
itzmekhokan:fix/65073

Conversation

@itzmekhokan
Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/65073

Summary

On Options → Connectors, after the AI plugin is installed and activated, the "Control features in the AI plugin" button links to options-general.php?page=ai. The AI plugin now registers its admin page under the slug ai-wp-admin, so the old URL produces a "you do not have sufficient permissions to access this page" error.

The AI_PLUGIN_SLUG = "ai" constant is used in two different contexts in routes/connectors-home/ai-plugin-callout.tsx:

  1. As the wp.org plugin directory slug in saveEntityRecord( 'root', 'plugin', { slug: AI_PLUGIN_SLUG, status: 'active' } ) to install the plugin — this must stay "ai".
  2. As the admin settings page slug in addQueryArgs( 'options-general.php', { page: AI_PLUGIN_SLUG } ) — this is the broken one and must be "ai-wp-admin".

A single-value rename would break the install call, so this patch introduces a separate constant AI_PLUGIN_PAGE_SLUG = "ai-wp-admin" and uses it only at the settings-link use-site.

The variable name matches the upstream source-of-truth PR in Gutenberg (WordPress/gutenberg#77336), so these built-file changes line up with what core will receive via the next Gutenberg sync.

Changes

  • src/wp-includes/build/routes/connectors-home/content.js — add AI_PLUGIN_PAGE_SLUG = "ai-wp-admin" and use it for the page: query arg on the settings link.
  • src/wp-includes/build/routes/connectors-home/content.min.js — same behavioral change (minified); the literal "ai-wp-admin" is inlined at the single use-site to avoid adding a new minified identifier, while the existing Mt="ai" is preserved for the install call.

Test plan

  • Install and activate the AI plugin from the Connectors screen.
  • Confirm the "Control features in the AI plugin" button now links to wp-admin/options-general.php?page=ai-wp-admin and loads the plugin's settings page (no permissions error).
  • Confirm the install/activate flow still works (the wp.org slug ai is unchanged for that path).
  • Visually verify the callout still renders correctly in the install, inactive, and active-no-provider states.

Related

Props dkotter, JeffPaul, nimeshatxecurify, ocean90.

Made with Cursor

…p-admin` slug.

The "Control features in the AI plugin" button on the Options → Connectors
screen was linking to `options-general.php?page=ai`, which triggers a
"you do not have sufficient permissions" error because the AI plugin now
registers its settings page under the slug `ai-wp-admin`.

The `AI_PLUGIN_SLUG` constant is still needed as-is for the plugin install
call (`saveEntityRecord( 'root', 'plugin', { slug: AI_PLUGIN_SLUG, ... } )`),
which must use the wp.org plugin directory slug `ai`. A separate constant,
`AI_PLUGIN_PAGE_SLUG`, is introduced for the admin settings page slug and
used only at the settings link use-site.

Variable naming matches the upstream Gutenberg source-of-truth PR
(WordPress/gutenberg#77336), so these built-file changes line up with what
core will receive via the next Gutenberg sync.

Props dkotter, JeffPaul, nimeshatxecurify, ocean90.
Fixes #65073.

Made-with: Cursor
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 21, 2026

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @1178653+wordpress-develop-pr-bot[bot]@users.noreply.github.com.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props khokansardar.

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

@itzmekhokan
Copy link
Copy Markdown
Author

Cross-reference: there is an earlier open PR for the same Trac ticket — #11576 — which introduces the constant as AI_PLUGIN_ADMIN_SLUG.

This PR uses the name AI_PLUGIN_PAGE_SLUG to match the upstream source-of-truth in Gutenberg (WordPress/gutenberg#77336), so the built files here line up with what core will receive at the next Gutenberg sync. Happy to defer to whichever approach a committer prefers; the behavioral change is identical.

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.

1 participant