How to Fix Sharebar Plugin issue after upgrading to WordPress 3.5

Share this post...Share on Facebook24Share on Google+13Tweet about this on TwitterShare on StumbleUpon1Buffer this pagePrint this page

 

I had an issue with the Sharebar plugin today after I upgraded this blog to WordPress version 3.5. As always when making major WordPress upgrade on my blog I had made a backup of my files and database. This issue was not that big that my blog became inaccessible, but it was still annoying. I went for the Sharebar page at WordPress.org to look for an update to the plugin, but no luck 🙁 I decided to disable the plugin and started to look for others with the same problem. It was actually not that hard and I even found a couple of solutions/workaround to make it work without any errors on my blog.

WordPress_logo

The issue after upgrading to WordPress 3.5

After upgrading my blog I got this error on top of all my posts. The Sharebar actually looked like it was working, but I was not happy with these lines in top of all my posts:

Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/techwork.dk/public_html/wp-content/plugins/sharebar/sharebar.php on line 112 and defined in/var/www/techwork.dk/public_html/wp-includes/wp-db.php on line 990

Warning: Missing argument 2 for wpdb::prepare(), called in /var/www/techwork.dk/public_html/wp-content/plugins/sharebar/sharebar.php on line 124 and defined in/var/www/techwork.dk/public_html/wp-includes/wp-db.php on line 990

 

The Fix  to make ShareBar work with WordPress 3.5

If you know how to edit a PHP file in a text editor all you need is to edit the 2 lines creating this error in sharebar.php in your plugin folder. What I did was downloading the file via FTP to my PC to make sure that I had a copy if something went wrong. I then changed the 2 lines as stated below and uploaded it back to the sharbar plugin folder.

Line 112 looks something like this:

$results =$wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”)); $str .= “\n”;</a>

Correct line 112 to look like this instead:

$results =$wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”, null)); $str .= “\n”;


Line 124 looks something like this:

$results = $wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”)); $str .= “\n”;

Correct line 124 to loo like this instead:

$results = $wpdb->get_results($wpdb->prepare(“SELECT * FROM “.$wpdb->prefix.”sharebar WHERE enabled=1 ORDER BY position, id ASC”, null)); $str .= “\n”;

That should be all you need to do. It did the trick for this blog and I hope it can work for you too until the ShareBar gets an official update. I know a lot of people out there that are using the ShareBar plugin so I thought I would share this fix with you guys. I have heard that there should be other plugins out there with issues after the upgrade to WordPress 3.5. This is just another good reason to always keep your plugins as updated as possible.

Share this post...Share on Facebook24Share on Google+13Tweet about this on TwitterShare on StumbleUpon1Buffer this pagePrint this page
avatar
at
About the author:
I am an IT Professional that has this blog as a hobby project in my spare time. I have been in the IT business since 1996 and want to share some of the thing I have picked up over the years with people who visit this blog...

>>Subscribe to my Newsletter<<

