Phase 01 — Bootstrap & Scaffolding
Stand up the WordPress plugin skeleton so the plugin activates cleanly on a fresh WordPress install and the docs site scaffolding is in place and building.
What was built
Section titled “What was built”Plugin files
Section titled “Plugin files”wp-license-manager.php— Plugin header with all standard WordPress fields, PHP version gate, autoloader registration (Composer vendor or fallback PSR-4), activation/deactivation hook registration, andplugins_loadedboot trigger.uninstall.php— Guarded uninstall routine that drops all 15 WPLM tables and removes all plugin options. Honours thewplm_keep_data_on_uninstalloption to prevent accidental data loss.composer.json— PSR-4 autoload map forWPLM\→src/, dev deps (phpunit, phpcs, WPCS, Brain Monkey).
Core classes
Section titled “Core classes”src/Container.php— Lightweight DI container. Supportsbind()(factory closures),make()(cached singleton resolution),has(), andinstance()(direct registration). Auto-resolves concrete classes with no deps as a fallback.src/Plugin.php— Main singleton, boots onplugins_loaded. Owns the Container, registers all service bindings, wires WordPress hooks (rest_api_init,init,woocommerce_loaded, cron), and holds the staticactivate()/deactivate()methods called by WordPress hooks.
Install classes
Section titled “Install classes”src/Install/Installer.php— Creates all 15 tables viadbDelta(), storeswplm_db_version, and hands off to Migrator on version bump.src/Install/Migrator.php— Stub versioned migrator; hosts migration methods as the schema evolves.src/Install/Seeder.php— Generates the four long-lived cryptographic secrets on first activation (Ed25519 keypair, AES-256-GCM key, HMAC-SHA256 fingerprint secret, webhook secret). Also seeds default plugin options.
Docs site
Section titled “Docs site”docs-site/package.json— Astro + Starlight dependencies.docs-site/astro.config.mjs— Starlight config with full sidebar group structure matching Section 13.2.docs-site/tsconfig.json— Strict TypeScript config.docs-site/src/content/docs/index.mdx— Homepage / overview page with feature cards.docs-site/src/content/docs/getting-started/— Installation, First License, REST API Keys skeleton pages.
How it works
Section titled “How it works”// Bootstrap sequence (simplified)add_action( 'plugins_loaded', [ 'WPLM\\Plugin', 'get_instance' ] );
// Plugin::get_instance() creates the singleton, registers services,// then wires WP hooks including REST API, cron, and admin menu.
// On activation, Installer runs dbDelta for all 15 tables,// then Seeder generates crypto secrets and stores default options.How to test
Section titled “How to test”- Upload the plugin to
wp-content/plugins/wp-license-manager. - Activate in Plugins → Installed Plugins — no PHP notices should appear.
- Verify tables exist:
SHOW TABLES LIKE 'wp_wplm_%';-- Should return 15 rows
- Check options:
SELECT option_name FROM wp_options WHERE option_name LIKE 'wplm_%';-- Should include wplm_db_version, wplm_signing_keypair, wplm_encryption_key, etc.
- Docs site:
cd docs-site && npm install && npm run build—dist/should be populated.
Acceptance criteria covered
Section titled “Acceptance criteria covered”- Activation clean — Plugin activates with no PHP notices; all 15 tables created; secrets generated.