Preload fonts leftovers from the previous feature version should be cleaned
Context
Some deprecated code was identified and reported here. This code is not useful anymore and should be cleaned.
Dependencies
This should happen after #7445 is closed.
Expected behavior
Remove unused code:
- https://github.com/wp-media/wp-rocket/blob/3a1f32bb4a9b8cd40e32c682a86d888a71ec4825/inc/admin/upgrader.php#L145
- https://github.com/wp-media/wp-rocket/blob/3a1f32bb4a9b8cd40e32c682a86d888a71ec4825/inc/Engine/Preload/Fonts.php#L102
- https://github.com/wp-media/wp-rocket/blob/3a1f32bb4a9b8cd40e32c682a86d888a71ec4825/inc/Plugin.php#L101
Acceptance Criteria
- No errors on new installs
- Happy path of auto-preload fonts feature working as expected from a fresh install (check on a couple of pages).
Skipping grooming as it's pretty straightforward.
@MathieuLamiot @wp-media/product What about the old preload fonts values or the option in general. More context here: https://group-onecom.slack.com/archives/C08EFCYRQ2X/p1749106324308149?thread_ts=1749053738.147779&cid=C08EFCYRQ2X
I would say we can clean them from the DB, if they exist, when updating to 3.19.1?
Ok, should Implement this now or it's a question? 😀
Ahah, if you think that's not a dumb idea, then let's go for it and implement it in this PR 👍 I'm just not sure 100% that we indeed don't use that data anymore 😬 You probably know better on that 😄
I would say we can clean them from the DB, if they exist, when updating to 3.19.1?
@MathieuLamiot @jeawhanlee Does this mean that if a user rollback from 3.19 then those values won't exist in UI?
Yes, correct @Mai-Saad , good catch. It might be better to keep this for 3.20 then. Let's get @DahmaniAdame's decision here
@MathieuLamiot @Mai-Saad We already do the same here for old dns-prefetch in favor of the new preconnect to external domains.
Good catch, Mai. The decision to discard those settings was based on the assumption that keeping them would be a regression if still applied. The possibility of a rollback was overlooked.
Users should indeed retain access to their settings if rolling back. It's best if we preserve them this time around.
This would apply to preconnect to external domains as well.
Introducing a history or versioning of settings changes could help address this effortlessly in the future. Until we do, we should do an effort preserving settings.