Bin-Blog logoBin-Blog

Learn about the latest in Web Development - as soon as I do.

Surveys WordPress Plugin

By Binny V A • Nov 20th, 2008 • Category: Blogging, Scripts, WordPress

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.


80 Responses »

  1. web survey says:

    Looking forward to seeing your latest version. Keep up the good work, it is tough but you are hanging in there!

  2. shazli says:

    hi, i’ve downloaded the plugin and would like to try and put it on the sidebar. how do i do that?

  3. henk says:

    Hi, I installed the plugin in WP 2.71 and get this error:

    WordPress database error: [Table 'wpdb.wp_surveys_survey' doesn't exist]
    INSERT INTO wp_surveys_survey(name,description,status,added_on) VALUES(’Schoonmakers’,'Hoe schoon is onze binnentuin?’,'1′,NOW())

    what do I do?

    • Binny V A says:

      Try deactivating and re-activating the plugin. The error is caused because the plugin was unable to create the database table automatically. Could be a permission issue for the database user.

      • henk says:

        Hmm, did that now I get:

        Fatal error: Cannot redeclare surveys_add_menu_links() (previously declared in /var/www/wp-content/plugins/surveys/trunk/surveys.php:17) in /var/www/wp-content/plugins/surveys/surveys.php on line 23

  4. Joe says:

    I get the same error on 2.7.1 as well, I’ve deactivated and re-activated the plug in. Its not a permissions issue, the database user has all privileges. I really like this plugin and would like to use it, but need to resolve these errors.

  5. Dubber says:

    Great plugin - thanks.

    I’m using it here: http://morecanals.com/fans/health-check

    Wondered if there’s a simple way to increase the width of the input text boxes?

    Brilliant work - much appreciated.

  6. Jeff Hajek says:

    Hi Binny V A,

    I tried to install you survey, but get a 404 error when I create a new survey. I suspect it has something to do with moving my site’s URL location to the root directory (sorry-I am sketchy on the details of what I did or how I did it (it’s been a while)–i just set it so the URL appears to come from my root domain instead of my install folder).

    I’m excited about this plugin. Any ideas?

    Thanks,
    Jeff Hajek

    • Jeff Hajek says:

      Just an update.

      I got this working by tinkering with the code. Basically, I just kept searching the php files for references to “wp-admin” or similar directories, and adding in my own directory. Eventually I hit on the right combo (can’t quite recall which files had the magic touch), and got it working

      Works great now.
      Thanks.

  7. I started experimenting with your Surveys plugin in WP 2.7 and ran into problems when assigning questions. Turns out the problem was your use of short php tags in a couple of places in the question.php file. If you do a search for those short php tags and replace them (don’t remember if there were two or three), it so far seems to work in 2.7.

  8. ana says:

    How can I limit the number of times one PC can vote? via cookie or IP.

    It’s really important, otherwise the system is easily gamed.

  9. I was wondering if you could help me figure out what the following error means?

    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 '' at line 3]
    SELECT Q.ID,Q.question,(SELECT COUNT(*) FROM wp_surveys_answer WHERE question_id=Q.ID) AS answer_count FROM wp_surveys_question AS Q WHERE Q.survey_id=

  10. ced says:

    Hi,
    Is there anyway to share one survey on many diferent posts but having responses with the ID of the post?

    thanks

    cedric

  11. Thad says:

    If I want to display the survey someplace other than in a post, maybe the default.php file. Is there a PHP command I can use to call the function? and the survey will appear.

    Thank you!

  12. I attempted the plug-in on my site but was un-luckily did not suceed fully.I will require your help in achieving success.I followed procedure as given but did not succeed?Is the survey ok with word-press version 2.8.
    I uploaded content to /wp-content/plugins/folder activated the plug-in and then went to settings and clicked on surveys setting which resulted in to following error message. pls respond.Thanks.

    Warning: require() [function.require]: Unable to access /home/vhosts/technical-world.freevar.com//wp-content/plugins/surveys/options.php in /home/vhosts/technical-world.freevar.com/wp-content/plugins/surveys.php on line 56

    Warning: require(/home/vhosts/technical-world.freevar.com//wp-content/plugins/surveys/options.php) [function.require]: failed to open stream: No such file or directory in /home/vhosts/technical-world.freevar.com/wp-content/plugins/surveys.php on line 56

    Warning: require() [function.require]: Unable to access /home/vhosts/technical-world.freevar.com//wp-content/plugins/surveys/options.php in /home/vhosts/technical-world.freevar.com/wp-content/plugins/surveys.php on line 56

    Warning: require(/home/vhosts/technical-world.freevar.com//wp-content/plugins/surveys/options.php) [function.require]: failed to open stream: No such file or directory in /home/vhosts/technical-world.freevar.com/wp-content/plugins/surveys.php on line 56

  13. billpeace says:

    can restrict the survey to users who has login to your web?

    another question: can you add following data to record, for the users, the answers he has selected?

    thanks very much

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>