WordPress.com Stats Plugin 1.1

We updated the WordPress.com Stats plugin just a little bit today. Now, instead of redirecting you to dashboard.wordpress.com, the stats are loaded in an iframe on your own blog’s dashboard. You still have to be logged into wordpress.com to see your stats. If your plugin version is 1.0, you should upgrade to 1.1 to see the changes. Just replace the old stats.php file with the new one.

The good news is that you don’t have to leave your site, we still take care of your data just like before and we can still update the interface with new features, such as the new clickable chart points, without pushing an updated plugin.

The bad news is that the iframe will often have a vertical scroll bar or empty space at the bottom. We would resize the iframe dynamically but browsers won’t allow it because the pages are not served from the same domains. Browser security policies prevent that kind of cross-site scripting.

This change was prompted by countless requests to do away with the redirect. Thanks for that. 🙂

40 thoughts on “WordPress.com Stats Plugin 1.1”

  1. Great timing! I was just looking at my plugins yesterday wondering if a new version of this was going to come out soon. Thanks for all your hard work on it.

  2. Nice one, thanks! If there’s one thing I can grit my teeth about in the new version, it’s that I don’t like the addition of the “Random hot post” in the upper right corner.

  3. Cheers Andy, much appreciated.

    Question though – where would I report potential bugs for a plugin like this?

  4. I was never able to get it working for my site, so I had to uninstall it…such a shame =/

    maybe I’ll give this new one a shot…

  5. Great idea, and I like the upgrade, but you might want to work on the Random Hot Post. The first one that came up for me was a big picture of a dildo. My boss might not like that 😉

  6. After upgrade I have in Dashboard two possibilities:
    1) In left sidebar is message Visit your Global Dashboard to see your blog stats. I am then redirected to wordpress.com and all works well.
    2) In upper menu, there is link Stats (index.php?page=stats) and then there is a login WP screen and I cannot login with my admin password (ERROR: Cookies are blocked or not supported by your browser.)
    But My cookies works well, I never logged in to wp-admin (only for the first time and then I was remembered). Everything in admin area works, only this is not possible for me…
    Thank you for your help…

  7. Andy,

    I know you can’t manipulate the size of the iframe from within the iframe, but what about doing it from outside? Maybe you could estimate the height and modify the URL by adding an anchor (#height=700) which could then maybe read by the local site. Or, if browsers disallow that, you could just use AJAX to do a handoff (WP.com iframe decides proper height, uses AJAX to send it to WP.com. AJAX from local site to local server asks for the height, local server asks WP.com, WP.com responds, local server does AJAX response with height adjustment, local DOM takes care of it). Maybe too complicated.

    Of course serialized output/JSON would be the best, as people could write their own front ends for it.

  8. Stuffing the reports into the page via AJAX would make two page loads per click and complicate the thing more than I wanted for this revision. We’ll see how it goes.

    In another life, stats data were loaded via an XMLRPC multicall. Maybe that will be in the next iteration.

  9. “You still have to be logged into wordpress.com to see your stats”

    Does this mean that to take advantage of the iFrame, I have to log in to my self-hosted wordpress and my wordpress.com? If so, I might aswell just log onto WP.com

    Or am I misunderstanding something?

  10. I think it would make a whole lot more sense and make a prettier semantic experience if the stats were passed via REST. iframes are hackish at best and the need for data IN an actual wordpress admin is also pretty important.

    Take the industry standard approach and make this data available via XML. As an alternate, make it available via JSON too. In fact, with WordPress move to jQuery, it makes even more sense to pass data via JSON.

    But then again, I’ma JSON whore lately so take the suggestion as you will. 😉

  11. Aaron: jQuery is not available in WP 2.1 so I’d have to bump the requirements. Also, that would still require logging into wp.com.

    I’d rather do it by XMLRPC and not require a login. Also, that would facilitate a Top Posts widget. That may be the next iteration but it isn’t planned at this point.

  12. Many thanks Andy, it might not be the final version, but it is sure a step in the right direction, so many thanks for that.

    Being logged into both is not a problem after the initial log in, and having the stats more local is great.

    Andy, do you have any aims on including feed stats at some point?

  13. Mark, Aaron, Dougal, et al: If we made the plugin use APIs like REST or JSON and static we wouldn’t be able to launch things like this without updating the plugin and forcing everyone to download it again. We update stats features as often as once or twice a month. We’d need to update the APIs and everyone who used them would have to update just as often. Finally iframes are more secure then loading HTML/scripts directly.

  14. This new version of the stats plugin that embeds itself into the page does not work. EVERY TIME I click on the Blog Stats link, I’m asked to log into my WordPress.com account, which then redirects me to my profile. I would then have to renavigate over two clicks to see the stats, and then it displays the whole WordPress.com admin header inside there, so that half of the page is wasted for the header space. And it doesn’t remember my login either, it prompts me to go through that every time.

    Version 1.1 is a horrible upgrade. I’m going back to version 1.0–I really have no problems with having a redirect, and until you get rid of the iframe, I’m staying with 1.0.

  15. @ webmacster87

    If it helps, I was experiencing the same problem when viewing the page in IE7.

    I got around this by adding wordpress.com to the list of “allowed sites” in IEs cookie options.

    Tools > Internet Options > Privacy > Sites

    Then add wordpress.com and set to “always allow”

  16. Interesting plug-in, great idea. But because you have to be logged into the “mothership”, it’s not useful for me because my user/admins don’t have access to that, and I won’t be providing it to them, because they have enough to do just remembering their own password.

    So I’m dumping the plug-in.

    Thanks anyway, I know it’s free, and I’m sure it’s very useful for the “overseer” user.

  17. i’m looking forward to trying it. It’s been a bit tiring to login to two wordpress just to see the stats. Great plugins

Comments are closed.