wp-SwimTeam v1.18.747 released

This afternoon I released v1.18.747 of wp-SwimTeam.  This release includes what I am calling Phase 1 of the new Event Model.  The event model has been completely overhauled in anticipation of being able to generate Meet Entry files in SDIF format directly from wp-SwimTeam.  The whole Events tab looks and works differently.  Events are collected into what I call Event Groups.  This release adds the ability to import events from a Hy-tek Events File (.hyv).  Events are managed (added, deleted, imported, re-ordered, etc.) within the context of an event group.  In Phase 2 events will be connected to a swim meet via an event group although the swim meet will still retain the ability to re-order the events on a meet by meet basis.

Key features in this release are:

  • Phase 1 of overhauled Event Model is complete. The new Event Model introduces the concept of Event Groups. Events are now defined in the context of an Event Group. Swim meets currently do not have any connection to Events but that will chance in a release fairly shortly in Phase 2.
  • Added ability to import events from a Hy-tek Events File (.hyv) into an Event Group.
  • Added ability to delete all events from an Event Group.
  • Changed Google Maps API Key from required to optional. If the API key hasn’t been entered, wp-SwimTeam will now gracefully work without it.

I changed a lot of code in this release, if you run into anything odd or functionality that isn’t working or behaves differently, let me know ASAP and I’ll do my best to fix it quickly.  Now that I am back to a stable code base I should be able to turn bug fixes pretty quickly.  That is hard to do when you’re doing a bunch of remodeling!

This release has been committed to the WordPress Plugin Repository so you should an update notification on your Dashboard.  You can also download it and manually update it from the Download & Installation Page.

Edit (4/16/2012 @ 10:07 AM):  This update includes a database update so you must de-activate and re-activate the plugin after updating to have the database upgrade run.  One of these days I’ll figure out a more elegant way to do this!

wp-SwimTeam v0.1.417 – Meet Report Shortcode

I posted wp-SwimTeam v0.1.417 this afternoon to the download page.  This update adds new functionality and fixes a few minor things which have bothered me as I found them during the season.

The big new feature is a new shortcode – wpst_meet_report.  This shortcode allows a the contents of a meet report to appear in a post or a page like this example on the wp-SwimTeam demo site.

The reports also now support hiding first and last names by only showing the initial as well as the ability to override the first name with a nickname if the swimmer’s profile has one.  The missing ability to display a map on the swim meet report has been added so the checkbox on the form is now enabled.  The reports can now display opt-in and opt-out information chronologically in the order they were added to the system as well as the previously available by name and by swimmer label.

wp-SwimTeam demo up and running

I have spent quite a bit of my free time lately re-working my wp-SwimTeam WordPress plugin in a quest to get a demo site up and running.  In the process I changed quite a bit, some because I had no choice, some because I was knee deep in the code and decided it was time to fix some things I wasn’t real happy with.

A lot of the work involved working with Google Maps API.  The Google APIs are really pretty cool, if you need to do some work with AJAX or Javascript, they are worth looking into.  I ended up using the new Google AJAX API (which can load the Maps API) and the new syntax.  There seems to almost no performance degradation from loading Google’s JS libraries as compared to loading them directly from the host site.

A bunch of the work was neccessary because GoDaddy, the provider hosting the demo site, doesn’t support PEAR which I was using to access the database.  I needed to migrate to the WordPress database abstraction layer.  As opposed to just hacking up the plugin to do this, I decided to do it right and enhance phpHtmlLib with a new database abstraction layer specifically for WordPress.  I also made the changes to phpHtmlLib to make it into a WordPress plugin.

All in all, a lot of work behind the scenes which isn’t visible to the end user but in the long will make using wp-SwimTeam by other people much easier.  There are quite a few posts on my wp-SwimTeam development blog if you are interested in all of the nitty-gritty details along with my frustrations with GoDaddy Support.

Google Maps problem is fixed!

Last night I fixed the Google Maps problem by re-coding the way I was getting the data from Google.  I had been using a class called Phoogle but have eliminated it in favor of a direct AJAX solution using Google’s AJAX API.

Instead of embedding this new solution in the wp-SwimTeam plugin, I implemented as a widget in phpHtmlLib.  It works pretty well too!

Demo Site is running … sort of

The nice folks at WinSwim are interested in what I am doing with this plugin and have offered to host a demo site.  You can find it at:  http://wp.winswim.com  The demo site is running for the most part, if you are interested in trying it out, go ahead and register with the demo site then drop me an e-mail so I can change your permissions so you can actually do something other than register sample swimmers.

I say the demo site is running “sort of” because just about everything is working although there are a few bugs I know of (e.g. defining age groups).  The one thing which isn’t working and it is driving me nuts is the ability to display a Google Map.  This is a really nice feature that my own team used quite a bit this year.

I have encapsulated a class called Phoogle within wp-SwimTeam and it worked just fine in my development area and on the MacDolphins site.  Phoogle relies on a PHP configuration option known as allow_url_fopen which basically allows PHP to open a web page on an external site and read the content like it would a local file.  It’s a nice feature but one that a lot of web hosting providers turn off.  In fact, the host for the demo site has it turned off.

There is another technology called cURL which for all practical purposes, accomplishes what allow_url_fopen does although it is a little more involved.  I enhanced Phoogle to use cURL if allow_url_fopen is disabled and it worked just fine in my development area.  Great!  The change was pretty simple too.  Uploaded to the production server and nothing.  It doesn’t work there.  It turns out that GoDaddy (the web hosting provider) has a goofy cURL implementation which requires the use of a proxy.

After a much trial and error and a couple e-mails with GoDaddy support, all I have accomplished is a partial cURL request.  I am unable to get a complete response which prevents the map from being displayed.  I then got another e-mail from GoDaddy telling me that cURL is only supported on their Linux hosting environments not under Windows (even though it is enabled in PHP.ini).  Bleh.  ;-(

I think for now when I find a short code, I will check the allow_url_fopen setting and if it is off, will issue a warning during the short code processing.  There is probably a way to interact with the Google Maps API via Javascript, I guess I will need to look into that.  It is really too bad, the Phoogle solution was really simple to use.