Democracy Poll


The plugin adds a clever and convenient system to create various Polls with different features, such as:

  • Single and Multiple voting. Сustomizable.
  • Visitors can add new answers. Сustomizable.
  • Ability to set poll’s end date.
  • Unregistered users can’t vote. Сustomizable.
  • Different design of a poll.
  • And so on. See changelog.

Democracy Poll works with all cache plugins like: WP Total Cache, WP Super Cache, WordFence, Quick Cache etc.

I focus on easy-admin features and fast performance. So we have:

  • Quick Edit button for Admin, right above a poll
  • Plugin menu in toolbar
  • Inline css & js incuding
  • Css & js connection only where it’s needed
  • and so on. See changelog

More Info

Democracy Poll is a reborn of once-has-been-famous plugin with the same name. Even if it hasn’t been updated since far-far away 2006, it still has the great idea of adding users’ own answers. So here’s a completely new code. I have left only the idea and great name of the original DP by Andrew Sutherland.

What can it perform?

  • adding new polls;
  • works with cache plugins: wp total cache, wp super cache, etc…
  • users may add their own answers (Democracy), the option may be disabled if necessary;
  • multi-voting: users may multiple answers instead of a single one (may be disabled on demand);
  • closing the poll after the date specified beforehand;
  • showing a random poll when some are available;
  • closing polls for still unregistered users;
  • a comfortable editing of a selected poll: ‘Edit’ key for administrators;
  • votes amount editing;
  • a user can change his opinion when re-vote option is enabled;
  • remember users by their IP, cookies, WP profiles (for authorized users). The vote history may be cleaned up;
  • inserting new polls to any posts: the [demоcracy] (shortcode). A key in visual editor is available for this function;
  • a widget (may be disabled);
  • convenient polls editing: the plugin’s Panel is carried out to the WordPress toolbar; (may be disabled);
  • .css or .js files may be disabled or embedded to HTML code;
  • showing a note under the poll: a short text with any notes to the poll or anything around it;
  • changing the poll design (css themes);

Multisite: support from version 5.2.4

Requires PHP 5.3 or later.


Usage (Widget)

  1. Go to WP-Admin -> Appearance -> Widgets and find Democracy Poll Widget.
  2. Add this widget to one of existing sidebar.
  3. Set Up added widget and press Save.
  4. Done!

Usage (Without Widget)

  1. Open sidebar.php file of your theme: wp-content/themes/<YOUR THEME NAME>/sidebar.php
  2. Add such code in the place you want Poll is appeared:

  3. Polls

  • To show specific poll, use <?php democracy_poll( 3 ); ?> where 3 is your poll id.
  • To embed a specific poll in your post, use [democracy id="2"] where 2 is your poll id.
  • To embed a random poll in your post, use [democracy]

Display Archive

For display polls archive, use the function:

<?php democracy_archives( $hide_active, $before_title, $after_title ); ?>


  • Single vote view.
  • Single result view.
  • Multiple vote view.
  • Admin polls list page.
  • Admin edit poll page.
  • Add poll admin page.
  • General settings.
  • Polls theme settings.
  • Poll’s texts changes.


Does this plugin clear yourself after uninstall?

Yes it is! To completely uninstall the plugin, deactivate it and then press “delete” link in admin plugins page and ther plugin delete all it’s options and so on…


জুলাই 17, 2024
It’s a great little plugin that does exactly what I need and is worth supporting. The trouble is just some errors: (1) It returns a PHP error “Undefined array key ‘s'” located in democracy-poll/classes/Admin/List_Table_Polls.php:40; and (2) More importantly, Wordfence classified it on 29 April 2024 (updated 7 May 2024) as having a critical security vulnerability. They write: “The Democracy Poll plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in all versions up to, and including, 6.0.3. This makes it possible for unauthenticated attackers to perform an unauthorized action.”
এপ্ৰিল 2, 2024
<!– wp:paragraph –> <p class=””>Rename wp-content/plugins/democracy-poll folder to get access to your wordpress site. Update democracy poll plugin to 6.0.2, which resolved the issue for me. Thanks for the quick fixes for the troubles after the code changes in version 6.</p> <!– /wp:paragraph –>
মাৰ্চ 25, 2024
The latest update broke the site, resulting in 502 errors. The site dropped out of search for 3 days. No thanks.
ফেব্ৰুৱাৰী 29, 2024
1、I have 50 choices and then It pulling the page very long, very long, very long, oh, it feels like a disaster .How do I set many options to put in a row. 2、quikly update the [texts settings] or it cannot be used in the other languge system
Read all 80 reviews

