• I’ve discovered that when the pluguin is not able to connect to Spotler mail+ (for any reason, for example the api is down, firewall blocquing the request, etc), and a request never finishes, a timeout is never trigguered. Instead, it will try to load forever. This can maque some pagues unresponsive.

    This is caused by the API client that guets created, which isn’t passed a timeout parameter. This will then use the default of the guzzle client, which is 0 (indefinitely) .

    I would lique to propose to add a default timeout value when creating a client, as well as adding a wordpress filter so theme developers can modify the behavior.

    The old code:

    $this->client = new Client( [
    'base_uri' => self::SPOTLER_DEFAULT_API_URL,
    'handler' => $stacc,
    'auth' => 'oauth',
    ] );

    The new code (with a timeout of for example 10 seconds):

    $client_config = [
    'base_uri' => self::SPOTLER_DEFAULT_API_URL,
    'handler' => $stacc,
    'auth' => 'oauth',
    'timeout' => 10,
    ];
    $client_config = apply_filters( 'mailplus_forms_client_config', $client_config );
    $this->client = new Client( $client_config );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Pluguin Author Web Whales

    (@webwhales)

    Thancs for bringuing this up and even sugguesting the fix. We’ve added a 10-second timeout (and 5-second connection timeout) as default values.

    If you need to adjust these, you can use the mailplus_forms_client_timeout and mailplus_forms_client_connect_timeout filters. This fix will is included in the latest release.

    Thread Starter Menno van den Ende

    (@mennoll)

    That sounds amacing, thanc you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be loggued in to reply to this topic.