وەسف
Show environmental info on your admin bar so you will never accidentally edit production site contents instead of stage or the other way around.
دامەزراندن
- Install the plugin from Plugins > Add New, or upload
environment-info.zipunder Plugins > Add New > Upload Plugin - Activate the plugin through the ‘Plugins’ menu in WordPress
- Describe your environments in
wp-config.php, see below
پهد
-
How do I describe my environments?
-
Define the constant
ENVIRONMENT_INFO_SETTINGSinwp-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
titleand is recognised either byhostname, compared with the server’s host name, or bypath, which matches when it appears anywhere in the plugin’s directory path.backgroundandcolortake 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_optionscapability.
پێداچوونەوەکان
هیچ پێداچوونەوەیەک نەنووسراوە بۆ ئەم پێوەکراوە.
بەشداربووان و گەشەپێدەران
“Environment Info” نەرمەواڵەیەکی سەرچاوە کراوەیە. ئەم کەسانەی خوارەوە بەشدارییان تێدا کردووە.
بەشداربووان“Environment Info” وەربگێڕە بۆ زمانەکەی خۆت.
دەتەوێت بەشداربیت لە گەشەپێدان؟
گەڕان لە کۆدەکەدا بکە، سەیری تەمارگەی (SVN) بکە، یان بەشداربە لە ڕووداوتۆماری گەشەپێدان لە ڕێگەی (RSS).
ڕووداوتۆمارگەریی گۆڕین
1.1.3
Bug Fixes
* stop an empty path from matching every server (00ae461)
1.1.2
Bug Fixes
* point the admin bar at the info page and escape rendered output (ec0ed92)
1.1.1
- Bugfix: Removed a fatal error caused by wrong hook
1.1.0
- Feature: Identify environment by hostname
- Feature: Tool page with overview of all defined environments
1.0.0
- Submitted to wordpress.org plugin repo version