[WordPress] 外掛分享: Safe Mode

首頁外掛目錄 › Safe Mode
WordPress 外掛 Safe Mode 的封面圖片
100+
安裝啟用
★★★★
4.2/5 分(5 則評價)
2646 天前
最後更新
問題解決
WordPress 3.0.1+ v1.1.3 上架:2012-10-18

內容簡介

此外掛可為 WordPress 啟用安全模式,這意味著:

不會載入任何外掛。
會臨時啟用預設佈景主題(若已安裝)。

為什麼有用?

當 WordPress 網站出現問題時,第一要務就是禁用外掛並回復預設佈景主題。根據錯誤性質,這並非總是可行的。後台(儀表板)也可能掛了,或者您可能沒有 FTP 存取權限手動禁用外掛與佈景主題。

這時就可以使用安全模式。安全模式會完全禁用所有外掛和啟用的佈景主題,只暫時作用於單個頁面,因此可以讓您登入並移除問題外掛。 (這並不保證在所有情況下都有效,請閱讀免責聲明)

它是如何運作的?

如果網站崩潰是因為外掛或佈景主題引起的,只需將查詢字符串參數添加到 URL 即可。這樣做將暫時禁用所有外掛並在已安裝預設佈景主題的情況下啟用佈景主題。

假設您是 www.example.com 的擁有者。要為一個特定頁面啟用安全模式,只需將以下內容添加到 URL 中:“?safe_mode=1”。

請注意,您必須為每個頁面都這樣做。查詢字符串參數不會自動傳遞。例如:

如果您需要登入,請前往:www.example.com/wp-admin/?safe_mode=1
如果您需要進入外掛管理,請前往:www.example.com/wp-admin/plugins.php?safe_mode=1
如果您需要進入佈景主題管理,請前往:www.example.com/wp-admin/themes.php?safe_mode=1

當您進入外掛管理時,所有外掛似乎都已停用(因為安全模式的工作方式),但您仍然可以明確地停用每個外掛。僅需使用“停用(安全模式)”選項。

預設佈景主題是什麼?

預設佈景主題是指隨 WordPress 一起提供的佈景主題,即那些以“Twenty”字樣為開頭的佈景主題。

此外掛會檢查是否安裝了這些佈景主題,並在此情況下啟用第一個遇到的佈景主題。因此,強烈建議您始終安裝其中一個佈景主題。如果您沒有,安全模式將維持您目前啟用的佈景主題,而該佈景主題可能是罪魁禍首,這樣安全模式就毫無效用了。記住這一點。

免責聲明

此外掛可以處理許多情況,但並非所有情況。如果您的網站崩潰是由數據庫崩潰或某些只是導致 PHP 解析器故障的問題(例如對未定義函數的調用)引起的,安全模式將無法解決。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Safe Mode」→ 直接安裝(推薦)

原文外掛簡介

This plugin enables safe mode for WordPress. This means:

No plugins will be loaded.
A default theme will be temporarily activated (if it is installed).

Why is this useful?
Whenever something’s wrong with a WordPress site, the first rule of thumb is to disable plugins and revert to the default theme if possible. Depending on the nature of the error, that is not always an option. The back end (dashboard) may also be down or you may not have FTP access to manually disable plugins and themes.
Enter Safe Mode. Safe Mode will completely disable all plugins and the active theme temporarily for a single page view – ultimately enabling you to log in and remove the offending plugin. (This is not guaranteed to work in all scenarios, please read the disclaimer)
How does it work?
If your site crashes due to an upsetting plugin or theme, all you have to do is add a querystring parameter to the URL. Doing that will temporarily disable all plugins for that single page view, as well as temporarily activate a default theme if one is installed.
Let’s say you’re the owner of www.example.com. To enable safe mode for one particular page, you add this to the URL: “?safe_mode=1”.
Bear in mind that you have to do this for every view. The querystring parameter isn’t carried on automatically. So, for instance:

If you need to log in, go to: www.example.com/wp-admin/?safe_mode=1
If you need to go to plugin management, go to: www.example.com/wp-admin/plugins.php?safe_mode=1
If you need to go to theme management, go to: www.example.com/wp-admin/themes.php?safe_mode=1

When you go to plugin management, all plugins will seem to be deactivated (due to the way Safe Mode works), but you’ll still be able to explicitly deactivate each plugin. Just use the “Deactivate (safe mode)” option.
What are default themes?
By default theme, I’m referring to the themes that ships with WordPress, you know, the Twenty “something” ones.
The plugin checks if any of these themes are installed, and if so, activates the first theme it encounters. Thus I highly recommend that you keep one of those themes installed at all times. If you don’t, safe mode will keep your current active theme, and that theme may just be the offender – leaving safe mode useless. Keep this in mind.
Disclaimer
This plugin will be able to handle many scenarios, but not all. If your site’s crash is caused by a database crash, or something that simply brings down the PHP parser, like a call to an undefined function, Safe Mode won’t be able to do anything about that.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon