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
- Complete Walkthrough - Build a plugin step-by-step from scratch
What You Get
The scaffold creates a fully configured plugin with:
| Component | Description |
|---|---|
| Plugin Bootstrap | Callable bootstrap with 18 framework service providers in 8 phases |
| PluginContext | Single source of truth for plugin identity (slug, prefix, text-domain) |
| Lifecycle Classes | Activator, Deactivator, and Uninstaller for WordPress hooks |
| Configuration | config/app.php with providers, debug mode, capability settings |
| Routes | Route definitions in routes/web.php |
| PHP-Scoper | Pre-configured namespace isolation for distribution |
| Scaffold CLI | PowerShell/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:
- Getting Started - Configuration and installation
- Core Concepts - Architecture and service providers
- Packages - All available packages