SurveyPress
SurveyPressShow appreciation for SurveyPress
- Rate it on WordPress.org
- Tell you friends.
- Help support its development
SurveyPress is a tool that helps you create your surveys for your WordPress Blog. You supply you own forms and it takes care of all the rest, such as collecting the data. Surveys cay easily be downloaded from your site into your favourite spreadsheet package.
Requirements
- A basic knowledge of creating forms in HTML
- download SurveyPress.
- Copy to your ‘wp-content/plugins‘ directory.
- Log in with an administration account.
- Select the ‘Plugins‘ tab.
- Scroll down to ‘SurveyPress’ and click ‘activate‘.
To create a new template.
- Create a directory inside the ‘pages‘ folder inside the plug-ins directory.
- Name the folder to represent the template that you will use when inserting the survey into your post or page.
Inside the template directory you can create a number of files to modify the look of the form.
- form.html
- Purpose: this is the most important file of the all. This is the HTML form that will be used for the form. The only requirements for this file is that you omit the <form> tag and submit button as these will supplied by the plug-in.
- alreadydonemessage.html
- Purpose: This the message that will be displayed to the user if they have already filled in the form. This is optional, if it is not supplied a default one is used
- thanksmessage.html
- Purpose: This is the message that will be displayed when the form is submitted. This is optional, if it is not supplied a default one will be used.
- closedmessage.html
- Purpose: This is the message that will be display if this form is closed. This is optional, if it is not supplied a default one will be used.
- rssfeedmessage.html
- Purpose: There are problems filling out forms in RSS feeds so the form is disabled in the RSS feed. This is the message that will be displayed when the form is seen from an RSS feed. This is optional, if it is not supplied a default one will be used.
Anti-SPAM
The anti-SPAM is done by asking the user to name the nth colour in a random selection of coloured boxes. This does not require your site to have any graphics modules loaded.
Options
The Survey Data
As the surveys are completed, the data is attached as meta data to the post or page that the survey is on. This is done to integrate the survey data with the post or page, which allows you to backup or export your site without having to select any extra tables.
The Exported Data
The results are exported in the CSV file format, This can be easily imported into almost any spreadsheet or database. Along with the fields from you survey there a a number of other fields that are added to the file for information purposes. These are :
- ip
- Purpose: The ip address other the person who filled out the survey.
- HTTP_REFERER
- Purpose: The page that referred the user to the survey.
- form_page
- Purpose: The tittle of the post or page the survey is on.
- form_page_url
- Purpose: The address of the post or page the survey is on.
Version History
- 1.0.0
- Initial internal release.
- 1.1.0
- Corrected problems with radio buttons on forms
- Added once attribute
- Added time-out attribute
- Added antispam
- 1.2.0
- Added action for use with templates
- 1.3.0
- Updated Libraries
- 1.4.0
- Improved form loading. Added configure screen, added direct download.
If you liked this plug-in visits our download area where you will find many more.
If you have questions, have found any bugs, or you would like to see features added to SurveyPress please feel free to use the form at the bottom of the page to Contact us. If SurveyPress doesn’t fill your needs , feel free to Contact us to discuss a specially commissioned plug-in.
If you liked SurveyPress please:
- Tell you friends.
- Write a review and tell your subscribers.
- Rate SurveyPress on WordPress.org
You can also make a donation to Help support its development.


