WordPress-Coding-Standards icon indicating copy to clipboard operation
WordPress-Coding-Standards copied to clipboard

PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

Results 220 WordPress-Coding-Standards issues
Sort by recently updated
recently updated
newest added

## Bug Description I'm using `wp_handle_upload` in one of my plugins. PHPCS complains about the `$_FILES` slice not being run through `wp_unslash`. However, [`wp_magic_quotes` does not add slashes to `$_FILES`](https://developer.wordpress.org/reference/functions/wp_magic_quotes/)....

Type: Bug

## Is your feature request related to a problem? PHP 5.3 introduced namespaces into PHP. Refs: * https://www.php.net/manual/en/migration53.new-features.php * https://www.php.net/manual/en/language.namespaces.php At this moment WPCS has no formatting rules for namespace...

Type: Enhancement
Focus: Modern PHP
Component: Core

Ticket: https://core.trac.wordpress.org/ticket/52506 Change: https://core.trac.wordpress.org/changeset/53575 With WordPress 6.1 ([October 2022](https://make.wordpress.org/core/2022/06/23/wordpress-6-1-planning-roundup/)), the `%i` placeholder will provide a safe way to escape Identifiers (e.g. table/field names). Technically it's not needed if the variable...

Type: Enhancement
Component: Core
Focus: Security
Focus: DB

## Is your feature request related to a problem? Yes. When writing code like the following, it's flagged as unescaped (`WordPress.Security.EscapeOutput.OutputNotEscaped`): ```php printf( 'Foo %d Bar', $id ); ``` With...

Component: Extra
Type: Enhancement
Focus: Security

## Bug Description Installing fails with `composer create-project wp-coding-standards/wpcs`. And would seem to work, but throws Fatal Error with standalone installatation. System: Ubuntu 20.04.4 LTS php: 7.4 composer: 2.3.7 ###...

## Rationale WPCS currently has its own `ClassInstantiation` sniff. Since PHPCS 3.5.0, the PSR12 standard in PHPCS itself also contains a `PSR12.Classes.ClassInstantiation` sniff. I've done a comparison of the two...

Component: Extras

Work on WordPressCS 3.0.0 will start in the near future. @GaryJones, @dingo-d and me have recently had a call to discuss what we envision for WPCS 3.0.0. This issue is...

Meta: Repo

In the MVC+Templating world, all new code does have template separation from the code. So in templates with template-like syntax, which uses "`if(STATEMENT):`", "`endif;`", "`foreach(..):`", `endforeach;`" - and that does...

Focus: Modern PHP
Status: Needs Make post

## Is your feature request related to a problem? I notice sometimes when using the PHPStorm autocompletion for WordPress hooks that some hooks I use to used don't show up...

Type: Enhancement
Component: Core

Hooks which are marked as `@deprecated` should be ignored for the purposes of the `ValidHookName` sniff. Related: #1797, #1806, #1811

Type: Enhancement