Crowdsignal Dashboard – Polls, Surveys & more - Version 1.6

Version Description

  • Added Poll Question and Answer fields now accept limited HTML tags
  • Added 'Share This' link option to allow voters to share the poll around the interweb
Download this release

Release Info

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

Code changes from version 1.5 to 1.6

Files changed (4) hide show
  1. polldaddy-client.php +2 -1
  2. polldaddy-xml.php +1 -0
  3. polldaddy.php +63 -8
  4. readme.txt +6 -2
polldaddy-client.php CHANGED
@@ -645,7 +645,7 @@ function &polldaddy_poll( $args = null, $id = null, $_require_data = true ) {
645
  return $false;
646
  }
647
 
648
- foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'makePublic', 'closePoll', 'closePollNow' ) as $bool ) {
649
  if ( 'no' !== $args[$bool] && 'yes' !== $args[$bool] )
650
  $args[$bool] = $defaults[$bool];
651
  }
@@ -692,6 +692,7 @@ function _polldaddy_poll_defaults() {
692
  'closePoll' => 'no',
693
  'closePollNow' => 'no',
694
  'closeDate' => null,
 
695
  'styleID' => 0,
696
  'packID' => 0,
697
  'folderID' => 0,
645
  return $false;
646
  }
647
 
648
+ foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'makePublic', 'closePoll', 'closePollNow', 'sharing' ) as $bool ) {
649
  if ( 'no' !== $args[$bool] && 'yes' !== $args[$bool] )
650
  $args[$bool] = $defaults[$bool];
651
  }
692
  'closePoll' => 'no',
693
  'closePollNow' => 'no',
694
  'closeDate' => null,
695
+ 'sharing' => 'yes',
696
  'styleID' => 0,
697
  'packID' => 0,
698
  'folderID' => 0,
polldaddy-xml.php CHANGED
@@ -269,6 +269,7 @@ class PollDaddy_Poll extends PollDaddy_XML_Object {
269
  var $parentID;
270
  var $answers;
271
 
 
272
  var $rank;
273
  var $url;
274
  }
269
  var $parentID;
270
  var $answers;
271
 
272
+ var $sharing;
273
  var $rank;
274
  var $url;
275
  }
polldaddy.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: PollDaddy Polls
5
  Description: Create and manage PollDaddy polls in WordPress
6
  Author: Automattic, Inc.
7
  Author URL: http://automattic.com/
8
- Version: 1.5
9
  */
10
 
11
  // You can hardcode your PollDaddy PartnerGUID (API Key) here
