Popup Builder – Responsive WordPress Pop up - Version 3.57

Version Description

Current Version of Popup Builder is 3.57

Download this release

Release Info

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

Code changes from version 3.56 to 3.57

PopupBuilderInit.php CHANGED
@@ -94,6 +94,7 @@ class PopupBuilderInit
94
 
95
  public function deactivate()
96
  {
 
97
  AdminHelper::removeSelectedTypeOptions('cron');
98
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
99
  $pluginName = SG_POPUP_FILE_NAME;
94
 
95
  public function deactivate()
96
  {
97
+ Functions::clearAllTransients();
98
  AdminHelper::removeSelectedTypeOptions('cron');
99
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
100
  $pluginName = SG_POPUP_FILE_NAME;
com/classes/Actions.php CHANGED
@@ -30,6 +30,7 @@ class Actions
30
  add_action('admin_notices', array($this, 'pluginNotices'));
31
  add_action('admin_notices', array($this, 'promotionalBanner'), 10);
32
  add_action('admin_init', array($this, 'pluginLoaded'));
 
33
  // activate extensions
34
  add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
35
  add_action('admin_head', array($this, 'hidePageBuilderEditButtons'));
@@ -60,6 +61,15 @@ class Actions
60
  new Ajax();
61
  }
62
 
 
 
 
 
 
 
 
 
 
63
  public function showPreviewButtonAfterPopupPublish()
64
  {
65
  $currentPostType = AdminHelper::getCurrentPostType();
@@ -785,6 +795,7 @@ class Actions
785
 
786
  public function savePost($postId = 0, $post = array(), $update = false)
787
  {
 
788
  $postData = SGPopup::parsePopupDataFromData($_POST);
789
  $saveMode = '';
790
  $postData['sgpb-post-id'] = $postId;
30
  add_action('admin_notices', array($this, 'pluginNotices'));
31
  add_action('admin_notices', array($this, 'promotionalBanner'), 10);
32
  add_action('admin_init', array($this, 'pluginLoaded'));
33
+ add_action('transition_post_status', array($this, 'deletePopup'));
34
  // activate extensions
35
  add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
36
  add_action('admin_head', array($this, 'hidePageBuilderEditButtons'));
61
  new Ajax();
62
  }
63
 
64
+ public function deletePopup($newStatus, $oldStatus, $post)
65
+ {
66
+ $currentPostType = AdminHelper::getCurrentPostType();
67
+
68
+ if (!empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
69
+ Functions::clearAllTransients();
70
+ }
71
+ }
72
+
73
  public function showPreviewButtonAfterPopupPublish()
74
  {
75
  $currentPostType = AdminHelper::getCurrentPostType();
795
 
796
  public function savePost($postId = 0, $post = array(), $update = false)
797
  {
798
+ Functions::clearAllTransients();
799
  $postData = SGPopup::parsePopupDataFromData($_POST);
800
  $saveMode = '';
801
  $postData['sgpb-post-id'] = $postId;
com/classes/PopupLoader.php CHANGED
@@ -91,6 +91,7 @@ class PopupLoader
91
  global $post;
92
  $foundPopup = $post;
93
  }
 
94
  if (!empty($foundPopup)) {
95
  global $SGPB_DATA_CONFIG_ARRAY;
96
  if (@$post->post_type == SG_POPUP_POST_TYPE) {
@@ -121,15 +122,15 @@ class PopupLoader
121
  }
122
  }
123
 
124
- $popupBuilderPosts = get_transient('sgpbLoadPopups');
125
- if (($popupBuilderPosts = get_transient('sgpbLoadPopups')) === false) {
126
  $popupBuilderPosts = new WP_Query(
127
  array(
128
  'post_type' => SG_POPUP_POST_TYPE,
129
  'posts_per_page' => 100
130
  )
131
  );
132
- set_transient('sgpbLoadPopups', $popupBuilderPosts, 60 * MINUTE_IN_SECONDS);
133
  }
134
 
135
  // We check all the popups one by one to realize whether they might be loaded or not.
91
  global $post;
92
  $foundPopup = $post;
93
  }
94
+
95
  if (!empty($foundPopup)) {
96
  global $SGPB_DATA_CONFIG_ARRAY;
97
  if (@$post->post_type == SG_POPUP_POST_TYPE) {
122
  }
123
  }
124
 
125
+ $popupBuilderPosts = get_transient(SGPB_TRANSIENT_POPUPS_LOAD);
126
+ if ($popupBuilderPosts === false) {
127
  $popupBuilderPosts = new WP_Query(
128
  array(
129
  'post_type' => SG_POPUP_POST_TYPE,
130
  'posts_per_page' => 100
131
  )
132
  );
133
+ set_transient(SGPB_TRANSIENT_POPUPS_LOAD, $popupBuilderPosts, SGPB_TRANSIENT_TIMEOUT_WEEK);
134
  }
135
 
136
  // We check all the popups one by one to realize whether they might be loaded or not.
com/classes/popups/SGPopup.php CHANGED
@@ -1305,7 +1305,7 @@ abstract class SGPopup
1305
  $popupIds = array();
1306
 
1307
  $termPopups = get_transient('getPopupsByTermSlug');
1308
- if (($termPopups = get_transient('getPopupsByTermSlug')) === false) {
1309
  $termPopups = get_posts(
1310
  array(
1311
  'post_type' => 'popupbuilder',
@@ -1319,7 +1319,7 @@ abstract class SGPopup
1319
  )
1320
  )
1321
  );
1322
- set_transient('getPopupsByTermSlug', $termPopups, 60 * MINUTE_IN_SECONDS);
1323
  }
1324
 
1325
  if (empty($termPopups)) {
1305
  $popupIds = array();
1306
 
1307
  $termPopups = get_transient('getPopupsByTermSlug');
1308
+ if ($termPopups === false) {
1309
  $termPopups = get_posts(
1310
  array(
1311
  'post_type' => 'popupbuilder',
1319
  )
1320
  )
1321
  );
1322
+ set_transient(SGPB_TRANSIENT_POPUPS_TERMS, $termPopups, SGPB_TRANSIENT_TIMEOUT_WEEK);
1323
  }
1324
 
1325
  if (empty($termPopups)) {
com/config/config.php CHANGED
@@ -131,6 +131,10 @@ class SgpbPopupConfig
131
  self::addDefine('SGPB_SUBSCRIPTION_EMAIL_MESSAGE', __('Please enter a valid email address', SG_POPUP_TEXT_DOMAIN).'.');
132
  self::addDefine('SGPB_TRANSIENT_TIMEOUT_HOUR', 60 * MINUTE_IN_SECONDS);
133
  self::addDefine('SGPB_TRANSIENT_TIMEOUT_DAY', 24 * HOUR_IN_SECONDS);
 
 
 
 
134
  self::popupTypesInit();
135
  }
136
 
131
  self::addDefine('SGPB_SUBSCRIPTION_EMAIL_MESSAGE', __('Please enter a valid email address', SG_POPUP_TEXT_DOMAIN).'.');
132
  self::addDefine('SGPB_TRANSIENT_TIMEOUT_HOUR', 60 * MINUTE_IN_SECONDS);
133
  self::addDefine('SGPB_TRANSIENT_TIMEOUT_DAY', 24 * HOUR_IN_SECONDS);
134
+ self::addDefine('SGPB_TRANSIENT_TIMEOUT_WEEK', 7 * DAY_IN_SECONDS);
135
+ self::addDefine('SGPB_TRANSIENT_POPUPS_LOAD', 'sgpbLoadPopups');
136
+ self::addDefine('SGPB_TRANSIENT_POPUPS_TERMS', 'sgpbGetPopupsByTermSlug');
137
+ self::addDefine('SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES', 'sgpbGetPostsAllCategories');
138
  self::popupTypesInit();
139
  }
