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

Metadata sniffs #136

Open
justintadlock opened this issue Apr 13, 2017 · 6 comments
Open

Metadata sniffs #136

justintadlock opened this issue Apr 13, 2017 · 6 comments

Comments

@justintadlock
Copy link

justintadlock commented Apr 13, 2017

Warning:

We need sniffs that check metadata. Currently, the theme review team allows themes to have metadata if it is presentational in nature. Some common examples:

  • Sidebar position
  • Background color
  • Layout

However, we do not allow metadata that is non-presentational in nature. Some common examples:

  • Video URL
  • Gallery shortcode
  • User-specific social URLs

This would probably need to be an warning-level notice because we wouldn't be able to know whether the meta is presentational or not via code.

Code would need to check functions:

  • add_metadata()
  • update_metadata()
  • add_post_meta()
  • update_post_meta()
  • add_user_meta()
  • update_user_meta()
  • add_comment_meta()
  • update_comment_meta()

We could probably check for the delete_*_meta() functions too, but this is probably unnecessary.

Hooks to check:

  • attachment_fields_to_edit
  • attachment_fields_to_save

Error:

One area we could absolutely check for non-presentational metadata is if a theme has a filter on user_contactmethods. This is only used for adding contact methods to the user profile, which would not be presentational.

@joyously
Copy link

And how would this work if the theme integrates a library for that purpose? Is it allowed because the theme isn't doing the work? Or is the library then part of the theme that shouldn't be doing it either?

@justintadlock
Copy link
Author

A library included in the theme is still a part of the theme. So, it doesn't matter. The library is irrelevant in this case.

@carolinan
Copy link

I suppose we should do the same for custom widgets.

@rinkuyadav999
Copy link

Let allow non-presentational metadata.

@carolinan
Copy link

There is a branch for this issue-136-non-presentational-meta but it needs testing.
Should this not be combined with other restricted functions?

@dingo-d
Copy link
Member

dingo-d commented Mar 11, 2020

Resolution from the triage: we should add this as a sniff and add info into the requirements. Also, see if there is a chapter for this in the Theme developers handbook and add a chapter there if there isn't.

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

6 participants