Simple Cloudflare Turnstile — 使用方便的 CAPTCHA 替代解決方案

外掛說明

輕鬆將 Cloudflare Turnstile 人機驗證功能加入 WordPress 功能表單中,並保護他們不受垃圾訊息侵擾。

這是方便使用、具備隱私保護的 reCAPTCHA 替代解決方案。

支援的功能表單

網站管理員目前可以在下列功能表單中啟用 Cloudflare Turnstile 人機驗證功能:

WordPress

  • 登入表單
  • 註冊表單
  • 重設密碼表單
  • 留言表單

WooCommerce

  • 結帳頁面
  • 前往付款
  • 登入表單
  • 註冊表單
  • 重設密碼表單

聯絡表單外掛

  • WPForms
  • Fluent Forms
  • Contact Form 7
  • Gravity Forms
  • Formidable Forms
  • Forminator Forms

其他整合項目

  • Elementor Pro 聯絡表單
  • Mailchimp for WordPress 聯絡表單
  • BuddyPress 註冊表單
  • bbPress 建立主題及回覆表單
  • Ultimate Member 功能表單
  • wpDiscuz 自訂留言表單

什麼是 Cloudflare Turnstile?

Cloudflare Turnstile 為網站訪客提供無障礙、不需驗證碼的網站體驗。

Turnstile 在沒有個人資料隱私問題或 CAPTCHA 造成的糟糕使用者體驗的狀況下,可以防止網站遭到濫用,並且協助確認網站訪客為真人。

進一步了解:https://www.cloudflare.com/zh-tw/products/turnstile/

快速入門

以下是快速簡易的 Cloudflare Turnstile 入門指南。

  1. 只要在 Cloudflare 帳號中產生 [網站金鑰] 及 [秘密金鑰],並在外掛設定頁的對應欄位中輸入並儲存。
  2. 選取要加入 Cloudflare Turnstile 人機驗證功能的功能表單,並點擊 [儲存]。
  3. 請點擊 [測試 API 回應] 按鈕,確認 Turnstile API 正確執行。
  4. 全新的 Cloudflare Turnstile 驗證便會顯示在要使用人機驗證的功能表單,保護這些功能表單免遭濫用。

如需更詳盡的說明,請參閱外掛設定指南

這個外掛是否免費提供使用?

是的,這個外掛不會有付費版本,完全免費使用,也不會追蹤任何資料。Cloudflare Turnstile 同樣是完全免費的服務。

請以撰寫外掛評論贊助外掛開發工作的方式提供協助。

本地化

這個外掛目前有 8 個本地化版本,感謝全體本地化貢獻者。如果你想要協助這個外掛本地化為你的母語版本,請點擊這裡

其他資訊

螢幕擷圖

  • 在 WordPress 登入表單中的人機驗證功能
  • 在 WordPress 註冊表單中的人機驗證功能
  • 在 WordPress 留言表單中的人機驗證功能
  • 在 WooCommerce [我的帳號] 頁面中的人機驗證功能
  • 在 WooCommerce 結帳表單中的人機驗證功能
  • 在聯絡表單中的人機驗證功能
  • 外掛設定頁面

安裝方式

  1. 將外掛安裝壓縮檔解壓縮所得的 simple-cloudflare-turnstile 資料夾上傳至網站的 /wp-content/plugins/ 目錄中。
  2. 在 WordPress 管理後台的 [外掛] 選單中啟用外掛。
  3. 在 WordPress 管理後台中,前往 [設定]→[Cloudflare Turnstile] 設定外掛以符合需求。
  4. 請在 Clourflare 帳號中產生 [網站金鑰] 及 [秘密金鑰],並在外掛設定頁中輸入。
  5. 選取要啟用 Cloudflare Turnstile 人機驗證功能的功能表單,然後點擊 [儲存設定]。
  6. 最後還需要對小工具進行快速測試。請點擊 [測試 API 回應] 按鈕,確認 API 正確執行。
  7. 全新的 Cloudflare Turnstile 驗證便會顯示在要使用人機驗證的功能表單,保護這些功能表單免遭濫用。

如需更詳盡的說明,請參閱外掛設定指南

使用者評論

