Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Create a focused plugin that adds a review-and-approval workflow to one custom post type. Use namespaced code, a testable transition service, explicit activation/upgrade/deactivation/uninstall behavior, object-level capabilities, validation and output escaping, action-specific CSRF controls, one versioned REST endpoint, and a noninteractive WP-CLI command over the same service. Include an idempotent migration and adversarial authorization, replay, malformed-input, and stored-XSS tests.
The plugin owns one capability, separates domain rules from adapters, and defines clean install, retry-safe upgrade, deactivation, and explicit uninstall retention behavior.
Object capabilities, request intent, validation, sanitization, prepared data access, context-aware escaping, and redacted errors protect every trust boundary.
The permissioned REST route and automation-safe CLI command invoke one service with consistent outcomes, idempotency, dry-run behavior, and useful errors.
Tests prove transition rules, cross-user denial, malformed values, replay behavior, upgrade reruns, deactivation/reactivation, and selected data-retention behavior.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# A secure workflow plugin ## Goal Create a focused plugin that adds a review-and-approval workflow to one custom post type. Use namespaced code, a testable transition service, explicit activation/upgrade/deactivation/uninstall behavior, object-level capabilities, validation and output escaping, action-specific CSRF controls, one versioned REST endpoint, and a noninteractive WP-CLI command over the same service. Include an idempotent migration and adversarial authorization, replay, malformed-input, and stored-XSS tests. ## Acceptance criteria - [ ] Plugin boundaries and lifecycle: The plugin owns one capability, separates domain rules from adapters, and defines clean install, retry-safe upgrade, deactivation, and explicit uninstall retention behavior. - [ ] Authorization and data safety: Object capabilities, request intent, validation, sanitization, prepared data access, context-aware escaping, and redacted errors protect every trust boundary. - [ ] REST and CLI contract: The permissioned REST route and automation-safe CLI command invoke one service with consistent outcomes, idempotency, dry-run behavior, and useful errors. - [ ] Migration and adversarial evidence: Tests prove transition rules, cross-user denial, malformed values, replay behavior, upgrade reruns, deactivation/reactivation, and selected data-retention behavior. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.