Crowdsignal Dashboard – Polls, Surveys & more - Version 2.1.2

Version Description

  • Make sure that the poll Javascript code comes from Crowdsignal servers.
  • Show decimal numbers on poll results page.
Download this release

Release Info

Developer donncha
Plugin Icon 128x128 Crowdsignal Dashboard – Polls, Surveys & more
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

Files changed (3) hide show
  1. js/polldaddy-shortcode.js +9 -0
  2. polldaddy.php +2 -2
  3. readme.txt +10 -5
js/polldaddy-shortcode.js CHANGED
@@ -11,6 +11,15 @@
11
  var poll = $( this ).data( 'settings' );
12
 
13
  if ( poll ) {
 
 
 
 
 
 
 
 
 
14
  var wp_pd_js = document.createElement('script');
15
  wp_pd_js.type = 'text/javascript';
16
  wp_pd_js.src = poll['url'];
11
  var poll = $( this ).data( 'settings' );
12
 
13
  if ( poll ) {
14
+ var poll_url = document.createElement("a");
15
+ poll_url.href = poll['url'];
16
+ if ( poll_url.hostname != 'secure.polldaddy.com' && poll_url.hostname != 'static.polldaddy.com' ) {
17
+ return false;
18
+ }
19
+ var pathname = poll_url.pathname;
20
+ if ( ! /\/?p\/\d+\.js/.test( pathname ) ) {
21
+ return false;
22
+ }
23
  var wp_pd_js = document.createElement('script');
24
  wp_pd_js.type = 'text/javascript';
25
  wp_pd_js.src = poll['url'];
polldaddy.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
7
  * Author: Automattic, Inc.
8
  * Author URL: https://crowdsignal.com/
9
- * Version: 2.1.1
10
  */
11
 
12
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
@@ -2574,7 +2574,7 @@ src="https://static.polldaddy.com/p/<?php echo (int) $poll_id; ?>.js"&gt;&lt;/sc
2574
  <?php echo number_format_i18n( $answer->_total ); ?>
2575
  </td>
2576
  <td style="text-align:center;vertical-align:middle;">
2577
- <?php echo number_format_i18n( $answer->_percent ); ?>%
2578
  </td>
2579
  <td style="vertical-align:middle;">
2580
  <span class="result-bar" style="width: <?php echo number_format( $answer->_percent, 2 ); ?>%;">&nbsp;</span>
6
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
7
  * Author: Automattic, Inc.
8
  * Author URL: https://crowdsignal.com/
9
+ * Version: 2.1.2
10
  */
11
 
12
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
2574
  <?php echo number_format_i18n( $answer->_total ); ?>
2575
  </td>
2576
  <td style="text-align:center;vertical-align:middle;">
2577
+ <?php echo number_format_i18n( $answer->_percent, 2 ); ?>%
2578
  </td>
2579
  <td style="vertical-align:middle;">
2580
  <span class="result-bar" style="width: <?php echo number_format( $answer->_percent, 2 ); ?>%;">&nbsp;</span>
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Crowdsignal Polls & Ratings ===
2
  Contributors: eoigal, mdawaffe, donncha, johnny5, panosktn, ice9js
3
  Tags: crowdsignal, polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
- Requires at least: 3.3
5
- Tested up to: 5.0
6
- Stable tag: 2.1.1
 
7
 
8
  Create and manage Crowdsignal polls and ratings from within WordPress.
9
 
@@ -57,7 +58,7 @@ Want to help translate the plugin or keep an existing translation up-to-date? He
57
 
58
  Some strings are not translated when polls and surveys are embedded. You will have to translate them using a language pack on [Crowdsignal.com](https://crowdsignal.com/).
59
 
60
- Development of the plugin will take place in [this Github repository](https://github.com/Automattic/polldaddy-plugin).
61
 
62
  == Installation ==
63
 
@@ -121,10 +122,14 @@ This is possible if your server or network is blocking outgoing calls to Crowdsi
121
  Make sure to whitelist `api.crowdsignal.com` in your firewall to fix this.
122
 
123
  == Upgrade Notice ==
124
- Don't autoload the usercode blog options
125
 
126
  == Changelog ==
127
 
 
 
 
 
128
  = 2.1.1 =
129
  * Updated regular expressions within the plugin for PHP 7.3 compatibility.
130
  * Fixed 'button'-type shortcode embed links.
1
  === Crowdsignal Polls & Ratings ===
2
  Contributors: eoigal, mdawaffe, donncha, johnny5, panosktn, ice9js
3
  Tags: crowdsignal, polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
+ Requires at least: 4.6
5
+ Requires PHP: 5.6
6
+ Tested up to: 5.1.1
7
+ Stable tag: 2.1.2
8
 
9
  Create and manage Crowdsignal polls and ratings from within WordPress.
10
 
58
 
59
  Some strings are not translated when polls and surveys are embedded. You will have to translate them using a language pack on [Crowdsignal.com](https://crowdsignal.com/).
60
 
61
+ Development of the plugin will take place in [this Github repository](https://github.com/Automattic/crowdsignal-plugin).
62
 
63
  == Installation ==
64
 
122
  Make sure to whitelist `api.crowdsignal.com` in your firewall to fix this.
123
 
124
  == Upgrade Notice ==
125
+ Security update: make sure the Javascript embed comes from Crowdsignal servers.
126
 
127
  == Changelog ==
128
 
129
+ = 2.1.2 =
130
+ * Make sure that the poll Javascript code comes from Crowdsignal servers.
131
+ * Show decimal numbers on poll results page.
132
+
133
  = 2.1.1 =
134
  * Updated regular expressions within the plugin for PHP 7.3 compatibility.
135
  * Fixed 'button'-type shortcode embed links.