WPTT / WPThemeReview

PHP_CodeSniffer rules (sniffs) to enforce WordPress theme review coding conventions
MIT License
207 stars 38 forks source link

[New sniff] Incorrect function parameter usage #96

Open jrfnl opened 7 years ago

jrfnl commented 7 years ago

Rule type:

Error / Warning

Rule:

Check for incorrect usage of certain parameters in WP functions (hard-coded) and provide valid alternatives based on the parameter passed.

hardcoded text in title tag Ref: https://make.wordpress.org/themes/handbook/review/required/theme-check-plugin/#additional-checks

hardcoded dates Ref: https://make.wordpress.org/themes/handbook/review/required/theme-check-plugin/#info

To create this sniff, a list of function should be compiled where theme authors are typically doing this wrong, i.e. passing hardcoded information instead of variables/function calls.

Theme check file covering this rule:

https://github.com/WordPress/theme-check/blob/master/checks/time_date.php

Decision needed:

Which function and parameters should be covered by this sniff ? Input requested.

To do:

grappler commented 7 years ago

Related to this would be #93

Once #80 get merged in this will be a very easy sniff to merge it as most of the work will have been done.