@@ -24,7 +24,7 @@ class WP_PollDaddy {
24
  var $base_url = false;
25
  var $use_ssl = 0;
26
  var $scheme = 'https';
27
- var $version = '1.5';
28
 
29
  var $polldaddy_clients = array();
30
 
@@ -317,6 +317,38 @@ class WP_PollDaddy {
317
  add_action( 'admin_notices', array( &$this, 'management_page_notices' ) );
318
 
319
  $query_args = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
 
321
  $is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
322
 
@@ -488,7 +520,7 @@ class WP_PollDaddy {
488
  if ( '_' === $key[0] )
489
  unset( $poll_data[$key] );
490
 
491
- foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer' ) as $option ) {
492
  if ( isset( $_POST[$option] ) && $_POST[$option] )
493
  $poll_data[$option] = 'yes';
494
  else
@@ -511,7 +543,9 @@ class WP_PollDaddy {
511
  foreach ( $_POST['answer'] as $answer_id => $answer ) {
512
  if ( !$answer = trim( stripslashes( $answer ) ) )
513
  continue;
514
-
 
 
515
  if ( is_numeric( $answer_id ) )
516
  $answers[] = polldaddy_poll_answer( $answer, $answer_id );
517
  else
@@ -526,6 +560,8 @@ class WP_PollDaddy {
526
 
527
  $poll_data['answers'] = $answers;
528
 
 
 
529
  if ( isset ( $_POST['styleID'] ) ){
530
  if ( $_POST['styleID'] == 'x' ){
531
  $this->errors->add( 'UpdatePoll', __( 'Please choose a poll style' ) );
@@ -560,9 +596,15 @@ class WP_PollDaddy {
560
  $polldaddy->reset();
561
 
562
  $answers = array();
563
- foreach ( $_POST['answer'] as $answer )
564
- if ( $answer = trim( stripslashes( $answer ) ) )
565
- $answers[] = polldaddy_poll_answer( $answer );
 
 
 
 
 
 
566
  if ( !$answers )
567
  return false;
568
 
@@ -572,6 +614,9 @@ class WP_PollDaddy {
572
  $poll_data[$key] = stripslashes( $_POST[$key] );
573
 
574
  $poll_data['answers'] = $answers;
 
 
 
575
  if ( isset ( $_POST['styleID'] ) ){
576
  if ( $_POST['styleID'] == 'x' ){
577
  $this->errors->add( 'UpdatePoll', __( 'Please choose a poll style' ) );
@@ -831,6 +876,11 @@ class WP_PollDaddy {
831
  foreach ( $polls as $poll ) :
832
  $poll_id = (int) $poll->_id;
833
 
 
 
 
 
 
834
  $poll_closed = (int) $poll->_closed;
835
 
836
  if ( $this->can_edit( $poll ) )
@@ -1083,7 +1133,7 @@ class WP_PollDaddy {
1083
  <ul id="answer-options">
1084
 
1085
  <?php
1086
- foreach ( array( 'multipleChoice' => __( 'Multiple choice' ), 'randomiseAnswers' => __( 'Randomize answer order' ), 'otherAnswer' => __( 'Allow other answers' ) ) as $option => $label ) :
1087
  if ( $is_POST )
1088
  $checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
1089
  else
@@ -1253,6 +1303,11 @@ pd_change_style( <?php echo $style_ID ?> );
1253
  <?php
1254
  $class = '';
1255
  foreach ( $results->answers as $answer ) :
 
 
 
 
 
1256
  $class = $class ? '' : ' class="alternate"';
1257
  $content = $results->others && 'Other answer...' === $answer->___content ? sprintf( __( 'Other (<a href="%s">see below</a>)' ), '#other-answers-results' ) : wp_specialchars( $answer->___content );
1258
 
5
  Description: Create and manage PollDaddy polls in WordPress
6
  Author: Automattic, Inc.
7
  Author URL: http://automattic.com/
8
+ Version: 1.6
9
  */
10
 
11
  // You can hardcode your PollDaddy PartnerGUID (API Key) here
24
  var $base_url = false;
25
  var $use_ssl = 0;
26
  var $scheme = 'https';
27
+ var $version = '1.6';
28
 
29
  var $polldaddy_clients = array();
30
 
317
  add_action( 'admin_notices', array( &$this, 'management_page_notices' ) );
318
 
319
  $query_args = array();
320
+
321
+ $allowedtags = array(
322
+ 'a' => array(
323
+ 'href' => array (),
324
+ 'title' => array (),
325
+ 'target' => array ()),
326
+ 'img' => array(
327
+ 'alt' => array (),
328
+ 'align' => array (),
329
+ 'border' => array (),
330
+ 'class' => array (),
331
+ 'height' => array (),
332
+ 'hspace' => array (),
333
+ 'longdesc' => array (),
334
+ 'vspace' => array (),
335
+ 'src' => array (),
336
+ 'width' => array ()),
337
+ 'abbr' => array(
338
+ 'title' => array ()),
339
+ 'acronym' => array(
340
+ 'title' => array ()),
341
+ 'b' => array(),
342
+ 'blockquote' => array(
343
+ 'cite' => array ()),
344
+ 'cite' => array (),
345
+ 'em' => array (),
346
+ 'i' => array (),
347
+ 'q' => array(
348
+ 'cite' => array ()),
349
+ 'strike' => array(),
350
+ 'strong' => array()
351
+ );
352
 
353
  $is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
354
 
520
  if ( '_' === $key[0] )
521
  unset( $poll_data[$key] );
522
 
523
+ foreach ( array( 'multipleChoice', 'randomiseAnswers', 'otherAnswer', 'sharing' ) as $option ) {
524
  if ( isset( $_POST[$option] ) && $_POST[$option] )
525
  $poll_data[$option] = 'yes';
526
  else
543
  foreach ( $_POST['answer'] as $answer_id => $answer ) {
544
  if ( !$answer = trim( stripslashes( $answer ) ) )
545
  continue;
546
+
547
+ $answer = wp_kses( $answer, $allowedtags );
548
+
549
  if ( is_numeric( $answer_id ) )
550
  $answers[] = polldaddy_poll_answer( $answer, $answer_id );
551
  else
560
 
561
  $poll_data['answers'] = $answers;
562
 
563
+ $poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
564
+
565
  if ( isset ( $_POST['styleID'] ) ){
566
  if ( $_POST['styleID'] == 'x' ){
567
  $this->errors->add( 'UpdatePoll', __( 'Please choose a poll style' ) );
596
  $polldaddy->reset();
597
 
598
  $answers = array();
599
+ foreach ( $_POST['answer'] as $answer ){
600
+ if ( !$answer = trim( stripslashes( $answer ) ) )
601
+ continue;
602
+
603
+ $answer = wp_kses( $answer, $allowedtags );
604
+
605
+ $answers[] = polldaddy_poll_answer( $answer );
606
+ }
607
+
608
  if ( !$answers )
609
  return false;
610
 
614
  $poll_data[$key] = stripslashes( $_POST[$key] );
615
 
616
  $poll_data['answers'] = $answers;
617
+
618
+ $poll_data['question'] = wp_kses( $poll_data['question'], $allowedtags );
619
+
620
  if ( isset ( $_POST['styleID'] ) ){
621
  if ( $_POST['styleID'] == 'x' ){
622
  $this->errors->add( 'UpdatePoll', __( 'Please choose a poll style' ) );
876
  foreach ( $polls as $poll ) :
877
  $poll_id = (int) $poll->_id;
878
 
879
+ $poll->___content = trim( strip_tags( $poll->___content ) );
880
+ if( strlen( $poll->___content ) == 0 ){
881
+ $poll->___content = '-- empty HTML tag --';
882
+ }
883
+
884
  $poll_closed = (int) $poll->_closed;
885
 
886
  if ( $this->can_edit( $poll ) )
1133
  <ul id="answer-options">
1134
 
1135
  <?php
1136
+ foreach ( array( 'multipleChoice' => __( 'Multiple choice' ), 'randomiseAnswers' => __( 'Randomize answer order' ), 'otherAnswer' => __( 'Allow other answers' ), 'sharing' => __( "'Share This' link" ) ) as $option => $label ) :
1137
  if ( $is_POST )
1138
  $checked = 'yes' === $_POST[$option] ? ' checked="checked"' : '';
1139
  else
1303
  <?php
1304
  $class = '';
1305
  foreach ( $results->answers as $answer ) :
1306
+ $answer->___content = trim( strip_tags( $answer->___content ) );
1307
+ if( strlen( $answer->___content ) == 0 ){
1308
+ $answer->___content = '-- empty HTML tag --';
1309
+ }
1310
+
1311
  $class = $class ? '' : ' class="alternate"';
1312
  $content = $results->others && 'Other answer...' === $answer->___content ? sprintf( __( 'Other (<a href="%s">see below</a>)' ), '#other-answers-results' ) : wp_specialchars( $answer->___content );
1313
 
readme.txt CHANGED
@@ -3,13 +3,13 @@ Contributors: mdawaffe, eoigal
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys
4
  Requires at least: 2.6
5
  Tested up to: 2.7.1
6
- Stable tag: 1.5
7
 
8
  Create and manage PollDaddy polls from within WordPress.
9
 
10
  == Description ==
11
 
12
- The PollDaddy plugin allows you to create and manage your [PollDaddy.com](http://polldaddy.com/) polls from within your WordPress blog's administration area.
13
 
14
  == Installation ==
15
 
@@ -32,6 +32,10 @@ Yes. You'll be able to edit the polls they create from your blog. (You won't be
32
  Nope. The permissions are the same as for posts. So Editors and Administrators can edit anyone's polls for that blog. Authors can only edit their own.
33
 
34
  == Change Log ==
 
 
 
 
35
  = 1.5 =
36
  Bug Fix: Other answers in the poll results are now displaying.
37
 
3
  Tags: polls, poll, polldaddy, wppolls, vote, polling, surveys
4
  Requires at least: 2.6
5
  Tested up to: 2.7.1
6
+ Stable tag: 1.6
7
 
8
  Create and manage PollDaddy polls from within WordPress.
9
 
10
  == Description ==
11
 
12
+ The PollDaddy Polls plugin allows you to create and manage polls from within your WordPress dashboard. You can create polls, choose from 20 different styles for your polls and view all results for your polls as they come in. All PollDaddy polls are fully customizable, you can set a close date for your poll, create multiple choice polls, choose whether to display the results or keep them private. You can even embed the polls you create on other websites. You can collect unlimited votes and create unlimited polls.
13
 
14
  == Installation ==
15
 
32
  Nope. The permissions are the same as for posts. So Editors and Administrators can edit anyone's polls for that blog. Authors can only edit their own.
33
 
34
  == Change Log ==
35
+ = 1.6 =
36
+ * Added Poll Question and Answer fields now accept limited HTML tags
37
+ * Added 'Share This' link option to allow voters to share the poll around the interweb
38
+
39
  = 1.5 =
40
  Bug Fix: Other answers in the poll results are now displaying.
41