PHPackages                             rockschtar/wordpress-controller - 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. rockschtar/wordpress-controller

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

rockschtar/wordpress-controller
===============================

Controller Trait for handling WordPress Hooks

2.4.1(2y ago)011.3kMITPHPPHP &gt;=7.4

Since Sep 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rockschtar/wordpress-controller)[ Packagist](https://packagist.org/packages/rockschtar/wordpress-controller)[ RSS](/packages/rockschtar-wordpress-controller/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (11)Used By (0)

rockschtar/wordpress-controller
===============================

[](#rockschtarwordpress-controller)

Controller Trait for handling WordPress Hooks

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

[](#requirements)

- PHP &gt;= 7.1
- Composer - [Install](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx)

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

[](#installation)

Use [composer](https://composer.org/) to install vendor/package-name.

```
composer install rockschtar/wordpress-controller
```

Usage
-----

[](#usage)

```
use Rockschtar\WordPress\Controller\HookController;

class MyController
{
    use HookController;

    private function __construct()
    {
        $this->addAction('wp_head', 'wpHead');
        $this->addFilter('body_class', 'bodyClass');
    }

    private function wpHead(): void
    {
        echo '';
    }

    private function bodyClass(?array $classes = []): array
    {
        if ($classes === null) {
            $classes = [];
        }

        $classes[] = 'my-body-class';

        return $classes;
    }
}
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~224 days

Recently: every ~290 days

Total

9

Last Release

1020d ago

Major Versions

1.0.0 → 2.0.02018-12-17

PHP version history (2 changes)1.0.0PHP &gt;=7.1

2.4.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/67724bb6880d11c1609be2abeecc7857e2fd22147eb634b3dcce3d77a2818f68?d=identicon)[rockschtar](/maintainers/rockschtar)

---

Top Contributors

[![rockschtar](https://avatars.githubusercontent.com/u/87191?v=4)](https://github.com/rockschtar "rockschtar (31 commits)")

### Embed Badge

![Health badge](/badges/rockschtar-wordpress-controller/health.svg)

```
[![Health](https://phpackages.com/badges/rockschtar-wordpress-controller/health.svg)](https://phpackages.com/packages/rockschtar-wordpress-controller)
```

PHPackages © 2026

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