@the-bearded-bear/claude-craft 9.2.0 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dev/i18n/base/Angular/rules/00-project-context.md.template +1 -1
- package/Dev/i18n/base/Angular/rules/03-coding-standards.md +17 -16
- package/Dev/i18n/base/Angular/rules/06-tooling.md +2 -2
- package/Dev/i18n/base/CSharp/rules/06-tooling.md +8 -6
- package/Dev/i18n/base/Common/hooks/scripts/block-dangerous-commands.sh +93 -48
- package/Dev/i18n/base/Common/hooks/scripts/guard-network.sh +58 -0
- package/Dev/i18n/base/Common/hooks/scripts/lib/hook-io.sh +181 -0
- package/Dev/i18n/base/Common/hooks/scripts/notify-slack.sh +21 -32
- package/Dev/i18n/base/Common/hooks/scripts/output-filter.sh +23 -0
- package/Dev/i18n/base/Common/hooks/scripts/output-size-hint.sh +19 -0
- package/Dev/i18n/base/Common/hooks/scripts/post-edit-lint.sh +29 -53
- package/Dev/i18n/base/Common/hooks/scripts/post-tool-failure.sh +50 -0
- package/Dev/i18n/base/Common/hooks/scripts/pre-commit-check.sh +59 -63
- package/Dev/i18n/base/Common/hooks/scripts/pre-compact.sh +52 -0
- package/Dev/i18n/base/Common/hooks/scripts/protect-sensitive-files.sh +16 -0
- package/Dev/i18n/base/Common/hooks/scripts/quality-gate.sh +49 -92
- package/Dev/i18n/base/Common/hooks/scripts/session-end.sh +51 -0
- package/Dev/i18n/base/Common/hooks/scripts/session-init.sh +45 -69
- package/Dev/i18n/base/Common/hooks/templates/examples/README.md +59 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/auto-format.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/block-dangerous-commands.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/context-reinject.json +28 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/output-filter.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/pre-compact.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/protect-files.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/security-block.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/stop-hook.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/user-prompt-submit.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/hooks.default.json +72 -0
- package/Dev/i18n/base/Common/hooks/templates/{settings-hooks.json → hooks.full.json} +22 -23
- package/Dev/i18n/base/Common/hooks/templates/hooks.memory.json +62 -0
- package/Dev/i18n/base/Common/templates/AGENTS.md.template +1 -1
- package/Dev/i18n/base/Common/templates/settings.json.template +46 -0
- package/Dev/i18n/base/Flutter/rules/00-project-context.md.template +9 -9
- package/Dev/i18n/base/Laravel/checks/code-quality.md +1 -1
- package/Dev/i18n/base/Laravel/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Laravel/rules/06-tooling.md +10 -8
- package/Dev/i18n/base/Laravel/rules/07-testing-laravel.md +2 -0
- package/Dev/i18n/base/Laravel/rules/08-quality-tools.md +2 -2
- package/Dev/i18n/base/PHP/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Tauri/rules/02-architecture-tauri.md +1 -0
- package/Dev/i18n/base/Vercel/checks/all.md +1 -1
- package/Dev/i18n/base/Vercel/checks/architecture.md +1 -1
- package/Dev/i18n/base/Vercel/rules/02-architecture-vercel.md +4 -2
- package/Dev/i18n/base/Vercel/rules/06-tooling.md +7 -5
- package/Dev/i18n/base/Vercel/rules/11-security-vercel.md +1 -1
- package/Dev/i18n/base/Vite/rules/06-tooling.md +2 -1
- package/Dev/i18n/base/Vite/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/VueJS/rules/06-tooling.md +3 -3
- package/Dev/i18n/base/VueJS/rules/07-testing-vuejs.md +9 -8
- package/Dev/i18n/base/VueJS/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/WordPress/checklists/new-feature.md +59 -0
- package/Dev/i18n/base/WordPress/checklists/pre-commit.md +125 -0
- package/Dev/i18n/base/WordPress/checks/all.md +257 -0
- package/Dev/i18n/base/WordPress/checks/architecture.md +157 -0
- package/Dev/i18n/base/WordPress/checks/code-quality.md +158 -0
- package/Dev/i18n/base/WordPress/checks/security.md +158 -0
- package/Dev/i18n/base/WordPress/checks/testing.md +157 -0
- package/Dev/i18n/base/WordPress/commands/check.md +28 -0
- package/Dev/i18n/base/WordPress/rules/00-project-context.md.template +169 -0
- package/Dev/i18n/base/WordPress/rules/02-architecture-wordpress.md +174 -0
- package/Dev/i18n/base/WordPress/rules/03-coding-standards.md +98 -0
- package/Dev/i18n/base/WordPress/rules/06-tooling.md +146 -0
- package/Dev/i18n/base/WordPress/rules/07-testing-wordpress.md +150 -0
- package/Dev/i18n/base/WordPress/rules/08-quality-tools.md +161 -0
- package/Dev/i18n/base/WordPress/rules/11-security-wordpress.md +175 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/REFERENCE.md +214 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/SKILL.md +40 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/checklist.md +66 -0
- package/Dev/i18n/base/WordPress/templates/block.md +235 -0
- package/Dev/i18n/base/WordPress/templates/plugin-bootstrap.md +215 -0
- package/Dev/i18n/base/WordPress/templates/rest-endpoint.md +246 -0
- package/Dev/i18n/de/Angular/CLAUDE.md.template +2 -1
- package/Dev/i18n/de/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/de/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/de/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/de/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/de/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/de/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/de/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/de/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/de/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/de/Common/rules/11-security.md +12 -12
- package/Dev/i18n/de/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/de/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/de/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/de/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/de/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/de/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/de/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/de/Paperclip/README.md +1 -1
- package/Dev/i18n/de/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/de/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/de/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/de/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/de/Python/checks/security.md +2 -2
- package/Dev/i18n/de/Python/checks/testing.md +2 -2
- package/Dev/i18n/de/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/de/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/de/Python/templates/repository.md +2 -2
- package/Dev/i18n/de/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/de/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/de/React/templates/component.md +11 -9
- package/Dev/i18n/de/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/de/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/de/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/de/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/de/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/de/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/de/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/de/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/de/Symfony/adr/README.md +1 -1
- package/Dev/i18n/de/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/de/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/de/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/de/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/de/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/de/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/de/Symfony/templates/README.md +1 -1
- package/Dev/i18n/de/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/de/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/de/Vercel/checks/all.md +1 -1
- package/Dev/i18n/de/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/de/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/de/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/de/WordPress/checks/all.md +242 -0
- package/Dev/i18n/de/WordPress/commands/check.md +28 -0
- package/Dev/i18n/en/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/en/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/en/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/en/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/en/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/en/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/en/Common/hooks/HOOKS-QUICKSTART.md +31 -43
- package/Dev/i18n/en/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/en/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/en/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/en/Common/rules/11-security.md +12 -12
- package/Dev/i18n/en/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/en/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/en/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/en/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/en/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/en/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/en/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/en/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/en/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/en/Paperclip/README.md +1 -1
- package/Dev/i18n/en/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/en/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/en/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/en/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/en/Python/checks/security.md +2 -2
- package/Dev/i18n/en/Python/checks/testing.md +2 -2
- package/Dev/i18n/en/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/en/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/en/Python/templates/repository.md +2 -2
- package/Dev/i18n/en/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/en/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/en/React/templates/component.md +11 -9
- package/Dev/i18n/en/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/02-architecture.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/en/ReactNative/rules/07-testing-reactnative.md +1 -1
- package/Dev/i18n/en/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/en/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/en/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/en/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/en/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/en/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/en/Symfony/adr/README.md +1 -1
- package/Dev/i18n/en/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/en/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/en/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/en/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/en/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/en/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/en/Symfony/templates/README.md +1 -1
- package/Dev/i18n/en/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/en/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/en/Vercel/checks/all.md +1 -1
- package/Dev/i18n/en/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/en/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/en/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/en/WordPress/checks/all.md +241 -0
- package/Dev/i18n/en/WordPress/commands/check.md +28 -0
- package/Dev/i18n/es/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/es/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/es/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/es/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/es/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/es/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/es/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/es/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/es/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/es/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/es/Common/rules/11-security.md +12 -12
- package/Dev/i18n/es/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/es/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/es/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/es/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/es/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/es/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/es/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/es/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/es/Paperclip/README.md +1 -1
- package/Dev/i18n/es/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/es/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/es/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/es/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/es/Python/checks/security.md +2 -2
- package/Dev/i18n/es/Python/checks/testing.md +2 -2
- package/Dev/i18n/es/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/es/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/es/Python/templates/repository.md +2 -2
- package/Dev/i18n/es/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/es/React/templates/component.md +11 -9
- package/Dev/i18n/es/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/es/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/es/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/es/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/es/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/es/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/es/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/es/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/es/Symfony/adr/README.md +1 -1
- package/Dev/i18n/es/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/es/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/es/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/es/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/es/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/es/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/es/Symfony/templates/README.md +1 -1
- package/Dev/i18n/es/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/es/Vercel/agents/vercel-reviewer.md +2 -1
- package/Dev/i18n/es/Vercel/checks/all.md +1 -1
- package/Dev/i18n/es/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/es/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/es/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/es/WordPress/checks/all.md +241 -0
- package/Dev/i18n/es/WordPress/commands/check.md +28 -0
- package/Dev/i18n/fr/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/fr/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/fr/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/fr/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/fr/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/fr/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/fr/Common/hooks/HOOKS-QUICKSTART.md +32 -44
- package/Dev/i18n/fr/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/fr/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/fr/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/fr/Common/rules/11-security.md +12 -12
- package/Dev/i18n/fr/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/fr/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/fr/Flutter/rules/02-architecture.md +4 -4
- package/Dev/i18n/fr/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/fr/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/fr/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/fr/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/fr/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/fr/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/fr/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/fr/Paperclip/README.md +1 -1
- package/Dev/i18n/fr/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/fr/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/fr/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/fr/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/fr/Python/checks/security.md +2 -2
- package/Dev/i18n/fr/Python/checks/testing.md +2 -2
- package/Dev/i18n/fr/Python/commands/dependency-audit.md +1 -2
- package/Dev/i18n/fr/Python/commands/generate-endpoint.md +7 -11
- package/Dev/i18n/fr/Python/commands/generate-model.md +6 -6
- package/Dev/i18n/fr/Python/rules/02-architecture.md +9 -24
- package/Dev/i18n/fr/Python/rules/03-coding-standards.md +19 -7
- package/Dev/i18n/fr/Python/templates/repository.md +9 -10
- package/Dev/i18n/fr/React/commands/generate-component.md +52 -51
- package/Dev/i18n/fr/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/fr/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/fr/React/templates/component.md +11 -9
- package/Dev/i18n/fr/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/fr/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/fr/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/fr/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/fr/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/fr/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/fr/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/fr/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/fr/Symfony/adr/README.md +1 -1
- package/Dev/i18n/fr/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/fr/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/fr/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/fr/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/fr/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/fr/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/fr/Symfony/templates/README.md +1 -1
- package/Dev/i18n/fr/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/fr/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/fr/Vercel/checks/all.md +1 -1
- package/Dev/i18n/fr/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/fr/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/fr/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/fr/WordPress/checks/all.md +242 -0
- package/Dev/i18n/fr/WordPress/commands/check.md +28 -0
- package/Dev/i18n/pt/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/pt/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/pt/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/pt/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/pt/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/pt/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/pt/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/pt/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/pt/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/pt/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/pt/Common/rules/11-security.md +12 -12
- package/Dev/i18n/pt/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/pt/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/pt/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/pt/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/pt/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/pt/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/pt/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/pt/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/pt/Paperclip/README.md +1 -1
- package/Dev/i18n/pt/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/pt/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/pt/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/pt/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/pt/Python/checks/security.md +2 -2
- package/Dev/i18n/pt/Python/checks/testing.md +2 -2
- package/Dev/i18n/pt/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/pt/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/pt/Python/templates/repository.md +2 -2
- package/Dev/i18n/pt/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/pt/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/pt/React/templates/component.md +12 -10
- package/Dev/i18n/pt/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/pt/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/pt/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/pt/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/pt/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/pt/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/pt/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/pt/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/pt/Symfony/adr/README.md +1 -1
- package/Dev/i18n/pt/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/pt/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/pt/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/pt/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/pt/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/pt/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/pt/Symfony/templates/README.md +1 -1
- package/Dev/i18n/pt/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/pt/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/pt/Vercel/checks/all.md +1 -1
- package/Dev/i18n/pt/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/pt/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/pt/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/pt/WordPress/checks/all.md +241 -0
- package/Dev/i18n/pt/WordPress/commands/check.md +28 -0
- package/Dev/scripts/check-config.sh +1 -1
- package/Dev/scripts/install-common-rules.sh +65 -0
- package/Dev/scripts/install-from-config.sh +3 -0
- package/Dev/scripts/install-paperclip-rules.sh +1 -1
- package/Dev/scripts/install-wordpress-rules.sh +153 -0
- package/Dev/scripts/lib/merge-hooks.mjs +110 -0
- package/Dev/scripts/memory-lifecycle/README.md +10 -9
- package/Dev/scripts/memory-lifecycle/_db.sh +1 -1
- package/Dev/scripts/memory-lifecycle/post-tool.sh +1 -1
- package/Dev/scripts/memory-lifecycle/pre-compact.sh +5 -5
- package/Dev/scripts/memory-lifecycle/prompt-submit.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-end.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-start.sh +5 -4
- package/Dev/stack-profiles/wordpress/permissions.txt +10 -0
- package/Dev/stack-profiles/wordpress/quality.md +4 -0
- package/Dev/stack-profiles/wordpress/stack.txt +2 -0
- package/Infra/i18n/de/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/de/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/de/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/de/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/de/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/de/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/de/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/de/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-architect.md +16 -14
- package/Infra/i18n/de/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/de/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-security.md +1 -1
- package/Infra/i18n/de/Hcloud/commands/architecture.md +2 -2
- package/Infra/i18n/de/Hcloud/commands/debug.md +3 -3
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/de/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/de/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/de/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/en/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/en/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/en/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/en/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/en/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/en/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/en/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Hcloud/agents/hcloud-architect.md +10 -8
- package/Infra/i18n/en/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/en/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/en/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/en/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/en/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/es/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/es/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/es/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/es/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/es/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/es/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/es/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Hcloud/agents/hcloud-architect.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/es/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/es/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/es/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/es/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/fr/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/fr/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/fr/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Hcloud/agents/hcloud-architect.md +7 -5
- package/Infra/i18n/fr/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/fr/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/fr/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/fr/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/pt/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/pt/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/pt/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Hcloud/agents/hcloud-architect.md +9 -7
- package/Infra/i18n/pt/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/pt/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/architecture.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/pt/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/pt/PgBouncer/commands/deploy-setup.md +1 -1
- package/README.md +27 -15
- package/Tools/PluginExport/export-plugin.sh +15 -17
- package/Tools/Ralph/README.md +17 -7
- package/Tools/Ralph/hooks/lib/ralph-common.sh +101 -0
- package/Tools/Ralph/hooks/pre-tool-context.sh +28 -0
- package/Tools/Ralph/hooks/session-restore.sh +94 -0
- package/Tools/Ralph/hooks/stop-dod-gate.sh +60 -0
- package/Tools/Ralph/lib/hooks-generator.sh +109 -93
- package/bundles/cursor/.cursorrules +11 -10
- package/bundles/windsurf/.windsurfrules +11 -10
- package/cli/index.js +1 -0
- package/cli/lib/doctor.js +4 -3
- package/cli/lib/help.js +1 -0
- package/cli/lib/installer.js +1 -1
- package/cli/lib/parse-args.js +12 -0
- package/cli/lib/tech-registry.js +15 -5
- package/package.json +2 -1
- package/Dev/i18n/de/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/de/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/de/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/de/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/en/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/en/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/en/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/en/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/es/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/es/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/es/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/es/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/fr/Common/hooks/scripts/post-tool-failure.sh +0 -88
- package/Dev/i18n/fr/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/fr/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/fr/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/pt/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/pt/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/pt/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/pt/Common/templates/settings.json.template +0 -128
- package/Tools/Ralph/.ralph/hooks/pre-tool-context.sh +0 -100
- package/Tools/Ralph/.ralph/hooks/session-restore.sh +0 -118
- package/Tools/Ralph/.ralph/hooks/status-injector.sh +0 -147
- package/Tools/Ralph/.ralph/hooks/stop-dod-gate.sh +0 -137
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# WooCommerce Extension Checklist
|
|
2
|
+
|
|
3
|
+
Apply when the project depends on WooCommerce (plugin header `Requires Plugins: woocommerce`, `wc_*` calls, `before_woocommerce_init` hook). Report findings in a separate section; they do not change the core WordPress score. Details and snippets: `REFERENCE.md` in this folder.
|
|
4
|
+
|
|
5
|
+
Severity: C = critical (release blocker), I = important, M = minor.
|
|
6
|
+
|
|
7
|
+
## Bootstrap and Compatibility
|
|
8
|
+
|
|
9
|
+
- [ ] (C) Plugin header contains `Requires Plugins: woocommerce`; code guards with `class_exists( 'WooCommerce' )` where load order matters
|
|
10
|
+
- [ ] (C) `FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true )` on `before_woocommerce_init`, guarded by `class_exists()`, and only if the plugin is really HPOS-safe
|
|
11
|
+
- [ ] (I) `FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true )` declared when the plugin touches cart or checkout and has been tested with the blocks
|
|
12
|
+
- [ ] (M) `Requires at least` / `Requires PHP` align with the WooCommerce version the plugin supports (WooCommerce 11.2 requires WordPress 7.0 and PHP 7.4)
|
|
13
|
+
|
|
14
|
+
## HPOS and Data Access
|
|
15
|
+
|
|
16
|
+
- [ ] (C) No `get_post()`, `get_posts()`, `WP_Query`, `get_post_meta()`, `update_post_meta()`, `wp_update_post()` or `$wpdb->posts` access on orders
|
|
17
|
+
- [ ] (C) Orders read and written via `wc_get_order()`, `wc_get_orders()`, `$order->get_meta()`, `$order->update_meta_data()` and `$order->save()`
|
|
18
|
+
- [ ] (I) Admin meta boxes and assets use `wc_get_page_screen_id( 'shop-order' )` and accept both `WP_Post` and `WC_Order`
|
|
19
|
+
- [ ] (I) Order list columns, bulk actions and filters use HPOS hooks when both storages are supported
|
|
20
|
+
- [ ] (I) Code does not depend on legacy posts-table data being synchronized
|
|
21
|
+
- [ ] (I) Products, customers, coupons and order items use the CRUD classes (`WC_Product`, `WC_Customer`, ...) and `save()`; no direct SQL on WooCommerce tables
|
|
22
|
+
- [ ] (M) Queries use `wc_get_orders()` / `wc_get_products()` with `limit`, `return => 'ids'` and `paginate`; no unbounded `limit => -1` on large stores
|
|
23
|
+
|
|
24
|
+
## Money and Business Rules
|
|
25
|
+
|
|
26
|
+
- [ ] (C) Prices, totals and currency are recomputed server-side from the cart or order; client-sent amounts are never trusted
|
|
27
|
+
- [ ] (I) Monetary values handled as strings with `wc_format_decimal()`; display through `wc_price()`; no float arithmetic on totals
|
|
28
|
+
- [ ] (M) Taxes and rounding go through WooCommerce APIs (`wc_get_price_decimals()`, tax classes), not custom formulas
|
|
29
|
+
|
|
30
|
+
## Cart, Checkout and Blocks
|
|
31
|
+
|
|
32
|
+
- [ ] (I) Cart and Checkout customization works with the block checkout (Store API extension, `IntegrationInterface`, slot-fills, Additional Checkout Fields), not only classic hooks
|
|
33
|
+
- [ ] (I) Extension data registered with `woocommerce_store_api_register_endpoint_data()` on `woocommerce_blocks_loaded`, under the plugin's own namespace, with a schema callback
|
|
34
|
+
- [ ] (I) Values submitted from blocks are validated and sanitized in `woocommerce_store_api_checkout_update_order_from_request` (or the equivalent) before `update_meta_data()`
|
|
35
|
+
- [ ] (M) `Experimental*` slot-fills isolated behind a small adapter and covered by an E2E test, because they may change between releases
|
|
36
|
+
- [ ] (M) Classic shortcode checkout fallback still works when the plugin claims to support it
|
|
37
|
+
|
|
38
|
+
## Payment Gateways and Webhooks
|
|
39
|
+
|
|
40
|
+
- [ ] (C) No raw card data touches the server; hosted fields or redirect used
|
|
41
|
+
- [ ] (C) Incoming webhooks verify the provider signature (`hash_equals()`, timestamp tolerance) before any state change
|
|
42
|
+
- [ ] (C) Amount and currency from the provider are compared with the order before `payment_complete()`
|
|
43
|
+
- [ ] (I) Webhook handlers are idempotent (order status or transaction id checked) and respond fast, with heavy work deferred to Action Scheduler
|
|
44
|
+
- [ ] (I) Block checkout payment method provided (`AbstractPaymentMethodType`, registration hook, `registerPaymentMethod()`), `supports` lists only implemented features
|
|
45
|
+
- [ ] (I) Provider secrets live in constants or encrypted options, not in autoloaded or REST-exposed options; logs (`wc_get_logger()`) never include secrets or card data
|
|
46
|
+
|
|
47
|
+
## REST, Capabilities and Security
|
|
48
|
+
|
|
49
|
+
- [ ] (C) Custom routes have a `permission_callback` using WooCommerce capabilities (`manage_woocommerce`, `edit_shop_order`) or `wc_rest_check_*` helpers; writes never `__return_true`
|
|
50
|
+
- [ ] (C) Order and customer data is escaped on output (`esc_html()`, `esc_attr()`, `wp_kses_post()`); customer input sanitized with `wc_clean()` or the WordPress sanitizers
|
|
51
|
+
- [ ] (I) Admin actions on orders carry a nonce and a per-order capability check (`current_user_can( 'edit_shop_order', $order_id )`)
|
|
52
|
+
- [ ] (I) Personal data stored by the plugin has privacy exporters and erasers; order meta is cleaned on uninstall when appropriate
|
|
53
|
+
- [ ] (M) External `wc/v3` clients use API keys over HTTPS or Application Passwords, with least-privilege scopes
|
|
54
|
+
|
|
55
|
+
## Performance
|
|
56
|
+
|
|
57
|
+
- [ ] (I) Heavy or long jobs use Action Scheduler (`as_enqueue_async_action()`, `as_schedule_single_action()`) in chunks, not synchronous request handling
|
|
58
|
+
- [ ] (I) Front-end assets load only on shop, cart, checkout, account pages or where the block appears
|
|
59
|
+
- [ ] (M) Expensive calculations cached in transients with invalidation on product and order changes
|
|
60
|
+
|
|
61
|
+
## Tests
|
|
62
|
+
|
|
63
|
+
- [ ] (I) `php-stubs/woocommerce-stubs` available to PHPStan (version aligned with the supported WooCommerce line)
|
|
64
|
+
- [ ] (I) `.wp-env.json` installs WooCommerce; CI runs against the minimum supported and the latest WooCommerce
|
|
65
|
+
- [ ] (I) Integration tests exercise order creation, meta persistence and status transitions through the CRUD API, with HPOS enabled
|
|
66
|
+
- [ ] (M) E2E covers classic and block checkout for the features the plugin adds
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Template: Dynamic Block with Interactivity API
|
|
2
|
+
|
|
3
|
+
A block folder with `block.json` (apiVersion 3), an editor script, a server-rendered `render.php` and an optional Interactivity API view module. Blocks are registered all at once from a build manifest (recommended since WordPress 6.8). Targets the WordPress 7.1 line with `@wordpress/scripts` 37.1.0.
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- One folder per block under `src/`, namespaced block name (`acme/report`), `textdomain` equal to the plugin slug
|
|
8
|
+
- Dynamic rendering in PHP (`render.php`) when output depends on server data; static `save()` only for markup that never changes server-side
|
|
9
|
+
- `render.php` escapes late and uses `get_block_wrapper_attributes()`
|
|
10
|
+
- Front-end interactivity with the Interactivity API (`viewScriptModule`), not jQuery
|
|
11
|
+
- Any change to saved markup or attributes needs a `deprecated` entry and a fixture
|
|
12
|
+
- Scaffold quickly with `npx @wordpress/create-block@latest report-block` (add `--template @wordpress/create-block-interactive-template` for an interactive block)
|
|
13
|
+
|
|
14
|
+
## Layout
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
src/report/
|
|
18
|
+
├── block.json
|
|
19
|
+
├── index.js # registerBlockType + edit/save
|
|
20
|
+
├── edit.js
|
|
21
|
+
├── render.php
|
|
22
|
+
├── view.js # Interactivity API store (script module)
|
|
23
|
+
├── style.scss # Front end and editor
|
|
24
|
+
└── editor.scss # Editor only
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## block.json
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
32
|
+
"apiVersion": 3,
|
|
33
|
+
"name": "acme/report",
|
|
34
|
+
"version": "1.0.0",
|
|
35
|
+
"title": "Report",
|
|
36
|
+
"category": "widgets",
|
|
37
|
+
"icon": "chart-bar",
|
|
38
|
+
"description": "Displays a report with a toggleable details panel.",
|
|
39
|
+
"textdomain": "acme-reports",
|
|
40
|
+
"attributes": {
|
|
41
|
+
"reportId": { "type": "integer", "default": 0 },
|
|
42
|
+
"showDetails": { "type": "boolean", "default": false }
|
|
43
|
+
},
|
|
44
|
+
"supports": {
|
|
45
|
+
"html": false,
|
|
46
|
+
"align": [ "wide", "full" ],
|
|
47
|
+
"interactivity": true,
|
|
48
|
+
"color": { "background": true, "text": true }
|
|
49
|
+
},
|
|
50
|
+
"editorScript": "file:./index.js",
|
|
51
|
+
"editorStyle": "file:./index.css",
|
|
52
|
+
"style": "file:./style-index.css",
|
|
53
|
+
"render": "file:./render.php",
|
|
54
|
+
"viewScriptModule": "file:./view.js"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Edit Component (edit.js)
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
import { __ } from '@wordpress/i18n';
|
|
62
|
+
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
|
|
63
|
+
import { PanelBody, ToggleControl, TextControl } from '@wordpress/components';
|
|
64
|
+
|
|
65
|
+
export default function Edit( { attributes, setAttributes } ) {
|
|
66
|
+
const { reportId, showDetails } = attributes;
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<InspectorControls>
|
|
71
|
+
<PanelBody title={ __( 'Settings', 'acme-reports' ) }>
|
|
72
|
+
<TextControl
|
|
73
|
+
type="number"
|
|
74
|
+
label={ __( 'Report ID', 'acme-reports' ) }
|
|
75
|
+
value={ reportId }
|
|
76
|
+
onChange={ ( value ) => setAttributes( { reportId: parseInt( value, 10 ) || 0 } ) }
|
|
77
|
+
/>
|
|
78
|
+
<ToggleControl
|
|
79
|
+
label={ __( 'Show details', 'acme-reports' ) }
|
|
80
|
+
checked={ showDetails }
|
|
81
|
+
onChange={ ( value ) => setAttributes( { showDetails: value } ) }
|
|
82
|
+
/>
|
|
83
|
+
</PanelBody>
|
|
84
|
+
</InspectorControls>
|
|
85
|
+
<p { ...useBlockProps() }>
|
|
86
|
+
{ __( 'Report preview (rendered on the server).', 'acme-reports' ) }
|
|
87
|
+
</p>
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
// index.js: dynamic block, save returns null
|
|
95
|
+
import { registerBlockType } from '@wordpress/blocks';
|
|
96
|
+
import metadata from './block.json';
|
|
97
|
+
import Edit from './edit';
|
|
98
|
+
|
|
99
|
+
registerBlockType( metadata.name, {
|
|
100
|
+
edit: Edit,
|
|
101
|
+
save: () => null,
|
|
102
|
+
} );
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For a richer editor preview use `@wordpress/server-side-render` sparingly (it re-requests on every attribute change).
|
|
106
|
+
|
|
107
|
+
## Server Rendering (render.php)
|
|
108
|
+
|
|
109
|
+
Variables available: `$attributes` (array), `$content` (string, inner blocks), `$block` (`WP_Block`).
|
|
110
|
+
|
|
111
|
+
```php
|
|
112
|
+
<?php
|
|
113
|
+
/**
|
|
114
|
+
* Render callback for acme/report.
|
|
115
|
+
*
|
|
116
|
+
* @var array $attributes Block attributes.
|
|
117
|
+
* @var string $content Inner blocks content.
|
|
118
|
+
* @var WP_Block $block Block instance.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
defined( 'ABSPATH' ) || exit;
|
|
122
|
+
|
|
123
|
+
$report_id = absint( $attributes['reportId'] ?? 0 );
|
|
124
|
+
$report = $report_id ? get_post( $report_id ) : null;
|
|
125
|
+
|
|
126
|
+
if ( ! $report || 'acme_report' !== $report->post_type || ! current_user_can( 'read_post', $report->ID ) ) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
wp_interactivity_state(
|
|
131
|
+
'acme/report',
|
|
132
|
+
array( 'isOpen' => ! empty( $attributes['showDetails'] ) )
|
|
133
|
+
);
|
|
134
|
+
?>
|
|
135
|
+
<div
|
|
136
|
+
<?php echo get_block_wrapper_attributes(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped by core. ?>
|
|
137
|
+
data-wp-interactive="acme/report"
|
|
138
|
+
data-wp-context='{ "toggled": false }'
|
|
139
|
+
>
|
|
140
|
+
<h3><?php echo esc_html( get_the_title( $report ) ); ?></h3>
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
data-wp-on--click="actions.toggle"
|
|
144
|
+
data-wp-bind--aria-expanded="context.toggled"
|
|
145
|
+
>
|
|
146
|
+
<?php esc_html_e( 'Toggle details', 'acme-reports' ); ?>
|
|
147
|
+
</button>
|
|
148
|
+
<div data-wp-bind--hidden="!context.toggled">
|
|
149
|
+
<?php echo wp_kses_post( wpautop( $report->post_excerpt ) ); ?>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Interactivity API Store (view.js)
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
import { store, getContext } from '@wordpress/interactivity';
|
|
158
|
+
|
|
159
|
+
store( 'acme/report', {
|
|
160
|
+
actions: {
|
|
161
|
+
toggle() {
|
|
162
|
+
const context = getContext();
|
|
163
|
+
context.toggled = ! context.toggled;
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
} );
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`viewScriptModule` builds need `wp-scripts build --experimental-modules` unless the scaffold already sets it.
|
|
170
|
+
|
|
171
|
+
## Registration (plugin main file or `src/Blocks.php`)
|
|
172
|
+
|
|
173
|
+
```php
|
|
174
|
+
add_action(
|
|
175
|
+
'init',
|
|
176
|
+
static function () {
|
|
177
|
+
wp_register_block_types_from_metadata_collection(
|
|
178
|
+
__DIR__ . '/build',
|
|
179
|
+
__DIR__ . '/build/blocks-manifest.php'
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`package.json`:
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"scripts": {
|
|
190
|
+
"build": "wp-scripts build --blocks-manifest --experimental-modules",
|
|
191
|
+
"start": "wp-scripts start --blocks-manifest --experimental-modules"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`wp-scripts build-blocks-manifest` is the standalone command that produces `build/blocks-manifest.php`. For one block, `register_block_type( __DIR__ . '/build/report' )` still works.
|
|
197
|
+
|
|
198
|
+
## Deprecation (when saved markup or attributes change)
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
const v1 = {
|
|
202
|
+
attributes: { /* old attributes */ },
|
|
203
|
+
save( { attributes } ) { /* old markup */ },
|
|
204
|
+
migrate( attributes ) { return { ...attributes /* renamed fields */ }; },
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
registerBlockType( metadata.name, { edit: Edit, save, deprecated: [ v1 ] } );
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Keep the old markup as a Jest fixture so validation keeps passing.
|
|
211
|
+
|
|
212
|
+
## Test (Jest)
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
import { render, screen } from '@testing-library/react';
|
|
216
|
+
import Edit from '../edit';
|
|
217
|
+
|
|
218
|
+
test( 'edit renders the preview text', () => {
|
|
219
|
+
render( <Edit attributes={ { reportId: 1, showDetails: false } } setAttributes={ () => {} } /> );
|
|
220
|
+
expect( screen.getByText( /report preview/i ) ).toBeTruthy();
|
|
221
|
+
} );
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Run with `npx wp-scripts test-unit-js`. Cover the front-end rendering in an integration test (`do_blocks( '<!-- wp:acme/report {"reportId":1} /-->' )`) and one Playwright journey.
|
|
225
|
+
|
|
226
|
+
## Checklist
|
|
227
|
+
|
|
228
|
+
- [ ] `block.json` has `apiVersion` 3, namespaced name, `textdomain`, typed attributes with defaults
|
|
229
|
+
- [ ] Dynamic output escaped late; wrapper from `get_block_wrapper_attributes()`
|
|
230
|
+
- [ ] Access to the data checked with a capability where the content is not public
|
|
231
|
+
- [ ] Interactivity API used for front-end behavior; no jQuery
|
|
232
|
+
- [ ] Registered via `wp_register_block_types_from_metadata_collection()` and a generated manifest
|
|
233
|
+
- [ ] Deprecations and fixtures present when markup changed
|
|
234
|
+
- [ ] Strings translatable; accessible markup (button, `aria-expanded`)
|
|
235
|
+
- [ ] Tests: Jest for edit/save, PHPUnit for `render.php`, Playwright for the journey
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Template: Plugin Bootstrap
|
|
2
|
+
|
|
3
|
+
A minimal, safe plugin skeleton: header, direct-access guard, Composer autoload, a bootstrap class on `plugins_loaded`, activation, deactivation and uninstall. Targets the WordPress 7.1 line; PHP 7.4 minimum (8.3+ recommended).
|
|
4
|
+
|
|
5
|
+
## Conventions
|
|
6
|
+
|
|
7
|
+
- The main file contains the header and the bootstrap only; features live in classes under `src/`
|
|
8
|
+
- One namespace (`Acme\Reports`) and one prefix (`acme_reports_`) for every global
|
|
9
|
+
- Text domain equals the plugin slug; `Domain Path` points to `/languages`
|
|
10
|
+
- `Requires at least` and `Requires PHP` reflect the versions in the CI matrix; `Requires Plugins` lists hard dependencies by WordPress.org slug
|
|
11
|
+
- Activation and deactivation are idempotent; data removal lives in `uninstall.php`
|
|
12
|
+
|
|
13
|
+
## Main File (acme-reports.php)
|
|
14
|
+
|
|
15
|
+
```php
|
|
16
|
+
<?php
|
|
17
|
+
/**
|
|
18
|
+
* Plugin Name: Acme Reports
|
|
19
|
+
* Plugin URI: https://example.com/acme-reports
|
|
20
|
+
* Description: Reports and dashboards for Acme.
|
|
21
|
+
* Version: 1.0.0
|
|
22
|
+
* Requires at least: 6.6
|
|
23
|
+
* Requires PHP: 7.4
|
|
24
|
+
* Requires Plugins: {{REQUIRED_PLUGIN_SLUG}}
|
|
25
|
+
* Author: Acme
|
|
26
|
+
* License: GPL-2.0-or-later
|
|
27
|
+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
28
|
+
* Text Domain: acme-reports
|
|
29
|
+
* Domain Path: /languages
|
|
30
|
+
*
|
|
31
|
+
* @package Acme\Reports
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
defined( 'ABSPATH' ) || exit;
|
|
35
|
+
|
|
36
|
+
define( 'ACME_REPORTS_VERSION', '1.0.0' );
|
|
37
|
+
define( 'ACME_REPORTS_FILE', __FILE__ );
|
|
38
|
+
define( 'ACME_REPORTS_DIR', plugin_dir_path( __FILE__ ) );
|
|
39
|
+
define( 'ACME_REPORTS_URL', plugin_dir_url( __FILE__ ) );
|
|
40
|
+
|
|
41
|
+
if ( ! is_readable( ACME_REPORTS_DIR . 'vendor/autoload.php' ) ) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
require_once ACME_REPORTS_DIR . 'vendor/autoload.php';
|
|
45
|
+
|
|
46
|
+
register_activation_hook( __FILE__, array( Acme\Reports\Lifecycle::class, 'activate' ) );
|
|
47
|
+
register_deactivation_hook( __FILE__, array( Acme\Reports\Lifecycle::class, 'deactivate' ) );
|
|
48
|
+
|
|
49
|
+
add_action( 'plugins_loaded', array( new Acme\Reports\Plugin(), 'boot' ) );
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Remove the `Requires Plugins` line when there is no dependency.
|
|
53
|
+
|
|
54
|
+
## composer.json
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"name": "acme/acme-reports",
|
|
59
|
+
"type": "wordpress-plugin",
|
|
60
|
+
"license": "GPL-2.0-or-later",
|
|
61
|
+
"require": { "php": ">=7.4" },
|
|
62
|
+
"autoload": { "psr-4": { "Acme\\Reports\\": "src/" } }
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Ship `vendor/` in the release ZIP built with `composer install --no-dev --optimize-autoloader`.
|
|
67
|
+
|
|
68
|
+
## Bootstrap Class (src/Plugin.php)
|
|
69
|
+
|
|
70
|
+
```php
|
|
71
|
+
<?php
|
|
72
|
+
declare( strict_types=1 );
|
|
73
|
+
|
|
74
|
+
namespace Acme\Reports;
|
|
75
|
+
|
|
76
|
+
defined( 'ABSPATH' ) || exit;
|
|
77
|
+
|
|
78
|
+
final class Plugin {
|
|
79
|
+
|
|
80
|
+
public function boot(): void {
|
|
81
|
+
add_action( 'init', array( $this, 'register_content_types' ) );
|
|
82
|
+
add_action( 'init', array( $this, 'register_blocks' ) );
|
|
83
|
+
add_action( 'rest_api_init', array( new Rest\Reports_Controller(), 'register_routes' ) );
|
|
84
|
+
|
|
85
|
+
if ( is_admin() ) {
|
|
86
|
+
( new Admin\Settings_Page() )->register();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
|
90
|
+
\WP_CLI::add_command( 'acme reports', Cli\Reports_Command::class );
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public function register_content_types(): void {
|
|
95
|
+
register_post_type(
|
|
96
|
+
'acme_report',
|
|
97
|
+
array(
|
|
98
|
+
'label' => __( 'Reports', 'acme-reports' ),
|
|
99
|
+
'public' => false,
|
|
100
|
+
'show_ui' => true,
|
|
101
|
+
'show_in_rest' => true,
|
|
102
|
+
'supports' => array( 'title', 'editor', 'excerpt' ),
|
|
103
|
+
'capability_type' => 'post',
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public function register_blocks(): void {
|
|
109
|
+
wp_register_block_types_from_metadata_collection(
|
|
110
|
+
ACME_REPORTS_DIR . 'build',
|
|
111
|
+
ACME_REPORTS_DIR . 'build/blocks-manifest.php'
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If the plugin supports WordPress below 6.8, fall back to `register_block_type( ACME_REPORTS_DIR . 'build/<block>' )`. Since WordPress 4.6, translations of plugins hosted on WordPress.org load automatically; call `load_plugin_textdomain()` on `init` only for translations bundled outside WordPress.org.
|
|
118
|
+
|
|
119
|
+
## Lifecycle (src/Lifecycle.php)
|
|
120
|
+
|
|
121
|
+
```php
|
|
122
|
+
<?php
|
|
123
|
+
declare( strict_types=1 );
|
|
124
|
+
|
|
125
|
+
namespace Acme\Reports;
|
|
126
|
+
|
|
127
|
+
defined( 'ABSPATH' ) || exit;
|
|
128
|
+
|
|
129
|
+
final class Lifecycle {
|
|
130
|
+
|
|
131
|
+
private const DB_VERSION = '1';
|
|
132
|
+
|
|
133
|
+
public static function activate(): void {
|
|
134
|
+
global $wpdb;
|
|
135
|
+
|
|
136
|
+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
|
137
|
+
|
|
138
|
+
$table = $wpdb->prefix . 'acme_reports_log';
|
|
139
|
+
$charset = $wpdb->get_charset_collate();
|
|
140
|
+
|
|
141
|
+
dbDelta(
|
|
142
|
+
"CREATE TABLE {$table} (
|
|
143
|
+
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
144
|
+
report_id bigint(20) unsigned NOT NULL,
|
|
145
|
+
created_at datetime NOT NULL,
|
|
146
|
+
PRIMARY KEY (id),
|
|
147
|
+
KEY report_id (report_id)
|
|
148
|
+
) {$charset};"
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
update_option( 'acme_reports_db_version', self::DB_VERSION, false );
|
|
152
|
+
|
|
153
|
+
if ( ! wp_next_scheduled( 'acme_reports_daily' ) ) {
|
|
154
|
+
wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', 'acme_reports_daily' );
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public static function deactivate(): void {
|
|
159
|
+
wp_clear_scheduled_hook( 'acme_reports_daily' );
|
|
160
|
+
flush_rewrite_rules();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`dbDelta()` is strict about formatting (two spaces after `PRIMARY KEY`, each field on its own line). Register post types before `flush_rewrite_rules()` runs on activation if the plugin adds rewrite rules.
|
|
166
|
+
|
|
167
|
+
## Uninstall (uninstall.php)
|
|
168
|
+
|
|
169
|
+
```php
|
|
170
|
+
<?php
|
|
171
|
+
// Runs only when WordPress deletes the plugin from the admin or via WP-CLI.
|
|
172
|
+
defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
|
|
173
|
+
|
|
174
|
+
global $wpdb;
|
|
175
|
+
|
|
176
|
+
delete_option( 'acme_reports_settings' );
|
|
177
|
+
delete_option( 'acme_reports_db_version' );
|
|
178
|
+
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}acme_reports_log" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery,WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name built from the trusted prefix.
|
|
179
|
+
wp_clear_scheduled_hook( 'acme_reports_daily' );
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
For multisite, loop over `get_sites()` with `switch_to_blog()` / `restore_current_blog()` and delete network options with `delete_site_option()`.
|
|
183
|
+
|
|
184
|
+
## Test (PHPUnit, integration)
|
|
185
|
+
|
|
186
|
+
```php
|
|
187
|
+
class Lifecycle_Test extends WP_UnitTestCase {
|
|
188
|
+
|
|
189
|
+
public function test_activate_records_db_version_and_schedules_cron(): void {
|
|
190
|
+
Acme\Reports\Lifecycle::activate();
|
|
191
|
+
|
|
192
|
+
$this->assertSame( '1', get_option( 'acme_reports_db_version' ) );
|
|
193
|
+
$this->assertNotFalse( wp_next_scheduled( 'acme_reports_daily' ) );
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public function test_deactivate_clears_cron(): void {
|
|
197
|
+
Acme\Reports\Lifecycle::activate();
|
|
198
|
+
Acme\Reports\Lifecycle::deactivate();
|
|
199
|
+
|
|
200
|
+
$this->assertFalse( wp_next_scheduled( 'acme_reports_daily' ) );
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
The WordPress test suite turns `CREATE TABLE` into temporary tables during tests, so assert the table through behavior (insert and read a row via your repository class) rather than `SHOW TABLES`.
|
|
206
|
+
|
|
207
|
+
## Checklist
|
|
208
|
+
|
|
209
|
+
- [ ] Header complete: `Plugin Name`, `Version`, `Requires at least`, `Requires PHP`, `Text Domain`, `Domain Path`, `License` (and `Requires Plugins` if dependent)
|
|
210
|
+
- [ ] `defined( 'ABSPATH' ) || exit;` in every directly reachable file
|
|
211
|
+
- [ ] Unique namespace and prefix; PSR-4 autoload
|
|
212
|
+
- [ ] Bootstrap on `plugins_loaded`; hooks registered in classes, not at file scope
|
|
213
|
+
- [ ] Activation and deactivation idempotent; `uninstall.php` removes all plugin data
|
|
214
|
+
- [ ] Database changes through `dbDelta()` with a version option
|
|
215
|
+
- [ ] Tests for lifecycle routines
|