wp-hooks/generator
Generate WordPress hook documentation from your PHP source code. This tool scans plugins, themes, and packages to produce structured JSON files of all actions and filters, powering searchable hook references and API docs.
Architecture fit
nikic/php-parser and emits a JSON document describing do_action* / apply_filters* call sites and their docblocks — no WordPress bootstrap required. That makes it a clean fit for CI containers and headless setups (e.g., a Laravel app that owns a WordPress content backend, or a monorepo of WP plugins).Integration feasibility
composer require --dev, run against one package, inspect JSON. No schema migrations, no database, no service to operate.composer.json before automating; do not assume CLI contract stability across versions.Technical risk
do_action($name), interpolation, hooks returned from arrays/factories) are invisible to static analysis. The output will look complete while being partial — the most dangerous failure mode for a documentation or contract-testing use case.nikic/php-parser is shared with PHPStan, Rector, and Pint. Version-pin conflicts in a mature dev-dependency graph are likely and must be checked per-repo.Key questions
Stack fit
require-dev block of the WordPress-adjacent packages, invoked from a Composer script or an Artisan command; in a polyrepo it belongs in a dedicated tooling/ package pinned once and consumed everywhere.artisan route:list-style introspection covers Laravel hooks; this covers the WordPress extension surface that Laravel has no visibility into.Migration path
Compatibility
composer why nikic/php-parser and a dry-run composer update --with-dependencies on a branch to surface constraint conflicts with PHPStan/Rector/Pint before committing to adoption.Sequencing
Maintenance
php-parser.Support
Scaling
--no-verify culture.Failure modes
| Mode | Impact | Mitigation |
|---|---|---|
| Dynamic hooks silently omitted | Docs/contracts incomplete, false confidence | Publish a known-limitations note; add a manual checklist for dynamic cases |
php-parser constraint conflict |
composer install breaks across the dev toolchain |
Pre-flight check; isolate the tool in its own Composer context |
| Output schema drift on upgrade | Docs/stub generators break | Pin version; snapshot-test the JSON schema in CI |
| Package abandonment | Tooling rots as PHP evolves | Fork contingency; keep the invocation thin so swapping is cheap |
| Noise in generated JSON diffs | Review fatigue, suppressed diffs | Commit only on release branches, or publish as a CI artifact |
Ramp-up / verdict
How can I help you explore Laravel packages today?