WordPress theme with smart conditional asset loading for performance

Sarah Chen Sarah Chen 7 months ago

Our community site has gotten heavy. We run BuddyPress, WooCommerce, a multi-vendor plugin, an LMS, plus a few more integrations. Page speed has tanked because the theme is loading CSS and JS for every plugin on every page, even pages that never show those widgets. I am tired of writing dequeue filters manually. I want a theme that is smart enough to only load what the current page actually renders, so I can stop fighting asset bloat on a per-plugin basis.

65

Reign has an explicit performance architecture for this. Two distinct mechanisms:

  • Smart widget detection: assets load only for widgets that are actually displayed on each page. If a member carousel is not on the page being rendered, its CSS and JS do not ship
  • Conditional asset loading for 22+ plugin types: CSS and JS scoped to the relevant pages only. LearnDash styles do not load on WooCommerce shop pages, Dokan styles do not load on blog archives, and so on
  • Modern image format support with WebP and AVIF upload, plus image compression, so featured images and avatars stay lean
  • Smart tab memory so tabs remember position on reload, avoiding layout thrash
  • Sticky sidebar with smart scrolling, and a configurable scroll-up button, both respecting the asset loading rules above

Honest limits: Reign's asset loader only applies to assets it controls. Third-party plugins that enqueue globally will still do that unless you dequeue them. For heavy multi-vendor or LMS stacks, the default behavior is already lean, but you may still want a caching plugin and a CDN for static assets.