PHPackages                             solvebeam/solvebeam-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. solvebeam/solvebeam-wordpress-plugin-boilerplate

ActiveWordpress-plugin

solvebeam/solvebeam-wordpress-plugin-boilerplate
================================================

A modern WordPress plugin boilerplate by SolveBeam, providing a structured foundation for building scalable and maintainable plugins.

14↓100%PHP

Since Mar 19Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#solvebeam-wordpress-plugin-boilerplate)

A modern WordPress plugin boilerplate by SolveBeam, providing a structured foundation for building scalable and maintainable plugins.

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

[](#requirements)

- PHP 8.2+
- WordPress 6.7+
- Composer
- Node.js / npm

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

[](#installation)

```
composer install
npm install
```

Development
-----------

[](#development)

### Local environment (wp-env)

[](#local-environment-wp-env)

```
npx wp-env start
npx wp-env stop
```

The `.wp-env.json` maps the plugin twice into the WordPress environment:

Mount pathSourcePurpose`wp-content/plugins/solvebeam-boilerplate-dev``./`Live development (including dev files)`wp-content/plugins/solvebeam-boilerplate``./build/stage-2/`Built distribution versionThis lets you test both the raw source and the production build side-by-side.

### Build

[](#build)

```
composer run build
```

The build uses a **two-stage rsync** process:

1. **Stage 1** — copies source (respecting `.distignore`), then runs `composer install --no-dev` to get production-only dependencies.
2. **Stage 2** — copies stage 1 output (again respecting `.distignore`) to strip any remaining dev artifacts, then generates `.pot` / `.mo` translation files and creates a dist archive via `wp dist-archive`.

The final distributable ZIP is created from `build/stage-2/`.

### Linting &amp; analysis

[](#linting--analysis)

```
composer run phpcs
composer run rector
```

Architecture &amp; Conventions
------------------------------

[](#architecture--conventions)

This boilerplate follows the [SolveBeam Plugin Development Guidelines](https://github.com/solvebeam). Key conventions that may not be immediately obvious:

### Why `psr-4/` instead of `src/`

[](#why-psr-4-instead-of-src)

WordPress plugins typically contain PHP, JavaScript, CSS, and other assets. Using `src/` for only PHP files creates ambiguity about where non-PHP source files belong. The `psr-4/` directory makes the PSR-4 autoload root explicit and prevents accidental mixing of PHP and non-PHP sources.

### Strict typing in every file

[](#strict-typing-in-every-file)

Every PHP file must start with `declare(strict_types=1);` — no exceptions.

### Flat namespace architecture

[](#flat-namespace-architecture)

All classes live directly under a single namespace (e.g. `SolveBeam\WordPressPluginBoilerplate`). No sub-namespaces, no deep folder structure. Everything goes into `psr-4/` directly.

### Minimal visibility surface

[](#minimal-visibility-surface)

- Classes → `final` wherever possible
- Properties → `private readonly` wherever possible
- Methods → `private` wherever possible
- Only expose what *must* be public

### Singleton pattern for Plugin.php

[](#singleton-pattern-for-pluginphp)

`psr-4/Plugin.php` must be `final`, use a private constructor, and expose a single `public static function instance(): self` entry point. Hooks are registered internally from the constructor.

### First-class callable syntax for hooks

[](#first-class-callable-syntax-for-hooks)

Always use PHP 8.1+ first-class callable syntax for hook callbacks:

```
// ✅ Correct
add_action( 'init', $this->init( ... ) );

// ❌ Never use array syntax
add_action( 'init', [ $this, 'init' ] );
```

### Comments

[](#comments)

No redundant or obvious comments. Only add comments where the logic isn't self-evident.

### Distribution cleanliness

[](#distribution-cleanliness)

The `.distignore` file ensures development-only files (config files, build tooling, node\_modules, etc.) are excluded from the production ZIP. A `.gitattributes` with `export-ignore` rules should be used to keep GitHub-generated ZIP archives clean as well.

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

[](#directory-structure)

```
solvebeam-boilerplate/
├── solvebeam-boilerplate.php   # Main plugin file (bootstrap)
├── composer.json
├── package.json
├── .wp-env.json
├── .editorconfig
├── .distignore
├── README.md
├── CHANGELOG.md
├── phpcs.xml.dist
├── rector.php
├── psr-4/
│   └── Plugin.php              # Singleton entry point
├── languages/
├── assets/
│   ├── js/
│   └── css/
└── vendor/

```

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance59

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/869674?v=4)[Remco Tolsma](/maintainers/remcotolsma)[@remcotolsma](https://github.com/remcotolsma)

---

Top Contributors

[![remcotolsma](https://avatars.githubusercontent.com/u/869674?v=4)](https://github.com/remcotolsma "remcotolsma (12 commits)")

---

Tags

phpphpcsremcotolsmasolvebeamwordpresswordpress-boilerplatewordpress-developmentwordpress-pluginwp-envwp-plugin

### Embed Badge

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

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

PHPackages © 2026

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