What would be the best way to require certain form fields to be submitted? I found some javascript that I could use, but it requires me to add an onsubmit event to the FORM tag. How would I go about that?
@Josh-
This is something that is planned, when we figure out a nice way that will work for most users.
Until then the easiest way for you to do it is with the script file you have. To add this copy the file ‘classes/surveypress/templates/default/mainform.html.php’ into you template directory. This contains the FORM tag, so you can add your onsubmit here.
One thing to note, this file is one of the templates files that shouldn’t really be changed or overridden, well without knowing what your doing. Changes are planed for this file. so just keep an eye on this when you upgrade the plugin. It should be just a matter of copying accross the new mainform.html.php if any changes are made in the new vesrion.
Thanks! I’ll do that and report my results!
That worked! Thanks a ton!
FYI, the script I used is here:
http://www.dynamicdrive.com/dynamicindex16/requiredcheck.htm
Hi, I can’t seem to get rid of the bit space that is between the page title and the actual form, I have put everything to zero and still gives me a large gap.
Cheers
@Neil:
This may be due to css on the containers the survey is held in.
If you post a link to the page, I’ll see if I can advise how to fix this.
Hi, I can’t give you the link because i’m running it on an intranet.
@Heil:
Ok,
if you take a look at the source html, and adjust the css to reduce the padding and margins for the elemets of the survey.
Hi,
Which one is the source? The one in \pages\example?
This is the one I put zero margin’s in for everything.
Thanks
@Neil- I was meaning the source that you see in the bowser. Depending the theme, things like this can happen, makesure that all the elements in the form fit into the width the theme sets, also remember the padding, this can cause things to overflow.
Hi,
Ok will have a go, thanks!
Hi! When I go to download the results from the dashboard, I get a blank php file (surveypress.php).
I also searched the db and results directory on my server and I don’t see any data.
Survey link: http://www.fatstylist.com/sabby-anand/everybody-counts/
Thanks
@Shareta: Sorry to here of your problems. Just double checked on the plguin on the test system and it does work as expected.
So there must be some incompatibility with your setup.
For your info, the data is stored in the postmeta table with the key “survey_data”, one entry per result. This is probable not much use unless you are a programmer.
The results directory was superseded with this new method in the last release to get round problems with file access.
What should happend when you click the download, is the surveypress.php you offer up the standard download box to download the csv file of your data.
At present there are two possible causes.
it could be caused by a popup blocker. If you could disable this if you have one and try it.
OR it could be something different with you installation. in which case could you inform us of:
your version of PHP
your version of wordpress
your OS
If you require the data quickly, installing an older version that exports the data to the results directory. This will solve the problem.
A permanent solution to the problem is now being looked into.
DCoda-
My pop up blocker is off and I tried downloading again and still got a blank php file.
I’m running PHP 5, WP version 2.6.1, Mac OS 10.4.11.
Thanks!
DCoda-
I just downloaded the table for survey_data and I see there is data being written to the db. I can see all my test answers.
Problem averted, DCoda. I downloaded an older version (1.1.0) and this works.
I wonder why the new version doesn’t work for me? That’s ok for now. Thanks for all your help!
Shareta:
When you say you are running mac OS is this on the server or you local machine. It is the server OS thatis of interest.
For the new version to work, it has to know where it is being run from. Different OS’s and versions of php sometime deal with this infoin different ways.
Hi- this plugin looks great, but I’m having trouble geting the results. I’m getting ‘An unidentified error has occurred.’ when I try to add the survey_data custom field and if I don’t add it I can click the ‘download’ button, but it just redirects to a black page. Any help would be appreciated!
Thanks
@Joe:
It would appear the direct download that was introduced in the last version, has some problems n some system.
if you revert back to version 1.3.0 which you can find here
http://wordpress.org/extend/plugins/wp-survey/download/
you will be able to download your results.
you will need to create a results directory in the plugin folder that is writeable.
I have installed SurveyPress and gotten the survey to work but there is no anti-spam. Since it says only non-admin users will see this, I’ve checked it from several remote unknown computers. But there is no anti-spam of any kind, no choosing of the “nth color.” What’s wrong?
Hi DCoda
I am making a webpage with a SurveyPress survey on it and someone will be downloading the CSV file onto a PC. Is there any way they can get a virus from this? I use a Mac, so I don’t worry about it on my end. Will I have to worry about spam going into the survey? Thanks — I wrote a post earlier about the anti-spam, which I don’t see.
@primatepress:
there does appear to be a problem with the defaults, preventing the antispam from showing. This will be addressed in the next version.
@primatepress:
Since a cvs is basically a text file, I don’t see any problem with viruses.
Most surveys don’t use the antispam, but a fix for the problem is being looked into.
I am having difficulties exporting data using the plugin. Everytime I download the csv file it contains only “0″”" which displays as a single 0 in Excel. Looking at the database, I can see that the data is being written properly, so I assume it just isn’t being exported right. I am running 1.4.
Thanks in advance.
@Jared Smith:
It does appear that the direct download method introduced in version 1.4 has problems on some systems. If you need to download your results in a hurry the easiest way is to install version 1.2. This will out put the results to a results directory and provide you with a link to retrieve them.
The direct download method has been removed from the next release until the problem can correctly be diagnosed. This should hopefully be released soon.
Thanks for your help. I will wait for the update. Also, is it possible to configure the plugin to email the survey responses or email a notification that the survey has been completed?
@Jared Smith:
Yes it it is possible. But is at present an undocumented feature that wasn’t included until it could be full integrated into the documentation.
if you add the attribute
emailme = “yes”
this will sent an email to the post author containing the response to the survey.
I hope this is helps.
A wonderful plugin! Thanks for your responses.
Hi DCoda,
Some feedback re. Neil above, on Sept. 2. I get this same effect - no matter what I do to the CSS or which theme I use, there is an equal chunk of space above and below the form. It doesn’t matter what content comprises the form, either, because on this page I entered only two words, “test words”, and no fields at all:
http://www.waschmidtgraphics.com/holttest/?p=38
I’ve tried deleting all margin and padding values in the CSS. Just thought it might help you to see this problem in action. Any thoughts?
Answer to my own question: these gaps are caused at the bottom by the invisible submit fields. In the SurveyPress CSS file I changed their font size and line height to 1px and this greatly reduces the space.
At the top the gap is caused by all the fieldsets that aren’t being used in my form, username, email, etc. When I deleted all the fieldsets from the mainform.html.php file except the copy fieldset, the gap at the top got smaller, but is still there. If you visit the link above it will no longer display the large equal gaps I reported earlier.
Hey, Im putting together a survey for a game me myself and a few friends are running, your plugin is great, I got one problem tho, it adds after each line so on my one survey I get 219 validation errors and viewing it with for example chrome the makes each radio options appear below eachother instead of lined on the same line (the options are 1-5)
here is my dev site for my wordpress:
http://www.beernweed.net/wordtest/?page_id=74
@Mike- I’m not sure what the problems is. The site looks fine for us in firefox and chrome. There are only a few html validations errors on the page when checked, only a few warnings are caused by the html generated by the plugin.
These warning are minor, but will be looked into in the next version.
Problem solved I removed add_filter(’the_content’, ‘wpautop’); from /wp-includes/default-filters.php
noticed aswell that it didnt show the br I posted in previous post.
ah I didnt refresh the page before I wrote that last one, yeah I solved it a few hours ago removing the part I mentioned, one of the features I really dont like with wordpress with it adding p and br everywhere:P
Cheers, keep up the great work
I used the plug in, which worked great, but now am unable to pull the collected info down. I attempted to install V. 1.2.0, but was still unsuccessful.
could you point me to a reference for a non-direct download of results?
Thanks
Could some post a working example. Im using Version 1.4.0, and get in the downloadable file:
Warning: unserialize() expects parameter 1 to be string, array given in /var/www/coolit/wp-content/plugins/wp-survey/library/classes/base.php(148) : eval()’d code on line 60
Warning: unserialize() expects parameter 1 to be string, array given in /var/www/coolit/wp-content/plugins/wp-survey/library/classes/base.php(148) : eval()’d code on line 60
Warning: unserialize() expects parameter 1 to be string, array given in /var/www/coolit/wp-content/plugins/wp-survey/library/classes/base.php(148) : eval()’d code on line 60
Warning: unserialize() expects parameter 1 to be string, array given in /var/www/coolit/wp-content/plugins/wp-survey/library/classes/base.php(148) : eval()’d code on line 60
“0″
“”
“”
“”
“”
@patrick:
Not entirely sure what could be causing you problems.
Two thinks come to mind.
Have you modified the fields the survey after the survey has gone live, This will cause problems.
Also there are problems with the download method in version 1.4.0 on some system, it is recommended that you revert to version 1.1.
@John Knox White : I thik f you try version 1.1.0 this will download the results. This was the last version version not to try the direct download which seems to be causing problems
Hello DCoda,
I have the same error like Patrick
“Warning: unserialize() expects parameter 1 to be string, array given in /var/www/coolit/wp-content/plugins/wp-survey/library/classes/base.php(148) : eval()’d code on line 60″
in CSV file.
I tried version 1.1, but I had error line 25.
My survey is here http://www.eu-russiacentre.org/survey
It is only radio buttons.
Hi!
Is it possible that you provide me a sample complete quiz so i can replace it with the info that i want?
Thank you!
@JC,
from the error it sounds like there either is no survey data, or that questions were added to the survey after it had already been filled in.
@ownerpredator,
There is an example template.
I reinstalled plugin and made new survey. And the same in file CSV - Warning…line 60
Can I use in form.html some html tags except [p][/p]? Tables, span, div?
Do you have example of survey with radio and chechkboxes, may be I did some errors in my code?
Can you look exactly in my form, please?
http://eu-russiacentre.org/wp-content/plugins/wp-survey.1.4.0/pages/second/form.html
Another question - how can I reset data of survey?
@JC.
you can use any html you like in the form.html, that was the main objective of the plugin, all you need to is supply the “name” variable for each form field.
Sorry I don’t have any examples with radios buttons.
The survey data is attached to the post,the simplest way to reset this is to copy the post content to a new post and delete the old post.
Work permitting, there should be a new version out soon, that should address a few problems.
Idea is great, but survey doesn’t work. I can make survay, place it on my blog, by i can’t get the results.
Warning: unserialize() expects parameter 1 to be string, array given in C:\wamp\www\blog\wp-content\plugins\wp-survey\library\classes\base.php(148) : eval()’d code on line 60
“0″
“”
I’m working on Windows on localhost.
Its happening on every survey, even new one.
Sorry to here of you problems.
There are some problems with theme download method on the current version on some configurations.
If you revert to version 1.1 you should be able to download your results.
The problem will be addressed in the next release.
Thanks for answer. I’ve tried version 1.1 before, but with the same result. But i have managed to run your plugin just few minutes ago. I was using WP 2.6.3. Now i’m using 2.6 and there is no problem with downloading reports.
I’m looking forward for next release.
Hi DCoda, thanks for the plugin, we are using it for collecting feedback for internal developers trainings.
Wierd enough, I cannot see/edit filled in survey data for my post as custom field. I can easily download them though, using URL http:/…/wordpress/wp-content/plugins/wp-survey/surveypress.php?results=375
I would like to edit already commited answers, so I searched the custom fields for my surveyed post, but the only custom fields there is ratings_average, ratings_score, ratings_users. I can see survey_data item in “Add a new custom field:” select box though.
So my question is, have you any idea why I cant see survey_data with filled in values as custom field?