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
+19
View File
@@ -142,6 +142,25 @@ class SubApps
return;
}
// Settings > Plugins > "Modern plugins page". Unlike the others below,
// this one was previously only handled by MenuSerializer rewriting the
// sidebar's own link — direct visits to plugins.php never redirected,
// which is exactly what WordPress's own post-activate/post-install
// redirect does (wp_redirect(self_admin_url('plugins.php?activate=true'))
// — no ?page= param, so it always landed on the true native page,
// fixed only once the user next clicked the (correctly rewritten)
// sidebar link themselves. Redirects to plugins.php?page=... (not
// admin.php?page=...) to match the URL admin_url("plugins.php?page=
// aurora-admin-plugins") that the sidebar link itself already uses.
if (
$pagenow === "plugins.php" &&
current_user_can("activate_plugins") &&
Settings::get("modern_plugins", true)
) {
wp_safe_redirect(admin_url("plugins.php?page=aurora-admin-plugins"));
exit;
}
// Settings > Comments > "Modern comments page" — previously always
// redirected regardless of this setting; default true so existing
// installs keep their current behavior until explicitly turned off.