Popup Builder – Responsive WordPress Pop up - Version 3.69.2

Version Description

Current Version of Popup Builder is 3.69.2

Download this release

Release Info

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

Code changes from version 3.69.1 to 3.69.2

PopupBuilderInit.php CHANGED
@@ -62,6 +62,7 @@ class PopupBuilderInit
62
  require_once(SG_POPUP_CLASSES_PATH.'RegisterPostType.php');
63
  require_once(SG_POPUP_CLASSES_PATH.'Ajax.php');
64
  require_once(SG_POPUP_CLASSES_PATH.'ConvertToNewVersion.php');
 
65
  require_once(SG_POPUP_CLASSES_PATH.'Filters.php');
66
  require_once(SG_POPUP_CLASSES_PATH.'Actions.php');
67
  require_once(SG_POPUP_LIBS_PATH.'Table.php');
62
  require_once(SG_POPUP_CLASSES_PATH.'RegisterPostType.php');
63
  require_once(SG_POPUP_CLASSES_PATH.'Ajax.php');
64
  require_once(SG_POPUP_CLASSES_PATH.'ConvertToNewVersion.php');
65
+ require_once(SG_POPUP_LIBS_PATH.'Reports.php');
66
  require_once(SG_POPUP_CLASSES_PATH.'Filters.php');
67
  require_once(SG_POPUP_CLASSES_PATH.'Actions.php');
68
  require_once(SG_POPUP_LIBS_PATH.'Table.php');
com/classes/Actions.php CHANGED
@@ -59,6 +59,7 @@ class Actions
59
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
60
  add_action('wpml_loaded', array($this, 'wpmlRelatedActions'));
61
  new SGPBFeedback();
 
62
  new Ajax();
63
  }
64
 
@@ -1140,7 +1141,9 @@ class Actions
1140
  $metaValues = get_post_custom_values($metaKey, $post->ID);
1141
  foreach ($metaValues as $metaValue) {
1142
  $metaValue = maybe_unserialize($metaValue);
1143
- $metaValue['sgpb-post-id'] = $newId;
 
 
1144
  add_post_meta($newId, $metaKey, $this->popupWpSlash($metaValue));
1145
  }
1146
  }
@@ -1278,14 +1281,19 @@ class Actions
1278
 
1279
  $postData = $_POST;
1280
  $deleteData = 0;
 
1281
 
1282
  if (isset($postData['sgpb-dont-delete-data'])) {
1283
  $deleteData = 1;
1284
  }
 
 
 
1285
  $userRoles = @$postData['sgpb-user-roles'];
1286
 
1287
  update_option('sgpb-user-roles', $userRoles);
1288
  update_option('sgpb-dont-delete-data', $deleteData);
 
1289
 
1290
  AdminHelper::filterUserCapabilitiesForTheUserRoles('save');
1291
 
59
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
60
  add_action('wpml_loaded', array($this, 'wpmlRelatedActions'));
61
  new SGPBFeedback();
62
+ new SGPBReports();
63
  new Ajax();
64
  }
65
 
1141
  $metaValues = get_post_custom_values($metaKey, $post->ID);
1142
  foreach ($metaValues as $metaValue) {
1143
  $metaValue = maybe_unserialize($metaValue);
1144
+ if (is_array($metaValue)) {
1145
+ $metaValue['sgpb-post-id'] = $newId;
1146
+ }
1147
  add_post_meta($newId, $metaKey, $this->popupWpSlash($metaValue));
1148
  }
1149
  }
1281
 
1282
  $postData = $_POST;
1283
  $deleteData = 0;
1284
+ $enableDebugMode = 0;
1285
 
1286
  if (isset($postData['sgpb-dont-delete-data'])) {
1287
  $deleteData = 1;
1288
  }
1289
+ if (isset($postData['sgpb-enable-debug-mode'])) {
1290
+ $enableDebugMode = 1;
1291
+ }
1292
  $userRoles = @$postData['sgpb-user-roles'];
1293
 
1294
  update_option('sgpb-user-roles', $userRoles);
1295
  update_option('sgpb-dont-delete-data', $deleteData);
1296
+ update_option('sgpb-enable-debug-mode', $enableDebugMode);
1297
 
1298
  AdminHelper::filterUserCapabilitiesForTheUserRoles('save');
1299
 
com/classes/Ajax.php CHANGED
@@ -155,8 +155,13 @@ class Ajax
155
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
156
 
157
  global $wpdb;
 
 
158
  $popupId = (int)$_POST['popupId'];
159
  $allPopupsCount = get_option('SgpbCounter');
 
 
 
