OPML Blogroll widget update 1.2
Sterling Camden
Sorry Paul, this isn’t the big update you’re waiting for — just a few loose screws that needed tightening up.
After upgrading to WordPress 2.1, I noticed that the RSS icons in my OPML blogroll widget disappeared. I was using an image that is no longer distributed in the same location, so I put a copy of rss.png in the wp-content/widgets/images directory.
Taking a look at how I was referencing images, I realized that it also wouldn’t work if your blog was not in the root folder of your domain. So I added a call to get_settings(‘siteurl’) to fix that up.
Last month I nearly ran out of bandwidth on Chip’s Quips, and after analyzing the requests I found that nearly half of the bandwidth for the month was consumed by requests for my OPML file. In my case, the OPML file resides on the same server as my site, so there’s no need to request it over HTTP. I added a “Local path” option to the widget which, if specified, will open the file locally.
So now of course the “OPML URL” option is no longer required. If you leave that empty, then the auto-discovery link will be suppressed. It doesn’t make much sense to auto-discover a link on the local file system.
I also discovered that WordPress’s cache support in wp-includes/cache.php ignores the $expire parameter that you can pass when adding or setting cache data. This has not been fixed in WordPress 2.1 either. I’ll have to come up with a better solution so the OPML file doesn’t get banged every fifteen minutes, whether or not it’s on a local drive. But we’ll leave that for the next revision.
UPDATE (3/29/07): Tony Lindskog found a bug where a feed that has no “text” attribute caused a regular expression parsing error, and Paul McGillivary found a missing end-quote in the auto-discovery link. I’ve included fixes for those as well.
UPDATE (3/29/07): For an OPML plugin that preserves the hierarchy within the OPML file (categories, usually) and lets you expand/collapse that hierarchy, go here.
UPDATE (4/17/08): The latest version of this plugin can be found here.
Posted in OPML, PHP, RSS, Web, Wildly popular, WordPress |
31 Comments » RSS 2.0 | Sphere it!





[...] The only plugin that failed to operate as expected was my own OPML blogroll widget, which needed a couple of tweaks. [...]
[...] OPML Blogroll widget update 1.2 — Chip’s Tips for Developers Chip is an OPML star! (tags: opml web20 blogroll widget) [...]
[...] New improved version 1.2here. Tags:Chip’s Tips for Developers: autodiscovery blogroll dead20 opml php phpopmlroll [...]
Ha, I had no idea why it would matterif I had that feed open.
I can see now that it affects hits.
Obviously I need to come here more often, I need all the help I can get.
Hey cooper, thanks for dropping by. Glad to be of help.
Chip,
Excellent script, thank you for fixing the little issue I had and I am really looking forward to the next version that will preserve the hierarchy of the links.
.T
Thanks, Tony. I haven’t uploaded that correction yet, but I plan to do so soon. And the opml-browser widget I’m planning should be done in the next few days (I hope — PHP debugging always takes longer than you think).
That is excellent – this is a great widget and the opml-browser will be the icing on the cake.
I’ve posted the new opml-browser widget (hierarchical) here.
Thanks for this, it’s just what I need. However, it doesn’t work with multiple OPML feeds – that is, you can’t use the widget twice – at least you can’t with K2 widgets. I’ve got around the problem by duplicating the plugin and renaming the function in the second file, but it’s a bit ugly. Any chance of an update for multiple OPMLs?
Mark, I’ll plan on adding that. Also, have you looked at the OPML Browser widget? That widget preserves OPML categories, so you might be able to merge your lists into one widget, if that’s appropriate.
[...] Link zum Plugin [...]
[...] Giant Blogroll. Having authored not one, but two such widgets for WordPress, I naturally disagree. I think your blogroll tells [...]
[...] opml-browser widget are copied to the first opml-browser widget. Thanks to Mark Barnes for suggesting this [...]
[...] existing opml-browser widget are copied to the first opml-browser widget. Thanks to Mark Barnes for suggesting this [...]
[...] OPML Blogroll widget, by fabulous Sterling Camden, to [...]
Hi Chip,
I love your plugin, and been using it for quite some time now. The only request I have for your next update is that it shows each link’s extended info in a hover text when you point your mouse over that link. It’s really important for readers to know a little about the link and even more for SEO reasons
Cheers,
Diego
http://www.drbolsa.com
That’s a good suggestion, Diego. What element(s) would you specifically like to see? It seems that the OPML spec has several flavors of “text”, “description”, “title”, etc. Currently, this plugin displays the “text” element if found, otherwise the “title” element.
I was thinking about “description”. It’s great to let people know about what the link is.
Do you think I could do a quick mod in the plugin? Or should I wait for your new release?
OK, will do.
Hello again Chip
Thanks for your last reply. I want to ask you to make that plugin upgrade compatible with WP 2.5 (OPML-Blogroll 1.2 stopped showing in th widget area of my recently upgraded WordPress).
When do you think you will release it?
Thanks for a great job!
Diego,
I’ve got it running on WordPress 2.5 here.
Maybe you should try deactivating/reactivating the plugin?
I’ll try to get an update out sometime this week.
Great, Chip! Thanks, I’ll be waiting for the notification on my admin panel
Cheers!
Hey Diego,
Just wanted to let you know that I haven’t finished the new version yet, but I expect to put it up on Monday. Have a great weekend.
Chip
Hi Chip,
I can see the updated plugin notification in my WP Control Panel, but the link points to whe “widgets plugin”, so I couldn’t find the updated file yet.
Thanks for your work mate!
Diego
I haven’t updated it yet, Diego — but I plan to before the end of the day (Pacific time).
[...] to a suggestion from Diego, I have added tooltips to each entry in the OPML Blogroll widget for WordPress. [...]
That’s a cool widget!
Glad you like it!
Thanks for the tips.
This is new to me, I need to learn a lot from your blog. Thanks
Glad to be of help.