140
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.56');
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', '3.57');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -7,6 +7,7 @@ class SgpbDataConfig
7
  {
8
  self::addFilters();
9
  self::conditionInit();
 
10
  self::popupDefaultOptions();
11
  }
12
 
@@ -950,4 +951,17 @@ class SgpbDataConfig
950
  {
951
  ConfigDataHelper::addFilters();
952
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
953
  }
7
  {
8
  self::addFilters();
9
  self::conditionInit();
10
+ self::transientConfig();
11
  self::popupDefaultOptions();
12
  }
13
 
951
  {
952
  ConfigDataHelper::addFilters();
953
  }
954
+
955
+ public static function transientConfig()
956
+ {
957
+ global $SGPB_TRANSIENT_CONFIG;
958
+
959
+ $SGPB_TRANSIENT_CONFIG = array(
960
+ SGPB_TRANSIENT_POPUPS_LOAD,
961
+ SGPB_TRANSIENT_POPUPS_TERMS,
962
+ SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES
963
+ );
964
+
965
+ $SGPB_TRANSIENT_CONFIG = apply_filters('sgpbAllTransients', $SGPB_TRANSIENT_CONFIG);
966
+ }
967
  }
com/helpers/AdminHelper.php CHANGED
@@ -1939,8 +1939,14 @@ class AdminHelper
1939
  foreach ($registered as $singleExntensionData) {
1940
  $key = $singleExntensionData['options']['licence']['key'];
1941
  $name = $singleExntensionData['options']['licence']['itemName'];
1942
- $licenseKey = (empty(self::getOption('sgpb-license-key-'.$key))) ? 'No license' : self::getOption('sgpb-license-key-'.$key);
1943
- $licenseStatus = (self::getOption('sgpb-license-status-'.$key) == 'valid') ? 'Active' : 'Inactive';
 
 
 
 
 
 
1944
 
1945
  $systemInfoContent .= 'Name: '.$name."\n";
1946
  $systemInfoContent .= 'License key: '.$licenseKey."\n";
1939
  foreach ($registered as $singleExntensionData) {
1940
  $key = $singleExntensionData['options']['licence']['key'];
1941
  $name = $singleExntensionData['options']['licence']['itemName'];
1942
+ $licenseKey = 'No license';
1943
+ if (!empty(self::getOption('sgpb-license-key-'.$key))) {
1944
+ $licenseKey = self::getOption('sgpb-license-key-'.$key);
1945
+ }
1946
+ $licenseStatus = 'Inactive';
1947
+ if (self::getOption('sgpb-license-status-'.$key) == 'valid') {
1948
+ $licenseStatus = 'Active';
1949
+ }
1950
 
1951
  $systemInfoContent .= 'Name: '.$name."\n";
1952
  $systemInfoContent .= 'License key: '.$licenseKey."\n";
com/helpers/ConfigDataHelper.php CHANGED
@@ -158,8 +158,8 @@ class ConfigDataHelper
158
 
159
  public static function getPostsAllCategories($postType = 'post', $taxonomies = array())
160
  {
161
- $cats = get_transient('getPostsAllCategories');
162
- if (($cats = get_transient('getPostsAllCategories')) === false) {
163
  $cats = get_terms(
164
  array(
165
  'taxonomy' => $taxonomies,
@@ -169,7 +169,7 @@ class ConfigDataHelper
169
  'order' => 'ASC'
170
  )
171
  );
172
- set_transient('getPostsAllCategories', $cats, SGPB_TRANSIENT_TIMEOUT_HOUR);
173
  }
174
 
175
  $supportedTaxonomies = array('category');
158
 
159
  public static function getPostsAllCategories($postType = 'post', $taxonomies = array())
160
  {
161
+ $cats = get_transient(SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES);
162
+ if ($cats === false) {
163
  $cats = get_terms(
164
  array(
165
  'taxonomy' => $taxonomies,
169
  'order' => 'ASC'
170
  )
171
  );
172
+ set_transient(SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES, $cats, SGPB_TRANSIENT_TIMEOUT_WEEK);
173
  }
174
 
175
  $supportedTaxonomies = array('category');
com/helpers/Functions.php CHANGED
@@ -249,4 +249,13 @@ class Functions
249
 
250
  return $ipAddress;
251
  }
 
 
 
 
 
 
 
 
 
252
  }
249
 
250
  return $ipAddress;
251
  }
252
+
253
+ public static function clearAllTransients()
254
+ {
255
+ global $SGPB_TRANSIENT_CONFIG;
256
+
257
+ foreach ($SGPB_TRANSIENT_CONFIG as $eachTransient) {
258
+ delete_transient($eachTransient);
259
+ }
260
+ }
261
  }
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: 3.56
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: 3.57
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
readme.txt CHANGED
@@ -9,7 +9,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.56
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,6 +185,10 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
188
  = Version 3.56 =
189
  * Transient name changed.
190
  * Max loaded popups limit increased.
@@ -1103,7 +1107,7 @@ Leave us a good review :)
1103
 
1104
  == Upgrade Notice ==
1105
 
1106
- Current Version of Popup Builder is 3.55
1107
 
1108
  == Other Notes ==
1109
 
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.57
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
185
 
186
  == Changelog ==
187
 
188
+ = Version 3.57 =
189
+ * Bug fixed related to get_option function.
190
+ * Popup cache improvements.
191
+
192
  = Version 3.56 =
193
  * Transient name changed.
194
  * Max loaded popups limit increased.
1107
 
1108
  == Upgrade Notice ==
1109
 
1110
+ Current Version of Popup Builder is 3.57
1111
 
1112
  == Other Notes ==
1113