WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Sparkline files loading when toolbar disabled (5 posts)

  1. GermanKiwi
    Member
    Posted 7 months ago #

    Hi, I've noticed that my webpage source includes a reference in the footer to "wp-piwik-spark.css" and "jquery.sparkline.min.js" coming from this plugin.

    I've read the support thread here which explains that the sparkline files are used for the little Piwik graph in the Admin toolbar, and should only be loaded in the page source for a user who is logged in (as I currently am).

    However, I have disabled the toolbar from showing on my site, via the option in my Profile settings "Show Toolbar when viewing site". So when I view my homepage, there is no toolbar - the toolbar is only there when I'm viewing the Admin pages.

    Therefore, shouldn't that mean that the sparkline files should only be loaded for the Admin pages, and not for the front-end webpages - even when I'm logged in?

    Oh and incidentally (to change the subject a bit), when I was searching for what sparkline actually was, I discovered that there is a newer version available here which adds support for jQuery 1.10.0 - your plugin is still using the previous version of sparkline - maybe this newer version would be better, now that WordPress itself is using jQuery 1.10.x? (Although I'm no expert on jQuery so I don't really know what relevance this has!)

    Cheers!

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

  2. braekling
    Member
    Plugin Author

    Posted 6 months ago #

    The scripts are loaded if the user is logged in and the sparkline graph is activated.

    I'm not sure if there is an alternative filter which allows to check if the toolbar is hidden. Whether such a filter is available, I will change this in a future version.

  3. GermanKiwi
    Member
    Posted 6 months ago #

    Thanks! Would the correct filter to use for this, be "is_admin_bar_showing"?

    From here:
    http://codex.wordpress.org/Function_Reference/is_admin_bar_showing

  4. braekling
    Member
    Plugin Author

    Posted 3 months ago #

    Resolved in 0.9.9, release soon.

  5. GermanKiwi
    Member
    Posted 3 months ago #

    Great, thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.