Facebook posting from Social WP plugin works again…

some dude named cangluo on the WP forums posted a fix.  His explanation:

“For plugin author Alex King and plugin developers:

The problem happens because WP 4.0 has changed the way it creates and verifies nonce. They call this Tie nonces and cookies to expirable sessions. Basically it means WP now use the current session value (along with other variables) to create and verify nonce. Bear this in mind, let take a look at how the plugin runs when the sign in button is clicked (according to my understanding of the plugin).”

The fix:

1. open file wp-content/plugins/social/lib/social/controller/auth.php, and inside function action_authorized(), look for this code block

if (wp_verify_nonce($nonce, $this->auth_nonce_key($salt)) === false) {
	Social::log('Failed to verify authentication nonce.');
	echo json_encode(array(
		'result' => 'error',
		'message' => 'Invalid nonce',
	));
	exit; //(comment this line to temporarily enable adding accounts, uncomment when finish.)
}

2. comment out the line that says exit;, it is line 88 for me (version 2.11), save and upload if necessary.
(now it becomes:) //exit;

3. Go to yout WP backend, and click the ‘Sign in with Facebook/Twiter’ button, and it should work.

4. For security reason, once you have added your accounts, remember to uncomment line 88.
(now it becomes:) exit;

from the WP forum

About Theoblogical

I am a Web developer with a background in theology, sociology and communications. I love to read, watch movies, sports, and am looking for authentic church.

Leave a Reply