Contributors: GamerZ
Donate link: http://lesterchan.net/site/donation/
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
Requires at least: 3.9
Tested up to: 4.2
Stable tag: 2.70
Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
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.
https://github.com/lesterchan/wp-polls
http://dev.wp-plugins.org/browser/wp-polls/i18n/
I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.
- NEW: Add wp_polls_vote_poll_success action hook
- NEW: Add wp_polls_add_poll, wp_polls_update_poll, wp_polls_delete_poll action hooks
- FIXED: PHP Notices
- FIXED: Removed not needed wp_print_scripts
- NEW: Make use of wp_add_inline_style. Props @pathawks.
- NEW: Create 2 filters for secret ballot. Props @afragen.
- FIXED: Added new index to wp_pollsip. Props ArtemR.
- FIXED: Integration with WP-Stats
- FIXED: Proper IP checking
- NEW: Poll answer percentage are now not rounded off, previously it was always rounded to add up to 100%
- NEW: Support WordPress MultiSite Network Activation
- NEW: Uses native WordPress uninstall.php
- NEW: Show shortcode in success message after creating a poll
- NEW: Checks and ensure that Poll Question and Poll Answers are not empty
- NEW: Checks whether Poll is closed before checking whether user has voted
- NEW: Use POST for View Results and Vote link
- FIXED: Added ?v=VERSION_NUMBER to the plugin TinyMCE JS because it is breaking a lot of editors due to cache issue
- FIXED: Added backward compatibility with [poll=1] in order not to break older polls
- FIXED: Notices from polls_archive function. Props. @prettyboymp.
- FIXED: Ajax request in parallel with animation. Props @nodecode.
- FIXED: Editor button was outputting the wrong shortcode.
- FIXED: ReferenceError: pollsEdL10n is not defined if TinyMCE 4.0 is loaded outside the Add/Edit Posts/Pages.
- NEW: Use Dashicons
- NEW: Supports TinyMCE 4.0 For WordPress 3.9
- NEW: Added Poll ID after adding it
- FIXED: Use SITECOOKIEPATH instead of COOKIEPATH.
- FIXED: Use http://ipinfo.io instead of http://ws.arin.net to get check IP information.
- FIXED: Wrapped all JS function in jQuery.ready(). It is ugly, but it will do till I have time to rewrite it.
- FIXED: Add INDEX for wp_pollsip: pollip_ip_qid (pollip_ip, pollip_qid) to prevent full table scan. Thanks archon810 from AndroidPolice.
- NEW: Add in various filters in the plugin. Props Machiel.
- FIXED: Deveral undefined variable / undefined index notices. Props Machiel.
- Move AJAX Request to wp-admin/admin-ajax.php
- Added nonce To AJAX Calls
- FIXED: PHP Notices/add_options() Deprecated Arguments (Dewey Bushaw)
- FIXED: Escaped Hostname. Thanks to Renaud Feil (Renaud Feil)
- FIXED: Ensure Poll ID In Shortcode Is An Integer. Thanks to Renaud Feil (Renaud Feil)
- FIXED: XSS Vulnerability. Thanks to Dweeks, Leon Juranic and Chad Lavoie of the Swiftwill Security Team Inc (www.swiftwill.com)
- NEW: Uses WordPress nonce Throughout
- NEW: Display 2,000 Records In Poll Logs Instead Of 100
- NEW: Works For WordPress 2.8 Only
- NEW: Javascript Now Placed At The Footer
- NEW: Uses jQuery Instead Of tw-sack
- NEW: Minified Javascript Instead Of Packed Javascript
- NEW: Renamed polls-admin-js-packed.js To polls-admin-js.js
- NEW: Renamed polls-admin-js.js To polls-admin-js.dev.js
- NEW: Renamed polls-js-packed.js To polls-js.js
- NEW: Renamed polls-js.js To polls-js.dev.js
- NEW: Translate Javascript Variables Using wp_localize_script()
- NEW: Add "Add Poll" To WordPress Favourite Actions
- NEW: Minified plugin.js And Added Non-Minified plugin.min.js
- NEW: Able To Remove Individual Answers When Adding Or Editing A Poll
- NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
- NEW: Uses New Widget Class From WordPress
- NEW: Merge Widget Code To wp-polls.php And Remove wp-polls-widget.php
- FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(FILE) Instead Of Just $_SERVER['REQUEST_URI']
- FIXED: Ensure That Percentage Always Add Up To 100%
- FIXED: More Efficient WP-Polls Archive
- FIXED: Logged By Username Now Shows Poll Results To Users Who Did Not Login
- NEW: Works For WordPress 2.7 Only
- NEW: Load Admin JS And CSS Only In WP-Polls Admin Pages
- NEW: Added polls-admin-css.css For WP-Polls Admin CSS Styles
- NEW: Right To Left Language Support by Kambiz R. Khojasteh
- NEW: Added "polls-css-rtl.css" by Kambiz R. Khojasteh
- NEW: Applied Output Of polls_archive() To "polls_archive" Filter by Kambiz R. Khojasteh
- NEW: Added Call To polls_textdomain() In create_poll_table() and vote_poll() functions by Kambiz R. Khojasteh
- NEW: Uses wp_register_style(), wp_print_styles(), plugins_url() And site_url()
- NEW: [poll id="-2"] or Will Randomize The Poll
- FIXED: SSL Support
- FIXED: Moved Call To update_pollbar() From onblur To onclick Event. It Was Showing The Last Selection Instead Of Current One by Kambiz R. Khojasteh
- NEW: Works For WordPress 2.6
- NEW: Better Translation Using __ngetext() by Anna Ozeritskaya
- FIXED: MYSQL Charset Issue Should Be Solved
- NEW: Works For WordPress 2.5 Only
- NEW: Added Paging Header And Footer Template For Polls Archive Page
- NEW: Uses WP-PageNavi Style Paging For Polls Archive Page
- NEW: WP-Polls Will Load 'polls-css.css' Inside Your Theme Directory If It Exists. If Not, It Will Just Load The Default 'polls-css.css' By WP-Polls
- NEW: Uses Shortcode API
- NEW: When Inserting Poll Into Post, It is Now [poll id="1"], Where 1 Is Your Poll ID
- NEW: When User Does Not Have Permission To Vote, The Voting Form Is Now Disabled Instead Of Showing Poll's Result
- NEW: Added A New Action Called "Display Disabled Poll's Voting Form" To Action Taken When A Poll Is Closed
- NEW: Updated WP-Polls TinyMCE Plugin To Work With TinyMCE 3.0
- NEW: Add Time Expiry For Cookie/Log
- NEW: Removed polls-usage.php
- NEW: Removed "Fade Anything Technique" In Polls Admin
- NEW: Uses /wp-polls/ Folder Instead Of /polls/
- NEW: Uses wp-polls.php Instead Of polls.php
- NEW: Uses wp-polls-widget.php Instead Of polls-widget.php
- NEW: Use number_format_i18n() Instead
- NEW: Renamed polls-admin-js.php To polls-admin-js.js and Move The Dynamic Javascript Variables To The PHP Pages
- NEW: Renamed polls-js.php To polls-js.js and Move The Dynamic Javascript Variables To The PHP Pages
- NEW: Uses polls-js-packed.js And polls-admin-js-packed.js
- FIXED: Unable To Delete Poll Or Poll Answers If There Is Quotes Within The Poll Or Poll Answer
- FIXED: number_format() Not Used In Polls Archive
- FIXED: Unable To Schedule Future Poll If The Year Is Different From Current Year
- FIXED: TinyMCE Tool Tip For Insert Poll Not Translated
- FIXED: Content-Type Not Being Sent Back When AJAX Return Results
- NEW: Works For WordPress 2.3 Only
- NEW: Added Quick Tag For Poll To Visual (TinyMCE) / Code Editor
- NEW: New CSS Style For WP-Polls Archive (.wp-polls-archive)
- NEW: Uses WP-Stats Filter To Add Stats Into WP-Stats Page
- NEW: Ability To Add Polls To Excerpt
- NEW: Added "Random Order" For Sorting Poll's Answers And Poll's Result Answers
- FIXED: Language Problem By Setting Database Table To UTF8
- FIXED: Some Text Not Translated In Polls Widget
- FIXED: 2 Wrong Options Name In Polls Uninstall
- FIXED: Some Translation Bug in polls-usage.php
- NEW: Poll Archive Link, Individual Poll Header And Footer In Poll Archive Template
- NEW: Poll Templates Has Now Its Own Page 'WP-Admin -> Polls -> Poll Templates'
- NEW: Poll Widget Can Now Display Multiple Polls
- NEW: Ability To Allow User To Select More Than 1 Poll Answer
- NEW: Added AJAX Style Option: "Show Loading Image With Text"
- NEW: Added AJAX Style Option: "Show Fading In And Fading Out Of Polls"
- NEW: Major Changes To The Administration Panel For WP-Polls
- NEW: AJAX Added To The Administration Panel For WP-Polls
- NEW: Default Poll's Result Template Will Now Show Number Of Votes Beside The Percentage
- NEW: Term "Total Votes" Changed To "Total Voters"
- NEW: Removed Polls From Feed If The Poll Is Embedded Into The Post Using [poll=ID]
- NEW: Filtering Of Individual Poll Logs
- FIXED: Poll Archive Will Now Show Only Polls Results
- NEW: Works For WordPress 2.1 Only
- NEW: Renamed polls-js.js to polls-js.php To Enable PHP Parsing
- NEW: Ability To Make A Poll Expire
- NEW: Ability To Make A Future Poll
- NEW: Future Poll Will Automatically Open When The Poll's Date Is Reached
- NEW: Expired Poll Will Automatically Closed When The Poll's Date Is Reached
- NEW: Ablity To Choose What To Do When The Poll Is Closed (Display Result, Remove Poll From Sidebar)
- FIXED: Future Dated Polls Will Not Appear In The Post/Sidebar/Polls Archive
- NEW: polls.php Now Handles The AJAX Processing Instead Of index.php
- NEW: Able To Modify The Style Of Poll Results Bar in 'Polls -> Poll Option'
- NEW: Usage Instructions Is Also Included Within The Plugin Itself
- NEW: Uninstaller Done By Philippe Corbes
- NEW: Localization Done By Ravan
- NEW: Ability To Add HTML Into Poll Question and Answers
- FIXED: AJAX Not Working On Servers Running On PHP CGI
- FIXED: Added Some Default Styles To polls-css.css To Ensure That WP-Polls Does Not Break
- FIXED: Other Languages Not Appearing Properly
- FIXED: Poll IP Logs Of Deleted Poll's Answer Did Not Get Deleted
- FIXED: There Is An Error In Voting If There Is Only 1 Poll's Answer
- NEW: Polls Archive Is Now Embedded Into A Page, And Hence No More Integrating Of Polls Archive
- NEW: WP-Polls Is Now Using DIV To Display The Poll's Results Instead Of The Image Bar
- NEW: Added Widget Title Option To WP-Polls Widget
- NEW: Ability To Logged By UserName
- NEW: Added CSS Class 'wp-polls-image' To All IMG Tags
- FIXED: If Site URL Doesn't Match WP Option's Site URL, WP-Polls Will Not Work
- NEW: You Can Now Place The Poll On The Sidebar As A Widget
- NEW: Moved wp-polls.php To wp-content/plugins/polls/ Folder
- FIXED: AJAX Not Working In Opera Browser
- FIXED: Poll Not Working On Physical Pages That Is Integrated Into WordPress
- NEW: Poll Is Now Using AJAX
- NEW: Ability To Close/Open Poll
- NEW: Added Poll Option For Logging Method
- NEW: Added Poll Option For Who Can Vote
- NEW: Added Poll Results Footer Template Variable (Used When User Click "View Results")
- NEW: Added The Ability To Delete All Poll Logs Or Logs From A Specific Poll
- NEW: Poll Administration Panel And The Code That WP-Polls Generated Is XHTML 1.0 Transitional
- FIXED: Bug In vote_poll();
- FIXED: Random Poll Not Working Correctly
- NEW: Poll Bar Is Slightly Nicer
- NEW: Got Rid Of Tables, Now Using List
- NEW: Added In Most Voted And Least Voted Answer/Votes/Percentage For Individual Poll As Template Variables
- NEW: Display Random Poll Option Under Poll -> Poll Options -> Current Poll
- FIXED: Totally Removed Tables In wp-polls.php
- NEW: Improved On 'manage_polls' Capabilities
- NEW: Neater Structure
- NEW: No More Install/Upgrade File, It Will Install/Upgrade When You Activate The Plugin
- NEW: Added Poll Stats Function
- NEW: Added 'manage_polls' Capabilities To Administrator Role
- NEW: [poll=POLL_ID] Tag To Insert Poll Into A Post
- NEW: Ability To Edit Poll's Timestamp
- NEW: Ability To Edit Individual Poll's Answer Votes
- NEW: %POLL_RESULT_URL% To Display Poll's Result URL
- FIXED: Cannot Sent Header Error
- NEW: Compatible With WordPress 2.0 Only
- NEW: Poll Administration Menu Added Automatically Upon Activating The Plugin
- NEW: Removed Add Poll Link From The Administration Menu
- NEW: GPL License Added
- NEW: Page Title Added To wp-polls.php
- FIXED: poll-install.php And poll-upgrade.php will Now Be Installed/Upgraded To 2.02 Instead Of 2.01
- FIXED: Showing 0 Vote On Poll Edit Page
- FIXED: Null Vote Being Counted As A Vote
- FIXED: Auto Loading Of Poll Option: Polls Per Page In Poll Archive Page Is Now "No"
- NEW: Host Column In Poll IP Table To Prevent Network Lagging When Resolving IP
- NEW: New Poll Error Template
- FIXED: Upgrade Script To Insert Lastest Poll ID Of User's Current Polls, Instead Of Poll ID 1
- FIXED: Replace All <?### With <?php
- FIXED: Added addalshes() To $pollip_user
- FIXED: Better Localization Support (80% Done, Will Leave It In The Mean Time)
- NEW: IP Logging
- NEW: Poll Options: Sorting Of Answers In Voting Form
- NEW: Poll Options: Sorting Of Answers In Results View
- NEW: Poll Options: Number Of Polls Per Page In Poll Archive
- NEW: Poll Options: Choose Poll To Display On Index Page
- NEW: Poll Options: Able To Disable Poll With Custom Message
- NEW: Poll Options: Poll Templates
- NEW: Display User's Voted Choice
- FIXED: Better Install/Upgrade Script
- Open
wp-content/plugins
Folder - Put:
Folder: wp-polls
- Activate
WP-Polls
Plugin - Go to
WP-Admin -> WP-Polls
- Open
wp-content/themes/<YOUR THEME NAME>/sidebar.php
- Add:
<?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
<li>
<h2>Polls</h2>
<ul>
<li><?php get_poll();?></li>
</ul>
<?php display_polls_archive_link(); ?>
</li>
<?php endif; ?>
- To show specific poll, use
<?php get_poll(2); ?>
where 2 is your poll id. - To show random poll, use
<?php get_poll(-2); ?>
- To embed a specific poll in your post, use
[poll id="2"]
where 2 is your poll id. - To embed a random poll in your post, use
[poll id="-2"]
- To embed a specific poll's result in your post, use
[poll id="2" type="result"]
where 2 is your poll id.
- Go to
WP-Admin -> Appearance -> Widgets
. - You can add the Polls Widget by clicking on the 'Add' link besides it.
- After adding, you can configure the Polls Widget by clicking on the 'Edit' link besides it.
- Click 'Save Changes'.
- Scroll down for instructions on how to create a Polls Archive.
- Deactivate
WP-Polls
Plugin - Open
wp-content/plugins
Folder - Put/Overwrite:
Folder: wp-polls
- Activate
WP-Polls
Plugin - Go to
WP-Admin -> Polls -> Polls Templates
and restore all the template variables toDefault
- Go to
WP-Admin -> Appearance -> Widgets
and re-add the Poll Widget
N/A
- Admin - All Poll
- Admin - Manage Polls
- Admin - Poll Options
- Admin - Poll Templates
- Admin - Poll Widget
- Admin - Uninstall Poll
- Poll - Single Poll Answer
- Poll - Mutiple Poll Answers
- Poll - Results
- Poll - Archive
- Go to
WP-Admin -> Pages -> Add New
. - Type any title you like in the post's title area.
- If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an 'Edit' link just beside the permalink.
- Click 'Edit' and type in
pollsarchive
in the text field and click 'Save'. - Type
[page_polls]
in the post's content area. - Click 'Publish'.
- If you ARE NOT using nice permalinks, you need to go to
WP-Admin -> Polls -> Poll Options
and underPoll Archive -> Polls Archive URL
, you need to fill in the URL to the Polls Archive Page you created above.
- It is because of rounding issues. To make it always round up to 100%, the last poll's answer will get the remainding percentage added to it. To enable this feature, add this to your theme's functions.php:
add_filter( 'wp_polls_round_percentage', '__return_true' );
- WP-Polls will load
polls-css.css
from your theme's directory if it exists. - If it doesn't exists, it will just load the default
polls-css.css
that comes with WP-Polls. - This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.
- To solve this issue, Open poll-css.css
- Find:
/* background-color: #ffffff; */
- Replace:
background-color: #ffffff;
(where #ffffff should be your background color for the poll.)
- Courtesy Of TreedBox.com
- Open poll-css.css
- Add to the end of the file:
.wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
.wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
.wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
.wp-polls-ul li:nth-child(04) .pollbar{ background:#a61e2a}
.wp-polls-ul li:nth-child(05) .pollbar{ background:#4ebbff}
.wp-polls-ul li:nth-child(06) .pollbar{ background:#fbca54}
.wp-polls-ul li:nth-child(07) .pollbar{ background:#aad34f}
.wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a}
.wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB}
.wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
.wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
.wp-polls-ul li .pollbar:hover{ background:#F00 }
- Use:
<?php if (function_exists('get_pollquestions')): ?>
<?php get_pollquestions(); ?>
<?php endif; ?>
- Use:
<?php if (function_exists('get_pollanswers')): ?>
<?php get_pollanswers(); ?>
<?php endif; ?>
- Use:
<?php if (function_exists('get_pollvotes')): ?>
<?php get_pollvotes(); ?>
<?php endif; ?>
- Use:
<?php if (function_exists('get_pollvoters')): ?>
<?php get_pollvoters(); ?>
<?php endif; ?>