Support » Plugin: WP Visitor Statistics (Real Time Traffic) » CSS and JS loaded for every admin page

  • Resolved madmax4ever

    (@madmax4ever)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CSS and JS loaded for every admin page’ is closed to new replies.