WordPress Google Form Enhancements

Several people have asked for enhancements, many of which are similar. The most common request is to add either pre-filled or hidden fields based on something WordPress knows about. A recent request was to add tracking so a form could only be submitted by a user once. I am certainly not opposed to adding features like these, I think most would be pretty useful. However, there are some things to think about before implementing a solution or adding new features.

  1. To auto-fill a field or populate a hidden field, the field must be mapped from what the column is called on the Google Docs side of the form to something WordPress knows about (e.g. username, email address, etc.). How should this mapping be done? Arguments as part of the shortcode? For anything to be posted to the form processor on the Google side, the field must be defined on the form so the results spreadsheet has a corresponding column. For hidden fields, wpGForm would have to turn what is an existing field (which may or may not be a simple text box) into a hidden field with a value supplied by WordPress. This isn’t impossible, jQuery can do much of the work fairly easily but the problem is it is fraught with potential errors so I am reluctant to add it until I have a better idea how to bullet proof it. Pre-populating values is fairly easy, as long as we know what the field name
  2. I’ve considered, and posted about, introducing a Custom Post Type for forms. If I do this, then it makes addressing the tracking aspect fairly easy because the CPT id could be stored as part of the users meta data. That is pretty straight forward once the CPT exists (which it doesn’t yet). However, it does require the user to be logged into the site which many people don’t want to allow. This could also be handled by the CPT which could in theory, define a new form as anonymous or not. An anonymous form would have some limitations, tracking being one of them.

I’ve got some ideas on how to implement these features, most of which would be pretty useful. Introducing a CPT is absolutely on my radar screen but right now I am focused on my Swim Team plugin as we’re gearing up for Summer Swim Season here in North Carolina. Once I knock out my to-do list on the Swim Team plugin I’ll come back and look at adding the CPT for WordPress Google Forms which would facilitate adding some of the requests people have asked for.

wp-SwimTeam v1.20.786 released

I have just pushed out v1.20.787 of wp-SwimTeam.  This release fixes a pretty serious bug in the Jobs module.  If Jobs were assigned using the Swim Meets tab, other jobs could potentially be unassigned, possibly even from prior seasons.  Hopefully my own team was the only one affected by this problem.  The WordPress Plugin repository has been updated as has the Download & Installation page.

wp-SwimTeam v1.19.783 released

This afternoon I released an update to wp-SwimTeam.  This latest update continues work on the new Event Model.  Events can now be imported from a Hy-tek Events File (.hyv) and connected to a swim meet.  I also made a number of GUI improvements to fix flow control and be more intuitive.  Other changes include:

  • Fixed wp-SwimTeam so it will work in sub-directory installations and WordPress multi-site.
  • Added new option to toggle message verbosity. Some actions generate numerous messages, this option will reduce and summarize messages.
  • Fixed Event Opt-In/Opt-Out which was broken with Event Model changes in v1.18.
  • Added ability to load Meet Events from an Event Group into a swim meet.
  • Fixed broken GUI controls for Events (expand, collapse, page forward and back).
  • Tightened up flow control between Event Groups and Events and Swim Meets and Events.
  • Changed buttons on for some actions (events, swim meets) to return to a logical place. “Back” and “Home” didn’t really mean anything in most cases. In particular, “Back” has been a reliability challenge so in most cases it has been eliminated.
  • Fixed several bugs in report generator which manifested themselves when User or Swimmer optional field count was set to zero.
  • Fixed bug which resulted in broken Opt-In and Opt-Out actions on the drop down lists.
  • Fixed bug which incorrectly entered Opt-In/Opt-Out information in Stroke format even when set for Event Mode.

This update is available now from the WordPress Plugin Repository or from the Download and Installation page.  Existing users should see an update notification appear on the WordPress Dashboard.

If you run into any problems, please let me know and I will try and fix them ASAP.  We’re gearing up for swim team season so I am actively engaged in adding features and fixing bugs right now.  My next effort, which I’ve already started, is what I refer to as Phase 3 of the new Event Model which will provide the ability to export a Meet Entries file accounting for scratches and/or registrations which can be loaded directly into one of the various Swimming applications (e.g. Hy-tek, WinSwim, and others).

wp-SwimTeam v1.19 beta available for testing

