PHPackages                             juvo/wordpress-plugin-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. juvo/wordpress-plugin-boilerplate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

juvo/wordpress-plugin-boilerplate
=================================

A boilerplate for WordPress plugin development. Supercharged with Autoloading, @wordpress/scripts, PHPStan and PHPCS.

v2.0.0(2mo ago)7299↓100%3[4 PRs](https://github.com/JUVOJustin/wordpress-plugin-boilerplate/pulls)GPL-3.0-or-laterPHPPHP &gt;=8.0CI passing

Since Dec 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/JUVOJustin/wordpress-plugin-boilerplate)[ Packagist](https://packagist.org/packages/juvo/wordpress-plugin-boilerplate)[ RSS](/packages/juvo-wordpress-plugin-boilerplate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (45)Used By (0)

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

[](#wordpress-plugin-boilerplate)

[![PHPStan](https://camo.githubusercontent.com/3f7138a32cbdc88c79057d4e02246eef7d4b66df03013f2b36967877199eb5d4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230362d626c7565)](https://phpstan.org/)[![PHPCS](https://camo.githubusercontent.com/323e0faa79138dccf8e9e77fd64fe99322716a3df13f55c9ff7c2e09c5b17f9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d576f726450726573732d677265656e)](https://github.com/WordPress/WordPress-Coding-Standards)[![Test/Analyse](https://github.com/JUVOJustin/wordpress-plugin-boilerplate/actions/workflows/test-analyse.yml/badge.svg)](https://github.com/JUVOJustin/wordpress-plugin-boilerplate/actions/workflows/test-analyse.yml)

This boilerplate is a fork of [WordPress Boilerplate](https://github.com/DevinVinson/WordPress-Plugin-Boilerplate) with additional features and improvements. It provides a modern, organized, and object-oriented foundation for building high-quality WordPress plugins.

Features of this boilerplate
----------------------------

[](#features-of-this-boilerplate)

- Namespaces support using composer
- Automatic Namespace prefixing with [Strauss](https://github.com/BrianHenryIE/strauss)
- Easy Shortcode, CLI Command Registration through the loader
- PHPStan with ready-made Github actions
- PHPCS with ready-made Github actions
- [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) for simple bundling, linting and formatting of JS and CSS/SCSS files
- Ready-made Github actions for building and bundling
- [AI-optimized](docs/work-with-ai.mdx) with AGENTS.md, commands, and skills
- Documentation guidelines in `docs/documentation.mdx` with front matter metadata
- Simple [Gutenberg Block generation](/docs/create-blocks.mdx) and automated loading

Setup
=====

[](#setup)

Step 1: Create Your Project
---------------------------

[](#step-1-create-your-project)

Run the following command to create your project in the current folder. This will download the boilerplate and automatically run the script for initial configuration:

```
composer create-project juvo/wordpress-plugin-boilerplate
```

The boilerplate will be set up in the current directory, and the setup script will run automatically.

Step 2: Configure Your Plugin (Automatic Prompt)
------------------------------------------------

[](#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)
-------------------------------

[](#step-3-finalization-optional)

Congrats! Your plugins is ready.

To boost AI performance you proabably want to tune your `AGENTS.md` rules. For improved AI capabilities you can add official [WordPress Agent Skills](docs/work-with-ai.mdx) stored in `.agents/skills`. Default set includes `wp-block-development`, `wp-interactivity-api`, `wp-project-triage`, `wp-phpstan`, and `wp-rest-api`.

Development Guide
=================

[](#development-guide)

Project Structure
-----------------

[](#project-structure)

### Source Code Organization

[](#source-code-organization)

All plugin logic should go into the `src` folder. This separation helps maintain a clean structure and follows modern PHP development practices. Example:

```
src/
├── Abilities/     # Abilitis and their categories
├── API/           # Rest API-specific functionality
├── Blocks/        # Gutenberg Blocks
├── CLI/           # CLI commands
└── Integrations/  # Core plugin functions and utilities
    └── BricksBuilder/ # Bricks Builder integration
    └── Elementor/ # Elementor integration
    └── ACF/ # ACF integration
    └── WC/ # WooCommerce integration

```

Avoid placing logic directly in the plugin's root files. The main plugin file should primarily be used for bootstrapping your plugin.

Loader and Hooks Registration
-----------------------------

[](#loader-and-hooks-registration)

### Using the Loader Correctly

[](#using-the-loader-correctly)

The plugin uses a loader pattern to centralize the registration of hooks, filters, and shortcodes. Instead of registering hooks in class constructors, always use the loader in the root class:

```
public function __construct() {
    $this->loader = new Loader();
    $this->define_admin_hooks();
    $this->define_public_hooks();
}

private function define_admin_hooks() {
    $admin = new Admin\Admin($this->get_plugin_name(), $this->get_version());
    $this->loader->add_action('admin_enqueue_scripts', $admin, 'enqueue_styles');
    $this->loader->add_action('admin_enqueue_scripts', $admin, 'enqueue_scripts');
}

private function define_shortcodes() {
    $example_shortcode = new Shortcodes\ExampleShortcode();
    $this->loader->add_shortcode('example', $example_shortcode, 'render');
}
```

This approach provides several benefits:

1. Centralized hook management
2. Easier debugging
3. Better testability
4. Cleaner class implementations

Frontend Assets Management
--------------------------

[](#frontend-assets-management)

### Resources Organization

[](#resources-organization)

All frontend-facing assets (scripts, styles, images, etc.) should be placed in the `resources` directory, organized by context:

```
resources/
├── admin/            # Admin-specific assets
│   ├── css/
│   ├── js/
│   └── images/
├── frontend/         # Frontend-specific assets
│   ├── css/
│   ├── js/
│   └── images/
├── acf-json/         # ACF field group JSON files
└── webpack.config.js     # webpack/wp-scripts configuration

```

### Asset Compilation

[](#asset-compilation)

The boilerplate uses [@wordpress/scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) for asset compilation and bundling.

To compile assets:

```
npm run start        # Watch for changes during development and compile assets
npm run build         # For production. Compiles assets and minifies them

```

To add a new entry point for scripts or styles, modify the `webpack.config.js` file.

### Gutenberg Block Development

[](#gutenberg-block-development)

Generate blocks using `npm run create-block` and follow the interactive prompts. This command scaffolds a new block in the `src/Blocks` directory. Under the hood the npm script uses `@wordpress/create-block` package.

Blocks are automatically registered using `wp_register_block_types_from_metadata_collection` in the main plugin class. Scripts and styles for the blocks are enqueued and bundled automatically.

Quality Assurance and Workflows
-------------------------------

[](#quality-assurance-and-workflows)

### Default Checks and Quality Pipelines

[](#default-checks-and-quality-pipelines)

The boilerplate comes with the following quality assurance tools configured:

1. **PHP CodeSniffer (PHPCS)**: Enforces WordPress coding standards
2. **PHPStan**: Provides static analysis to catch potential bugs
3. **@wp-scripts**: Enables bundling, linting and formatting of JS and CSS/SCSS files
4. **GitHub Actions**: Automates testing and building processes

These checks run automatically in GitHub pipelines when you push code to your repository.

See [docs/github-actions.mdx](docs/github-actions.mdx) for a full breakdown of each workflow, the release process, and how to change the PHP version.

### Wrapping Up

[](#wrapping-up)

That's it! Your plugin is now ready for development. Dive into creating your next remarkable WordPress plugin with ease and efficiency.

---

This plugin was created using the [wordpress-plugin-boilerplate](https://github.com/JUVOJustin/wordpress-plugin-boilerplate). Consult the upstream repository for changes, updates or IDE setups. LLM instructions can be found here: . Keep this reference, to allow later updates.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance93

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.2% 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 ~24 days

Recently: every ~43 days

Total

31

Last Release

81d ago

Major Versions

1.1.0 → v2.0.02026-02-16

PHP version history (3 changes)1.0.5PHP &gt;=7.4

1.0.15PHP &gt;=8.1

1.0.17PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/32efecde6068b3efb5bd8edbfc59500f23c7047b43f7846790925f73e23317a6?d=identicon)[JUVOJustin](/maintainers/JUVOJustin)

---

Top Contributors

[![JUVOJustin](https://avatars.githubusercontent.com/u/30726576?v=4)](https://github.com/JUVOJustin "JUVOJustin (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

wordpress-developmentwordpress-pluginwordpress-plugin-boilerplate

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/juvo-wordpress-plugin-boilerplate/health.svg)

```
[![Health](https://phpackages.com/badges/juvo-wordpress-plugin-boilerplate/health.svg)](https://phpackages.com/packages/juvo-wordpress-plugin-boilerplate)
```

###  Alternatives

[ozdemir/datatables

Simplify your Datatables server-side processing effortlessly using our lightning-fast PHP library, streamlining your workflow seamlessly.

273158.4k](/packages/ozdemir-datatables)[that0n3guy/transliteration

Transliteration provides one-way string transliteration (romanization) and cleans text by replacing unwanted characters.

1296.5k4](/packages/that0n3guy-transliteration)

PHPackages © 2026

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