160
  if (empty($allPopupsCount)) {
161
  echo SGPB_AJAX_STATUS_FALSE;
162
  wp_die();
@@ -164,6 +169,7 @@ class Ajax
164
  if (isset($allPopupsCount[$popupId])) {
165
  $allPopupsCount[$popupId] = 0;
166
  }
 
167
  // 7, 12, 13 => exclude close, subscription success, contact success events
168
  $stmt = $wpdb->prepare(' DELETE FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (7, 12, 13)', $popupId);
169
  $popupAnalyticsData = $wpdb->get_var($stmt);
155
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
156
 
157
  global $wpdb;
158
+
159
+ $tableName = $wpdb->prefix.'sgpb_analytics';
160
  $popupId = (int)$_POST['popupId'];
161
  $allPopupsCount = get_option('SgpbCounter');
162
+ if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") == $tableName) {
163
+ SGPopup::deleteAnalyticsDataByPopupId($popupId);
164
+ }
165
  if (empty($allPopupsCount)) {
166
  echo SGPB_AJAX_STATUS_FALSE;
167
  wp_die();
169
  if (isset($allPopupsCount[$popupId])) {
170
  $allPopupsCount[$popupId] = 0;
171
  }
172
+
173
  // 7, 12, 13 => exclude close, subscription success, contact success events
174
  $stmt = $wpdb->prepare(' DELETE FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (7, 12, 13)', $popupId);
175
  $popupAnalyticsData = $wpdb->get_var($stmt);
com/classes/Filters.php CHANGED
@@ -55,11 +55,20 @@ class Filters
55
  add_filter('sgpbFilterOptionsBeforeSaving', array($this, 'filterOptionsBeforeSaving'), 100, 1);
56
  add_filter('sgpbPopupExtraData', array($this, 'popupExtraDataRender'), 100, 2);
57
  add_filter('wpml_link_to_translation', array($this, 'linkToTranslationWpml'), 30, 4);
 
 
 
 
 
 
 
 
58
  }
59
 
60
  public function linkToTranslationWpml($link, $postId, $lang, $trid)
61
  {
62
  if (strpos($link, SG_POPUP_POST_TYPE) && strpos($link, 'source_lang') && isset($trid)) {
 
63
  $popupType = 'html';
64
  $popup = SGPopup::find($postId);
65
  if (!empty($popup) || !is_object($popup)) {
55
  add_filter('sgpbFilterOptionsBeforeSaving', array($this, 'filterOptionsBeforeSaving'), 100, 1);
56
  add_filter('sgpbPopupExtraData', array($this, 'popupExtraDataRender'), 100, 2);
57
  add_filter('wpml_link_to_translation', array($this, 'linkToTranslationWpml'), 30, 4);
58
+ add_filter('pll_get_post_types', array($this, 'enablePBpostTypeForTranslating'), 10, 2);
59
+ }
60
+
61
+ public function enablePBpostTypeForTranslating($postTypes, $isSettings)
62
+ {
63
+ $post_types[SG_POPUP_POST_TYPE] = SG_POPUP_POST_TYPE;
64
+
65
+ return $post_types;
66
  }
67
 
68
  public function linkToTranslationWpml($link, $postId, $lang, $trid)
69
  {
70
  if (strpos($link, SG_POPUP_POST_TYPE) && strpos($link, 'source_lang') && isset($trid)) {
71
+
72
  $popupType = 'html';
73
  $popup = SGPopup::find($postId);
74
  if (!empty($popup) || !is_object($popup)) {
com/classes/Javascript.php CHANGED
@@ -66,9 +66,8 @@ class Javascript
66
  }
67
 
68
  $classObj = new $pluginData['className']();
69
- $extensionInterface = 'SgpbIPopupExtension';
70
 
71
- if(!$classObj instanceof $extensionInterface) {
72
  continue;
73
  }
74
  $args = array(
66
  }
67
 
68
  $classObj = new $pluginData['className']();
 
69
 
70
+ if(!$classObj instanceof \SgpbIPopupExtension) {
71
  continue;
72
  }
73
  $args = array(
com/classes/PopupChecker.php CHANGED
@@ -73,6 +73,9 @@ class PopupChecker
73
 
74
  if (isset($popupOptions['sgpb-is-active'])) {
75
  $isActive = $popupOptions['sgpb-is-active'];
 
 
 
76
  }
77
 
78
  if (!$isActive) {
@@ -93,6 +96,7 @@ class PopupChecker
93
  private function allowToLoad()
94
  {
95
  $isCustomInserted = $this->isCustomInserted();
 
96
  $insertedModes = array(
97
  'attr_event' => false,
98
  'option_event' => false
@@ -178,6 +182,8 @@ class PopupChecker
178
  }
179
  }
180
 
 
 
181
  return true;
182
  }
183
 
@@ -190,7 +196,6 @@ class PopupChecker
190
  if ($paramName == 'select_role') {
191
  return true;
192
  }
193
-
194
  if (!$defaultStatus && do_action('isAllowedForConditions', $option, $post)) {
195
  $defaultStatus = true;
196
  }
@@ -623,6 +628,6 @@ class PopupChecker
623
  }
624
  }
625
 
626
- return true;
627
  }
628
  }
73
 
74
  if (isset($popupOptions['sgpb-is-active'])) {
75
  $isActive = $popupOptions['sgpb-is-active'];
76
+ if ($isActive) {
77
+ $popup->setReportData($popup->getId());
78
+ }
79
  }
80
 
81
  if (!$isActive) {
96
  private function allowToLoad()
97
  {
98
  $isCustomInserted = $this->isCustomInserted();
99
+
100
  $insertedModes = array(
101
  'attr_event' => false,
102
  'option_event' => false
182
  }
183
  }
184
 
185
+
186
+
187
  return true;
188
  }
189
 
196
  if ($paramName == 'select_role') {
197
  return true;
198
  }
 
199
  if (!$defaultStatus && do_action('isAllowedForConditions', $option, $post)) {
200
  $defaultStatus = true;
201
  }
628
  }