2023 年 3 月 10 日
Very simple to implement in your WordPress website the captcha of the future, Turnstile.
2023 年 3 月 9 日
After a year of problem-free operation, my CAPTCHA 4WP (free version) plugin seemed to lose the fight against some spam bots and I was getting new spam registrations in each 30 min (even with max score). Installed SCT and problem was solved immediately. Thanks.
2023 年 3 月 7 日
Δουλεύει, τουλάχιστον για το registration spam που χρειαζόμουν, ένα μικρό μειονέκτημα, ο τίτλος στο κουμπί "Επαναπροσδιορισμός κωδικού" που μπορεί να μπερδέψει κάποιον κατα την ολοκλήρωση της εγγραφής. Κατα τα άλλα, απλή εύκολη αποτελεσματική λύση.
2023 年 3 月 4 日
From a user perspective, Turnstile is an improvement over recaptcha. It took just minutes to install and so far it is working good. Works fine in Chrome, Safari, Netscape, and Edge. I was able to turn off recaptcha for WooCommerce and use Simple Cloudflare Turnstile instead.
閱讀全部 53 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Simple Cloudflare Turnstile — 使用方便的 CAPTCHA 替代解決方案〉的開發相關工作。

參與者

〈Simple Cloudflare Turnstile — 使用方便的 CAPTCHA 替代解決方案〉外掛目前已有 7 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Simple Cloudflare Turnstile — 使用方便的 CAPTCHA 替代解決方案〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

Version 1.17.3 – 10th March 2023

  • Tweak: The “Language” setting options are now localized.
  • Tweak: The “cfturnstile.css” file is now only loaded when required.
  • Fix: Added a check to prevent PHP warning when there is an API error.

Version 1.17.2 – 24th February 2023

  • New: Added support for the new “data-language” attribute available with Turnstile. A default language can now be selected in the settings.
  • Tweak: Added “data-action” attribute to Turnstile widget, which will allow you to see more detailed analytics in your Cloudflare dashboard.
  • Tweak: Some improvements to code (added universal “cfturnstile_form_disable” function).
  • Tweak: Added NULL check to force render script.
  • Fix: Fixed “Uncaught TypeError” JS error when Turnstile enabled on comments form.
  • Fix: Fixed potential console error due to unknown parameter sent to Cloudflare API.
  • Fix: Fixed issue with multisite compatibility.

Version 1.17.1 – 27th December 2022

  • Tweak: Edited the filter used for WooCommerce login authentication, and fixed Turnstile challenge being checked twice when both WP Login and Woo Login enabled.

Version 1.17.0 – 20th December 2022

  • New: Added integration for the WooCommerce “Pay for Order” form.
  • New: Added “Disabled Form IDs” option for “Forminator Forms” integration.
  • Tweak: Added “After Form” option to elementor forms integration “Widget Location” setting. This will display the widget better on certain types of form layouts.
  • Tweak: When submitting WPForms form, if there is an error, the Turnstile widget will now reset and re-verify.
  • Tweak: On Elementor forms, wpDiscuz forms, and Forminator forms, Turnstile will now re-render on submission.
  • Tweak: The code for the “Disable Submit Button” option now uses vanila javascript instead of jQuery, and the JS file will only be loaded if the option is enabled.
  • Tweak: Turnstile on WordPress login will now work better with plugins that hide/change the admin login URL.
  • Tweak: WordPress Login and Register will skip Turnstile check for XMLRPC requests.
  • Tweak: Edited the filter used for WordPress login authentication.
  • Fix: Fixed issue with Turnstile widget not showing in some cases with the Contact Form 7 integration “Enable on all CF7 Forms” option enabled, since CF7 version 5.7.
  • Fix: Fixed “Disable Submit Button” not working with the new “Forminator” plugin integration.
  • Fix: Fixed “One or more fields have an error.” message sometimes showing on Contact Form 7 integration with Turnstile enabled.
  • Fix: Fixed issue with the “bbPress” integration “alignment” option no longer working, since a recent update.

Version 1.16.0 – 8th December 2022

  • New: Added integration with the “Forminator” plugin.
  • Tweak: Added a check in the scripts for showing Turnstile on Elementor, to prevent a possible console error.
  • Fix: Fixed error with Turnstile widget not showing on Elementor forms with the “Before” option selected for “Widget Location”.

Version 1.15.4 – 30th November 2022

  • Tweak: Implemented the new “data-retry-interval” attribute for Turnstile widget when displayed on Elementor forms.
  • Fix: Turnstile widget now works properly with multiple Elementor forms on the same page, as long as each form has a unique “name”.

Version 1.15.3 – 27th November 2022

  • Fix: Fixed Turnstile widget no longer rendering for some sites with certain optimisations enabled since 1.15.0 update.

Version 1.15.2 – 26th November 2022

  • Fix: Fixed “Call to undefined function is_plugin_active()” error showing on some sites since 1.15.0 update.