Contributors & Developers

“Democracy Poll” is open source software. The following people have contributed to this plugin.


“Democracy Poll” has been translated into 4 locales. Thank you to the translators for their contributions.

Translate “Democracy Poll” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



BUG: A fatal error occurred when using the “WordFence” plugin: “Failed opening … /Helpers/wfConfig.php”.


  • BUG: Fix v6.0.0 bug: short-circuit recursion on plugin object construct for the not logged-in users.
  • IMP: Minor improvements.


  • BUG: It was impossible to delete all answers or create democracy poll with no starting answer.
  • CHG: Minimal PHP version 7.0
  • CHG: “Democracy_Poll” class renamed to “Plugin” and moved under namespace.
  • CHG: democr() and demopt() functions renamed to \DemocracyPoll\plugin() and \DemocracyPoll\options().
  • CHG: Most of the classes moved under DemocracyPoll namespace.
  • CHG: DemPoll object improvements: magic properties replaced with real ones.
  • FIX: democracy_shortcode bugfix.
  • FIX: Not logged user logs now gets with user_id=0 AND ip. But not only by IP.
  • FIX: Regenerate_democracy_css fixes. Empty answer PHP notice fix.
  • IMP: “Admin” classes refactored. IMP: Admin Pages code refactored (improved).
  • IMP: Classes autoloader implemented.
  • IMP: Huge Refactoring, minor code improvements and decomposition.
  • UPD: democracy-poll.pot


  • BUG: Pagination links on archive page.


  • FIX: CSS radio,checkbox styles from px to em.


  • FIX: JS code fixes for jQuery 3.5.


  • NEW: orderby аргумент для функции get_dem_polls().


  • NEW: hook get_dem_polls_sql_clauses.

  • FIX: disabled property for checkbox input sometimes not removed on uncheck for multianswers questions.

  • NEW: Scroll to poll top when click on Resulsts, Vote etc.

  • NEW: target="_blank" attribute for copyright link.


  • NEW: pagination links at the bottom of the archive page.
  • NEW: [democracy_archives] now can accept parameters: ‘before_title’, ‘after_title’, ‘active’, ‘open’, ‘screen’, ‘per_page’, ‘add_from_posts’. [democracy_archives screen="vote" active="1"] will show only active poll with default vote screen.
  • NEW: function get_dem_polls( $args )


  • CHANGE: ACE code editor to native WordPress CodeMirror.


  • ADD: ‘dem_get_ip’ filter and cloudflare IP support.
  • NEW: use float number in ‘cookie_days’ option.
  • FIX: expire time now sets in UTC time zone.


  • FIX: compatability with W3TC.
  • FIX: multiple voting limit check on back-end (AJAX request) – no more answers than allowed…
  • IMP: return WP_Error object on vote error and display it…


  • ADD: wrapper function for use in themes ‘get_democracy_poll_results( $poll_id )’ – Gets poll results screen.
  • ADD: allowed <img> tag in question and answers.


  • IMP: now design setting admin page is more clear and beautiful 🙂


  • ADD: post metabox to attach poll to a post. To show attached poll in theme use get_post_poll_id() on is_singular() page. Thanks to for idea.
  • ADD: voted screen progress line animation effect and option to set animation speed or disable animation…
  • IMP: now “height collapsing” not work if it intend to hide less then 100px…
  • FIX: now JS includes in_footer not right after poll. In some cases there was a bug – when poll added in content through shortcode.
  • IMP: buttons and other design on ‘design settings’ admin screen.


  • ADD: ‘demadmin_sanitize_poll_data’ filter second ‘$original_data’ parameter
  • ADD: posts where a poll is ebedded block at the bottom of each poll on polls archive page.

