wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

3.16 - Bail-out of pre-warmup for LCP when license is expired for more than 15 days

Open Miraeld opened this issue 1 year ago • 1 comments

Context

For the 3.16 version, we need to prevent sending requests to the SaaS and stop preloading if the license is expired for more than 15 days.

Scope a solution

in Engine\License\API\User

  • Add a new method to check if user is expired since more than 15 days
// Check if the license has been expired for more than 15 days
if ( $user->is_license_expired() && (time() - $license_expiration > 15 * 24 * 60 * 60) ) {
	return  false;
}
  • Add test

in Engine\Media\AboveTheFold\Warmup\Controller

  • Add a new dependency on the User class
  • In the method that manages the fetch_links(), add a check with the new user expired method above
  • Update tests

Expected Behavior

The pre-warmup should not start if the license is expired for more than 15 days.

Effort estimation:

Effort [S]

Miraeld avatar Feb 02 '24 11:02 Miraeld

Is inc/Engine/Media/AboveTheFold/Context really dedicated to the pre-warm-up?

MathieuLamiot avatar Feb 07 '24 13:02 MathieuLamiot