Surveys WordPress Plugin

The 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.

If you are new to this blog, this is the Plugin Week. I am going to release one wordpress plugin each day, every day for one week(ie. Monday to Friday). Each day you will get a new plugin by me. This is the fourth plugin in this series. The earlier ones were…

Note: Surveys is a beta plugin(as are most of the plugins released in the Plugin Week) – so watch out for bugs. And trust me, there will be a lot of them.

Usage/Screenshots

First, Download, install and activate the Surveys plugin. Then go to Manage > Surveys section to create new surveys – or edit existing ones. After creating a survey insert the HTML comment [SURVEYS 1] into a post. Here, the 1 should be the ID of the survey you want to insert into that post.

The client side of the plugin will look something like this – your visitors will see this part…

You can see the result of the survey from the admin side – there are two ways to see the data…

Aggregate

This will show the results each question by aggregating all the data so far. This will look like a poll result. This mode is useful to make decisions – you can immediately see the most favored answers for each question.

Individual Responses

You can also view all the answers provided by each visitor one by one. This mode has its uses as well.

See it in action

I have set up a demo for Surveys over at BinnyVA WordPress demo blog. Take a look.

Feedback

If you have any suggestions or notice any problems with the plugin, post it in the Surveys forum. I’ll take a look at it – as soon as the Plugin Week is over – I am way too busy right now πŸ™‚

Next plugin – will be released tomorrow.

About Binny V A 102 Articles
Freelance Web Developer on the LAMP Platform. Maintains a blogs http://blog.binnyva.com/. Other sites include Bin-Co and OpenJS

