Chip's Tips for Developers

Contains coding, but not narcotic.

OPML Blogroll widget update 1.2

March 4th, 2007 3:09:57 pm pst by 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!

31 Responses to “OPML Blogroll widget update 1.2”

  1. [...] The only plugin that failed to operate as expected was my own OPML blogroll widget, which needed a couple of tweaks. [...]

  2. [...] OPML Blogroll widget update 1.2 — Chip’s Tips for Developers Chip is an OPML star! (tags: opml web20 blogroll widget) [...]

  3. [...] New improved version 1.2here. Tags:Chip’s Tips for Developers: autodiscovery blogroll dead20 opml php phpopmlroll [...]

  4. cooper says:

    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.

  5. Hey cooper, thanks for dropping by. Glad to be of help.

  6. 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

  7. 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).

  8. That is excellent – this is a great widget and the opml-browser will be the icing on the cake.

  9. I’ve posted the new opml-browser widget (hierarchical) here.

  10. Mark Barnes says:

    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?

  11. 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.

  12. [...] Giant Blogroll.  Having authored not one, but two such widgets for WordPress, I naturally disagree.  I think your blogroll tells [...]

  13. [...] opml-browser widget are copied to the first opml-browser widget.  Thanks to Mark Barnes for suggesting this [...]

  14. [...] existing opml-browser widget are copied to the first opml-browser widget. Thanks to Mark Barnes for suggesting this [...]

  15. [...] OPML Blogroll widget, by fabulous Sterling Camden, to [...]

  16. Diego says:

    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

  17. Diego says:

    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!

  18. Diego says:

    Great, Chip! Thanks, I’ll be waiting for the notification on my admin panel :D

    Cheers!

  19. Diego says:

    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

  20. [...] to a suggestion from Diego, I have added tooltips to each entry in the OPML Blogroll widget for WordPress.  [...]

  21. weeksgo says:

    That’s a cool widget!

  22. FitLine says:

    Thanks for the tips.
    This is new to me, I need to learn a lot from your blog. Thanks

Leave a Reply

Better Tag Cloud