Interactive scaffold generator for modern, production-ready WordPress plugins — built with PSR-4 autoloading, WPCS/VIP coding standards, PHPUnit unit tests, WP-CLI command integration, and optional React asset build pipeline (@wordpress/scripts).
Run directly without installing:
npx create-wp-plugin-cliPublished on npm as
create-wp-plugin-cli(thecreate-wp-pluginname was already taken). You can still run the latestmainbranch directly from GitHub withnpx github:akshat009/create-wp-plugin.
node index.jsnode index.js --yes --name "My Plugin" --prefix myp --namespace MyPlugin --out ./my-pluginAvailable flags: --help, --version, --yes, --name, --slug, --namespace, --prefix, --author, --email, --author-uri, --description, --min-php, --out, --modules, --react, --no-react.
--modules accepts a comma-separated list of: admin_settings, shortcode, rest_api, ajax_handler, cpt_taxonomy, cron, elementor_widget, woocommerce_hooks, interactivity.
After running the generator, perform the following steps to initialize your project:
cd <slug>
composer install # installs PHPCS/WPCS/VIP rulesets, PHPUnit (required
# before composer lint / composer test will work)
composer lint
composer test
git init && git add -A && git commit -m "scaffold"Note:
composer installmay prompt to allow thedealerdirect/phpcodesniffer-composer-installerplugin — answer yes, as it registers the WPCS/VIP rulesets with PHPCS. You may also see a message "No composer.lock file present" on the first run; this is completely normal and Composer will automatically create the lock file.
- ⚡ PSR-4 Autoloading: Clean
src/directory layout with automatic fallback. - 🎨 WordPress Coding Standards: Full WPCS, Docs, VIP Go, and PHPCompatibilityWP integration (
composer lint). - 🧪 PHPUnit & Brain Monkey: Zero-WordPress-install unit testing suite (
composer test). - 💻 WP-CLI Commands: Built-in
wp <prefix> statusandwp <prefix> cache clearhandlers. - ⚛️ React Admin App Build Pipeline: Built-in
@wordpress/scriptsworkflow that mounts a real interactive React app into your plugin's own wp-admin screen (not shipped to frontend visitors). - ⚡ Frontend Interactivity Module: WordPress's native Interactivity API (directive-based, WP 6.5+) for lightweight, actually-interactive frontend markup without shipping a React runtime to visitors.
- 📦 Modular Architecture: Toggleable scaffolding for Admin Settings Page, Shortcodes, REST API, AJAX, CPT + Taxonomies, Cron Jobs, Elementor Widgets, WooCommerce, and Frontend Interactivity.
- 🛒 Full WooCommerce Integration: Payment gateway (classic checkout and WooCommerce Blocks / block-based checkout), shipping method, custom order email (with its own template files), custom product type, HPOS compatibility — all real, working, PHPCS-clean skeletons, not stubs you have to wire up yourself.
- 🔌 Service Composition: Extensible
{{PREFIX}}_servicesfilter to inject third-partyRegistrableservices. - 🎨 Elementor Auto-Discovery: Automatic discovery of concrete widgets in
src/Widgets/with convention-based CSS/JS registration ({{PREFIX}}-widget-slug). - 🛠️ VS Code Tooling: Code snippets (
wpelwidget), PHPCS integration (valeryanm.vscode-phpsab), EditorConfig support, and WordPress stubs via Intelephense. - ⚙️ GitHub Actions CI: Preconfigured workflow for automated PHPCS linting and PHP version matrix testing.
Note: To scaffold Gutenberg blocks, use
npx @wordpress/create-block.
GPL-2.0-or-later