How to Fix Sharebar Plugin issue after upgrading to WordPress 3.5

wordpress-update-150x150
  • Buffer
  • Buffer

 

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.

Thomas on youtubeThomas on twitterThomas on googleThomas on facebook
avatar
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
    Twitter:
    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!
    Ileane recently posted..Google is Trying to Tell You Something, Are You Listening?My Profile

  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.

  4. avatar Juan
    Twitter:
    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.

  11. avatar Karen
    Twitter:
    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 😉
    Karen recently posted..Life of Pi &#8211; Visually Stunning &#8211; Blazing Minds Film ReviewMy Profile

  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 :)

  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. 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!
    Shahbaz Sayyed recently posted..How to Fix/Remove “Comments are Closed” WordPress ProblemMy Profile

  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 *

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=""> <s> <strike> <strong>

CommentLuv badge
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 3 approved comments. Use your real name and then @ your keywords (maximum of 2)