Search by

wpdesk / wp-code-sniffer

dyszczogrolabjaskulskiendriu84

Library for WP Desk Coding Standards in plugins.

Package info

github.com/WP-Desk/wp-code-sniffer

Homepage

Type:phpcodesniffer-standard

pkg:composer/wpdesk/wp-code-sniffer

Statistics

Installs: 61 605

Dependents: 22

Suggesters: 0

Stars: 0

Open Issues: 0

1.3.3 2026-09-03 08:56 UTC

README

PHPCS ruleset for WP Desk WordPress plugins.

It builds on WordPress Coding Standards and PHPCompatibilityWP, with additional WP Desk conventions and WooCommerce-aware configuration.

Installation

composer require --dev wpdesk/wp-code-sniffer

Usage

Copy the provided example files into your project:

cp vendor/wpdesk/wp-code-sniffer/phpcs.xml.dist phpcs.xml.dist
cp vendor/wpdesk/wp-code-sniffer/.editorconfig .editorconfig

Adjust the values in phpcs.xml.dist:

  • text_domain
  • minimum_wp_version
  • testVersion

Then run:

vendor/bin/phpcs

The example configuration scans src and templates by default.

Ruleset

The included standard is:

<rule ref="WPDeskPlugin"/>

It includes WordPress rules, PHP compatibility checks, short array syntax, selected WooCommerce capabilities/functions, and excludes common generated or dependency directories.

PhpStorm

Configure PHP_CodeSniffer in:

Settings → Languages & Frameworks → PHP → Quality Tools

Then enable:

Settings → Inspections → Quality Tools → PHP_CodeSniffer

Use your project phpcs.xml.dist as the custom coding standard.