Popups – WordPress Popup - Version 1.9.3.2

Version Description

  • Ninja forms fix
  • Added new display rule "custom url"
  • Added new display rule "keyword in url"
  • Basic css removed to make it more compatible with themes
Download this release

Release Info

Developer timersys
Plugin Icon 128x128 Popups – WordPress Popup
Version 1.9.3.2
Comparing to
See all releases

Code changes from version 1.9.3.1 to 1.9.3.2

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Popups - WordPress Popup ===
2
  Contributors: timersys
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q
4
- Tags: popup,twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, postmatic, mailpoet, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe, login popup, ajax login popups, popupmaker
5
  Requires at least: 3.6
6
- Tested up to: 4.9.6
7
- Stable tag: 1.9.3.1
8
  Requires PHP: 5.3
9
  Text Domain: popups
10
  License: GPLv2 or later
@@ -184,6 +184,12 @@ If you have cache be sure to enable AJAX mode in the plugin settings page
184
 
185
  == Changelog ==
186
 
 
 
 
 
 
 
187
  = 1.9.3.1 =
188
  * Fixed security vulnerability. Thanks DefenseCode and their ThunderScan tool
189
 
1
  === Popups - WordPress Popup ===
2
  Contributors: timersys
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q
4
+ Tags: popup,twitter,google+,facebook,Popups,twitter follow,facebook like,mailchimp,Activecampaign,Mailpoet,Postmatic,Infusionsoft,mailerlite,constant contact,aweber,google plus,social boost,social splash,postmatic,mailpoet,facebook popup,scroll popups,popups,wordpress popup,wp popups,cf7,gf,gravity forms,contact form 7,ifs,infusion soft,subscribe,login popup,ajax login popups,popupmaker
5
  Requires at least: 3.6
6
+ Tested up to: 4.9.7
7
+ Stable tag: 1.9.3.2
8
  Requires PHP: 5.3
9
  Text Domain: popups
10
  License: GPLv2 or later
184
 
185
  == Changelog ==
186
 
187
+ = 1.9.3.2 =
188
+ * Ninja forms fix
189
+ * Added new display rule "custom url"
190
+ * Added new display rule "keyword in url"
191
+ * Basic css removed to make it more compatible with themes
192
+
193
  = 1.9.3.1 =
194
  * Fixed security vulnerability. Thanks DefenseCode and their ThunderScan tool
195
 
admin/class-social-popup-admin.php CHANGED
@@ -771,7 +771,9 @@ class SocialPopup_Admin {
771
  ),
772
  __("Other", 'popups' ) => array(
773
  'referrer' => __("Referrer", 'popups' ),
774
- 'query_string' => __("Query String", 'popups' ),
 
 
775
  'mobiles' => __("Mobile Phone", 'popups' ),
776
  'tablets' => __("Tablet", 'popups' ),
777
  'desktop' => __("Dekstop", 'popups' ),
@@ -817,6 +819,8 @@ class SocialPopup_Admin {
817
  add_action('spu/rules/print_crawlers_field', array('Spu_Helper', 'print_select'), 10, 2);
818
  add_action('spu/rules/print_referrer_field', array('Spu_Helper', 'print_textfield'), 10, 1);
819
  add_action('spu/rules/print_query_string_field', array('Spu_Helper', 'print_textfield'), 10, 1);
 
 
820
  add_action('spu/rules/print_browser_field', array('Spu_Helper', 'print_textfield'), 10, 1);
821
  }
822
 
771
  ),
772
  __("Other", 'popups' ) => array(
773
  'referrer' => __("Referrer", 'popups' ),
774
+ 'query_string' => __("Query String", 'popups' ),
775
+ 'keyword_url' => __("Url contains keyword", 'popups' ),
776
+ 'custom_url' => __("Custom Url", 'popups' ),
777
  'mobiles' => __("Mobile Phone", 'popups' ),
778
  'tablets' => __("Tablet", 'popups' ),
779
  'desktop' => __("Dekstop", 'popups' ),
819
  add_action('spu/rules/print_crawlers_field', array('Spu_Helper', 'print_select'), 10, 2);
820
  add_action('spu/rules/print_referrer_field', array('Spu_Helper', 'print_textfield'), 10, 1);
821
  add_action('spu/rules/print_query_string_field', array('Spu_Helper', 'print_textfield'), 10, 1);
822
+ add_action('spu/rules/print_keyword_url_field', array('Spu_Helper', 'print_textfield'), 10, 1);
823
+ add_action('spu/rules/print_custom_url_field', array('Spu_Helper', 'print_textfield'), 10, 1);
824
  add_action('spu/rules/print_browser_field', array('Spu_Helper', 'print_textfield'), 10, 1);
825
  }
826
 
includes/class-spu-helper.php CHANGED
@@ -333,7 +333,6 @@ class Spu_Helper {
333
  {
334
  die();
335
  }
336
-
337
  }
338
 
