I wrote early last month on an employee workplace feedback tool we launched using our WordPress MU installation and the Survey plug-in. Overall the plugin worked well. Here is a screen shot of one of our forms:
The main issue was a problem in the table that holds the responses. The field that stores the user answer is limited to 255 characters, but no limit is enforced on the form. And when users are invited to submit free form comments they quickly exceed the 255 limit. The result is that a number of the responses were cut off in the database, and some of the user response was lost. Not the nicest thing to realize after the fact, but luckily the fix is easy.
To make the alteration change open the plugin’s surveys.php file and find the create table section. Right around line 101 you’ll see the code that creates the surveys_result_answer table. Alter the ‘user_answer’ column to use the blob data type — you’ll see it is set to a text(255) type, which is too short for many users.
CREATE TABLE {$wpdb->prefix}surveys_result_answer ((
`ID` int(11) unsigned NOT NULL auto_increment,
`result_ID` int(11) unsigned NOT NULL,
`answer_ID` int(11) unsigned NOT NULL,
`question_ID` int(11) unsigned NOT NULL,
`user_answer` blob NOT NULL,
PRIMARY KEY (`ID`),
KEY `question_ID` (`question_ID`),
KEY `answer_ID` (`answer_ID`),
KEY `result_ID` (`result_ID`)
) ;
This small change fixes that problem. The only other note is we used this tool on a members-only site. I’d want to give it a thorough security check before using this on a public site. I did note the user-text was escaped, so it looks like some protections are in place. But these days you can never be too security conscious.
Surveys < Plugins < WordPress < Tools < Bin-Co
Surveys WordPress plugin lets you add surveys to your blog. You can let the visitors take surveys and see the result from the admin side. The user who take the survey can enter their details at the end of the survey – or leave it as an anonymous result.
ADD YOUR COMMENT
Comments are moderated.
Randall Rode's online home for thoughts, notes, and experiments with a wide range of technology topics. Visit the about page for info on my recent projects and professional background. I welcome your comments!
New articles are normally posted on Mondays and Wednesdays. Subscribe to the RSS feed or the email update to keep current on the latest posts.