Most Shared Posts – WordPress Plugin

Most Share Posts

Screenshots of the Most Shared Posts plugin on various sites.

The Most Shared Posts plugin for WordPress allows you to display, as a widget, which of your blog posts have the most social shares and are proving to be your most popular content.

download button
Version 1.1.0 – 14th August 2011
hosted on wordpress.org

 

If you’d like to see this plugin in action, you can see it on this site, or you could check out Kate Morris’ SEO Blog or John Doherty’s SEO Blog. They both helped to test the initial version.

Features

If you have feature requests, bug reports or you just want to show me where you are using the plugin please post a comment below or drop me an email to [email protected].

  • Fetches Facebook Likes, Twitter Tweets and the new Google +1s.
  • Caches results to ensure good performance. Older posts are cached for longer.
  • Select which of the 3 social counts to include.
  • Select how many posts to display in the list, and an age cut-off.
  • For beginners, it is very easy to install with no necessary customisation.
  • For advanced users, there are various display options available.
  • Option to hide the counts and icons.
  • You can have multiple instances on the same page with different titles (e.g “Most Tweeted Posts” showing just the Tweet counts, or “Most Liked Posts” showing just the FB Likes counts etc.)

Installation

The steps to install ‘Most Shared Posts’ are quite simple:

  1. Upload `most-shared-posts` directory to the `/wp-content/plugins/` directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to the ‘Widgets’ page in the ‘Appearance’ section of WordPress.
  4. Now you can add the widget to different pages of your site. Recommended pages to add the widget: “Sidebar Index”, “Sidebar Single”, “Sidebar Category”.
  5. You can customise the plugin differently for each of these sections should you wish.
  6. NOTE: The plugin throttles how quickly it gathers the social data, to ensure it does not cause any slowness for your users. For small sites with less than 100 posts, this should typically be done in the first hour. For sites with other 2000 posts it could take a day or more.
  7. Now load a page on your blog which should show the widget. This will initiate the first data fetch.

Frequently Asked Questions

  1. Q: I just installed and refreshed the page, but my most shared posts are not at the top of the list?
    A: The plugin will take a little time to collect all the data about your posts. It does so in batches so as not to upset the social networks by requesting too much data at once. You should find that it’ll sort itself out and catch up quite quickly.
  2. Q: I just got tweeted but the count hasn’t updated! Why not?
    A: The results for each post are cached for varying lengths of time depending on the posts age. Very recent posts (less than 2 days old) are cached for an hour, and then older posts are cached for incrementally longer periods of time. Posts in the last month are cached for 12 hours, posts 1-6 months old are cached for 48 hours and older posts are cached for a week.
  3. Q: My older posts aren’t showing up…
    A: When you add an instance of the widget to a sidebar in the WordPress admin section, you can customise how far back you wish to look; the default is 2 years.
  4. Q: Where can I change how many posts are included in the list?
    A: When you add an instance of the widget to a sidebar in the WordPress admin section, you can customise how many posts to include; the default is 5.
  5. Q: I activated the plugin, but I don’t see it. 🙁
    A: This plugin is a widget, so after activating it you need to go to the Appearance->Widgets section of your WordPress settings and select which pages you’d like it to appear on.
  6. Q: Can I include the count inside a post or a page?
    A: Yes – there is now a shortcode option. The shortcode has a few options (all are optional):

    [most-shared-posts num_posts="5" max_month_age="24" title="Most Shared Posts"]
  7. Q: I have no shares. How depressing… help!
    A: Assuming you’re providing content worthy of being shared… Make sure you are including sharing buttons on your blog in a consistent fashion. I recommend adding them into your theme, or alternatively:

    • Alex Moss of Pleer has created some great social button plugins for Twitter, Facebook and Google+.
    • The AddThis plugin is very popular, and provides a variety of sharing buttons.
    • At sharethis.com, they provide a variety of sharing plugins.
    • The Sharedaddy plugin, part of Jetpack from WordPress.com, provides a range of social buttons.

Changelog

Version 1.0.0 – 4th August 2011

  • Initial Release

Version 1.0.1 – 5th August 2011

  • Update on the format of the API requests for added robustness.
  • Added link to the FAQ on plugin activation.

Version 1.1.0 – 14th August 2011

  • Can now view social stats in admin area (with or without an active widget).
  • Added a shortcode option to include within posts/pages.
  • Data now collected without an active widget.
  • Improved method for scheduling data collection.
  • Various code tidying and improvements.

