juvo / wordpress-plugin-boilerplate
A boilerplate for WordPress plugin development. Supercharged with bud.js, Autoloading, and PHPStan.
Requires
- php: >=8.0
Requires (Dev)
- composer/installers: ^v2
- php-stubs/acf-pro-stubs: ^6
- php-stubs/wp-cli-stubs: ^2
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.11.9
- szepeviktor/phpstan-wordpress: ^1.1
- wp-cli/wp-cli: ^2
- wp-coding-standards/wpcs: ^3.1
- yoast/phpunit-polyfills: ^1.0
This package is auto-updated.
Last update: 2024-11-10 06:54:12 UTC
README
This boilerplate is a fork of WordPress Boilerplate but with some additional features and improvements. It is a modern, organized, and object-oriented foundation for building high-quality WordPress plugins.
Features of this boilerplate
- Namespaces support using composer
- Automatic Namespace prefixing with Strauss
- Easy Shortcode, CLI Command Registration through the loader
- PHPStan with ready-made Github actions
- PHPCS with ready-made Github actions
- Bud.js for simple bundling and build of assets
- ESLint built in
- Ready made Github actions, for building and bundling
Setup
Step 1: Create Your Project
Run the following command to create your project. This will download the boilerplate and automatically run the script for initial configuration:
composer create-project juvo/wordpress-plugin-boilerplate path/to/your-new-plugin
Step 2: Configure Your Plugin (Automatic Prompt)
Upon project creation, you'll be guided through a series of prompts to configure your plugin:
- Plugin Name: Enter the name of your plugin.
- Namespace (optional): Suggests a default namespace based on your plugin name but allows customization.
- Plugin Slug (optional): Choose a slug for your plugin; a default based on your plugin name is suggested.
Your inputs will automatically tailor the boilerplate to match your plugin's identity.
Step 3: Finalization (Optional)
After configuration, the setup will finalize by updating files, renaming relevant items, and performing cleanup actions, including:
- Replacing placeholders with your specified details.
- Renaming files to match your plugin's namespace and slug.
- Running
composer update
andnpm install
to install dependencies. - Cleaning up by removing the
setup.php
file.
At this point the plugin is set up and good to go. Now it is your time to change to adjust plugin and readme headers according to your needs.
Wrapping Up
That's it! Your plugin is now ready for development. Dive into creating your next remarkable WordPress plugin with ease and efficiency.