• Resolved mc001

    (@mc001)


    Hi,

    We’re getting infinite loading (with spinning disc) on one of our sites when someone tries to submit an email. We have found that a workaround is to change one line in wp-contact-form-7.php from:

    define( ‘WPCF7_LOAD_JS’, true );

    to

    define( ‘WPCF7_LOAD_JS’, false );

    and then it all works. We’re currently using:

    WP 5.7.2
    PHP 7.4.20
    CF7 5.4.2

    and a large number of other plugins. We realise that the official advice is to turn off all plugins and and then turn them on one by one to debug the issue, but this is not an option for us as this site has to stay up. We also see no error messages in WP’s debug log. We’d be interested to know if anyone who has had the same experience was able to get a fix that dispensed with the workaround above. Thanks.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • anonymized-14293447

    (@anonymized-14293447)

    that “infinite loading” bug has been here since 7.5.3.3 and the solution you are suggesting also has been the only one since then. This confirms that the issue was, sadly, never addressed by the Authors.

    hi @arsenalemusica,
    this kind of issue happens (stated in a simplistic way) when cf7 has “completed” its job, send the email, but it doesn’t receive the response and it keeps running forever.

    Causes can be many, but mainly the ones I’ve been able to verify are 500 errors and smtp configuration.
    You can download from my github a version of scripts.js from cf7 that responds with http error messages if you want to understand better what happens. But this doesn’t really help, because you will notice the issue is later than cf7 and you’ll only get an http 500 error as a response.

    Another case of endless spinning wheel is when wp_mail can’t deliver the mail because it’s not properly configured (try smtp or configure dkim dmarc spf). This will also result in an endless spinning wheel.

    But in your case the issue is the wp-api that is unreacheable.
    "DRA: Only authenticated users can access the REST API."

    For this reason the author doesn’t consider this specific issue a fault of cf7, because it is external to the plugin. And if you think about, it’s right, again also in this case.

    @mc001 hope my answer is satisfactory also for you

    PS: i know you find that solution on stackoverflow but isn’t correct, disabling cf7 script will only disable the cf7 script to dialog with… wp-api, the one you disallow for unlogged users ??

    anonymized-14293447

    (@anonymized-14293447)

    oh, thank you very much @codekraft for a clarification that the author obviously never bothered to give us. I don’t have capabilities to test scripts like you suggest but I appreciate the tips. ??

    hi @arsenalemusica

    I can’t help you too much because I haven’t seen your website, but you should open a new thread because the cases in which this issue happens are many so I assume that your problem is not exactly the same of mc001.

    if you want to try to solve the most common problems are:
    – wp_mail() you need to check if works and if it can send emails to your address (a random smtp plugin do the job)
    – html not valid (w3c validator)
    – plugins after cf7 that hooks to wp_mail that fails (check apache/nginx log)
    – wp-api not reacheable for unlogged users (security plugins – check the console)

    I think the author got tired of repeating it…. just take a look here in the forum to verify it (plus he wrote a very extensive documentation).

    Anyway, I have to confess that I asked him too ??

    after re-reading my first answer I realized that I had addressed the reply to @arsenalemusica but in reality it was for @mc001

    So, to clarify, the issue experienced by @mc001 was caused by “disable-json-api”. You need to disable this plugin to get cf7 work with define( ‘WPCF7_LOAD_JS’, true );.

    • This reply was modified 3 years, 8 months ago by Erik.
    Thread Starter mc001

    (@mc001)

    Hi @codekraft. Thanks for your comments. We do run “Disable REST API” plugin, so it gives us a lead what we need to reconfigure to get it to work.

    hello @mc001, I just installed it for testing and it seems that plugin has an option specifically to ensure the path /contact-form-7/v1 is not blocked.

    Try to check, the “Disable REST API” settings page, i am using version 1.6

    Thread Starter mc001

    (@mc001)

    Hi @codekraft. Yep, we whitelisted CF7 in the “Disable REST API” settings and it all burst into life, without requiring the hack I mentioned in my initial post. Thanks again for putting us on the right trail.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Infinite loading (and workaround)’ is closed to new replies.