pictures and musings about our projects and passions

Writing a WordPress Plugin

Writing a WordPress Plugin

When Kim and I first started out blog, we poured over many WordPress Themes, trying to find the right one that suited our needs and that we liked the looks of.  One of the things that Kim really wanted was a “Photostream” of recent pictures, similar to the one on Matt Logelin’s Blog.  That Photostream uses a Flickr account, and we just wanted to upload the pictures directly into our blog posts.  I couldn’t find a WordPress Theme that had such a feature, but we settled on a theme with a “Recently Added” pictures feature.  But this didn’t quite meet the requirements of my #1 user.  I ended up finding a plugin called Post Image Gallery that had a lot of the features that we wanted, but still required a lot of tweaking to make it work the way that we wanted.

So what you see on our current blog home page is my tweaks to the Post Image Gallery plugin.  And every time I look at our blog it bugs me.  Mainly because the images in the photostream aren’t cached or resized.  They are the actual images from our recent blog posts which are resized on the browser side.  What does that mean? It means really slow load time!  And that’s what bugs me.  That, and the fact that I’ve had to tweak (aka hack) the code in Post Image Gallery to get it to do what I want.

So I’ve undertaken writing my own plugin to improve on the features availible in the Post Image Gallery plugin.  I’m calling it “Kim’s Photostream” since most of my requirements come from Kim.  When learning any new technology, there’s a lot of learning to be done.  It took me a week just to get the upgrade process working with the WordPress.org Plugin Site.  But I’m making progress. I’ve set up my plugin in the WordPress Subversion Repository.  I’ve figured out how to search through all the recent blog posts and find the images in them.  Next up on my list is creating thumbnails for those images (and cleaning up thumbnails that are too old) and finally creating a function to display Kim’s Photostream.

I think I’ve got a pretty good design, and I think that in a few weeks, I can have version 1.0 of Kim’s Photostream Plugin complete.  A couple of weeks?!?  Yeah, well, I have a full time job.  So, in the mean time, stay tuned, and hopefully soon, I can demo the Plugin for you.  And soon I can replace the Post Image Gallery with Kim’s Photostream on our blog!



3 thoughts on “Writing a WordPress Plugin”

  • Quick Update: The plugin is finished! I’m doing a little burn in testing to make sure it’s 100% ready for release. Should be soon!

  • Really looking forward to testing it out and giving some feedback. I’ve been looking for a photo plugin like yours to use on my blog. Hoping it gets released soon. 🙂

    • Hi fruityoaty!
      Thanks for your comment. I released Version 1.0 of my plugin TODAY! It’s available from the WordPress.org Extend Plugin Site: http://wordpress.org/extend/plugins/kims-photostream-plugin/

      I did find one problem during testing which is indicated in the release log. Basically the thumbnails are generated via PHP and in memory. I found that sometimes (and I haven’t figured out the sometimes), the build thumbnails process can use all the memory availible to PHP Scripts. You can fix this by increasing your memory_limit in your php.ini file. Instructions on how to do this can be found on Google.

      I’m looking into a fix for this, as soon as I figure out why it happened. I *think* that maybe it has to do with the size of the original image. More to come…

      In the meantime, please let me know what you think!

Leave a Reply

Your email address will not be published. Required fields are marked *