This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
Additional tests for tags used #118
Labels
Status: Help Wanted
A help is needed regarding an issue or an opened PR.
Type: Enhancement
This is an enhancement of the existing features or a new feature to the plugin.
Type: Question
This is a question regarding the functionality of the plugin.
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 filesResult Error when not found
custom-logo
Check Check that
add_theme_support( 'custom-logo' );
is being used in the theme php filesResult Error when not found
custom-menu
Check Check that
register_nav_menu()
orregister_nav_menus(),
is being used in the theme php filesResult Error when not found
Check Check that
wp_nav_menu()
is being used in the theme php filesResult 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
Check check file for css property
direction
withrtl
as value.Check check file for css property
unicode-bidi
withembed
as value.Result Error if not found.
-- Check check if
wp_style_add_data
is used to addrtl
using a different stylesheet name.-- Result Error if not found - no methods of rtl styles found.
-- Check check file for css property
direction
withrtl
as value.-- Check check file for css property
unicode-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.
The text was updated successfully, but these errors were encountered: