PHPackages                             engagedc/wp-handler - 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. engagedc/wp-handler

ActiveProject[Framework](/categories/framework)

engagedc/wp-handler
===================

An object oriented boilerplate for WordPress themes and plugins.

2.1.0(7y ago)135MITPHPPHP ^7.0

Since Jul 31Pushed 7y ago7 watchersCompare

[ Source](https://github.com/EngageDC/wp-handler)[ Packagist](https://packagist.org/packages/engagedc/wp-handler)[ RSS](/packages/engagedc-wp-handler/feed)WikiDiscussions master Synced 3w ago

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

WP-Handler
==========

[](#wp-handler)

This object is a method by which to hide the gritty details of attaching handlers to WordPress action and filter hooks to protected functions within an object. Without it, only public methods of an object are accessible to the WordPress core ecosystem, but with it we can use protected methods as well to help avoid anyone calling a method of our objects in an inappropriate way.

Usage
-----

[](#usage)

Simply extend the `AbstractHandler` object and implement the `initialize()` method. In that method, you should use the the `addAction()` and `addFilter()` methods of the object to attach other methods to WordPress actions and filters. For example:

```
public function initialize(): void {
    $this->addAction("admin_enqueue_scripts", "addAdminScripts");
}

protected function addAdminScripts(): void {
    /* do important things here */
}
```

Both the `addAction()` and `addFilter()` methods have similar arguments to WordPress's core `add_action()` and `add_filter()` functions: the hook's name, the name of the callback method, the priority at which it's called, and the number of arguments to send your callback. Like the WP Core functions, these last two parameters have default values of 10 and 1 respectively.

Why?
----

[](#why)

Simply put, having an object with only public methods helps avoid naming collisions, but does not avoid putting all of that code in the global scope where it can be accessed from anywhere. The AbstractHandler object makes sure that your protected methods can only be called on the action/filter hook for which they're intended at the priority level that you provide. Any other attempt to use them will either cause a PHP error (because the methods are protected) or throw a `HandlerException`.

Additional Objects
------------------

[](#additional-objects)

There are some additional helper objects in the `Pages` folder and a few traits in the one named `Traits`. These are here because they're frequently utilized by handlers to display template files. Conceivably, they could be in their own repo, but since these objects are so often used together, we might decided to let them live in the same one for now.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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

Total

5

Last Release

2833d ago

Major Versions

1.0.2 → 2.0.02018-08-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14929232?v=4)[Engage-DC](/maintainers/Engage-DC)[@Engage-DC](https://github.com/Engage-DC)

---

Top Contributors

[![dashifen](https://avatars.githubusercontent.com/u/8269?v=4)](https://github.com/dashifen "dashifen (1 commits)")

### Embed Badge

![Health badge](/badges/engagedc-wp-handler/health.svg)

```
[![Health](https://phpackages.com/badges/engagedc-wp-handler/health.svg)](https://phpackages.com/packages/engagedc-wp-handler)
```

###  Alternatives

[laravel/dusk

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

1.9k39.6M290](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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