Popup Builder – Responsive WordPress Pop up - Version 4.1.0

Version Description

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 4.1.0
Comparing to
See all releases

Code changes from version 4.0.9 to 4.1.0

com/classes/Actions.php CHANGED
@@ -19,7 +19,9 @@ class Actions
19
  {
20
  add_action('init', array($this, 'wpInit'), 100);
21
  add_action('init', array($this, 'postTypeInit'), 9999);
22
- add_action('init', array($this, 'updatesInit'), 9999);
 
 
23
  add_action('admin_menu', array($this, 'addSubMenu'));
24
  add_action('admin_menu', array($this, 'supportLinks'), 999);
25
  add_action('admin_head', array($this, 'showPreviewButtonAfterPopupPublish'));
@@ -69,87 +71,6 @@ class Actions
69
  new Ajax();
70
  }
71
 
72
- private function checkIfLicenseIsActive($license, $itemId, $storeURL, $key) {
73
- $transient = 'sgpb-license-key-'.$key.'-requested';
74
- if ( false !== ( $value = get_transient( $transient ) ) ) {
75
- return;
76
- }
77
- $params = array(
78
- 'woo_sl_action' => 'status-check',
79
- 'licence_key' => $license,
80
- 'product_unique_id' => $itemId,
81
- 'domain' => home_url()
82
- );
83
- $requestUri = 'https://popup-builder.com/index.php?'.http_build_query($params);
84
- $response = wp_remote_get($requestUri);
85
- if (!is_wp_error($response) || 200 == wp_remote_retrieve_response_code($response)) {
86
- $licenseData = json_decode(wp_remote_retrieve_body($response));
87
- $status = (isset($licenseData[0]->licence_status) && $licenseData[0]->licence_status === 'active') ? 'valid' : $licenseData[0]->licence_status;
88
- update_option('sgpb-license-status-'.$key, $status);
89
- set_transient($transient, $licenseData[0]->status_code, WEEK_IN_SECONDS);
90
- }
91
- }
92
- public function updatesInit()
93
- {
94
- if (!class_exists('sgpb\WOOSL_CodeAutoUpdate')) {
95
- // load our custom updater if it doesn't already exist
96
- require_once(SG_POPUP_LIBS_PATH .'WOOSL_CodeAutoUpdate.php');
97
- }
98
- $licenses = (new License())->getLicenses();
99
-
100
- foreach ($licenses as $license) {
101
- $key = @$license['key'];
102
- $storeURL = @$license['storeURL'];
103
- $itemId = @$license['itemId'];
104
- $filePath = @$license['file'];
105
- $pluginMainFilePath = strpos($filePath, SG_POPUP_PLUGIN_PATH) !== 0 ? SG_POPUP_PLUGIN_PATH.$filePath : $filePath;
106
-
107
- $licenseKey = trim(get_option('sgpb-license-key-'.$key));
108
- $status = get_option('sgpb-license-status-'.$key);
109
-
110
- if ($status == false || $status != 'valid') {
111
- continue;
112
- }
113
- $this->checkIfLicenseIsActive($licenseKey, $itemId, $storeURL, $key);
114
- switch($key) {
115
- case 'POPUP_SOCIAL':
116
- if (defined('SGPB_SOCIAL_POPUP_VERSION')) {
117
- $version = @constant('SGPB_SOCIAL_POPUP_VERSION');
118
- } else {
119
- $version = @constant('SG_VERSION_'.$key);
120
- }
121
- break;
122
- case 'POPUP_AGE_VERIFICATION':
123
- if (defined('SGPB_AGE_VERIFICATION_POPUP_VERSION')) {
124
- $version = @constant('SGPB_AGE_VERIFICATION_POPUP_VERSION');
125
- } else{
126
- $version = @constant('SG_VERSION_'.$key);
127
- }
128
- break;
129
- case 'POPUP_GAMIFICATION':
130
- if (defined('POPUP_GAMIFICATION')) {
131
- $version = @constant('POPUP_GAMIFICATION');
132
- } else {
133
- $version = @constant('SG_VERSION_'.$key);
134
- }
135
- break;
136
- default :
137
- $version = @constant('SG_VERSION_'.$key);
138
- break;
139
- }
140
- // If the version of the extension is not found, update will not possibly be shown
141
- if(empty($version)) {
142
- continue;
143
- }
144
- $sgpbUpdater = new WOOSL_CodeAutoUpdate(
145
- 'https://popup-builder.com/index.php',
146
- $pluginMainFilePath,
147
- $itemId,
148
- $licenseKey,
149
- $version
150
- );
151
- }
152
- }
153
  public function custom_admin_js()
