Fixing the Simple Twitter Connect Plugin API Addresses

Published by John on January 15, 2014 Under Wordpress

One of my clients uses a WordPress plugin called Simple Twitter Connect. It is actually a suite of plugins which interact with Twitter, but they only use the STC – Publish plugin, which automatically adds a Tweet to their feed when they publish a post or page.

They contacted me today, because Simple Twitter Connect Plugin was no longer automatically adding Tweets when they published a new post. I did a quick check of the Plugin settings, to make sure it wasn’t turned off and the Setting Called ‘Automatically Tweet on Publish’ under ‘Automatic Publishing’ was still turned on.

Since in the past I have run into issues with various Twitter plugins when they change their API, I checked Twitter’s developer Site and found that they had in fact recently updated their API. Starting on January 14, 2014, Twitter now requires SSL or TLS for all connections to their API. You can read more about it here.

I checked the plugin code and found that STC – Publish wordpress plugin was in fact using the old insecure ‘http://api.twitter.com/1.1/statuses/update’ in several places.

Upon change that to ‘https://api.twitter.com/1.1/statuses/update’ , everything appeared to work again.

I had to replace it in three places:

simple-twitter-connect/stc-publish.php
simple-twitter-connect/stc-comments.php
simple-twitter-connect/stc-followers.php

The Old Code Looked Like This:

$resp = stc_do_request('http://api.twitter.com/1.1/statuses/update',$args);

I Changed it To:

$resp = stc_do_request('https://api.twitter.com/1.1/statuses/update',$args);

No Comments |

Add a Comment