Site-kit-wp: Make sure plugin menu doesn't disappear from left nav

Created on 13 Aug 2019  ·  5Comments  ·  Source: google/site-kit-wp

Bug Description

Currently, some plugins override Site Kit's position in the left nav menu and it completely disappears, making it impossible for users to access the dashboard at all (e.g. #392 ).
Let's make sure the Site Kit entry does not disappear in these cases.


_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance criteria

  • When other plugins are overriding menu positioning, Site Kit nav entry doesn't disappear.

Implementation Brief

  • Remove the specific $position value (of 3) from Site Kit's add_menu_page() call (so that it's theoretically appended somewhere at the end).
  • In the Screens class, implement a similar mechanism like Jetpack uses to ensure the menu item is not overridden.

    • Minor adjustment: We need to check for all slugs that starts with Screens::PREFIX, and they need to be moved to after the index.php item (dashboard).

Changelog entry

  • Ensure Site Kit admin menu item cannot accidentally be overridden by other plugins.
P0 Bug

Most helpful comment

Wouldn't only the top-level menu item need to be moved in the order?

Yes, but this list only includes top-level menu items anyway (and the slug used for it may differ on the available permissions of the current user).

All 5 comments

Implementation brief looks good, although this part is a bit unclear to me:

We need to check for all slugs that starts with Screens::PREFIX, and they need to be moved to after the index.php item (dashboard).

Wouldn't only the top-level menu item need to be moved in the order?

Wouldn't only the top-level menu item need to be moved in the order?

Yes, but this list only includes top-level menu items anyway (and the slug used for it may differ on the available permissions of the current user).

Ok, got it. Sounds good 👍

@felixarntz code review approved ✅

QA passed

Was this page helpful?
0 / 5 - 0 ratings