• Hi,
    I noticed when using cf7 on sites running the 2024 theme, there is a bug that causes duplicate feedback and potentially double submission, breaking captchas and lots of other extensions. This is caused by wp-polyfill-importmap.js triggering multiple DOMContentLoaded events when the browser used is missing support for importmaps.

    I have tested this with all plugins and caching disabled, running only 2024 theme and cf7.

    This happening on safari mobile as well as safari for MacBook and probably some other browsers.

    Here is a trace of what’s happening, ignore the unrelated event-manager-scripts.js errors:

    [Log] Trace
    	FA (wp-polyfill-importmap.min.js:597)
    	(anonymous function) (wp-polyfill-importmap.min.js:602)
    	asyncFunctionResume
    	(anonymous function)
    	promiseReactionJobWithoutPromise
    [Log] Trace
    	(anonymous function) (index.js:2)
    	forEach
    	m (index.js:2)
    	(anonymous function) (index.js:2:3595)
    	forEach
    	(anonymous function) (index.js:2:3579)
    [Error] ReferenceError: Can't find variable: EM
    	(anonymous function) (event-manager-scripts.js:9)
    [Log] Trace
    	FA (wp-polyfill-importmap.min.js:597)
    	promiseReactionJob
    [Log] Trace
    	(anonymous function) (index.js:2)
    	forEach
    	m (index.js:2)
    	(anonymous function) (index.js:2:3595)
    	forEach
    	(anonymous function) (index.js:2:3579)
    	dispatchEvent
    	FA (wp-polyfill-importmap.min.js:598)
    	promiseReactionJob
    [Error] ReferenceError: Can't find variable: EM
    	(anonymous function) (event-manager-scripts.js:9)
    	dispatchEvent
    	FA (wp-polyfill-importmap.min.js:598)
    	promiseReactionJob
    [Log] Trace
    	FA (wp-polyfill-importmap.min.js:597)
    	(anonymous function) (wp-polyfill-importmap.min.js:602)
    	asyncFunctionResume
    	(anonymous function)
    	promiseReactionJobWithoutPromise

    I was able to patch this locally by adding a basic check to the DOMContentLoaded handler in contact-form-7/includes/js/index.js file to only run once:

    document.addEventListener("DOMContentLoaded",(e=>{ window.mCalled = window.mCalled || false; if(window.mCalled) return; window.mCalled = true; console.log('wpcf7 dom content loaded');var t;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)...
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see the website in question?

    Hi. I’m seeing same issue, but have been for a while. I see the double span in the page source and the double validation messages to the user and also 2 emails for each form submission.

    I use Flamingo to track persist form submissions and we have been seeing this issue for many months.

    We use Total theme.

    WP 6.5.3
    Total 5.15
    CF7: 5.9.5
    PHP 7.4.33

    Thread Starter pk385

    (@pk385)

    Where can we see the website in question?

    sent you a dm on slack with the url @takayukister

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.