• Resolved Kramarz

    (@kramarz)


    After todays’ update (Version 5.4) I had to disable “Defer Render-blocking JS” within SG Optimizer.

    With it enabled CF7 simply does nothing when trying to submit.

    • This topic was modified 5 years, 3 months ago by Kramarz.
    • This topic was modified 5 years, 3 months ago by Kramarz.
Viewing 15 replies - 1 through 15 (of 24 total)
  • Thread Starter Kramarz

    (@kramarz)

    Hmm… Looks like I have to disable “Combine JavaScript Files” as well.

    So, yea, only works if I don’t try to optimize caching JS files too much.

    Hey there, did you get any JS errors or did it not submit?

    Thread Starter Kramarz

    (@kramarz)

    I can tell you what I see in Firefox Console.

    When I enable “Combine JavaScript” Files:

    Uncaught ReferenceError: wp is not defined
    <anonymous> https://www.mywebsite.com/contact-us/:13

    which I believe relates to this in code:

    <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script type='text/javascript' id='wp-api-fetch-js-after'> wp.apiFetch.use( wp.apiFetch.createRootURLMiddleware( "https://www.mywebsite.com/wp-json/" ) );
    wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "c924a5f794" );
    wp.apiFetch.use( wp.apiFetch.nonceMiddleware );
    wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware );
    wp.apiFetch.nonceEndpoint = "https://www.mywebsite.com/wp-admin/admin-ajax.php?action=rest-nonce"; </script>

    Sorry, not too good with debugging stuff like that…

    And when I click submit button:

    XHR POST https://www.mywebsite.com/contact-us/contact-form-7/v1/contact-forms/131/feedback?_locale=user
    [HTTP/2 404 Not Found 505ms]
    {…}
    ​code: "invalid_json"
    ​message: "The response is not a valid JSON response."

    And nothing happens. No error produced in front end by contact form.

    Thread Starter Kramarz

    (@kramarz)

    Similar happens when I turn on “Defer Render-blocking JS”, just points to different lines in code.

    Thread Starter Kramarz

    (@kramarz)

    Also I don’t get it why is it referencing some https://www.mywebsite.com/wp-json/ folder, which does not exist?

    • This reply was modified 5 years, 3 months ago by Kramarz.
    Thread Starter Kramarz

    (@kramarz)

    Also noticed now that Popup Maker plugin integration (auto close popup on submit) does not work anymore… guys… please fix 🙁

    I had the same issue today. Customers would click “send” on my contact form 7 submission form, and the wheel would spin forever. The emails were in fact sending, but no confirmation message appeared on the page, and the wheel just kept spinning. Some of our customers just kept clicking “send” and so we received a ton of duplicate emails.

    I followed the above advice of Kramarz and disabled “Combine JavaScript Files” as well as “Defer Render-blocking JS” in my SG Optimizer plugin and the issue resolved. I needed to disable both for it to work. Obviously not the best long-term solution, but I’m glad my form works properly now.

    Thanks for the heads-up Kramarz!

    Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Both optimizations have excludes – just exclude the js that has issues and keep them on for the rest.

    Thread Starter Kramarz

    (@kramarz)

    @hristo-sg

    Problem is I’m not exactly sure what to exclude… tried to exclude – /plugins/contact-form-7/includes/js/index.js – but as much as contact form seems to work after that, still see errors in console and seems like ajax stops working

    Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    We’ve released a new version of SG Optimizer plugin, which should fix the issues.

    Please update to the latest version and everything should be ok.

    Regards,
    Stanimir

    Thread Starter Kramarz

    (@kramarz)

    @sstoqnov

    Nope, does not seem to help – still just spinning when trying to submit with Defer Render-blocking JS and Combine JavaScript Files enabled – https://www.charismablinds.net/contact-us/

    Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Well please update to 5.7.15 and then check again.

    You are still using version 5.7.14 🙂

    Hello Stanimir,

    Thanks for the quick fix, but it doesn’t work. In fact, now it spins and spins and not only does the confirmation of submission not appear on the page, no email is sent either, whereas just before updating your plugin this morning it would spin forever but actually send the email still. If I disable “Combine JavaScript Files” and “Defer Render-blocking JS” then my form works normally.

    If I exclude all of the contact form 7 related JS scripts in the SG Optimizer dashboard it still doesn’t fix the problem.

    Thanks again for your help.

    I was using 5.7.15

    Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    @ryan8229 please provide your site URL and I will check the issue

Viewing 15 replies - 1 through 15 (of 24 total)

The topic ‘CF7 + Siteground SG Optimizer issue’ is closed to new replies.