Donate

Please consider a donation, or alternatively enabling the attribution link in the settings:

Donate Button

181 responses to “Most Shared Posts – WordPress Plugin”

  1. 5ubliminal Avatar

    Consider urlencode()-ing the get_permalink() in the Facebook and Twitter file_get_contents() requests. Stay safe.

    1. Tom Avatar

      Good shout. I think if someone is already compromising your permalink_structure then you have bigger problems, but you are right. Just rolled that in now. Thanks. 🙂

  2. Keith Brown Avatar

    Cool plugin, similar to what Huffpo and a few others have been doing for awhile to promote content. Also think that showing users that your posts get shared is a good measure of quality. Nothing like landing on a random blog, trying to figure out if it’s legit or not, and seeing all 0’s next to social sharing.

    1. Tom Avatar

      Thanks, Keith! 🙂

      Yeah – I agree that social sharing is a key indicator of what people are enjoying, so it not only helps draw attention to the most popular content, but also builds trust AND helps the author see what is being well received and what isn’t.

  3. Patrick Kelly Avatar

    Thank you for making this available! I have been wanting this functionality for quite some time. Much appreciated!

    1. Tom Avatar

      Thanks Patrick!! Looks really nice on your blog! 🙂

      Let me know if you have any feedback or feature suggestions. Got a few already so going to be doing some updates in the not too distant future.

  4. Ahmed Bakry Avatar

    I dunno how to thank you man, if thank you will do i’d be happy..this is exactly what i’ve been looking for ages, if u’d like any Arabic translation support i’d be glad to do it, thanks again Tom, u’re the best

    1. Tom Avatar

      Hi Ahmed — Thanks a lot. I’m glad you like it! 🙂 If the plugin proves popular I will want to provide some translations so that is a great offer, thanks. 🙂

  5. hkalant Avatar

    Great plugin. Works with the Sharedaddy plugin (part of Jetpack) by WordPress.com, too.

    1. Tom Avatar

      Thanks – I’ll add that to the FAQ. Glad you like the plugin. 🙂

  6. Avinash Avatar

    Hi.. This is a nice plugin to have, but wanted to know how we can manually call the function, instead of a widget..

    1. Tom Avatar

      Hi Avinash. Thanks! Yes, a shortcode is on my to do list for the next version, which should be coming in the not too distant future. 🙂

      1. Avinash Avatar

        Thanks , I ‘ll be waiting for it.

      2. Jean-Paul Avatar

        Also eagerly waiting for a short code or template tag version of the plugin. Looks excellent and can’t wait to try it.

      3. Tom Avatar

        Avinash & Jean-Paul,

        Just updated the plugin now and introduced a shortcode you can use. Let me know how you get on with it!

      4. Avinash Avatar

        Thanks for the update, I’ve set it up in my blog.

  7. Tim Avatar

    I really like your idea(!), but I need an template tag because I do not use a widget sidebar (i dont like it). I also want to write about it. Something like

    1. Avinash Avatar

      Your can try this to display the most shared posts, without using the widgets.Place the code in the sidebar.php where you want to display the list .

  8. Hun Avatar

    For some reason it’s only polling the Google +1 shared entries, and twitter & fb shares are all at 0 – though I know it’s been shared.

    1. Tom Avatar

      Hi there,

      I’m looking into why this might be – not sure why that might be. Can you send a couple of example URLs?

  9. Mick Lehr Avatar
    Mick Lehr

    I’m wondering about the plugin throttle speed. It seems that it would compile social data slowly to not affect page views. But this is all I’ve read about it:
    “The plugin throttles how quickly it gathers the social data, to ensure it does not cause any slowness for your users. For small sites with less than 100 posts, this should typically be done in the first hour. For sites with other 2000 posts it could take a day or more”

    1. Tom Avatar

      Hi Mick,

      One of the FAQs deals with this:

      “The results for each post are cached for varying lengths of time depending on the posts age. Very recent posts (less than 2 days old) are cached for an hour, and then older posts are cached for incrementally longer periods of time. Posts in the last month are cached for 12 hours, posts 1-6 months old are cached for 48 hours and older posts are cached for a week.”

      Furthermore, it’ll never do more than 15 API calls at once (so with 3 networks it’d be updating 5 posts), and it’ll never do more than one batch every 15 minutes. Should an API call fail, then it’ll wait 6 hours before trying again.

      -Tom

  10. Kevin Avatar
    Kevin

    Hey Tom,
    Great plugin, been looking for something like it for awhile and only been able to show users most viewed and most recent posts, now I can add most shared to the list! I’m actually having a few problems though. I’ve tweeted about a recent post a while ago and everything still shows as zero. Also in the dashboard the Images links for the social services are dead. Don’t know if these are related but most importantly its not actually getting the social data! Please help!

    1. Tom Avatar

      Thanks for your emails about this, Kevin. I think I have fixes for both which should be in the next release. 🙂

  11. Dan Hatfield Avatar

    It doesn’t seem like this plugin accounts for shares pages, just posts. Is that correct? If so, is there an easy way I can adjust to include pages?

    Thanks so much for your help!

    1. Tom Avatar

      Hi Dan. Yes, currently it is just posts and not pages. However, the next release will have an option to select (for a particular widget), either pages, posts or both. 🙂

  12. littleoslo Avatar

    hey, it is a great plugin, thank you, but one thing i noticed is after i activated it, all the “facebook likes” i have on the old posts are gone, like some of the mosts got 1000 likes, when i check the post again now it is back to 0. do you know why?

    1. Tom Avatar

      Can you fire me a URL for this. Did you update the permalinks structure of your site?

  13. David Avatar

    Nice plugin. I have it up and running at frontsidebus.net but I have one question. When pulling the widget using shortcode, how do you change the max age to one day? Thanks

    1. Tom Avatar

      You can’t in the current version (1.1.0) – but you should have more options in 1.2.0 expected soon. 🙂

      1. David Avatar

        That’s disappointing but understandable. I’ll be looking forward to the update.

  14. Dan Hatfield Avatar

    Thanks for getting back to me about my first question. I have another question/issue. On my site the widget only appears when using Firefox. It does not appear in Safari, Chrome, or IE. Any ideas?

    1. Tom Avatar

      Do you have a URL where the widget should I could look at so I can test this? Sounds very odd!

  15. Phat^Trance Avatar

    Theres something wrong with the latest plugin, it doesnt count all my popular posts and the counter seems to be stuck at 120 facebook likes. i have over 50 posts with over 2000 likes and the plugin havent found any one them 🙂

    1. Tom Avatar

      Thanks for your reply to my email. I’m looking into this! 🙂

  16. Frank Avatar
    Frank

    Hi,
    you wrote in your changelog: “Added a shortcode option to include within posts/pages.”

    Where can I find the shortcode to add manually the buttons?

    Greetings
    Frank

    1. Tom Avatar

      Hi Frank,

      There is a section in the FAQ above. The code should look:

      [most-shared-posts num_posts="5" max_month_age="24" title="Most Shared Posts"]

      I’m going to add some more options in the next update. 🙂

  17. Cynthia (@cynthiasantos) Avatar

    Hi, there!
    I’ve installed the plugin last night, and so far, nothing appeared at the share counts. I have 226 posts published, ill it take longer to show the counts, or it might have something wrong?
    Thank’s for your attention!

  18. Cynthia (@cynthiasantos) Avatar

    Hi again…now I’m having some issues with FB and TT API’s: “PHP Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http%3A%2F%2Feulalios.net%2Feueeu%2Findex.php%2F2010%2F06%2F24%2Farthur-o-conquistador%2F) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in E:\home\eulalios5\Web\EueEu\wp-content\plugins\most-shared-posts\msp-fetch.php on line 121
    PHP Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in E:\home\eulalios5\Web\EueEu\wp-content\plugins\most-shared-posts\msp-fetch.php on line 179″

    1. Tom Avatar

      Hi Cynthia,

      It seems that your hosting setup disallows the function I am using to access the social APIs. However, in the next release I change the way I do this, and I think it may solve your problem. I’m working hard on the update and will release it soon. I’ll fire you an email when it is ready and you will hopefully find it helps!

  19. Cynthia (@cynthiasantos) Avatar

    Ok, thank’s a lot! Looking forward to have it working at my blog!

  20. James Avatar
    James

    Hi, I was wondering if I could do this plugin for a list of (children) pages, shown on a page instead of posts on a sidebar?

    1. Emanuele Avatar

      I have the same doubt James!
      If you discover, can you tell me? 🙂

      Thanks ;*

Leave a Reply

Your email address will not be published. Required fields are marked *