[WIP] Add integration with Cloudflare Turnstile for form block#2832
Merged
Soare-Robert-Daniel merged 13 commits intoJun 16, 2026
Conversation
Contributor
Bundle Size Diff
|
Contributor
|
Plugin build for 74534df is ready 🛎️!
|
Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>
Contributor
E2E TestsPlaywright Test Status: See serial and parallel matrix jobs Performance ResultsserverResponse: {"q25":473.7,"q50":503.45,"q75":515,"cnt":10}, firstPaint: {"q25":544.9,"q50":646.4,"q75":760.9,"cnt":10}, domContentLoaded: {"q25":3471.7,"q50":3523.4,"q75":3563.8,"cnt":10}, loaded: {"q25":3473.8,"q50":3525.45,"q75":3566,"cnt":10}, firstContentfulPaint: {"q25":4012.9,"q50":4084.35,"q75":4116.9,"cnt":10}, firstBlock: {"q25":14128.2,"q50":14298.2,"q75":14409.5,"cnt":10}, type: {"q25":22.63,"q50":24,"q75":26.01,"cnt":10}, typeWithoutInspector: {"q25":20.6,"q50":22.29,"q75":25.05,"cnt":10}, typeWithTopToolbar: {"q25":29.39,"q50":30.81,"q75":31.85,"cnt":10}, typeContainer: {"q25":13.39,"q50":14.11,"q75":15.82,"cnt":10}, focus: {"q25":115.28,"q50":120.09,"q75":124.32,"cnt":10}, inserterOpen: {"q25":37.26,"q50":38.87,"q75":40.07,"cnt":10}, inserterSearch: {"q25":13.31,"q50":13.52,"q75":13.84,"cnt":10}, inserterHover: {"q25":5.75,"q50":5.89,"q75":6.01,"cnt":20}, loadPatterns: {"q25":1536.13,"q50":1580.17,"q75":1623.07,"cnt":10}, listViewOpen: {"q25":218.54,"q50":227.69,"q75":238.59,"cnt":10} |
aa467a9 to
02bfb6e
Compare
…ion-cloudflare-turnstile # Conflicts: # packages/e2e-tests/mu-plugins/otter-e2e-bootstrap.php
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Soare-Robert-Daniel
added a commit
that referenced
this pull request
Jun 16, 2026
Integrate the Cloudflare Turnstile captcha feature (#2832) with the form submission retention work. Conflict resolutions: - class-form-server.php: union the captcha-verification guard (form_has_captcha() + token present + no prior error) and keep the infrastructure-failure handling (mark_infrastructure_failure on is_wp_error/non-200), which subsumes development's simpler is_wp_error check. - otter-e2e-bootstrap.php: keep both captcha mocks — scenario-mode mock_captcha_provider (recaptcha) and stub_captcha_http_verification_for_e2e (recaptcha + turnstile). The /captcha endpoint now also sets a dummy recaptcha secret for active scenario modes so the merged empty($secret) gate doesn't short-circuit. - playwright.config.js: keep both serial specs (form-retention, form-turnstile). Also fix a pre-existing race in the form block surfaced by the merged behavior: a late/duplicate server load could migrate the legacy submissionsSaveLocation value back over an Email Notification toggle the user had just changed. A notificationDirty ref now preserves the edited value once dirty. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
How to test
Notes for tester
In my hosted instance I found that the current otter forms seams to no work reliable; thus you might encounter some issues on this one.
The #2856 seams to work nicely and it will integration with this once it is tested.
Figure 1: Turnstil setup in Cloudflare
Figure 2: Captcha block in the form
Figure 3: Captcha rendering