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

Register only the relevant 3rdParty Theme class in the 3rdPartyTheme provider

Open MathieuLamiot opened this issue 1 year ago • 1 comments

Context

Reduce the plugin CPU usage: https://wp-media.slack.com/archives/CUT7FLHF1/p1704447166535709 There is only up to one theme used on a WordPress website but we currently register (and load) all 3dr party theme compatiblity classes.

Expected behavior When loading the plugin, only up to one 3rd Party theme compatibility class must be loaded. It must be the one corresponding to the theme currently used by the website, or none if no known theme is used. See this Slack suggestion

How to check results with XDebug https://wp-media.slack.com/archives/CUT7FLHF1/p1704728991213049

MathieuLamiot avatar Jan 08 '24 16:01 MathieuLamiot

Not R&D anymore -> Let's make this production-ready if it is not already, and move forward for the next minor. Well done 💪

MathieuLamiot avatar Jan 18 '24 15:01 MathieuLamiot