Scaffold a WordPress plugin powered by WpApp.
composer create-project akirk/create-wp-app my-pluginThis will prompt you for:
- Plugin name — Display name for your plugin
- Namespace — PHP namespace for your classes
- Author — Plugin author (optional)
- URL path — Where your app lives (e.g.,
/my-plugin/) - Setup type — Minimal or Full (with BaseApp structure)
A simple setup with just the essentials:
my-plugin/
├── my-plugin.php # Main plugin file with WpApp initialization
├── templates/
│ └── index.php # Your app's home page
├── composer.json
└── .gitignore
A structured setup for larger applications:
my-plugin/
├── my-plugin.php # Main plugin file
├── src/
│ └── App.php # BaseApp subclass with routes, menu, database hooks
├── templates/
│ └── index.php
├── composer.json
└── .gitignore
For CI/CD or scripting, use environment variables:
WP_APP_PLUGIN_NAME="My App" \
WP_APP_NAMESPACE="MyApp" \
WP_APP_AUTHOR="Your Name" \
WP_APP_URL_PATH="my-app" \
WP_APP_SETUP_TYPE="1" \
composer create-project --no-interaction akirk/create-wp-app my-plugin- Move the folder to
wp-content/plugins/(if not already there) - Activate the plugin in WordPress
- Visit your app at the URL path you configured
See the WpApp documentation for details on routing, the masterbar, access control, and more.
GPL-2.0-or-later