inlineRSS - WordPress Plugin Review
I’ve been thinking lately that my top-level blog sites (blogs.dpotter.net and david.blogs.dpotter.net) should display a list of posts from the blogs they front. I finally got a bee in my bonnet about it and did a search for plugins that would do the trick. I found two that said they’d do it but only one of them actually worked - inlineRSS by Cal Demaine.
Overall Grade: A
Plugin Name: inlineRSS Version: 1.1 Plugin URI: http://www.iconophobia.com/wordpress/?page_id=55 Description: Allows inline RSS feeds from any source in any format (hopefully). Click here to edit the sources and here to edit the xslt file. Usage in templates: inlineRSS('feedname');Usage in posts / pages!inlineRSS:feedname. This flavour uses multiple processing engines.Author: Cal Demaine Author URI: http://www.iconophobia.com/
Installation
This plugin requires a few more steps than most of the plugins I’ve been testing lately.
- Make sure you have the XSL PHP extension installed.
- Copy the files to the inlineRSS folder below wp-content\plugins.
- Activate the plugin.
- Edit the inlineRSS.txt file to add your feeds.
- Copy your inlineRSS.txt and inlineRSS.xslt files to the plugins folder (more about this later).
- Give your web server write access to the wp-content\plugins folder (more about this later).
- Add either !inline : feedname (with no spaces) in posts or pages or add inlineRSS(’feedname’) in page templates.
I didn’t realize I needed to check for the first step until I had spent a bunch of time and tried to debug through the code (good ol’ echo). It would have been helpful if the author had included that step in the installation instructions somewhere in a requirements section.
The default location for all files is the plugin folder. I didn’t like that very much, so I modified the code in the following ways:
- Moved the location to look for inlineRSS.txt and for XSLT files to be the plugin folder itself. I’m not completely happy with my solution as it hardcodes the name of the plugin folder. I seem to remember there being a way to find the plugin folder generically, but I could be remembering that for themes.
- Moved the location for cached feeds to be wp-content\cache. I didn’t like the idea of opening up my entire plugins folder.
The changes are pretty simple. At the top of the inlineRSSparser function, modify the $path variable and add the $cachepath variable, like so:
$path = ‘wp-content/plugins/inlineRSS/’; // Where to look for all config files
$cachepath = ‘wp-content/cache/’; // Where to look for cache files
Then on line 93 change the definition of $casualpathname from this:
$casualpathname = ABSPATH . “wp-content/” . $fileprefix . $casualname . “.xml”;
to this:
$casualpathname = ABSPATH . $cachepath . $fileprefix . $casualname . “.xml”;
To specify which feeds to read, modify the inlineRSS.txt configuration file. The file that comes with the plugin is very well commented. Each line represents one feed and contains a comma-separated list with the following fields:
- Friendly name for the feed. The code refers to this as the casual name.
- URI for the feed.
- Number of minutes before the cached for the feed is discarded. The default is 30 minutes.
- Name of the XSLT file. The default is inlineRSS.xslt. I wasn’t sure if the file extension was required, so I tried it both ways and encountered an error when I didn’t add the extension.
There’s an example in the file pointing to Cal’s feed so you can easily test it out before spending any time adding your own feeds.
Usage
The plugin provides both a function and a filter - a very nice touch for adding feeds to pages and posts. To display feed items for Cal’s site on a post or a page, write the following:
!inlineRSS : iconophobia
(without the spaces, of course). To display the same feeds when using a page template, make the following call:
inlineRSS('iconophobia');
The plugin page contains an FAQ with references to alternate XSLT files for different purposes. One that looked interesting said it would display only the top 5 feed items. Unfortunately I couldn’t get that one to work. I did make one change to the standard XSLT file to add a title attribute to the <a> tag.
Wishlist
There are a number of feature that would make this plugin even more useful, which I might tackle over time:
- Provide an admin interface. Modifying the text file is a little clunky.
- Store the configuration in the database, either in the wp_options table or in a table specific to this plugin. This is an almost obvious follow-on to providing an admin interface.
- Store cached feeds in the database, e.g. in a table named wp_rsscache. This would obviate the need to modify permissions on file system folders and close up a security hole.
- Allow the number of feed items to be specified as an option. Since all the heavy lifting is done by an XSLT script, I’m not sure this is even possible.
Conclusion
I’m pretty pleased with the simplicity and ease of deployment of this plugin. It isn’t as feature rich as others, but it works (unlike the getRSS plugin which uses the built-in Magpie RSS functions - I couldn’t get that to work on my installation, probably because I’m missing another PHP extension). It’s also very flexible, allowing you to completely customize the resulting HTML code that is generated. I’ll be using this plugin. You can see it in action at blogs.dpotter.net.



Loading... 
Leave a Reply