WordPress v3.5 was recently released – if you had the social media plugin, Sharebar installed, you noticed that after upgrading you received an error on your website. UGH! Don’t you hate that?
The cause of this error is not that WordPress v3.5 broke something, but it was a result of extra security added to the underlying software of WordPress. In an effort to reduce the vulnerabilities of WP, additional coding was required to enhance the security process. In fact, this is a good thing.
However, good things sometimes go bad 馃檨 Well, not necessarily bad… here is what happened in non-techie terms. A part of the code for WP required some information to be sent to it. With the upgrade to version 3.5 it now requires 2 pieces of information. Technically, these are known as parameters. There are now 2 parameters that are required, however, the old/current version of Sharebar has not yet been updated. It is only sending 1 parameter.
The result is that you now get the ugly looking message on your site that looks something like this:
Unfortunately, at the time of this writing, there is no update from the creators of Sharbar to work with WordPress 3.5. If you can live without it, you can deactivate the plugin so this error does not show up on your site. In time, I am sure an update that fixes this will officially be published.
Now, if you REALLY want to have this on your site, there is a way to fix it. Best of all, it is not too difficult!
Step 1: BACKUP your site completely! I use WPTwin. You want a backup in the event you do something really bad.
Step 2. Log into your Dashboard and click on the Plugins > Editor. We are going to edit the code for the plugin.
Step 3: At the top of this page on the right, select ShareBar from the list of plugins.
Step 4. Press CTRL F (or Command F on a Mac) – we want to FIND the lines of code that are bad. Search for the lines that contains:
$results = $wpdb->get_results($wpdb->prepare
You will find it on Line 112 聽(although they are not numbered!) – the full line looks like this:
$results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."sharebar WHERE enabled=1 ORDER BY position, id ASC")); $str .= "\n";
You want to change it to be:
$results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."sharebar WHERE enabled=1 ORDER BY position, id ASC", null)); $str .= "\n";
Notice the only difference is the COMMA and the word null 聽are added. You need to add that to both lines.
Once you change that line, press CTRL F (or Command F on a Mac) again to find the second occurrence of this line. 聽You should find it on line 124. Add the same COMMA and the word null.
With both lines changed, click the Update 聽File button and you should be all set! No more ugly error messages will be displayed!
Laurent says
Thanks !!!