• Hi,

    I saw that other users also had problems with the latest version of the plugin.

    Since January 2nd we have been receiving the automatic plugin warning about a malfunction in one of the site’s forms:

    
    

    - Form: #7361 - Lead tank 5-2
    - Webhook: Don't post webhook URL
    - Error: "Webhook returned an error code."

    Request Method: POST

    Request Headers:
    {"Content-Type":"application\/json; charset=UTF-8","To get utm_source":"https:\/\/example.com\/?utm_source=example","Use this shortcode":"[hidden utm_source default:get]"}

    Request Body:
    "Maybe don't post that either"

    Response Code:
    400

    Response Message:
    "Bad Request"

    Response Headers:
    {}

    Response Body: "<html>\r\n<head><title>400 Bad Request<\/title><\/head>\r\n<body>\r\n<center><h1>400 Bad Request<\/h1><\/center>\r\n<hr><center>nginx<\/center>\r\n<\/body>\r\n<\/html>\r\n"

    If you plugin is active the contact form submission shows a generic submission error; by disabling the plugin the form starts without problems.

    Obviously we haven’t changed anything in the original form since a few months..

    Thank you

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hi.

    As you can see in your notification, your webhook is returning a error: 400 Bad Request

    Please, check your Zapier integration.

    tt1277

    (@tt1277)

    I am also getting some weird errors since the recent update “An error of type E_PARSE was caused in line 439”.

    Asking ChatGPT to review this code snippet:

    wp_mail(
    $error_mails,
    sprintf( __( ‘[%s] Webhook Error on Form %s’, ‘cf7-to-zapier’ ), wp_specialchars_decode( get_option( ‘blogname’ ), ENT_QUOTES ), $form ),
    $notification,
    );

    ChatGPT said:

    Possible Issue:

    • In this wp_mail function call, the trailing comma , after the third parameter ($notification) is incorrect syntax. In PHP, there should not be a comma after the last parameter in a function call.
    • Correct this by removing the comma at the end of the parameters.

    Here’s how the fixed function should look:

    wp_mail(
    $error_mails,
    sprintf( __( ‘[%s] Webhook Error on Form %s’, ‘cf7-to-zapier’ ), wp_specialchars_decode( get_option( ‘blogname’ ), ENT_QUOTES ), $form ),
    $notification
    );

    Not sure if this issue is related… our webhooks are working, but just getting this error which was not happening before the recent update.

    Plugin Author Mário Valney

    (@mariovalney)

    Thanks for pointing this! I’ll check it out.

    But no: It’s not related. The notification means everything is OK, but your server is returning a 400 Bad Request.

    Said that, I figured maybe your header is broken:

    {"Content-Type":"application\/json; charset=UTF-8","To get utm_source":"https:\/\/example.com\/?utm_source=example","Use this shortcode":"[hidden utm_source default:get]"}

    “To get utm_source” and “Use this shortcode” are pretty sure a invalid header. Remove everything from headers option and try again, please.

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