eFlag(); } } /** * Calculate the minimum delay after the Nth automatic license * activation attempt. * * @param int $attempt * @return float|int Delay in seconds. */ private function calculateLicenseActivationDelay($attempt) { if ( $attempt < 1 ) { return 0; } $minDelay = 20; $maxDelay = 600; $growthLimit = 4; //Stop increasing the delay after this many attempts. $fraction = (min($attempt - 1, $growthLimit) / ($growthLimit)); $desiredDelay = $minDelay + round(($maxDelay - $minDelay) * $fraction); if ( $desiredDelay < $minDelay ) { $desiredDelay = $minDelay; } return $desiredDelay; } public function clearActivationFailureFlag() { delete_site_option(self::ACTIVATION_FAILURE_FLAG . $this->slug); } }