PHPackages                             apermo/agency-pass - 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. apermo/agency-pass

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

apermo/agency-pass
==================

A WordPress agency-pass plugin.

v0.1.0(2mo ago)00[6 issues](https://github.com/apermo/agency-pass/issues)[1 PRs](https://github.com/apermo/agency-pass/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.1CI passing

Since Apr 15Pushed 3w agoCompare

[ Source](https://github.com/apermo/agency-pass)[ Packagist](https://packagist.org/packages/apermo/agency-pass)[ RSS](/packages/apermo-agency-pass/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (1)Dependencies (7)Versions (4)Used By (0)

Agency Pass
===========

[](#agency-pass)

[![PHP CI](https://github.com/apermo/agency-pass/actions/workflows/ci.yml/badge.svg)](https://github.com/apermo/agency-pass/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/de0ddaf3ca06742c66cba565b501eddc24597553da5b5d9df84f5c14e925311f/68747470733a2f2f636f6465636f762e696f2f67682f617065726d6f2f6167656e63792d706173732f67726170682f62616467652e737667)](https://codecov.io/gh/apermo/agency-pass)[![Packagist Version](https://camo.githubusercontent.com/57f9a2bdcc8e221523dd55fb59a00ceedc03360e7c79e4e8185838798f9ffdd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617065726d6f2f6167656e63792d70617373)](https://packagist.org/packages/apermo/agency-pass)[![PHP Version](https://camo.githubusercontent.com/a1de62ad10c9fecb7c7f60bf6c17a406ad7afe6e2ffb3208eca0a32b15882034/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f617065726d6f2f6167656e63792d706173732f706870)](composer.json)[![WordPress](https://camo.githubusercontent.com/03a70b17f4d61fa6cdf7ef1c9943b034dc09f74cef7c086a7aea2d1257fed93b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d362e342532422d323137353962)](https://wordpress.org/)[![License: GPL v2+](https://camo.githubusercontent.com/996c3451ae01accccbdbaaa15299d3a015844792e6de4a884a5d12f1356bacd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c76322b2d626c75652e737667)](LICENSE)[![Donate](https://camo.githubusercontent.com/d996e81ec0a85d0d72f805a8b3a4f45ed7a8eef4d30ce3b360ad0172da0023da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d303039636465)](https://paypal.me/apermo)

Self-service emergency login for agency staff on client WordPress sites.

Description
-----------

[](#description)

Agency Pass adds a magic-link login flow to the WordPress login screen. Staff with whitelisted email addresses can request a temporary login link that creates a time-limited user with a restricted admin role. No external infrastructure required — the entire solution is self-contained.

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

[](#requirements)

- PHP 8.1+
- WordPress 6.4+

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

[](#installation)

1. Upload the `agency-pass` directory to `/wp-content/plugins/`
2. Activate the plugin through the "Plugins" screen in WordPress
3. On activation, a mu-plugin loader is installed to guarantee early loading

Configuration
-------------

[](#configuration)

Add constants to `wp-config.php`:

### Required

[](#required)

```
define( 'AGENCY_PASS_EMAIL_PATTERN', '/^.+@youragency\.de$/' );
```

### Optional

[](#optional)

```
define( 'AGENCY_PASS_TOKEN_TTL', 900 );    // Magic link validity in seconds (default: 15 min)
define( 'AGENCY_PASS_USER_TTL', 28800 );   // Temporary user lifetime in seconds (default: 8 h)
```

How it works
------------

[](#how-it-works)

1. A "Agency Pass" button appears on the WordPress login form
2. Clicking it reveals an email input field
3. If the email matches the configured pattern, a single-use magic link is sent via `wp_mail()`
4. Clicking the link creates a temporary user with the `agency_pass_admin` role and logs them in
5. Expired users are cleaned up automatically via WP-Cron

Custom role
-----------

[](#custom-role)

The `agency_pass_admin` role has all administrator capabilities except:

- `edit_users`, `delete_users`, `create_users`
- `promote_users`, `remove_users`

The role retains `list_users` (can view the user list). Emergency users are blocked from editing their own profile via `map_meta_cap`.

Extensibility
-------------

[](#extensibility)

```
add_filter( 'agency_pass_email_allowed', function ( bool $allowed, string $email ): bool {
    // Custom validation logic here
    return $allowed;
}, 10, 2 );
```

Audit hooks
-----------

[](#audit-hooks)

- `agency_pass_link_requested` — fired when a magic link is requested
- `agency_pass_login` — fired on successful emergency login
- `agency_pass_user_cleanup` — fired when an expired user is removed

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

[](#development)

```
composer install
composer cs              # Run PHPCS
composer cs:fix          # Fix PHPCS violations
composer analyse         # Run PHPStan
composer test            # Run all tests
composer test:unit       # Run unit tests only
```

### Local WordPress Environment

[](#local-wordpress-environment)

```
ddev start && ddev orchestrate
```

### Git Hooks

[](#git-hooks)

```
git config core.hooksPath .githooks
```

Known incompatibilities
-----------------------

[](#known-incompatibilities)

### NinjaFirewall

[](#ninjafirewall)

NinjaFirewall blocks on-the-fly creation of users with elevated roles. Since Agency Pass creates temporary admin-level users via `wp_insert_user()`, NinjaFirewall will silently prevent emergency logins from working.

The relevant NinjaFirewall hooks are `nfw_account_creation` (action on `pre_user_login`), `nfwhook_update_user_meta` and `nfwhook_add_user_meta` (filters on user meta operations). A bypass is possible by removing these hooks before user creation, but this is not recommended and not shipped with the plugin.

Template Sync
-------------

[](#template-sync)

```
git remote add template https://github.com/apermo/template-wordpress.git
git fetch template
git checkout -b chore/sync-template
git merge template/main --allow-unrelated-histories
```

License
-------

[](#license)

[GPL-2.0-or-later](LICENSE)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

81d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/910b8010a35a86821d0b90d645374f5ae484513f2c195818e4c54bc0175d12e1?d=identicon)[apermo](/maintainers/apermo)

---

Top Contributors

[![apermo](https://avatars.githubusercontent.com/u/4695889?v=4)](https://github.com/apermo "apermo (53 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/apermo-agency-pass/health.svg)

```
[![Health](https://phpackages.com/badges/apermo-agency-pass/health.svg)](https://phpackages.com/packages/apermo-agency-pass)
```

###  Alternatives

[org_heigl/holidaychecker

Check for holidays - localeaware

844.1k](/packages/org-heigl-holidaychecker)

PHPackages © 2026

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