Version 1.15.0 – 26th November 2022

  • New: Added option to choose where exactly the Turnstile widget is displayed on WooCommerce checkout. Also updated code so adding it directly before the place order button now works.
  • Tweak: Turnstile widget will now re-render on WooCommerce checkout, if any changes are made (checkout cart info reloads via js/ajax).
  • Tweak: Minified the inline script for rendering Turnstile, and this now uses vanila javascript instead of jQuery.
  • Tweak: Updated all forms to have completely unique Turnstile IDs, even if same form is displayed twice on same page (popups etc). This should prevent issues with Turnstile not loading properly on one of them.
  • Tweak: Integrations should now work properly on WordPress multisite installations.
  • Tweak: Implemented the new “data-retry-interval” attribute for Turnstile widget when displayed on WordPress comments.
  • Other: Removed some redundant code for the “cfturnstile_scripts” option that was removed previously.

Version 1.14.0 – 17th November 2022

  • New: Added option to enable Turnstile on ALL forms created with Contact Form 7, instead of having to add it individually.
  • Tweak: Implemented the new “data-retry-interval” attribute to speed up time it takes to retry on failure.
  • Tweak: Turnstile will now work better/correctly with multiple forms displayed on the same page.
  • Fix: Fixed error with Turnstile enabled on CF7 multi-step forms.
  • Other: Tested with WordPress 6.1.1

Version 1.13.2 – 11th November 2022

  • Fix: Changed the code for wpDiscuz integration, so Turnstile loads properly for comment replies, and only attempt to enqueue scripts once.

Version 1.13.1 – 4th November 2022

  • Fix: Fixed Turnstile widget not showing on comments form for some sites that have certain optimisations enabled.

Version 1.13.0 – 4th November 2022

  • New: Added integration with “Ultimate Member” login, register, and password reset forms.
  • Fix: Fixed ‘Unknown parameter passed to api.js: “?ver=…”‘ console warning that was showing.

Version 1.12.4 – 3rd November 2022

  • Fix: Fixed a bug with widget showing twice for contact form 7 on some sites.

Version 1.12.3 – 3rd November 2022

  • Fix: Added check to see if jQuery is undefined, and fix error if so.

Version 1.12.2 – 2nd November 2022

  • Tweak: Removed “Where to load scripts?” option, since it will now accurately only load the scripts on pages that Turnstile is showing.
  • Tweak: Tweaks to the WordPress comments validation code.
  • Other: Tested with WordPress 6.1

Version 1.12.1 – 30th October 2022

  • Fix: Fixed a bug/issue on settings page for new installs (since last update).

Version 1.12.0 – 30th October 2022

  • New: Added “Disabled Form IDs” option for “Fluent Forms”, “Gravity Forms”, “WPForms”, and “Formidable Forms” integrations.
  • New: Added a “Widget Location” option to the “Formidable Forms” and “Elementor Forms” integrations.
  • New: Added option to set your own custom error message, shown when the user submits the form with a failed Turnstile challenge.
  • Tweak: A few small changes to the admin settings page.
  • Fix: Fixed “PHP Deprecated” warning with Elementor integration enabled.

Version 1.11.0 – 29th October 2022

  • New: Added integration with “Formidable” forms. Simply enable it in the settings, and Turnstile will be added to all your forms.

Version 1.10.0 – 28th October 2022

  • New: Added integration with “Elementor” Pro forms. Simply enable it in the settings, and Turnstile will be added to all your forms.

Version 1.9.0 – 28th October 2022

  • New: Added integration with “wpDiscuz” plugin.

Version 1.8.6 – 27th October 2022

  • New: Added a “Widget Location” option to the “WPForms” and “Gravity Forms” integrations, to choose if the widget is shown before or after the button.
  • Tweak: Updated alignment of Turnstile widget when displayed on frontend pages (moved 2px to left).

Version 1.8.5 – 27th October 2022

  • Tweak: It will now only try to re-render Turnstile widget explicitly (embedded JavaScript) if it can’t currently find the Turnstile widget iFrame.

Version 1.8.4 – 26th October 2022

  • New: Added a fourth “Auto Detect + Custom Page IDs” option to the “Where to load scripts?” setting.
  • Improvement: Updated the admin settings page to only show settings/dropdowns for integrations that are available (plugins activated and installed). A compact list of the other available integrations is still visible at the bottom.
  • Dev: Updated some of the comments in the code to be more readable.

Version 1.8.3 – 25th October 2022

  • New: Added a third “Custom Page IDs” option to the “Where to load scripts?” setting. This lets you enter the specific page IDs that you want the scripts to load on.

