WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Sparkline files loading outside of dashboard (8 posts)

  1. Paul Thomson
    Member
    Posted 11 months ago #

    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/

  2. Paul Thomson
    Member
    Posted 11 months ago #

    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

  3. braekling
    Member
    Plugin Author

    Posted 11 months ago #

    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é

  4. Paul Thomson
    Member
    Posted 11 months ago #

    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

  5. braekling
    Member
    Plugin Author

    Posted 11 months ago #

    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.

  6. Paul Thomson
    Member
    Posted 10 months ago #

    Hi André,

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

    Thanks for the help,
    Paul

  7. braekling
    Member
    Plugin Author

    Posted 10 months ago #

    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?

  8. Paul Thomson
    Member
    Posted 10 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.