Social Media Counters WordPress plugin

IntroductionDescriptionInstallScreenshotsChangelogCommentsAdvancedDownloadDonate


Introduction

This is my first ever plugin and I will be submitting it to the WordPress plugin directory imminently it is now available in the official WordPress directory here. I was inspired when trying to add social media counters to the School for Startups website and finding it surprisingly difficult to find a decent plugin that was flexible and did what I needed. So, I created my own and you can see it working here and on the School for Startups website.


Description

This plugin allows you to add social media counters to your blog posts. These are buttons that allow your site’s visitors to share your content, but also to see (and for you to see) how many times it has been shared through different services.

The options make this plugin incredibly flexible.

You can add counters to the top of your posts, the bottom of your posts or both and customise it so different services and different styles can be used for top and bottom. You can add a title to them and style the titles however you like.

Social counters can be added on posts, pages and even custom post types. They can also be applied to post excerpts and you can choose whether you’d like tall counters or compact counters (or one for each part of the blog post).

Services available as part of the plugin include:

  • Twitter
  • Facebook
  • Google Buzz
  • Google +1
  • LinkedIn
  • Digg
  • StumbleUpon
  • AddThis

Installation

How to install:

  • Click here to download the Social Media Counters plugin.
  • Unzip and extract to your wp-content/plugins folder.
  • Activate the plugin through the ‘Plugins’ menu in WordPress.
  • Configure settings through your WordPress admin via Settings > Social Media Counters.

Screenshots

 

Screenshot of the options screen

 

Screenshot of the icons in action, at the bottom of a blog post


Changelog

1.1.1

  • Fixed minor bug with StumbleUpon and Twitter badges

1.1

  • Added support for Pages and custom post types
  • Added support for excerpts
  • Addded option for Twitter handle

1.0

  • Initial Version

