-
Notifications
You must be signed in to change notification settings - Fork 0
Demo and Reset
Lukman Nakib edited this page May 30, 2026
·
2 revisions
The scaffold ships a kitchen-sink Task feature so you can see every seam working end-to-end, then remove it in one command when you're ready to build your own thing.
app/Model/Task.php, app/Admin/TasksListPage.php, app/Http/Controllers/TasksController.php, the
Task*Handler hooks, the CreateTasksTable migration, and app/Views/tasks.php together demonstrate:
- a Model with Rules → a ListPage CRUD table with the 5 auto REST routes + a rules-derived edit form,
- a
taskCPT, a[wppm-tasks]shortcode (advertised on the admin page), - a
tasks.statsAJAX route (Cache-backed), - a daily cron ("prune trashed tasks") via the
wppm/lifecycle/cron_eventsfilter, - a seed + activation Notice ("Demo data seeded") via
wppm/lifecycle/seed_defaults, - light use of the
ConfigandCachefacades.
Read it, copy from it, then strip it.
wp matrix:clean --dry-run # preview exactly what will be removed (changes nothing)
wp matrix:clean # delete the demo files + their registration lines- Requires the plugin active (it's a WP-CLI command the plugin registers).
- Idempotent — re-running reports "nothing to remove".
-
Drift-safe — if the demo files/registrations were hand-edited, it refuses and lists what drifted
(pass
--forceto override). This prevents leaving a dangling registration pointing at a deleted class. -
Source-only — it deletes the demo's files and removes the exact lines it added; it does not touch
the database, seeded rows, or cron. That teardown is the uninstall flow, gated behind
apply_filters('wppm/uninstall_destructive', false).
What survives a clean: the framework (app/Core, Facades, Helpers), the Settings example, the
Config/Cache bindings, and all the matrix:make:* generators — i.e. a clean, fully working starter.
WP Plugin Matrix · GPL-2.0-or-later · source · pages are generated from docs/wiki/ — edit there, not in the wiki UI.
Seams
Tooling