wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
687 stars 215 forks source link

As a user, I want the homepage preloaded with accurate OCI data upon fresh activation. #6746

Open MathieuLamiot opened 2 months ago

MathieuLamiot commented 2 months ago

Context Follow-up of #6697. In the current warm_up behavior, it can happen that the SaaS browse the homepage (desktop and mobile) before WP Rocket is fully activated, hence on those visits, our callbacks to inject the beacon are not yet registered. Those visits don't result in LCP/ATF data being saved in DB.

Expected behavior

Acceptance Criteria When I activate the plugin (consider also fresh installations):

Additional information https://wp-media.slack.com/archives/CUT7FLHF1/p1719492413110199?thread_ts=1719482180.104929&cid=CUT7FLHF1

wordpressfan commented 2 months ago

When handling this issue, we need to refactor this method:

https://github.com/wp-media/wp-rocket/blob/7df15529f858b1da9fd3a2127f7b4b96664f99d5/inc/Engine/Media/AboveTheFold/WarmUp/Controller.php#L242-L249

To remove doing the version check and just change the default value for mobile options to be 1 instead of 0.

Slack discussion: https://wp-media.slack.com/archives/CUKB44GNN/p1719824617612169?thread_ts=1719823420.166129&cid=CUKB44GNN

Mai-Saad commented 3 weeks ago

To be checked here : update from <3.16 to PR , will warmup home + 10 links as desktop and mobile (currently on 3.16.4, home mobile is not warmedup and not added to WPR logs nor DB)