PHPackages                             yutahaga/wpcs-psr2 - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. yutahaga/wpcs-psr2

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

yutahaga/wpcs-psr2
==================

PHP\_CodeSniffer ruleset to enforce WordPress &amp; PSR-2 coding conventions

v1.0.3(7y ago)030MITPHP &gt;=5.4

Since Mar 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/yutahaga/wp-psr2-coding-standards)[ Packagist](https://packagist.org/packages/yutahaga/wpcs-psr2)[ RSS](/packages/yutahaga-wpcs-psr2/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (5)Used By (0)

WordPress &amp; PSR-2 Coding Standards for PHP\_CodeSniffer
===========================================================

[](#wordpress--psr-2-coding-standards-for-php_codesniffer)

PHP\_CodeSniffer ruleset to enforce WordPress &amp; PSR-2 coding conventions

Introduction
------------

[](#introduction)

A rule set that combines [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) and [PSR-2](https://www.php-fig.org/psr/psr-2/). The goal is to reduce the stress on developers by reducing the differences in coding conventions with other PHP applications.

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

[](#installation)

### Automatic install

[](#automatic-install)

Add the following scripts in `composer.json`

```
{
  "scripts": {
    "install-codestandards": ["Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"],
    "post-install-cmd": ["@install-codestandards"]
  }
}
```

```
composer require --dev dealerdirect/phpcodesniffer-composer-installer
composer require --dev yutahaga/wpcs-psr2
```

### Manually install

[](#manually-install)

```
composer require --dev yutahaga/wpcs-psr2
phpcs --config-set installed_paths ./vendor/yutahaga/wpcs-psr2,./vendor/wp-coding-standards/wpcs,other-ruleset
```

Usage
-----

[](#usage)

Here is an example of the `phpcs.xml`

```

  My Coding Standards extends WordPress-Extra and PSR-2

  ./app
  ./bootstrap
  ./config
  ./functions.php

  bootstrap/cache/*.php
  */*.js
  */*.css
  */*.xml
  */node_modules/*
  */vendor/*

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

2608d ago

### Community

Maintainers

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

---

Top Contributors

[![yutahaga](https://avatars.githubusercontent.com/u/5030849?v=4)](https://github.com/yutahaga "yutahaga (5 commits)")

---

Tags

standardsphpcswordpress

### Embed Badge

![Health badge](/badges/yutahaga-wpcs-psr2/health.svg)

```
[![Health](https://phpackages.com/badges/yutahaga-wpcs-psr2/health.svg)](https://phpackages.com/packages/yutahaga-wpcs-psr2)
```

###  Alternatives

[automattic/vipwpcs

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

25510.2M145](/packages/automattic-vipwpcs)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1785.2k3](/packages/infinum-eightshift-coding-standards)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)[phpcompatibility/phpcompatibility-all

A set of rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues and opportunities to modernize code in PHP projects.

1361.7k](/packages/phpcompatibility-phpcompatibility-all)

PHPackages © 2026

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