Skip to content

feat: Adding Cloudflare Turnstile support #1273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: preview
Choose a base branch
from

Conversation

soldiereleven
Copy link

通过一些微小的改动使主题支持turnstile,已完成核心代码,测试可以使用

没有完成的部分:
1、国际化字符串
2、测试中发现cloudflare turnstile的验证框会顶到登录框右边,应该可以通过调整css样式解决

@mirai-mamori mirai-mamori changed the base branch from main to preview June 8, 2025 00:44
@mirai-mamori mirai-mamori requested a review from robert1chi June 8, 2025 00:45
@soldiereleven
Copy link
Author

在commit 6d4ec48中,我已经完成国际化和页面调整,另外我注意到登陆页面vcaptcha验证出错的提示并没有做本地化,所以我暂时没有做出错提示的本地化,如需要的话我后期加上。 @robert1chi

@soldiereleven
Copy link
Author

我认为应该为turnstile加载引入占位符号以避免网络不畅时turnstile未能及时加载,我看到vaptcha代码中有这一部分,但是我没能成功移植,css样式太令人困惑了。非常抱歉打扰您。@robert1chi

@robert1chi robert1chi changed the title Turnstile支持 feat: Adding Cloudflare Turnstile support Jun 8, 2025
@robert1chi
Copy link
Collaborator

TODO: function test

@nicocatxzc
Copy link
Contributor

整体没有问题,但是有点小瑕疵,登录页不论是否有登录动作都会提示请完成验证码,即使小组件还没有加载出来

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Cloudflare Turnstile as an alternative captcha solution, updating theme options, language files, and integrating a new Turnstile class along with modifications to login, registration, and lost password flows.

  • New theme options for specifying Turnstile site/secret keys and theme selection.
  • New language entries and modifications to the .pot file to include Cloudflare Turnstile strings.
  • Addition of a Turnstile integration class with corresponding form hooks and validation logic in functions.php.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

File Description
opt/options/theme-options.php Added new captcha options and Turnstile site/secret key settings.
opt/languages/sakurairo_csf.pot Added language entries for Cloudflare Turnstile support.
inc/classes/Turnstile.php Introduced a new class for Cloudflare Turnstile integration.
functions.php Updated login, registration, and lost password flows with Turnstile support.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants