kallookoo / phpcs-rules
WordPress & WooCommerce sniffs
Package info
github.com/kallookoo/phpcs-rules
Type:phpcodesniffer-standard
pkg:composer/kallookoo/phpcs-rules
1.0.5
2026-09-10 08:13 UTC
Requires
- php: >=7.2
- dealerdirect/phpcodesniffer-composer-installer: ^1.0.0
- phpcompatibility/phpcompatibility-wp: ^2.1.7
- squizlabs/php_codesniffer: ^3.13.6
- woocommerce/woocommerce-sniffs: ^2.0
- wp-coding-standards/wpcs: ^3.4.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Collection of PHP_CodeSniffer sniffs for WordPress & WooCommerce that exclude your own files.
Installation
composer require kallookoo/phpcs-rules
Usage
When the project is related to WooCommerce set the standard with WooCommerce-Excl or set it with WordPress-Excl otherwise.
Example of a configuration file
<?xml version="1.0"?> <ruleset name="WordPress and WooCommerce Sniffs"> <description>My project ruleset.</description> <!-- Only use for PHP files --> <!-- <arg name="extensions" value="php"/> --> <!-- Configure the PHP Compatibility WP version. Uncomment only if customize the version. --> <!-- <config name="testVersion" value="7.0-"/> --> <!-- Configure the minimum WordPress version --> <config name="minimum_supported_wp_version" value="6.0"/> <!-- Rules --> <!-- Uncomment the required rule below --> <!-- <rule ref="WordPress-Excl"/> --> <!-- <rule ref="WooCommerce-Excl"/> --> <rule ref="WordPress.WP.I18n"> <properties> <!-- Replace the text-domain with the text domain in this project or remove this rule. --> <property name="text_domain" type="array" value="text-domain"/> </properties> </rule> </ruleset>