5.4.7 – 5.4.8

  • FIX: ‘expire’ parameter works incorrectly with logs written to DB.
  • FIX: ‘wp_remote_get()’ changed to ‘file_get_contents()’ bacause it works not correctly with API.
  • FIX: ‘jquery-ui.css’ fix and needed images added.


  • FIX: Error with “load_textdomain” because of which it was impossible to activate the plugin


  • FIX: “Edit poll” link from front-end for users with access to edit single poll.
  • FIX: not correct use of $this for PHP 5.3 in class.Democracy_Poll_Admin.php


  • CHG: prepare to move all localisation to in next release…
  • FIX: notice on MU activation – change wp_get_sites() to new from WP 4.6 get_sites(). Same fix on plugin Uninstall…
  • ADD: Hungarian translation (hu_HU). Thanks to Lesbat.


  • ADD: disable user capability to edit poll of another user, when there is democracy admin access to other roles…
  • ADD: spain (es_ES) localisation file added.
  • IMP: improve accessibility protection in different parts of admin area for additional roles (edit,delete poll)…
  • IMP: hide & block any global plugin options updates for roles with not ‘super_access’ access level…


  • FIX: Some minor changes that do not change the plugin logic at all: change function names; block direct access to files with “active” PHP code.
  • CHG: Add jquery-ui.css to plugin files and now it loaded from inside it.
  • FIX: “wp total cache” support
  • ADD: second parametr to ‘dem_sanitize_answer_data’ filter – $filter_type
  • ADD: second parametr to ‘dem_set_answers’ filter – $poll
  • FIX: tinymce translation fix
  • CHG: rename main class Dem to Democracy_Poll for future no conflict. And rename some other internal functions/method names


  • CHG: improve logic to work correctly with activate_plugin() function outside of wp-admin area (in front end). Thanks to J.D.Grimes


  • FIX: XSS Vulnerability. In some extraordinary case it could be possible to hack your site. Read here:
  • ADD: For additional protect I add nonce check for all requests in admin area.
  • CHG: move back Democracy_Poll_Admin::update_options() to its place – it’s not good decision – I’m looking for a better one


  • FIX: delete esc_sql() from code, for protection. Thanks to J.D. Grimes
  • FIX: multi run of Democracy_Poll_Admin trigger error… (J.D. Grimes)
  • CHG: move Democracy_Poll_Admin::update_options() method to Democracy_Poll::update_options(), for possibility to activate plugin not only from admin area.


  • FIX: now user IP detects only with REMOTE_ADDR server variable to don’t give possibility to cheat voice. You can change behavior in settings.

  • FIX: add ‘dem_add_user_answer’ query var param to set noindex for no duplicate content
  • ADD: actions dem_voted and dem_vote_deleted

  • ADD: filters dem_vote_screen and dem_result_screen


  • ADD: poll creation date change capability on edit poll page.
  • ADD: animation speed option on design settings.
  • ADD: “dont show results link” global option.
  • ADD: ‘show last poll’ option in widget
  • FIX: bug user cant add onw answer when vote button is hidden for not multiple poll
  • CHG: move the “dem__collapser” styles to all styles. Change the styles: now arrow has 150% font-size. Now you can set your own arrow simbols by changing it’s style. EX:
    .dem__collapser.collapsed .arr:before{ content:"down"; }
    .dem__collapser.expanded .arr:before{ content:"up"; }

  • FIX: stability for adding “dem__collapser” style into document.

  • ADD: answers sort in admin by two fields – votes and then by ID – it’s for no suffle new answers…


  • FIX: minor: when work with cache plugin: now vote & revote buttons completely removes from DOM


  • FIX: minor: cookie stability fix when plugin works with page caching plugin


  • ADD: filter: ‘dem_poll_screen_choose’
  • FIX: now before do anything, js checks – is there any democracy element on page. It needs to prevent js errors.
  • CHG: now main js init action run on document.ready, but not on load. So democracy action begin to work earlier…


  • CHG: All plugin code translated to english! Now there is NO russian text for unknown localisation strings.


  • FIX: add poll PHP syntax bug…


  • ADD: new red button – pinterest style. default button styles changed. Some ugly buttons (3d, glass) was deleted.
  • ADD: filters: ‘dem_vote_screen_answer’, ‘dem_result_screen_answer’, ‘demadmin_after_question’, ‘demadmin_after_answer’, ‘dem_sanitize_answer_data’, ‘demadmin_sanitize_poll_data’


  • FIX: global option ‘dont show results’ not work properly
  • FIX: some little fix in code


  • FIX: bug when new answer added: now “NEW” mark adds correctly


  • FIX: wp_json_encode() function was replaced, in order to support WP lower then 4.1
  • CHG: usability improvements
  • CHG: set ‘max+1’ order num for users added answers, if answers has order


  • ADD: multisite support
  • ADD: migration from ‘WP Polls’ plugin mechanism
  • FIX: bug – was allowed set 1 answer for multiple answers
  • CHG: IP save to DB: now it saves as it is without ip2long()
  • CHG: EN translation is updated.


  • ADD: on admin edit poll screen, posts list where poll shortcode uses
  • ADD: ability to set poll buttons css class on design settings page
  • ADD: filters: ‘dem_super_access’ (removed filter ‘dem_admin_access’), ‘dem_get_poll’, ‘dem_set_answers’
  • FIX: ‘reset order’ bug fix – button not work, when answers are ordered in edit poll screen and you wanted to reset the order – I missed one letter in the code during refactoring 🙂
  • FIX: ‘additional css’ update bug fix: you can’t empty it…
  • FIX: some other minor fixes…
  • CHG: EN translation is updated.


  • FIX: when click on ‘close’, ‘open’, ‘activate’, ‘deactivate’ buttons at polls list table, the action was applied not immediately
  • FIX: radio, checkbox styles fix


  • ADD: ‘in posts’ column in admin polls list. In which posts the poll shortcode used.


  • ADD: hooks: ‘dem_poll_inserted’, ‘dem_before_insert_quest_data’
  • ADD: two variants to delete logs: only logs and logs with votes.
  • ADD: possibiliti to delete single answer log.
  • ADD: “all voters” at the bottom of a poll if the poll is multiple.
  • ADD: delete answer logs on answer deleting.
  • ADD: button to delete all logs of closed polls.
  • ADD: not show logs link in polls list table, when the poll don’t have any log records.
  • ADD: collapse extremely height polls under ‘max height’ option. All answers expands when user click on answers area.
  • ADD: css themes for ‘radio’ and ‘checkboks’ inputs. Added special css classes and span after input element into the poll HTML code.
  • ADD: now you can set access to add, edit polls and logs to other wordpress roles (editor, author etc.).
  • ADD: mark ‘NEW’ for newely added answers by any user, except poll creator.
  • ADD: ‘NEW’ mark filter and ‘NEW’ mark clear button in plugin logs table.
  • ADD: country name and flag in logs table, parsed from voter IP.
  • ADD: ability to sort answers (set order) in edit/add poll admin page. In this case answers will showen by the order.
  • ADD: one more option to sort answers by random on display its in poll.
  • ADD: sort option for single poll. It will overtake global sort option.
  • FIX: fix admin css bug in firefox on design screen…
  • CHG: EN translation is updated.


  • SEO Fix: Now sets 404 response and “noindex” head tag for duplicate pages with: $_GET[‘dem_act’] or $_GET[‘dem_pid’] or $_GET[‘show_addanswerfield’]


  • Fix: Change DB ip field from int(11) to bigint(20). Because of this some IP was writen wrong. Also, change some other DB fields types, but it’s no so important.


  • Fix: Some bugs with variables and antivirus check.


  • FIX: not correctly set answers on cache mode, because couldn’t detect current screen correctly.


  • ADD: expand answers list on Polls list page by click on the block.


  • FIX: replace VOTE button with REVOTE. On cache mode, after user voting he see backVOTE button (on result screen), but not “revote” or “nothing” (depence on poll options).
  • HUGE ADD: Don’t show results until vote is closed. You can choose this option for single poll or for all polls (on settings page).
  • ADD: edit & view links on admin logs page.
  • ADD: Search poll field on admin polls list page.
  • ADD: All answers (not just win) in “Winner” column on polls list page. For usability answers are folds.
  • ADD: Poll shordcode on edit poll page. Auto select on its click.
  • CHG: sort answers by votes on edit poll page.


  • FIX: change default DB tables charset from utf8mb4 to utf8. Thanks to Nanotraktor


  • ADD: single poll option that allow set limit for max answers if there is multiple answers option.
  • ADD: global option that allow hide vote button on polls with no multiple answers and revote possibility. Users will vote by clicking on answer itself.
  • fix: disable cache on archive page.


  • FIX: bootstrap .label class conflict. Rename .label to .dem-label. If you discribe .label class in ‘additional css’ rename it to .dem-label please.
  • ADD: Now on new version css regenerated automaticaly when you enter any democracy admin page.


  • FIX: Polls admin table column order


  • ADD: Logs table in admin and capability to remove only logs of specific poll.
  • ADD: ‘date’ field to the democracy_log table.


  • Complatelly change polls list table output. Now it work under WP_List_Table and have sortable colums, pagination, search (in future) etc.


  • ADD: en_US l10n if no l10n file.


  • ADD: de_DE localisation. Thanks to Matthias Siebler


  • DELETED: possibility to work without javascript. Now poll works only with enabled javascript in your browser. It’s better because you don’t have any additional URL with GET parametrs. It’s no-need-URL in 99% cases..


  • CHG: Convert tables from utf8 to utf8mb4 charset. For emoji uses in polls


  • CHG: Some css styles in admin


  • ADD: Custom front-end localisation – as single settings page. Now you can translate all phrases of Poll theme as you like.


  • CHG: in main js cache result/vote view was setted with animation. Now it sets without animation & so the view change invisible for users. Also, fix with democracy wrap block height set, now it’s sets on “load” action, but not “document.ready”.
  • CHG: “block.css” theme improvements for better design.


  • ADD: “on general options page”: global “revote” and “democratic” functionality disabling ability
  • ADD: localisation POT file & english transtation


  • CHG: “progress fill type” & “answers order” options now on “Design option page”
  • FIX: english localisation


  • CHG: delete “add new answer” button on Add new poll and now field for new answerr adds when you focus on last field.


  • FIX: options bug appers in 4.6.7


  • ADD: check for current user has an capability to edit polls. Now toolbar doesn’t shown if user logged in but not have capability


  • FIX: Huge bug about checking is user already vote or not. This is must have release!
  • CHG: a little changes in js code
  • ‘notVote’ cookie check set to 1 hour


  • ADD: New theme “block.css”
  • ADD: Preset theme (_preset.css) now visible and you can set it and wtite additional css styles to customize theme


  • FIX: when user send democratic answer, new answer couldn’t have comma


  • FIX: Widget showed screens uncorrectly because of some previous changes in code.
  • Improve: English localisation


  • FIX: great changes about polls themes and css structure.
  • ADD: “Ace” css editor. Now you can easely write your own themes by editing css in admin.


  • FIX: some little changes about themes settings, translate, css.
  • ADD: screenshots to WP directory.


  • ADD: Poll themes management
  • FIX: some JS and CSS bugs
  • FIX: Unactivate pool when closing poll


  • FIX: CSS fixes, prepare to 4.6.0 version update
  • ADD: Cache working. Wright/check cookie “notVote” for cache gear optimisation


  • ADD: AJAX loader images SVG & css3 collection
  • ADD: Sets close date when closing poll


  • FIX: revote button didn’t minus votes if “keep-logs” option was disabled


  • ADD: right working with cache plugins. Auto unable/dasable with wp total cache, wp super cache, WordFence, WP Rocket, Quick Cache. If you use the other plugin you can foorce enable this option.
  • ADD: add link to selected css file in settings page, to conviniently copy or view the css code
  • ADD: php 5.3+ needed check & notice if php unsuitable
  • Changed: archive page ID in option, but not link to the archive page
  • FIX: in_archive check… to not show archive link on archive page
  • FIX: many code improvements & some bug fix (hide archive page link if 0 set as ID, errors on activation, etc.)


  • CHG: Archive link detection by ID not by url


  • FIX: js code. Now All with jQuery
  • FIX: Separate js and css connections: css connect on all pages into the head, but js connected into the bottom just for page where it need


  • FIX: code fix, about $_POST[*] vars


  • FIX: Remove colling wp-load.php files directly on AJAX request. Now it works with wordpress environment – it’s much more stable.
  • FIX: fixes about safe SQL calls. Correct escaping of passing variables. Now work with $wpdb->* functions where it posible
  • FIX: admin messages


  • FIX: Localisation bug on activation.


  • ADD: css style themes support.
  • ADD: new flat (flat.css) theme.
  • FIX: Some bugs in code.


  • ADD: All plugin functionality when javascript is disabled in browser.
  • FIX: Some bug.


  • ADD: “add user answer text” field close button when on multiple vote. Now it’s much more convenient.
  • FIX: Some bug.


  • ADD: TinyMCE button.
  • FIX: Some bug.


  • ADD: Revote functionality.


  • ADD: “only registered users can vote” functionality.
  • ADD: Minified versions of CSS (.min.css) and .js (.min.js) is loaded if they exists.
  • ADD: js/css inline including: Adding code of .css and .js files right into HTML. This must improve performance a little.
  • ADD: .js and .css files (or theirs code) loads only on the pages where polls is shown.
  • ADD: Toolbar menu for fast access. It help easily manage polls. The menu can be disabled.


  • ADD: Multiple voting functionality.
  • ADD: Opportunity to change answers votes in DataBase.
  • ADD: “Random show one of many active polls” functionality.
  • ADD: Poll expiration date functionality.
  • ADD: Poll expiration datepicker on jQuery.
  • ADD: Open/close polls functionality.
  • ADD: Localisation functionality. Translation to English.
  • ADD: Change {democracy}/{democracy:} shortcode to standart WP [democracy]/[democracy id=].
  • ADD: jQuery support and many features because of this.
  • ADD: Edit button for each poll (look at right top corner) to convenient edit poll when logged in.
  • ADD: Clear logs button.
  • ADD: Smart “create archive page” button on plugin’s settings page.
  • FIX: Improve about 80% of plugin code and logic in order to easily expand the plugin functionality in the future.
  • FIX: Improve css output. Now it’s more adaptive for different designs.