| 开发者 | webknitdigital |
|---|---|
| 更新时间 | 2026年10月30日 17:04 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
WP_ENVIRONMENT_TYPE setting.localhost, 127.0.0.1, or a domain ending in .local, .test, .localhost, .example or .invalid.webknit_environment_indicator_environment filter.
Settings are saved per site URL
When you clone a site, its database (and this plugin's settings) goes with it. To stop a "Staging" setting from ending up on your live site after a push to production, settings are stored separately for each site URL. Settings saved for a different URL are never applied; the settings page shows a URL mismatch warning and asks you to configure the site again.
/wp-content/plugins/webknit-environment-indicator, or install through the WordPress plugins screen directly.WP_ENVIRONMENT_TYPE in wp-config.php.Guessing from names like staging. or dev., or from the .dev domain, can be wrong, and a wrong guess would put a "Staging" badge on a live site. That's exactly the mistake this plugin exists to prevent, so it only acts on addresses that can never be a public site (such as localhost, .local and .test). For everything else, choose the environment in the settings or set WP_ENVIRONMENT_TYPE.
The settings in the database were saved on a different site URL, so they are not applied here. Choose the environment for this URL and save. Settings left behind for other URLs are never used here, and are deleted if you uninstall the plugin.
Yes. Set "Show badge on front end" to No. The badge still shows in wp-admin and on the login page.
Define it in wp-config.php:
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
Or use the filter:
add_filter( 'webknit_environment_indicator_environment', function () { return 'staging'; } );
No, it warns you. If the site isn't production and "Discourage search engines from indexing this site" (Settings → Reading) is off, you'll see a warning on the plugin's settings page and on the Dashboard, Plugins and Reading screens. It also warns the other way round: when the site is set as production but search engines are discouraged, which often happens after a staging site is pushed live. The plugin never changes that setting itself. For real protection, put staging sites behind a password.
No. It's a Webknit Digital plugin that reads WordPress's own WP_ENVIRONMENT_TYPE setting when you have one.