When I first created the MLB Standings plugin I had assumed that most blogs to use it would be fan blogs of specific baseball teams. The plugin shows the standings of only one division because such sites will want to display the standings of the division that their team is part of. Another thing such blogs would probably like is the option to highlight their team in their division’s standings but I was in a rush to deliver version 1.0 and didn’t have the time to add that option on the initial release. I had resolved to add this feature in version 1.1 of the plugin but a funny thing happened on the way to 1.1.
While working on this one feature I actually ended up adding a whole lot more. Most of them are under the hood but some of them are visible. For example the menu to choose a team to highlight uses AJAX to only show the teams in the division selected in the Division menu. Implementing the Team menu in this way removes the possibility that a user may accidentally choose a team from a division that isn’t going to be displayed.
While discussing this with a couple of colleagues some under the hood ideas came out. For example using the WP_http protocol to download the XML file. Though this change is transparent to the user it removes the dependency on having cURL on the server end. Also switching to the WP Transients API instead of a custom function to determine when to update the XML. The third idea was to save the XML to the database instead of to a directory on the server. This eliminates the dependency on the server’s file system as well as making file permission issues a thing of the past.
All this and a rewritten settings page that uses the WordPress settings API better, a link to the settings on the Plugins page and some refactoring to eliminate unnecessary settings & variables and you can see why this is much more than a 1.1 version.
So I now present MLB Standings 2.0. Check out the MLB Standings page for more details and download links. This is an almost complete rewrite of the plugin so if you tried it before and it didn’t quite work for you please try it again.