2
« Last post by aga2442 on Yesterday at 04:18:19 PM »
Unconditional global script enqueueing causes duplicate LightGallery loading & PageSpeed penalty
---
Hello,
We are using the Blog Plugin (v1.9.0) together with the Epsilon Theme on our Osclass platform, and we noticed an asset enqueueing issue that impacts overall page loading performance.
Summary of the Issue:
In blog/index.php, the plugin enqueues its assets—specifically LightGallery v1.6.11 (CSS & JS), FontAwesome 4.7, and user.js—unconditionally at the main file execution level, rather than scoping them conditionally to blog pages.
Impact on the Website:
Duplicate Library Loading: On item detail pages, the Epsilon Theme enqueues LightGallery v1.10.0 (using handle lightgallery), while the Blog Plugin enqueues LightGallery v1.6.11 (using handle light-gallery). Because the script handle names differ, both versions of LightGallery are downloaded simultaneously on item pages.
Unnecessary Global Asset Payload: Pages with no blog content (such as the Homepage, Category Search listings, and Static pages) are forced to download LightGallery CSS/JS files and external font assets on every single page view.
Request:
Could you please consider wrapping the plugin asset enqueueing in a conditional check (e.g., loading assets only when visiting blog routes/pages) in the next update? This would eliminate duplicate scripts and improve site loading speed for all users.
Or, if you have any suggestions or solutions related to this issue, please let us know.