WPThemeReview
WPThemeReview copied to clipboard
Metadata sniffs
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.
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?
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.
I suppose we should do the same for custom widgets.
Let allow non-presentational metadata.
There is a branch for this issue-136-non-presentational-meta but it needs testing. Should this not be combined with other restricted functions?
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.