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

ActiveWordpress-plugin

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

A WordPress agency-pass plugin.

00[2 issues](https://github.com/apermo/agency-pass/issues)[1 PRs](https://github.com/apermo/agency-pass/pulls)PHPCI passing

Since Apr 4Pushed 1mo 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 1mo ago

READMEChangelogDependenciesVersions (2)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)[![License: GPL v2+](https://camo.githubusercontent.com/996c3451ae01accccbdbaaa15299d3a015844792e6de4a884a5d12f1356bacd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c76322b2d626c75652e737667)](LICENSE)

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.2+

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', 86400 );   // Temporary user lifetime in seconds (default: 24 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`
- `list_users`, `promote_users`, `remove_users`

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
```

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

20

—

LowBetter than 14% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://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 (2 commits)")

### 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)
```

PHPackages © 2026

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