Popups – WordPress Popup - Version 1.1.1

Version Description

  • Sorry!! fixed bug in settings page and js file
Download this release

Release Info

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

Code changes from version 1.1 to 1.1.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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.0.0
7
- Stable tag: 1.1
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -87,6 +87,10 @@ Yes if you need to debug you can use uncompressed javascript by addings ([this c
87
 
88
  == Changelog ==
89
 
 
 
 
 
90
  = 1.1 =
91
 
92
  * Added settings page
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.0.0
7
+ Stable tag: 1.1.1
8
  Text Domain: spucpt
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
87
 
88
  == Changelog ==
89
 
90
+ = 1.1.1 =
91
+
92
+ * Sorry!! fixed bug in settings page and js file
93
+
94
  = 1.1 =
95
 
96
  * Added settings page
admin/assets/js/min/admin-ck.js ADDED
@@ -0,0 +1 @@
 
1
+ var spu={rules:null};SPU_ADMIN=function($){function t(t){"percentage"==t?$("tr.auto_hide").fadeIn("fast"):$("tr.auto_hide").fadeOut("fast")}function r(t,r){return t.val()?parseInt(t.val()):void 0!==r?r+"px":0}function e(t,r){return t.val().length>0?t.wpColorPicker("color"):void 0!==r?r:""}function n(){var t=$("#content_ifr").contents().find("html");t.css({background:"white"}),t.find("#tinymce").css({padding:"25px","background-color":e($("#spu-background-color")),"border-color":e($("#spu-border-color")),"border-width":r($("#spu-border-width")),"border-style":"solid",display:"inline-block",width:$("#spu-width").val(),color:e($("#spu-color")),height:"auto","min-width":"200px"})}return $(document).ready(function(){spu.rules.init(),$("#spu-options input.spu-color-field").wpColorPicker({change:n,clear:n}),$("#spu-options :input").not(".spu-color-field").change(n),checkTriggerMethod($("#spu_trigger").val()),$("#spu_trigger").change(function(){checkTriggerMethod($(this).val())})}),spu.rules={$el:null,init:function(){var t=this;t.$el=$("#spu-rules"),t.$el.on("click",".rules-add-rule",function(){return t.add_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-remove-rule",function(){return t.remove_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-add-group",function(){return t.add_group(),!1}),t.$el.on("change",".param select",function(){var t=$(this).closest("tr"),r=t.attr("data-id"),e=t.closest(".rules-group"),n=e.attr("data-id"),i={action:"spu/field_group/render_rules",nonce:spu_js.nonce,rule_id:r,group_id:n,value:"",param:$(this).val()},o=$('<div class="spu-loading"><img src="'+spu_js.admin_url+'/images/wpspin_light.gif"/> </div>');t.find("td.value").html(o),$.ajax({url:ajaxurl,data:i,type:"post",dataType:"html",success:function(t){o.replaceWith(t)}})})},add_rule:function(t){var r=t.clone(),e=r.attr("data-id"),n="rule_"+(parseInt(e.replace("rule_",""),10)+1);return r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),t.after(r),!1},remove_rule:function(t){var r=t.siblings("tr").length;0==r?this.remove_group(t.closest(".rules-group")):t.remove()},add_group:function(){var t=this.$el.find(".rules-group:last"),r=t.clone(),e=r.attr("data-id"),n="group_"+(parseInt(e.replace("group_",""),10)+1);r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),r.find("h4").text(spu_js.l10n.or),r.find("tr:not(:first)").remove(),t.after(r)},remove_group:function(t){t.remove()}},{onTinyMceInit:function(){n()}}}(jQuery);
admin/assets/js/min/admin-min.js ADDED
@@ -0,0 +1 @@
 
1
+ var spu={rules:null};SPU_ADMIN=function($){function t(t){"percentage"==t?$("tr.auto_hide").fadeIn("fast"):$("tr.auto_hide").fadeOut("fast")}function r(t,r){return t.val()?parseInt(t.val()):void 0!==r?r+"px":0}function e(t,r){return t.val().length>0?t.wpColorPicker("color"):void 0!==r?r:""}function n(){var t=$("#content_ifr").contents().find("html");t.css({background:"white"}),t.find("#tinymce").css({padding:"25px","background-color":e($("#spu-background-color")),"border-color":e($("#spu-border-color")),"border-width":r($("#spu-border-width")),"border-style":"solid",display:"inline-block",width:$("#spu-width").val(),color:e($("#spu-color")),height:"auto","min-width":"200px"})}return $(document).ready(function(){spu.rules.init(),$("#spu-options input.spu-color-field").wpColorPicker({change:n,clear:n}),$("#spu-options :input").not(".spu-color-field").change(n),t($("#spu_trigger").val()),$("#spu_trigger").change(function(){t($(this).val())})}),spu.rules={$el:null,init:function(){var t=this;t.$el=$("#spu-rules"),t.$el.on("click",".rules-add-rule",function(){return t.add_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-remove-rule",function(){return t.remove_rule($(this).closest("tr")),!1}),t.$el.on("click",".rules-add-group",function(){return t.add_group(),!1}),t.$el.on("change",".param select",function(){var t=$(this).closest("tr"),r=t.attr("data-id"),e=t.closest(".rules-group"),n=e.attr("data-id"),i={action:"spu/field_group/render_rules",nonce:spu_js.nonce,rule_id:r,group_id:n,value:"",param:$(this).val()},a=$('<div class="spu-loading"><img src="'+spu_js.admin_url+'/images/wpspin_light.gif"/> </div>');t.find("td.value").html(a),$.ajax({url:ajaxurl,data:i,type:"post",dataType:"html",success:function(t){a.replaceWith(t)}})})},add_rule:function(t){var r=t.clone(),e=r.attr("data-id"),n="rule_"+(parseInt(e.replace("rule_",""),10)+1);return r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),t.after(r),!1},remove_rule:function(t){var r=t.siblings("tr").length;0==r?this.remove_group(t.closest(".rules-group")):t.remove()},add_group:function(){var t=this.$el.find(".rules-group:last"),r=t.clone(),e=r.attr("data-id"),n="group_"+(parseInt(e.replace("group_",""),10)+1);r.find("[name]").each(function(){$(this).attr("name",$(this).attr("name").replace(e,n)),$(this).attr("id",$(this).attr("id").replace(e,n))}),r.attr("data-id",n),r.find("h4").text(spu_js.l10n.or),r.find("tr:not(:first)").remove(),t.after(r)},remove_group:function(t){t.remove()}},{onTinyMceInit:function(){n()}}}(jQuery);
includes/class-spu-helper.php CHANGED
@@ -76,7 +76,7 @@ class Spu_Helper {
76
  case "page":
77
 
78
  $post_type = 'page';
79
- $posts = get_posts(array(
80
  'posts_per_page' => -1,
81
  'post_type' => $post_type,
82
  'orderby' => 'menu_order title',
@@ -84,7 +84,9 @@ class Spu_Helper {
84
  'post_status' => 'any',
85
  'suppress_filters' => false,
86
  'update_post_meta_cache' => false,
87
- ));
 
 
88
 
89
  if( $posts )
90
  {
@@ -162,13 +164,13 @@ class Spu_Helper {
162
  {
163
  foreach( $post_types as $post_type )
164
  {
165
-
166
- $posts = get_posts(array(
167
  'numberposts' => '-1',
168
  'post_type' => $post_type,
169
  'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'),
170
  'suppress_filters' => false,
171
- ));
 
172
 
173
  if( $posts)
174
  {
@@ -200,7 +202,8 @@ class Spu_Helper {
200
 
201
  case "post_category" :
202
 
203
- $category_ids = get_all_category_ids();
 
204
 
205
  foreach($category_ids as $cat_id)
206
  {
76
  case "page":
77
 
78
  $post_type = 'page';
79
+ $args = array(
80
  'posts_per_page' => -1,
81
  'post_type' => $post_type,
82
  'orderby' => 'menu_order title',
84
  'post_status' => 'any',
85
  'suppress_filters' => false,
86
  'update_post_meta_cache' => false,
87
+ );
88
+
89
+ $posts = get_posts( apply_filters('spu/rules/page_args', $args ) );
90
 
91
  if( $posts )
92
  {
164
  {
165
  foreach( $post_types as $post_type )
166
  {
167
+ $args = array(
 
168
  'numberposts' => '-1',
169
  'post_type' => $post_type,
170
  'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'),
171
  'suppress_filters' => false,
172
+ );
173
+ $posts = get_posts(apply_filters('spu/rules/post_args', $args ));
174
 
175
  if( $posts)
176
  {
202
 
203
  case "post_category" :
204
 
205
+ $ids = get_all_category_ids();
206
+ $category_ids = apply_filters('spu/rules/category_ids', $ids );
207
 
208
  foreach($category_ids as $cat_id)
209
  {
popups.php CHANGED
@@ -11,7 +11,7 @@
11
  * @socialpopup
12
  * Plugin Name: Popups
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
- * Version: 1.1
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
13
  * Plugin URI: http://www.timersys.com/free-plugins/social-popup/
14
+ * Version: 1.1.1
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-ck.js → public-min.js} RENAMED
@@ -1 +1 @@
1
- function spuCreateCookie(t,i,n){if(n){var e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3);var o="; expires="+e.toGMTString()}else var o="";document.cookie=t+"="+i+o+"; path=/"}function spuReadCookie(t){for(var i=t+"=",n=document.cookie.split(";"),e=0;e<n.length;e++){for(var o=n[e];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(i))return o.substring(i.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function($){function t(t){var i=o[t],n=$(window).width(),e=$(window).height(),s=i.height(),a=i.width();i.css({position:"fixed",top:e/2-s/2,left:n/2-a/2})}function i(i,n){var e=o[i],s=$("#spu-bg-"+i),a=e.data("bgopa");if(e.is(":animated"))return!1;if(n===!0&&e.is(":visible")||n===!1&&e.is(":hidden"))return!1;if(n===!1){var r=parseInt(e.data("cookie"));r>0&&spuCreateCookie("spu_box_"+i,!0,r)}e.hasClass("spu-centered")&&t(i);var d=e.data("animation");return"fade"===d?e.fadeToggle("slow"):e.slideToggle("slow"),n===!0&&a>0?s.fadeIn():s.fadeOut(),n}var n=$(window).height(),e=spuvar.is_admin,o=[];return $(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){var t=$(this),s=t.data("trigger"),a=0,r=1===parseInt(t.data("test-mode")),d=t.data("box-id"),u=1===parseInt(t.data("auto-hide")),c=parseInt(t.data("seconds-close")),h=parseInt(t.data("trigger-number"),10),f="percentage"==s?parseInt(t.data("trigger-number"),10)/100:.8,l=f*$(document).height();$(".spu-google").width($(".spu-google").width()-20),$(".spu-twitter").width($(".spu-twitter").width()-12);var g=0,p=0,w=$(this).find(".spu-content").width(),m=t.data("total");m&&($(this).find(".spu-shortcode").each(function(){g+=$(this).width()}),p=w-g),p>0&&($(this).find(".spu-shortcode").each(function(){3==m?$(this).css("margin-left",p/(m-1)):$(this).css("margin-left",p/2)}),2==m?$(this).find(".spu-shortcode").last().css("margin-left",0):3==m&&$(this).find(".spu-shortcode").first().css("margin-left",0)),$(document).keyup(function(t){27==t.keyCode&&i(d,!1)});var v=navigator.userAgent,b=v.match(/iPad/i)||v.match(/iPhone/i)?"touchstart":"click";$("body").on(b,function(t){console.log(b.target),i(d,!1)}),$(".spu-box").on(b,function(t){t.stopPropagation()}),t.hide().css("left",""),o[d]=t;var k=function(){a&&clearTimeout(a),a=window.setTimeout(function(){var t=$(window).scrollTop(),e=t+n>=l;e?(u||$(window).unbind("scroll",k),i(d,!0)):i(d,!1)},100)},T=function(){a&&clearTimeout(a),a=window.setTimeout(function(){i(d,!0)},1e3*h)},x=spuReadCookie("spu_box_"+d);if((void 0==x||e&&r)&&("seconds"==s?T():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var C=window.location.hash,I;C.substring(1)===t.attr("id")&&setTimeout(function(){i(d,!0)},100)}t.find(".spu-close").click(function(){i(d,!1),"percentage"==s&&$(window).unbind("scroll",k)}),$('a[href="#'+t.attr("id")+'"]').click(function(){return i(d,!0),!1})}),{show:function(t){return i(t,!0)},hide:function(t){return i(t,!1)}}}(window.jQuery)});
1
+ function spuCreateCookie(t,i,n){if(n){var e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3);var o="; expires="+e.toGMTString()}else var o="";document.cookie=t+"="+i+o+"; path=/"}function spuReadCookie(t){for(var i=t+"=",n=document.cookie.split(";"),e=0;e<n.length;e++){for(var o=n[e];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(i))return o.substring(i.length,o.length)}return null}jQuery(window).load(function(){window.SPU=function($){function t(t){var i=o[t],n=$(window).width(),e=$(window).height(),s=i.height(),a=i.width();i.css({position:"fixed",top:e/2-s/2,left:n/2-a/2})}function i(i,n){var e=o[i],s=$("#spu-bg-"+i),a=e.data("bgopa");if(e.is(":animated"))return!1;if(n===!0&&e.is(":visible")||n===!1&&e.is(":hidden"))return!1;if(n===!1){var r=parseInt(e.data("cookie"));r>0&&spuCreateCookie("spu_box_"+i,!0,r)}e.hasClass("spu-centered")&&t(i);var d=e.data("animation");return"fade"===d?e.fadeToggle("slow"):e.slideToggle("slow"),n===!0&&a>0?s.fadeIn():s.fadeOut(),n}var n=$(window).height(),e=spuvar.is_admin,o=[];return $(".spu-content").children().first().css({"margin-top":0,"padding-top":0}).end().last().css({"margin-bottom":0,"padding-bottom":0}),$(".spu-box").each(function(){var t=$(this),s=t.data("trigger"),a=0,r=1===parseInt(t.data("test-mode")),d=t.data("box-id"),u=1===parseInt(t.data("auto-hide")),c=parseInt(t.data("seconds-close")),h=parseInt(t.data("trigger-number"),10),l="percentage"==s?parseInt(t.data("trigger-number"),10)/100:.8,f=l*$(document).height();$(".spu-google").width($(".spu-google").width()-20),$(".spu-twitter").width($(".spu-twitter").width()-12);var g=0,p=0,w=$(this).find(".spu-content").width(),m=t.data("total");m&&!spuvar.disable_style&&($(this).find(".spu-shortcode").each(function(){g+=$(this).width()}),p=w-g),p>0&&($(this).find(".spu-shortcode").each(function(){3==m?$(this).css("margin-left",p/(m-1)):$(this).css("margin-left",p/2)}),2==m?$(this).find(".spu-shortcode").last().css("margin-left",0):3==m&&$(this).find(".spu-shortcode").first().css("margin-left",0)),$(document).keyup(function(t){27==t.keyCode&&i(d,!1)});var v=navigator.userAgent,b=v.match(/iPad/i)||v.match(/iPhone/i)?"touchstart":"click";$("body").on(b,function(t){console.log(b.target),i(d,!1)}),$(".spu-box").on(b,function(t){t.stopPropagation()}),t.hide().css("left",""),o[d]=t;var k=function(){a&&clearTimeout(a),a=window.setTimeout(function(){var t=$(window).scrollTop(),e=t+n>=f;e?(u||$(window).unbind("scroll",k),i(d,!0)):i(d,!1)},100)},T=function(){a&&clearTimeout(a),a=window.setTimeout(function(){i(d,!0)},1e3*h)},x=spuReadCookie("spu_box_"+d);if((void 0==x||e&&r)&&("seconds"==s?T():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var C=window.location.hash,I;C.substring(1)===t.attr("id")&&setTimeout(function(){i(d,!0)},100)}t.find(".spu-close").click(function(){i(d,!1),"percentage"==s&&$(window).unbind("scroll",k)}),$('a[href="#'+t.attr("id")+'"]').click(function(){return i(d,!0),!1})}),{show:function(t){return i(t,!0)},hide:function(t){return i(t,!1)}}}(window.jQuery)});
public/class-social-popup.php CHANGED
@@ -23,7 +23,7 @@ class SocialPopup {
23
  *
24
  * @var string
25
  */
26
- const VERSION = '1.1';
27
 
28
  /**
29
  * Popups to use acrros files
@@ -324,7 +324,7 @@ class SocialPopup {
324
  */
325
  public function register_scripts() {
326
 
327
- $js_url = plugins_url( 'assets/js/min/public-ck.js', __FILE__ );
328
 
329
  $opts = $this->spu_settings;
330
 
@@ -335,17 +335,17 @@ class SocialPopup {
335
 
336
  wp_register_script( 'spu-public', $js_url, array( 'jquery' ), self::VERSION, true );
337
 
338
- if( ! defined( 'SPU_UNLOAD_FB_JS') || !empty( $opts['facebook'] ) ) {
339
 
340
  wp_register_script( 'spu-facebook', 'http://connect.facebook.net/'.get_locale().'/all.js#xfbml=1', array('jquery'), self::VERSION, FALSE);
341
 
342
  }
343
- if( ! defined( 'SPU_UNLOAD_TW_JS') || !empty( $opts['google'] ) ) {
344
 
345
  wp_register_script( 'spu-twitter', 'http://platform.twitter.com/widgets.js', array('jquery'), self::VERSION, FALSE);
346
 
347
  }
348
- if( ! defined( 'SPU_UNLOAD_GO_JS') || !empty( $opts['twitter'] ) ) {
349
 
350
  wp_register_script( 'spu-google', 'https://apis.google.com/js/plusone.js', array('jquery'), self::VERSION, FALSE);
351
 
23
  *
24
  * @var string
25
  */
26
+ const VERSION = '1.1.1';
27
 
28
  /**
29
  * Popups to use acrros files
324
  */
325
  public function register_scripts() {
326
 
327
+ $js_url = plugins_url( 'assets/js/min/public-min.js', __FILE__ );
328
 
329
  $opts = $this->spu_settings;
330
 
335
 
336
  wp_register_script( 'spu-public', $js_url, array( 'jquery' ), self::VERSION, true );
337
 
338
+ if( !defined( 'SPU_UNLOAD_FB_JS') && empty( $opts['facebook'] ) ) {
339
 
340
  wp_register_script( 'spu-facebook', 'http://connect.facebook.net/'.get_locale().'/all.js#xfbml=1', array('jquery'), self::VERSION, FALSE);
341
 
342
  }
343
+ if( ! defined( 'SPU_UNLOAD_TW_JS') && empty( $opts['google'] ) ) {
344
 
345
  wp_register_script( 'spu-twitter', 'http://platform.twitter.com/widgets.js', array('jquery'), self::VERSION, FALSE);
346
 
347
  }
348
+ if( ! defined( 'SPU_UNLOAD_GO_JS') && empty( $opts['twitter'] ) ) {
349
 
350
  wp_register_script( 'spu-google', 'https://apis.google.com/js/plusone.js', array('jquery'), self::VERSION, FALSE);
351