PHPackages                             fabrikage/wp-env-switcher - 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. fabrikage/wp-env-switcher

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

fabrikage/wp-env-switcher
=========================

Adds dropdown to admin bar to switch between different DTAP environments

0.1.0(2y ago)18MITPHPPHP &gt;=8.1

Since Dec 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/fabrikage/wp-env-switcher)[ Packagist](https://packagist.org/packages/fabrikage/wp-env-switcher)[ RSS](/packages/fabrikage-wp-env-switcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

  ![Fabrikage logo](https://camo.githubusercontent.com/ab7138e1ceb31b23b62baba37b0922cd14b264c7c99493b4be88187ec0963985/68747470733a2f2f66616272696b6167652e6e6c2f6173736574732f696d672f6c6f676f2e737667)

fabrikage/wp-env-switcher

[](#fabrikagewp-env-switcher)

Use this package to add a menu item in your WordPress admin bar in which you can switch between environments. This is useful when you have a DTAP street and you want to quickly switch between your environments.

The library will compare your current URL with the environment URLs you have set in your environment variables. If the current URL matches one of the environment URLs, that environment will be marked as active. Other environments will show in the submenu.

Screenshot
----------

[](#screenshot)

[![A screenshot of the menu item](screenshot.jpg)](screenshot.jpg)

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

[](#requirements)

Set the following `$_ENV` variables in your project:

```
URL_DEVELOPMENT='https://example.dev'
URL_TESTING='https://example.test'
URL_ACCEPTANCE='https://example.acceptance'
URL_PRODUCTION='https://example.com'
```

*Note: These variables are not required, but if you don't set them, the corresponding menu item will not show up.*

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

[](#installation)

Install the package using composer:

```
composer require fabrikage/wp-env-switcher
```

Usage
-----

[](#usage)

Add the following code to your `functions.php`:

```
\Fabrikage\WordPress\EnvSwitcher::enable();
```

If you want to enable the menu for specific users, pass an array with usernames:

```
\Fabrikage\WordPress\EnvSwitcher::enable(['admin', 'other-user']);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

885d ago

### Community

Maintainers

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

---

Top Contributors

[![bartkleinreesink](https://avatars.githubusercontent.com/u/28318911?v=4)](https://github.com/bartkleinreesink "bartkleinreesink (3 commits)")

---

Tags

phpphp8wordpresswordpress-development

### Embed Badge

![Health badge](/badges/fabrikage-wp-env-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/fabrikage-wp-env-switcher/health.svg)](https://phpackages.com/packages/fabrikage-wp-env-switcher)
```

PHPackages © 2026

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