-
Notifications
You must be signed in to change notification settings - Fork 3
Developer Guide
Nick Hamze edited this page Feb 13, 2026
·
1 revision
git clone https://github.com/RegionallyFamous/wp-pinch.git
cd wp-pinch
composer install
npm install
npm run build
make setup-hooks # Install pre-commit quality gates
npx wp-env start # http://localhost:8888 (admin/password)npm run build # Production build (Webpack via @wordpress/scripts)
npm run start # Watch mode for development
npm run lint:js # ESLint (wp-scripts lint-js)
npm run lint:css # Stylelint (wp-scripts lint-style)WP Pinch uses a multi-layered quality system. Think of it as a lobster cage with multiple chambers -- nothing escapes.
| Layer | Tool | What It Catches |
|---|---|---|
| Pre-commit hook | PHPCS + PHPStan | Coding standard violations, type errors |
| CI Pipeline | GitHub Actions | PHPCS, PHPStan, PHPUnit, ESLint, Stylelint, Build |
| Static Analysis | PHPStan Level 6 | Type mismatches, null access, undefined properties |
| Coding Standards | PHPCS (WordPress-Extra + Security) | Security, escaping, sanitization, naming |
| Unit Tests | PHPUnit (160+ tests) | Functional correctness, security guards, edge cases |
| JS Lint | ESLint (wp-scripts) | JavaScript errors, Prettier formatting |
| CSS Lint | Stylelint (wp-scripts) | CSS errors, specificity issues |
| Branch Protection | GitHub | All checks must pass before merging to main |
# Run everything
make check # PHPCS + PHPStan
# PHP
composer lint # PHPCS only
composer phpstan # PHPStan only
composer lint:fix # Auto-fix what PHPCBF can
# JavaScript / CSS
npm run lint:js # ESLint
npm run lint:css # Stylelint
# Tests
make test # PHPUnit
npm test # Jest (frontend tests)We follow a test-first approach for bug fixes:
- Write a failing test that reproduces the bug
- Run the test to confirm it fails
- Fix the bug
- Run the test to confirm it passes
- Run
make checkto ensure nothing else broke - Commit with a message that references the test
wp-pinch/
├── includes/ # PHP classes
│ ├── class-abilities.php # 35 WordPress abilities
│ ├── class-audit-table.php # Audit log database table
│ ├── class-circuit-breaker.php
│ ├── class-cli.php # WP-CLI commands
│ ├── class-feature-flags.php # Feature toggle system
│ ├── class-plugin.php # Core plugin singleton
│ ├── class-rest-controller.php # REST API endpoints
│ ├── class-settings.php # Admin settings pages
│ └── class-webhook-dispatcher.php
├── src/
│ ├── admin/ # Admin JS/CSS source
│ └── blocks/
│ └── pinch-chat/ # Chat block
│ ├── block.json # Block metadata
│ ├── edit.js # Editor component
│ ├── index.js # Block registration
│ ├── view.js # Frontend (Interactivity API)
│ ├── render.php # Server-side rendering
│ ├── style.css # Frontend + editor styles
│ └── editor.css # Editor-only styles
├── build/ # Compiled assets (generated)
├── tests/ # PHPUnit tests
├── languages/ # Translation files
├── wiki/ # GitHub Wiki source files
├── wp-pinch.php # Plugin entry point
├── uninstall.php # Cleanup on uninstall
├── Makefile # Build and quality targets
├── phpcs.xml.dist # PHPCS configuration
├── phpstan.neon.dist # PHPStan configuration
└── .wp-env.json # wp-env configuration
make zip # Build, generate i18n, package as wp-pinch.zipThe zip includes compiled assets, Composer production dependencies, and translation files. It does not include dev dependencies, tests, or source files.
See CONTRIBUTING.md for full guidelines on pull requests, commit messages, and code style.
WP Pinch is built on many open-source projects:
- WordPress -- The CMS that makes it all possible
- Abilities API -- WordPress 6.9 AI capability registration
- MCP Adapter -- Bridges abilities to Model Context Protocol
- Gutenberg -- Block editor foundation
- Interactivity API -- Reactive frontend runtime
- Action Scheduler -- Background task execution (GPL-3.0-or-later)
- Jetpack Autoloader -- Version conflict prevention (GPL-2.0-or-later)
- @wordpress/scripts -- Build toolchain
- @wordpress/env -- Docker dev environment
- OpenClaw -- AI agent framework
- WP-CLI -- Command-line interface (MIT)
- PHPUnit -- Testing framework (BSD-3-Clause)
- PHPStan -- Static analysis (MIT)
- WordPress Coding Standards -- PHPCS rules (MIT)
Created and maintained by Nick Hamze. Built with coffee, crustacean puns, and an unreasonable number of PHPStan runs.