One of the things I liked on my old blog was the ability to have a Popular Posts section that was based off of Google Analytics. I had also like that I was using pre-caching, i.e., a cache that does not expire but is, rather, overwritten. There are two benefits to this. 1) There is no lag time when the cache expires and I need to contact Google to get new data. 2) If my connection goes down for whatever reason (bad data, time expired, modified password), the data stays in the cache until you can get the problem fixed.
So I had missed that, but it was not overly important so I left it. But yesterday was a day where I needed something that was both engaging and brainless to do. So I decided to implement my Job Queue API code for WordPress so that I could write a WordPress widget that would put the popular posts in the sidebar.
It was actually relatively easy to do. But the cool part was that I was able to extend WordPress, which still contains code that was written around when the Martini was invented, and PHP 5.3 code, which is what my Job Queue code was based off of. This is part of some “ESchrade enablement” which I am building as a WordPress plugin and so it contains some other stuff than just the JQ part of the plugin. You can download it from here and put it in your wp-content/plugins directory. There are some things that aren’t working quite right yet, and probably won’t. I don’t really have the desire to become a WordPress developer.
What have I learned or re-enforced from this?
- PHP backwards compatibility is pretty darn good
- If you build a software application, make building plugins easy, even if it’s your own app. (WordPress is kind of win/lose on this) I may end up looking at Event_Dispatcher.