Download the PHP package devsabbirhossain/wordpress-code-sniffer without Composer
On this page you can find all versions of the php package devsabbirhossain/wordpress-code-sniffer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download devsabbirhossain/wordpress-code-sniffer
More information about devsabbirhossain/wordpress-code-sniffer
Files in devsabbirhossain/wordpress-code-sniffer
Package wordpress-code-sniffer
Short Description A customized PHP_CodeSniffer ruleset that extends the official WordPress Coding Standards, tailored for modern, secure, and consistent PHP development practices.
License GPL-3.0-only
Informations about the package 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
- 🎯 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
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
- 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
Install via Composer:
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
Command Line
Quick Check
Using Composer Script
Custom Configuration
IDE Integration
For better IDE integration, create a .phpcs.xml.dist
file in your project root:
Continuous Integration
Add to your CI workflow:
Configuration Details
PHP Version Support
- Minimum: PHP 7.4
- Maximum: PHP 8.5
- Compatibility: Uses PHPCompatibilityWP for WordPress-specific compatibility checks
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
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
Project-Level Overrides
Create a phpcs.xml.dist
file to override or add rules:
Inline Annotations
Disable rules for specific code blocks:
Requirements
- PHP 7.4 or higher
- Composer
- PHP_CodeSniffer 3.9.0 or higher
Dependencies
dealerdirect/phpcodesniffer-composer-installer
: ^1.0phpcompatibility/phpcompatibility-wp
: ^2.1wp-coding-standards/wpcs
: ^3.1.0
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
composer run phpcs
- Submit a pull request
License
GPL-3.0-only
Author
Sabbir Hossain
Email: [email protected]
Organization: devsabbirhossain
This is only for WordPress plugin and theme development purposes.
All versions of wordpress-code-sniffer with dependencies
phpcompatibility/phpcompatibility-wp Version ^2.1.7
wp-coding-standards/wpcs Version ^3.1.0