PHPackages                             madebyaris/wp-boilerplate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. madebyaris/wp-boilerplate

ActiveWordpress-plugin[CLI &amp; Console](/categories/cli)

madebyaris/wp-boilerplate
=========================

A modern WordPress plugin boilerplate with PSR-4 autoloading, Vite integration, and CLI tools

v0.1.1(1y ago)117GPL-2.0-or-laterPHPPHP &gt;=8.0

Since May 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/madebyaris/wp-boilerplate-ars)[ Packagist](https://packagist.org/packages/madebyaris/wp-boilerplate)[ Docs](https://github.com/madebyaris/wp-boilerplate)[ RSS](/packages/madebyaris-wp-boilerplate/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (3)Used By (0)

WordPress Plugin Boilerplate
============================

[](#wordpress-plugin-boilerplate)

A modern WordPress plugin boilerplate with Vite integration, optional block support, and a CLI tool for common tasks.

Features
--------

[](#features)

- Clean, well-structured, and modular code
- Modern JavaScript development with Vite
- WordPress coding standards compliance
- Optional Gutenberg block support
- CLI tool for plugin generation and code scaffolding
- Security best practices
- Comprehensive inline documentation

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- WordPress 5.0 or higher
- Composer
- Node.js (for Vite)

Installation
------------

[](#installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

The easiest way to get started is by using Composer:

```
composer create-project madebyaris/wp-boilerplate my-plugin
```

This will create a new plugin in the specified directory and guide you through an interactive setup process where you'll:

- Enter your plugin name and slug
- Provide author information
- Set a description
- Choose whether to include block support
- Specify other optional settings

The setup process will automatically handle file generation and configuration.

### Manual Installation

[](#manual-installation)

Clone or download this repository to your WordPress plugins directory:

```
git clone https://github.com/your-username/wp-boilerplate-ars.git
cd wp-boilerplate-ars
```

Usage
-----

[](#usage)

### Creating a new plugin

[](#creating-a-new-plugin)

```
# Initialize a new plugin (basic)
./wp-boilerplate init --name="My Plugin" --author="Your Name" --slug="my-plugin"

# Initialize with additional options
./wp-boilerplate init --name="My Plugin" --author="Your Name" --slug="my-plugin" --blocks --php=8.0 --description="A custom WordPress plugin" --uri="https://example.com" --author-uri="https://example.com" --prefix="my_plugin" --namespace="MyPlugin" --dev-deps
```

### Adding an admin menu

[](#adding-an-admin-menu)

```
# Add a top-level menu
./wp-boilerplate add-menu --title="My Menu" --slug="my-menu"

# Add a submenu
./wp-boilerplate add-menu --title="My Submenu" --slug="my-submenu" --parent="my-menu" --capability="manage_options"
```

### Adding a class

[](#adding-a-class)

```
# Add a new class
./wp-boilerplate add-class --name="My_Class" --dir="core" --description="Custom functionality"
```

CLI Tool
--------

[](#cli-tool)

The plugin comes with a powerful CLI tool that helps you manage and extend your plugin.

### Available Commands

[](#available-commands)

```
# Interactive plugin setup
./wp-boilerplate --setup

# Create a new admin menu
./wp-boilerplate add-menu --title="Settings Page" --slug="settings" --capability="manage_options"

# Create a new class file
./wp-boilerplate add-class --name="API_Controller" --dir="core" --description="Handles external API connections"
```

For manual initialization without the interactive prompts, you can use:

```
./wp-boilerplate init --name="My Plugin" --author="Your Name" --slug="my-plugin" --blocks
```

See all available options with:

```
./wp-boilerplate help
```

Production Build
----------------

[](#production-build)

When you're ready to prepare your plugin for distribution, the following Composer commands are available:

CommandDescription`composer scoper`Scopes the plugin Composer dependencies to prevent namespace conflicts with other plugins.`composer build`Run the plugin build process for production i.e. updating the translation POT file, and prefixing namespace.`composer plugin:zip`Creates a zip file of the plugin for distribution. Based on the Composer archive. [Refer to the documentation](https://getcomposer.org/doc/03-cli.md#archive) for the available options to run the command.### Dependency Isolation

[](#dependency-isolation)

The `scoper` command uses [PHP-Scoper](https://github.com/humbug/php-scoper) to prefix all your dependencies with a unique namespace, preventing conflicts with other plugins that might use the same libraries. The prefixed code is placed in the `dist/scoped` directory.

You can configure scoping behavior in the `scoper.inc.php` file.

### Internationalization

[](#internationalization)

The `build` command includes generating POT translation files for your plugin using WP-CLI's i18n command. This ensures your plugin is ready for translation.

### Distribution

[](#distribution)

The `plugin:zip` command creates a production-ready ZIP file in the `dist` directory, excluding development files like tests, source assets, and configuration files.

After initialization
--------------------

[](#after-initialization)

After creating a new plugin, navigate to its directory and run:

```
# Install PHP dependencies
composer install

# Install Node.js dependencies and build assets
npm install
npm run build
```

Directory Structure
-------------------

[](#directory-structure)

```
my-plugin/
├── config/
│   └── default-settings.php
├── includes/
│   ├── admin/
│   │   ├── class-plugin-name-admin.php
│   │   └── partials/
│   │       ├── settings-page.php
│   │       └── settings-section.php
│   ├── core/
│   │   ├── class-plugin-name.php
│   │   ├── class-plugin-loader.php
│   │   ├── class-i18n.php
│   │   ├── functions.php
│   │   └── [OPTIONAL] block-functions.php
│   └── data/
│       └── install.php
├── languages/
├── assets/
│   ├── src/
│   │   ├── admin.js
│   │   ├── admin.scss
│   │   └── frontend.js
│   └── dist/
├── [OPTIONAL] blocks/
├── .gitignore
├── composer.json
├── eslintrc.js
├── phpcs.xml.dist
├── vite.config.js
└── my-plugin.php

```

Block Support
-------------

[](#block-support)

The boilerplate includes optional support for Gutenberg blocks. You can:

1. Include block support with the `--blocks` flag during initialization
2. Remove block support by removing the blocks directory and block-functions.php file

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance46

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

415d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13942122?v=4)[Aris Setiawan](/maintainers/madebyaris)[@madebyaris](https://github.com/madebyaris)

---

Top Contributors

[![madebyaris](https://avatars.githubusercontent.com/u/13942122?v=4)](https://github.com/madebyaris "madebyaris (8 commits)")

---

Tags

plugincliwordpressviteboilerplatePSR-4

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/madebyaris-wp-boilerplate/health.svg)

```
[![Health](https://phpackages.com/badges/madebyaris-wp-boilerplate/health.svg)](https://phpackages.com/packages/madebyaris-wp-boilerplate)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
