From 908de1c63eef4e3827d62e482f56d7153d7b74f8 Mon Sep 17 00:00:00 2001 From: Daniele Alessandra Date: Fri, 19 Jun 2026 17:05:36 +0200 Subject: [PATCH] [api] [timeout] Introduced a constant for API timeout and updated usage in the SDK --- config.php | 4 ++++ includes/sdk/FreemiusWordPress.php | 2 +- start.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.php b/config.php index a9a3f1be..0926e6cf 100644 --- a/config.php +++ b/config.php @@ -210,6 +210,10 @@ define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' ); } + if ( ! defined( 'WP_FS_API__TIMEOUT' ) ) { + define( 'WP_FS_API__TIMEOUT', 30 ); + } + // Set API address for local testing. if ( ! WP_FS__IS_PRODUCTION_MODE ) { if ( ! defined( 'FS_API__ADDRESS' ) ) { diff --git a/includes/sdk/FreemiusWordPress.php b/includes/sdk/FreemiusWordPress.php index 0bd8b239..dccb655c 100755 --- a/includes/sdk/FreemiusWordPress.php +++ b/includes/sdk/FreemiusWordPress.php @@ -408,7 +408,7 @@ private static function MakeStaticRequest( $pWPRemoteArgs = array( 'method' => strtoupper( $pMethod ), 'connect_timeout' => 10, - 'timeout' => 60, + 'timeout' => WP_FS_API__TIMEOUT, 'follow_redirects' => true, 'redirection' => 5, 'user-agent' => $user_agent, diff --git a/start.php b/start.php index f5664c45..d5d355df 100644 --- a/start.php +++ b/start.php @@ -15,7 +15,7 @@ * * @var string */ - $this_sdk_version = '2.13.2'; + $this_sdk_version = '2.13.2.1'; #region SDK Selection Logic --------------------------------------------------------------------