Fix Plugins dropping to native page after activating a plugin (v2.7.2)

Unlike Posts/Pages/Media/Users/Comments, Plugins only ever had its
sidebar link rewritten (MenuSerializer.php) — there was no
redirect_native_pages() case for direct visits to plugins.php itself.
WordPress's own post-activate/post-install redirect
(wp_redirect(self_admin_url('plugins.php?activate=true'))) is exactly
that: a direct visit with no ?page= param, landing on the true native
page until the sidebar link was clicked again.

Added the missing case, gated by modern_plugins like the others,
redirecting to plugins.php?page=aurora-admin-plugins to match the URL
the sidebar link itself already uses.

Verified live by visiting plugins.php?activate=true directly (the
exact URL WP's own redirect produces) — now lands on the Aurora page
correctly, confirmed with FileBird Lite showing Active in the list.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
nixpanel
2026-07-05 07:17:47 -05:00
co-authored by Claude Sonnet 5
parent fdd252cfe2
commit 07d77bda57
5 changed files with 60 additions and 4 deletions
+24 -1
View File
@@ -1,6 +1,6 @@
# Aurora Admin v2 — Project Status
_Last updated: 2026-07-05 (latest session — fixed white native form fields on classic edit screens, e.g. Edit Media's title field)_
_Last updated: 2026-07-05 (latest session — fixed Plugins dropping to the native page after activating a plugin)_
## What this project is
@@ -766,6 +766,29 @@ replacement — there's no native WP file browser to redirect from).
## Key bugs fixed (root causes, in case they resurface)
- **Plugins dropped to the native page after activating a plugin**: user
installed FileBird and it "defaulted back to WordPress plugins page
until I clicked on plugins from the menu." Root cause: unlike Posts/
Pages/Media/Users/Comments, Plugins was originally built with *only* a
`MenuSerializer.php` link rewrite (the sidebar's own "Plugins" link
pointed at the Aurora page) — it never got a `redirect_native_pages()`
case for direct visits to `plugins.php` itself. WordPress's own
post-activate/post-install redirect
(`wp_redirect(self_admin_url('plugins.php?activate=true'))`) is exactly
that: a direct visit with no `?page=` param, bypassing the rewritten
sidebar link entirely and landing on the true native page — fixed only
once the user next clicked the sidebar link themselves. Added the
missing `redirect_native_pages()` case, gated by `modern_plugins` like
the others, redirecting to `plugins.php?page=aurora-admin-plugins` (not
`admin.php?page=...`, to match the URL the sidebar link itself already
uses). Verified live by visiting `plugins.php?activate=true` directly
(the exact URL WP's own redirect produces) — now lands on the Aurora
page correctly. **If a similarly "sidebar-link-only" page ever gets
reported as dropping to native after some WP-core-triggered redirect,
check `redirect_native_pages()` for a missing case first** — this is
the second time that exact gap has caused a bug (Plugins now fixed;
worth double-checking Comments/Posts/Pages/Media/Users don't have
similar missed redirect sources, e.g. bulk actions, if this resurfaces).
- **White native form fields on classic (non-block-editor) screens**: user
reported "a lot of endpoints still linking back to the original
WordPress dashboard [look]" — investigation landed on the Edit Media