CSS and JS loaded for every admin page
-
Hello,
I’ve just realized that WP Visitor Statistics loads a lot of assets on every admin page:
/css/dashboard_widget.css
/css/flags.min.css
/css/admin_css.css
/css/leaflet.css
/js/jquery.jqplot.js
/js/jqplot.cursor.js
/js/jqplot.highlighter.js
/js/jqplot.canvasAxisTickRenderer.js
/js/jqplot.dateAxisRenderer.js
/js/jqplot.categoryAxisRenderer.js
/js/jqplot.canvasTextRenderer.js
/js/jqplot.enhancedLegendRenderer.js
/js/jqplot.enhancedPieLegendRenderer.js
/js/jqplot.logAxisRenderer.js
/js/jqplot.barRenderer.js
/js/jqplot.pieRenderer.js
/js/custom_adminjscode.js
/js/leaflet.js(A total of almost 1 Mo!)
Assets should be loaded only on your admin pages, the dashboard and for your shortcodes (if needed), as others plugin do.
It seems to be nothing but many plugins behave the same way which leads to heavy loading pages for admins…
I’m sure you’ll find best practices or example of plugins loading their CSS (for admin at least) only when mandatory (plug-in setting pages, admin dashboard, specific pages if needed, etc…).Keep on the good work!
Thanks
- The topic ‘CSS and JS loaded for every admin page’ is closed to new replies.