Version 1.8.2 – 24th October 2022

  • New: Added option to select where the Turnstile script is loaded. Either “Auto Detect” or “All Pages”.
  • Tweak: “Auto Detect” will also load the required scripts on blog posts that include forms.

Version 1.8.1 – 24th October 2022

  • Fix: Fixed issue with admins not being able to reply to comments in the admin area, when Turnstile was enabled on the comments form.

Version 1.8.0 – 24th October 2022

  • New: Added integration with “Gravity Forms” plugin. Simply enable it in the settings, and Turnstile will be added to all your forms.
  • Tweak: Added some code to ensure the Cloudflare widget is rendered when sites have certain optimisations enabled.
  • Fix: Fixed error with WPForms emails still being sent if Turnstile fails.

Version 1.7.0 – 22nd October 2022

  • New: Added integration with “Fluent Forms” plugin. Simply enable it in the settings, and Turnstile will be added to all your forms.
  • Tweak: Improved alignment of the Turnstile widget when displayed on Contact Form 7.
  • Fix: Fixed a string that was missing localisation.

Version 1.6.2 – 21st October 2022

  • Fix: Fixed some strings that were missing localisation.
  • Fix: Fixed “Cannot modify header information – headers already sent” error showing on some sites when activating plugins.

Version 1.6.1 – 21st October 2022

  • Tweak: Small tweaks to admin settings page styling.
  • Fix: Fixed to the “Test API Response” step. It should now properly block Turnstile from loading on the login page until it’s successfully tested (new activations only).

Version 1.6.0 – 21st October 2022

  • New: Added integration with “bbPress” create topic and reply forms.
  • New: Added a new “Test API Response” step to the settings page, whenever the API keys are updated to make sure it’s working. Turnstile will not work on your login forms until the test is successfully complete.
  • Tweak: Changed the way the error message is shown for WordPress comments.
  • Fix: Fixed issue with Turnstile verification not working correctly on checkout if “Create an account?” was selected.

Version 1.5.1 – 20th October 2022

  • Tweak: Removed the “Disable Submit Button” feature for the “WooCommerce Checkout” form button, to prevent issues with it sometimes not working.
  • Fix: Fixed “Call to undefined function is_plugin_active()” error showing on some sites.
  • Fix: Fixed styling/scripts not loading on admin page on first load.

Version 1.5.0 – 20th October 2022

  • New: Added integration with “WPForms” plugin. Simply enable it in the settings, and Turnstile will be added to all your forms.
  • Tweak: Updated the design of admin settings page slightly.
  • Fix: Fixed issue causing “Disable Submit Button” option to not work on some sites.

Version 1.4.0 – 19th October 2022

  • New: Added integration with “MC4WP: Mailchimp for WordPress”. You can now add Turnstile to any MC4WP form. Just add the shortcode: [mc4wp-simple-turnstile]

Version 1.3.0 – 18th October 2022

  • New: Added integration with “BuddyPress” registration form.
  • Other: Restructured some of the code.

Version 1.2.2 – 18th October 2022

  • Tweak: Upon submitting checkout form, if there is an error, it will now automatically reset Turnstile challenge token.

Version 1.2.1 – 18th October 2022

  • Tweak: Update so the the required scripts are only loaded on pages that need it.
  • Tweak: Added an “Auto” option to the “Theme” setting.
  • Tweak: Upon submitting contact form 7, it will now automatically reset Turnstile challenge token.
  • Fix: Fixed some strings with wrong text domain, that could not be translated.
  • Fix: Fixed settings link in plugins list not working.

Version 1.2.0 – 17th October 2022

  • New: Added integration with “Contact Form 7”. You can now add Turnstile to any CF7 forms. Just add the shortcode: [cf7-simple-turnstile]

Version 1.1.2 – 17th October 2022

  • New: Added a “Disable Submit Button” option. When enabled, the submit button for all forms will be disabled until the Turnstile widget says “Success”.
  • Tweak: The turnstile script will now load correctly when using a custom wp-login URL.
  • Tweak: Added a redirect to settings page on activation.
  • Tweak: Hidden WooCommerce form settings if it is not installed or activated.

Version 1.1.1 – 15th October 2022

  • Fix: Fixed PHP error sometimes showing when WooCommerce is not installed.

Version 1.1.0 – 15th October 2022

  • New: Added option to enable Turnstile on WordPress comments form.

Version 1.0.0 – 15th October 2022

  • Plugin Released