-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Problem Description
Gravity Forms Zero Spam plugin incorrectly marks legitimate form submissions as spam when forms are displayed inside Elementor Popups, while the same forms work correctly when embedded directly on pages.
Environment
- WordPress: Latest version
- Gravity Forms: Active and configured
- Gravity Forms Zero Spam: Active (latest version)
- Elementor: Active with Popup feature
Current Behavior
-
Form embedded directly on page: β Works correctly
- Legitimate submissions are delivered
- Spam is blocked
-
Same form in Elementor Popup: β Fails
- Legitimate submissions marked as spam
- Submissions end up in spam folder
- Works only when Zero Spam plugin is disabled
Expected Behavior
Forms should work identically whether embedded directly on a page or displayed in an Elementor Popup. Legitimate submissions should not be marked as spam regardless of the display method.
Root Cause Analysis
The issue appears to be related to JavaScript initialization timing. Elementor Popups load content dynamically via AJAX/JavaScript, which likely prevents Gravity Forms Zero Spam from properly initializing its spam protection mechanisms on the form.
Steps to Reproduce
- Install and activate WordPress with Elementor, Gravity Forms, and Gravity Forms Zero Spam
- Create a Gravity Form with standard fields
- Embed the form directly on a page and test submission (should work correctly)
- Create an Elementor Popup and add the same form to it
- Trigger the popup and submit the form
- Check spam folder - legitimate submission will be marked as spam
Proposed Solution Approaches
- JavaScript Re-initialization: Hook into Elementor's popup events to reinitialize Zero Spam when popup opens
- Event Delegation: Use event delegation for spam protection instead of direct binding
- Mutation Observer: Detect when forms are added to DOM and initialize protection
- Elementor Integration: Add specific compatibility layer for Elementor Popups
Code Investigation Areas
gravityforms-zero-spam.php- Main plugin file, initialization logic- JavaScript files handling form validation and spam checks
- Hook/filter implementations for form rendering
- Event binding mechanisms
Testing Requirements
- Test with various Elementor Popup trigger types (on load, on click, on scroll)
- Test with multiple forms in different popups
- Test with nested popups if applicable
- Verify spam protection still blocks actual spam
- Cross-browser testing (Chrome, Firefox, Safari, Edge)
Additional Context
This issue affects multiple client websites in production environments. A quick fix or workaround would be highly valuable while a permanent solution is developed.