Version Description
- Fixed bug popup not closing when using conversion close option
- Changed ajax mode to be on by default
Download this release
Release Info
Developer | timersys |
Plugin | Popups – WordPress Popup |
Version | 1.3.1 |
Comparing to | |
See all releases |
Code changes from version 1.3.0.3 to 1.3.1
- README.txt +7 -3
- admin/class-social-popup-admin.php +2 -2
- admin/includes/class-spu-notices.php +37 -0
- admin/includes/class-spu-upgrade.php +0 -137
- admin/includes/class-spu-upgrader.php +31 -0
- popups.php +9 -2
- public/assets/js/min/public-min.js +1 -1
- public/assets/js/public.js +3 -3
- public/class-social-popup.php +9 -1
README.txt
CHANGED
@@ -3,9 +3,9 @@ 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.2.
|
7 |
-
Stable tag: 1.3.
|
8 |
-
Text Domain:
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -109,6 +109,10 @@ Yes if you need to debug you can use uncompressed javascript by addings ([this c
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
|
|
112 |
= 1.3.0.3 =
|
113 |
* Social providers not loading on https sites
|
114 |
* Fixed bug preventing popups to show on non ajax mode
|
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.2.2
|
7 |
+
Stable tag: 1.3.1
|
8 |
+
Text Domain: spu
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
109 |
|
110 |
== Changelog ==
|
111 |
|
112 |
+
= 1.3.1 =
|
113 |
+
* Fixed bug popup not closing when using conversion close option
|
114 |
+
* Changed ajax mode to be on by default
|
115 |
+
|
116 |
= 1.3.0.3 =
|
117 |
* Social providers not loading on https sites
|
118 |
* Fixed bug preventing popups to show on non ajax mode
|
admin/class-social-popup-admin.php
CHANGED
@@ -217,7 +217,7 @@ class SocialPopup_Admin {
|
|
217 |
|
218 |
$defaults = apply_filters( 'spu/settings_page/defaults_opts', array(
|
219 |
'aff_link' => '',
|
220 |
-
'ajax_mode' => '',
|
221 |
'debug' => '',
|
222 |
'safe' => '',
|
223 |
'shortcodes_style' => '',
|
@@ -232,7 +232,7 @@ class SocialPopup_Admin {
|
|
232 |
|
233 |
|
234 |
if ( isset( $_POST['spu_nonce'] ) && wp_verify_nonce( $_POST['spu_nonce'], 'spu_save_settings' ) ) {
|
235 |
-
$opts =
|
236 |
update_option( 'spu_settings' , $opts );
|
237 |
}
|
238 |
|
217 |
|
218 |
$defaults = apply_filters( 'spu/settings_page/defaults_opts', array(
|
219 |
'aff_link' => '',
|
220 |
+
'ajax_mode' => '1',
|
221 |
'debug' => '',
|
222 |
'safe' => '',
|
223 |
'shortcodes_style' => '',
|
232 |
|
233 |
|
234 |
if ( isset( $_POST['spu_nonce'] ) && wp_verify_nonce( $_POST['spu_nonce'], 'spu_save_settings' ) ) {
|
235 |
+
$opts = esc_sql( @$_POST['spu_settings'] );
|
236 |
update_option( 'spu_settings' , $opts );
|
237 |
}
|
238 |
|
admin/includes/class-spu-notices.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class that handle all admin notices
|
5 |
+
*
|
6 |
+
* @since 1.3.1
|
7 |
+
* @package SocialPopup
|
8 |
+
* @subpackage SocialPopup/Admin/Includes
|
9 |
+
* @author Damian Logghe <info@timersys.com>
|
10 |
+
*/
|
11 |
+
class SocialPopup_Notices {
|
12 |
+
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Initialize the class and set its properties.
|
16 |
+
*
|
17 |
+
* @since 1.3.1
|
18 |
+
*/
|
19 |
+
public function __construct( ) {
|
20 |
+
|
21 |
+
if( isset( $_GET['spu_notice'])){
|
22 |
+
update_option('spu_'.esc_attr($_GET['spu_notice']), true);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
public function rate_plugin(){
|
28 |
+
?><div class="updated notice">
|
29 |
+
<h3><i class=" dashicons-before dashicons-share-alt"></i>WordPress Popups Plugin</h3>
|
30 |
+
<p><?php echo sprintf(__( 'We noticed that you have been using our plugin for a while and we would like to ask you a little favour. If you are happy with it and can take a minute please <a href="%s" target="_blank">leave a nice review</a> on WordPress', 'spu' ), 'https://wordpress.org/support/view/plugin-reviews/popups?filter=5' ); ?></p>
|
31 |
+
<ul>
|
32 |
+
<li><?php echo sprintf(__('<a href="%s" target="_blank">Leave a nice review</a>'),'https://wordpress.org/support/view/plugin-reviews/popups?filter=5');?></li>
|
33 |
+
<li><?php echo sprintf(__('<a href="%s">No, thanks</a>'), '?spu_notice=rate_plugin');?></li>
|
34 |
+
</ul>
|
35 |
+
</div><?php
|
36 |
+
}
|
37 |
+
}
|
admin/includes/class-spu-upgrade.php
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* Upgrade (NOT USED for now)
|
5 |
-
*
|
6 |
-
* @description: Upgrade rutines and upgrade messages
|
7 |
-
* @since 1.0.0
|
8 |
-
* @version 1.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
class Spu_Upgrade {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* __construct
|
15 |
-
*
|
16 |
-
* @description:
|
17 |
-
* @since 1.0
|
18 |
-
*/
|
19 |
-
|
20 |
-
function __construct()
|
21 |
-
{
|
22 |
-
// actions
|
23 |
-
add_action('admin_menu', array($this,'admin_menu'), 11);
|
24 |
-
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* admin_menu
|
30 |
-
* @since 1.0
|
31 |
-
**/
|
32 |
-
|
33 |
-
function admin_menu()
|
34 |
-
{
|
35 |
-
// dont run on plugin activate!
|
36 |
-
if( isset($_GET['action']) && $_GET['action'] == 'activate-plugin' )
|
37 |
-
{
|
38 |
-
return;
|
39 |
-
}
|
40 |
-
|
41 |
-
// vars
|
42 |
-
$new_version = apply_filters('spu/get_info', 'version');
|
43 |
-
$old_version = get_option('spu_version', false);
|
44 |
-
|
45 |
-
// update info
|
46 |
-
global $pagenow;
|
47 |
-
|
48 |
-
if( $pagenow == 'plugins.php' )
|
49 |
-
{
|
50 |
-
$hook = apply_filters('spu/get_info', 'hook');
|
51 |
-
|
52 |
-
add_action( 'in_plugin_update_message-' . $hook, array($this, 'in_plugin_update_message'), 10, 2 );
|
53 |
-
}
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Shows update changelog message
|
65 |
-
* @param [type] $plugin_data [description]
|
66 |
-
* @param [type] $r [description]
|
67 |
-
* @return [type] [description]
|
68 |
-
*/
|
69 |
-
function in_plugin_update_message( $plugin_data, $r )
|
70 |
-
{
|
71 |
-
// vars
|
72 |
-
$version = apply_filters('spu/get_info', 'version');
|
73 |
-
#$readme = wp_remote_fopen( 'http://plugins.svn.wordpress.org/advanced-custom-fields/trunk/readme.txt' );
|
74 |
-
$readme = wp_remote_fopen( 'http://local.dev.192.168.1.200.xip.io/testdrive/README.txt' );
|
75 |
-
$regexp = '/== Changelog ==(.*)= ' . $version . ' =/sm';
|
76 |
-
$o = '';
|
77 |
-
|
78 |
-
|
79 |
-
// validate
|
80 |
-
if( !$readme )
|
81 |
-
{
|
82 |
-
return;
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
// regexp
|
87 |
-
preg_match( $regexp, $readme, $matches );
|
88 |
-
|
89 |
-
|
90 |
-
if( ! isset($matches[1]) )
|
91 |
-
{
|
92 |
-
return;
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
// render changelog
|
97 |
-
$changelog = explode('*', $matches[1]);
|
98 |
-
array_shift( $changelog );
|
99 |
-
|
100 |
-
|
101 |
-
if( !empty($changelog) )
|
102 |
-
{
|
103 |
-
$o .= '<div class="acf-plugin-update-info">';
|
104 |
-
$o .= '<h3>' . __("What's new", 'acf') . '</h3>';
|
105 |
-
$o .= '<ul>';
|
106 |
-
|
107 |
-
foreach( $changelog as $item )
|
108 |
-
{
|
109 |
-
$item = explode('http', $item);
|
110 |
-
|
111 |
-
$o .= '<li>' . $item[0];
|
112 |
-
|
113 |
-
if( isset($item[1]) )
|
114 |
-
{
|
115 |
-
$o .= '<a href="http' . $item[1] . '" target="_blank">' . __("credits",'acf') . '</a>';
|
116 |
-
}
|
117 |
-
|
118 |
-
$o .= '</li>';
|
119 |
-
|
120 |
-
|
121 |
-
}
|
122 |
-
|
123 |
-
$o .= '</ul></div>';
|
124 |
-
}
|
125 |
-
|
126 |
-
echo $o;
|
127 |
-
|
128 |
-
|
129 |
-
}
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
}
|
134 |
-
|
135 |
-
new Spu_Upgrade();
|
136 |
-
|
137 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/includes/class-spu-upgrader.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Upgrader Class
|
5 |
+
*
|
6 |
+
* @description: Upgrade rutines and upgrade messages
|
7 |
+
* @since 1.3.1
|
8 |
+
* @version 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
class SocialPopup_Upgrader {
|
12 |
+
|
13 |
+
public function upgrade_plugin() {
|
14 |
+
global $wpdb;
|
15 |
+
$current_version = get_option('spu-version');
|
16 |
+
|
17 |
+
if( !get_option('spu_plugin_updated') ) {
|
18 |
+
// show feedback box if updating plugin
|
19 |
+
if ( empty( $current_version ) ) {
|
20 |
+
$total = $wpdb->get_var( "SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'spucpt'" );
|
21 |
+
if ( $total > 0 ) {
|
22 |
+
update_option( 'spu_plugin_updated', true );
|
23 |
+
}
|
24 |
+
} elseif ( ! empty( $current_version ) && version_compare( $current_version, SPU_VERSION, '<' ) ) {
|
25 |
+
update_option( 'spu_plugin_updated', true );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
}
|
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.3.
|
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
|
@@ -30,11 +30,12 @@ if ( ! defined( 'WPINC' ) ) {
|
|
30 |
* Public-Facing Functionality
|
31 |
*----------------------------------------------------------------------------*/
|
32 |
|
|
|
33 |
define( 'SPU_PLUGIN_DIR' , plugin_dir_path(__FILE__) );
|
34 |
define( 'SPU_PLUGIN_URL' , plugin_dir_url(__FILE__) );
|
35 |
define( 'SPU_PLUGIN_HOOK' , basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
|
36 |
|
37 |
-
|
38 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-social-popup.php' );
|
39 |
// Include Helper class
|
40 |
require_once( SPU_PLUGIN_DIR . 'includes/class-spu-helper.php' );
|
@@ -62,7 +63,13 @@ add_action( 'plugins_loaded', array( 'SocialPopup', 'get_instance' ) );
|
|
62 |
if ( is_admin() ) {
|
63 |
|
64 |
require_once( plugin_dir_path( __FILE__ ) . 'admin/class-social-popup-admin.php' );
|
|
|
|
|
|
|
65 |
|
66 |
add_action( 'plugins_loaded', array( 'SocialPopup_Admin', 'get_instance' ) );
|
67 |
|
|
|
|
|
|
|
68 |
}
|
11 |
* @socialpopup
|
12 |
* Plugin Name: Popups - WordPress Popup
|
13 |
* Plugin URI: http://www.timersys.com/free-plugins/social-popup/
|
14 |
+
* Version: 1.3.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
|
30 |
* Public-Facing Functionality
|
31 |
*----------------------------------------------------------------------------*/
|
32 |
|
33 |
+
define( 'SPU_VERSION' , '1.3.1' );
|
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__ ) );
|
37 |
|
38 |
+
require_once( plugin_dir_path( __FILE__ ) . 'admin/includes/class-spu-upgrader.php' );
|
39 |
require_once( plugin_dir_path( __FILE__ ) . 'public/class-social-popup.php' );
|
40 |
// Include Helper class
|
41 |
require_once( SPU_PLUGIN_DIR . 'includes/class-spu-helper.php' );
|
63 |
if ( is_admin() ) {
|
64 |
|
65 |
require_once( plugin_dir_path( __FILE__ ) . 'admin/class-social-popup-admin.php' );
|
66 |
+
require_once( plugin_dir_path( __FILE__ ) . 'admin/includes/class-spu-notices.php' );
|
67 |
+
|
68 |
+
$spu_notices = new SocialPopup_Notices();
|
69 |
|
70 |
add_action( 'plugins_loaded', array( 'SocialPopup_Admin', 'get_instance' ) );
|
71 |
|
72 |
+
if( get_option('spu_plugin_updated') && !get_option('spu_rate_plugin') )
|
73 |
+
add_action( 'admin_notices', array( $spu_notices, 'rate_plugin') );
|
74 |
+
|
75 |
}
|
public/assets/js/min/public-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){"use strict";function t(t,i,o,e,n){var r={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},n=n||!1,o=o||!1,e=e||!1;i&&(r.url=i),o&&(r.success=o),e&&(r.error=e),n&&(r.dataType=n),$.ajax(r)}function i(t,i,o){if(o){var e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3);var n="; expires="+e.toGMTString()}else var n="";document.cookie=t+"="+i+n+"; path=/"}function o(t){for(var i=t+"=",o=document.cookie.split(";"),e=0;e<o.length;e++){for(var n=o[e];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(i))return n.substring(i.length,n.length)}return null}function e(){try{FB.Event.subscribe("edge.create",function(t,i){var o=$(i).parents(".spu-box").data("box-id");o&&SPU.hide(o)})}catch(t){}l=!0,clearInterval(h)}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){}if(spuvar_social.google)try{gapi.plusone.go()}catch(t){}if(spuvar_social.twitter)try{twttr.widgets.load()}catch(t){}}function u(){$(".spu-box form").each(function(){var t=$(this).attr("action");t&&$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var d=function(){function e(t){var i=d[t],o=$(window).width(),e=$(window).height(),n=i.outerHeight(),r=i.outerWidth(),a=i.data("width"),s=0,u=e/2-n/2,c="fixed",f=$(document).scrollTop();i.hasClass("spu-centered")&&(o>a&&(s=o/2-r/2),i.css({left:s,position:c,top:u})),n+50>e&&(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 o=i.find(".fb-like > span").width();if(0==o){var e=i.find(".fb-like").data("layout");i.append("box_count"==e?'<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,o,n){var r=d[t],a=$("#spu-bg-"+t),s=r.data("bgopa");if(r.is(":animated"))return!1;if(o===!0&&r.is(":visible")||o===!1&&r.is(":hidden"))return!1;if(o===!1){var u=parseInt(r.data("cookie"));u>0&&i("spu_box_"+t,!0,u),r.trigger("spu.box_close",[t])}else r.trigger("spu.box_open",[t]),$(window).resize(function(){e(t)}),e(t);var c=r.data("spuanimation"),f=r.data("close-on-conversion");return"fade"===c?o===!0?r.fadeIn("slow"):o===!1&&f&&r.fadeOut("slow"):o===!0?r.slideDown("slow"):o===!1&&f&&r.slideUp("slow"),o===!0&&s>0?a.fadeIn():o===!1&&f&&a.fadeOut(),o}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),e=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")),h=parseInt(i.data("trigger-number"),10),m="percentage"==e?parseInt(i.data("trigger-number"),10)/100:.8,g=m*$(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(),y=i.data("total");i.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),y&&!spuvar.disable_style&&$(window).width()>v&&(i.find(".spu-shortcode").each(function(){w+=$(this).width()}),b=_-w-y),b>0&&(i.find(".spu-shortcode").each(function(){$(this).css("margin-left",b/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,!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,!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>=g;i?(p||$(window).unbind("scroll",k),r(f,!0,!1)):r(f,!1,!1)},100)},I=function(){s&&clearTimeout(s),s=window.setTimeout(function(){r(f,!0,!1)},1e3*h)},j=o("spu_box_"+f);if((void 0==j||""==j||u&&c)&&("seconds"==e?I():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var P=window.location.hash,S;P.substring(1)===i.attr("id")&&setTimeout(function(){r(f,!0,!1)},100)}i.on("click",".spu-close-popup",function(){r(f,!1,!1),"percentage"==e&&$(window).unbind("scroll",k)}),$('a[href="#'+i.attr("id")+'"]').click(function(){return r(f,!0,!1),!1}),i.find(".gform_wrapper form").addClass("gravity-form"),i.on("submit","form.spu-disable-ajax",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),i.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax")',function(o){o.preventDefault();var e=!0,n=$(this),a=n.serialize(),s=n.attr("action"),u=function(t,i,o){console.log("Spu Form error: "+i+" - "+o)},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,!0)},1e3*spuvar.seconds_confirmation_close)};return t(a,s,d,u,"html"),i.trigger("spu.form_submitted",[f]),e}),$("body").on("mailsent.wpcf7",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),$(document).on("gform_confirmation_loaded",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),i.on("submit",".infusion-form",function(t){t.preventDefault(),i.trigger("spu.form_submitted",[f]),r(f,!1,!0),this.submit()})}),{show:function(t){return r(t,!0,!1)},hide:function(t){return r(t,!1,!1)},request:function(i,o,e,n){return t(i,o,e,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,o){console.log("Problem loading popups - error: "+i+" - "+o)};t(c,spuvar.ajax_mode_url,f,p,"html")}else jQuery(window).load(function(){window.SPU=d()});var l=!1,h=setInterval(function(){"undefined"==typeof FB||l||e()},1e3);if("undefined"!=typeof twttr)try{twttr.ready(function(t){t.events.bind("tweet",n),t.events.bind("follow",n)})}catch(m){}}(jQuery);
|
1 |
+
!function($){"use strict";function t(t,i,o,e,n){var r={url:spuvar.ajax_url,data:t,cache:!1,type:"POST",dataType:"json",timeout:3e4},n=n||!1,o=o||!1,e=e||!1;i&&(r.url=i),o&&(r.success=o),e&&(r.error=e),n&&(r.dataType=n),$.ajax(r)}function i(t,i,o){if(o){var e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3);var n="; expires="+e.toGMTString()}else var n="";document.cookie=t+"="+i+n+"; path=/"}function o(t){for(var i=t+"=",o=document.cookie.split(";"),e=0;e<o.length;e++){for(var n=o[e];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(i))return n.substring(i.length,n.length)}return null}function e(){try{FB.Event.subscribe("edge.create",function(t,i){var o=$(i).parents(".spu-box").data("box-id");o&&SPU.hide(o)})}catch(t){}l=!0,clearInterval(h)}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){}if(spuvar_social.google)try{gapi.plusone.go()}catch(t){}if(spuvar_social.twitter)try{twttr.widgets.load()}catch(t){}}function u(){$(".spu-box form").each(function(){var t=$(this).attr("action");t&&$(this).attr("action",t.replace("?spu_action=spu_load",""))}),$.fn.wpcf7InitForm&&$(".spu-box div.wpcf7 > form").wpcf7InitForm()}var d=function(){function e(t){var i=d[t],o=$(window).width(),e=$(window).height(),n=i.outerHeight(),r=i.outerWidth(),a=i.data("width"),s=0,u=e/2-n/2,c="fixed",f=$(document).scrollTop();i.hasClass("spu-centered")&&(o>a&&(s=o/2-r/2),i.css({left:s,position:c,top:u})),n+50>e&&(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 o=i.find(".fb-like > span").width();if(0==o){var e=i.find(".fb-like").data("layout");i.append("box_count"==e?'<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,o,n){var r=d[t],a=$("#spu-bg-"+t),s=r.data("bgopa");if(r.is(":animated"))return!1;if(o===!0&&r.is(":visible")||o===!1&&r.is(":hidden"))return!1;if(o===!1){var u=parseInt(r.data("cookie"));u>0&&i("spu_box_"+t,!0,u),r.trigger("spu.box_close",[t])}else r.trigger("spu.box_open",[t]),$(window).resize(function(){e(t)}),e(t);var c=r.data("spuanimation"),f=r.data("close-on-conversion");return"fade"===c?o===!0?r.fadeIn("slow"):o===!1&&(f&&n||!n)&&r.fadeOut("slow"):o===!0?r.slideDown("slow"):o===!1&&(f&&n||!n)&&r.slideUp("slow"),o===!0&&s>0?a.fadeIn():o===!1&&f&&a.fadeOut(),o}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),e=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")),h=parseInt(i.data("trigger-number"),10),m="percentage"==e?parseInt(i.data("trigger-number"),10)/100:.8,g=m*$(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(),y=i.data("total");i.find(".spu-shortcode").wrapAll('<div class="spu_shortcodes"/>'),y&&!spuvar.disable_style&&$(window).width()>v&&(i.find(".spu-shortcode").each(function(){w+=$(this).width()}),b=_-w-y),b>0&&(i.find(".spu-shortcode").each(function(){$(this).css("margin-left",b/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,!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,!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>=g;i?(p||$(window).unbind("scroll",k),r(f,!0,!1)):r(f,!1,!1)},100)},I=function(){s&&clearTimeout(s),s=window.setTimeout(function(){r(f,!0,!1)},1e3*h)},j=o("spu_box_"+f);if((void 0==j||""==j||u&&c)&&("seconds"==e?I():($(window).bind("scroll",k),k()),window.location.hash&&window.location.hash.length>0)){var P=window.location.hash,S;P.substring(1)===i.attr("id")&&setTimeout(function(){r(f,!0,!1)},100)}i.on("click",".spu-close-popup",function(){r(f,!1,!1),"percentage"==e&&$(window).unbind("scroll",k)}),$('a[href="#'+i.attr("id")+'"]').click(function(){return r(f,!0,!1),!1}),i.find(".gform_wrapper form").addClass("gravity-form"),i.on("submit","form.spu-disable-ajax",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),i.on("submit",'form:not(".wpcf7-form, .gravity-form, .infusion-form, .spu-disable-ajax")',function(o){o.preventDefault();var e=!0,n=$(this),a=n.serialize(),s=n.attr("action"),u=function(t,i,o){console.log("Spu Form error: "+i+" - "+o)},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,!0)},1e3*spuvar.seconds_confirmation_close)};return t(a,s,d,u,"html"),i.trigger("spu.form_submitted",[f]),e}),$("body").on("mailsent.wpcf7",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),$(document).on("gform_confirmation_loaded",function(){i.trigger("spu.form_submitted",[f]),r(f,!1,!0)}),i.on("submit",".infusion-form",function(t){t.preventDefault(),i.trigger("spu.form_submitted",[f]),r(f,!1,!0),this.submit()})}),{show:function(t){return r(t,!0,!1)},hide:function(t){return r(t,!1,!1)},request:function(i,o,e,n){return t(i,o,e,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,o){console.log("Problem loading popups - error: "+i+" - "+o)};t(c,spuvar.ajax_mode_url,f,p,"html")}else jQuery(window).load(function(){window.SPU=d()});var l=!1,h=setInterval(function(){"undefined"==typeof FB||l||e()},1e3);if("undefined"!=typeof twttr)try{twttr.ready(function(t){t.events.bind("tweet",n),t.events.bind("follow",n)})}catch(m){}}(jQuery);
|
public/assets/js/public.js
CHANGED
@@ -383,13 +383,13 @@ var SPU_master = function() {
|
|
383 |
if (animation === 'fade') {
|
384 |
if (show === true) {
|
385 |
$box.fadeIn('slow');
|
386 |
-
} else if (show === false && conversion_close ) {
|
387 |
-
|
388 |
}
|
389 |
} else {
|
390 |
if (show === true ) {
|
391 |
$box.slideDown('slow');
|
392 |
-
} else if (show === false && conversion_close ) {
|
393 |
$box.slideUp('slow');
|
394 |
}
|
395 |
}
|
383 |
if (animation === 'fade') {
|
384 |
if (show === true) {
|
385 |
$box.fadeIn('slow');
|
386 |
+
} else if (show === false && ( (conversion_close && conversion ) || !conversion ) ) {
|
387 |
+
$box.fadeOut('slow');
|
388 |
}
|
389 |
} else {
|
390 |
if (show === true ) {
|
391 |
$box.slideDown('slow');
|
392 |
+
} else if (show === false && ( (conversion_close && conversion ) || !conversion ) ) {
|
393 |
$box.slideUp('slow');
|
394 |
}
|
395 |
}
|
public/class-social-popup.php
CHANGED
@@ -23,7 +23,7 @@ class SocialPopup {
|
|
23 |
*
|
24 |
* @var string
|
25 |
*/
|
26 |
-
const VERSION =
|
27 |
|
28 |
/**
|
29 |
* Popups to use acrros files
|
@@ -294,6 +294,14 @@ class SocialPopup {
|
|
294 |
);
|
295 |
wp_insert_post( $defaults, $wp_error );
|
296 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
|
299 |
/**
|
23 |
*
|
24 |
* @var string
|
25 |
*/
|
26 |
+
const VERSION = SPU_VERSION;
|
27 |
|
28 |
/**
|
29 |
* Popups to use acrros files
|
294 |
);
|
295 |
wp_insert_post( $defaults, $wp_error );
|
296 |
}
|
297 |
+
|
298 |
+
$upgrader = new SocialPopup_Upgrader();
|
299 |
+
$upgrader->upgrade_plugin();
|
300 |
+
|
301 |
+
update_option('spu-version', SPU_VERSION);
|
302 |
+
|
303 |
+
do_action( 'spu/activate' );
|
304 |
+
|
305 |
}
|
306 |
|
307 |
/**
|