Build WordPress Plugins Faster with `wp-plugin-init` Boilerplate
Creating a WordPress plugin from scratch can be time-consuming, especially when using modern tooling like Composer, Vite, Vue.js, and a robust OOP-based MVC structure. Thatβs where `wp-plugin-init` comes in β a complete plugin scaffolding tool published on [npm](https://www.npmjs.com/package/wp-plugin-init), built to speed up your development and follow best practices.
What is `wp-plugin-init`?
`wp-plugin-init` is a Node.js CLI tool that generates a fully structured WordPress plugin boilerplate in seconds. Itβs tailored for modern plugin development using:
* PHP OOP and PSR-4 Autoloading via Composer
* MVC architecture
* Vue.js (for interactive admin UI)
* Vite (as a modern asset bundler and hot module reloader)
* Ready-to-extend admin dashboard
* Automated namespace and file structure generation
Features
β WordPress-ready file structure
β MVC directory separation (`Controllers`, `Models`, `Views`)
β PSR-4 compliant autoloading
β Vite-powered development for assets
β Vue.js ready for dynamic admin UI
β CLI automation for renaming namespaces, constants, menus, and plugin slugs
β Composer autoload update after setup
Installation
To use `wp-plugin-init`, install it globally:
```bash
npm install -g wp-plugin-init
```
Usage
Simply run the command with your desired plugin name:
```bash
wp-plugin-init suite-one
```
This will:
– Create a new directory named `suite-one`
– Rename all placeholders (`PluginsNameSpaces`, constants, dashboard menu names)
– Set correct namespaces (`SuiteOne\\`)
– Replace plugin headers in the main file (`suite-one.php`)
– Run `composer dump-autoload`
Youβll end up with a plugin that looks like:
```
suite-one/
βββ app/
β βββ Controllers/
β βββ Models/
β βββ Views/
β βββ App.php
β βββ AdminMenuHandler.php
βββ composer.json
βββ package.json
βββ vite.config.js
βββ public/
βββ resources/
β βββ js/
β βββ main.js
βββ suite-one.php
βββ README.md
```
Whatβs Inside?
PHP OOP Structure
Your plugin logic is split into:
`Controllers/` β Manage logic and plugin actions
`Models/` β Handle data
`Views/` β Separate template rendering
Composer Autoloading
Namespaces are set dynamically based on your plugin name. After creation:
```php
namespace SuiteOne\Controllers;
```
Composerβs autoload config is automatically updated.
Vue.js + Vite Integration
Your plugin is asset-ready out of the box. Inside `resources/js/main.js`, start building your Vue components. Vite handles bundling and live reload.
```bash
npm install
npm run dev
```
During production:
```bash
npm run build
```
Smart Defaults & Automation
`wp-plugin-init` auto-generates:
* Plugin headers
* Namespace structure
* Dashboard menu entries
* Constant definitions
* Vue/Vite asset paths
No manual edits required β just start coding!
Development Tips
* Use `App.php` for bootstrapping logic
* Place reusable components in `app/`
* Run `composer dump-autoload` after adding new PHP classes
* Customize the admin dashboard from `AdminMenuHandler.php`
* Use Vue.js for dynamic forms or settings pages
Example
```bash
wp-plugin-init my-cool-plugin
```
Creates:
```php
// Plugin header
/*
* Plugin Name: My Cool Plugin
*/
// Namespace usage
use MyCoolPlugin\Controllers\DashboardController;
```
Requirements
* Node.js (v14+)
* Composer
* PHP 7.4+
* WordPress >= 5.8
License
MIT β free to use and extend!
Contribute
Found a bug or want to improve the boilerplate?
* GitHub: [github.com/Suite-Press/wp-plugin-init](https://github.com/Suite-Press/wp-plugin-init)
* Pull requests welcome!
Final Thoughts
If youβre tired of rebuilding boilerplates or piecing together modern workflows manually, `wp-plugin-init` is your perfect starting point. It saves time, enforces structure, and empowers you to focus on building features, not boilerplate.
> Start your next plugin with power, performance, and productivity β in one command.