629
  }
630
 
631
+ return apply_filters('checkOtherConditions', true);
632
  }
633
  }
com/classes/PopupLoader.php CHANGED
@@ -100,37 +100,31 @@ class PopupLoader
100
  global $post;
101
  $foundPopup = $post;
102
  }
103
-
104
  if (!empty($foundPopup)) {
105
  global $SGPB_DATA_CONFIG_ARRAY;
106
- if (@$post->post_type == SG_POPUP_POST_TYPE) {
 
107
  $targets = array($SGPB_DATA_CONFIG_ARRAY['target']['initialData']);
108
-
109
  // for any targets preview popup should open
110
  if (!empty($targets[0][0])) {
111
  $targets[0][0]['param'] = 'post_all';
112
  }
113
 
114
- $popup = SGPopup::find($post);
115
- if (is_object($popup)) {
116
- $popup->setTarget($targets);
117
- }
118
- }
119
- if (@$foundPopup->post_type == SG_POPUP_POST_TYPE) {
120
  $popup = SGPopup::find($foundPopup);
121
  if (empty($popup)) {
122
  return;
123
  }
 
 
124
 
125
- $popup->setEvents($SGPB_DATA_CONFIG_ARRAY['events']['initialData'][0]);
126
  $this->addLoadablePopup($popup);
127
  $this->doGroupFiltersPopups();
128
  $popups = $this->getLoadablePopups();
129
-
130
  $scriptsLoader = new ScriptsLoader();
131
  $scriptsLoader->setLoadablePopups($popups);
132
  $scriptsLoader->loadToFooter();
133
  return;
 
134
  }
135
  }
136
 
100
  global $post;
101
  $foundPopup = $post;
102
  }
 
103
  if (!empty($foundPopup)) {
104
  global $SGPB_DATA_CONFIG_ARRAY;
105
+ if (@$foundPopup->post_type == SG_POPUP_POST_TYPE) {
106
+ $events = $SGPB_DATA_CONFIG_ARRAY['events']['initialData'][0];
107
  $targets = array($SGPB_DATA_CONFIG_ARRAY['target']['initialData']);
 
108
  // for any targets preview popup should open
109
  if (!empty($targets[0][0])) {
110
  $targets[0][0]['param'] = 'post_all';
111
  }
112
 
 
 
 
 
 
 
113
  $popup = SGPopup::find($foundPopup);
114
  if (empty($popup)) {
115
  return;
116
  }
117
+ $popup->setTarget($targets);
118
+ $popup->setEvents($events);
119
 
 
120
  $this->addLoadablePopup($popup);
121
  $this->doGroupFiltersPopups();
122
  $popups = $this->getLoadablePopups();
 
123
  $scriptsLoader = new ScriptsLoader();
124
  $scriptsLoader->setLoadablePopups($popups);
125
  $scriptsLoader->loadToFooter();
126
  return;
127
+
128
  }
129
  }
130
 
com/classes/ScriptsLoader.php CHANGED
@@ -91,6 +91,7 @@ class ScriptsLoader
91
  $popupContent = apply_filters('sgpbPopupContentLoadToPage', $popup->getPopupTypeContent(), $popupId);
92
 
93
  $events = $popup->getPopupAllEvents($postId, $popupId, $popup);
 
94
  // if popup's data has already loaded into the page with the same event
95
  if (isset(self::$alreadyLoadedPopups[$popupId])) {
96
  if (self::$alreadyLoadedPopups[$popupId] == $events) {
@@ -106,10 +107,12 @@ class ScriptsLoader
106
  }
107
  }
108
  }
 
109
  self::$alreadyLoadedPopups[$popupId] = $events;
110
  $events = json_encode($events);
111
  $currentUseOptions = $popup->getOptions();
112
  $extraContent = apply_filters('sgpbPopupExtraData', $popupId, $currentUseOptions);
 
113
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
114
  $popupOptions = apply_filters('sgpbLoadToFooterOptions', $popupOptions);
