Wordpress.com Sidebar Widgets In A Self-Hosted World

Posted on in category Web Development

I recently migrated a WordPress.com hosted site over to a self-hosted environment, which was going smooth as silk, until I compared some of the sidebar widgets on the .com site to what was available on my .org environment. It was puzzling that the “Image” and “Upcoming Events” widgets weren’t available on the .org side. “No matter.”, I thought, I’ll just download Jetpack and the world will again be my Thanksgiving Cornucopia. Jetpack indeed had the “Image” widget, but no sign of the “Upcoming Events” widget. What the!?

Surely this is an oversight on the part of my Automattic friends. Seems like such an easy little thing to develop. You add your iCal style event feed URL in the widget parameter, set the number you would like to show, and kablammo! Event list city! I scoured message boards but alas, this little nugget just wasn’t available. I searched for a similar plugin, but I found that they were just a little too complicated for my needs.

And so, I decided to write my very first plugin. I’ve written a couple of sidebar widgets before, using the very awesome Widgets Helper Class, so I thought this would take no time at all. I can honestly say it was probably one of the easiest feeling code exercises I’ve ever done. I was able to create something that looked and felt exactly like the “Upcoming Events” widget. Of course the bulk of the heavy lifting was done by this great¬†ICS Parser I found as well as the aforementioned¬†Widgets Helper Class. So super kudos to them!

The plugin is currently in review at WordPress.org, however I’ve posted right here in case you feel like taking a plunge.

.zip file: ical-list-widget