Search by

valu / wp-codesniffer-rules

valu

PHP_CodeSniffer rules (sniffs) to enforce Valu WP coding conventions

Package info

github.com/valu-digital/wp-codesniffer-rules

Type:phpcodesniffer-standard

pkg:composer/valu/wp-codesniffer-rules

Statistics

Installs: 683

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-11-30 10:17 UTC

This package is auto-updated.

Last update: 2026-11-30 10:58:19 UTC


README

The Valu-WP-Rules standard for PHP_CodeSniffer: the WordPress Coding Standards (WPCS 3) security sniffs, plus a trailing comma after the last item of a multi-line array.

Install

Install it globally, as the Valu dev setup expects (CodeSniffer on docs.valu.pro):

composer global require "valu/wp-codesniffer-rules:dev-master" -W

Update with composer global update "valu/wp-codesniffer-rules" -W. The package has no tagged releases, so every update installs the latest master.

The package requires PHP_CodeSniffer 3.13.6 or later and WPCS 3.4.1 or later, because older versions have security vulnerabilities (CVE-2026-67434, CVE-2026-45293). The update command above brings both to these versions. Check the installed version with phpcs --version.

Run

In a theme or plugin directory:

phpcs --standard=Valu-WP-Rules

Always pass --standard. Without it, phpcs uses the first phpcs.xml it finds in the current directory or a parent directory, which may be a different ruleset.

To silence a false positive, use // phpcs:ignore <Sniff.Name> -- reason. The old whitelist comments (// XSS ok, // WPCS: XSS ok, // input var okay) are not recognised by WPCS 3.

Use as a project dependency

composer require --dev "valu/wp-codesniffer-rules:dev-master"

Add phpcs.xml to the project:

<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Custom" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
    <rule ref="Valu-WP-Rules"/>
</ruleset>

and run

./vendor/bin/phpcs src