From fa6c7a7aa8badaf7f48b1cf2f1d710575d9a3428 Mon Sep 17 00:00:00 2001 From: Leo Fajardo Date: Sat, 28 Feb 2026 01:27:00 +0800 Subject: [PATCH 1/2] [sync-cron] Add a grace period before rescheduling the data sync cron event to prevent a race condition between the rescheduling process and the execution of the scheduled event. --- includes/class-freemius.php | 3 ++- start.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 08589d64..03d53708 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -6560,7 +6560,8 @@ private function maybe_schedule_sync_cron() { // The event is properly scheduled, so no need to reschedule it. if ( is_numeric( $next_schedule ) && - $next_schedule > time() + // Add 1-hour grace period to avoid race conditions. + ( $next_schedule + ( WP_FS__TIME_24_HOURS_IN_SEC / 24 ) ) > time() ) { return; } diff --git a/start.php b/start.php index d07d287e..bdb932d9 100644 --- a/start.php +++ b/start.php @@ -15,7 +15,7 @@ * * @var string */ - $this_sdk_version = '2.13.0.4'; + $this_sdk_version = '2.13.0.5'; #region SDK Selection Logic -------------------------------------------------------------------- From 2d723b4e235b67f3f125645046f557033fca8e22 Mon Sep 17 00:00:00 2001 From: Leo Fajardo Date: Mon, 9 Mar 2026 19:34:04 +0800 Subject: [PATCH 2/2] [sync-cron] Simplification --- includes/class-freemius.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 03d53708..960b2ba8 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -6558,11 +6558,7 @@ private function maybe_schedule_sync_cron() { $next_schedule = $this->next_sync_cron(); // The event is properly scheduled, so no need to reschedule it. - if ( - is_numeric( $next_schedule ) && - // Add 1-hour grace period to avoid race conditions. - ( $next_schedule + ( WP_FS__TIME_24_HOURS_IN_SEC / 24 ) ) > time() - ) { + if ( is_numeric( $next_schedule ) ) { return; }