code-quality
Code Quality Standards
Quick Commands
npm run php:lint # Check PHP style
npm run php:lint-fix # Auto-fix PHP issues
npm run php:phpstan # Static analysis
npm run lint:js # JavaScript
npm run lint:css # CSS
Project-Specific Rules
| Area | Standard |
|---|---|
| PHP | 7.4+, WordPress Coding Standards |
| Prefixes | sh, simplehistory, simple_history |
| Text domain | simple-history |
| CSS naming | SuitCSS: sh-ComponentName-subpart |
| Array syntax | Short [] not array() |
| Control structures | Always use braces {}, never colon syntax |
Essential Principles
- Always escape output - Use WordPress escaping functions
- Prefix everything - All hooks, functions, classes
- Run tools after changes - phpcs/phpstan before committing
Detailed Guidelines
- php-standards.md - PHP style, happy path, early returns
- css-standards.md - SuitCSS naming conventions
- js-standards.md - JavaScript conventions
- tooling.md - phpcs, phpstan, rector usage
- design-principles.md - DRY, YAGNI, refactoring patterns
Related Files
phpcs.xml.dist- PHP_CodeSniffer configphpstan.neon- PHPStan config
More from bonny/wordpress-simple-history
changelog
Adds changelog entries to readme.txt following keepachangelog format. Use when updating the Unreleased section or documenting changes for a release.
23wordpress-org-compliance
Reviews plugin code for WordPress.org compliance and trialware violations. Use when checking premium features, upsells, or license keys before submission.
17logger-messages
Enforces active voice (verb-first) for all Simple History logger messages and the Event Details API for details output. Triggers: creating a new logger class, writing or modifying a 'messages' array in get_info()/getInfo(), calling notice_message/warning_message/info_message, or implementing get_log_row_details_output().
13release
Release checklist for core and premium plugins. Covers version bumping, changelog finalization, tagging, and deployment. Triggers when user says "release", "publish", "deploy", "bump version", "prepare release".
10sql
Run SQL queries against the WordPress development database. Use when querying database tables, inspecting Simple History events, checking WordPress data, debugging database issues, or when the user says "run query" or "check database".
7github-project
Use when working with the Simple History GitHub project board — updating issue status, querying board items, or automating project workflows.
1