Make WordPress Core

Opened 6 months ago

Closed 5 months ago

#65073 closed defect (bug) (fixed)

Connectors: reference to AI plugin uses old `ai` slug instead of correct `ai-wp-admin` slug

Reported by: JeffPaul Owned by: dkotter
Priority: normal Milestone: 7.0
Component: AI Version: 7.0
Severity: normal Keywords: connectors
Cc: Focuses:

Description

As called out by @matt ​on Slack, it seems the Connectors page is linking to the old AI plugin settings page slug of ai instead of the new, updated ai-wp-admin. That new slug was required as part of the update of the settings page to use wp-build tooling in an effort to (1) help test and dogfood that package from the Gutenberg team and (2) ensure the page appeared in a more modern WordPress admin experience (versus a dated grey background / form fields everywhere sort of approach).

Attachments (3)

Screenshot 2026-04-14 at 9.00.28 AM.png​ (404.2 KB ) - added by JeffPaul 6 months ago.
Connectors page where the AI plugin is referenced
CleanShot 2026-04-12 at 16.05.05@2x.png​ (44.2 KB ) - added by JeffPaul 6 months ago.
error message presented due to wrong page slug
65073.diff​ (158.4 KB ) - added by yusufmudagal 6 months ago.
Update the AI plugin reference from the old ai slug to the correct ai-wp-admin slug in connectors home.

Download all attachments as: .zip

Change History (20)

@JeffPaul
6 months ago

Connectors page where the AI plugin is referenced

@JeffPaul
6 months ago

error message presented due to wrong page slug

#1 @dkotter
6 months ago

Looks like the source code for this is handled in the Gutenberg plugin. Opened a PR there to fix: ​https://github.com/WordPress/gutenberg/pull/77336

Not sure what else is needed here on Trac for that or if that will just auto-sync back to WordPress Core once merged.

#3 @ocean90
6 months ago

#65077 was marked as a duplicate.

#5 @JeffPaul
6 months ago

A fix for this has now been backported for 7.0 and will make it to core in the next Gutenberg sync: ​https://github.com/WordPress/gutenberg/pull/77336#issuecomment-4245449831

#6 @JeffPaul
6 months ago

#65081 was marked as a duplicate.

This ticket was mentioned in ​PR #11614 on ​WordPress/wordpress-develop by ​@khokansardar.


6 months ago
#7

  • Keywords has-patch added; needs-patch removed

## 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

  • Trac: #65073
  • Upstream (Gutenberg): WordPress/gutenberg#77336
  • Parallel core PR: #11576 (same fix, different variable name — AI_PLUGIN_ADMIN_SLUG)
  • Duplicates on Trac: #65077, #65081

Props dkotter, JeffPaul, nimeshatxecurify, ocean90.

Made with ​Cursor

​@khokansardar commented on ​PR #11614:


6 months ago
#8

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.

This ticket was mentioned in ​Slack in #core-test by ozgur_sar. ​View the logs.


6 months ago

​@JeffPaul commented on ​PR #11614:


6 months ago
#10

A fix for this was already backported and will make it into 7.0 with the next sync: ​https://github.com/WordPress/gutenberg/pull/77336#issuecomment-4245449831

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


6 months ago

#12 @audrasjb
6 months ago

  • Keywords close added

As per today's bug scrub: looks like this is going to be fixed on the next Gutenberg merge. Marking this ticket as candidate for closure when it is properly fixed.

#13 @peterwilsoncc
6 months ago

  • Keywords has-patch removed

Keyword management for workflow report.

​@wildworks commented on ​PR #11614:


6 months ago
#14

The slug change was made in the Gutenberg repository: ​https://github.com/WordPress/gutenberg/pull/77336

That code will be built in the next sync and automatically applied to core. There is no need to make changes directly to core.

@yusufmudagal
6 months ago

Update the AI plugin reference from the old ai slug to the correct ai-wp-admin slug in connectors home.

#15 @wildworks
6 months ago

Thank you for your work on this, @yusufmudagal. However, this code is auto-generated by the build process, so it cannot be directly edited.

This ticket does not require any action at this time. We will confirm the issue is resolved after the Gutenberg sync runs and then close it.

This ticket was mentioned in ​Slack in #core by jorbin. ​View the logs.


5 months ago

#17 @wildworks
5 months ago

  • Keywords close removed
  • Resolution → fixed
  • Status assigned → closed

Confirmed that the Connectors page is linking to the correct AI plugin settings page in 7.0 RC3.

Note: See TracTickets for help on using tickets.