Building WPGlow for the WordPress Download Counter

A few WordPress releases ago, I decided to build a “realtime” download counter (which I’m calling WPGLow). It relies on the official WordPress download counter, but instead of updating the count every few seconds, it periodically increments the count by one. The rate at which it increments is determined based on how many downloads there have been since the last time the official counter was checked, so it keeps up pretty well with the official counter. That said, if you look at them side-by-side, you’ll notice that WPGlow is a little behind. This is because it is counting up to the current download count, so it’s always a few seconds behind. If you look at other “realtime” download counters, like the one Mozilla used to have (before they released a new version of Firefox every other day), you’ll actually notice that they do the same thing, except they’re usually at least a minute behind. They just get cached data from the last-minute or two, and then display it in realtime like it’s fresh.

Anyway, I wrote this counter a while ago, but I had some weird bugs that I never fixed, so I never released it. When WordPress 3.3 came out, I decided to revive it. Here it is!