NLFlickrAlbumRenderer Plugin

Having with WordPress since about 2005, building sites, blogs, a few web applications, communities and really just enjoying it’s use as an extensible framework for rapid development. I’ve created my own themes, plugins and other extensions – but always kept them for myself, not out of any selfishness but they were “by me, for me” and I wasn’t sure they’d benefit anyone else. I have pared back my development against the WordPress framework recently, erring for a more “basic” site – simpler to maintain, as this isn’t a job, it’s just me doing it for me…
However, recently I have spent a couple of days working on a plugin that suited my needs, but also may be of use to others – either as a curiosity on basic plugin development or integration with Flickr. The NLFlickrAlbumRenderer does what it says on the tin: Renders a Flickr album – with a few niceties:
- 3 rendering options: List, Grid or Masonry
- Integration with FullScreenLightBox.js
- Caching of photoset data to reduce API calls
- Instantiated by a shortcode
- API key and user Id administered within the blog admin
The shortcode needed is:
[NLFlickrAlbum photoset_id="{id}" layout="{layout}"]
- {id} to be replaced with the photoset Id from Flickr
- {layout} to be replaced with either “list”, “grid” or “masonry”
This will call the plugin to:
- Connect to the Flick API using the API key and user Id provided
- Get the photoset using the photoset_id provided
- Get the photos in the photoset
- Get the info for each photo
- Get the sizes for each photo
- Store the output of the combined API calls as a cached JSON file
- Check the cache
- Use the JSON data to render the photoset
There’s not much to say about this – it’s not the best plugin ever, it basically does one thing and I am open to any suggestions that it could do it better. But it works for me, and I’ve made it as generic as needed to feel comfortable sharing it.
Code is available at: Github.com/NLouch/NLFlickrAlbumRenderer