One of my New Year’s resolution for 2011 is to publish my first open source project, and that’s what I decided to do today. One of the projects I’m working on (a WordPress site) needed a sidebar widget that looked like a calendar, with each cell being a month showing how many posts were published on that month. Since I couldn’t find a plugin with that functionality, I decided to write my own. After I finished writing the plugin for the project, I realized that it was fairly simple to make it more generic and publish as a WP plugin.
Writing a WordPress plugin is quite simple. There are a few things you need to do to make it a sidebar widget (basically you just have to extend the
WP_Widget class and implement a few functions) but nothing too complicated. I also took the opportunity to learn how to use AJAX inside a WP plugin, since I didn’t want to refresh the whole page when changing years in the calendar.
So there you go: today I’m publishing my first open source project, a WordPress plugin called Month Calendar. The source is available at GitHub, and the plugin is also published on WordPress Plugin Directory. It’s an important milestone to me, and it was a fun pet project. I learned a few things while making it, and now I feel ready to write a couple more complex plugins I’ve been planning.
Fun fact: the hardest part in the development process was to publish the plugin to the WordPress Directory, since I use Git and WP forces you to use a SVN repository. But after playing with Git’s SVN bridge for a while, I found an elegant solution. Since it’s not trivial as I thought it would be, I may write a blog post someday detailing the whole process.