Download the PHP package wptechnix/wp-coding-standards without Composer

On this page you can find all versions of the php package wptechnix/wp-coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-coding-standards

WPTechnix Coding Standards

Validate Rulesets

A collection of PHP_CodeSniffer standards for modern WordPress development.

WPTechnix builds on established community standards instead of replacing them. It combines the best parts of WPCS, VIPCS, PHPCompatibilityWP, PHPCSExtra, and Slevomat Coding Standard into a small set of ready-to-use rulesets for WordPress plugins and general PHP projects.

Features

The bundled standards are built on:


Installation

Install with Composer:

PHP_CodeSniffer standards are registered automatically through dealerdirect/phpcodesniffer-composer-installer.

Verify the installation:

Example:


Included standards

The package contains four standards.

Standard Description
WPTechnix Base WordPress coding standard.
WPTechnix-PSR4 Base standard with PSR-4 file naming.
WPTechnix-PSR Base standard with PSR-4 file naming and PSR-12 formatting.
WPTechnix-Strict Standalone strict analysis standard for any PHP project.

Standards can be combined.


Which standard should I use?

Project type Recommended standard
Traditional WordPress plugin WPTechnix
WordPress plugin using PSR-4 autoloading WPTechnix-PSR4
WordPress plugin using PSR-12 formatting WPTechnix-PSR
General PHP project WPTechnix-Strict
Modern PSR-based WordPress plugin WPTechnix-PSR,WPTechnix-Strict

Standards

WPTechnix

WPTechnix is the primary WordPress standard.

It starts with WordPress-Extra and WordPress-Docs, then layers additional quality, compatibility, and modern PHP checks while intentionally avoiding rules that require project-specific configuration or create unnecessary noise.

Included checks

WordPress Coding Standards

Provides the familiar WordPress coding style together with checks for:

WordPress VIP Coding Standards

Includes a carefully selected subset of platform-independent VIP rules covering:

Platform-specific VIP sniffs are intentionally excluded.

PHPCompatibilityWP

Detects language features and functions that are incompatible with older PHP versions.

The default compatibility target is PHP 8.0 and above.

Projects can override this using the testVersion configuration.

PHPCSExtra

Adds additional quality checks including:

Slevomat Coding Standard

Adds modern PHP analysis including:


PHPDoc philosophy

WPTechnix follows WordPress documentation conventions while avoiding unnecessary duplication.

The standard intentionally:


Disabled by default

Some upstream sniffs are intentionally disabled because they require project-specific configuration or frequently produce false positives.

Sniff Reason
PrefixAllGlobals Requires each project to define its own prefixes.
CronInterval Cannot detect cron schedules registered through filters.
ExceptionNotEscaped Exception messages are intended for developers rather than end users.
UnknownCapability Plugins commonly register custom capabilities outside the built-in list.
YodaConditions Yoda conditions are not enforced.

Coding style

WPTechnix expects:


WPTechnix-PSR4

WPTechnix-PSR4 is identical to WPTechnix except for file naming.

Instead of WordPress-style filenames:

it allows standard PSR-4 filenames:

It also removes the requirement for @package annotations because namespaces already provide the necessary organization.


WPTechnix-PSR

WPTechnix-PSR builds on WPTechnix-PSR4 by replacing WordPress formatting rules with PSR-12 formatting.

Rule WPTechnix WPTechnix-PSR
Indentation Tabs Four spaces
Braces K&R Next line
snake_case enforcement Yes No
File naming class-example.php Example.php

WPTechnix-PSR already includes the functionality of WPTechnix-PSR4. There is no need to enable both simultaneously.


WPTechnix-Strict

WPTechnix-Strict is a standalone standard that adds stricter static analysis and code quality checks for modern PHP projects.

Unlike the other standards, it is not WordPress-specific and does not depend on WPTechnix. It can be used with any PHP 8.0+ codebase or layered on top of another WPTechnix standard.

Included checks

Type declarations

Encourages modern PHP type safety by enforcing:

Code quality

Improves maintainability by enforcing:

Object-oriented design

Encourages consistent object-oriented design:

Complexity metrics

Helps prevent overly complex code by enforcing:

Metric Warning Error
Cognitive complexity 12 20
Cyclomatic complexity — 10 (20 absolute)
Nesting level — 5 (10 absolute)

Import discipline

Encourages consistent namespace usage by requiring imported namespaced symbols while allowing normal use of global PHP functions and constants.


Combining standards

WPTechnix-Strict is designed to complement the other standards.

Examples:


Project configuration

Create a phpcs.xml file in the root of your project.

Run PHPCS:

Or scan a specific directory:

Automatically fix supported issues:


Frequently customized options

Most projects customize only three things:

Option Purpose
testVersion Select the minimum supported PHP version.
WordPress.WP.I18n Configure your plugin text domain.
PrefixAllGlobals Enable global prefix validation using your project prefix.

Everything else works with the default configuration.


Requirements

All PHPCS dependencies are installed automatically through Composer.


Contributing

Bug reports, suggestions, and pull requests are welcome.

If you discover a false positive or believe a sniff should be configured differently, please open an issue describing the problem together with a reproducible example.


License

MIT


All versions of wp-coding-standards with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
automattic/vipwpcs Version ^3.0.1
dealerdirect/phpcodesniffer-composer-installer Version ^1.1.2
phpcompatibility/phpcompatibility-wp Version ^2.1.8
slevomat/coding-standard Version ~8.22.0
squizlabs/php_codesniffer Version ^3.13.6
wp-coding-standards/wpcs Version ^3.4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wptechnix/wp-coding-standards contains the following files

Loading the files please wait ...