This afternoon I uploaded WordPress Google Form v0.46-beta-13. Yes, this is the 13th beta release of WordPress Google Form v0.46. Why so many? Mostly because made a significant change to Google Forms at about the same time I was introducing a major change to WordPress Google Forms.
This release adds a new feature – the ability to log form submissions. This is something I’ve wanted to do for a while. The next update will include some settings to control the log (on, off, entries per page, etc.) but in this beta release, it is on and shows 10 entries per page. There is a known bug in the pagination of the log file. The URL to move between pages is wrong and I haven’t been able to determine how to add the CPT and page information which the URL requires to be valid.
Most importantly, this beta release addresses a major bug with multi-page Google Forms AND Google Forms with checkboxes that are created with the new version of Google Forms. This functionality needs testing so please put it through its paces.
Ugh. Google has made the process of using multi-page forms much harder than it used to be. In the older version of Google Forms the values were passed from one page to another in an array.
In the new version of Google Forms the data is still passed from page to page in a variable (called draftResponses) however PHP sees this data as a string instead of an array so the code which reformats the array from a PHP style (which WordPress uses) to a Python style (which Google uses) doesn’t run.
It looks like I will need to parse the string into a PHP array and then encode the array to be compatible with Python. As I said, ugh.
For a while I have wanted to have a log of form submissions. My interest in this has mostly been to understand the source of spam submissions but there are other reasons too. With all of the changes Google Forms have undergone recently, this seemed like a good time to add this functionality as I chase down what Google changed to cause multi-page forms not to work.
The logging functionality I have implemented will only work with forms defined using the new Custom Post Type (CPT) as the log data is stored as Post Meta data attached to the CPT for the form. In my current build I am working with all submissions are logged however there will be a setting to turn it on and off (default will be off) when I make a beta release available (hopefully today).
Access to the log is via a sub-menu selection from the Google Forms menu.
The log itself is implemented using the standard WordPress List Table class which provides a standard look and feel which WordPress users will recognize.
Log entries can be deleted (in bulk or individually but right now that is the only operation. Is there some other operation that would make sense? Export might make sense but I’ll defer on that for now.