Scaffold Guide

Get started building your WordPress plugin with WPZylos scaffolding.

Quick Start

composer create-project MyCompanystudio/wpzylos-scaffold my-plugin
cd my-plugin
.\scaffold.ps1 init       # Windows
./scaffold.sh init        # Linux/Mac

Guides

What You Get

The scaffold creates a fully configured plugin with:

ComponentDescription
Plugin BootstrapCallable bootstrap with 18 framework service providers in 8 phases
PluginContextSingle source of truth for plugin identity (slug, prefix, text-domain)
Lifecycle ClassesActivator, Deactivator, and Uninstaller for WordPress hooks
Configurationconfig/app.php with providers, debug mode, capability settings
RoutesRoute definitions in routes/web.php
PHP-ScoperPre-configured namespace isolation for distribution
Scaffold CLIPowerShell/Bash scripts for init and production build

Directory Structure

my-plugin/
+-- app/
|   +-- Core/
|   |   +-- PluginContext.php
|   +-- Lifecycle/
|   |   +-- Activator.php
|   |   +-- Deactivator.php
|   |   +-- Uninstaller.php
|   +-- Support/
|       +-- helpers.php
+-- bootstrap/
|   +-- app.php
+-- config/
|   +-- app.php
+-- database/
|   +-- migrations/
+-- resources/
|   +-- views/
|   +-- lang/
+-- routes/
|   +-- web.php
+-- my-plugin.php
+-- uninstall.php
+-- scaffold.ps1
+-- scaffold.sh
+-- scoper.inc.php
+-- composer.json

Next Steps

After scaffolding, explore: