Juliette
Juliette
> Dynamic hooks should be named using interpolation rather than concatenation for readability and discoverability purposes. > > Dynamic hooks are hooks that include dynamic values in their tag name,...
> Ternary operators are fine, but always have them test if the statement is true, not false. Otherwise, it just gets confusing. (An exception would be using ! empty(), as...
The `/bin/class-ruleset-test.php` file is used to test the WPCS rulesets. This file should contain code which triggers each and every sniff in the WPCS rulesets _but should not trigger any...
What about a sniff to warn about code which does not use the WP helper functions - `checked()`, `selected()`, `disabled()`, `wp_readonly()`- for these form attributes ? ```html /> ```
I'd like to suggest adding two new sniffs around the usage of [`preg_quote()`](http://php.net/manual/en/function.preg-quote.php). * Verify the `$regex` parameter of any PCRE function calls to make sure that if the regex...
What's the general opinion on having a sniff to detect the following type of code patterns and throw `warning`s when detected ? Useful or not ? ```php echo sprintf( 'string...
Check that any function containing a `check_ajax_referer( ... );` call, also contains a call to `die()`, `wp_die()` or `exit` at the end of the same function. This should be a...
WordPress has a list of words which are reserved for use as query vars. See: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp.php#L18 If we can gather a list of functions in which these should not be...
With the regex functions, there are some best practices we could advise on /often made "mistakes" which we could warn people about. I'm thinking along the lines of: - Use...
The `I18n` sniff needs a `text_domain` property to be set in a custom ruleset to trigger the text-domain checks. The `DeprecatedFunctions`, `DeprecatedClasses` and the upcoming `DeprecatedParameters` (#826) sniffs need a...