52 Comments

  1. Thanks for this plugin, Binny! It’s really easy to use.

    I’ve got it running on my blog for a survey on the Texas Tech/Oklahoma game this weekend. Some feedback and questions:

    1) Being able to force an order of the questions would have been nice. They didn’t come out in the order I put them in; neither were they alphabetical.
    2) If you only have on question in the survey, it would be nice if only one click were needed.
    3) Does it place any sort of limit on the voting by individuals?

  2. 1) That’s odd – it works out correctly for me. Anyway, reordering questions is a feature I will add in the next relase – that should fix the problem.

    2) Good point. I actually have another plugin – Pollin – that is used for single questions cases. But I’ll add that feature to the Surveys as well.

    3) This limit exists in the Pollin plugin – again, I’ll add it to surveys as well.

    Thanks for the feedback.

  3. I had to signup for a ConstantContact account inorder to host a survey for my higher secondary investigatory project.

    This one is an awesome release.
    I hope you’ll put up a poll with the “pollin” plugin to select the favourite plugin out of those released this week.

  4. Love the concept and simplicity of this plug-in, however my first test was a simple single question survey. When inserting the comment:
    into a post or a page I see nothing in the WordPress page. Using the current version of WP.

  5. Hi
    This looks to be a most useful plug-in.
    Unfortunately I seem to be getting 2 votes recorded for each single vote so the results are in effect doubled.

    Currently running word-press 2.6.3. under MAMP PRO on my Macbook Pro.

    Any thoughts?

  6. I fixed the bug with

    change line 10 in survey_action.php from:

    $_REQUEST[‘submit’]==’Save’

    to

    isset($_REQUEST[‘submit’])

    all in the if statement

    Not everyone uses English πŸ˜‰

    Great plugin!

  7. btw do the same in line 8 in questions.php

    unfortunately I still have another bug: my questions won’t get displayed in the acutal post. I do get the “next” button but no questions or other information.

    I guess it still has something to do with the language dependant code.

  8. Spine, I get the same issue on my blog I can see the next button but my questions won’t show up for some strange reason.

    Any help would be greatly appreciate Binny and thanks for a great plugin if I can get it working I’ll do a quick youtube video about it… πŸ™‚

    great stuff

  9. Hi, I want to use the survey, but for some reason he does not show the survey in the order I want to show it.
    For example in admin:
    Question 1
    Answer 1, Answer 2, Answer 3

    Is shown as
    Question 1
    Answer 1, Answer 3, Answer 2

    What is the solution for this?
    Thnx

  10. It doesn’t work for me either. When I click on Manage Surveys on my dashboard, it immediately takes me to my site where there is a 404 error. I haven’t upgraded to 2.7 yet.

  11. I have alot of the above problems.. out of order questions etc. But when I tried to show the indvidual response it just repeated the data form the first one over and over for the various dates adn times the form was filled out.

    Also FYI… when I deleted a survery I got two error messages on deleting the database. I did not copy them sorry. But if you try the same thing you might get a clue as to what some of the probems might be??

  12. I would love to be able to have multiple-check items in the survey, rather than just single-answer questions.

    I would also like to be able to allow text entry as a question, so people can add comments, or to allow you to ask open-ended questions, such as “Why don’t you buy all your groceries from XYZ shop?”.

    • Thanks for reporting it – I have fixed the bug. The fix will be available in the next release. If you can’t wait, shoot me a mail and I’ll send you the latest version of the code. My email address is binnyva, gmail.

  13. This is a great find. Thanks. I was looking for a surveys plugin so I can run mini polls. I’ve got a couple of other ideas I can move forward with now.

    I just love playing about with plugins, even though half of them I never end up using, it’s all the big learning curve.

    Have a great day! I’ve bookmarked you now.

  14. I am about to give up and delete your plugin as it DOES NOT work for me.
    I created a survey with 4 questions. When I added this line:

    in the post and save it, the line are being replaced by this:
    .
    And yes I was in HTML mode in the post.

    When I view the post it only shows

    By the way: On this page you say to use , on the survey question page it says: .
    I have tried both. What’s right?

  15. The lines disappeard from my last submitted question coz I forgot it takes HTML. Hence same question one more time.
    I am about to give up and delete your plugin as it DOES NOT work for me.
    I created a survey with 4 questions. When I added this line:
    “”
    in the post and save it, the line are being replaced by this:
    “”
    And yes I was in HTML mode in the post.

    When I view the post it shows:
    “”, remark the automatic added space before the exclamation mark.

    By the way: On this page you say to use “”, on the survey question page it says: .

    I have tried both. What’s right?

  16. Hi,

    I think I’ve uncovered several bugs in version 1.00.1 of the Surveys plugin (a clean install on WP Version 2.7.1), two of which are minor and one of which causes data corruption.

    1)
    When looking at the individual responses (individual_responses.php) the link to “All Responses” does not go back to the right survey. The ID?> statement on line 67spits out the wrong ID as it returns the ID of the last respondent and not the ID of the survey. Perhaps using would fix this.

    2)
    When looking at the individual response (show_individual_response.php) the wrong responses get displayed. This may be due to the WHERE A.question_ID={$q->ID} statement on line 20. From what I can tell this ties the question to the answer just fine but completely forgets to tie the answer to the respondent. I would venture that this linking is designed to be achieved with the wp_surveys_result_answer.result_ID field. This would be easily fixed by adding an appropriate AND to the WHERE clause.

    3)
    Now here comes the clincher: The wp_surveys_result_answer.result_ID field does not get populated with the respondent ID field but with the survey ID (ref line 19 on show_survey.php). So there’s no way to tie back the responses to a respondent. And now we have a big problem since we can’t display, edit or delete individual responses from a survey.

    IMHO that last issue is a bit surreal for a plugin whose sole purpose is to manage surveys.

    I hope this helps improve the code and reminds people (including myself) that failure to properly test can break your reputation in a heartbeat.

  17. Whoosie… some things went missing in the post…

    Point 1) should state:
    The “$survey->ID” statement on line 67spits out the wrong ID as it returns the ID of the last respondent and not the ID of the survey. Perhaps “$survey_id” using would fix this.

  18. Hi! Binny,
    Yesterday i installed your plugin on my site. I have posted 3 questions in the survey, On first page i’m seeing all 3 question on same page along with next button on pressing next i’m seeing 2nd question as expected and thereafter the plugin is working fine. Please guide.

    I’m using your plugin version 1.01.0.
    Wordpress version: 2.7.1

    Regards,
    Ritesh

  19. Hi,

    I installed your plugin and on adding the first survey (hitting ‘Save’ on /edit.php?page=surveys/survey_form.php&action=new) I get:

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘s plugin’,’1′,NOW())’ at line 1 for query INSERT INTO wp_surveys_survey(name,description,status,added_on) VALUES(‘Survey Test’,’Testing the Surveys plugin’,’1′,NOW())

    This is on survey_action.php. I’m using MySQL 5.1.

  20. Hi Binny! Thanks for taking time to develope and share this plugin!
    I’m having difficulties from the beggining πŸ™
    When clicking ‘Survey Settings’ I get this error:

    Warning: require(/var/www/sites/domain.com/blog//wp-content/plugins/surveys/options.php) [function.require]: failed to open stream: No such file or directory in /var/www/sites/domain.com/blog/wp-content/plugins/survey/surveys.php on line 56

    Fatal error: require() [function.require]: Failed opening required ‘/var/www/sites/domain.com/blog//wp-content/plugins/surveys/options.php’ (include_path=’.:/usr/local/lib/php’) in /var/www/sites/domain.com/blog/wp-content/plugins/survey/surveys.php on line 56

    What could this be? Cheers!

6 Trackbacks / Pingbacks

  1. Poll: Texas Tech versus Oklahoma | BrianCombs.net
  2. Quizzin WordPress Plugin | Bin-Blog
  3. EduPress: WordPress + Educación
  4. WordPress Plugin Releases for 11/20 Β» All About Technologies
  5. Speedlinking da Semana [16 a 22 de Nov] - 2.0 WEBMANIA - Portugal, a Web 2.0, o Mundo e a Internet
  6. Surveys WordPress Plugin - Create Surveys in WordPress | Binny V A Projects

Leave a Reply to Jeff Hajek Cancel reply

Your email address will not be published.


*