154
  {
155
  $currentPostType = AdminHelper::getCurrentPostType();
19
  {
20
  add_action('init', array($this, 'wpInit'), 100);
21
  add_action('init', array($this, 'postTypeInit'), 9999);
22
+ if (method_exists('sgpb\AdminHelper', 'updatesInit') && !has_action('admin_init', array( 'sgpb\AdminHelper', 'updatesInit'))){
23
+ add_action('admin_init', array( 'sgpb\AdminHelper', 'updatesInit'), 9999);
24
+ }
25
  add_action('admin_menu', array($this, 'addSubMenu'));
26
  add_action('admin_menu', array($this, 'supportLinks'), 999);
27
  add_action('admin_head', array($this, 'showPreviewButtonAfterPopupPublish'));
71
  new Ajax();
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  public function custom_admin_js()
75
  {
76
  $currentPostType = AdminHelper::getCurrentPostType();
com/classes/Updates.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
  namespace sgpb;
3
 
4
- /* TODO change the domain name before production */
5
-
6
  class Updates
7
  {
8
  private $licenses = array();
@@ -70,7 +68,7 @@ class Updates
70
  'domain' => home_url()
71
  );
72
 
73
- $requestUri = 'https://popup-builder.com/index.php?'.http_build_query($params);
74
 
75
  return wp_remote_get($requestUri);
76
  }
@@ -84,7 +82,7 @@ class Updates
84
  'domain' => home_url()
85
  );
86
 
87
- $requestUri = 'https://popup-builder.com/index.php?'.http_build_query($params);
88
 
89
  return wp_remote_get($requestUri);
90
  }
@@ -119,7 +117,7 @@ class Updates
119
  $hasInactiveExtensions = AdminHelper::hasInactiveExtensions();
120
 
121
  if (empty($hasInactiveExtensions)) {
122
- delete_option('SGPB_INACTIVE_EXTENSIONS', 'inactive');
123
  }
124
 
125
  wp_redirect(admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE));
1
  <?php
2
  namespace sgpb;
3
 
 
 
4
  class Updates
5
  {
6
  private $licenses = array();
68
  'domain' => home_url()
69
  );
70
 
71
+ $requestUri = SGPB_REQUEST_URL.'?'.http_build_query($params);
72
 
73
  return wp_remote_get($requestUri);
74
  }
82
  'domain' => home_url()
83
  );
84
 
85
+ $requestUri = SGPB_REQUEST_URL.'?'.http_build_query($params);
86
 
87
  return wp_remote_get($requestUri);
88
  }
117
  $hasInactiveExtensions = AdminHelper::hasInactiveExtensions();
118
 
119
  if (empty($hasInactiveExtensions)) {
120
+ delete_option('SGPB_INACTIVE_EXTENSIONS');
121
  }
122
 
123
  wp_redirect(admin_url('edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SGPB_POPUP_LICENSE));
com/config/config.php CHANGED
@@ -143,6 +143,7 @@ class SgpbPopupConfig
143
  self::addDefine('SGPB_POPUP_BUILDER_REGISTERED_PLUGINS', 'sgpbPopupBuilderRegisteredPlugins');
144
  self::addDefine('SGPB_RATE_US_NOTIFICATION_ID', 'sgpbMainRateUsNotification');
145
  self::addDefine('SGPB_SUPPORT_BANNER_NOTIFICATION_ID', 'sgpbMainSupportBanner');
 
146
  self::popupTypesInit();
147
  }
148
 
143
  self::addDefine('SGPB_POPUP_BUILDER_REGISTERED_PLUGINS', 'sgpbPopupBuilderRegisteredPlugins');
144
  self::addDefine('SGPB_RATE_US_NOTIFICATION_ID', 'sgpbMainRateUsNotification');
145
  self::addDefine('SGPB_SUPPORT_BANNER_NOTIFICATION_ID', 'sgpbMainSupportBanner');
146
+ self::addDefine('SGPB_REQUEST_URL', 'https://popup-builder.com/index.php');
147
  self::popupTypesInit();
148
  }
