Change the webhook timeout

The plugin sends the webhooks while the form is being submitted, one after the other, and waits for each answer. It needs the answer to know whether the webhook worked: when it fails, the form shows an error and the plugin sends the error notification. The visitor only sees the result after every webhook answers.

By default, each request waits up to 30 seconds and follows up to 10 redirects. A slow webhook makes the form slow by the same amount, and with several webhooks the times add up.

Lower the timeout

The ctz_post_request_args filter changes the request before it is sent. Add this code as explained in Add custom code:

add_filter( 'ctz_post_request_args', function( $args ) {
    $args['timeout']     = 10; // Seconds to wait for an answer.
    $args['redirection'] = 3;  // Redirects to follow.

    return $args;
} );

Pick a timeout above the time your webhook usually takes to answer, or it will fail on a normal day.

Only for one webhook

The filter also receives the webhook URL, so you can change only the slow one:

add_filter( 'ctz_post_request_args', function( $args, $properties, $contact_form, $hook_url ) {
    if ( false !== strpos( $hook_url, 'hooks.zapier.com' ) ) {
        $args['timeout'] = 10;
    }

    return $args;
}, 10, 4 );

When the time runs out

A webhook that does not answer in time counts as an error: the form shows its error message, the plugin sends the error notification and the next webhooks of the form are not sent. To keep the form working when a webhook fails, see Make multiple webhooks optionals.