PHPackages                             wptechnix/wordpress-coding-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. wptechnix/wordpress-coding-standards

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

wptechnix/wordpress-coding-standards
====================================

A WordPress PHPCS coding standard based on WPTechnix and WPCS, fully compatible with PSR-12, providing modern, secure, and maintainable PHP code.

v2.0.1(4mo ago)195[1 PRs](https://github.com/WPTechnix/wordpress-coding-standards/pulls)MITPHP ^8.0CI passing

Since Nov 20Pushed 1mo agoCompare

[ Source](https://github.com/WPTechnix/wordpress-coding-standards)[ Packagist](https://packagist.org/packages/wptechnix/wordpress-coding-standards)[ RSS](/packages/wptechnix-wordpress-coding-standards/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (0)

WPTechnixWordPress Coding Standards
===================================

[](#wptechnixwordpress-coding-standards)

 **WordPress-specific coding standards building upon WPTechnix base standards for modern, secure, and performant code.**

 [![Source Code](https://camo.githubusercontent.com/84ec376466a0d9aae41ab42cbb9862b167177d92830b9564a4e69ca1909d9975/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d7770746563686e69782f776f726470726573732d2d636f64696e672d2d7374616e64617264732d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/wptechnix/wordpress-coding-standards) [![Download Package](https://camo.githubusercontent.com/1a69c1ed37dcefad58da444d6bbba0e42e1e38b3b48a94b49d7e4ab6e5ec9a85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7770746563686e69782f776f726470726573732d636f64696e672d7374616e64617264732e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/wptechnix/wordpress-coding-standards) [![PHP Programming Language](https://camo.githubusercontent.com/1bece8db04ac9e2a15cec08ba7471422f832c5e93cf575e6740639bb14a0f1be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7770746563686e69782f776f726470726573732d636f64696e672d7374616e64617264732e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/eae09dc9a96c662749b554917f7c55428309e5ea83bcec7121384e243f90387a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7770746563686e69782f776f726470726573732d636f64696e672d7374616e64617264732e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/wptechnix/wordpress-coding-standards/blob/master/LICENSE)

About
-----

[](#about)

This is a coding standard for [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) designed specifically for WordPress development. It extends the base [WPTechnix Coding Standards](https://github.com/WPTechnix/coding-standards), which already enforces strict types, immutability, and PSR-12 compliance, and incorporates rules from the official [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards).

This ruleset is designed to help you write modern, secure, and high-quality WordPress code, with a focus on:

**WordPress Best Practices:**

- Enforces the use of WordPress functions and APIs over native PHP.
- Checks for proper use of text domains for internationalization (i18n).
- Discourages the use of deprecated WordPress functions, classes, and parameters.
- Verifies correct prefixing and naming conventions for classes and functions.
- Ensures proper enqueueing of scripts and styles.

**Security:**

- Requires nonce verification for form and URL processing.
- Enforces proper data validation and sanitization of all inputs.
- Mandates output escaping to prevent XSS vulnerabilities.
- Flags the use of insecure and discouraged PHP and WordPress functions.

**Database:**

- Discourages direct database queries, promoting the use of WordPress database APIs.
- Enforces the use of prepared statements to prevent SQL injection attacks.
- Identifies potentially slow and inefficient database queries.

**Code Quality &amp; Analysis:**

- Flags the use of development functions (`var_dump`, `error_log`, etc.).
- Prevents modification of global variables.
- Enforces strict type checking (e.g., in `in_array`).

Installation
------------

[](#installation)

Install this package as a development dependency using [Composer](https://getcomposer.org).

```
composer require --dev "wptechnix/wordpress-coding-standards:^2.0"
```

### Optional: Automatic Installation with Dealerdirect

[](#optional-automatic-installation-with-dealerdirect)

For automatic registration with PHP\_CodeSniffer, you can optionally install [dealerdirect/phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer):

```
composer require --dev dealerdirect/phpcodesniffer-composer-installer
```

This plugin will:

- Automatically register the standard with PHP\_CodeSniffer upon Composer install.
- Eliminate the need for manual path configuration.
- Make the standard immediately available for use in your `phpcs.xml` configuration.

**Note:** This is optional. If you prefer manual configuration or have a custom PHP\_CodeSniffer setup, you can skip this step and configure the path manually in your `phpcs.xml` file.

Usage
-----

[](#usage)

To use this coding standard, add `` to your `phpcs.xml` configuration.

Here is an example `phpcs.xml.dist` file that you can place in the root of your repository:

```

    ./src
    ./tests

```

Then, run PHP\_CodeSniffer:

```
./vendor/bin/phpcs
```

To automatically fix violations:

```
./vendor/bin/phpcbf
```

Contributing
------------

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with the project's `CONTRIBUTING.md`.

Copyright and License
---------------------

[](#copyright-and-license)

The `wptechnix/wordpress-coding-standards` library is copyright © [WPTechnix](https://wptechnix.com) and licensed for use under the terms of the MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance85

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Total

3

Last Release

124d ago

Major Versions

v1.0.0 → v2.0.02025-11-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0fb168547a02b4a7b28df9403ab375f354591c75e814dce020f245e77f04e5f?d=identicon)[owaisahmed5300](/maintainers/owaisahmed5300)

---

Top Contributors

[![owaisahmed5300](https://avatars.githubusercontent.com/u/28684548?v=4)](https://github.com/owaisahmed5300 "owaisahmed5300 (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

code-qualitycoding-standardcoding-standardsphpcspsr-12standardsstatic-analysiswordpresswpcswptechnixstandardsphpcswordpressstatic analysiscode qualitycoding-standardsCoding Standardpsr-12wpcswptechnix

### Embed Badge

![Health badge](/badges/wptechnix-wordpress-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/wptechnix-wordpress-coding-standards/health.svg)](https://phpackages.com/packages/wptechnix-wordpress-coding-standards)
```

###  Alternatives

[wp-coding-standards/wpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[phpcompatibility/phpcompatibility-wp

A ruleset for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.

21830.6M587](/packages/phpcompatibility-phpcompatibility-wp)[inpsyde/php-coding-standards

PHP 7.4+ coding standards for Syde WordPress projects.

101163.9k45](/packages/inpsyde-php-coding-standards)[automattic/vipwpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions

25510.2M145](/packages/automattic-vipwpcs)[axepress/wp-graphql-cs

PHP\_CodeSniffer rules (sniffs) for the WPGraphQL ecosystem.

1060.9k7](/packages/axepress-wp-graphql-cs)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
