Title: WP Shield
Author: drupalmatts
Published: <strong>2019 年 11 月 24 日</strong>
Last modified: 2023 年 12 月 6 日

---

搜索插件

![](https://ps.w.org/wp-shield/assets/banner-772x250.png?rev=2199969)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/wp-shield/assets/icon.svg?rev=2199969)

# WP Shield

 作者：[drupalmatts](https://profiles.wordpress.org/drupalmatts/)

[下载](https://downloads.wordpress.org/plugin/wp-shield.1.6.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-shield/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-shield/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-shield/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-shield/#developers)

 [支持](https://wordpress.org/support/plugin/wp-shield/)

## 描述

This plugin will allow you to secure your development, staging and UAT environments

with an http authentication block that can be controlled in admin but also turned
off via a declared variable in your config file. It allows you to bring your Database
back to non-production environments without having to physically turn off the plugin
each time.

Variable: `define('WP_SHIELD_UN', '');`

This simple line of code (recommended to add to a file ignored by your code management

software and required into your wp_config.php file) will override the enabled flag
if the plugin’s settings. Enable in production and add the above code. If that require
file doesn’t exist in your other environments, it will prompt users for the set 
username and password.

## 安装

 1. Download WP Shield from the WordPress plugin directory
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Use the Settings->’WP Shield’ screen to configure the plugin
 4. Enter the username and password you want use for the shield
 5. Check the enabled checkbox and Submit
 6. Add the following code to your wp_config.php file:
 7.     ```
        if(file_exists('shield-settings.php')) {
          include('shield-settings.php');
        }
        ```
    

For production environments:
 7. Add the above snippet of code to the shield_settings.
php file in the root of your WordPress installation.

NOTE: Depending on your setup you may need to add one of the following to your .
htaccess
 or apache conf file:

**.htaccess**

    ```
    RewriteRule .* index.php [QSA,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    ```

**Apache conf**

    ```
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ```

## 常见问题

TBD

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP Shield」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ drupalmatts ](https://profiles.wordpress.org/drupalmatts/)

[帮助将「WP Shield」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-shield)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-shield/)，查看[SVN仓库](https://plugins.svn.wordpress.org/wp-shield/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/wp-shield/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-shield/)。

## 更新日志

#### 1.0

 * Initial release of the Plugin

#### 1.2

 * Add code to bypass shield on WP-CLI calls

#### 1.3

 * Update readme for authorization setup

#### 1.4

 * Fix for caching of credentials

#### 1.5

 * Tested and confirmed for WordPress 6.1

#### 1.6

 * Tested and confirmed for WordPress 6.4

## 额外信息

 *  版本 **1.6**
 *  最后更新：**3 年前**
 *  活跃安装数量 **40+**
 *  WordPress 版本 ** 4.6 或更高版本 **
 *  已测试的最高版本为 **6.4.8**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-shield/)
 * 标签
 * [development](https://cn.wordpress.org/plugins/tags/development/)[environments](https://cn.wordpress.org/plugins/tags/environments/)
   [security](https://cn.wordpress.org/plugins/tags/security/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-shield/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/wp-shield/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-shield/reviews/)

## 贡献者

 *   [ drupalmatts ](https://profiles.wordpress.org/drupalmatts/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-shield/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://N/A)