Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Sniff] Check for removal of admin pages #17

Open
3 tasks
jrfnl opened this issue Jul 12, 2016 · 8 comments
Open
3 tasks

[New Sniff] Check for removal of admin pages #17

jrfnl opened this issue Jul 12, 2016 · 8 comments

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Jul 12, 2016

Rule:

Removal of WP admin pages is not allowed.

The exception would be a child theme removing a theme admin submenu page added by the parent theme.

Ref: #12 (comment)

Theme check file covering this rule:

n/a

Decision needed:

This is currently not in the handbook as a rule. Should it be one ?

Notes for implementation:
  • Check for remove_menu_page() and forbid this.
  • Check for remove_submenu_page() and only forbid this if one of a known list of WP Core admin pages is being removed

To do:

  • If agreed this should be an error - Add the rule in the Theme Review handbook to the Requirements page.
  • If agreed this should be an error - Create unit tests
  • If agreed this should be an error - Create new sniff
@jrfnl
Copy link
Contributor Author

jrfnl commented May 31, 2018

Discussed in the meeting of May 31st, let's add this.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jun 5, 2018

To create this sniff, I need some more information about the WP Core admin pages which are not supposed to be removed.

The question is basically: which submenu items are allowed to be removed ? Answers I can think of:

  • Only admin pages within the Themes submenu and of those, not the known core ones (themes, customizer and its variants, widgets, menus, theme-editor).
  • Admin pages within the Themes submenu + the Options submenu, again with the exception of the known core ones
  • Any admin page, as long as its not a known core one

@justintadlock
Copy link

Essentially, the only admin pages allowed to be removed would be custom Appearance submenu items created by a parent theme and removed by a child theme. I can't think of any others we allow to be removed. I'm not even sure that there's a child theme that does this in the directory. The situation would be rare.

@grappler
Copy link
Member

grappler commented Jun 6, 2018

I would go with

Only admin pages within the Themes submenu and of those, not the known core ones (themes, customizer and its variants, widgets, menus, theme-editor).

I agree with Justin.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jun 7, 2018

Thanks for the feedback. I have the sniff nearly ready already, but won't be able to get back to it until the weekend.

@dingo-d
Copy link
Member

dingo-d commented May 18, 2019

@jrfnl is this a different sniff from the forbidden functions one?

@jrfnl
Copy link
Contributor Author

jrfnl commented May 20, 2019

Yes it is and a lot more complicated one. Themes can remove admin pages from, for instance, a parent theme, but they are not allowed to remove WP Core admin pages, so there is a lot more involved in that.

I worked on it last year and it's quite tricky. I'd need to have a good look again to see where I got stuck.

@dingo-d
Copy link
Member

dingo-d commented May 13, 2020

I've removed the input/decision needed, as we know what is and isn't allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants