You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed client-side post-submit logic that injected or updated a hidden recaptcha_checked input based on the AJAX response; the afterFormSubmitted callback flow remains unchanged. (Client-side reCAPTCHA state is no longer modified in this path.)
Changes
Cohort / File(s)
Summary
reCAPTCHA post-submit state handling js/formidable.js
Deleted the block that created/replaced a hidden recaptcha_checked input inside the form container after a successful AJAX submission; no other client-side recaptcha state updates added.
Sequence Diagram(s)
mermaid
sequenceDiagram
participant Browser
participant Server
participant FormHandler
Note over Browser,FormHandler #DDDDFF: Previous flow (before change)
Browser->>FormHandler: Submit form (AJAX)
FormHandler->>Server: Send data
Server-->>FormHandler: response (includes response.recaptcha)
alt response.recaptcha present
FormHandler->>Browser: Insert/Update hidden recaptcha_checked input
end
FormHandler->>Browser: Trigger afterFormSubmitted
mermaid
sequenceDiagram
participant Browser
participant Server
participant FormHandler
Note over Browser,FormHandler #DDFFDD: New flow (after change)
Browser->>FormHandler: Submit form (AJAX)
FormHandler->>Server: Send data
Server-->>FormHandler: response (may include response.recaptcha)
FormHandler->>Browser: Trigger afterFormSubmitted
Note over FormHandler,Browser #FFEEEE: No client-side insertion/update of recaptcha_checked
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
garretlaxton
truongwp
engahmeds3ed
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
Check name
Status
Explanation
Title Check
✅ Passed
The pull request title "Remove old captcha nonce token JS" directly and accurately reflects the main change in the changeset. The title is concise, clear, and specific—it identifies that legacy JavaScript related to captcha nonce tokens is being removed from js/formidable.js. The title is neither vague nor misleading, and it provides sufficient clarity for teammates reviewing the pull request history to understand the primary change at a glance.
Docstring Coverage
✅ Passed
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check
✅ Passed
The pull request description is directly related to the changeset. The author explains that legacy JavaScript for captcha nonce token handling is being removed because the logic is already implemented in PHP, making the client-side code unnecessary. The description also mentions an additional benefit of moving away from jQuery. This rationale aligns well with the documented change of removing post-submit recaptcha handling from js/formidable.js. The description provides meaningful context about the removal rather than being vague or off-topic.
✨ Finishing touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
Commit unit tests in branch remove_old_captcha_nonce_token_js
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
This should have really been in Pro, and it's only required now if people are opting into the old nonce field which isn't likely.
But it looks like this all happens in PHP anyway. This JS isn't necessary, so we can just remove it.
This also helps move use away from jQuery.
🥳