Linux 软件免费装

Environment Info

开发者 edwardbock
palasthotel
janaeggebrecht
更新时间 2026年11月23日 22:24
捐献地址: 去捐款
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPL-3.0-or-later
版权网址: 版权信息

标签

dashboard information admin bar

下载

1.1.1 1.1.2 2.0.0 1.1.0 1.1.3

详情介绍:

Show environmental info on your admin bar so you will never accidentally edit production site contents instead of stage or the other way around.

安装:

  1. Install the plugin from Plugins > Add New, or upload environment-info.zip under Plugins > Add New > Upload Plugin
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Describe your environments in wp-config.php, see below

常见问题:

How do I describe my environments?

Define the constant ENVIRONMENT_INFO_SETTINGS in wp-config.php, with one entry per environment: define( 'ENVIRONMENT_INFO_SETTINGS', [ [ 'path' => '/var/www/staging', 'title' => 'Staging', 'background' => '#b45309', 'color' => 'white' ], [ 'hostname' => 'web-prod-1', 'title' => 'Production', 'background' => '#b91c1c', 'color' => 'white' ], ] ); Each entry needs a title and is recognised either by hostname, compared with the server's host name, or by path, which matches when it appears anywhere in the plugin's directory path. background and color take any CSS colour.

The admin bar says "Unknown Server"

Exactly one entry has to match. With none, or with more than one, the label reads "Unknown Server"; more than one match is also written to the error log. Tools > Environment Info lists every entry, marks the active one and shows the current host name and path, so you can see why nothing matched.

Who sees the label?

Every logged-in user who sees the admin bar. The overview under Tools > Environment Info requires the manage_options capability.

更新日志:

2.0.0 ⚠ BREAKING CHANGES 1.1.3 Bug Fixes 1.1.2 Bug Fixes 1.1.1 1.1.0 1.0.0