I flew out to Phoenix and back this week and had some airplane time to work on wp-SwimTeam.  I have completed what I am calling “Phase 2” of the Event Model changes.  Events can now be assigned to a swim meet AND the Opt-In/Opt-Out system is working in the Event Mode (which I had broken in v1.18).

The majority of the work in this build is related to Events and their connection to swim meets which is the precursor to Phase 3 which will be the generation of Meet Entries in SDIF format that can be imported into tools like MeetManager and WinSwim.  I have also fixed quite a few bugs in the report manager which were present when either the User or Swimmer option count was set to zero.  There was some logic that didn’t test right and would result in using the default count which is 5.  So if you have seen checkboxes without labels on the User or Swimmer report generator, this has been fixed.

Please let me know if you run into any issues.  I am doing some testing with our team right now and we have our pre-season open house this weekend which tends to result in a good chunk of our registrations.  Assuming all goes well, I’ll release an update to the WordPress repository early next week if not sooner.

[download#14#image]

wp-SwimTeam and WordPress Multi-Site

I’ve had a couple requests to support WordPress multi-site installations with wp-SwimTeam.  The Tab Model and Form Processor I use require some URL manipulation to work correctly and my original implementation works fine for “normal” installations but breaks when installed in a sub-directory which is pretty common with WordPress multi-site.  I’ve put off fixing in favor of other things but recently did some work on another project which got me thinking about the URL problem.

After getting the Event Module done I decided to take a look at fixing the URL problem and found it wasn’t too hard to fix.  The bigger problem was how pervasive my broken solution was!  I think I have found every place which required a fix.  Before I release an update I’d really like someone to try it with multi-site and give me some feedback.

[download#14#image]

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!

Update on Events

I’ve been working on Events quite a bit over the last couple of days.  At this point I have all of the Event Management working again including the ability to import a Hy-tek Events File (.hyv).  I have not gotten to the point where I can connect the events to a swim meet but I don’t think that will take too long.  I will likely release an update with the progress I have to date.  Even with Events unfinished, it actually does more than the old Events Model does.  I have also fixed a few other odds and ends that I’d like to make sure get released sooner rather than later.

wpGForm v0.28 released

This morning I released an update to my WordPress Google Form plugin.  I can only assume very few people are using the email confirmation feature because it wasn’t working and I didn’t hear about it until this past weekend!  The email confirmation feature (add the attribute email=’on’ to your short code) will notify the WordPress administrator that a form submission has been made.

The update is now committed and should appear on your WordPress Dashboard shortly.

WordPress Google Form v0.27 released

This afternoon I have released v0.27 of my WordPress Google Form (aka wpGForm) plugin.  This release has some new functionality but more importantly, reverts the custom confirmation page to the redirect method which was present from v0.11 to v0.025.

If you prefer the AJAX style custom confirmation, which I do, it is still available by adding the short code attribute style=’ajax’ to your gform short code.

Changes for v0.27 are:

  • Added ability to check and warn for old and/or unsupported browsers. There is an option on the WordPress Google Form settings page to enable this check. When an old or unsupported browser is detected, a message will be displayed on top of the form. The browser check is based on the same functionality that WordPress uses on the Dashboard.
  • Changed default custom confirmation behavior has reverted back to using a javascript redirect as it did from v0.11 through v0.25.
  • Added new shortcode attribute, style, to control how confirmation pages should be handled. There are two options: style=’redirect’ which is the default and style=’ajax’which loads the page content via AJAX.
  • Added new CSS classes to support errors and warnings for the browser check and the inability to load Google Forms.
  • Cleaned up Options page GUI.

Highlighting Missing Fields on a Google Form

A user of my WordPress Google Form plugin asked how to highlight the required fields on a form but only after submitting for the form without providing all of the necessary fields.  Essentially, how show an error more clearly, much like Google does with their forms when run standalone.

Here is a form that has required fields before it has been submitted:
Form with required fields before submission
Here is a form that has required fields after it has been submitted:
Form with required fields after submission
Note that the form label is now red instead of the original black. To have the field text appear in red only after submitting the form without providing the required field, I used this CSS:
div.errorbox-bad div.ss-item-required label {
color: red;
}

If you use the prefix attribute in your short code you’ll need to adjust the class names accordingly. There are quite a few CSS tricks you can do to highlight errors and for experimenting, I recommend FireBug to tweak CSS without having to reload the page each time.