Scaffold WordPress Plugins Instantly Using wp-plugin-init (Node.js CLI)

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 ComposerViteVue.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.