WoodMartW
WoodMart
May 12

Zero-Bloat Asset Manager (Conditional Loading)

What it is: A smart switchboard for the theme's code.What it’s for: Turning off the code for features you aren't using (like Wishlist or Compare).What it improves: Page weight and Google PageSpeed scores.What I want: If I disable a feature in Theme Settings, I want its code to be 100% gone from the site, not just hidden.How it should be done: Use PHP to wp_dequeue_style and wp_dequeue_script for every feature that is toggled "OFF" in the WoodMart settings panel.
PendingPending

4 days ago

Hello, WoodMart already works like that. Scripts and styles load only when actually needed, on several levels. Wishlist code runs only if wishlist is enabled; grid code only loads when a grid element is on the page; a specific grid design's styles load only when that design is picked, others aren't touched. Fullscreen search code only ships if there's a search element in the header with fullscreen mode on, and since it's not visible on load, its styles are deferred to help FCP. This principle applies to the vast majority of the theme's functionality and works automatically, without needing to toggle any additional options. Kind regards