149
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '4.0.9');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '4.1.0');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -2123,4 +2123,85 @@ class AdminHelper
2123
 
2124
  return wp_nonce_url(apply_filters('popupGetClonePostLink', admin_url("admin.php".$action), $post->ID, $context), 'duplicate-post_' . $post->ID);
2125
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2126
  }
2123
 
2124
  return wp_nonce_url(apply_filters('popupGetClonePostLink', admin_url("admin.php".$action), $post->ID, $context), 'duplicate-post_' . $post->ID);
2125
  }
2126
+ private static function checkIfLicenseIsActive($license, $itemId, $key) {
2127
+ $transient = 'sgpb-license-key-'.$key.'-requested';
2128
+ if ( false !== ( $value = get_transient( $transient ) ) ) {
2129
+ return;
2130
+ }
2131
+ $params = array(
2132
+ 'woo_sl_action' => 'status-check',
2133
+ 'licence_key' => $license,
2134
+ 'product_unique_id' => $itemId,
2135
+ 'domain' => home_url()
2136
+ );
2137
+ $requestUri = SGPB_REQUEST_URL.'?'.http_build_query($params);
2138
+ $response = wp_remote_get($requestUri);
2139
+ if (!is_wp_error($response) || 200 == wp_remote_retrieve_response_code($response)) {
2140
+ $licenseData = json_decode(wp_remote_retrieve_body($response));
2141
+ $status = (isset($licenseData[0]->licence_status) && $licenseData[0]->licence_status === 'active') ? 'valid' : $licenseData[0]->licence_status;
2142
+ update_option('sgpb-license-status-'.$key, $status);
2143
+ set_transient($transient, $licenseData[0]->status_code, WEEK_IN_SECONDS);
2144
+ }
2145
+ }
2146
+
2147
+ public static function updatesInit()
2148
+ {
2149
+ if (!class_exists('sgpb\WOOSL_CodeAutoUpdate')) {
2150
+ // load our custom updater if it doesn't already exist
2151
+ require_once(SG_POPUP_LIBS_PATH .'WOOSL_CodeAutoUpdate.php');
2152
+ }
2153
+ $licenses = (new License())->getLicenses();
2154
+
2155
+ foreach ($licenses as $license) {
2156
+ $key = @$license['key'];
2157
+ $itemId = @$license['itemId'];
2158
+ $filePath = @$license['file'];
2159
+ $pluginMainFilePath = strpos($filePath, SG_POPUP_PLUGIN_PATH) !== 0 ? SG_POPUP_PLUGIN_PATH.$filePath : $filePath;
2160
+
2161
+ $licenseKey = trim(get_option('sgpb-license-key-'.$key));
2162
+ $status = get_option('sgpb-license-status-'.$key);
2163
+
2164
+ if ($status == false || $status != 'valid') {
2165
+ continue;
2166
+ }
2167
+ self::checkIfLicenseIsActive($licenseKey, $itemId, $key);
2168
+ switch($key) {
2169
+ case 'POPUP_SOCIAL':
2170
+ if (defined('SGPB_SOCIAL_POPUP_VERSION')) {
2171
+ $version = @constant('SGPB_SOCIAL_POPUP_VERSION');
2172
+ } else {
2173
+ $version = @constant('SG_VERSION_'.$key);
2174
+ }
2175
+ break;
2176
+ case 'POPUP_AGE_VERIFICATION':
2177
+ if (defined('SGPB_AGE_VERIFICATION_POPUP_VERSION')) {
2178
+ $version = @constant('SGPB_AGE_VERIFICATION_POPUP_VERSION');
2179
+ } else{
2180
+ $version = @constant('SG_VERSION_'.$key);
2181
+ }
2182
+ break;
2183
+ case 'POPUP_GAMIFICATION':
2184
+ if (defined('POPUP_GAMIFICATION')) {
2185
+ $version = @constant('POPUP_GAMIFICATION');
2186
+ } else {
2187
+ $version = @constant('SG_VERSION_'.$key);
2188
+ }
2189
+ break;
2190
+ default :
2191
+ $version = @constant('SG_VERSION_'.$key);
2192
+ break;
2193
+ }
2194
+ // If the version of the extension is not found, update will not possibly be shown
2195
+ if(empty($version)) {
2196
+ continue;
2197
+ }
2198
+ $sgpbUpdater = new WOOSL_CodeAutoUpdate(
2199
+ SGPB_REQUEST_URL,
2200
+ $pluginMainFilePath,
2201
+ $itemId,
2202
+ $licenseKey,
2203
+ $version
2204
+ );
2205
+ }
2206
+ }
2207
  }
