PHPackages                             mindspun/wordpress-plugin-framework - 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. [Framework](/categories/framework)
4. /
5. mindspun/wordpress-plugin-framework

ActiveLibrary[Framework](/categories/framework)

mindspun/wordpress-plugin-framework
===================================

Framework for creating professional-grade WordPress plugins.

v1.4.0(1y ago)482MITPHPPHP &gt;=7.4

Since May 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/getmindspun/wordpress-plugin-framework)[ Packagist](https://packagist.org/packages/mindspun/wordpress-plugin-framework)[ RSS](/packages/mindspun-wordpress-plugin-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

WordPress Plugin Framework (wpfw)
=================================

[](#wordpress-plugin-framework-wpfw)

The WordPress plugin framework utilizes the registry and facade design patterns to create profession-grade plugins that:

- Have a clean, easy to understand, OOP implementation.
- Have 100% unit test coverage.

See the `examples` directory for a batteries-included example.

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

[](#installation)

The code is simple enough - and licensed appropriately - to be copied into your product directly, however, the best approach is to use Composer and [Strauss](https://github.com/BrianHenryIE/strauss).

See the `examples` directory for complete plugin that uses this method.

### Autoloading

[](#autoloading)

This package also contains a simple autoloader class that support both WordPress and PSR-4 style classes. Use it to autoload your application code.

```
require_once( __DIR__ . '/vendor-prefixed/autoload.php' );
Autoloader::autoload( 'Examples\Logging', __DIR__ . '/includes' );

```

The first line pulls in the Strauss autoloader, which loads the framework - including our autoloader class. The second line loads our plugin code.

The autoload method registers a namespace and associates the directory containing the files.

```
autoload( string $namespace, string $dir, string $type = 'psr4' )

```

The `$type` parameter also accepts `wordpress` or `wp` in which case the WordPress file namings scheme is used - i.e. with 'class-' filenames etc.

Usage
-----

[](#usage)

The facade/provider combo acts as a mini-library inside your plugin. The facade is the sole way the rest of the application acts with the functionality the provider provides.

In the plugin file, you'd call:

```
MyComponentProvider::provide();
```

then in the rest of the application, use the facade:

```
MyComponent::my_method();
```

Globals Facade/Provider
-----------------------

[](#globals-facadeprovider)

The framework contains one 'built-in' facade/provider combo: 'Globals', since every plugin is going to need it.

In your plugin, replace any call to a global function - either PHP native, or WordPress defined - with this facade. For example, `die()` becomes `Globals::die()`, `wp_redirect(...)` becomes `Globals::wp_redirect(...)`etc.

Generally, you'd create a 'Globals' class in your own namespace that extends `Mindspun\Framework\Facades\Globals` and then has an empty body. The purpose of this class is to add PHP doc `@method` comments with the globals you use to assist your editor. See the 'Globals' class in the 'examples' directory for an example.

Motivation
----------

[](#motivation)

There are at least six other GitHub projects with the name 'wordpress-plugin-framework', so why one more?

- It's just plain difficult to get 100% code coverage for a plugin of any complexity, and we consider that a minimum requirement for release. This approach fixes that.
- Just look at any of the older plugins on [wordpress.org/plugins/,](https://wordpress.org/plugins/)and you'll see that it's really difficult to prevent a plugin from turning into spaghetti code as it grows. This approach prevents that (mostly, care must still be taken).

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

[](#development)

### Setup

[](#setup)

```
composer update
make
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~117 days

Total

5

Last Release

632d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d54fd5d0c76de355798c465ea41a1a3ae5d04fdc9d8e08c1cb508389bba3d6fc?d=identicon)[mindspun](/maintainers/mindspun)

---

Top Contributors

[![mattlaue](https://avatars.githubusercontent.com/u/1434092?v=4)](https://github.com/mattlaue "mattlaue (27 commits)")

---

Tags

wordpresswordpress-plugin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mindspun-wordpress-plugin-framework/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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