Download the PHP package madebyaris/wp-boilerplate without Composer
On this page you can find all versions of the php package madebyaris/wp-boilerplate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download madebyaris/wp-boilerplate
More information about madebyaris/wp-boilerplate
Files in madebyaris/wp-boilerplate
Package wp-boilerplate
Short Description A modern WordPress plugin boilerplate with PSR-4 autoloading, Vite integration, and CLI tools
License GPL-2.0-or-later
Homepage https://github.com/madebyaris/wp-boilerplate
Informations about the package wp-boilerplate
WordPress Plugin Boilerplate
A modern WordPress plugin boilerplate with Vite integration, optional block support, and a CLI tool for common tasks.
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
- PHP 8.0 or higher
- WordPress 5.0 or higher
- Composer
- Node.js (for Vite)
Installation
Using Composer (Recommended)
The easiest way to get started is by using Composer:
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
Clone or download this repository to your WordPress plugins directory:
Usage
Creating a new plugin
Adding an admin menu
Adding a class
CLI Tool
The plugin comes with a powerful CLI tool that helps you manage and extend your plugin.
Available Commands
For manual initialization without the interactive prompts, you can use:
See all available options with:
Production Build
When you're ready to prepare your plugin for distribution, the following Composer commands are available:
Command | Description |
---|---|
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 for the available options to run the command. |
Dependency Isolation
The scoper
command uses 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
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
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 creating a new plugin, navigate to its directory and run:
Directory Structure
Block Support
The boilerplate includes optional support for Gutenberg blocks. You can:
- Include block support with the
--blocks
flag during initialization - Remove block support by removing the blocks directory and block-functions.php file
License
GPL-2.0-or-later