skip to Main Content

I’m using WordPress and Elementor, I have a page with a form integrated into a Google Spreadsheet, using the webhook I send the data I need from the form to the spreadsheet, the data is added to the spreadsheet, but an error appears in the form "Webhook Webhook error. This message is not visible to site visitors." and the person is not redirected to the next page.

spreadsheet

form

I have several such "systems", several different spreadsheets and websites, some adding less data, others more data, and they all stopped working at the same time.

I searched several websites and forums and found nothing.

By giving this error and the person is not redacted, it is "duplicating" the person’s sending.

2

Answers


  1. Chosen as BEST ANSWER

    Problem solved, the error was happening because the default Wordpress waiting time is 5 seconds, so it was sending the data to Google Spreadsheet, adding it to the spreadsheet, but there was no time to return the response with status 200 (ok) , the problem was solved by adding the code:

    add_filter('http_request_timeout', function($timeout, $url = '') {
    $start_with = 'https://script.google.com';
    
    return is_string($url) && strncmp($url, $start_with, strlen($start_with)) === 0 // PHP 7 ou mais antigo
        ? 30 // Defina o timeout apropriado, o padrão do WordPress é 5 segundos
        : $timeout; // Retorna o timeout inalterado para outras solicitações
    

    }, 10, 2);

    in functions.php under appearance -> theme file editor -> functions.php


  2. I’m having the same problem.

    I’m new to PHP and web design in general. Is there a specific spot in the file the code needs to be placed.

    I tried placing it on line 2 below <php and at the bottom of the script.

    The script was updated successfully, but the error still shows when I submit the form.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search