42 Responses to How to Fix Sharebar Plugin issue after upgrading to WordPress 3.5

  1. avatar Lisa says:

    You rock! Thank you soooo much.

  2. avatar Ileane says:

    Hi Thomas! Good for you on finding a fix for this. I’m sure this will help a ton of people who use this plugin.

    I didn’t update WordPress yet, but I plan to do it this weekend. Hopefully all of my plugins will be working fine.

    Thanks!

    • avatar Thomas says:

      Hi Ileane
      I was very happy to be able to fix this little issue, so I thought that other bloggers would be the same. Good luck with your upgrade. If just your plugins are up to date, I don’t think you will have any trouble with the upgrade.

  3. avatar Steve (JoeBugBuster) Case says:

    I’ve been stalling on making the move to WordPress 3.5. Looks like I’ll stall a little longer. 😉 Thanks for finding and sharing the fix.

    • avatar Thomas says:

      Hi Steve
      Some times it is a good strategy to wait a bit before upgrading to the newest version, just to make sure that most of the bugs has been fixed already 🙂

  4. avatar Juan says:

    i already upgrade to latest wordpress and so far don’t have any problem

  5. avatar Angelo Webdeco says:

    Sharebar is one of the cripiest thing ever invented…. i really hate it.

  6. avatar ARPAN says:

    Thanx for your help. working fine on my blog.

  7. avatar Stacy says:

    Thanks for the fix, worked perfectly!

  8. avatar Paul says:

    Worked a treat! Thanks. My blog at http://www.outdoorphotography.co.nz was broken after 3.5…..your tips helped it get back online!

  9. avatar Jacquelyn Weaver says:

    Thanks for the info about the fix. Seems like the 3.5 update brought up a fair share of issues and problems, but thankfully all of them can be fixed with one tweak or another.

  10. avatar Nadine Greg says:

    I’m starting to think that 3.5 has a bit lower quality than previous WordPress editions. I’m also hoping that there will be mini-updates or hotfixes on the way.

    • avatar Thomas says:

      Hi Nadine
      I am sure that the problems with the updates will be solved along the way. As long as it only is a problem with a plugin we can always disable it and keep the plugin running.

  11. avatar Karen says:

    Nicely discovered Thomas, I know quite a few bloggers that will be loving the solution to the Share bar issue. I use Digg Digg for my sidebar, so thankfully I didn’t have an issue, though 9 times out of 10 something is bound to fail on a WordPress update 😉

    • avatar Thomas says:

      Hi Karen 🙂
      There often are issues when a new WordPress version is released, but I would say that most of the times it is due to bad plugins or themes.

      • avatar Karen says:

        Very true Thomas. a lot of themes don’t get updated ready for the new version of WordPress and do suffer from the lack of frequent updates 😉

  12. avatar Saundra Beach says:

    This is always an issue with systems that use plugins. Newere core systems and older plugins may not get along so well initially.

  13. avatar Allan Gallagher says:

    3.5 is fine. It’s just that there are issues on release, as with every piece of software or a framework like WordPress.

  14. avatar Glen Quinn says:

    Usually, “old” WordPress plugins work fine with newer framework versions, but it’s nice to see fixes like these when they don’t work.

  15. avatar Daren Crane says:

    Thanks for the info about the fix. Seems like the 3.5 update brought up a fair share of issues and problems, but thankfully all of them can be fixed with one tweak or another.

  16. avatar Kris says:

    Cool stuff! Thanks for the fix. Hopefully ShareBar can release an official patch and then eventually learn from this so the plugin will still be compatible with future WordPress versions.

  17. avatar Alan Jeffery says:

    Thanks for sharing this fix Thomas, I’m a bit new at WordPress and was gutted to see the error messages on my posts. Hopefully there will be an update soon

  18. avatar Evan says:

    I had the same troubles with Sharebar plugin.. Was dissapointed and stressed and gave up for a while. You literary saved me) Thanks for useful info!

  19. avatar Zubair Ahmed says:

    Thanks a lot.. was facing problem as had upgraded to WordPress 3.5 recently.

  20. avatar Antonio says:

    Worked like a charm! Awesome fix just had this problem on client sites that had sharebar installed. Nice quick fix until they update the plugin. Thanks!

  21. avatar Bizz says:

    Thank you so much for this post! I started having troubles with this plugin after I updated several sites to 3.5

    I finally just switched over to Addthis, even though I much prefer the Sharebar plugin. This will come in very handy!

  22. avatar JediMasterHouse says:

    I use wordpress and had same problem some time ago, and take lot of time to fix it. I should get here earlyer. But anyway now i know how to sove that, thanks

  23. avatar Jan says:

    This was a great help. Thanks!!!

  24. avatar Lisa says:

    Just to let you know there is a new problem on the homapage of the blog after upgrading for 2.5 grr !!!

    Can you help? It says it’s on line 195 for sharebar.php and also there is a problem with WP Super cache on line 90.

    Thanks 🙂

    • avatar Lisa says:

      Humm actually this is super weird. I have desactivated the plugin and then reactivate it and there is no error anymore… I am suspicious though…

      • avatar Thomas says:

        Hi Lisa
        I just noticed that the Sharebar plugin was just updated yesterday. Maybe you have upgraded to the new version? I just took a look on your blog and it looks like it is working again.

        • avatar Lisa says:

          I know ! This is so weird. First time I upgraded it I got 3 errors and after desactivate and reactivate it, back again!

          Anyway 🙂 Your tip did the trick wayyyy before the upgrade.

  25. avatar Luis says:

    Wow, I’ve been looking for this for about a week! I’m completely new to wordpress and was having crazy trouble with plugins. Thanks for the help!

  26. avatar Ryan says:

    Thanks for making it easier to find it, nice blog!!

  27. avatar Shahbaz Sayyed says:

    All other solutions were spinning my head round to fix this plug in but actually it was not that tough after reading this post.

    BIG THANKS!

  28. avatar honey says:

    thanks for the clearance of Sharebar plugin will try it as i use now wordpress 4.0

Leave a Reply

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