WP-Polls - Version 2.73.8

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Polls
Version 2.73.8
Comparing to
See all releases

Code changes from version 2.73.7 to 2.73.8

Files changed (3) hide show
  1. polls-manager.php +2 -2
  2. readme.txt +18 -14
  3. wp-polls.php +4 -4
polls-manager.php CHANGED
@@ -30,7 +30,7 @@ if(!empty($_POST['do'])) {
30
  $pollq_active = (int) sanitize_key($_POST['pollq_active']);
31
  // Poll Start Date
32
  $pollq_timestamp = isset( $_POST['poll_timestamp_old'] ) ? $_POST['poll_timestamp_old'] : current_time( 'timestamp' );
33
- $edit_polltimestamp = isset( $_POST['edit_polltimestamp'] ) && (int) sanitize_key( $_POST['edit_polltimestamp'] ) === 1;
34
  if($edit_polltimestamp === 1) {
35
  $pollq_timestamp_day = (int) sanitize_key($_POST['pollq_timestamp_day']);
36
  $pollq_timestamp_month = (int) sanitize_key($_POST['pollq_timestamp_month']);
@@ -179,7 +179,7 @@ if(!empty($_POST['do'])) {
179
  // Update Lastest Poll ID To Poll Options
180
  $latest_pollid = polls_latest_id();
181
  $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
182
- do_action( 'wp_polls_update_poll', $latest_pollid );
183
  cron_polls_place();
184
  break;
185
  }
30
  $pollq_active = (int) sanitize_key($_POST['pollq_active']);
31
  // Poll Start Date
32
  $pollq_timestamp = isset( $_POST['poll_timestamp_old'] ) ? $_POST['poll_timestamp_old'] : current_time( 'timestamp' );
33
+ $edit_polltimestamp = isset( $_POST['edit_polltimestamp'] ) && (int) sanitize_key( $_POST['edit_polltimestamp'] ) === 1 ? 1 : 0;
34
  if($edit_polltimestamp === 1) {
35
  $pollq_timestamp_day = (int) sanitize_key($_POST['pollq_timestamp_day']);
36
  $pollq_timestamp_month = (int) sanitize_key($_POST['pollq_timestamp_month']);
179
  // Update Lastest Poll ID To Poll Options
180
  $latest_pollid = polls_latest_id();
181
  $update_latestpoll = update_option('poll_latestpoll', $latest_pollid);
182
+ do_action( 'wp_polls_update_poll', $pollq_id );
183
  cron_polls_place();
184
  break;
185
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: GamerZ
3
  Donate link: https://lesterchan.net/site/donation/
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
  Requires at least: 4.0
6
- Tested up to: 4.8
7
- Stable tag: 2.73.7
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
@@ -27,6 +27,10 @@ WP-Polls is extremely customizable via templates and css styles and there are to
27
  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.
28
 
29
  ## Changelog
 
 
 
 
30
  * FIXED: Unable to save input HTML tags for footer templates
31
 
32
  ### Version 2.73.6
@@ -92,7 +96,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
92
 
93
  ### General Usage (Without Widget)
94
 
95
- ```
96
  <?php if ( function_exists( 'vote_poll' ) && ! in_pollarchive() ): ?>
97
  <li>
98
  <h2>Polls</h2>
@@ -102,7 +106,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
102
  <?php display_polls_archive_link(); ?>
103
  </li>
104
  <?php endif; ?>
105
- ```
106
 
107
  * To show specific poll, use `<?php get_poll(2); ?>` where 2 is your poll id.
108
  * To show random poll, use `<?php get_poll(-2); ?>`
@@ -145,7 +149,7 @@ I spent most of my free time creating, updating, maintaining and supporting thes
145
  * Open poll-css.css
146
  * Add to the end of the file:
147
 
148
- ```
149
  .wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
150
  .wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
151
  .wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
@@ -158,36 +162,36 @@ I spent most of my free time creating, updating, maintaining and supporting thes
158
  .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
159
  .wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
160
  .wp-polls-ul li .pollbar:hover{ background:#F00 }
161
- ```
162
 
163
  ### To Display Total Polls
164
 
165
- ```
166
  <?php if ( function_exists( 'get_pollquestions' ) ): ?>
167
  <?php get_pollquestions(); ?>
168
  <?php endif; ?>
169
- ```
170
 
171
  ### To Display Total Poll Answers
172
 
173
- ```
174
  <?php if ( function_exists( 'get_pollanswers' ) ): ?>
175
  <?php get_pollanswers(); ?>
176
  <?php endif; ?>
177
- ```
178
 
179
  ### To Display Total Poll Votes
180
 
181
- ```
182
  <?php if ( function_exists( 'get_pollvotes' ) ): ?>
183
  <?php get_pollvotes(); ?>
184
  <?php endif; ?>
185
- ```
186
 
187
  ### To Display Total Poll Voters
188
 
189
- ```
190
  <?php if ( function_exists( 'get_pollvoters' ) ): ?>
191
  <?php get_pollvoters(); ?>
192
  <?php endif; ?>
193
- ```
3
  Donate link: https://lesterchan.net/site/donation/
4
  Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
5
  Requires at least: 4.0
6
+ Tested up to: 4.9
7
+ Stable tag: 2.73.8
8
 
9
  Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
10
 
27
  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.
28
 
29
  ## Changelog
30
+ ### Version 2.73.8
31
+ * FIXED: Bug fixes and stricter type checking
32
+
33
+ ### Version 2.73.7
34
  * FIXED: Unable to save input HTML tags for footer templates
35
 
36
  ### Version 2.73.6
96
 
97
  ### General Usage (Without Widget)
98
 
99
+ ~~~
100
  <?php if ( function_exists( 'vote_poll' ) && ! in_pollarchive() ): ?>
101
  <li>
102
  <h2>Polls</h2>
106
  <?php display_polls_archive_link(); ?>
107
  </li>
108
  <?php endif; ?>
109
+ ~~~
110
 
111
  * To show specific poll, use `<?php get_poll(2); ?>` where 2 is your poll id.
112
  * To show random poll, use `<?php get_poll(-2); ?>`
149
  * Open poll-css.css
150
  * Add to the end of the file:
151
 
152
+ ~~~
153
  .wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
154
  .wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
155
  .wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
162
  .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
163
  .wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
164
  .wp-polls-ul li .pollbar:hover{ background:#F00 }
165
+ ~~~
166
 
167
  ### To Display Total Polls
168
 
169
+ ~~~
170
  <?php if ( function_exists( 'get_pollquestions' ) ): ?>
171
  <?php get_pollquestions(); ?>
172
  <?php endif; ?>
173
+ ~~~
174
 
175
  ### To Display Total Poll Answers
176
 
177
+ ~~~
178
  <?php if ( function_exists( 'get_pollanswers' ) ): ?>
179
  <?php get_pollanswers(); ?>
180
  <?php endif; ?>
181
+ ~~~
182
 
183
  ### To Display Total Poll Votes
184
 
185
+ ~~~
186
  <?php if ( function_exists( 'get_pollvotes' ) ): ?>
187
  <?php get_pollvotes(); ?>
188
  <?php endif; ?>
189
+ ~~~
190
 
191
  ### To Display Total Poll Voters
192
 
193
+ ~~~
194
  <?php if ( function_exists( 'get_pollvoters' ) ): ?>
195
  <?php get_pollvoters(); ?>
196
  <?php endif; ?>
197
+ ~~~
wp-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Polls
4
  Plugin URI: https://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include 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.
6
- Version: 2.73.7
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-polls
@@ -29,7 +29,7 @@ Text Domain: wp-polls
29
  */
30
 
31
  ### Version
32
- define( 'WP_POLLS_VERSION', '2.73.7' );
33
 
34
 
35
  ### Create Text Domain For Translations
@@ -530,7 +530,7 @@ function display_pollvote($poll_id, $display_loading = true) {
530
 
531
 
532
  ### Function: Display Results Form
533
- function display_pollresult($poll_id, $user_voted = '', $display_loading = true) {
534
  global $wpdb;
535
  do_action( 'wp_polls_display_pollresult', $poll_id, $user_voted );
536
  $poll_id = (int) $poll_id;
@@ -541,7 +541,7 @@ function display_pollresult($poll_id, $user_voted = '', $display_loading = true)
541
  if ( is_array( $user_voted ) ) {
542
  $user_voted = array_map( 'intval', $user_voted );
543
  } else {
544
- $user_voted = (int) $user_voted;
545
  }
546
 
547
  // Temp Poll Result
3
  Plugin Name: WP-Polls
4
  Plugin URI: https://lesterchan.net/portfolio/programming/php/
5
  Description: Adds an AJAX poll system to your WordPress blog. You can easily include 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.
6
+ Version: 2.73.8
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-polls
29
  */
30
 
31
  ### Version
32
+ define( 'WP_POLLS_VERSION', '2.73.8' );
33
 
34
 
35
  ### Create Text Domain For Translations
530
 
531
 
532
  ### Function: Display Results Form
533
+ function display_pollresult($poll_id, $user_voted = array(), $display_loading = true) {
534
  global $wpdb;
535
  do_action( 'wp_polls_display_pollresult', $poll_id, $user_voted );
536
  $poll_id = (int) $poll_id;
541
  if ( is_array( $user_voted ) ) {
542
  $user_voted = array_map( 'intval', $user_voted );
543
  } else {
544
+ $user_voted = array( (int) $user_voted );
545
  }
546
 
547
  // Temp Poll Result