From 8691504e9ee584b421071633c61a6c524f2f6b80 Mon Sep 17 00:00:00 2001 From: Eric Soderquist Date: Mon, 7 Feb 2022 14:24:46 -0900 Subject: [PATCH] Randomize firstCheckTime into the future, rather than scheduling into the past --- Puc/v4p11/Scheduler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Puc/v4p11/Scheduler.php b/Puc/v4p11/Scheduler.php index dd3c3c3..fcbd0a0 100644 --- a/Puc/v4p11/Scheduler.php +++ b/Puc/v4p11/Scheduler.php @@ -53,7 +53,7 @@ public function __construct($updateChecker, $checkPeriod, $hourlyHooks = array(' if ( !wp_next_scheduled($this->cronHook) && !defined('WP_INSTALLING') ) { //Randomly offset the schedule to help prevent update server traffic spikes. Without this //most checks may happen during times of day when people are most likely to install new plugins. - $firstCheckTime = time() - rand(0, max($this->checkPeriod * 3600 - 15 * 60, 1)); + $firstCheckTime = time() + rand(0, max($this->checkPeriod * 3600 - 15 * 60, 1)); $firstCheckTime = apply_filters( $this->updateChecker->getUniqueName('first_check_time'), $firstCheckTime