89 comments

  1. or Posted a while ago #

    Thanks for the plugin. Unfortunatelly it cannot be shown in pages. I hope you can add this – and facebook like. ;)

    • Phil Hancox Posted a while ago #

      Glad you like it. I will be adding this feature and improving the plugin in the next release.

  2. Arq e Tec Posted a while ago #

    I just instaled the plugin in one of my blogs and just wanted to thank you! So thanks!!! It’s a great plugin. Also if you could add the option to put the counters on the main page posts it would be awesome.

  3. Ric Raftis Posted a while ago #

    Just installed your plugin Phil and although I am more of a Joomla person than WP, it looks really cool.

    Small problem though and that is when you share FB it is showing javascript in the description despite me adding a page description. I am using the Thesis theme. I note your page does not do this.

    Cheers

  4. James Posted a while ago #

    Plugin is really good; simple and clean. I would like to replace addtoany with this fully and will probably do so once the functionality works on pages as well. Great Job!

  5. John Posted a while ago #

    Nice plugin..would like to see the LIKE button instead of Share for Facebook…any suggestion for a quick change?

  6. sarah Posted a while ago #

    Hey,
    this is exactly what I need except that I need it to work for pages. when do you think the next release will be available?
    Thanks
    -Sarah

  7. Henry Posted a while ago #

    I installed it but on the settings page it just has the enable top and bottom part, that’s it. Seems to be missing everything else I see in the screenshot. Did I miss something? Please let me know what I can do whenever you get the time. Plugin looks awesome and I want it so bad! lol

  8. Patrick Large Posted a while ago #

    Any ETA on page support? Would like to use this one, but need page functionality.

    • Phil Hancox Posted a while ago #

      v1.1 is to be released early next week (Monday or Tuesday hopefully) with page support, custom post type support, excerpt support, better Twitter sharing and more.

  9. Ian Colyer Posted a while ago #

    hi, first of all, nice job, and thanks for such a great job with this plugin.
    I have a question, is normal that facebook share, DO NOT show quantity, unless you click the button?
    THis is how is working for me.
    Thanks!

    • Phil Hancox Posted a while ago #

      Yes, unfortunately Facebook have a peculiar rule of not showing the quantity until it gets to at least 3 shares. There are hacks which I may include in the next release as an option.

      • Ian Colyer Posted a while ago #

        Phil, thanks for the reply, can’t wait for the new update!!!
        Awesome

  10. Scott Sawyer Posted a while ago #

    Hey Phil,

    Great job, keep it coming :)

    Feature request, if I may:
    Let me toggle media counters per post category or per post?

    Or is there already a way to do this.

    Many thanks!

    • Phil Hancox Posted a while ago #

      Could you elaborate, I’m not sure I understand? Are you saying you’d like to exclude categories and posts from showing the counters, for example?

      • Scott Sawyer Posted a while ago #

        Hey Phil,

        Great to see such fast responses. That is exactly what I was thinking. For instance, if I have a category “Blog”, I would want to show the counters, but for category “Knowledge Base”, I would not.

        An alternate approach would be to have a check box on New Post/ Edit Post to allow for per post control.

        Does that make sense?

        Thanks again for your hard work and attention.

  11. Scott Sawyer Posted a while ago #

    Hey Phil,

    Just a quick follow up, I was having problems with w3c validation. Specifically, the meta tag id not being a single token.
    From w3c:

    value of attribute “id” must be a single token

    <link rel='stylesheet' id='Social Media Counters CSS-css' href='http://alphare…

    This attribute can not take a space-separated list of words as a value, but only one word ("token"). This may also be caused by the use of a space for the value of an attribute which does not permit it.

    So I modded the plugin and changed the following lines:

    wp_register_style('Social-Media-Counters-CSS', $css_url);
    wp_enqueue_style('Social-Media-Counters-CSS');

    Thanks again for the plugin. Still looking for a clean solution to my previous question.
    S

    • Phil Hancox Posted a while ago #

      Thanks Scott, I’ll take a look at that for the next release.

  12. Phil Hancox Posted a while ago #

    Version 1.1 is now available with, as most requested, Page support amongst other things.

    This page will be updated in due course.

  13. CannabisChris Posted a while ago #

    It only works right to post to Facebook. Pretty much all the other buttons have problems inserting the URL. There is no point in sharing if the URL is not there. Any idea what the problem is?

    • Phil Hancox Posted a while ago #

      Do you have an example of a site where the plugin is not working? Which version are you running?

  14. Cicero Posted a while ago #

    Just installed this plugin but it only shows on pages but not posts

    • Phil Hancox Posted a while ago #

      Hi Cicero,
      Have you ensured that the ‘post’ checkbox is ticked in the settings? Which version are you running? Do you have an example site I could see?
      Thanks

      • Cicero Posted a while ago #

        Version 1.1
        Yeah it is checked. I have tried all permutations but it only shows on pages

          • Phil Hancox Posted a while ago #

            WordPress automatically assumed both comments were spam, presumably due to having a link.
            I find this quite peculiar. Have you tried deleting and reinstalling a fresh plugin?
            The theme is a paid theme so I can’t see the source code but does single.php use the_content to display content? Could the theme be hindering the plugin from working or overwriting the settings?

          • Cicero Posted a while ago #

            The Theme is the free version. It is the theme at fault I installed another to check it

          • Cicero Posted a while ago #

            The code for single.php

            [Code cut out as it had been stripped anyway, removed completely for brevity - Phil]

          • Phil Hancox Posted a while ago #

            Hi Cicero,
            Obviously a lot of that code got stripped out. If you could send it as a file to philh@ncox.co.uk I might be able to take a look and identify any issues.

  15. Fabrizio Posted a while ago #

    Mate,

    just a small request, please add date and hour when update the version. Just to be easier when shows up here!

    Cheers =)

    • Phil Hancox Posted a while ago #

      Thanks Fabrizio, I’ll make sure I include this in future releases. The official plugin page on WordPress.org shows the last date it was updated, but I take your point on board.

  16. Brandon Posted a while ago #

    Hi Phil,

    I had your old version of 1.0 and loved it. I saw the new version 1.1 and found that everything has disappeared. I no longer have a social media logo on any of my pages nor a way for anyone to click on a social media logo to send my page to a social media site. I simply downloaded your plugin, but I don’t know what else I may have done wrong. I may just go back to 1.0 for the time being.

    Brandon

    • Brandon Posted a while ago #

      Never mind… I deleted it and activated it again and it works. It looks great!

      Thanks,

      Brandon

      • Phil Hancox Posted a while ago #

        No problem Brandon, I’m glad you like it and that it’s worked. A few people have experienced this issue so I will be adding a message to this page to ensure people know to resave their settings.

  17. Shawn Murphy Posted a while ago #

    Hi Phil,
    I like how simple it was to upload the plugin. I noticed, though, that my tweet, linkedin, and facebook counts reset to zero. Thoughts?

    • Phil Hancox Posted a while ago #

      Hi Shawn,

      This a peculiar issue but one I would suggest might be an issue with the social networks and the URL configurations. It uses the current page URL, or the permalink of the page it is associated with, and brings the count back according to those URLs.

      Nevertheless, I will do some research and see if it could be an issue with the plugin.

      Thanks for your comment!

      • Roy Posted a while ago #

        If you could find a possible solution? The same has happened to me.

        Don’t worry, I don’t think it’s your plugin as it happened to me on a different plugin as well… Just curious as to what caused this issue and can’t seem to track where it went wrong

        • Roy Posted a while ago #

          Please forget my previous reply, I fixed the issue. A change in permalink structure was what occurred, resetting this brought back the count

  18. CannabisChris Posted a while ago #

    I just reactivated it on this site:
    http://aromatherapylearning.com

    At the top share buttons if you hit “Stumbleupon” for instance, there is no URL. Under the post Stumble appears to work. Thick buttons up top, thin below. (maybe that is the difference)

    Twitter does not insert the link on either of them, just the un-linked title of the post.

    • Phil Hancox Posted a while ago #

      Aha, yes, I have identified a tiny bug with the StumbleUpon thick badge and potentially with the Twitter badge. I will release an update in the next hour or two.

      • CannabisChris Posted a while ago #

        Don’t take it the wrong way, I am glad it was a bug! I was beginning to think I was going crazy. Other than that, it looks good. I’ll look forward to the update.

        • Phil Hancox Posted a while ago #

          Feedback is very much appreciated, sometimes bugs slip through the net and if it wasn’t for kind users like yourself I’d never know.
          I believe the bugs to be fixed now, you can see by clicking the Twitter and StumbleUpon badges on this very page.
          Version 1.1.1 with the fixes have been uploaded to the plugin directory and should be available as an update as soon as the WordPress servers accept them and update them.
          Thanks for your help in improving the plugin!

  19. Otavio Diniz Posted a while ago #

    I’m having problems with twitter share, the url is not being received by twitter.com, it seems that the url is being urlencoded twice…
    I disabled the rawurlencode and it worked again…

    • Phil Hancox Posted a while ago #

      Yes, this bug has been recognised and fixed. Version 1.1.1 (which should be available imminently) contains the fix.

  20. Kamil Tamiola Posted a while ago #

    Hey! Phil!

    You did very good job on the plugin! However, support for URL shortener, like bitly would be greatly appreciated!

    • Phil Hancox Posted a while ago #

      This is a great idea and something I’ll definitely be looking at for the next release.

  21. rae Posted a while ago #

    dunno why.. but all the fb share counts are lost over one night …
    any solution?
    we had alot of people shared every post but now…. back to 1-2 …

      • rae Posted a while ago #

        still the same.. sadly…

        this post http://phlhn.cx/atherethere (URL shortened to prevent issues – Phil)

        is shared 25 times .. but now… only 2…

        anything that can help to refer to fb real counts??

        • Phil Hancox Posted a while ago #

          I will do some research into this but can’t say for sure what’s causing it. I notice there are a lot of foreign characters in the URL but I doubt that would cause any serious issues. I’ll try and get back to you in due course.

          • Rae Posted a while ago #

            Thank you. I guess it’s not coz of language coz other chinese sites use similar plugin too
            If u know any way to get back the shared count it would b great

        • Otavio Diniz Posted a while ago #

          I believe that the bug fix is the cause, his old count 25 is stored in a url double urlencoded url.

          • Rae Posted a while ago #

            Know how to fix it? Seriously it’s sad to lose the counts…

  22. CB Posted a while ago #

    A possibility to include the widget in pages of your choice would be pretty sweet. Also the buttons don’t line up properly for me (FF 5.0 and Chrome 12 on Ubuntu 10.10), especially the slim ones, and there especially the Facebook button.

    • CB Posted a while ago #

      If I define in my theme’s CSS
      #content .ph_social_share_box #phsmc_bottom_facebook {
      vertical-align: super;
      }

      the button is properly aligned … however I’d prefer I hadn’t to do so.

  23. bernard Prince Posted a while ago #

    Great job, really!
    The only bug i have is i’m cannot see buttons in the home page (but work great in tag and categories). I’ve tested it with 2 differents themes ( v. 1.1.1). I don’t know if is related to the plugin ou the themes. Any suggestions where to look for that?

    Thank you!

  24. rae Posted a while ago #

    HI,

    I removed this $encoded_link = rawurlencode( $link );
    and now the first 3 pages showed the share counts now
    but from the 4th pages, it’s not showing the real share counts number.
    do you know the reason? :(
    but i am still glad.
    but i want the share counts all back to the real numbers.

    from page 4. (you can click on one of those 8 small blog posts and see the count
    http://www.atherethere.com/page/4/

    i am using Facebook Share Button Zero Count Fix plugin
    which can allow my post to have a share count at 2 from start.

  25. Phred Posted a while ago #

    Great plug in–I love it! Would it be possible for you to add a Facebook “Like” button to the bar? A “Reddit” button would be nice as well, but the “Like” button would be very very helpful.

    Thanks a lot and keep up the good work!

  26. CB Posted a while ago #

    Another thing – what if I use a static page instead of the one listing all blog entries? The listing of entries actually happens under /blog in my case, but enabling “Homepage” and “Excerpts” in the plugin settings doesn’t include the buttons on the /blog page consequently, probably because it is not recognized by the plugin as such.

  27. Paul Posted a while ago #

    Hey, great plugin, super easy to set up. I have a similar problem as CB… I want the counter to show up on my blog’s homepage, which would create multiple count bars for every post that appears.

    I checked every option in the “Where to display” settings.

    As it is now, the counter only shows up when you click on the post. Is there a way to get it to show up on the blog homepage, and appear with each post?

    Thanks!

  28. Scott Sawyer Posted a while ago #

    Hey Phil,

    Thanks again for your responsiveness. I installed 1.1, but still had the problem with the <meta id. Not a problem for me, easy enough to change it in the plug in.

    I noticed another problem when using Pleer's Facebook Comments, if I activate Social Media Counters on the same post as Comments, the comments disappear. Obviously there is some conflict with the plugins.

    Have you experienced something similar? Any known conflicts or suggestions for troubleshooting?

    Thanks,
    Scott

    • Jonni Posted a while ago #

      Heck yeah this is exaclty what I needed.

  29. Joe Posted a while ago #

    Testing this plugin with our website, fall in love with it right away. Simple and easy.
    I still need to fix the CSS to my likening…

    Wish you happy day,

    Founder of Mwd

  30. Barrie Spence Posted a while ago #

    The plugin appears to have a slight conflict when used with prettyPhoto (as used by the Invictus theme – http://themeforest.net/item/invictus-a-premium-photographer-portfolio-theme/180096.

    This only manifests itself on the fullscreen image, not the gallery page where the caption includes the text “ShareTweetvar addthis_config = {”

    e.g. http://www.spencephotography.co.uk/gallery/boudoir-photography-holly-3/#!prettyPhoto/0/

    The tweet and like buttons are implemented by prettyPhoto in this case and can be turned off, but the code segment is still displayed in the caption.

    Any suggestions?

    Barrie

  31. Phil Hancox Posted a while ago #

    Thank you all for your comments. I will be taking a closer look and fixing several of the issues for the new version 1.1.2 which will be released at the weekend.

    • jeremy Posted a while ago #

      Also having difficulty getting the counters to work on the homepage, let me know when that’s fixed!

    • Matthew Varpness Posted a while ago #

      Thanks, Phil. I wanted to add that I too am having problems with the links not showing up on my homepage http://varpness.com but they are showing up if you click into the article.

  32. Chris Arlen Posted a while ago #

    Great plugin. A couple of problems with the Linked IN share button. When clicked it gets this msg:

    “There was a problem performing this action, please try again later.”

    Have tried it with/without being signed in to LinkedIn

    Also, no counts are being displayed.

    Here’s the page: http://bit.ly/oqzh6I

    Appreciate your help.

  33. Daniel Posted a while ago #

    +1 for the Facebook “Like” Button

  34. Roger Posted a while ago #

    Love the plugin and appreciate the updates and responses to everything. Just wanted to put a vote in for having it on the homepage / main index page as well. Would be great if every post just had it at the bottom.
    Thanks

  35. Chris Posted a while ago #

    LinkedIn Share not working. Clicking the icon attempts to connect (whether I’m signed into LI or not) but it doesn’t make connection.

    Tried the LI icon on your post and also didn’t work.

    Using Firefox 5. Curious to hear if there’s fix.

    Otherwise, really like the plugin.

  36. Oren Ellenbogen Posted a while ago #

    Joining Paul’s question – As it is now, the counter only shows up when you click on the post. Is there a way to get it to show up on the blog homepage, and appear with each post?

  37. Sanjee Posted a while ago #

    Works great thanks! Is there a way I could place the buttons in a template file. A PHP code that could grab specifically the tall buttons?

  38. john papadopoulos Posted a while ago #

    Another vote for adding Reddit ;)

  39. Jeff Tom Posted a while ago #

    Same issue. Will not show up on the homepage! Awesome besides that but unusable with this bug.

  40. Laurent Posted a while ago #

    Thanks for this great plugin ! The only missing thing would be to extend it to work inside a sidebar widget.

  41. Phred Barnet Posted a while ago #

    This was working fine for my site, but now it doesnt work anymore

  42. Martin M. Posted a while ago #

    Hello there, thx for this awesome plugin.
    But I have a little request: is it possible to add the social media bar not only in a full post but also on the teaser posts on the first page of a blog?
    I found no setting in the options :(

  43. darweenn Posted a while ago #

    Like all other comments, really great plugin!
    Maybe I’ll just repeat the others but please just add the possibility to choose the Facebook Like instead of Share and the opportunity to use the counters where we want to (checkbox to tick?). Because here as I’m using WP pages everywhere (like embedded pages and so on), the counters are just everywhere :-/.

  44. Doug Posted a while ago #

    Where exactly is the facebook like link ?

  45. Renee @ Create Innergy! Posted a while ago #

    WOW! i’ve been looking for a plug-in like this for a VERY long time!! LOVE it…but, i have the same question…how do I get it to show up on my blog homepage….only the posts that are shown when a person views my page. when i click on show on homepage…it doesn’t show up on the recent 2 posts that are shown…only on the previous entries (which i don’t want it show up there)…it does show up when you click on the actual post to read, but i’d love it if someone didn’t have to click on the post again to share….just more clicking and such to do….would love to know how to fix this b/c i really want to keep using your plug-in! thanks so much!

  46. Urbanski Posted a while ago #

    Works great on specific page posts but for some reason I can not get it to show on the bottom of each post on my home page. Any recommendations?

  47. CP Posted a while ago #

    Hi Phil, I have something of a feature request as well – this may be solved by your fixes some of the other requests I’ve seen above, or maybe not, I’m not sure. I’ve installed this plugin for my workplace’s website, and overall its working great for us.

    However, there doesn’t seem to be a good way to enable it for specific category pages. We want users to be able to share a post from feed pages, without having to click to the single page for the post. This mostly works, but in some unusual but very important cases does not:

    Namely, it needs to use “the_excerpt” instead of “the_content” – and for a blog feed this is not ideal – what we want instead is of course the snippet + Read More as defined by the tag. Your plugin also allows pages to be shared, of course, but even if we configured it that way, the share would be for the blog page, not for the individual post. Could this be an option in the next version?

  48. Bryan Eggers Posted a while ago #

    Social media Counters is awesome! I’ve donated a couple of beers and hope others will, too. If you will permit me a couple of questions:

    1. Regarding the Twitter string, can you tell me how to remove the website Title from it? I need the space for tags, etc.

    2. I’d like to center the icons under the post. Can you tell me how?

    Thanks again!

  49. rae Posted a while ago #

    I don’t know why all the FB share counts lost …
    I didn’t touch anything

    Can you tell ?

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>