115
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent, $extraContent) {
@@ -191,9 +194,8 @@ class ScriptsLoader
191
  require_once($classPath);
192
 
193
  $classObj = new $pluginData['className']();
194
- $extensionInterface = 'SgpbIPopupExtension';
195
 
196
- if (!$classObj instanceof $extensionInterface) {
197
  continue;
198
  }
199
 
@@ -292,9 +294,8 @@ class ScriptsLoader
292
  require_once($classPath);
293
 
294
  $classObj = new $pluginData['className']();
295
- $extensionInterface = 'SgpbIPopupExtension';
296
 
297
- if (!$classObj instanceof $extensionInterface) {
298
  continue;
299
  }
300
 
91
  $popupContent = apply_filters('sgpbPopupContentLoadToPage', $popup->getPopupTypeContent(), $popupId);
92
 
93
  $events = $popup->getPopupAllEvents($postId, $popupId, $popup);
94
+
95
  // if popup's data has already loaded into the page with the same event
96
  if (isset(self::$alreadyLoadedPopups[$popupId])) {
97
  if (self::$alreadyLoadedPopups[$popupId] == $events) {
107
  }
108
  }
109
  }
110
+
111
  self::$alreadyLoadedPopups[$popupId] = $events;
112
  $events = json_encode($events);
113
  $currentUseOptions = $popup->getOptions();
114
  $extraContent = apply_filters('sgpbPopupExtraData', $popupId, $currentUseOptions);
115
+
116
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
117
  $popupOptions = apply_filters('sgpbLoadToFooterOptions', $popupOptions);
118
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent, $extraContent) {
194
  require_once($classPath);
195
 
196
  $classObj = new $pluginData['className']();
 
197
 
198
+ if (!$classObj instanceof \SgpbIPopupExtension) {
199
  continue;
200
  }
201
 
294
  require_once($classPath);
295
 
296
  $classObj = new $pluginData['className']();
 
297
 
298
+ if (!$classObj instanceof \SgpbIPopupExtension) {
299
  continue;
300
  }
301
 
com/classes/Style.php CHANGED
@@ -67,9 +67,8 @@ class Style
67
  }
68
 
69
  $classObj = new $pluginData['className']();
70
- $extensionInterface = 'SgpbIPopupExtension';
71
 
72
- if (!$classObj instanceof $extensionInterface) {
73
  continue;
74
  }
75
  $args = array(
67
  }
68
 
69
  $classObj = new $pluginData['className']();
 
70
 
71
+ if (!$classObj instanceof \SgpbIPopupExtension) {
72
  continue;
73
  }
74
  $args = array(
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -253,10 +253,9 @@ class SgpbPopupExtension implements SgpbIPopupExtension
253
  $translatedData = ConfigDataHelper::getJsLocalizedData();
254
  $jsFiles = array();
255
  $localizeData = array();
256
- $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
257
- $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js');
258
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js', 'dep' => array('Popup.js'));
259
- $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilder.js', 'dep' => array('jquery'));
260
  if (SGPB_POPUP_PKG >= SGPB_POPUP_PKG_SILVER) {
261
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilderProFunctionality.js', 'dep' => array('jquery'));
262
  }
253
  $translatedData = ConfigDataHelper::getJsLocalizedData();
254
  $jsFiles = array();
255
  $localizeData = array();
256
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js', 'dep' => array('jquery'));
 
257
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js', 'dep' => array('Popup.js'));
258
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilder.js', 'dep' => array('PopupConfig.js'));
259
  if (SGPB_POPUP_PKG >= SGPB_POPUP_PKG_SILVER) {
260
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupBuilderProFunctionality.js', 'dep' => array('jquery'));
261
  }
com/classes/popups/SGPopup.php CHANGED
@@ -138,6 +138,18 @@ abstract class SGPopup
138
  }
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  public function getPopupAllEvents($postId, $popupId, $popupObj = false)
142
  {
143
  $events = array();
@@ -1671,10 +1683,16 @@ abstract class SGPopup
1671
  // 7, 12, 13 => exclude close, subscription success, contact success events
1672
  $stmt = $wpdb->prepare('SELECT COUNT(*) FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (7, 12, 13)', $popupId);
1673
  $popupAnalyticsData = $wpdb->get_var($stmt);
1674
-
1675
  return $popupAnalyticsData;
1676
  }
1677
 
 
 
 
 
 
 
 
1678
  public static function getActivePopupsQueryString()
1679
  {
1680
  $activePopupsQuery = '';
138
  }
139
  }
140
 
141
+ public function setReportData($popupId)
142
+ {
143
+ $events = $this->getEvents();
144
+ $options = $this->getOptions();
145
+ $targets = $this->getTarget();
146
+ $conditions = $this->getConditions();
147
+ do_action('sgpbDebugReportUpdate', 'options', $options, $popupId);
148
+ do_action('sgpbDebugReportUpdate', 'events', $events, $popupId);
149
+ do_action('sgpbDebugReportUpdate', 'targets', $targets, $popupId);
150
+ do_action('sgpbDebugReportUpdate', 'conditions', $conditions, $popupId);
151
+ }
152
+
153
  public function getPopupAllEvents($postId, $popupId, $popupObj = false)
