VIP-Coding-Standards
VIP-Coding-Standards copied to clipboard
PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
## Bug Description Adding the `WordPress-VIP-Go` ruleset suppresses many warning from `WordPress-Core`, including `StrictComparisons.LooseComparison`. Sample file (test.php) ```php ``` Output: ``` $ vendor/bin/phpcs test.php W 1 / 1 (100%) ```...
## Describe the solution you'd like When `printf()` is used, we should ensure that the content in the placeholders are correctly escaped. ## What code should be reported as a...
## Bug Description We started flagging for `exclude` since it's an alias of `post__not_in` in #589. Unfortunately, when used outside of a `get_posts()` or WP_Query context, it's a false positive....
With the direction of the "master" term being deprecated in favour of something more ambiguous such as "main" (more context: https://sfconservancy.org/news/2020/jun/23/gitbranchname/), VIPCS should follow suit. This shouldn't be done until...
## What problem would the enhancement address for VIP? When template partials are `require`'d from within a class, then the partial may use `$this->` to insert display a value. At...
Follow up action after #628 Conversation about this between @GaryJones and @jrfnl from #628: >>> Register with coveralls.io (or another service) and start recording and checking code coverage for builds....
Follow up action after #628 Note: as things stand, testing against PHPCS 4.x requires to run `composer install` using `--prefer-source` as the abstract test case file is no longer included...
Follow up action after #628 Conversation about this between @GaryJones and @jrfnl from #628: > > > (Re-)enable a test run against PHP 8.1/nightly. > > > > Yes, but...
It's almost always meant to be `wp_json_encode`
## What problem would the enhancement address for VIP? Some developers are not aware that `esc_url()` supports more than just the `http` and `https` protocols. The default list also includes...