[Plugin: Twitter Widget Pro] Tweets not updating (hosting incompatibility with TLC Transients)
-
Hi there,
I’ve had problems with numerous installs of Twitter Widget Pro not updating tweets and I’ve discovered – I think – that it’s all down to a problem with my hosting and your use of TLC Transients. This MAY (or may not) also be the cause of other people’s lack of updates.
The behaviour I was seeing was that I appeared to have different versions of my tweet stream “cached” and I could flick between the different cached versions by changing the settings. So, for example, with lot of widget settings I might see Tweets A, B and C. With a different set of widget settings I would see Tweets C, D and E. Changing the widget’s settings between the two brought up to two different cached lists. BUT…when I posted a new Tweet NEITHER cached list of Tweets got updated.
I checked the database and noted a few timestamps in transient values in there and then went and checked the code.
TWP uses a hash of the widget options as a key for the transient “cache” of fetched Tweets. See line 710 of the plugin in the _getTweets function:
$key = 'twp_' . md5( $this->_getFeedUrl( $widgetOptions ) );
So that explains why different Tweet settings have different cached lists of Tweets, and how I can switch between them.
But why are they never updating?
Well, I’ve not done a too-thorough inspection of the code but TLC transients seems to use a “loopback” URL to fetch the cached list of Tweets without holding up the user – similar to how WP-Cron works. When scheduled it does:
add_action( 'shutdown', array( $this, 'spawn_server' ) );
And the spawn_server callback looks like this:
public function spawn_server() { $server_url = home_url( '/?tlc_transients_request' ); wp_remote_post( $server_url, array( 'body' => array( '_tlc_update' => $this->lock, 'key' => $this->key ), 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', true ) ) ); }
NOW…my hosting company don’t actually allow me to make these
loopback
HTTP requests. So, all my installed instances of TWP are broken.Options for me seem to be:
1) The TWP developer make use of TLC Transients optional
2) I could put some hack in that deletes the transients every now and then. I DO have WP-Cron working (via a Unix cron job), so I could setup a job to clear the transients from the database using that.
3) I could use another plugin.I know that TLC Transients is a clever way of making some big efficiencies. And I know that my hosting issue is probably a rare thing. But I could really use some feedback on whether TLC Transients will continue to be used or not, or if I have to consider one of the other options.
I hope that write up is useful to someone else too.
Thanks
- The topic ‘[Plugin: Twitter Widget Pro] Tweets not updating (hosting incompatibility with TLC Transients)’ is closed to new replies.