PHPackages                             humanmade/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. humanmade/coding-standards

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

humanmade/coding-standards
==========================

Human Made Coding Standards

v1.2.1(3y ago)161424.0k—9.6%19[24 PRs](https://github.com/humanmade/coding-standards/pulls)20GPL-2.0-or-laterPHPPHP &gt;=7.1CI failing

Since Dec 8Pushed 3mo ago23 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (55)Used By (20)

   **Human Made Coding Standards**
 WordPress coding standards, enhanced for modern development.   [![](https://camo.githubusercontent.com/03b7babe299b4265a1972a894bc8a3c4cb689a972956f0a25f908bdedbd493a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68756d616e6d6164652f636f64696e672d7374616e64617264732e737667)](https://packagist.org/packages/humanmade/coding-standards) [![](https://camo.githubusercontent.com/d4a6b181f9c16626785932efb10f5b45e3e7a67cc1da034225a95d7ba2d6ac76/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f4068756d616e6d6164652f65736c696e742d636f6e6669673f6c6162656c3d25343068756d616e6d61646525324665736c696e742d636f6e666967)](https://www.npmjs.com/package/@humanmade/eslint-config) [![](https://camo.githubusercontent.com/da1d01f4a56299b0baca44fb3a772c76f57727429ab2fc801d2c8628cc8b94e1/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f4068756d616e6d6164652f7374796c656c696e742d636f6e6669673f6c6162656c3d25343068756d616e6d6164652532467374796c656c696e742d636f6e666967)](https://www.npmjs.com/package/@humanmade/stylelint-config) [![Build Status](https://camo.githubusercontent.com/7288d9845c36d60aa345b234e40e8fdbf8bd344448b43372d7b64d864d59276b/68747470733a2f2f7472617669732d63692e636f6d2f68756d616e6d6164652f636f64696e672d7374616e64617264732e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/7288d9845c36d60aa345b234e40e8fdbf8bd344448b43372d7b64d864d59276b/68747470733a2f2f7472617669732d63692e636f6d2f68756d616e6d6164652f636f64696e672d7374616e64617264732e7376673f6272616e63683d6d6173746572)     A **[Human Made](https://hmn.md/)** project.   [![](https://camo.githubusercontent.com/21ddd8db8af0243ccabd437a33ded6e2da1e9777d1b4d75f30ab9ac80803c90a/68747470733a2f2f686d6e2e6d642f636f6e74656e742f7468656d65732f686d6e6d642f6173736574732f696d616765732f686d2d6c6f676f2e737667)](https://camo.githubusercontent.com/21ddd8db8af0243ccabd437a33ded6e2da1e9777d1b4d75f30ab9ac80803c90a/68747470733a2f2f686d6e2e6d642f636f6e74656e742f7468656d65732f686d6e6d642f6173736574732f696d616765732f686d2d6c6f676f2e737667)  This is a codified version of [the Human Made style guide](http://engineering.hmn.md/how-we-work/style/). We include phpcs, ESLint, and stylelint rules.

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

[](#contributing)

We welcome contributions to these standards and want to make the experience as seamless as possible. To learn more about contributing, please reference the [CONTRIBUTING.md](CONTRIBUTING.md) file.

Setup
-----

[](#setup)

Each ruleset is available individually via Composer or NPM. To install the needed ruleset, use one of the following commands:

- PHPCS: `composer require --dev humanmade/coding-standards`
- ESLint: `npx install-peerdeps --dev @humanmade/eslint-config@latest`
- stylelint: `npm install --save-dev stylelint @humanmade/stylelint-config`

Using PHPCS
-----------

[](#using-phpcs)

Run the following command to run the standards checks:

```
vendor/bin/phpcs --standard=vendor/humanmade/coding-standards .

```

We use the [DealerDirect phpcodesniffer-composer-installer](https://github.com/Dealerdirect/phpcodesniffer-composer-installer) package to handle `installed_paths` for PHPCS when first installing the HM ruleset. If you an error such as `ERROR: Referenced sniff "WordPress-Core" does not exist`, delete the `composer.lock` file and `vendor` directories and re-install Composer dependencies.

The final `.` here specifies the files you want to test; this is typically the current directory (`.`), but you can also selectively check files or directories by specifying them instead.

You can add this to your Travis YAML file as a test:

```
script:
  - phpunit
  - vendor/bin/phpcs --standard=vendor/humanmade/coding-standards .
```

### Excluding Files

[](#excluding-files)

This standard includes special support for a `.phpcsignore` file (in the future, this should be [built into phpcs itself](https://github.com/squizlabs/PHP_CodeSniffer/issues/1884)). Simply place a `.phpcsignore` file in your root directory (wherever you're going to run `phpcs` from).

The format of this file is similar to `.gitignore` and similar files: one pattern per line, comment lines should start with a `#`, and whitespace-only lines are ignored:

```
# Exclude our tests directory.
tests/

# Exclude any file ending with ".inc"
*\.inc

```

Note that the patterns should match [the PHP\_CodeSniffer style](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders): `*` is translated to `.*` for convenience, but all other characters work like a regular expression.

Patterns are relative to the directory that the `.phpcsignore` file lives in. On load, they are translated to absolute patterns: e.g. `*/tests/*` in `/your/dir/.phpcsignore` will become `/your/dir/.*/tests/.*` as a regular expression. **This differs from the regular PHP\_CodeSniffer practice.**

### Advanced/Extending

[](#advancedextending)

If you want to add further rules (such as WordPress.com VIP-specific rules) or customize PHPCS defaults, you can create your own custom standard file (e.g. `phpcs.ruleset.xml`):

```

	.

```

You can then reference this file when running phpcs:

```
vendor/bin/phpcs --standard=phpcs.ruleset.xml .

```

#### Excluding/Disabling Checks

[](#excludingdisabling-checks)

You can also customise the rule to exclude elements if they aren't applicable to the project:

```

```

Rules can also be disabled inline. [phpcs rules can be disabled](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-parts-of-a-file) with a `// @codingStandardsIgnoreLine` comment, and [ESLint rules can be disabled](http://eslint.org/docs/user-guide/configuring#disabling-rules-with-inline-comments) with a `/* eslint disable ... */` comment.

To find out what these codes are, specify `-s` when running `phpcs`, and the code will be output as well. You can specify a full code, or a partial one to disable groups of errors.

Included Checks
---------------

[](#included-checks)

The phpcs standard is based upon the `WordPress-VIP` standard from [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards), with [customisation and additions](HM/ruleset.xml) to match our style guide.

Using ESLint
------------

[](#using-eslint)

The ESLint package contains an [ESLint](https://eslint.org/) configuration which you can use to validate your JavaScript code style. While it is possible to run ESLint via phpcs, we recommend you install and use eslint via npm directly or use [linter-bot](https://github.com/humanmade/linter-bot). See [the `@humanmade/eslint-config` package README](packages/eslint-config-humanmade/readme.md) for more information on configuring ESLint to use the Human Made coding standards.

Once you have installed the [`@humanmade/eslint-config` npm package](https://www.npmjs.com/package/@humanmade/eslint-config), you may simply specify that your own project-level ESLint file extends the `humanmade` configuration. If you install this globally (`npm install -g @humanmade/eslint-config`) you can also reference the configuration directly from the command line via `eslint -c humanmade .`

Alternatively, you can create your own configuration and extend these rules:

`.eslintrc`

```
{
  "extends": "@humanmade"
}
```

Using stylelint
---------------

[](#using-stylelint)

The stylelint package contains a [stylelint](https://stylelint.io/) configuration which you can use to validate your CSS and SCSS code style. We recommend you install and use stylelint via npm directly or use [linter-bot](https://github.com/humanmade/linter-bot). See [the `@humanmade/stylelint` package README](packages/stylelint-config/readme.md) for more information on configuring stylelint to use the Human Made coding standards.

To integrate the Human Made rules into your project, add a `.stylelintrc` file and extend these rules. You can also add your own rules and overrides for further customization.

```
{
  "extends": "@humanmade/stylelint-config",
  "rules": {
    ...
  }
}
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance53

Moderate activity, may be stable

Popularity53

Moderate usage in the ecosystem

Community43

Growing community involvement

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~90 days

Recently: every ~207 days

Total

27

Last Release

1099d ago

Major Versions

v0.8.0 → v1.0.02020-07-30

v0.8.x-dev → v1.1.x-dev2020-12-10

v1.2.1 → v2.x-dev2023-05-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21655?v=4)[Ryan McCue](/maintainers/rmccue)[@rmccue](https://github.com/rmccue)

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

---

Top Contributors

[![rmccue](https://avatars.githubusercontent.com/u/21655?v=4)](https://github.com/rmccue "rmccue (239 commits)")[![mikeselander](https://avatars.githubusercontent.com/u/3021494?v=4)](https://github.com/mikeselander "mikeselander (234 commits)")[![ntwb](https://avatars.githubusercontent.com/u/1016458?v=4)](https://github.com/ntwb "ntwb (95 commits)")[![kadamwhite](https://avatars.githubusercontent.com/u/442115?v=4)](https://github.com/kadamwhite "kadamwhite (60 commits)")[![tfrommen](https://avatars.githubusercontent.com/u/6049306?v=4)](https://github.com/tfrommen "tfrommen (30 commits)")[![joehoyle](https://avatars.githubusercontent.com/u/161683?v=4)](https://github.com/joehoyle "joehoyle (25 commits)")[![mattheu](https://avatars.githubusercontent.com/u/494927?v=4)](https://github.com/mattheu "mattheu (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![roborourke](https://avatars.githubusercontent.com/u/23417?v=4)](https://github.com/roborourke "roborourke (16 commits)")[![abhishek-kaushik](https://avatars.githubusercontent.com/u/1883835?v=4)](https://github.com/abhishek-kaushik "abhishek-kaushik (14 commits)")[![nathanielks](https://avatars.githubusercontent.com/u/314009?v=4)](https://github.com/nathanielks "nathanielks (6 commits)")[![johnbillion](https://avatars.githubusercontent.com/u/208434?v=4)](https://github.com/johnbillion "johnbillion (5 commits)")[![dac514](https://avatars.githubusercontent.com/u/812192?v=4)](https://github.com/dac514 "dac514 (5 commits)")[![igmoweb](https://avatars.githubusercontent.com/u/1516569?v=4)](https://github.com/igmoweb "igmoweb (4 commits)")[![svandragt](https://avatars.githubusercontent.com/u/594871?v=4)](https://github.com/svandragt "svandragt (4 commits)")[![peterwilsoncc](https://avatars.githubusercontent.com/u/519727?v=4)](https://github.com/peterwilsoncc "peterwilsoncc (4 commits)")[![kevinlangleyjr](https://avatars.githubusercontent.com/u/877634?v=4)](https://github.com/kevinlangleyjr "kevinlangleyjr (2 commits)")[![pdewouters](https://avatars.githubusercontent.com/u/30460?v=4)](https://github.com/pdewouters "pdewouters (1 commits)")[![missjwo](https://avatars.githubusercontent.com/u/1190079?v=4)](https://github.com/missjwo "missjwo (1 commits)")[![BronsonQuick](https://avatars.githubusercontent.com/u/1377956?v=4)](https://github.com/BronsonQuick "BronsonQuick (1 commits)")

---

Tags

eslint-configeslint-rulesphpcsstylelint-configwordpress

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[woocommerce/woocommerce-sniffs

WooCommerce sniffs

496.8M42](/packages/woocommerce-woocommerce-sniffs)[syde/phpcs

Syde PHP coding standards for WordPress projects.

1019.7k7](/packages/syde-phpcs)[awesomemotive/wpforms-phpcs

WPForms Coding Standards

147.0k](/packages/awesomemotive-wpforms-phpcs)[bjornjohansen/wp-pre-commit-hook

Pre-commit hook for WordPress projects

118.8k3](/packages/bjornjohansen-wp-pre-commit-hook)

PHPackages © 2026

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