wp-rocket
wp-rocket copied to clipboard
3.16 - Bail-out of pre-warmup for LCP when license is expired for more than 15 days
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]
Is inc/Engine/Media/AboveTheFold/Context really dedicated to the pre-warm-up?