-
Notifications
You must be signed in to change notification settings - Fork 1
Add Honeypot and No-JS Field for Spam Prevention #139
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
Conversation
…nd deprecated few functions.
|
@iamdharmesh I see this PR is opened against |
Yes, @dkotter. I had used |
dkotter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor things but marking this as approved so it can move to QA
| * Initialize the class. | ||
| */ | ||
| public function init() { | ||
| // TODO: Update this to use ajax handler hook instead of init. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO still valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have kept this to replace this init action with specific ajax action. This was on init to handle form submission via HTML and JS both. However, with #126 we enabled the form submission with JS only, So, we are good to replace this to listen specific ajax action only. Maybe better to handle this with validation improvements PR, to keep this PR moving.
| if ( ! headers_sent() ) { // just in case... | ||
| header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT', true, 200 ); | ||
| } | ||
| // TODO: Refactor this to use JSON response instead of setting a global message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should work on this along with validation improvements.
Regression / Smoke Test Report ✅Tested with the Testing Environment
Next Step- Ready to Merge 🚀 |



Description of the Change
This PR adds a honeypot field and a no-JS field to the form to help detect and prevent potential spam bots. Additionally, it moves the form submission handling code into the form submission class to unify the form handling logic for block forms and shortcode/widget forms. This refactor improves the overall codebase and simplifies future enhancements.
(Note: As we already have an open PR for validation function improvements, those functions were not modified here to avoid potential conflicts.)
PR also adds the needed filter hook to allow adding support for the "WP Armour – Honeypot Anti Spam" plugin as requested in #127
Closes #120
Closes #138
Closes #127
How to test the Change
Follow these steps for testing the form block, shortcode form, and widget form:
jQuery('input[name="mailchimp_sf_alt_email"]').val("123");Changelog Entry
Credits
Props @jeffpaul @dkotter @iamdharmesh
Checklist: