I’ve just written my first major WordPress plugin, BookLinker. It was developed for another of my websites, which features quite a few book reviews; the philosophical reasoning behind it is here. But it was also an interesting little glimpse into the WordPress programming paradigm.
The plugin’s goal was to make it easy for me to switch Amazon affiliate links, or augment those links, with links to other book sources. It was prompted by the “#amazonfail” fiasco of a month ago, but the need for such a tool goes deeper than one incident. I want to encourage people to buy books from other places, like Powell’s or IndieBound, or to get them from their library, but the thought of changing all those Amazon links was daunting.
My original thought was to write something that would go into each blog post with an Amazon link and change it to an IndieBound or Powell’s link. But as I looked into the variety of link formats that Amazon provides, and the number of links on my sites, that seemed a more dangerous way to go: it would be difficult to back out a data change like that.
I like the WordPress plugin architecture. It’s very easy to use the “hooks” and extend the functionality of the core system, which makes for a rich and varied ecosystem. This is certainly one of the best arguments for open architecture as well as for open source.
The thing I like most about this plugin is the UI. I was able to reuse some concepts from the last professional project I had, and build a nice little modal window to hold the collection of links.
You can see it in action here, with this link to Effective Java (2nd Edition) (Java Series); buy it from Amazon if you must, but you can’t blame me for limiting your choices.