From d59d37f4512c0eb68f88df3e267a2206fc3f9858 Mon Sep 17 00:00:00 2001 From: Marco Almeida Date: Wed, 17 Dec 2025 13:45:23 +0000 Subject: [PATCH] Stop killing other plugins remote requests - Remove http_request_timeout filter and callback Removed the http_request_timeout filter and its callback function. Set a timeout value directly in the wp_remote_get call. This will stop your plugin from affecting ALL WordPress remote calls, either from core or other plugins or API calls, and set the 2-second timeout ONLY for your own wp_remote_get call. I just spent one hour debugging a customer website that could not make end API calls because your plugin was killing all connections after 2 seconds. --- updater/updater.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/updater/updater.php b/updater/updater.php index ff9e24b9..ba031cba 100644 --- a/updater/updater.php +++ b/updater/updater.php @@ -53,9 +53,6 @@ class Updater { add_filter( 'plugins_api', array( $this, 'get_plugin_info' ), 10, 3 ); add_filter( 'upgrader_post_install', array( $this, 'upgrader_post_install' ), 10, 3 ); - // set timeout - add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) ); - // set sslverify for zip download add_filter( 'http_request_args', array( $this, 'http_request_sslverify' ), 10, 2 ); } @@ -120,17 +117,6 @@ class Updater { } - - /** - * Callback fn for the http_request_timeout filter - * - * @since 1.0 - * @return int timeout value - */ - public function http_request_timeout() { - return 2; - } - /** * Callback fn for the http_request_args filter * @@ -215,7 +201,8 @@ class Updater { $query = add_query_arg( array( 'access_token' => $this->config['access_token'] ), $query ); $raw_response = wp_remote_get( $query, array( - 'sslverify' => $this->config['sslverify'] + 'sslverify' => $this->config['sslverify'], + 'timeout' => 2, ) ); return $raw_response; @@ -400,4 +387,4 @@ class Updater { return $result; } -} \ No newline at end of file +}