Skip to content

Getting Started

Lukman Nakib edited this page May 30, 2026 · 1 revision

Getting Started

Install

Fast path (recommended) — scaffold + personalize in one step:

composer create-project wp-plugin-matrix/starter my-awesome-plugin

The post-create-project-cmd runs the Personalizer automatically: it prompts for the plugin name, namespace, and vendor, rewrites every identity token (WPPluginMatrix namespace, wp-plugin-matrix slug/text-domain, WP_PLUGIN_MATRIX_* constants, main-file name, composer.json name), then deletes itself. Skip the prompts non-interactively:

composer create-project wp-plugin-matrix/starter my-awesome-plugin -- "My Awesome Plugin" MyAwesomePlugin acme

Manual path — if you cloned the repo directly:

php rename-plugin.php "My Awesome Plugin"   # add --dry-run to preview
composer install && npm install
npm run build
wp plugin activate my-awesome-plugin

Activate

Activation runs the Lifecycle: it applies pending migrations (creating tables), seeds the demo, registers capabilities, and schedules cron. You'll land on a working plugin with a Tasks admin page (a full CRUD demo).

Your first feature

wp matrix:make:resource Book

This generates a Book Model, a migration, a controller, a BooksListPage, and the routes — wired and ready. Re-activate (or run the migration) and a Books CRUD page appears. See CLI Generators.

Prefer to hand-write it? See Models & Validation and Admin & List Pages.

Strip the demo

When you're ready to start clean:

wp matrix:clean --dry-run    # preview
wp matrix:clean              # remove the Task demo → blank starter

See Demo & Reset.

Everyday commands

composer install                   # PHP deps + autoloader
npm run dev | build                # Vite dev / production assets
./vendor/bin/pest                  # PHP unit tests
wp matrix:make:<thing> [--dry-run] # scaffold model/migration/controller/listpage/adminpage/route/resource/types
wp matrix:clean [--dry-run]        # strip the demo

Clone this wiki locally