PHPackages                             davekellam/dont-mess-up-prod - 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. davekellam/dont-mess-up-prod

ActiveWordpress-plugin

davekellam/dont-mess-up-prod
============================

A WordPress plugin to indicate which environment you're currently using in the admin bar

1.0.1(3mo ago)143[3 issues](https://github.com/davekellam/dont-mess-up-prod/issues)[1 PRs](https://github.com/davekellam/dont-mess-up-prod/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.0CI passing

Since Nov 12Pushed 3mo agoCompare

[ Source](https://github.com/davekellam/dont-mess-up-prod)[ Packagist](https://packagist.org/packages/davekellam/dont-mess-up-prod)[ Docs](https://github.com/davekellam/dont-mess-up-prod)[ RSS](/packages/davekellam-dont-mess-up-prod/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (11)Used By (0)

Don't Mess Up Prod
==================

[](#dont-mess-up-prod)

This plugin displays a colored environment indicator in the WordPress admin bar to help developers and content managers identify which environment they're working in.

[![Environment indicator screenshot](.wordpress-org/screenshot-1.png)](.wordpress-org/screenshot-1.png)

See a [live preview on Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/davekellam/dont-mess-up-prod/main/.wordpress-org/blueprints/blueprint.json).

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

[](#installation)

### Manual

[](#manual)

1. Upload the plugin files to `/wp-content/plugins/dont-mess-up-prod/`
2. Activate the plugin through the "Plugins" screen in WordPress
3. Configure the plugin via the Settings → Don’t Mess Up Prod screen (or filters)

### Composer

[](#composer)

```
composer require davekellam/dont-mess-up-prod
```

Environment Detection
---------------------

[](#environment-detection)

The plugin detects the current environment using this priority order:

1. **URL matching** – Compares the current site URL against the configured environment URLs. This list will also be used to generate a list of links that appears on hover in the admin bar.
2. **`wp_get_environment_type()`** – Which defaults to `production` and can be set via php constant:

    ```
    define( 'WP_ENVIRONMENT_TYPE', 'staging' );
    ```

The indicator is visible to users who either meet the minimum capability (defaults to `publish_posts`, filterable via `dmup_minimum_capability`) or whose username appears in the allowed users filter. This keeps visibility limited to the folks who need the context.

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

[](#configuration)

The plugin can be configured using the WordPress admin screen or using filters.

### Admin Settings

[](#admin-settings)

Go to **Settings → Don’t Mess Up Prod** to configure:

- **Colors** for each environment (local, development, staging, production)
- **URLs** for each environment (used for detection and quick links)

Settings are saved per environment, and defaults are provided out of the box.

### Example Configuration (mu-plugin)

[](#example-configuration-mu-plugin)

Create a file `/wp-content/mu-plugins/dmup-config.php`:

```
