WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
CF7 Not Working After Upgrade (24 posts)

  1. slabadie
    Member
    Posted 12 months ago #

    I just upgraded to 3.5.2 and WP to 3.6.1 and CF7 stopped working. The little arrows just spin forever.

    http://wordpress.org/plugins/contact-form-7/

  2. jwatkinsdc
    Member
    Posted 12 months ago #

    I am having the same problem (and am also on 3.5.2 and WP 3.6.1). There is no feedback to the person completing the form, the little arrows just keep spinning. We are also using the Easy WP SMTP plugin ver 1.0.4. When I deactivate that plugin, this problem goes away. However, we need to use SMTP.

  3. esmi
    Forum Moderator
    Posted 12 months ago #

    As per the Forum Welcome, please post your own topic.

  4. slabadie
    Member
    Posted 12 months ago #

    I am using WP-Mail-SMTP. I deactivated it and CF7 still doesn't work.

  5. slabadie
    Member
    Posted 11 months ago #

    I re-activated WP-Mail-SMTP and the mail is sent but the arrows keep spinning and no confirmation displayed.

  6. slabadie
    Member
    Posted 11 months ago #

    I have now deactived WP-Mail-SMTP and installed Easy WP SMTP and the same thing happens. I get the email but the arrows continue to spin and no confirmation message.

  7. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    I'm dealing with the same issue at the moment myself. It's likely a jQuery conflict with another plugin/theme. However, even though I've reverted to a default theme (I've tried 2012 and 2013) and deactivated all other plugins, I'm still having the same issue. My current work around is to eliminate the spinner (for now) by adding this to wp-config.php:

    define ('WPCF7_LOAD_JS', false);

    I'm devoting the weekend to solving this issue, as I've yet to find a definitive answer.

  8. slabadie
    Member
    Posted 11 months ago #

    I copied your code to disable the spinner, but it still spins.

  9. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    Did you do a hard refresh on the page before resending? If you've already loaded the page, you'll need to refresh it first since this statement will remove some javascript from your rendered page.

  10. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    You shouldn't see this in the view source of your page once you've made the change and refreshed the page:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var _wpcf7 = {"loaderUrl":"http:\/\/example.com\/wp-content\/plugins\/contact-form-7\/images\/ajax-loader.gif","sending":"Sending ...","cached":"1"};
    /* ]]> */
    </script>
    <script type='text/javascript' src='http://example.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=3.5.2'></script>
  11. slabadie
    Member
    Posted 11 months ago #

    Yes I did a hard refresh and the code is showing when you view source.

  12. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    And this

    define ('WPCF7_LOAD_JS', false);

    is in your wp-config.php?

    If so, you might check as wp-config.php can be located in one of two places. Top level of your WordPress install and one directory above that.

    I put it right above the "happy blogging line"

    .
    .
    .
    /**
    * Contact Form 7 JavaScript causing issues with jQuery and form submission
    */
    define ('WPCF7_LOAD_JS', false);
    
    /* That's all, stop editing! Happy blogging. */
    .
    .
    .
  13. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    I have found the root cause of the problem (in my case). I simply eliminate the cause of the problem instead of fixing the plugin, as I'm hoping that the plugin author is reading he can update the plugin to deal with what caused the issue.

    View source on your page and make sure there is absolutely nothing after the closing html tag.

    This is what was causing my problem (the very end of my html output):

    </html><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->

    Apparently this the commented after the closing html tag is being appended to the JSON response, causing an error, which in turn causes the spinner to never quit spinning (actually, the element css style for visibility is never updated to "hidden"). In my case, we had moved to another server, and the contents of wp-content/advanced-cache.php (from WP Super Cache) was causing this extra output. I simply uninstalled WP Super Cache, which eliminated the extraneous output to my page.

    So check if there's any extra output after your closing html tag. You can also use Firebug to see the XHR response.

  14. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    Update: It appears to me that it's not specifically due to the extra content after the closing html tag, but something to do with WP Super Cache using the PHP fucntion register_shutdown_function() to call wpcache_broken_message() in advanced-cache.php. (which in the end, does add extra content after the closing html tag)

    This is definitely an edge case and may or may not be the cause of your problem. All I can say is that it was in my case.

    If this doesn't remedy your situation, I can recommend you try one of a few things.

    1) See what the error message is (if the spinner won't go away, then the response had an error).

    In wp-content/plugins/contact-form-7/includes/js/scripts.js, try changing:

    error: function(xhr, status, error, $form) {
        var e = $('<div class="ajax-error"></div>').text(error.m    essage);
        $form.after(e);

    }

    to

    error: function(xhr, status, error, $form) {
        alert(error.message);
        var e = $('<div class="ajax-error"></div>').text(error.m    essage);
        $form.after(e);

    }

    If you get an error like: "JSON.parse: unexpected non-whitespace character after JSON data"

    then use Firebug (or similar) to take a peek at the response from the Ajax call.

    In my case, I saw:

    {"mailSent":true,"into":"#wpcf7-f1994-p1944-o1","captcha":null,"message":"Your message was sent successfully. Thanks."}<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->

    which made it obvious that there was extra characters after the JSON.

  15. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    I've found WP Super Cache to be the culprit. In my case I had a misconfigured WP Super Cache plugin appending an html comment to the end of the JSON data, causing the JSON to be invalid, hence breaking the Ajax and never stopping the spinner.

    I created a new thread on the WP Super Cache plugin forum:

    wpcache_broken_message on xhr (Ajax) causing issue with Contact Form 7

    As a final note to the OP (as this may not be the solution for your situation), make sure all your plugins and theme(s) are using the WP provided jQuery. Deactivate all the plugins other than Contact Form 7 and try a default theme like 2012 or 2013 and see if that fixes your problem. If so, there is more than likely a plugin/theme jQuery conflict.

  16. slabadie
    Member
    Posted 11 months ago #

    Hey Doug, I had define ('WPCF7_LOAD_JS', false); at the very bottom of the config file and moved it the same spot that you placed it and now all of the forms are working.

  17. Scriptrunner (Doug Sparling)
    Member
    Posted 11 months ago #

    Great, thanks for the update!

  18. nonamebaby
    Member
    Posted 11 months ago #

    I get following message as answer in firebug:

    {"mailSent":true,"into":"#wpcf7-f566-p567-o1","captcha":null,"message":"Ihre Anfrage wurde erfolgreich gesendet. Vielen Dank! <br \/>Sie h\u00f6ren in K\u00fcrze von uns."}<br />
    <b>Fatal error</b>:  Call to a member function get() on a non-object in <b>/www/htdocs/.../wp-includes/cache.php</b> on line <b>113</b><br />
  19. esmi
    Forum Moderator
    Posted 11 months ago #

    nonamebaby: As per the Forum Welcome, please post your own topic.
    http://wordpress.org/support/plugin/contact-form-7

  20. zihuarob
    Member
    Posted 11 months ago #

    I had the same problem. I'm running WP 3.6.1 but no WP Super Cache installed. Your code snippet fixed it like a charm! Thank you VERY much!

  21. samalius1
    Member
    Posted 11 months ago #

    hello, I don't use any cache plugin, can anyone help me to get over this problem?

  22. samalius1
    Member
    Posted 11 months ago #

    I also tried to add define ('WPCF7_LOAD_JS', false); to wp-congig.php, but when I click on the send button it redirects me to non valid URL, for example http://domain.com/#wpcf7-f1279-p9-o1

  23. skimitchell
    Member
    Posted 11 months ago #

    THANKS Scriptrunner, Worked a treat for me too.

    I added

    define ('WPCF7_LOAD_JS', false);

    to my wp-config.php. Hard refresh and all sorted.!!

    NICE WORK mate..

    Cheers

  24. samalius1
    Member
    Posted 11 months ago #

    well, I fixed it with WP-Mail-SMTP plugin :)

Reply

You must log in to post.

About this Plugin

About this Topic