339
  /**
333
  {
334
  die();
335
  }
 
336
  }
337
 
338
  /**
popups.php CHANGED
@@ -11,7 +11,7 @@
11
  * @socialpopup
12
  * Plugin Name: Popups - WordPress Popup
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
- * Version: 1.9.3.1
15
  * Description: Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
16
  * Author: timersys
17
  * Author URI: https://timersys.com
@@ -30,7 +30,7 @@ if ( ! defined( 'WPINC' ) ) {
30
  * Public-Facing Functionality
31
  *----------------------------------------------------------------------------*/
32
 
33
- define( 'SPU_VERSION' , '1.9.3' );
34
  define( 'SPU_PLUGIN_DIR' , plugin_dir_path(__FILE__) );
35
  define( 'SPU_PLUGIN_URL' , plugin_dir_url(__FILE__) );
36
  define( 'SPU_PLUGIN_HOOK' , basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
11
  * @socialpopup
12
  * Plugin Name: Popups - WordPress Popup
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
+ * Version: 1.9.3.2
15
  * Description: Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
16
  * Author: timersys
17
  * Author URI: https://timersys.com
30
  * Public-Facing Functionality
31
  *----------------------------------------------------------------------------*/
32
 
33
+ define( 'SPU_VERSION' , '1.9.3.2' );
34
  define( 'SPU_PLUGIN_DIR' , plugin_dir_path(__FILE__) );
35
  define( 'SPU_PLUGIN_URL' , plugin_dir_url(__FILE__) );
36
  define( 'SPU_PLUGIN_HOOK' , basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
public/assets/css/public.css CHANGED
@@ -38,21 +38,6 @@ body {
38
  margin: 0;
39
  }
40
  /** Some basic css for box content**/
41
- .spu-box h1{
42
- margin: 1.414285714rem 0;
43
- font-size: 1.4em;
44
- }
45
- .spu-box h2{
46
- margin: 1.414285714rem 0;
47
- font-size: 1.2em;
48
- }
49
- .spu-box h3{
50
- margin: 1.414285714rem 0;
51
- font-size: 1.0em;
52
- }
53
- .spu-box p{
54
- margin: 0 0 1.414285714rem;
55
- }
56
  .spu-box img{
57
  max-width: 100%;
58
  height: auto;
38
  margin: 0;
39
  }
40
  /** Some basic css for box content**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  .spu-box img{
42
  max-width: 100%;
43
  height: auto;
public/assets/js/public.js CHANGED
@@ -79,21 +79,26 @@ var SPU_master = function() {
79
  var ua = navigator.userAgent,
80
  event = (ua.match(/iPad/i) || ua.match(/iPhone/i)) ? "touchstart" : "click";
81
 
 
82
  $('body').on(event, function (ev) {
83
  var $target = $(ev.target);
 
 
 
 
 
 
 
84
  // test that event is user triggered and not programatically,
85
  // and that it is not fired from input within the box
86
  if( ev.originalEvent !== undefined && ! ( $.contains( $box, $target ) && $target.is('input') ) && ! $box.hasClass('spu-top-bar') && ! $box.hasClass('spu-bottom-bar') ) {
87
-
88
  toggleBox( id, false, false );
89
-
90
  }
91
  });
92
  //not on the box
93
- $('body' ).on(event,'.spu-box,.spu-clickable', function(event) {
94
- event.stopPropagation();
95
- });
96
-
97
  //hide boxes and remove left-99999px we cannot since beggining of facebook won't display
98
  $box.hide().css('left','').css('right','');
99
 
@@ -599,6 +604,7 @@ if( spuvar.ajax_mode ) {
599
  var data = {
600
  pid : spuvar.pid,
601
  referrer : document.referrer,
 
602
  query_string : document.location.search,
603
  is_category : spuvar.is_category,
604
  is_archive : spuvar.is_archive,
79
  var ua = navigator.userAgent,
80
  event = (ua.match(/iPad/i) || ua.match(/iPhone/i)) ? "touchstart" : "click";
81
 
82
+
83
  $('body').on(event, function (ev) {
84
  var $target = $(ev.target);
85
+ // for some reason ninja form in ajax mode not working, added this dirty workadound
86
+ // $.contains( $box, $target ) return false , same for .has .parents, etc
87
+ // so no popup closing when form is clicked
88
+ if($target.is('input.nf-element')) {
89
+ return;
90
+ }
91
+
92
  // test that event is user triggered and not programatically,
93
  // and that it is not fired from input within the box
94
  if( ev.originalEvent !== undefined && ! ( $.contains( $box, $target ) && $target.is('input') ) && ! $box.hasClass('spu-top-bar') && ! $box.hasClass('spu-bottom-bar') ) {
 
95
  toggleBox( id, false, false );
 
96
  }
97
  });
98
  //not on the box
99
+ $('body' ).on(event,'.spu-box,.spu-clickable', function(event) {
100
+ event.stopPropagation();
101
+ });
 
102
  //hide boxes and remove left-99999px we cannot since beggining of facebook won't display
103
  $box.hide().css('left','').css('right','');
104
 
604
  var data = {
605
  pid : spuvar.pid,
606
  referrer : document.referrer,
607
+ current_url : document.documentURI,
608
  query_string : document.location.search,
609
  is_category : spuvar.is_category,
610
  is_archive : spuvar.is_archive,
public/includes/class-spu-rules.php CHANGED
@@ -37,6 +37,18 @@ class Spu_Rules
37
  */
38
  protected $is_search = false;
39
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  /*
41
  * __construct
42
  * Add all the filters to use later
@@ -76,10 +88,14 @@ class Spu_Rules
76
  add_filter('spu/rules/rule_match/crawlers', array($this, 'rule_match_crawlers'), 10, 2);
77
  add_filter('spu/rules/rule_match/browser', array($this, 'rule_match_browser'), 10, 2);
78
  add_filter('spu/rules/rule_match/query_string', array($this, 'rule_match_query_string'), 10, 2);
 
 
79
 
80
  $this->post_id = get_queried_object_id();
81
  $this->referrer = isset($_SERVER['HTTP_REFERER']) && !defined('DOING_AJAX') ? $_SERVER['HTTP_REFERER'] : '';
82
  $this->query_string = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
 
 
83
 
84
  if( defined('DOING_AJAX') ) {
85
 
@@ -89,6 +105,9 @@ class Spu_Rules
89
  if( !empty( $_REQUEST['referrer'] ) ) {
90
  $this->referrer = $_REQUEST['referrer'];
91
  }
 
 
 
92
  if( !empty( $_REQUEST['query_string'] ) ) {
93
  $this->query_string = $_REQUEST['query_string'];
94
  }
@@ -1093,4 +1112,46 @@ class Spu_Rules
1093
  return $post_type;
1094
  }
1095
 
1096
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  */
38
  protected $is_search = false;
39
 
40
+ /**
41
+ * Holds current url
42
+ * @var string
43
+ */
44
+ protected $current_url;
45
+
46
+ /**
47
+ * Holds query string
48
+ * @var
49
+ */
50
+ protected $query_string;
51
+
52
  /*
53
  * __construct
54
  * Add all the filters to use later
88
  add_filter('spu/rules/rule_match/crawlers', array($this, 'rule_match_crawlers'), 10, 2);
89
  add_filter('spu/rules/rule_match/browser', array($this, 'rule_match_browser'), 10, 2);
90
  add_filter('spu/rules/rule_match/query_string', array($this, 'rule_match_query_string'), 10, 2);
91
+ add_filter('spu/rules/rule_match/custom_url', array($this, 'rule_match_custom_url'), 10, 2);
92
+ add_filter('spu/rules/rule_match/keyword_url', array($this, 'rule_match_keyword_url'), 10, 2);
93
 
94
  $this->post_id = get_queried_object_id();
95
  $this->referrer = isset($_SERVER['HTTP_REFERER']) && !defined('DOING_AJAX') ? $_SERVER['HTTP_REFERER'] : '';
96
  $this->query_string = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
97
+ $this->current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
98
+
99
 
100
  if( defined('DOING_AJAX') ) {
101
 
105
  if( !empty( $_REQUEST['referrer'] ) ) {
106
  $this->referrer = $_REQUEST['referrer'];
107
  }
108
+ if( !empty( $_REQUEST['current_url'] ) ) {
109
+ $this->current_url = $_REQUEST['current_url'];
110
+ }
111
  if( !empty( $_REQUEST['query_string'] ) ) {
112
  $this->query_string = $_REQUEST['query_string'];
113
  }
1112
  return $post_type;
1113
  }
1114
 
1115
+ /**
1116
+ * Check for custom url
1117
+ *
1118
+ * @param array $rule rule to compare
1119
+ *
1120
+ * @return boolean true if match
1121
+ */
1122
+ public function rule_match_custom_url( $match, $rule ) {
1123
+
1124
+ $wide_search = strpos($rule['value'],'*') !== false ? true : false;
1125
+
1126
+ if( $wide_search ) {
1127
+ if( strpos( $this->current_url, trim($rule['value'],'*') ) === 0 ) {
1128
+ return ( $rule['operator'] == "==" );
1129
+ }
1130
+ return ! ( $rule['operator'] == "==" );
1131
+ }
1132
+
1133
+ if( $rule['operator'] == "==" )
1134
+ return ($this->current_url == $rule['value']);
1135
+
1136
+ return ! ($this->current_url == $rule['value']);
1137
+
1138
+ }
1139
+
1140
+ /**
1141
+ * Check for keyword url
1142
+ *
1143
+ * @param array $rule rule to compare
1144
+ *
1145
+ * @return boolean true if match
1146
+ */
1147
+ function rule_match_keyword_url($match, $rule) {
1148
+
1149
+ $search_url = str_replace(site_url(), '', $this->current_url);
1150
+
1151
+ if( strlen($search_url) > 0 && strpos($search_url, trim($rule['value'])) !== false )
1152
+ return ($rule['operator'] == "==");
1153
+ else
1154
+ return !($rule['operator'] == "==");
1155
+
1156
+ }
1157
+ }