PHPackages                             bradp/wordpress-pattern-category-phpcs - 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. bradp/wordpress-pattern-category-phpcs

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

bradp/wordpress-pattern-category-phpcs
======================================

PHPCS sniffs for enforcing categories in WordPress block pattern files.

1.1.0(3mo ago)0800↓79.6%MITPHPPHP &gt;=7.4

Since Feb 13Pushed 3mo agoCompare

[ Source](https://github.com/bradp/wordpress-pattern-category-phpcs)[ Packagist](https://packagist.org/packages/bradp/wordpress-pattern-category-phpcs)[ RSS](/packages/bradp-wordpress-pattern-category-phpcs/feed)WikiDiscussions main Synced 2d ago

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

WordPressPatternCategory
========================

[](#wordpresspatterncategory)

PHPCS sniffs for enforcing categories in WordPress block pattern files.

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

[](#installation)

```
composer require --dev bradp/wordpress-pattern-category-phpcs
```

Usage
-----

[](#usage)

Add the rule to your project's `phpcs.xml` or `.phpcs.xml.dist`:

```

```

The legacy single-category property still works:

```

```

What it checks
--------------

[](#what-it-checks)

The sniff validates that WordPress block pattern files contain a file-level docblock with the correct metadata:

1. **Missing docblock** — The pattern file must have a `/** ... */` docblock near the top.
2. **Missing Categories** — The docblock must include a `Categories:` line.
3. **Missing required category** — If `base_category` or `base_categories` is configured, the pattern must include at least one configured category in the comma-separated list.

### Example of a valid pattern file

[](#example-of-a-valid-pattern-file)

```

```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance82

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

Total

2

Last Release

94d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66798?v=4)[Brad Parbs](/maintainers/bradp)[@bradp](https://github.com/bradp)

---

Top Contributors

[![bradp](https://avatars.githubusercontent.com/u/66798?v=4)](https://github.com/bradp "bradp (3 commits)")

---

Tags

standardsphpcswordpress

### Embed Badge

![Health badge](/badges/bradp-wordpress-pattern-category-phpcs/health.svg)

```
[![Health](https://phpackages.com/badges/bradp-wordpress-pattern-category-phpcs/health.svg)](https://phpackages.com/packages/bradp-wordpress-pattern-category-phpcs)
```

###  Alternatives

[automattic/vipwpcs

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

25811.4M200](/packages/automattic-vipwpcs)[wptrt/wpthemereview

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

216792.6k30](/packages/wptrt-wpthemereview)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.2M34](/packages/yoast-yoastcs)[inpsyde/php-coding-standards

PHP 7.4+ coding standards for Syde WordPress projects.

101172.1k47](/packages/inpsyde-php-coding-standards)[mayflower/mo4-coding-standard

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

17534.2k7](/packages/mayflower-mo4-coding-standard)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1790.9k6](/packages/infinum-eightshift-coding-standards)

PHPackages © 2026

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