popup-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
- * Version: 4.0.9
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 4.1.0
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/views/allMetaboxesView.php CHANGED
@@ -32,13 +32,11 @@ $metaboxes = apply_filters('sgpbAdditionalMetaboxes', array());
32
  }
33
  jQuery(document).ready(function () {
34
  setTimeout(function () {
35
- let minHeightShouldBe = jQuery('.sgpb-options-menu-active').next().height();
36
- jQuery('#allMetaboxesView').css('min-height', parseInt(minHeightShouldBe+100)+'px');
37
  });
38
  jQuery('.sgpb-options-content, .sgpb-options-menu').click(function(){
39
  setTimeout(function(){
40
- let minHeightShouldBe = jQuery('.sgpb-options-menu-active').next().height();
41
- jQuery('#allMetaboxesView').css('min-height', parseInt(minHeightShouldBe+100)+'px');
42
  }, 500);
43
  });
44
  jQuery('.sgpb-options-menu').click(function () {
@@ -53,5 +51,15 @@ $metaboxes = apply_filters('sgpbAdditionalMetaboxes', array());
53
  }, 500);
54
  location.hash = jQuery(this).attr('id');
55
  });
 
 
 
 
 
 
 
 
 
 
56
  });
57
  </script>
32
  }
33
  jQuery(document).ready(function () {
34
  setTimeout(function () {
35
+ calcHeight();
 
36
  });
37
  jQuery('.sgpb-options-content, .sgpb-options-menu').click(function(){
38
  setTimeout(function(){
39
+ calcHeight();
 
40
  }, 500);
41
  });
42
  jQuery('.sgpb-options-menu').click(function () {
51
  }, 500);
52
  location.hash = jQuery(this).attr('id');
53
  });
54
+ jQuery(document.body).on( 'click.postboxes', function() {
55
+ calcHeight();
56
+ });
57
+ function calcHeight() {
58
+ let minHeightShouldBe = 0;
59
+ if (!jQuery( '.postbox' ).hasClass('closed')) {
60
+ minHeightShouldBe = parseInt(jQuery('.sgpb-options-menu-active').next().height())+100;
61
+ }
62
+ jQuery('#allMetaboxesView').css('min-height', minHeightShouldBe+'px');
63
+ }
64
  });
65
  </script>
readme.txt CHANGED
@@ -8,7 +8,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
8
  Requires at least: 4.2
9
  Tested up to: 5.9
10
  Requires PHP: 5.3.3
11
- Stable tag: 4.0.9
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
@@ -145,6 +145,10 @@ Go to the Popup Builder settings and set your desired options.
145
 
146
  == Changelog ==
147
 
 
 
 
 
148
  = Version 4.0.9 =
149
  * Security improvements and fixes.
150
 
@@ -494,4 +498,4 @@ Leave us a good review :)
494
 
495
  == Upgrade Notice ==
496
 
497
- Current Version of Popup Builder is 4.0.8
8
  Requires at least: 4.2
9
  Tested up to: 5.9
10
  Requires PHP: 5.3.3
11
+ Stable tag: 4.1.0
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
145
 
146
  == Changelog ==
147
 
148
+ = Version 4.1.0 =
149
+ * Code improvements.
150
+ * Minor fixes.
151
+
152
  = Version 4.0.9 =
153
  * Security improvements and fixes.
154
 
498
 
499
  == Upgrade Notice ==
500
 
501
+ Current Version of Popup Builder is 4.1.0