{"id":33344109,"url":"https://github.com/davekellam/dont-mess-up-prod","last_synced_at":"2026-01-28T23:03:18.631Z","repository":{"id":323933283,"uuid":"1095233265","full_name":"davekellam/dont-mess-up-prod","owner":"davekellam","description":"A WordPress plugin that provides an admin bar prod to remind you what environment you're currently working in","archived":false,"fork":false,"pushed_at":"2026-01-27T19:27:49.000Z","size":2132,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T04:43:21.981Z","etag":null,"topics":["admin-bar","environment","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/dont-mess-up-prod/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davekellam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-12T19:16:58.000Z","updated_at":"2026-01-27T18:08:34.000Z","dependencies_parsed_at":"2025-11-21T22:00:25.999Z","dependency_job_id":null,"html_url":"https://github.com/davekellam/dont-mess-up-prod","commit_stats":null,"previous_names":["davekellam/dont-mess-up-prod"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/davekellam/dont-mess-up-prod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davekellam%2Fdont-mess-up-prod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davekellam%2Fdont-mess-up-prod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davekellam%2Fdont-mess-up-prod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davekellam%2Fdont-mess-up-prod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davekellam","download_url":"https://codeload.github.com/davekellam/dont-mess-up-prod/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davekellam%2Fdont-mess-up-prod/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28854454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-bar","environment","wordpress","wordpress-plugin"],"created_at":"2025-11-21T22:00:17.486Z","updated_at":"2026-01-28T23:03:18.624Z","avatar_url":"https://github.com/davekellam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Don't Mess Up Prod\n\nThis plugin displays a colored environment indicator in the WordPress admin bar to help developers and content managers identify which environment they're working in. \n\n![Environment indicator screenshot](.wordpress-org/screenshot-1.png)\n\nSee 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).\n\n## Installation\n\n### Manual\n\n1. Upload the plugin files to `/wp-content/plugins/dont-mess-up-prod/`\n2. Activate the plugin through the \"Plugins\" screen in WordPress\n3. Configure the plugin via the Settings → Don’t Mess Up Prod screen (or filters)\n\n### Composer\n\n```bash\ncomposer require davekellam/dont-mess-up-prod\n```\n\n## Environment Detection\n\nThe plugin detects the current environment using this priority order:\n\n1. **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.\n2. **`wp_get_environment_type()`** – Which defaults to `production` and can be set via php constant:\n\n    ```php\n    define( 'WP_ENVIRONMENT_TYPE', 'staging' );\n    ```\n\nThe 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.\n\n## Configuration\n\nThe plugin can be configured using the WordPress admin screen or using filters.\n\n### Admin Settings\n\nGo to **Settings → Don’t Mess Up Prod** to configure:\n\n- **Colors** for each environment (local, development, staging, production)\n- **URLs** for each environment (used for detection and quick links)\n\nSettings are saved per environment, and defaults are provided out of the box.\n\n### Example Configuration (mu-plugin)\n\nCreate a file `/wp-content/mu-plugins/dmup-config.php`:\n\n```php\n\u003c?php\n/**\n * Plugin Name: Don't Mess Up Prod Configuration\n */\n\n/**\n * Configure minimum capability for the environment indicator\n *\n * By default, the plugin only shows to explicitly allowed users.\n * Use this filter to enable role-based access.\n *\n * @param string|false $capability Current capability setting.\n * @return string|false Modified capability setting.\n */\nfunction dmup_set_minimum_capability( $capability ) {\n    // Enable for Author level and above\n    return 'publish_posts';\n}\nadd_filter( 'dmup_minimum_capability', 'dmup_set_minimum_capability' );\n\n/**\n * Configure allowed users for the environment indicator\n *\n * Add specific user logins that should see the environment indicator\n * regardless of their role level.\n *\n * @param array $users Current allowed users array.\n * @return array Modified allowed users array.\n */\nfunction dmup_set_allowed_users( $users ) {\n    // Add specific user logins here\n    $project_users = [\n        'developer-name',\n        'content-manager-name',\n    ];\n\n    return array_merge( $users, $project_users );\n}\nadd_filter( 'dmup_allowed_users', 'dmup_set_allowed_users' );\n\n/**\n * Configure environment URLs for your project\n *\n * Customize the URLs used to detect different environments and populate child links under the admin bar menu item\n *\n * @param array $urls Current environment URLs array.\n * @return array Modified environment URLs array.\n */\nfunction dmup_set_environment_urls( $urls ) {\n    return [\n        'local'       =\u003e 'http://yourproject.local',\n        'development' =\u003e 'https://dev.yourproject.com',\n        'staging'     =\u003e 'https://staging.yourproject.com',\n        'production'  =\u003e 'https://yourproject.com',\n    ];\n}\nadd_filter( 'dmup_environment_urls', 'dmup_set_environment_urls' );\n\n/**\n * Configure environment colors for your project\n *\n * Customize the colors used for each environment\n *\n * @param array $colors Current environment colors array.\n * @return array Modified environment colors array.\n */\nfunction dmup_set_environment_colors( $colors ) {\n    return [\n        'local'       =\u003e '#17a2b8', // blue\n        'development' =\u003e '#6f42c1', // purple\n        'staging'     =\u003e '#ffc107', // yellow\n        'production'  =\u003e '#dc3545', // red\n    ];\n}\n// Note: Admin settings are applied at priority 20.\n// If you want to override admin settings in code, use a higher priority.\nadd_filter( 'dmup_environment_colors', 'dmup_set_environment_colors', 30 );\n```\n\n## License\n\nGPL-2.0-or-later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavekellam%2Fdont-mess-up-prod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavekellam%2Fdont-mess-up-prod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavekellam%2Fdont-mess-up-prod/lists"}