• Resolved Paul Thomson

    (@pthomson87)


    Hello braekling,

    I was just wondering whether there was a reason why certain sparkline files are being loaded outside of the dashboard area?

    When I load up post-new.php and check the source code, these two files are being loaded and adding unnecessary overhead to the page:

    – /js/sparkline/jquery.sparkline.min.js?ver=3.5.1
    – /css/wp-piwik-spark.css?ver=3.5.1

    If these files are not needed outside of the dashboard widget and piwik page, is it possible to stop them loading on other pages in future releases?

    Regards,
    Paul

    http://wordpress.org/extend/plugins/wp-piwik/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Paul Thomson

    (@pthomson87)

    FYI, I’m getting an error on the front-end of my site:

    Uncaught TypeError: undefined is not a function : jquery.sparkline.min.js:4

    I figured I’d include it on this support request as issues might be related? Thanks, Paul

    Plugin Author braekling

    (@braekling)

    Hi Paul,

    the sparkline classes are used to add the small graph to your toolbar. Until you are logged in, the sparkline is shown in the toolbar – even if you leave your dashboard.

    If you don’t like to load the sparkline files, disable the toolbar graph.

    Regarding the javascript error: Can you tell me which browser you are using? The next WP-Piwik release will contain updated sparkline files – they will fix some IE issues.

    Best regards
    André

    Thread Starter Paul Thomson

    (@pthomson87)

    Hello André,

    Thanks for getting back to me and providing an explanation to the sparkline files. It appears the sparkline files are loaded on the frontend even when the toolbar has been disabled for the frontend.

    Is there a way to hook into this function on future releases so that the files are not loaded frontend when user sets for the toolbar not to be displayed? – A trivial fix i know, but might be worth implementing if easy to do?

    In answer to the error I was receiving, I’m using the latest version on Chrome…

    Regards,
    Paul

    Plugin Author braekling

    (@braekling)

    That’s strange. Can you tell me your blogs URL?

    This function (don’t load sparkline code if toolbar not shown) is already a part of WP-Piwik and seems to work fine here.

    Thread Starter Paul Thomson

    (@pthomson87)

    Hi André,

    Sorry for the delay in getting back to you, my URL is http://www.livefreedietravelling.com

    Thanks for the help,
    Paul

    Plugin Author braekling

    (@braekling)

    I opened your website and had a look at your source code, but I can’t find either jquery.sparkline.min.js nor wp-piwik-spark.css. So I’m quite sure the sparkline script is only loaded for logged-in users, isn’t it?

    Thread Starter Paul Thomson

    (@pthomson87)

    Hello André,

    This issue seems to be fixed now, I’m assuming any changes you made to later versions of the plugin resolved the issue.

    Thanks for your continued support and EXCELLENT plugin!

    Regards,
    Paul

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sparkline files loading outside of dashboard’ is closed to new replies.