PHPackages                             devsabbirhossain/wordpress-code-sniffer - 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. devsabbirhossain/wordpress-code-sniffer

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

devsabbirhossain/wordpress-code-sniffer
=======================================

A customized PHP\_CodeSniffer ruleset that extends the official WordPress Coding Standards, tailored for modern, secure, and consistent PHP development practices.

v1.0.0(11mo ago)04GPL-3.0-onlyShell

Since Jul 9Pushed 11mo agoCompare

[ Source](https://github.com/devsabbirhossain/wordpress-code-sniffer)[ Packagist](https://packagist.org/packages/devsabbirhossain/wordpress-code-sniffer)[ RSS](/packages/devsabbirhossain-wordpress-code-sniffer/feed)WikiDiscussions master Synced today

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

Wordpress Code Sniffer
======================

[](#wordpress-code-sniffer)

A customized PHP\_CodeSniffer ruleset that extends the official WordPress Coding Standards, tailored for modern, secure, and consistent PHP development practices.

Features
--------

[](#features)

- 🎯 **WordPress-First**: Built on top of WordPress Coding Standards (WPCS) 3.1.0
- 🐘 **PHP Compatibility**: Supports PHP 7.4 – 8.5 with PHPCompatibility checks
- ⚡ **Performance**: Configured for parallel processing with 8 threads
- 🎨 **Sensible Defaults**: Pre-configured with practical exclusions for real-world development
- 📝 **Tab Indentation**: Enforces consistent tab-based indentation
- 🔧 **Customizable**: Easy to extend and override rules per project

What's Included
---------------

[](#whats-included)

### Base Standards

[](#base-standards)

- **WordPress**: Complete WordPress coding standards
- **WordPress-Extra**: Additional WordPress-specific rules
- **WordPress-Docs**: Documentation standards
- **PHPCompatibilityWP**: WordPress-specific PHP compatibility checks

### Wordpress Code Standard Customizations

[](#wordpress-code-standard-customizations)

- Tab-based indentation (1 tab = 1 indent level)
- Space inside parentheses for better readability
- Relaxed file naming requirements
- Allowance for shorthand array syntax `[]`
- Sensible exclusions for database queries and nonce verification
- Comment and doc comment tokens ignored in indentation checks

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

[](#installation)

Install via Composer:

```
composer require devsabbirhossain/wordpress-code-sniffer
```

The package will automatically:

- Install PHP\_CodeSniffer and required dependencies
- Register the `WordPress-Code-Sniffer` standard
- Set it as the default standard for your project

Usage
-----

[](#usage)

### Command Line

[](#command-line)

#### Quick Check

[](#quick-check)

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

#### Using Composer Script

[](#using-composer-script)

```
composer run phpcs
```

#### Custom Configuration

[](#custom-configuration)

```
vendor/bin/phpcs --standard=WordPress-Code-Sniffer path/to/files
```

### IDE Integration

[](#ide-integration)

For better IDE integration, create a `.phpcs.xml.dist` file in your project root:

```

    A customized PHP_CodeSniffer ruleset that extends the official WordPress Coding Standards, tailored for modern, secure, and consistent PHP development practices.

    src/
    inc/

    vendor/
    node_modules/
    *.min.js

```

### Continuous Integration

[](#continuous-integration)

Add to your CI workflow:

```
# GitHub Actions example
- name: PHP CodeSniffer
  run: composer run phpcs
```

Configuration Details
---------------------

[](#configuration-details)

### PHP Version Support

[](#php-version-support)

- **Minimum**: PHP 7.4
- **Maximum**: PHP 8.5
- **Compatibility**: Uses PHPCompatibilityWP for WordPress-specific compatibility checks

### Key Rules Applied

[](#key-rules-applied)

- WordPress Coding Standards (with sensible exclusions)
- Tab indentation (1 tab per indent level)
- Space inside parentheses for readability
- Superfluous whitespace detection
- PHP compatibility checking for WordPress

### Excluded Rules

[](#excluded-rules)

The following rules are excluded for practical development:

- File naming conventions (WordPress.Files.FileName)
- Nonce verification requirements
- Direct database query restrictions
- Global variable override prohibitions
- Some documentation capitalization requirements

Customization
-------------

[](#customization)

### Project-Level Overrides

[](#project-level-overrides)

Create a `phpcs.xml.dist` file to override or add rules:

```

    admin/ajax-handlers/*

```

### Inline Annotations

[](#inline-annotations)

Disable rules for specific code blocks:

```
// phpcs:disable WordPress.Security.NonceVerification.Missing
if ( isset( $_POST['data'] ) ) {
    // Process data without nonce check
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
```

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- Composer
- PHP\_CodeSniffer 3.9.0 or higher

Dependencies
------------

[](#dependencies)

- `dealerdirect/phpcodesniffer-composer-installer`: ^1.0
- `phpcompatibility/phpcompatibility-wp`: ^2.1
- `wp-coding-standards/wpcs`: ^3.1.0

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

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test with `composer run phpcs`
5. Submit a pull request

License
-------

[](#license)

GPL-3.0-only

Author
------

[](#author)

**Sabbir Hossain**
Email:
Organization: [devsabbirhossain](https://devsabbirhossain.com)

---

*This is only for WordPress plugin and theme development purposes.*

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance50

Moderate activity, may be stable

Popularity3

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

Unknown

Total

1

Last Release

359d ago

### Community

Maintainers

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

---

Top Contributors

[![devsabbirhossain](https://avatars.githubusercontent.com/u/119017487?v=4)](https://github.com/devsabbirhossain "devsabbirhossain (1 commits)")

---

Tags

standardsphpcswordpresscode standardSabbir Hossaindevsabbirhossain

### Embed Badge

![Health badge](/badges/devsabbirhossain-wordpress-code-sniffer/health.svg)

```
[![Health](https://phpackages.com/badges/devsabbirhossain-wordpress-code-sniffer/health.svg)](https://phpackages.com/packages/devsabbirhossain-wordpress-code-sniffer)
```

###  Alternatives

[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[wp-coding-standards/wpcs

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

2.8k47.8M2.2k](/packages/wp-coding-standards-wpcs)[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k134.0M2.3k](/packages/slevomat-coding-standard)[humanmade/coding-standards

Human Made Coding Standards

160443.1k59](/packages/humanmade-coding-standards)[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.

22134.3M758](/packages/phpcompatibility-phpcompatibility-wp)[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)
