Title: Protected Site
Author: dbhynds
Published: <strong>2011 年 7 月 7 日</strong>
Last modified: 2011 年 7 月 7 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/protected-site.svg)

# Protected Site

 由 [dbhynds](https://profiles.wordpress.org/dbhynds/) 開發

[下載](https://downloads.wordpress.org/plugin/protected-site.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/protected-site/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/protected-site/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/protected-site/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/protected-site/#developers)

 [技術支援](https://wordpress.org/support/plugin/protected-site/)

## 外掛說明

The Protected Site plugin for WordPress allows you to block incoming traffic from
accessing a blog or a specific blog in a network. It requires visitors to log in
before viewing the content of the blog. Only users with valid usernames and passwords
will be permitted to access the blog in question.

## 安裝方式

This section describes how to install the plugin and get it working.

e.g.

 1. Upload `protected-site.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常見問題集

  Why use Protected Site?

It provides an additional layer of privacy for WordPress blogs. Currently, the only
available privacy setting in WordPress is: “I would like my site to be visible to
everyone, including search engines (like Google, Bing, Technorati) and archivers.”
Protected Site allows you to prevent any incoming traffic to your blog unless the
user logs in to WordPress as a valid user for that blog.

  How might Protected Site be used?

The Protected Sites plugin has a variety of uses. For example, a web developer can
use it to prevent traffic to blogs while their still in development. The site admin
can provide a usernames and passwords to the client, designer and other developers
working on the project. This allows them to browse the blog and keep track of progress
as it is being developed. This allows them to provide feedback throughout the development
process, minimizing the need for time-consuming tweaks down the road. Clients can
even begin adding content to the site, so that it’s ready to go the day the site
launches. All the while, the site remains private to all outside traffic.

  How does it work?

To protect a site from incoming traffic, simply install and activate the plugin 
on that site. Once activated, all traffic to the site receive a message alerting
them that they must log in to view the page. Once logged in to WordPress, the user
will be redirected to the page they were attempting to access and can navigate throughout
the site at will. To un-protect a site, simply deactivate the plugin. This plugin
is also compatible with a WordPress Network. Activating it on an individual site
within a network only protects that site. To activate it on all sites and protect
the entire network, choose “Network Activate” in the “Network Admin” section.

  But how exactly does it work?

By adding an action that overrides the get_header(); function. When get_header();
is called in the template, it runs a function that generates the “Login Required”
message, then kills the function. In order to work properly, get_header(); should
be the very first code in your template. Otherwise, and code before the get_header();
function will make it into the source code for your page. This means that if you
open the and tags, then link a CSS stylesheet, the “Login Required” message will
inherit this style. To prevent this, ensure that your header.php file contains the
tag.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Protected Site〉的開發相關工作。

參與者

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

[將〈Protected Site〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/protected-site)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/protected-site/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/protected-site/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/protected-site/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/protected-site/)。

## 變更記錄

#### 1.0

 * Changed action to utilize get_header() function instead of wp_head().
 * Changed doctype to HTML 4.01 Transitional instead of HTML5.
 * Added CSS style to head.

## 中繼資料

 *  版本 **1.0**
 *  最後更新 **15 年前**
 *  啟用安裝數 **30+**
 *  WordPress 版本需求 ** 3.1.3 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.1.4**
 *  語言
 * [English (US)](https://wordpress.org/plugins/protected-site/)
 * 標籤
 * [validation](https://tw.wordpress.org/plugins/tags/validation/)
 *  [進階檢視](https://tw.wordpress.org/plugins/protected-site/advanced/)

## 評分

這個項目尚無任何評論記錄。

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

[查看全部使用者評論](https://wordpress.org/support/plugin/protected-site/reviews/)

## 參與者

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

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/protected-site/)