Popups – WordPress Popup - Version 1.2.3.5

Version Description

  • Added IFS (infusion soft) support
  • Added display rule - Post ID
  • Added display rule - Categories / Archives
  • Now both version are shown if you use premium
Download this release

Release Info

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

Code changes from version 1.2.3.4 to 1.2.3.5

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: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups
5
  Requires at least: 3.6
6
  Tested up to: 4.1.1
7
- Stable tag: 1.2.3.4
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -41,6 +41,7 @@ There are multiple display filters that can be combined:
41
  * Days until popup shows again
42
  * Ajax mode to make popups cache compatible
43
  * Shortcodes for social networks available
 
44
 
45
  > <strong>Premium Version</strong><br>
46
  >
@@ -106,6 +107,13 @@ Yes if you need to debug you can use uncompressed javascript by addings ([this c
106
 
107
  == Changelog ==
108
 
 
 
 
 
 
 
 
109
  = 1.2.3.4 =
110
 
111
  * Added referrer display rule
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: twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, popup, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe
5
  Requires at least: 3.6
6
  Tested up to: 4.1.1
7
+ Stable tag: 1.2.3.5
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
41
  * Days until popup shows again
42
  * Ajax mode to make popups cache compatible
43
  * Shortcodes for social networks available
44
+ * Compatible with Gravity Forms, Infusion Soft, Contact form 7, jetpack forms and much more
45
 
46
  > <strong>Premium Version</strong><br>
47
  >
107
 
108
  == Changelog ==
109
 
110
+ = 1.2.3.5 =
111
+
112
+ * Added IFS (infusion soft) support
113
+ * Added display rule - Post ID
114
+ * Added display rule - Categories / Archives
115
+ * Now both version are shown if you use premium
116
+
117
  = 1.2.3.4 =
118
 
119
  * Added referrer display rule
admin/class-social-popup-admin.php CHANGED
@@ -95,7 +95,7 @@ class SocialPopup_Admin {
95
 
96
  // add settings page
97
  add_action('admin_menu' , array( $this, 'add_settings_menu' ) );
98
-
99
  //Add our metaboxes
100
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
101
 
@@ -145,9 +145,13 @@ class SocialPopup_Admin {
145
  * @return void
146
  */
147
  function register_cpt() {
148
-
 
 
 
 
149
  $labels = array(
150
- 'name' => _x( 'Popups v' . SocialPopup::VERSION , 'post type general name', $this->plugin_slug ),
151
  'singular_name' => _x( 'Popups', 'post type singular name', $this->plugin_slug ),
152
  'menu_name' => _x( 'Popups', 'admin menu', $this->plugin_slug ),
153
  'name_admin_bar' => _x( 'Popups', 'add new on admin bar', $this->plugin_slug ),
@@ -205,33 +209,36 @@ class SocialPopup_Admin {
205
 
206
  }
207
 
 
 
208
  /**
209
  * Settings page of the plugin
210
  * @since 1.1
211
  * @return void
212
  */
213
- public function settings_page(){
214
 
215
- if ( isset( $_POST['spu_nonce'] ) && wp_verify_nonce( $_POST['spu_nonce'], 'spu_save_settings' ) ) {
 
 
 
 
216
 
217
- update_option( 'spu_settings' , esc_sql( @$_POST['spu_settings'] ) );
218
-
219
- }
220
-
221
  $defaults = array(
222
- 'debug' => '',
223
- 'safe' => '',
224
- 'shortcodes_style' => '',
225
- 'facebook' => '',
226
- 'google' => '',
227
- 'twitter' => '',
228
  );
229
 
230
- $opts = apply_filters('spu/settings_page/opts', get_option( 'spu_settings', $defaults ) );
231
 
232
  include 'views/settings-page.php';
233
 
234
  }
 
235
  /**
236
  * Register the metaboxes for our cpt and remove others
237
  */
@@ -310,7 +317,7 @@ class SocialPopup_Admin {
310
  */
311
  public function popup_premium( $post, $metabox ) {
312
 
313
- include 'views/metabox-premium.php';
314
  }
315
 
316
  /**
@@ -321,7 +328,7 @@ class SocialPopup_Admin {
321
  */
322
  public function popup_help( $post, $metabox ) {
323
 
324
- include 'views/metabox-help.php';
325
  }
326
  /**
327
  * Include the metabox view for popup rules
@@ -333,7 +340,7 @@ class SocialPopup_Admin {
333
 
334
  $groups = apply_filters('spu/metaboxes/get_box_rules', $this->helper->get_box_rules( $post->ID ), $post->ID);
335
 
336
- include 'views/metabox-rules.php';
337
  }
338
  /**
339
  * Include the metabox view for popup options
@@ -345,7 +352,7 @@ class SocialPopup_Admin {
345
 
346
  $opts = apply_filters('spu/metaboxes/get_box_options', $this->helper->get_box_options( $post->ID ), $post->ID );
347
 
348
- include 'views/metabox-options.php';
349
  }
350
 
351
  /**
@@ -356,7 +363,7 @@ class SocialPopup_Admin {
356
  */
357
  public function metabox_donate( $post, $metabox ) {
358
 
359
- $donate_metabox = apply_filters( 'spu/metaboxes/donate_metabox', dirname(__FILE__) . '/views/metabox-donate.php' );
360
 
361
  include $donate_metabox;
362
  }
@@ -368,7 +375,7 @@ class SocialPopup_Admin {
368
  */
369
  public function metabox_support( $post, $metabox ) {
370
 
371
- $support_metabox = apply_filters( 'spu/metaboxes/support_metabox', dirname(__FILE__) . '/views/metabox-support.php' );
372
 
373
  include $support_metabox;
374
  }
@@ -381,7 +388,7 @@ class SocialPopup_Admin {
381
  */
382
  public function metabox_links( $post, $metabox ) {
383
 
384
- $links_metabox = apply_filters( 'spu/metaboxes/links_metabox', dirname(__FILE__) . '/views/metabox-links.php' );
385
 
386
  include $links_metabox;
387
  }
@@ -601,12 +608,14 @@ class SocialPopup_Admin {
601
  return $post_types;
602
 
603
  }
604
-
605
  /**
606
  * Get taxonomies. Used in filters rules
607
- * @param array $choices [description]
 
608
  * @param boolean $simple_value [description]
609
- * @return [type] [description]
 
610
  */
611
  function get_taxonomies( $choices, $simple_value = false ) {
612
 
@@ -662,7 +671,6 @@ class SocialPopup_Admin {
662
  $args['setup'] = 'function(ed) { if(typeof SPU_ADMIN === \'undefined\') { return; } ed.onInit.add(SPU_ADMIN.onTinyMceInit); }';
663
 
664
  return $args;
665
- }
666
-
667
 
668
  }
95
 
96
  // add settings page
97
  add_action('admin_menu' , array( $this, 'add_settings_menu' ) );
98
+
99
  //Add our metaboxes
100
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
101
 
145
  * @return void
146
  */
147
  function register_cpt() {
148
+
149
+ $name = 'Popups v' . SocialPopup::VERSION;
150
+ if( class_exists('PopupsP') ){
151
+ $name .= ' - Premium v'. PopupsP::VERSION;
152
+ }
153
  $labels = array(
154
+ 'name' => $name,
155
  'singular_name' => _x( 'Popups', 'post type singular name', $this->plugin_slug ),
156
  'menu_name' => _x( 'Popups', 'admin menu', $this->plugin_slug ),
157
  'name_admin_bar' => _x( 'Popups', 'add new on admin bar', $this->plugin_slug ),
209
 
210
  }
211
 
212
+
213
+
214
  /**
215
  * Settings page of the plugin
216
  * @since 1.1
217
  * @return void
218
  */
219
+ public function settings_page() {
220
 
221
+ if ( isset( $_POST['spu_nonce'] ) && wp_verify_nonce( $_POST['spu_nonce'], 'spu_save_settings' ) ) {
222
+
223
+ update_option( 'spu_settings', esc_sql( @$_POST['spu_settings'] ) );
224
+
225
+ }
226
 
 
 
 
 
227
  $defaults = array(
228
+ 'debug' => '',
229
+ 'safe' => '',
230
+ 'shortcodes_style' => '',
231
+ 'facebook' => '',
232
+ 'google' => '',
233
+ 'twitter' => '',
234
  );
235
 
236
+ $opts = apply_filters( 'spu/settings_page/opts', get_option( 'spu_settings', $defaults ) );
237
 
238
  include 'views/settings-page.php';
239
 
240
  }
241
+
242
  /**
243
  * Register the metaboxes for our cpt and remove others
244
  */
317
  */
318
  public function popup_premium( $post, $metabox ) {
319
 
320
+ include 'views/metaboxes/metabox-premium.php';
321
  }
322
 
323
  /**
328
  */
329
  public function popup_help( $post, $metabox ) {
330
 
331
+ include 'views/metaboxes/metabox-help.php';
332
  }
333
  /**
334
  * Include the metabox view for popup rules
340
 
341
  $groups = apply_filters('spu/metaboxes/get_box_rules', $this->helper->get_box_rules( $post->ID ), $post->ID);
342
 
343
+ include 'views/metaboxes/metabox-rules.php';
344
  }
345
  /**
346
  * Include the metabox view for popup options
352
 
353
  $opts = apply_filters('spu/metaboxes/get_box_options', $this->helper->get_box_options( $post->ID ), $post->ID );
354
 
355
+ include 'views/metaboxes/metabox-options.php';
356
  }
357
 
358
  /**
363
  */
364
  public function metabox_donate( $post, $metabox ) {
365
 
366
+ $donate_metabox = apply_filters( 'spu/metaboxes/donate_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-donate.php' );
367
 
368
  include $donate_metabox;
369
  }
375
  */
376
  public function metabox_support( $post, $metabox ) {
377
 
378
+ $support_metabox = apply_filters( 'spu/metaboxes/support_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-support.php' );
379
 
380
  include $support_metabox;
381
  }
388
  */
389
  public function metabox_links( $post, $metabox ) {
390
 
391
+ $links_metabox = apply_filters( 'spu/metaboxes/links_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-links.php' );
392
 
393
  include $links_metabox;
394
  }
608
  return $post_types;
609
 
610
  }
611
+
612
  /**
613
  * Get taxonomies. Used in filters rules
614
+ *
615
+ * @param array $choices [description]
616
  * @param boolean $simple_value [description]
617
+ *
618
+ * @return array [type] [description]
619
  */
620
  function get_taxonomies( $choices, $simple_value = false ) {
621
 
671
  $args['setup'] = 'function(ed) { if(typeof SPU_ADMIN === \'undefined\') { return; } ed.onInit.add(SPU_ADMIN.onTinyMceInit); }';
672
 
673
  return $args;
674
+ }
 
675
 
676
  }
admin/views/{metabox-donate.php → metaboxes/metabox-donate.php} RENAMED
File without changes
admin/views/{metabox-help.php → metaboxes/metabox-help.php} RENAMED
File without changes
admin/views/{metabox-links.php → metaboxes/metabox-links.php} RENAMED
File without changes
admin/views/{metabox-options.php → metaboxes/metabox-options.php} RENAMED
File without changes
admin/views/{metabox-premium.php → metaboxes/metabox-premium.php} RENAMED
File without changes
admin/views/{metabox-rules.php → metaboxes/metabox-rules.php} RENAMED
@@ -51,6 +51,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
51
  ),
52
  __("Post", $this->plugin_slug ) => array(
53
  'post' => __("Post", $this->plugin_slug ),
 
54
  'post_type' => __("Post Type", $this->plugin_slug ),
55
  'post_category' => __("Post Category", $this->plugin_slug ),
56
  'post_format' => __("Post Format", $this->plugin_slug ),
51
  ),
52
  __("Post", $this->plugin_slug ) => array(
53
  'post' => __("Post", $this->plugin_slug ),
54
+ 'post_id' => __("Post ID", $this->plugin_slug ),
55
  'post_type' => __("Post Type", $this->plugin_slug ),
56
  'post_category' => __("Post Category", $this->plugin_slug ),
57
  'post_format' => __("Post Format", $this->plugin_slug ),
admin/views/{metabox-support.php → metaboxes/metabox-support.php} RENAMED
File without changes
admin/views/settings-page.php CHANGED
@@ -5,7 +5,11 @@
5
  */
6
  ?>
7
  <div class="wrap">
8
- <h2>Popups <?php echo SocialPopup::VERSION;?></h2>
 
 
 
 
9
  <form name="spu-settings" method="post">
10
  <table class="form-table">
11
  <?php do_action( 'spu/settings_page/before' ); ?>
5
  */
6
  ?>
7
  <div class="wrap">
8
+ <h2>Popups <?php echo SocialPopup::VERSION;
9
+ if( class_exists('PopupsP') ){
10
+ echo ' - Premium v', PopupsP::VERSION;
11
+ }
12
+ ?></h2>
13
  <form name="spu-settings" method="post">
14
  <table class="form-table">
15
  <?php do_action( 'spu/settings_page/before' ); ?>
includes/class-spu-helper.php CHANGED
@@ -133,6 +133,8 @@ class Spu_Helper {
133
  'all_pages' => __("All Pages", self::$plugin_slug),
134
  'front_page' => __("Front Page", self::$plugin_slug),
135
  'posts_page' => __("Posts Page", self::$plugin_slug),
 
 
136
  'top_level' => __("Top Level Page (parent of 0)", self::$plugin_slug),
137
  'parent' => __("Parent Page (has children)", self::$plugin_slug),
138
  'child' => __("Child Page (has parent)", self::$plugin_slug),
@@ -266,7 +268,7 @@ class Spu_Helper {
266
  // allow custom rules rules
267
  $choices = apply_filters( 'spu/rules/rule_values/' . $options['param'], $choices );
268
 
269
- if( $options['param'] == 'referrer' ) {
270
  self::print_textfield( $options );
271
  } else {
272
  self::print_select( $choices, $options );
133
  'all_pages' => __("All Pages", self::$plugin_slug),
134
  'front_page' => __("Front Page", self::$plugin_slug),
135
  'posts_page' => __("Posts Page", self::$plugin_slug),
136
+ 'category_page' => __("Category Page", self::$plugin_slug),
137
+ 'archive_page' => __("Archives Page", self::$plugin_slug),
138
  'top_level' => __("Top Level Page (parent of 0)", self::$plugin_slug),
139
  'parent' => __("Parent Page (has children)", self::$plugin_slug),
140
  'child' => __("Child Page (has parent)", self::$plugin_slug),
268
  // allow custom rules rules
269
  $choices = apply_filters( 'spu/rules/rule_values/' . $options['param'], $choices );
270
 
271
+ if( $options['param'] == 'referrer' || $options['param'] == 'post_id' ) {
272
  self::print_textfield( $options );
273
  } else {
274
  self::print_select( $choices, $options );
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.2.3.4
15
  * Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
11
  * @socialpopup
12
  * Plugin Name: Popups - WordPress Popup
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
+ * Version: 1.2.3.5
15
  * Description: This plugin will display a popup or splash screen when a new user visit your site showing a Google+, twitter and facebook follow links. This will increase you followers ratio in a 40%. Popup will be close depending on your settings. Check readme.txt for full details.
16
  * Author: Damian Logghe
17
  * Author URI: http://wp.timersys.com
public/assets/js/min/public-min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";function t(t,i,e,o,n){var r={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},n=n||!1,e=e||!1,o=o||!1;i&&(r.url=i),e&&(r.success=e),o&&(r.error=o),n&&(r.dataType=n),$.ajax(r)}function i(t,i,e){if(e){var o=new Date;o.setTime(o.getTime()+24*e*60*60*1e3);var n="; expires="+o.toGMTString()}else var n="";document.cookie=t+"="+i+n+"; path=/"}function e(t){for(var i=t+"=",e=document.cookie.split(";"),o=0;o<e.length;o++){for(var n=e[o];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(i))return n.substring(i.length,n.length)}return null}function o(){FB.Event.subscribe("edge.create",function(t,i){var e=$(i).parents(".spu-box").data("box-id");e&&SPU.hide(e)}),l=!0,clearInterval(g)}function n(t){var i=$(t.target).parents(".spu-box").data("box-id");i&&SPU.hide(i)}function r(t){if("on"==t.state){var i=jQuery(".spu-gogl").data("box-id");i&&SPU.hide(i)}}function a(t){if("confirm"==t.type){var i=jQuery(".spu-gogl").data("box-id");i&&SPU.hide(i)}}function s(){if(spuvar_social.facebook)try{FB.XFBML.parse()}catch(t){}spuvar_social.google&&gapi.plusone.go(),spuvar_social.twitter&&twttr.widgets.load()}function d(){$(".spu-box form").each(function(){var t=$(this).attr("action");$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var u=function(){function o(t){var i=u[t],e=$(window).width(),o=$(window).height(),n=i.outerHeight(),r=i.outerWidth(),a=i.data("width"),s=0,d=o/2-n/2,c="fixed",f=$(document).scrollTop();i.hasClass("spu-centered")&&(e>a&&(s=e/2-r/2),i.css({left:s,position:c,top:d})),n+50>o&&(c="absolute",d=f,i.css({position:c,top:d,bottom:"auto"}))}function n(t){var i=$(t).find(".spu-facebook");if(i.length){var e=i.find(".fb-like > span").width();if(0==e){var o=i.find(".fb-like").data("layout");i.append("box_count"==o?'<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 63px !important;width: 80px !important;}</style>":'<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 20px !important;width: 80px !important;}</style>")}}}function r(t,e){var n=u[t],r=$("#spu-bg-"+t),a=n.data("bgopa");if(n.is(":animated"))return!1;if(e===!0&&n.is(":visible")||e===!1&&n.is(":hidden"))return!1;if(e===!1){var s=parseInt(n.data("cookie"));s>0&&i("spu_box_"+t,!0,s),n.trigger("spu.box_close",[t])}else n.trigger("spu.box_open",[t]),$(window).resize(function(){o(t)}),o(t);var d=n.data("spuanimation");return"fade"===d?n.fadeToggle("slow"):n.slideToggle("slow"),e===!0&&a>0?r.fadeIn():r.fadeOut(),e}var a=$(window).height(),d=spuvar.is_admin,u=[];return s(),$(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){spuvar.safe_mode&&$(this).prependTo("body");var i=$(this),o=i.data("trigger"),s=0,c=1===parseInt(i.data("test-mode")),f=i.data("box-id"),p=1===parseInt(i.data("auto-hide")),l=parseInt(i.data("seconds-close")),g=parseInt(i.data("trigger-number"),10),h="percentage"==o?parseInt(i.data("trigger-number"),10)/100:.8,m=h*$(document).height();n(i),$(".spu-google").width($(".spu-google").width()-20),$(".spu-twitter").width($(".spu-twitter ").width()-50);var w=0,b=0,v=i.outerWidth(),_=i.find(".spu-content").width(),x=i.data("total");i.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),x&&!spuvar.disable_style&&$(window).width()>v&&(i.find(".spu-shortcode").each(function(){w+=$(this).width()}),b=_-w-x),b>0&&(i.find(".spu-shortcode").each(function(){$(this).css("margin-left",b/2)}),2==x?i.find(".spu-shortcode").last().css("margin-left",0):3==x&&i.find(".spu-shortcode").first().css("margin-left",0)),$(document).keyup(function(t){27==t.keyCode&&r(f,!1)});var y=navigator.userAgent,T=y.match(/iPad/i)||y.match(/iPhone/i)?"touchstart":"click";$("body").on(T,function(t){void 0!==t.originalEvent&&r(f,!1)}),$("body").on(T,".spu-box",function(t){t.stopPropagation()}),i.hide().css("left",""),u[f]=i;var k=function(){s&&clearTimeout(s),s=window.setTimeout(function(){var t=$(window).scrollTop(),i=t+a>=m;i?(p||$(window).unbind("scroll",k),r(f,!0)):r(f,!1)},100)},I=function(){s&&clearTimeout(s),s=window.setTimeout(function(){r(f,!0)},1e3*g)},P=e("spu_box_"+f);if((void 0==P||""==P||d&&c)&&("seconds"==o?I():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var j=window.location.hash,S;j.substring(1)===i.attr("id")&&setTimeout(function(){r(f,!0)},100)}i.find(".spu-close-popup").click(function(){r(f,!1),"percentage"==o&&$(window).unbind("scroll",k)}),$('a[href="#'+i.attr("id")+'"]').click(function(){return r(f,!0),!1}),i.find(".gform_wrapper form").addClass("gravity-form"),i.on("submit",'form:not(".wpcf7-form, .gravity-form")',function(e){e.preventDefault();var o=!0,n=$(this),a=n.serialize(),s=n.attr("action"),d=function(t,i,e){console.log("Spu Form error: "+i+" - "+e)},u=function(t){var i=$(t).filter("#spu-"+f).html();$("#spu-"+f).html(i),$("#spu-"+f).find(".mc4wp-form-error").length||setTimeout(function(){r(f,!1)},1e3*spuvar.seconds_confirmation_close)};return t(a,s,u,d,"html"),i.trigger("spu.form_submitted",[f]),o}),$("body").on("mailsent.wpcf7",function(){i.trigger("spu.form_submitted",[f]),r(f,!1)}),$(document).on("gform_confirmation_loaded",function(){i.trigger("spu.form_submitted",[f]),r(f,!1)})}),{show:function(t){return r(t,!0)},hide:function(t){return r(t,!1)},request:function(i,e,o,n){return t(i,e,o,n)}}};if(spuvar.ajax_mode){var c={pid:spuvar.pid,referrer:document.referrer},f=function(t){$("body").append(t),window.SPU=u(),d()},p=function(t,i,e){console.log("Problem loading popups - error: "+i+" - "+e)};t(c,spuvar.ajax_mode_url,f,p,"html")}else jQuery(window).load(function(){window.SPU=u()});var l=!1,g=setInterval(function(){"undefined"==typeof FB||l||o()},1e3);"undefined"!=typeof twttr&&twttr.ready(function(t){t.events.bind("tweet",n),t.events.bind("follow",n)})}(jQuery);
1
+ !function($){"use strict";function t(t,i,e,o,n){var r={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},n=n||!1,e=e||!1,o=o||!1;i&&(r.url=i),e&&(r.success=e),o&&(r.error=o),n&&(r.dataType=n),$.ajax(r)}function i(t,i,e){if(e){var o=new Date;o.setTime(o.getTime()+24*e*60*60*1e3);var n="; expires="+o.toGMTString()}else var n="";document.cookie=t+"="+i+n+"; path=/"}function e(t){for(var i=t+"=",e=document.cookie.split(";"),o=0;o<e.length;o++){for(var n=e[o];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(i))return n.substring(i.length,n.length)}return null}function o(){FB.Event.subscribe("edge.create",function(t,i){var e=$(i).parents(".spu-box").data("box-id");e&&SPU.hide(e)}),l=!0,clearInterval(g)}function n(t){var i=$(t.target).parents(".spu-box").data("box-id");i&&SPU.hide(i)}function r(t){if("on"==t.state){var i=jQuery(".spu-gogl").data("box-id");i&&SPU.hide(i)}}function a(t){if("confirm"==t.type){var i=jQuery(".spu-gogl").data("box-id");i&&SPU.hide(i)}}function s(){if(spuvar_social.facebook)try{FB.XFBML.parse()}catch(t){}spuvar_social.google&&gapi.plusone.go(),spuvar_social.twitter&&twttr.widgets.load()}function u(){$(".spu-box form").each(function(){var t=$(this).attr("action");$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var d=function(){function o(t){var i=d[t],e=$(window).width(),o=$(window).height(),n=i.outerHeight(),r=i.outerWidth(),a=i.data("width"),s=0,u=o/2-n/2,c="fixed",f=$(document).scrollTop();i.hasClass("spu-centered")&&(e>a&&(s=e/2-r/2),i.css({left:s,position:c,top:u})),n+50>o&&(c="absolute",u=f,i.css({position:c,top:u,bottom:"auto"}))}function n(t){var i=$(t).find(".spu-facebook");if(i.length){var e=i.find(".fb-like > span").width();if(0==e){var o=i.find(".fb-like").data("layout");i.append("box_count"==o?'<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 63px !important;width: 80px !important;}</style>":'<style type="text/css"> #'+$(t).attr("id")+" .fb-like iframe, #"+$(t).attr("id")+" .fb_iframe_widget span, #"+$(t).attr("id")+" .fb_iframe_widget{ height: 20px !important;width: 80px !important;}</style>")}}}function r(t,e){var n=d[t],r=$("#spu-bg-"+t),a=n.data("bgopa");if(n.is(":animated"))return!1;if(e===!0&&n.is(":visible")||e===!1&&n.is(":hidden"))return!1;if(e===!1){var s=parseInt(n.data("cookie"));s>0&&i("spu_box_"+t,!0,s),n.trigger("spu.box_close",[t])}else n.trigger("spu.box_open",[t]),$(window).resize(function(){o(t)}),o(t);var u=n.data("spuanimation");return"fade"===u?n.fadeToggle("slow"):n.slideToggle("slow"),e===!0&&a>0?r.fadeIn():r.fadeOut(),e}var a=$(window).height(),u=spuvar.is_admin,d=[];return s(),$(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){spuvar.safe_mode&&$(this).prependTo("body");var i=$(this),o=i.data("trigger"),s=0,c=1===parseInt(i.data("test-mode")),f=i.data("box-id"),p=1===parseInt(i.data("auto-hide")),l=parseInt(i.data("seconds-close")),g=parseInt(i.data("trigger-number"),10),h="percentage"==o?parseInt(i.data("trigger-number"),10)/100:.8,m=h*$(document).height();n(i),$(".spu-google").width($(".spu-google").width()-20),$(".spu-twitter").width($(".spu-twitter ").width()-50);var w=0,v=0,b=i.outerWidth(),_=i.find(".spu-content").width(),y=i.data("total");i.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),y&&!spuvar.disable_style&&$(window).width()>b&&(i.find(".spu-shortcode").each(function(){w+=$(this).width()}),v=_-w-y),v>0&&(i.find(".spu-shortcode").each(function(){$(this).css("margin-left",v/2)}),2==y?i.find(".spu-shortcode").last().css("margin-left",0):3==y&&i.find(".spu-shortcode").first().css("margin-left",0)),$(document).keyup(function(t){27==t.keyCode&&r(f,!1)});var x=navigator.userAgent,T=x.match(/iPad/i)||x.match(/iPhone/i)?"touchstart":"click";$("body").on(T,function(t){void 0!==t.originalEvent&&r(f,!1)}),$("body").on(T,".spu-box",function(t){t.stopPropagation()}),i.hide().css("left",""),d[f]=i;var k=function(){s&&clearTimeout(s),s=window.setTimeout(function(){var t=$(window).scrollTop(),i=t+a>=m;i?(p||$(window).unbind("scroll",k),r(f,!0)):r(f,!1)},100)},I=function(){s&&clearTimeout(s),s=window.setTimeout(function(){r(f,!0)},1e3*g)},P=e("spu_box_"+f);if((void 0==P||""==P||u&&c)&&("seconds"==o?I():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var j=window.location.hash,S;j.substring(1)===i.attr("id")&&setTimeout(function(){r(f,!0)},100)}i.find(".spu-close-popup").click(function(){r(f,!1),"percentage"==o&&$(window).unbind("scroll",k)}),$('a[href="#'+i.attr("id")+'"]').click(function(){return r(f,!0),!1}),i.find(".gform_wrapper form").addClass("gravity-form"),i.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form")',function(e){e.preventDefault();var o=!0,n=$(this),a=n.serialize(),s=n.attr("action"),u=function(t,i,e){console.log("Spu Form error: "+i+" - "+e)},d=function(t){var i=$(t).filter("#spu-"+f).html();$("#spu-"+f).html(i),$("#spu-"+f).find(".mc4wp-form-error").length||setTimeout(function(){r(f,!1)},1e3*spuvar.seconds_confirmation_close)};return t(a,s,d,u,"html"),i.trigger("spu.form_submitted",[f]),o}),$("body").on("mailsent.wpcf7",function(){i.trigger("spu.form_submitted",[f]),r(f,!1)}),$(document).on("gform_confirmation_loaded",function(){i.trigger("spu.form_submitted",[f]),r(f,!1)}),i.on("submit",".infusion-form",function(t){t.preventDefault(),i.trigger("spu.form_submitted",[f]),r(f,!1),this.submit()})}),{show:function(t){return r(t,!0)},hide:function(t){return r(t,!1)},request:function(i,e,o,n){return t(i,e,o,n)}}};if(spuvar.ajax_mode){var c={pid:spuvar.pid,referrer:document.referrer,is_category:spuvar.is_category,is_archive:spuvar.is_archive},f=function(t){$("body").append(t),window.SPU=d(),u()},p=function(t,i,e){console.log("Problem loading popups - error: "+i+" - "+e)};t(c,spuvar.ajax_mode_url,f,p,"html")}else jQuery(window).load(function(){window.SPU=d()});var l=!1,g=setInterval(function(){"undefined"==typeof FB||l||o()},1e3);"undefined"!=typeof twttr&&twttr.ready(function(t){t.events.bind("tweet",n),t.events.bind("follow",n)})}(jQuery);
public/assets/js/public.js CHANGED
@@ -204,7 +204,7 @@ var SPU_master = function() {
204
  $box.find('.gform_wrapper form').addClass('gravity-form');
205
 
206
  // Add generic form tracking
207
- $box.on('submit','form:not(".wpcf7-form, .gravity-form")', function(e){
208
  e.preventDefault();
209
 
210
 
@@ -252,6 +252,14 @@ var SPU_master = function() {
252
  toggleBox(id, false );
253
  });
254
 
 
 
 
 
 
 
 
 
255
  });
256
 
257
 
@@ -391,7 +399,9 @@ if( spuvar.ajax_mode ) {
391
 
392
  var data = {
393
  pid : spuvar.pid,
394
- referrer : document.referrer
 
 
395
  }
396
  ,success_cb = function(response) {
397
 
204
  $box.find('.gform_wrapper form').addClass('gravity-form');
205
 
206
  // Add generic form tracking
207
+ $box.on('submit','form:not(".wpcf7-form, .gravity-form, .infusion-form")', function(e){
208
  e.preventDefault();
209
 
210
 
252
  toggleBox(id, false );
253
  });
254
 
255
+ // Infusion Software - not ajax
256
+ $box.on('submit','.infusion-form', function(e){
257
+ e.preventDefault();
258
+ $box.trigger('spu.form_submitted', [id]);
259
+ toggleBox(id, false );
260
+ this.submit();
261
+ });
262
+
263
  });
264
 
265
 
399
 
400
  var data = {
401
  pid : spuvar.pid,
402
+ referrer : document.referrer,
403
+ is_category : spuvar.is_category,
404
+ is_archive : spuvar.is_archive
405
  }
406
  ,success_cb = function(response) {
407
 
public/class-social-popup.php CHANGED
@@ -23,7 +23,7 @@ class SocialPopup {
23
  *
24
  * @var string
25
  */
26
- const VERSION = '1.2.3.4';
27
 
28
  /**
29
  * Popups to use acrros files
@@ -412,6 +412,8 @@ class SocialPopup {
412
  'ajax_mode_url' => site_url('/?spu_action=spu_load&lang='.$this->info['wpml_lang']),
413
  'pid' => get_queried_object_id(),
414
  'is_front_page' => is_front_page(),
 
 
415
  'seconds_confirmation_close' => apply_filters( 'spu/spuvar/seconds_confirmation_close', 5 ),
416
  )
417
  );
23
  *
24
  * @var string
25
  */
26
+ const VERSION = '1.2.3.5';
27
 
28
  /**
29
  * Popups to use acrros files
412
  'ajax_mode_url' => site_url('/?spu_action=spu_load&lang='.$this->info['wpml_lang']),
413
  'pid' => get_queried_object_id(),
414
  'is_front_page' => is_front_page(),
415
+ 'is_category' => is_category(),
416
+ 'is_archive' => is_archive(),
417
  'seconds_confirmation_close' => apply_filters( 'spu/spuvar/seconds_confirmation_close', 5 ),
418
  )
419
  );
public/includes/class-spu-rules.php CHANGED
@@ -15,11 +15,23 @@ class Spu_Rules
15
  protected $post_id;
16
 
17
  /**
18
- * referred using in ajax calls
19
  * @var string
20
  */
21
  protected $referrer;
22
-
 
 
 
 
 
 
 
 
 
 
 
 
23
  /*
24
  * __construct
25
  * Add all the filters to use later
@@ -38,6 +50,7 @@ class Spu_Rules
38
 
39
  // Post
40
  add_filter('spu/rules/rule_match/post_type', array($this, 'rule_match_post_type'), 10, 2);
 
41
  add_filter('spu/rules/rule_match/post', array($this, 'rule_match_post'), 10, 2);
42
  add_filter('spu/rules/rule_match/post_category', array($this, 'rule_match_post_category'), 10, 2);
43
  add_filter('spu/rules/rule_match/post_format', array($this, 'rule_match_post_format'), 10, 2);
@@ -63,9 +76,15 @@ class Spu_Rules
63
  if( isset( $_REQUEST['pid'] ) ) {
64
  $this->post_id = $_REQUEST['pid'];
65
  }
66
- if( isset( $_REQUEST['referrer'] ) ) {
67
  $this->referrer = $_REQUEST['referrer'];
68
  }
 
 
 
 
 
 
69
  }
70
 
71
  }
@@ -395,6 +414,53 @@ class Spu_Rules
395
  }
396
 
397
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  elseif( $rule['value'] == 'posts_page') {
399
 
400
  $posts_page = (int) get_option('page_for_posts');
15
  protected $post_id;
16
 
17
  /**
18
+ * referrer using in ajax calls
19
  * @var string
20
  */
21
  protected $referrer;
22
+
23
+ /**
24
+ * Is category using in ajax calls
25
+ * @var boolean
26
+ */
27
+ protected $is_category = false;
28
+
29
+ /**
30
+ * Is archive using in ajax calls
31
+ * @var boolean
32
+ */
33
+ protected $is_archive = false;
34
+
35
  /*
36
  * __construct
37
  * Add all the filters to use later
50
 
51
  // Post
52
  add_filter('spu/rules/rule_match/post_type', array($this, 'rule_match_post_type'), 10, 2);
53
+ add_filter('spu/rules/rule_match/post_id', array($this, 'rule_match_post'), 10, 2);
54
  add_filter('spu/rules/rule_match/post', array($this, 'rule_match_post'), 10, 2);
55
  add_filter('spu/rules/rule_match/post_category', array($this, 'rule_match_post_category'), 10, 2);
56
  add_filter('spu/rules/rule_match/post_format', array($this, 'rule_match_post_format'), 10, 2);
76
  if( isset( $_REQUEST['pid'] ) ) {
77
  $this->post_id = $_REQUEST['pid'];
78
  }
79
+ if( !empty( $_REQUEST['referrer'] ) ) {
80
  $this->referrer = $_REQUEST['referrer'];
81
  }
82
+ if( !empty( $_REQUEST['is_category'] ) ) {
83
+ $this->is_category = true;
84
+ }
85
+ if( !empty( $_REQUEST['is_archive'] ) ) {
86
+ $this->is_archive = true;
87
+ }
88
  }
89
 
90
  }
414
  }
415
 
416
  }
417
+ elseif( $rule['value'] == 'category_page') {
418
+
419
+ if( defined( 'DOING_AJAX') ) {
420
+ if($rule['operator'] == "==") {
421
+
422
+ $match = $this->is_category;
423
+
424
+ } elseif($rule['operator'] == "!=") {
425
+
426
+ $match = !$this->is_category;
427
+
428
+ }
429
+ } else {
430
+ if ( $rule['operator'] == "==" ) {
431
+
432
+ $match = is_category();
433
+
434
+ } elseif ( $rule['operator'] == "!=" ) {
435
+
436
+ $match = ! is_category();
437
+
438
+ }
439
+ }
440
+ }
441
+ elseif( $rule['value'] == 'archive_page') {
442
+ if( defined( 'DOING_AJAX') ) {
443
+ if($rule['operator'] == "==") {
444
+
445
+ $match = $this->is_archive;
446
+
447
+ } elseif($rule['operator'] == "!=") {
448
+
449
+ $match = !$this->is_archive;
450
+
451
+ }
452
+ } else {
453
+ if ( $rule['operator'] == "==" ) {
454
+
455
+ $match = is_archive();
456
+
457
+ } elseif ( $rule['operator'] == "!=" ) {
458
+
459
+ $match = ! is_archive();
460
+
461
+ }
462
+ }
463
+ }
464
  elseif( $rule['value'] == 'posts_page') {
465
 
466
  $posts_page = (int) get_option('page_for_posts');