A Chrome extension that automatically detects WordPress environments (development, staging, production) and displays a corresponding badge in the WordPress admin bar.
Prevent confusion between local or test environments and production by clearly displaying the current environment in the WordPress interface.
- Automatic detection of environments based on:
- Domains:
.dev,.test,.local - Hostnames:
localhost,127.x.x.x - Staging patterns:
staging,stage,preview,demo,test
- Domains:
- Visual badge in the WordPress admin bar with SVG icons
- Popup interface with General tab displaying environment information
- WordPress detection: Version, language and current theme
- Distinctive colors:
- 🔵 Development: Purple (
#4f39f6) - 🟣 Staging: Pink (
#e60076) - ⚪ Production: No badge (production environment)
- 🔵 Development: Purple (
- Download or clone this repository
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked extension"
- Select the extension folder
- Navigate to a WordPress site
- The extension automatically detects the environment and WordPress information
- A colored badge with icon appears in the WordPress admin interface
- Click on the extension icon to see details in the popup
- The popup displays:
- Detected environment (development/staging)
- WordPress version
- Site language
- Current theme
The extension automatically detects:
- Development environments:
localhost,127.x.x.x,.dev,.test,.localdomains - Staging environments: hostnames containing
staging,stage,preview,demo,test - WordPress information: version, language, theme via DOM analysis
chrome-wordpress-env-indicator/
├── manifest.json # Extension configuration (Manifest V3)
├── background.js # Service worker
├── scripts/
│ └── content.js # Script injected into WordPress pages
├── popup/
│ ├── popup.html # Popup interface with tabs
│ ├── popup.css # Popup styles (BEM methodology)
│ └── popup.js # Popup logic and communication
├── styles.css # Styles injected into WordPress admin
├── images/ # Extension icons (16px, 32px, 48px, 128px)
│ ├── icon16.png
│ ├── icon32.png
│ ├── icon48.png
│ ├── icon128.png
│ └── logo.svg # Custom WordPress logo
└── locales/ # Translation files (v0.3)
- Vanilla JavaScript (no framework)
- Chrome Extensions Manifest V3
- CSS3 with responsive support and BEM methodology
- Chrome Storage API for data persistence
- Chrome Scripting API for script injection
- SVG for badge icons
- MutationObserver for page change detection (SPA)
- Chrome Runtime API for component communication
- ✅ Automatic environment detection (development, staging)
- ✅ Visual badge with SVG icons in WordPress admin bar
- ✅ Popup interface with General tab
- ✅ WordPress version, language and theme detection
- ✅ Single-page application (SPA) support
- ✅ Distinctive colors per environment
- ✅ Component communication via Chrome APIs
- 🔄 Settings tab in popup (interface ready)
- 🔄 Custom domains for staging
- 🔄 Badge color customization
- 🔄 User preferences saving
- Internationalization (EN, FR, ES)
- Automatic browser language detection
Contributions are welcome! Feel free to:
- Report bugs
- Suggest improvements
- Submit pull requests
- Raphael Sanchez - Frontend Developeur
This project is licensed under the MIT License. See the LICENSE file for more details.
