The sniff of tags is a good start, but I think the next step to increase usefulness of these checks would be to ensure that the tags used are applied correctly within the theme.
Examples:
custom-header
Check Check that add_theme_support( 'custom-header' ); is being used in the theme php files
Result Error when not found
custom-logo
Check Check that add_theme_support( 'custom-logo' ); is being used in the theme php files
Result Error when not found
custom-menu
Check Check that register_nav_menu() or register_nav_menus(), is being used in the theme php files
Result Error when not found
Check Check that wp_nav_menu() is being used in the theme php files
Result Error when not found
wide-block
Check Check that .alignwide and .alignfull as CSS classes are used in theme's css files and/or php files.
Result Error if not found
translation-ready
Check check that theme has any translatable strings.
Result Error if theme has no translatable strings.
Check Check that all sniffs pass for textdomain issues.
Result Error theme can't be translation ready if these fail.
Check Check that load_theme_textdomain() is used in theme's php files.
Result Error if the strings aren't ever loaded.
threaded-comments
Check check that a script with the handle comment-reply exists in theme's php file.
Result Warning - a theme could implement it's own way of handling threaded comments, but this should be brought to author's attention with reference to how to add via wp_enqueue_script the normal way in case they just forgot.
sticky-post
Check check that .sticky is being used in theme's css and/or php files.
Result Error - theme should style sticky post if using tag.
rtl-language-support
This one could get more in depth, but generally something like this:
Check check that rtl.css stylesheet exist in theme's css files.
Result
Success:
Check check file for css property direction with rtl as value.
Check check file for css property unicode-bidi with embed as value.
Result Error if not found.
Error
-- Check check if wp_style_add_data is used to add rtl using a different stylesheet name.
-- Result Error if not found - no methods of rtl styles found.
Success
-- Check check file for css property direction with rtl as value.
-- Check check file for css property unicode-bidi with embed as value.
-- Result Error if not found.
There are others that could be done as well, but they might be best served as their own tickets instead of creating a giant one like this as it could get pretty long. I think maybe some of this belongs in the WPTRT/WPThemeReview repo as I think the way to best handle this efficiently would be first process the style.css/readme.txt to set flags, which could then include additional sniffs when the runner is created. I'm not really sure where the line would be drawn though as I'm not horribly familiar with the relationship between the two repos. I just wanted to be sure to write down some of these thoughts for reference as this project grows.
The sniff of tags is a good start, but I think the next step to increase usefulness of these checks would be to ensure that the tags used are applied correctly within the theme.
Examples:
custom-header
Check Check that
add_theme_support( 'custom-header' );
is being used in the theme php files Result Error when not foundcustom-logo
Check Check that
add_theme_support( 'custom-logo' );
is being used in the theme php files Result Error when not foundcustom-menu
Check Check that
register_nav_menu()
orregister_nav_menus(),
is being used in the theme php files Result Error when not found Check Check thatwp_nav_menu()
is being used in the theme php files Result Error when not foundwide-block
Check Check that
.alignwide
and.alignfull
as CSS classes are used in theme's css files and/or php files. Result Error if not foundtranslation-ready
Check check that theme has any translatable strings. Result Error if theme has no translatable strings. Check Check that all sniffs pass for textdomain issues. Result Error theme can't be translation ready if these fail. Check Check that
load_theme_textdomain()
is used in theme's php files. Result Error if the strings aren't ever loaded.threaded-comments
Check check that a script with the handle
comment-reply
exists in theme's php file. Result Warning - a theme could implement it's own way of handling threaded comments, but this should be brought to author's attention with reference to how to add viawp_enqueue_script
the normal way in case they just forgot.sticky-post
Check check that
.sticky
is being used in theme's css and/or php files. Result Error - theme should style sticky post if using tag.rtl-language-support
This one could get more in depth, but generally something like this: Check check that rtl.css stylesheet exist in theme's css files. Result
direction
withrtl
as value. Check check file for css propertyunicode-bidi
withembed
as value. Result Error if not found.wp_style_add_data
is used to addrtl
using a different stylesheet name. -- Result Error if not found - no methods of rtl styles found.direction
withrtl
as value. -- Check check file for css propertyunicode-bidi
withembed
as value. -- Result Error if not found.There are others that could be done as well, but they might be best served as their own tickets instead of creating a giant one like this as it could get pretty long. I think maybe some of this belongs in the WPTRT/WPThemeReview repo as I think the way to best handle this efficiently would be first process the style.css/readme.txt to set flags, which could then include additional sniffs when the runner is created. I'm not really sure where the line would be drawn though as I'm not horribly familiar with the relationship between the two repos. I just wanted to be sure to write down some of these thoughts for reference as this project grows.