Two-Factor

外掛說明

前往 [使用者]→[個人資料] 中的 [兩步驟驗證選項],便能為網站帳號啟用及設定一或多個兩步驟驗證方式:

  • 透過電子郵件傳送驗證碼
  • TOTP 驗證碼 (Time Based One-Time Passwords,以時間為基礎、最通用的演算法)
  • FIDO U2F 安全金鑰 (Universal 2nd Factor,通用第二因素)
  • 備用驗證碼
  • 測試模式 (僅供測試目的使用)

如需進一步了解這個外掛的開發沿革,請參閱這篇文章

動作及篩選器

以下所列為這個外掛提供的動作及篩選器勾點:

  • two_factor_providers 篩選器:這個篩選器會覆寫如電子郵件及 TOTP 等兩步驟驗證方式。陣列值為兩步驟驗證方式的 PHP 類別名稱。
  • two_factor_providers_for_user 篩選器:這個篩選器會覆寫已為特定使用者啟用的兩步驟驗證方式。陣列值的第一個引數是驗證方式類別的執行個體,第二個引數為使用者物件 WP_User
  • two_factor_enabled_providers_for_user 篩選器:這個篩選器會覆寫已為使用者啟用的兩步驟驗證方式清單。第一個引數是已啟用的功能提供程式類別名稱值陣列,第二個引數為使用者 ID。
  • two_factor_user_authenticated 動作:這個動作會接收已登入的 WP_User 物件作為第一個引數,用於完成驗證工作流程後立即確定已登入的使用者。
  • two_factor_user_api_login_enable 篩選器:這個篩選器會限制 REST API 及 XML-RPC 僅能使用應用程式密碼,第二個引數為使用者 ID。
  • two_factor_email_token_ttl 篩選器:這個篩選器會覆寫電子郵件權杖產生後的使用期限 (以秒為單位)。接受第一個引數為以秒為單位的時間間隔設定後,才能驗證 WP_User 物件的 ID。
  • two_factor_email_token_length 篩選器:這個篩選器會覆寫電子郵件權杖預設為 8 個字元的設定。
  • two_factor_backup_code_length 篩選器:這個篩選器會覆寫備用代碼預設為 8 個字元的設定,提供與 WP_User 關聯的使用者作為第二個引數。

螢幕擷圖

  • [個人資料] 頁面中的 [兩步驟驗證選項]
  • [個人資料] 頁面中的 U2F 安全金鑰設定
  • 使用驗證碼產生器 App 產生的驗證碼登入
  • 使用復原代碼登入
  • 使用電子郵件傳送的驗證碼登入

常見問題集

Two-Factor 外掛支援哪些 PHP 及 WordPress 版本?

這個外掛支援 WordPress 最新的 2 個主要版本及這些 WordPress 核心程式所支援的 PHP 最低版本需求

如何針對程式碼錯誤進行意見反應或取得協助?

Two Factor 的 GitHub 待解問題頁面,是回報外掛程式碼錯誤、功能建議及任何 (非安全性相關) 意見反應的最佳集中地。在提交新問題前,請先搜尋現有待解問題中,是否已有其他人回報過類似的問題。

在何處可以回報安全性程式碼錯誤?

外掛參與者及 WordPress 社群對安全性程式碼錯誤一向嚴陣以待,我們非常感謝使用者披露相關發現所付出的心力,並會盡全力解決使用者提出的問題。

如需回報安全性問題,請參考 WordPress HackerOne 計畫。

使用者評論

2025 年 11 月 8 日
The Two-Factor plugin adds reliable two-step verification to your WordPress site. It’s easy to configure, works smoothly with the default login, and supports multiple authentication methods for stronger protection.
2025 年 11 月 5 日
The Two-Factor plugin provides an extra layer of security by adding two-step verification to your WordPress login. It’s simple to configure, reliable, and supports various authentication methods. A great choice for keeping your site safe from unauthorized access.
2025 年 8 月 20 日 3 則留言
A great plugin and absolutely useful and important! Unfortunately, there is a problem that needs to be addressed and resolved: The QR code generated for 2FA apps is reported as incorrect by the 2FAS smartphone app. If you type the code below into the app, everything works fine. This problem did not occur with Google Authenticator. Of course, it seems to be a problem with the 2FAS app, because Google can do it! But shouldn’t the problem be analyzed in more detail on the developer side? I will probably also inform the developer of the app. However, it would certainly be best if the two experts (plugin here and app there) got in touch with each other.
2025 年 7 月 17 日
This plugin made it really easy to add two-factor authentication to my WordPress test site. The interface is clean, and the setup took just a few minutes. Works well with email and TOTP apps like Google Authenticator. A must-have for basic security!
閱讀全部 197 則使用者評論

參與者及開發者

〈Two-Factor〉外掛目前已有 38 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Two-Factor〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

檢視發佈記錄