Twitter for WordPress on 2.7
Today, I upgraded my blog to WordPress 2.7, and while most of the upgrade went smoothly, I did notice that my Twitter plugin wasn’t showing new tweets anymore. I initially thought maybe it was a caching issue, or I had run out of API calls or something, but I returned hours later to find it in the same state. I tweaked with the function call to see if changing it would refresh the cache but nothing I tried made it work. I looked for a solution on the official plugin website and on WordPress.org, but none was available, so I decided to try and fix it myself. The following will fix the bug, but it involves turning off the MagPie cache used by the fetch_rss function. I don’t really know what this means, but the cache is likely there for a reason and turning it off is probably not ideal, or recommended. However, this did get my new tweets appearing again, so it will have to do until an official fix is released. If you want to do the same, here is how I did it:
- Log in to your WordPress Administration Interface (usually http://www.yoursite.com/wp-admin)
- On the navigation bar on the left hand side of the page, click on the Arrow next to Plugins. You should see an expanded submenu.
- From this submenu, click on “Editor” to bring up the Plugin Editor
- You should now see a large text editor with the code for the first of your plugins showing in it (Akismet in my case). On the right hand side should be a list of plugins. Find “Twitter for WordPress” in this list and click on the link.
- You should now be able to edit “twitter.php” in the text editor. Scroll down just below the copyright notice until you find the line: Â
define('MAGPIE_CACHE_AGE', 120); - Add a new line under this and paste the following:
define('MAGPIE_CACHE_ON', false); - Click the “Update” button at the bottom of the page to update the plugin file. That’s it, your twitter plugin should now be showing new tweets once again.
Note: your plugin file will need to be writable in order to perform the above procedure. If it’s not, either make it writable using an FTP client or SSH, or else simply edit the file manually by downloading it with FTP or via SSH. As I said above, this is almost definitely not the best solution to this problem, but one that should make do until an official fix is released by the plugin author.
FYI the new version (1.9.2) of the Twitter for WordPress plugin is available. This release includes the fix above, so I recommend simply upgrading to the new version of the plugin.
Joe Lennon
13 Dec 08 at 2:53 pm