154
  {
155
  $events = array();
1683
  // 7, 12, 13 => exclude close, subscription success, contact success events
1684
  $stmt = $wpdb->prepare('SELECT COUNT(*) FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (7, 12, 13)', $popupId);
1685
  $popupAnalyticsData = $wpdb->get_var($stmt);
 
1686
  return $popupAnalyticsData;
1687
  }
1688
 
1689
+ public static function deleteAnalyticsDataByPopupId($popupId)
1690
+ {
1691
+ global $wpdb;
1692
+ $prepareSql = $wpdb->prepare('DELETE FROM '.$wpdb->prefix.'sgpb_analytics WHERE target_id = %d AND event_id NOT IN (7, 12, 13) LIMIT 100', $popupId);
1693
+ $wpdb->query($prepareSql);
1694
+ }
1695
+
1696
  public static function getActivePopupsQueryString()
1697
  {
1698
  $activePopupsQuery = '';
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.69.1');
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.69.2');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/libs/Reports.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class SGPBReports
5
+ {
6
+ private $type = 'debug';
7
+ private $reports = array();
8
+
9
+ public function __construct()
10
+ {
11
+ $this->init();
12
+ }
13
+
14
+ public function init()
15
+ {
16
+ $debugModeEnabled = AdminHelper::getOption('sgpb-enable-debug-mode');
17
+ if ($debugModeEnabled == 1) {
18
+ add_action('sgpbDebugReportUpdate', array($this, 'updateReport'), 10, 3);
19
+ $this->render();
20
+ }
21
+ }
22
+
23
+ public static function updateReport($key = '', $value = '', $popupId = 0)
24
+ {
25
+ global $SGPB_DEBUG_POPUP_BUILDER_DETAILS;
26
+ $value = $this->filterOptions($key, $value);
27
+ $SGPB_DEBUG_POPUP_BUILDER_DETAILS[$popupId][$key] = $value;
28
+ $this->updateCookiesReportForCurrentPopup($popupId);
29
+ }
30
+
31
+ public function render()
32
+ {
33
+ add_action('wp_footer', array($this, 'renderReportData'));
34
+ }
35
+
36
+ public function renderReportData()
37
+ {
38
+ require_once(SG_POPUP_VIEWS_PATH.'debugReport.php');
39
+ }
40
+
41
+ public function filterOptions($key, $options)
42
+ {
43
+ $result = array();
44
+ if (empty($options)) {
45
+ return $result;
46
+ }
47
+
48
+ $optionsShouldBeConverted = array(
49
+ 'options',
50
+ 'events',
51
+ 'conditions',
52
+ 'targets'
53
+ );
54
+
55
+ if (!in_array($key, $optionsShouldBeConverted)) {
56
+ return $options;
57
+ }
58
+ foreach ($options as $optionKey => $optionValue) {
59
+ // when $key is 'events' or 'conditions'
60
+ if (!is_array($optionValue) && $key != 'options') {
61
+ $result[$optionKey]['name'] = $optionValue;
62
+ }
63
+ if (isset($optionValue['param'])) {
64
+ $result[$optionKey]['name'] = $optionValue['param'];
65
+ }
66
+ if (isset($optionValue['value'])) {
67
+ $result[$optionKey]['value'] = $optionValue['value'];
68
+ }
69
+ if (isset($optionValue['operator'])) {
70
+ if ($optionValue['operator'] == '==') {
71
+ $optionValue['operator'] = 'is';
72
+ }
73
+ else if ($optionValue['operator'] == '!=') {
74
+ $optionValue['operator'] == 'is not';
75
+ }
76
+ $result[$optionKey]['operator'] = $optionValue['operator'];
77
+ }
78
+
79
+ if ($key == 'options') {
80
+ // popup limitation
81
+ if ($optionKey == 'sgpb-show-popup-same-user') {
82
+ $result[]['popupLimitationCount'] = $options['sgpb-show-popup-same-user-count'];
83
+ $result[]['popupLimitatioExpiry'] = $options['sgpb-show-popup-same-user-expiry'];
84
+ if (isset($options['sgpb-show-popup-same-user-page-level'])) {
85
+ $result[]['pageLevelCookie'] = $options['sgpb-show-popup-same-user-page-level'];
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ return $result;
92
+ }
93
+
94
+ public function updateCookiesReportForCurrentPopup($popupId = 0)
95
+ {
96
+ global $SGPB_DEBUG_POPUP_BUILDER_DETAILS;
97
+
98
+ foreach ($_COOKIE as $cookieName => $cookieValue) {
99
+ if (strpos($cookieName, (string)$popupId) != false) {
100
+ if (isset($SGPB_DEBUG_POPUP_BUILDER_DETAILS[$popupId]['cookies'][0]['name']) && $SGPB_DEBUG_POPUP_BUILDER_DETAILS[$popupId]['cookies'][0]['name'] == $cookieName) {
101
+ continue;
102
+ }
103
+ $SGPB_DEBUG_POPUP_BUILDER_DETAILS[$popupId]['cookies'][] = array('name' => $cookieName, 'value' => 'exists');
104
+ }
105
+ }
106
+ }
107
+
108
+ }
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.69.1
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.69.2
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/theme.css CHANGED
@@ -12,7 +12,7 @@ iframe{margin:0
12
  !important;width:100%;height:100%;border:none}.sgpb-video-error-message-wrapper
13
  h1{text-align:center}.sgpb-video-error-message-wrapper h3:last-child{padding:0}#sgpb-yes-button,#sgpb-no-button{text-transform:none !important}.sg-fb-buttons-wrapper{text-align:center;min-height:25px}@media only screen and (max-width: 600px){.sgpb-scroll-wrapper{overflow:auto !important}}@media (min-width: 600px){.sgpb-fb-wrapper-standard{min-width:450px !important;overflow:hidden}}@media (min-width: 521px) and (max-width: 599px){.sgpb-fb-wrapper-standard{min-width:450px !important;overflow:scroll}#sg-facebook-like{overflow:hidden}}@media (max-width: 520px){.sgpb-fb-wrapper-standard{min-width:380px !important;max-width:380px !important;overflow:hidden}.sgpb-fb-wrapper-standard .fb-like{max-width:380px !important}#sg-facebook-like{overflow:hidden}}@media (max-width: 420px){.sgpb-fb-wrapper-standard{min-width:350px !important;max-width:350px !important;overflow:hidden}}@media (max-width: 400px){.sgpb-fb-wrapper-standard{min-width:330px !important;max-width:330px !important;overflow:scroll}}@media (max-width: 320px){.sgpb-fb-wrapper-standard{min-width:270px !important;max-width:270px !important;overflow:scroll}}.sg-hide-element{display:none}a.sg-show-popup{cursor:pointer !important}.sgpb-cursor-pointer{cursor:pointer}/*/*/.sgpb-theme-1-content{border-radius:6px;padding-bottom:0;box-shadow:rgba(0, 0, 0, 0.6) 0px 0px 0px 14px !important;border-bottom-width:35px !important;border-bottom-color:#fff !important}.sgpb-theme-4-content{padding-bottom:0;border-radius:7px !important;border-bottom-width:35px !important;border-bottom-color:#fff !important}.sgpb-popup-close-button-4{z-index:initial !important;height:auto !important}.sgpb-popup-dialog-main-div-theme-wrapper-5{border:8px
14
  solid #555;outline:1px
15
- solid #8A8A8A;background-color:#707070}.sgpb-theme-5-content{border-radius:3px !important;box-shadow:0 0 10px #222 !important}.sgpb-theme-6-content{box-shadow:#646161 0px 0px 8px 3px !important}.sgpb-popup-close-button-1:hover,.sgpb-popup-close-button-2:hover,.sgpb-popup-close-button-5:hover{z-index:initial !important;opacity:0.8}.sgpb-popup-close-button-3:hover{z-index:999999999 !important;opacity:0.9}.sgpb-popup-close-button-3{z-index:999999999 !important}.sgpb-popup-close-button-2{z-index:initial !important;border-radius:2px}.sgpb-main-image-content-wrapper
16
  img{height:auto;max-width:100%}.sgpb-overflow-hidden{width:100%;height:100%;overflow:hidden !important}.sgpb-overflow-hidden-body{width:100%;overflow:hidden !important}.sgpb-popup-content-direction-right{direction:rtl !important}.sgpb-popup-content-direction-right input[type="url"],
17
  .sgpb-popup-content-direction-right input[type="email"],
18
  .sgpb-popup-content-direction-right .sg-fb-buttons-wrapper,
12
  !important;width:100%;height:100%;border:none}.sgpb-video-error-message-wrapper
13
  h1{text-align:center}.sgpb-video-error-message-wrapper h3:last-child{padding:0}#sgpb-yes-button,#sgpb-no-button{text-transform:none !important}.sg-fb-buttons-wrapper{text-align:center;min-height:25px}@media only screen and (max-width: 600px){.sgpb-scroll-wrapper{overflow:auto !important}}@media (min-width: 600px){.sgpb-fb-wrapper-standard{min-width:450px !important;overflow:hidden}}@media (min-width: 521px) and (max-width: 599px){.sgpb-fb-wrapper-standard{min-width:450px !important;overflow:scroll}#sg-facebook-like{overflow:hidden}}@media (max-width: 520px){.sgpb-fb-wrapper-standard{min-width:380px !important;max-width:380px !important;overflow:hidden}.sgpb-fb-wrapper-standard .fb-like{max-width:380px !important}#sg-facebook-like{overflow:hidden}}@media (max-width: 420px){.sgpb-fb-wrapper-standard{min-width:350px !important;max-width:350px !important;overflow:hidden}}@media (max-width: 400px){.sgpb-fb-wrapper-standard{min-width:330px !important;max-width:330px !important;overflow:scroll}}@media (max-width: 320px){.sgpb-fb-wrapper-standard{min-width:270px !important;max-width:270px !important;overflow:scroll}}.sg-hide-element{display:none}a.sg-show-popup{cursor:pointer !important}.sgpb-cursor-pointer{cursor:pointer}/*/*/.sgpb-theme-1-content{border-radius:6px;padding-bottom:0;box-shadow:rgba(0, 0, 0, 0.6) 0px 0px 0px 14px !important;border-bottom-width:35px !important;border-bottom-color:#fff !important}.sgpb-theme-4-content{padding-bottom:0;border-radius:7px !important;border-bottom-width:35px !important;border-bottom-color:#fff !important}.sgpb-popup-close-button-4{z-index:initial !important;height:auto !important}.sgpb-popup-dialog-main-div-theme-wrapper-5{border:8px
14
  solid #555;outline:1px
15
+ solid #8A8A8A;background-color:#707070}.sgpb-theme-5-content{border-radius:3px !important;box-shadow:0 0 10px #222 !important}.sgpb-theme-6-content{box-shadow:#646161 0px 0px 8px 3px !important}.sgpb-popup-close-button-1:hover,.sgpb-popup-close-button-1:focus,.sgpb-popup-close-button-1:active,.sgpb-popup-close-button-2:hover,.sgpb-popup-close-button-5:hover{z-index:99999999 !important;opacity:0.8}.sgpb-popup-close-button-3:hover{z-index:999999999 !important;opacity:0.9}.sgpb-popup-close-button-3{z-index:999999999 !important}.sgpb-popup-close-button-2{z-index:initial !important;border-radius:2px}.sgpb-main-image-content-wrapper
16
  img{height:auto;max-width:100%}.sgpb-overflow-hidden{width:100%;height:100%;overflow:hidden !important}.sgpb-overflow-hidden-body{width:100%;overflow:hidden !important}.sgpb-popup-content-direction-right{direction:rtl !important}.sgpb-popup-content-direction-right input[type="url"],
17
  .sgpb-popup-content-direction-right input[type="email"],
18
  .sgpb-popup-content-direction-right .sg-fb-buttons-wrapper,
public/views/debugReport.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $SGPB_DEBUG_POPUP_BUILDER_DETAILS;
3
+ $SGPB_DEBUG_POPUP_BUILDER_DETAILS = json_encode($SGPB_DEBUG_POPUP_BUILDER_DETAILS);
4
+
5
+ echo '<script>var SGPB_DEBUG_POPUP_BUILDER_DETAILS = '.$SGPB_DEBUG_POPUP_BUILDER_DETAILS.';</script>';
6
+ ?>
7
+ <script type="text/javascript">
8
+
9
+ var SGPB_DEBUG_POPUP_BUILDER_DETAILS = <?php echo $SGPB_DEBUG_POPUP_BUILDER_DETAILS; ?>;
10
+
11
+ function debugModeInit()
12
+ {
13
+ if (typeof SGPB_DEBUG_POPUP_BUILDER_DETAILS == 'undefined') {
14
+ return false;
15
+ }
16
+
17
+ console.log('%c POPUP BUILDER AVAILABLE DEBUG DETAILS', 'background: #eeeeee; color: #000000');
18
+
19
+ for (var popupId in SGPB_DEBUG_POPUP_BUILDER_DETAILS) {
20
+ console.groupCollapsed('Details for the '+ popupId +' popup:');
21
+
22
+ var debugParamas = SGPB_DEBUG_POPUP_BUILDER_DETAILS[popupId];
23
+ for (var i in debugParamas) {
24
+ if (jQuery.isEmptyObject(debugParamas[i])) {
25
+ continue;
26
+ }
27
+
28
+ var paramName = debugParamas[i];
29
+
30
+ console.info('%c '+i.toUpperCase() +': ', 'background: #ccc; color: #000000');
31
+
32
+ for (var x in paramName) {
33
+ if (typeof paramName[x]['name'] != 'undefined') {
34
+ console.log('%c Option name ------- ' + paramName[x]['name'], 'background: #eeeeee; color: #000000');
35
+ }
36
+ if (typeof paramName[x]['operator'] != 'undefined') {
37
+ console.log('%c Option operator --- ' + paramName[x]['operator'], 'background: #eeeeee; color: #000000');
38
+ }
39
+ if (typeof paramName[x]['value'] != 'undefined') {
40
+ if (typeof paramName[x]['value'] == 'string') {
41
+ /* when empty string we need to set it 0 (delay) */
42
+ if (paramName[x]['value'] == '') {
43
+ paramName[x]['value'] = 0;
44
+ }
45
+ console.log('%c Option value ------ ' + paramName[x]['value'], 'background: #eeeeee; color: #000000');
46
+ }
47
+ else {
48
+ console.log('%c Option value ------ ' + Object.values(paramName[x]['value']), 'background: #eeeeee; color: #000000');
49
+ }
50
+ }
51
+ if (i == 'options') {
52
+ // all other options here
53
+ for (var option in paramName[x]) {
54
+ console.log('%c '+option+ ' - ' + paramName[x][option], 'background: #eeeeee; color: #000000');
55
+ }
56
+ }
57
+ console.log('<->');
58
+ }
59
+ }
60
+ console.groupEnd();
61
+ }
62
+ };
63
+
64
+ jQuery(document).ready(function()
65
+ {
66
+ debugModeInit();
67
+ });
68
+
69
+ </script>
public/views/importConfigView.php CHANGED
@@ -5,6 +5,7 @@ use sgpb\SubscriptionPopup;
5
 
6
  $fileContent = AdminHelper::getFileFromURL($fileURL);
7
  $csvFileArray = array_map('str_getcsv', file($fileURL));
 
8
  $ourFieldsArgs = array(
9
  'class' => 'js-sg-select2 sgpb-our-fields-keys'
10
  );
5
 
6
  $fileContent = AdminHelper::getFileFromURL($fileURL);
7
  $csvFileArray = array_map('str_getcsv', file($fileURL));
8
+
9
  $ourFieldsArgs = array(
10
  'class' => 'js-sg-select2 sgpb-our-fields-keys'
11
  );
public/views/settingsOptions.php CHANGED
@@ -7,6 +7,11 @@
7
  $deleteData = 'checked';
8
  }
9
 
 
 
 
 
 
10
  $systemInfo = AdminHelper::getSystemInfoText();
11
  $userSavedRoles = get_option('sgpb-user-roles');
12
  ?>
@@ -23,6 +28,14 @@
23
  </h3>
24
  <div class="sgpb-options-content">
25
  <form method="POST" action="<?php echo admin_url().'admin-post.php?action=sgpbSaveSettings'?>">
 
 
 
 
 
 
 
 
26
  <div class="row form-group">
27
  <div class="col-md-4 sgpb-static-padding-top">
28
  <label for="sgpb-dont-delete-data"><?php _e('Delete popup data', SG_POPUP_TEXT_DOMAIN)?></label>
7
  $deleteData = 'checked';
8
  }
9
 
10
+ $enableDebugMode = '';
11
+ if (get_option('sgpb-enable-debug-mode')) {
12
+ $enableDebugMode = 'checked';
13
+ }
14
+
15
  $systemInfo = AdminHelper::getSystemInfoText();
16
  $userSavedRoles = get_option('sgpb-user-roles');
17
  ?>
28
  </h3>
29
  <div class="sgpb-options-content">
30
  <form method="POST" action="<?php echo admin_url().'admin-post.php?action=sgpbSaveSettings'?>">
31
+ <div class="row form-group">
32
+ <div class="col-md-4 sgpb-static-padding-top">
33
+ <label for="sgpb-enable-debug-mode"><?php _e('Enable DEBUG MODE', SG_POPUP_TEXT_DOMAIN)?></label>
34
+ </div>
35
+ <div class="col-md-6">
36
+ <input type="checkbox" name="sgpb-enable-debug-mode" class="sgpb-reset-checkbox-margin-top" id="sgpb-enable-debug-mode" <?php echo $enableDebugMode; ?>>
37
+ </div>
38
+ </div>
39
  <div class="row form-group">
40
  <div class="col-md-4 sgpb-static-padding-top">
41
  <label for="sgpb-dont-delete-data"><?php _e('Delete popup data', SG_POPUP_TEXT_DOMAIN)?></label>
readme.txt CHANGED
@@ -9,7 +9,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
9
  Requires at least: 4.2
10
  Tested up to: 5.5
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.69.1
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -186,6 +186,12 @@ Go to the Popup Builder settings and set your desired options.
186
 
187
  == Changelog ==
188
 
 
 
 
 
 
 
189
  = Version 3.69.1 =
190
  * Code improvements. Thanks to 'G Lagonikas'.
191
  * Minor fixes.
@@ -1226,7 +1232,7 @@ Leave us a good review :)
1226
 
1227
  == Upgrade Notice ==
1228
 
1229
- Current Version of Popup Builder is 3.69.1
1230
 
1231
  == Other Notes ==
1232
 
9
  Requires at least: 4.2
10
  Tested up to: 5.5
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.69.2
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
186
 
187
  == Changelog ==
188
 
189
+ = Version 3.69.2 =
190
+ * Code improvement.
191
+ * Debug mode added: Now it’s easier to find the issues that our users face.
192
+ * Bug fixed related to compatibility with Polylang plugin.
193
+ * Bug fixed related to close button showing on iOS devices.
194
+
195
  = Version 3.69.1 =
196
  * Code improvements. Thanks to 'G Lagonikas'.
197
  * Minor fixes.
1232
 
1233
  == Upgrade Notice ==
1234
 
1235
+ Current Version of Popup Builder is 3.69.2
1236
 
1237
  == Other Notes ==
1238