Skip to content

Add an admin redirect from the old ai page to the new ai-wp-admin page#424

Merged
dkotter merged 4 commits intoWordPress:developfrom
dkotter:feature/old-settings-redirect
Apr 13, 2026
Merged

Add an admin redirect from the old ai page to the new ai-wp-admin page#424
dkotter merged 4 commits intoWordPress:developfrom
dkotter:feature/old-settings-redirect

Conversation

@dkotter
Copy link
Copy Markdown
Collaborator

@dkotter dkotter commented Apr 13, 2026

What?

Redirect from the old settings page to the new one:
options-general.php?page=ai -> options-general.php?page=ai-wp-admin

Why?

In #340 we switched to a new approach to building our settings page. This required a new page slug, ai-wp-admin. For anyone still trying to access the old slug of ai, you'll get an access denied error. We probably should have introduced a redirect for that in #340 but better late then never.

How?

  • Listen for admin requests going to ai and redirect to ai-wp-admin
  • Ensure we listen both on admin_init and admin_page_access_denied, as it seems the latter fires most consistently
  • Update our unit tests to account for this change

Use of AI Tools

Used Cursor running GPT-5.3 Codex to investigate and execute the approach. Tested and refined slightly myself

Testing Instructions

  1. Checkout this PR
  2. Ensure you can go to the current settings page, either by going to Settings > AI, going to the plugin list screen and clicking Settings under the AI plugin, or manually typing in wp-admin/options-general.php?page=ai-wp-admin
  3. Manually type in the old URL and ensure you are redirected: wp-admin/options-general.php?page=ai
  4. Ensure other variations of that URL properly deny access, like wp-admin/options-general.php?page=ai-wp or wp-admin/options-general.php?page=ai-experiments
Open WordPress Playground Preview

dkotter added 2 commits April 13, 2026 11:09
…into admin_init and the page denied hook, as the latter seems to fire most often
@dkotter dkotter added this to the 0.8.0 milestone Apr 13, 2026
@dkotter dkotter self-assigned this Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 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.

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: dkotter <[email protected]>
Co-authored-by: jeffpaul <[email protected]>
Co-authored-by: wpankit <[email protected]>

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.31%. Comparing base (1a12dc9) to head (8346415).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
includes/Settings/Settings_Page.php 78.57% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #424      +/-   ##
=============================================
+ Coverage      68.15%   68.31%   +0.16%     
- Complexity       808      812       +4     
=============================================
  Files             53       53              
  Lines           3925     3939      +14     
=============================================
+ Hits            2675     2691      +16     
+ Misses          1250     1248       -2     
Flag Coverage Δ
unit 68.31% <78.57%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkotter dkotter requested a review from jeffpaul April 13, 2026 17:28
Comment thread includes/Settings/Settings_Page.php
@wpankit
Copy link
Copy Markdown

wpankit commented Apr 13, 2026

Tested this on WordPress Playground and my local. Confirmed the redirect from ?page=ai to ?page=ai-wp-admin is working as expected. ✅

424-ai-wp-admin-recording.mp4

@jeffpaul jeffpaul moved this to Needs review in WordPress AI Planning & Roadmap Apr 13, 2026
@dkotter dkotter merged commit 5d474c3 into WordPress:develop Apr 13, 2026
18 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Planning & Roadmap Apr 13, 2026
@dkotter dkotter deleted the feature/old-settings-redirect branch April 13, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants