Curated resource guide
WordPress Coding Standards and Code Quality
Keep large WordPress codebases consistent, reviewable, and easier to change. The selected resources cover official coding standards, PHPCS, static analysis, JavaScript and CSS tooling, architecture, automated formatting, security checks, documentation, backward compatibility, and pragmatic quality controls for plugins and themes.
Scope
What this guide covers
- WordPress PHP, JavaScript, CSS, HTML and documentation standards
- PHPCS and WordPress Coding Standards
- PHPStan/Psalm static analysis
- ESLint, Stylelint and Prettier
- Composer
- autoloading
- namespaces
- dependency injection
- object-oriented design
- procedural WordPress patterns
- code organization
- type declarations
- strictness tradeoffs
- security linting
- complexity
- dead code
- test coverage
- Git hooks
- automated formatting
- code review
- backward compatibility
- deprecated APIs
- documentation
- and maintaining quality in large plugins/themes
Selected references
Curated resources
Links open the original publisher so you can use the complete, current material in context.
- 01Recommended starting point
WordPress Coding Standards
The official index for PHP, JavaScript, CSS, HTML, and documentation conventions.
developer.wordpress.org - 02
WordPress PHP Coding Standards
Apply WordPress-specific PHP formatting, naming, control-structure, database, and security conventions.
developer.wordpress.org - 03
WordPress JavaScript Coding Standards
Keep JavaScript readable and consistent with the conventions used across WordPress projects.
developer.wordpress.org - 04
WordPress CSS Coding Standards
Use the project conventions for selectors, properties, values, structure, and documentation.
developer.wordpress.org - 05
WordPress HTML Coding Standards
Review valid, semantic, accessible markup conventions expected in WordPress code.
developer.wordpress.org - 06
WordPress Inline Documentation Standards
Document PHP and JavaScript APIs in the formats used by WordPress tooling and references.
developer.wordpress.org - 07
WordPress Coding Standards for PHPCS
The canonical PHPCS ruleset for enforcing WordPress PHP conventions and catching common quality problems in CI.
github.com