This repository provides a modern, well-structured template for developing WordPress plugins. It's designed to help developers quickly bootstrap new WordPress plugins with best practices, modern development tools, and a standardized structure.
- Modern development environment with Composer for PHP dependencies
- Block editor (Gutenberg) support with built-in block registration
- ESLint configuration for JavaScript/TypeScript development
- GitHub Actions workflows for automated testing and deployment
- Standardized plugin structure following WordPress coding standards
- Apache 2.0 License
- PHP 7.4 or higher
- WordPress 6.4.4 or higher
- Composer
- Node.js and npm (for block development)
-
Create a new repository from this template
- Click the "Use this template" button on GitHub
- Name your new repository
- Clone the new repository to your local machine
-
Update plugin information
- Edit
plugin.phpand replace the placeholder values:{Plugin Name}with your plugin name{plugin-name}with your plugin slug{PluginName}with your plugin's namespace- Update the description and other metadata
- Edit
-
Install dependencies
composer install
-
Development
- Place your PHP classes in the
srcdirectory - Create new blocks in the
Blocksdirectory - Use the provided namespace structure:
Bcgov\{PluginName}\{ClassName}
- Place your PHP classes in the
-
Building blocks
npm install
npm run build├── Blocks/ # Gutenberg blocks
├── src/ # PHP source files
├── vendor/ # Composer dependencies
├── workflows/ # GitHub Actions workflows
├── plugin.php # Main plugin file
├── composer.json # PHP dependencies
└── package.json # Node.js dependencies-
PHP Development
- Follow PSR-4 autoloading standards
- Use namespaces for all classes
- Document your code with PHPDoc comments
-
Block Development
- Create new blocks in the
Blocksdirectory - Use block.json for block registration
- Follow WordPress block development best practices
- Create new blocks in the
-
Testing
- Write unit tests for your PHP code
- Test blocks in the WordPress block editor
- Ensure compatibility with WordPress versions specified in plugin.php
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This template uses .gitattributes to exclude development and documentation files from production plugin archives.
Files marked with export-ignore are omitted from git archive–based packaging, helping ensure deployments contain only runtime code and assets.
This file should be kept when creating a new plugin from the template. You may update it if your plugin adds or removes development tooling.
This template is licensed under the Apache License 2.0. See the LICENSE file for details.
For questions or issues, please create an issue in the repository.