Skip to content

[WIP] Add integration with Cloudflare Turnstile for form block#2832

Merged
Soare-Robert-Daniel merged 13 commits into
developmentfrom
codex/integration-cloudflare-turnstile
Jun 16, 2026
Merged

[WIP] Add integration with Cloudflare Turnstile for form block#2832
Soare-Robert-Daniel merged 13 commits into
developmentfrom
codex/integration-cloudflare-turnstile

Conversation

@Codex

@Codex Codex AI commented May 28, 2026

Copy link
Copy Markdown

Changes

  • Add Cloudflare Turnstile integration.

How to test

  1. Have a Cloudflare Account account where you can get a Turnstile API keys for your domain. (Figure 1)
  2. Insert an Otter Form and add captcha via the new Captcha block. (Figure 2)
  3. Insert the API Key for Turnstile
  4. You should see in the page the captcha integration. (Figure 3)
  5. It should look like: https://optimole-sample-bug.instawp.co/form/

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

CleanShot 2026-05-29 at 14 23 51@2x

Figure 2: Captcha block in the form

CleanShot 2026-06-12 at 15 54 20@2x

Figure 3: Captcha rendering

CleanShot 2026-05-29 at 14 10 27@2x

@Codex Codex AI linked an issue May 28, 2026 that may be closed by this pull request
@Codex Codex AI requested a review from Soare-Robert-Daniel May 28, 2026 14:42
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review May 29, 2026 07:04
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label May 29, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label May 29, 2026
@pirate-bot

pirate-bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.5 MB 1.51 MB 6.1 KB (0.40%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 109.65 KB 111.06 KB 1.41 KB (1.28%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 322.45 KB 322.45 KB 0 B (0.00%)

@pirate-bot

pirate-bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 74534df is ready 🛎️!

Codex AI and others added 2 commits May 29, 2026 10:36
Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>
@pirate-bot

pirate-bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"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}

@Soare-Robert-Daniel Soare-Robert-Daniel force-pushed the codex/integration-cloudflare-turnstile branch from aa467a9 to 02bfb6e Compare May 29, 2026 09:13
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 254e74d into development Jun 16, 2026
16 of 17 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the codex/integration-cloudflare-turnstile branch June 16, 2026 14:47
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration with Cloudflare Turnstile

3 participants