Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make…
About WP-Polls
WP-Polls is a highly customizable polling plugin for WordPress that allows you to create and customize polls on your website. It supports multiple selection of answers and offers plenty of options for customization. You can find more information about its development on GitHub and the plugin icon was created by Freepik from Flaticon. If you enjoy using the plugin, you can make a donation to support the creator.Screenshots










Frequently asked questions
How customizable is WP-Polls?
WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.
Where can I find the development of WP-Polls?
You can find the development of WP-Polls on GitHub. Here is the link: https://github.com/lesterchan/wp-polls
Who created the plugin icon for WP-Polls?
The plugin icon for WP-Polls was created by Freepik from Flaticon.
Is there an option for donations for WP-Polls?
Yes, if you love the WP-Polls plugin and would like to support the creator, you can donate a few bucks. However, there is no obligation to do so.
Changelog
3.0.3
- FIXED: A page that refreshes its polls from theme or plugin code could show the same poll twice. Since 3.0.0 the “Loading …” placeholder beside each poll carried the
wp-pollsclass as well aswp-polls-loading, so code that walks.wp-pollsto find the polls on a page found every one twice, and the id it read off the placeholder,polls-369-loading, was taken as poll 369 again. The placeholder carrieswp-polls-loadingalone, as it did before 3.0.0. - NOTE: Custom CSS that addresses the spinner as
.wp-polls .wp-polls-spinnerno longer matches;.wp-polls-loading .wp-polls-spinnerdoes.
3.0.2
- NEW: A
wp_polls_needs_assetsfilter, for code that renders a poll where WP-Polls cannot see it coming. 3.0.1 loads the stylesheet and the voting script only where it finds the poll widget, a[poll]or[page_polls]shortcode, one of the two blocks, or a poll rendering during the page itself. Poll markup fetched overadmin-ajax.phpor the REST API into a page that shows no poll of its own is none of those, and got neither file — leaving the poll unable to vote, under a “Loading …” that never cleared. Returning true from the filter is how such a page asks for them.
3.0.1
- CHANGED: The stylesheet, the voting script and the inline poll bar styles load only on pages that show a poll, a polls archive or the poll widget; every other page sheds all three. If a caching or optimisation plugin combines assets per page, its combined file now differs between pages with and without a poll — that is this change, not a fault, and its cache can simply be regenerated.
- NEW: A Settings link on the plugin’s row on the Plugins screen.
- CHANGED: Upgrade routines run on
initrather thanadmin_init, so a site updated in the background — by automatic updates or WP-CLI — is migrated on its next request of any kind instead of waiting for somebody to open wp-admin. - CHANGED: Only one request at a time runs the outstanding upgrade. Running it on
initmeans running it on front-end requests, so two visitors arriving together could both start the option migration and do the same work twice over; now the second waits for the first and finds nothing left to do.
3.0.0
- FIXED: The limit on how many answers a vote may select was enforced in the browser and nowhere else, so one crafted request could vote for every answer of a single-choice poll — each answer gaining a vote and the poll’s total gaining several, while the voter count went up by one. That leaves the percentages,
%POLL_MOST_ANSWER%and%POLL_LEAST_ANSWER%permanently wrong. The maximum is checked on the server now, on both the AJAX and REST paths - NEW: A
wp pollsWP-CLI command —list,get,open,closeanddelete. - NEW: A
polls/v1REST API for reading a poll, reading its result and voting. Theadmin-ajax.phppollsaction is unchanged and still supported. - NEW: Two editor blocks, Poll and Polls Archive, both under Widgets. They render on the server through the same code the shortcodes use, so a block and a shortcode showing the same poll produce the same markup. The
[poll],[poll=2]and[page_polls]shortcodes are unchanged and still supported — nothing needs converting, and posts already containing them keep working. - BREAKING: Requires WordPress 6.8 and PHP 8.2.
- BREAKING: The scripts no longer define any global JavaScript functions.
poll_vote(),poll_result(),poll_booth()and the admin equivalents are now private, so custom templates or themes that called them directly must move todata-poll-id/data-poll-actionattributes. WP-Polls converts the stock templates for you on upgrade and warns in wp-admin about any it could not convert. - CHANGED: Options, templates, settings, the widget and the install/upgrade routine moved into classes under
includes/. The documented extension points are unchanged: everywp_polls_*filter and action, both the[poll]and[page_polls]shortcodes, and the template tags keep their exact names and signatures. - CHANGED: The thirty-odd separate
wp_optionsrows are now a singlewp_polls_optionsrow holding a nested array. Your settings are migrated automatically on upgrade; the old rows are removed once they have been folded in. - FIXED: XSS in the Poll Templates screen. Inline
onclickhandlers are replaced bydata-poll-action/data-poll-idattributes andonclickis no longer an allowed attribute in poll templates. - FIXED: On multisite, uninstall called
restore_current_blog()once after the loop rather than once per site.switch_to_blog()pushes onto a stack, so the stack was left unwound by every site but the first. - FIXED: On uninstall the three poll tables were dropped from inside the loop over option rows, so the drop ran 36 times per site and issued three
DROP TABLEstatements each instead of three in total. - CHANGED: Uninstall asks
get_sites()for IDs only rather than hydrating aWP_Siteobject per site, and the table-dropping work now lives onWP_Polls_Install::uninstall_site()instead of occupying the unprefixed global nameplugin_uninstalled(). - FIXED: Network activating on multisite was a fatal error. The activation routine called
wp_get_sites(), which WordPress removed in 5.1. - FIXED: On multisite the three poll tables were not registered with
$wpdb, so any query made insideswitch_to_blog()read and wrote the wrong site’s polls. - FIXED: Adding or removing a poll answer in wp-admin no longer breaks. It called jQuery’s
.size(), which was removed in jQuery 3. - FIXED: The poll bar tooltip showed a literal
&for any answer containing an ampersand. The polls archive had its own copy of the same bug in%POLL_ANSWER_TEXT%, which is fixed too. - FIXED: Poll Logs had the same double encoding: an answer containing an ampersand showed a literal
&in both the answer filter and the log table. - FIXED: Voters identified by the comment author cookie were logged with a backslash before any apostrophe, so a commenter named
O'Brienappeared in Poll Logs asO\'Brien. - FIXED:
$_SERVER['REMOTE_ADDR']is no longer read unguarded, which warned under WP-CLI and cron on PHP 8. - FIXED: The result and vote links no longer follow their placeholder
hrefwhen clicked. - FIXED: Removed the duplicated shortcode registration.
- FIXED: Undefined array key warnings on missing stats_display options.
- FIXED: Warnings when rendering a poll whose ID no longer exists.
- FIXED: The voting endpoint read
$_REQUEST['view']without checking it was set, which warned on PHP 8 for any request that left it out. - FIXED: Activation looked for
wp-admin/upgrade-functions.php, which WordPress removed in 2.x, and stopped with an error message if it found neither that nor the current file. - FIXED: Poll Options could offer a poll bar style that saving then rejected, reverting it while still reporting “Settings saved.” The screen and the sanitiser now build the list of available styles the same way.
- FIXED: Every stylesheet, script and image URL was built from a hardcoded
wp-polls/path, so renaming the plugin directory left WP-Polls loading none of its own assets. All paths now come from the plugin file itself. - CHANGED: The Settings and Templates tabs now use the WordPress Settings API instead of hand-rolled form handling. Every row on both tabs is registered with
add_settings_section()andadd_settings_field()and rendered bydo_settings_sections(), so the screens look and behave like the rest of wp-admin and neither one writes any table markup of its own. - CHANGED: Poll Bar Background and Poll Bar Border are colour pickers now – the browser’s own colour input, the same control WP-Postratings uses – rather than six character text fields with a
#printed beside them and a swatch kept in step by JavaScript. The bar preview follows the colour as it is picked. The setting is still stored as the six digits without the#, so a theme or filter reading it sees what it always did; a three digit value left over from 2.x is expanded to six on the way out, because a colour input will not display#abc. - CHANGED: Manage Polls is now a
WP_List_Table, so it paginates at 20 polls a page, sorts on ID, Total Voters and Start Date, and puts Edit, Logs and Delete in hover row actions instead of three columns of links. The poll the site is currently showing is still highlighted. - CHANGED: Add Poll, Edit Poll and Poll Logs are built out of the standard wp-admin furniture –
form-tablerows with real labels,submit_button(),noticemessages, and oneh1per screen – rather than tables laid out withwidth,valignandalignattributes. The Cancel buttons are links back to Manage Polls instead of ahistory.go(-1)that could not be middle-clicked or opened in a new tab. - FIXED: The stats under Manage Polls were accumulated while printing rows, which would have counted only the page being looked at once the list paginated. They are summed in SQL now.
- FIXED: Opening the logs of a poll that allows multiple answers raised four undefined variable warnings: that filter’s fields were only initialised inside the branch that handles its own submission.
- FIXED: The poll logs named their answers from a list built while printing the filter dropdown, so with the
wp_polls_log_show_log_filterfilter turned off every group heading in the log was blank. A vote recorded against no answer at all also warned instead of printing “Null Votes”. - FIXED: Rows in the by-voter poll log never alternated: the row counter was reset inside the loop rather than at each new voter.
- FIXED: Changing “Expiry Time For Cookie And Log” did not reschedule the cron job. The callback that rebuilds the schedule was registered while the Poll Options screen rendered, but the save happens on
options.php, which never loads that screen. - CHANGED: Removed every remaining inline
onclick/onblur/onchangehandler from the admin pages in favour ofdata-poll-actionattributes and delegated listeners, so poll questions and answers no longer have to be escaped into a JavaScript context. - CHANGED: Dropped the jQuery dependency. Both scripts, the inline admin scripts and the TinyMCE plugin now use the browser’s own APIs, so WP-Polls no longer forces jQuery to load on the front end.
- CHANGED: The scripts ship as readable source; the
.dev.jscopies have been removed. - FIXED: The
polls-adminAJAX handler now checks themanage_pollscapability instead of relying on its nonces for authorisation. - FIXED: Escaped the poll bar colours, the voting form action and
%POLL_RESULT_URL%on output, and validated the poll bar colours on save. - BREAKING: “Poll Logging Method” is now “Check For Repeat Votes”, and it no longer decides whether anything is logged. It never did anything but choose what a returning visitor is matched against, and the two readings pointed opposite ways: a site that picked “Do Not Log” or “Logged By Cookie” got no vote log, no rows on the Logs screen and no WP-Stats figures, which is not what either choice sounds like. Every vote is now recorded whatever this is set to. The choices read “Do Not Check”, “Check By Cookie”, “Check By IP Address”, “Check By Cookie And IP Address” and “Check By Username”; the stored numbers are unchanged, so your setting means what it always meant. The option key inside
wp_polls_optionsischeck_methodrather thanlogging_method, migrated automatically. Sites that would rather not keep the record can return false from the newwp_polls_log_votefilter; the answer tallies and poll totals are columns on the poll tables and are updated either way. - BREAKING: “Expiry Time For Cookie And Log” is now “Remember A Voter For”, and its hint no longer says the opposite of what the setting does. It offered “0 to disable”; zero disables nothing, it is what makes the block permanent — a cookie lasting a year and no time limit at all on the IP and username queries. Nothing expires in the sense of being deleted either: the poll log keeps every vote whatever this says. All it decides is how far back a repeat-vote check looks. The value is unchanged, so existing sites behave exactly as before.
- BREAKING: The “Polls AJAX Style” settings are gone. They chose whether to show a loading indicator and whether to fade the poll while a vote was in flight. Telling somebody their vote is being processed is feedback rather than decoration, so the indicator now always shows; and whether to animate is the visitor’s answer rather than the site owner’s, so the fade follows
prefers-reduced-motionlike the spinner and the result bars already did.poll_ajax_styleis dropped on upgrade rather than carried. - BREAKING: The poll bar has been rebuilt and the change is applied on upgrade. It was one
<div class="pollbar">sized by an inline width; it is now awp-polls-bartrack holding awp-polls-bar-fill, which is what lets a 100% answer render at a true 100%. The Result Body and Result Body (Voted) templates are rewritten to the new markup on upgrade even if you had customised them – the class names and the stylesheet moved with the markup, so a customised copy of the old template has no rules left to match it. Re-apply your changes on Poll Templates. See the FAQ. - BREAKING: The poll bar rules moved out of the PHP-generated inline
<style>block and intocss/wp-polls.css. Only four custom properties are emitted inline now –--wp-polls-bar-height,--wp-polls-bar-background,--wp-polls-bar-borderand--wp-polls-bar-image– and overriding those is the supported way to restyle the bar. If your theme ships its ownwp-polls.css, the bar rules are not in it; see the FAQ. - BREAKING: The
images/defaultandimages/default_gradientpoll bar tiles are gone. The two shaded styles were 1px wide GIFs that carried their own colours, so picking one silently discarded the Poll Bar Background setting. Poll Bar Style is now Flat or Gradient, both drawn in CSS from the colour you configure.defaultanddefault_gradientbecome Gradient on upgrade, and the old “Use CSS Style” becomes Flat. - FIXED: A poll answer with every vote drew a 99% bar, and in the polls archive every bar drew at 90% of its real percentage, so the same answer was a visibly different length in the two places. Both fudges existed to stop the old bar’s border overflowing its container and are no longer needed.
- FIXED: An answer with no votes drew a 1% sliver of a bar rather than an empty one.
- FIXED: The polls archive applied the
wp_polls_round_percentagerounding buffer unconditionally while the poll itself only applied it when the filter was turned on, so on a default install the same poll reported one set of percentages on the page and a different set in the archive. The archive now honours the filter, which defaults to off. If you relied on archive percentages summing to exactly 100, addadd_filter( 'wp_polls_round_percentage', '__return_true' );to turn it back on — it now applies in both places. - FIXED: With the
wp_polls_round_percentagefilter enabled, the last answer’s printed percentage gets a rounding buffer added so the column sums to 100. The bar width was calculated before that happened, so the last answer printed one number and drew a different one. Every bar now matches the percentage beside it. - BREAKING: The
%POLL_ANSWER_IMAGEWIDTH%template variable has been removed and is no longer substituted. It only ever held the percentage with a fudge applied so the old bar’s border did not overflow, and with the fudges gone it said nothing%POLL_ANSWER_PERCENTAGE%does not. Use%POLL_ANSWER_PERCENTAGE%instead. The upgrade rewrites both result templates, so you only need to act if you re-customise them afterwards. - CHANGED: The poll bar no longer carries a
titletooltip repeating the percentage and vote count that are already printed beside it, and is markedaria-hiddenso screen readers do not read those numbers twice. On Result Body (Voted) the “You Have Voted For This Choice” tooltip moves onto the answer text itself. - CHANGED: The bar fill animates in, and honours
prefers-reduced-motion. - CHANGED:
wp-polls-rtl.csshas been removed.css/wp-polls.cssnow uses CSS logical properties, so the one stylesheet lays out correctly in both directions and right-to-left sites load one file fewer. If your theme overrideswp-polls-rtl.css, fold those rules into yourwp-polls.css. - BREAKING: If you set “Header That Contains The IP”, WP-Polls used the whole header as the voter’s identity.
X-Forwarded-Foris a chain the visitor controls the left of, so appending one more hop produced a different identity and another vote. It now takes the first valid address in the header, and falls back toREMOTE_ADDRwhen the header holds no address at all. Sites that left the setting blank are unaffected and their existing vote logs still match. See the FAQ. - CHANGED: Added the
WP_POLLS_TRUST_PROXYconstant and thewp_polls_trust_proxyfilter, matching WP-Email and WP-UserOnline, so sites behind Cloudflare or a load balancer can opt in to the usual proxy headers without naming one on the settings screen. Proxy headers are still ignored unless you opt in. - CHANGED: Reformatted to the WordPress Coding Standards. Fifteen translatable strings gained numbered placeholders (
%1$s), which changes their msgid, so those strings need retranslating. - BREAKING: The settings row is named
wp_polls_optionsrather thanpoll_options, and the two version markerspoll_versionandpoll_db_versioncollapse into onewp_polls_versionrow holdingpluginanddb. All three old rows are folded in and removed on upgrade. - BREAKING: Poll Options and Poll Templates are two tabs of one Polls -> Settings screen instead of two menu entries. Their URLs change from
admin.php?page=wp-polls/polls-options.phpand…/polls-templates.phptoadmin.php?page=wp-polls-settings&tab=optionsand&tab=templates, and Manage Polls and Add Poll move toadmin.php?page=wp-pollsand?page=wp-polls-add. - BREAKING: WP-Polls no longer reads or writes WP-Stats’ shared
stats_displayrow. Whether the polls block appears on the WP-Stats page is now a WP-Polls setting, under WP-Polls -> Settings -> WP-Stats, and WP-Polls contributes its block through thewp_stats_sectionsfilter. Update all seven WP-Stats plugins together. - BREAKING: Every class is prefixed
WP_Polls_:Polls_OptionsisWP_Polls_Options,Polls_DisplayisWP_Polls_Display,Polls_VoteisWP_Polls_Vote,Polls_SettingsisWP_Polls_Settings,Polls_InstallisWP_Polls_Install,Polls_WidgetisWP_Polls_Widget,Polls_List_TableisWP_Polls_List_Table,Polls_TemplatesisWP_Polls_TemplateandPolls_Coreis plainWP_Polls. The template tags, the shortcodes and everywp_polls_*hook are unchanged. - NEW:
WP_POLLS_DB_VERSIONalongsideWP_POLLS_VERSION, and awp_polls_capabilityfilter over themanage_pollscheck. - CHANGED: The plugin files are laid out the way every other plugin here is: the five loose screens move into
includes/, the stylesheets intocss/and the scripts intojs/, named after the plugin. A theme overridingpolls-css.cssshould rename its copywp-polls.css. - CHANGED: The localised script objects are
wpPollsL10nandwpPollsAdminL10n, replacingpollsL10nandpollsAdminL10n. - CHANGED: The loading indicator is drawn in CSS instead of loading
images/loading.gif, so it inherits the theme’s colour, scales with the font size and stops animating for a visitor who has asked for reduced motion.images/is gone. - CHANGED: No wp-admin screen carries an inline
styleattribute any more: status messages use core’snoticeclasses and anything that starts hidden uses core’s.hiddenclass. - CHANGED: The front end stylesheet sets no font and no text colour, and its hardcoded blues, blacks and whites become
currentColorplus the--wp-polls-borderand--wp-polls-surfacecustom properties, so a poll is legible on a dark theme without a second stylesheet. - CHANGED: The two inline
<script>blocks the settings screens carried – the poll bar preview and the Restore Default Template buttons – moved intojs/wp-polls-admin.js. - FIXED:
current_time( 'timestamp' ), which WordPress deprecated, is replaced byWP_Polls::now(). Poll times are still stored as site-local, so nothing shifts. - NOTE: Every filter and action WP-Polls fires now carries a docblock recording what it is passed and which release introduced it.
- FIXED: The “maximum number of choices allowed” alert ended in a trailing space inside the translated string, and the script added a space of its own — so the number was preceded by two. The space belongs to the script, which is the same in every language
