How to Fix Sharebar Plugin issue after upgrading to WordPress 3.5

 

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.

Related posts

42 Thoughts to “How to Fix Sharebar Plugin issue after upgrading to WordPress 3.5”

  1. Lisa

    You rock! Thank you soooo much.

    1. Thank you Lisa. Glad I can help 🙂

  2. 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!

    1. 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. 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.

    1. 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. Juan

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

    1. Hi Juan
      The Sharebar issue was the only issue I had with the upgrade.

  5. Angelo Webdeco

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

  6. ARPAN

    Thanx for your help. working fine on my blog.

  7. Stacy

    Thanks for the fix, worked perfectly!

    1. Glad I could help Stacy 🙂

  8. Paul

    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. 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. 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.

    1. 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. 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 😉

    1. 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.

      1. 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. This is always an issue with systems that use plugins. Newere core systems and older plugins may not get along so well initially.

  13. Allan Gallagher

    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. 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. Daren Crane

    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. Kris

    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.

    1. Hi Kris
      So far there is no official patch for this issue. I really don’t know why. It should be pretty easy to fix for them I guess.

  17. 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

    1. Hi Alan
      I hope they soon will get it fixed too.

  18. Evan

    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!

    1. Hi Evan
      I am glad I good help you to get it fixed 🙂

  19. Zubair Ahmed

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

  20. 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. Bizz

    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. JediMasterHouse

    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. Jan

    This was a great help. Thanks!!!

  24. 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 🙂

    1. 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…

      1. 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.

        1. 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. Luis

    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. Ryan

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

  27. Shahbaz Sayyed

    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. honey

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

Leave a Comment