Popup Builder – Responsive WordPress Pop up - Version 3.54

Version Description

Current Version of Popup Builder is 3.54

Download this release

Release Info

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

Code changes from version 3.53 to 3.54

PopupBuilderInit.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  namespace sgpb;
3
  use \SgpbPopupExtensionRegister;
 
4
 
5
  class PopupBuilderInit
6
  {
@@ -93,6 +94,7 @@ class PopupBuilderInit
93
 
94
  public function deactivate()
95
  {
 
96
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
97
  $pluginName = SG_POPUP_FILE_NAME;
98
  // remove AWeber extension from registered extensions
1
  <?php
2
  namespace sgpb;
3
  use \SgpbPopupExtensionRegister;
4
+ use sgpb\AdminHelper;
5
 
6
  class PopupBuilderInit
7
  {
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;
100
  // remove AWeber extension from registered extensions
com/classes/Actions.php CHANGED
@@ -21,41 +21,42 @@ class Actions
21
  add_action('admin_menu', array($this, 'addSubMenu'));
22
  add_action('admin_menu', array($this, 'supportLinks'), 999);
23
  add_action('admin_head', array($this, 'showPreviewButtonAfterPopupPublish'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  add_filter('get_sample_permalink_html', array($this, 'removePostPermalink'), 1, 1);
25
  add_action('manage_'.SG_POPUP_POST_TYPE.'_posts_custom_column' , array($this, 'popupsTableColumnsValues'), 10, 2);
26
  add_action('media_buttons', array($this, 'popupMediaButton'));
27
  add_filter('mce_external_plugins', array($this, 'editorButton'), 1, 1);
28
  add_action('admin_enqueue_scripts', array('sgpb\Style', 'enqueueStyles'));
29
  add_action('admin_enqueue_scripts', array('sgpb\Javascript', 'enqueueScripts'));
30
- add_action('add_meta_boxes', array($this, 'popupMetaboxes'), 100);
31
  // this action for popup options saving and popup builder classes save ex from post and page
32
  add_action('save_post', array($this, 'savePost'), 100, 3);
33
  add_action('wp_enqueue_scripts', array($this, 'enqueuePopupBuilderScripts'));
34
- add_action('admin_enqueue_scripts', array($this, 'adminLoadPopups'));
35
- add_action('admin_action_popupSaveAsNew', array($this, 'popupSaveAsNew'));
36
- add_action('dp_duplicate_post', array($this, 'popupCopyPostMetaInfo'), 10, 2);
37
  add_filter('sgpbOtherConditions', array($this ,'conditionsSatisfy'), 11, 1);
38
- add_filter('post_updated_messages', array($this, 'popupPublishedMessage'), 1, 1);
39
- add_action('admin_post_csv_file', array($this, 'getSubscribersCsvFile'));
40
- add_action('before_delete_post', array($this, 'deleteSubscribersWithPopup'), 1, 1);
41
  add_shortcode('sg_popup', array($this, 'popupShortcode'));
42
  add_filter('cron_schedules', array($this, 'cronAddMinutes'), 10, 1);
43
  add_action('sgpb_send_newsletter', array($this, 'newsletterSendEmail'), 10, 1);
44
  add_action('sgpbGetBannerContentOnce', array($this, 'getBannerContent'), 10, 1);
45
- add_action('admin_post_sgpbSaveSettings', array($this, 'saveSettings'), 10, 1);
46
- add_action('admin_init', array($this, 'userRolesCaps'));
47
- add_action('admin_notices', array($this, 'pluginNotices'));
48
- add_action('admin_notices', array($this, 'promotionalBanner'), 10);
49
- add_action('admin_init', array($this, 'pluginLoaded'));
50
  add_action('plugins_loaded', array($this, 'loadTextDomain'));
51
  // for change admin popup list order
52
  add_action('pre_get_posts', array($this, 'preGetPosts'));
53
  add_action('template_redirect', array($this, 'redirectFromPopupPage'));
54
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
55
- // activate extensions
56
- add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
57
- add_action('admin_head', array($this, 'hidePageBuilderEditButtons'));
58
- add_action('admin_head', array($this, 'hidePublishingActions'));
59
  new Ajax();
60
  }
61
 
@@ -178,7 +179,6 @@ class Actions
178
  update_option('sgpb-banner-cron-only-once', 1);
179
  wp_schedule_event(time(), 'daily', 'sgpbGetBannerContentOnce');
180
  }
181
- new Updates();
182
  }
183
 
184
  public function mainActionButtons($views)
@@ -763,6 +763,9 @@ class Actions
763
 
764
  public function addSubMenu()
765
  {
 
 
 
766
  $this->customPostTypeObj->addSubMenu();
767
  }
768
 
@@ -1206,6 +1209,21 @@ class Actions
1206
  echo $content;
1207
  }
1208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1209
  public function saveSettings()
1210
  {
1211
  $postData = $_POST;
21
  add_action('admin_menu', array($this, 'addSubMenu'));
22
  add_action('admin_menu', array($this, 'supportLinks'), 999);
23
  add_action('admin_head', array($this, 'showPreviewButtonAfterPopupPublish'));
24
+ add_action('admin_enqueue_scripts', array($this, 'adminLoadPopups'));
25
+ add_action('admin_action_popupSaveAsNew', array($this, 'popupSaveAsNew'));
26
+ add_action('admin_post_csv_file', array($this, 'getSubscribersCsvFile'));
27
+ add_action('admin_post_sgpb_system_info', array($this, 'getSystemInfoFile'));
28
+ add_action('admin_post_sgpbSaveSettings', array($this, 'saveSettings'), 10, 1);
29
+ add_action('admin_init', array($this, 'userRolesCaps'));
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'));
36
+ add_action('admin_head', array($this, 'hidePublishingActions'));
37
+ add_action('add_meta_boxes', array($this, 'popupMetaboxes'), 100);
38
+ add_filter('post_updated_messages', array($this, 'popupPublishedMessage'), 1, 1);
39
+ add_action('before_delete_post', array($this, 'deleteSubscribersWithPopup'), 1, 1);
40
+ add_action('dp_duplicate_post', array($this, 'popupCopyPostMetaInfo'), 10, 2);
41
  add_filter('get_sample_permalink_html', array($this, 'removePostPermalink'), 1, 1);
42
  add_action('manage_'.SG_POPUP_POST_TYPE.'_posts_custom_column' , array($this, 'popupsTableColumnsValues'), 10, 2);
43
  add_action('media_buttons', array($this, 'popupMediaButton'));
44
  add_filter('mce_external_plugins', array($this, 'editorButton'), 1, 1);
45
  add_action('admin_enqueue_scripts', array('sgpb\Style', 'enqueueStyles'));
46
  add_action('admin_enqueue_scripts', array('sgpb\Javascript', 'enqueueScripts'));
 
47
  // this action for popup options saving and popup builder classes save ex from post and page
48
  add_action('save_post', array($this, 'savePost'), 100, 3);
49
  add_action('wp_enqueue_scripts', array($this, 'enqueuePopupBuilderScripts'));
 
 
 
50
  add_filter('sgpbOtherConditions', array($this ,'conditionsSatisfy'), 11, 1);
 
 
 
51
  add_shortcode('sg_popup', array($this, 'popupShortcode'));
52
  add_filter('cron_schedules', array($this, 'cronAddMinutes'), 10, 1);
53
  add_action('sgpb_send_newsletter', array($this, 'newsletterSendEmail'), 10, 1);
54
  add_action('sgpbGetBannerContentOnce', array($this, 'getBannerContent'), 10, 1);
 
 
 
 
 
55
  add_action('plugins_loaded', array($this, 'loadTextDomain'));
56
  // for change admin popup list order
57
  add_action('pre_get_posts', array($this, 'preGetPosts'));
58
  add_action('template_redirect', array($this, 'redirectFromPopupPage'));
59
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
 
 
 
 
60
  new Ajax();
61
  }
62
 
179
  update_option('sgpb-banner-cron-only-once', 1);
180
  wp_schedule_event(time(), 'daily', 'sgpbGetBannerContentOnce');
181
  }
 
182
  }
183
 
184
  public function mainActionButtons($views)
763
 
764
  public function addSubMenu()
765
  {
766
+ // We need to check license keys and statuses before adding new menu "License" item
767
+ new Updates();
768
+
769
  $this->customPostTypeObj->addSubMenu();
770
  }
771
 
1209
  echo $content;
1210
  }
1211
 
1212
+ public function getSystemInfoFile()
1213
+ {
1214
+ $content = AdminHelper::getSystemInfoText();
1215
+
1216
+ header('Pragma: public');
1217
+ header('Expires: 0');
1218
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
1219
+ header('Cache-Control: private', false);
1220
+ header('Content-Type: application/octet-stream');
1221
+ header('Content-Disposition: attachment; filename=popupBuilderSystemInfo.txt;');
1222
+ header('Content-Transfer-Encoding: binary');
1223
+
1224
+ echo $content;
1225
+ }
1226
+
1227
  public function saveSettings()
1228
  {
1229
  $postData = $_POST;
com/classes/Ajax.php CHANGED
@@ -81,7 +81,7 @@ class Ajax
81
 
82
  public function sgpbAutosave()
83
  {
84
- $popupId = (int)$_POST['post_ID'];
85
  $postStatus = get_post_status($popupId);
86
  if ($postStatus == 'publish') {
87
  echo '';
81
 
82
  public function sgpbAutosave()
83
  {
84
+ $popupId = @(int)$_POST['post_ID'];
85
  $postStatus = get_post_status($popupId);
86
  if ($postStatus == 'publish') {
87
  echo '';
com/classes/Filters.php CHANGED
@@ -47,6 +47,18 @@ class Filters
47
  add_filter('sgpbAdvancedOptionsDefaultValues', array($this, 'defaultAdvancedOptionsValues'), 10, 1);
48
  add_filter('sgpbPopupContentLoadToPage', array($this, 'popupContentLoadToPage'), 10, 2);
49
  add_filter('sgpbExtraNotifications', array($this, 'sgpbExtraNotifications'), 10, 1);
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
  public function popupContentLoadToPage($content, $popupId)
47
  add_filter('sgpbAdvancedOptionsDefaultValues', array($this, 'defaultAdvancedOptionsValues'), 10, 1);
48
  add_filter('sgpbPopupContentLoadToPage', array($this, 'popupContentLoadToPage'), 10, 2);
49
  add_filter('sgpbExtraNotifications', array($this, 'sgpbExtraNotifications'), 10, 1);
50
+ add_filter('sgpbSystemInformation', array($this, 'systemInformation'), 10, 1);
51
+ }
52
+
53
+ public function systemInformation($infoContent)
54
+ {
55
+
56
+ $infoContent .= 'Platform: '.@$platform . "\n";
57
+ $infoContent .= 'Browser Name: '.@$bname . "\n";
58
+ $infoContent .= 'Browser Version: '.@$version . "\n";
59
+ $infoContent .= 'User Agent: '.@$uAgent . "\n";
60
+
61
+ return $infoContent;
62
  }
63
 
64
  public function popupContentLoadToPage($content, $popupId)
com/classes/Notification.php CHANGED
@@ -52,11 +52,25 @@ class Notification
52
  {
53
  $id = $this->getId();
54
  $type = $this->getType();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  $priority = $this->getPriority();
56
  $message = $this->getMessage();
57
  $btnHtml = $this->getCloseBtnById($id);
58
  $content = '<div class="sgpb-single-notification-wrapper">
59
- <div class="sgpb-single-notification">'.$message.'</div>
60
  <div class="sgpb-single-notification-close-btn">
61
  '.$btnHtml.'
62
  </div>
52
  {
53
  $id = $this->getId();
54
  $type = $this->getType();
55
+ $color = '';
56
+ switch ($type) {
57
+ case 1:
58
+ $color = '#01B9FF !important';
59
+ break;
60
+ case 2:
61
+ $color = '#28a745 !important';
62
+ break;
63
+ case 3:
64
+ $color = '#dc3545 !important';
65
+ break;
66
+ }
67
+
68
+ $style = 'style="border-color:'.$color.';"';
69
  $priority = $this->getPriority();
70
  $message = $this->getMessage();
71
  $btnHtml = $this->getCloseBtnById($id);
72
  $content = '<div class="sgpb-single-notification-wrapper">
73
+ <div class="sgpb-single-notification"'.$style.'>'.$message.'</div>
74
  <div class="sgpb-single-notification-close-btn">
75
  '.$btnHtml.'
76
  </div>
com/classes/PopupLoader.php CHANGED
@@ -121,12 +121,17 @@ class PopupLoader
121
  }
122
  }
123
 
124
- $popupBuilderPosts = new WP_Query(
125
- array(
126
- 'post_type' => SG_POPUP_POST_TYPE,
127
- 'posts_per_page' => - 1
128
- )
129
- );
 
 
 
 
 
130
  // We check all the popups one by one to realize whether they might be loaded or not.
131
  while ($popupBuilderPosts->have_posts()) {
132
  $popupBuilderPosts->next_post();
121
  }
122
  }
123
 
124
+ $popupBuilderPosts = get_transient('loadPopups');
125
+ if (($popupBuilderPosts = get_transient('loadPopups')) === false) {
126
+ $popupBuilderPosts = new WP_Query(
127
+ array(
128
+ 'post_type' => SG_POPUP_POST_TYPE,
129
+ 'posts_per_page' => 10
130
+ )
131
+ );
132
+ set_transient('loadPopups', $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.
136
  while ($popupBuilderPosts->have_posts()) {
137
  $popupBuilderPosts->next_post();
com/classes/RegisterPostType.php CHANGED
@@ -314,6 +314,15 @@ class RegisterPostType
314
 
315
  public function supportLinks()
316
  {
 
 
 
 
 
 
 
 
 
317
  add_submenu_page(
318
  'edit.php?post_type='.SG_POPUP_POST_TYPE,
319
  __('Extend', SG_POPUP_TEXT_DOMAIN),
@@ -361,15 +370,6 @@ class RegisterPostType
361
  SG_POPUP_NEWSLETTER_PAGE,
362
  array($this, 'newsletter')
363
  );
364
-
365
- add_submenu_page(
366
- 'edit.php?post_type='.SG_POPUP_POST_TYPE,
367
- __('Settings', SG_POPUP_TEXT_DOMAIN),
368
- __('Settings', SG_POPUP_TEXT_DOMAIN),
369
- 'manage_options',
370
- SG_POPUP_SETTINGS_PAGE,
371
- array($this, 'settings')
372
- );
373
  }
374
 
375
  public function supportLink()
314
 
315
  public function supportLinks()
316
  {
317
+ add_submenu_page(
318
+ 'edit.php?post_type='.SG_POPUP_POST_TYPE,
319
+ __('Settings', SG_POPUP_TEXT_DOMAIN),
320
+ __('Settings', SG_POPUP_TEXT_DOMAIN),
321
+ 'manage_options',
322
+ SG_POPUP_SETTINGS_PAGE,
323
+ array($this, 'settings')
324
+ );
325
+
326
  add_submenu_page(
327
  'edit.php?post_type='.SG_POPUP_POST_TYPE,
328
  __('Extend', SG_POPUP_TEXT_DOMAIN),
370
  SG_POPUP_NEWSLETTER_PAGE,
371
  array($this, 'newsletter')
372
  );
 
 
 
 
 
 
 
 
 
373
  }
374
 
375
  public function supportLink()
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -114,6 +114,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
114
  'name' => 'SGPB_JS_PARAMS',
115
  'data' => array(
116
  'url' => admin_url('admin-ajax.php'),
 
117
  'nonce' => wp_create_nonce(SG_AJAX_NONCE)
118
  )
119
  );
114
  'name' => 'SGPB_JS_PARAMS',
115
  'data' => array(
116
  'url' => admin_url('admin-ajax.php'),
117
+ 'postUrl' => SG_POPUP_ADMIN_URL.'admin-post.php',
118
  'nonce' => wp_create_nonce(SG_AJAX_NONCE)
119
  )
120
  );
com/classes/popups/SGPopup.php CHANGED
@@ -1303,20 +1303,24 @@ abstract class SGPopup
1303
  public static function getPopupsByTermSlug($popupTermSlug)
1304
  {
1305
  $popupIds = array();
1306
- // proStartSilver
1307
- $termPopups = get_posts(
1308
- array(
1309
- 'post_type' => 'popupbuilder',
1310
- 'numberposts' => -1,
1311
- 'tax_query' => array(
1312
- array(
1313
- 'taxonomy' => SG_POPUP_CATEGORY_TAXONOMY,
1314
- 'field' => 'slug',
1315
- 'terms' => $popupTermSlug
 
 
 
1316
  )
1317
  )
1318
- )
1319
- );
 
1320
 
1321
  if (empty($termPopups)) {
1322
  return $popupIds;
@@ -1325,7 +1329,7 @@ abstract class SGPopup
1325
  foreach ($termPopups as $termPopup) {
1326
  $popupIds[] = $termPopup->ID;
1327
  }
1328
- // proEndSilver
1329
  return $popupIds;
1330
  }
1331
 
1303
  public static function getPopupsByTermSlug($popupTermSlug)
1304
  {
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',
1312
+ 'numberposts' => -1,
1313
+ 'tax_query' => array(
1314
+ array(
1315
+ 'taxonomy' => SG_POPUP_CATEGORY_TAXONOMY,
1316
+ 'field' => 'slug',
1317
+ 'terms' => $popupTermSlug
1318
+ )
1319
  )
1320
  )
1321
+ );
1322
+ set_transient('getPopupsByTermSlug', $termPopups, 60 * MINUTE_IN_SECONDS);
1323
+ }
1324
 
1325
  if (empty($termPopups)) {
1326
  return $popupIds;
1329
  foreach ($termPopups as $termPopup) {
1330
  $popupIds[] = $termPopup->ID;
1331
  }
1332
+
1333
  return $popupIds;
1334
  }
1335
 
com/config/config.php CHANGED
@@ -87,7 +87,7 @@ class SgpbPopupConfig
87
  self::addDefine('SGPB_POPUP_LICENSE', 'license');
88
  self::addDefine('SG_POPUP_EXTEND_PAGE', 'extend');
89
  self::addDefine('SGPB_FILTER_REPEAT_INTERVAL', 50);
90
- self::addDefine('SG_POPUP_TEXT_DOMAIN', 'popupBuilder');
91
  self::addDefine('SG_POPUP_STORE_URL', 'https://popup-builder.com/');
92
  self::addDefine('SG_POPUP_AUTHOR', 'Sygnoos');
93
  self::addDefine('SG_POPUP_KEY', 'POPUP_BUILDER');
@@ -129,6 +129,8 @@ class SgpbPopupConfig
129
  self::addDefine('SGPB_SUBSCRIPTION_ERROR_MESSAGE', __('There was an error while trying to send your request. Please try again', SG_POPUP_TEXT_DOMAIN).'.');
130
  self::addDefine('SGPB_SUBSCRIPTION_VALIDATION_MESSAGE', __('This field is required', SG_POPUP_TEXT_DOMAIN).'.');
131
  self::addDefine('SGPB_SUBSCRIPTION_EMAIL_MESSAGE', __('Please enter a valid email address', SG_POPUP_TEXT_DOMAIN).'.');
 
 
132
  self::popupTypesInit();
133
  }
134
 
87
  self::addDefine('SGPB_POPUP_LICENSE', 'license');
88
  self::addDefine('SG_POPUP_EXTEND_PAGE', 'extend');
89
  self::addDefine('SGPB_FILTER_REPEAT_INTERVAL', 50);
90
+ self::addDefine('SG_POPUP_TEXT_DOMAIN', 'popup-builder');
91
  self::addDefine('SG_POPUP_STORE_URL', 'https://popup-builder.com/');
92
  self::addDefine('SG_POPUP_AUTHOR', 'Sygnoos');
93
  self::addDefine('SG_POPUP_KEY', 'POPUP_BUILDER');
129
  self::addDefine('SGPB_SUBSCRIPTION_ERROR_MESSAGE', __('There was an error while trying to send your request. Please try again', SG_POPUP_TEXT_DOMAIN).'.');
130
  self::addDefine('SGPB_SUBSCRIPTION_VALIDATION_MESSAGE', __('This field is required', SG_POPUP_TEXT_DOMAIN).'.');
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
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.53');
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.54');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -312,7 +312,7 @@ class AdminHelper
312
  return 'inherit';
313
  }
314
 
315
- $size = (int)$dimension . 'px';
316
  // If user write dimension in px or % we give that dimension to target otherwise the default value will be px
317
  if (strpos($dimension, '%') || strpos($dimension, 'px')) {
318
  $size = $dimension;
@@ -525,12 +525,12 @@ class AdminHelper
525
  if (!empty($excludesPopups)) {
526
  foreach ($excludesPopups as $excludesPopupId) {
527
  if ($excludesPopupId != $id) {
528
- $popupIdTitles[$id] = $title . ' - ' . $type;
529
  }
530
  }
531
  }
532
  else {
533
- $popupIdTitles[$id] = $title . ' - ' . $type;
534
  }
535
  }
536
 
@@ -1431,7 +1431,7 @@ class AdminHelper
1431
  if ($excludesPopupId != $id) {
1432
  $array = array();
1433
  $array['id'] = $id;
1434
- $array['title'] = $title . ' - ' . $type;
1435
  $popupIdTitles[] = $array;
1436
  }
1437
  }
@@ -1439,7 +1439,7 @@ class AdminHelper
1439
  else {
1440
  $array = array();
1441
  $array['id'] = $id;
1442
- $array['title'] = $title . ' - ' . $type;
1443
  $popupIdTitles[] = $array;
1444
  }
1445
  }
@@ -1840,4 +1840,339 @@ class AdminHelper
1840
 
1841
  return $finalResult;
1842
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1843
  }
312
  return 'inherit';
313
  }
314
 
315
+ $size = (int)$dimension.'px';
316
  // If user write dimension in px or % we give that dimension to target otherwise the default value will be px
317
  if (strpos($dimension, '%') || strpos($dimension, 'px')) {
318
  $size = $dimension;
525
  if (!empty($excludesPopups)) {
526
  foreach ($excludesPopups as $excludesPopupId) {
527
  if ($excludesPopupId != $id) {
528
+ $popupIdTitles[$id] = $title.' - '.$type;
529
  }
530
  }
531
  }
532
  else {
533
+ $popupIdTitles[$id] = $title.' - '.$type;
534
  }
535
  }
536
 
1431
  if ($excludesPopupId != $id) {
1432
  $array = array();
1433
  $array['id'] = $id;
1434
+ $array['title'] = $title.' - '.$type;
1435
  $popupIdTitles[] = $array;
1436
  }
1437
  }
1439
  else {
1440
  $array = array();
1441
  $array['id'] = $id;
1442
+ $array['title'] = $title.' - '.$type;
1443
  $popupIdTitles[] = $array;
1444
  }
1445
  }
1840
 
1841
  return $finalResult;
1842
  }
1843
+
1844
+ public static function removeSelectedTypeOptions($type)
1845
+ {
1846
+ switch ($type) {
1847
+ case 'cron':
1848
+ $crons = _get_cron_array();
1849
+ foreach ($crons as $key => $value) {
1850
+ foreach ($value as $key => $body) {
1851
+ if (strstr($key, 'sgpb')) {
1852
+ wp_clear_scheduled_hook($key);
1853
+ }
1854
+ }
1855
+ }
1856
+ break;
1857
+ }
1858
+ }
1859
+
1860
+ public static function getSystemInfoText() {
1861
+ global $wpdb;
1862
+
1863
+ $browser = self::getBrowser();
1864
+
1865
+ // Get theme info
1866
+ if (get_bloginfo('version') < '3.4') {
1867
+ $themeData = get_theme_data(get_stylesheet_directory().'/style.css');
1868
+ $theme = $themeData['Name'].' '.$themeData['Version'];
1869
+ }
1870
+ else {
1871
+ $themeData = wp_get_theme();
1872
+ $theme = $themeData->Name.' '.$themeData->Version;
1873
+ }
1874
+
1875
+ // Try to identify the hosting provider
1876
+ $host = self::getHost();
1877
+
1878
+ $systemInfoContent = '### Start System Info ###'."\n\n";
1879
+
1880
+ // Start with the basics...
1881
+ $systemInfoContent .= '-- Site Info'."\n\n";
1882
+ $systemInfoContent .= 'Site URL: '.site_url()."\n";
1883
+ $systemInfoContent .= 'Home URL: '.home_url()."\n";
1884
+ $systemInfoContent .= 'Multisite: '.(is_multisite() ? 'Yes' : 'No')."\n";
1885
+
1886
+ // Can we determine the site's host?
1887
+ if ($host) {
1888
+ $systemInfoContent .= "\n".'-- Hosting Provider'."\n\n";
1889
+ $systemInfoContent .= 'Host: '.$host."\n";
1890
+ }
1891
+
1892
+ // The local users' browser information, handled by the Browser class
1893
+ $systemInfoContent .= "\n".'-- User Browser'."\n\n";
1894
+ $systemInfoContent .= $browser;
1895
+
1896
+ // WordPress configuration
1897
+ $systemInfoContent .= "\n".'-- WordPress Configuration'."\n\n";
1898
+ $systemInfoContent .= 'Version: '.get_bloginfo('version')."\n";
1899
+ $systemInfoContent .= 'Language: '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n";
1900
+ $systemInfoContent .= 'Permalink Structure: '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n";
1901
+ $systemInfoContent .= 'Active Theme: '.$theme."\n";
1902
+ $systemInfoContent .= 'Show On Front: '.get_option('show_on_front')."\n";
1903
+
1904
+ // Only show page specs if frontpage is set to 'page'
1905
+ if (get_option('show_on_front') == 'page') {
1906
+ $frontPageId = get_option('page_on_front');
1907
+ $blogPageId = get_option('page_for_posts');
1908
+
1909
+ $systemInfoContent .= 'Page On Front: '.($frontPageId != 0 ? get_the_title($frontPageId).' (#'.$frontPageId.')' : 'Unset')."\n";
1910
+ $systemInfoContent .= 'Page For Posts: '.($blogPageId != 0 ? get_the_title($blogPageId).' (#'.$blogPageId.')' : 'Unset')."\n";
1911
+ }
1912
+
1913
+ $systemInfoContent .= 'Table Prefix: '.'Prefix: '.$wpdb->prefix.' Length: '.strlen($wpdb->prefix ).' Status: '.( strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n";
1914
+ $systemInfoContent .= 'WP_DEBUG: '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n";
1915
+ $systemInfoContent .= 'Memory Limit: '.WP_MEMORY_LIMIT."\n";
1916
+ $systemInfoContent .= 'Registered Post Stati: '.implode(', ', get_post_stati())."\n";
1917
+
1918
+ // Must-use plugins
1919
+ $muplugins = get_mu_plugins();
1920
+ if ($muplugins && count($muplugins)) {
1921
+ $systemInfoContent .= "\n".'-- Must-Use Plugins'."\n\n";
1922
+
1923
+ foreach ($muplugins as $plugin => $plugin_data) {
1924
+ $systemInfoContent .= $plugin_data['Name'].': '.$plugin_data['Version']."\n";
1925
+ }
1926
+ }
1927
+
1928
+ $registered = AdminHelper::getOption('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
1929
+ $registered = json_decode($registered, true);
1930
+
1931
+ if (empty($registered)) {
1932
+ return false;
1933
+ }
1934
+ // remove free package data, we don't need it
1935
+ array_shift($registered);
1936
+
1937
+ $systemInfoContent .= "\n".'-- Popup Builder License Data'."\n\n";
1938
+ if (!empty($registered)) {
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";
1947
+ $systemInfoContent .= 'License status: '.$licenseStatus."\n";
1948
+ $systemInfoContent .= "\n";
1949
+ }
1950
+ }
1951
+
1952
+ $systemInfoContent .= "\n".'-- All created Popups'."\n\n";
1953
+ $allPopups = self::getPopupsIdAndTitle();
1954
+ $args['status'] = array('publish', 'draft', 'pending', 'private', 'trash');
1955
+ foreach ($allPopups as $id => $popupTitleType) {
1956
+ $popup = SGPopup::find($id, $args);
1957
+ $popupStatus = ($popup->getOptionValue('sgpb-is-active')) ? 'Enabled' : 'Disabled';
1958
+ $systemInfoContent .= 'Id: '.$id."\n";
1959
+ $systemInfoContent .= 'Title: '.get_the_title($id)."\n";
1960
+ $systemInfoContent .= 'Type: '.$popup->getOptionValue('sgpb-type')."\n";
1961
+ $systemInfoContent .= 'Status: '.$popupStatus."\n";
1962
+ $systemInfoContent .= "\n";
1963
+ }
1964
+
1965
+ // WordPress active plugins
1966
+ $systemInfoContent .= "\n".'-- WordPress Active Plugins'."\n\n";
1967
+
1968
+ $plugins = get_plugins();
1969
+ $activePlugins = get_option('active_plugins', array());
1970
+ foreach ($plugins as $pluginPath => $plugin) {
1971
+
1972
+ if (! in_array($pluginPath, $activePlugins)) {
1973
+ continue;
1974
+ }
1975
+
1976
+ $systemInfoContent .= $plugin['Name'].': '.$plugin['Version']."\n";
1977
+ }
1978
+ // WordPress inactive plugins
1979
+ $systemInfoContent .= "\n".'-- WordPress Inactive Plugins'."\n\n";
1980
+
1981
+ foreach ($plugins as $pluginPath => $plugin) {
1982
+ if (in_array($pluginPath, $activePlugins)) {
1983
+ continue;
1984
+ }
1985
+ $systemInfoContent .= $plugin['Name'].': '.$plugin['Version']."\n";
1986
+ }
1987
+
1988
+ if (is_multisite()) {
1989
+ // WordPress Multisite active plugins
1990
+ $systemInfoContent .= "\n".'-- Network Active Plugins'."\n\n";
1991
+
1992
+ $plugins = wp_get_active_network_plugins();
1993
+ $activePlugins = get_site_option('active_sitewide_plugins', array());
1994
+
1995
+ foreach ($plugins as $pluginPath) {
1996
+ $plugin_base = plugin_basename($pluginPath);
1997
+
1998
+ if (! array_key_exists($plugin_base, $activePlugins)) {
1999
+ continue;
2000
+ }
2001
+
2002
+ $plugin = get_plugin_data($pluginPath);
2003
+ $systemInfoContent .= $plugin['Name'].': '.$plugin['Version']."\n";
2004
+ }
2005
+ }
2006
+
2007
+ // Server configuration (really just versioning)
2008
+ $systemInfoContent .= "\n".'-- Webserver Configuration'."\n\n";
2009
+ $systemInfoContent .= 'PHP Version: '.PHP_VERSION."\n";
2010
+ $systemInfoContent .= 'MySQL Version: '.$wpdb->db_version()."\n";
2011
+ $systemInfoContent .= 'Webserver Info: '.$_SERVER['SERVER_SOFTWARE']."\n";
2012
+
2013
+ // PHP configs... now we're getting to the important stuff
2014
+ $systemInfoContent .= "\n".'-- PHP Configuration'."\n\n";
2015
+ $systemInfoContent .= 'Memory Limit: '.ini_get('memory_limit')."\n";
2016
+ $systemInfoContent .= 'Upload Max Size: '.ini_get('upload_max_filesize')."\n";
2017
+ $systemInfoContent .= 'Post Max Size: '.ini_get('post_max_size')."\n";
2018
+ $systemInfoContent .= 'Upload Max Filesize: '.ini_get('upload_max_filesize')."\n";
2019
+ $systemInfoContent .= 'Time Limit: '.ini_get('max_execution_time')."\n";
2020
+ $systemInfoContent .= 'Max Input Vars: '.ini_get('max_input_vars')."\n";
2021
+ $systemInfoContent .= 'Display Errors: '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
2022
+
2023
+ // PHP extensions and such
2024
+ $systemInfoContent .= "\n".'-- PHP Extensions'."\n\n";
2025
+ $systemInfoContent .= 'cURL: '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
2026
+ $systemInfoContent .= 'fsockopen: '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
2027
+ $systemInfoContent .= 'SOAP Client: '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
2028
+ $systemInfoContent .= 'Suhosin: '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
2029
+
2030
+ // Session stuff
2031
+ $systemInfoContent .= "\n".'-- Session Configuration'."\n\n";
2032
+ $systemInfoContent .= 'Session: '.(isset($_SESSION ) ? 'Enabled' : 'Disabled')."\n";
2033
+
2034
+ // The rest of this is only relevant is session is enabled
2035
+ if (isset($_SESSION)) {
2036
+ $systemInfoContent .= 'Session Name: '.esc_html( ini_get('session.name'))."\n";
2037
+ $systemInfoContent .= 'Cookie Path: '.esc_html( ini_get('session.cookie_path'))."\n";
2038
+ $systemInfoContent .= 'Save Path: '.esc_html( ini_get('session.save_path'))."\n";
2039
+ $systemInfoContent .= 'Use Cookies: '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
2040
+ $systemInfoContent .= 'Use Only Cookies: '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
2041
+ }
2042
+
2043
+ $systemInfoContent = apply_filters('sgpbSystemInformation', $systemInfoContent);
2044
+
2045
+ $systemInfoContent .= "\n".'### End System Info ###';
2046
+
2047
+ return $systemInfoContent;
2048
+ }
2049
+
2050
+ public static function getHost()
2051
+ {
2052
+ if (defined('WPE_APIKEY')) {
2053
+ return 'WP Engine';
2054
+ }
2055
+ else if (defined('PAGELYBIN')) {
2056
+ return 'Pagely';
2057
+ }
2058
+ else if (DB_HOST == 'localhost:/tmp/mysql5.sock') {
2059
+ return 'ICDSoft';
2060
+ }
2061
+ else if (DB_HOST == 'mysqlv5') {
2062
+ return 'NetworkSolutions';
2063
+ }
2064
+ else if (strpos(DB_HOST, 'ipagemysql.com') !== false) {
2065
+ return 'iPage';
2066
+ }
2067
+ else if (strpos(DB_HOST, 'ipowermysql.com') !== false) {
2068
+ return 'IPower';
2069
+ }
2070
+ else if (strpos(DB_HOST, '.gridserver.com') !== false) {
2071
+ return 'MediaTemple Grid';
2072
+ }
2073
+ else if (strpos(DB_HOST, '.pair.com') !== false) {
2074
+ return 'pair Networks';
2075
+ }
2076
+ else if (strpos(DB_HOST, '.stabletransit.com') !== false) {
2077
+ return 'Rackspace Cloud';
2078
+ }
2079
+ else if (strpos(DB_HOST, '.sysfix.eu') !== false) {
2080
+ return 'SysFix.eu Power Hosting';
2081
+ }
2082
+ else if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
2083
+ return 'Flywheel';
2084
+ }
2085
+ else {
2086
+ // Adding a general fallback for data gathering
2087
+ return 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME'];
2088
+ }
2089
+ }
2090
+
2091
+ public function getBrowser()
2092
+ {
2093
+ $uAgent = 'Unknown';
2094
+ if (isset($_SERVER['HTTP_USER_AGENT'])) {
2095
+ $uAgent = $_SERVER['HTTP_USER_AGENT'];
2096
+ }
2097
+ $bname = 'Unknown';
2098
+ $platform = 'Unknown';
2099
+ $version= '';
2100
+ $browserInfoContent = '';
2101
+
2102
+ //First get the platform?
2103
+ if (preg_match('/linux/i', $uAgent)) {
2104
+ $platform = 'Linux';
2105
+ }
2106
+ else if (preg_match('/macintosh|mac os x/i', $uAgent)) {
2107
+ $platform = 'Apple';
2108
+ }
2109
+ else if (preg_match('/windows|win32/i', $uAgent)) {
2110
+ $platform = 'Windows';
2111
+ }
2112
+
2113
+ if (preg_match('/MSIE/i',$uAgent) && !preg_match('/Opera/i',$uAgent)) {
2114
+ $bname = 'Internet Explorer';
2115
+ $ub = "MSIE";
2116
+ }
2117
+ else if (preg_match('/Firefox/i',$uAgent)) {
2118
+ $bname = 'Mozilla Firefox';
2119
+ $ub = "Firefox";
2120
+ }
2121
+ else if (preg_match('/OPR/i',$uAgent)) {
2122
+ $bname = 'Opera';
2123
+ $ub = "Opera";
2124
+ }
2125
+ else if (preg_match('/Chrome/i',$uAgent) && !preg_match('/Edge/i',$uAgent)) {
2126
+ $bname = 'Google Chrome';
2127
+ $ub = "Chrome";
2128
+ }
2129
+ else if (preg_match('/Safari/i',$uAgent) && !preg_match('/Edge/i',$uAgent)) {
2130
+ $bname = 'Apple Safari';
2131
+ $ub = "Safari";
2132
+ }
2133
+ else if (preg_match('/Netscape/i',$uAgent)) {
2134
+ $bname = 'Netscape';
2135
+ $ub = "Netscape";
2136
+ }
2137
+ else if (preg_match('/Edge/i',$uAgent)) {
2138
+ $bname = 'Edge';
2139
+ $ub = "Edge";
2140
+ }
2141
+ else if (preg_match('/Trident/i',$uAgent)) {
2142
+ $bname = 'Internet Explorer';
2143
+ $ub = "MSIE";
2144
+ }
2145
+
2146
+ // finally get the correct version number
2147
+ $known = array('Version', $ub, 'other');
2148
+ $pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
2149
+ if (!preg_match_all($pattern, $uAgent, $matches)) {
2150
+ // we have no matching number just continue
2151
+ }
2152
+ // see how many we have
2153
+ $i = count($matches['browser']);
2154
+ //we will have two since we are not using 'other' argument yet
2155
+ if ($i != 1) {
2156
+ //see if version is before or after the name
2157
+ if (strripos($uAgent,"Version") < strripos($uAgent,$ub)) {
2158
+ $version= $matches['version'][0];
2159
+ }
2160
+ else {
2161
+ $version= $matches['version'][1];
2162
+ }
2163
+ }
2164
+ else {
2165
+ $version= $matches['version'][0];
2166
+ }
2167
+
2168
+ // check if we have a number
2169
+ if ($version == null || $version == "") {$version = "?" ;}
2170
+
2171
+ $browserInfoContent .= 'Platform: '.$platform."\n";
2172
+ $browserInfoContent .= 'Browser Name: '.$bname."\n";
2173
+ $browserInfoContent .= 'Browser Version: '.$version."\n";
2174
+ $browserInfoContent .= 'User Agent: '.$uAgent."\n";
2175
+
2176
+ return $browserInfoContent;
2177
+ }
2178
  }
com/helpers/ConfigDataHelper.php CHANGED
@@ -17,18 +17,21 @@ class ConfigDataHelper
17
 
18
  public static function getQueryDataByArgs($args = array())
19
  {
20
- $defaultArgs = array(
21
- 'offset' => '',
22
- 'orderby' => 'date',
23
- 'order' => 'DESC',
24
- 'post_status' => 'publish',
25
- 'suppress_filters' => true,
26
- 'post_type' => 'post',
27
- 'posts_per_page' => 1000
28
- );
29
-
30
- $args = wp_parse_args($args, $defaultArgs);
31
- $query = new WP_Query($args);
 
 
 
32
 
33
  return $query;
34
  }
@@ -159,15 +162,20 @@ class ConfigDataHelper
159
 
160
  public static function getPostsAllCategories($postType = 'post', $taxonomies = array())
161
  {
162
- $cats = get_terms(
163
- array(
164
- 'taxonomy' => $taxonomies,
165
- 'hide_empty' => false,
166
- 'type' => $postType,
167
- 'orderby' => 'name',
168
- 'order' => 'ASC'
169
- )
170
- );
 
 
 
 
 
171
  $supportedTaxonomies = array('category');
172
  if (!empty($taxonomies)) {
173
  $supportedTaxonomies = $taxonomies;
17
 
18
  public static function getQueryDataByArgs($args = array())
19
  {
20
+ $query = get_transient('getQueryDataByArgs');
21
+ if (($query = get_transient('getQueryDataByArgs')) === false) {
22
+ $defaultArgs = array(
23
+ 'offset' => '',
24
+ 'orderby' => 'date',
25
+ 'order' => 'DESC',
26
+ 'post_status' => 'publish',
27
+ 'suppress_filters' => true,
28
+ 'post_type' => 'post',
29
+ 'posts_per_page' => 1000
30
+ );
31
+ $args = wp_parse_args($args, $defaultArgs);
32
+ $query = new WP_Query($args);
33
+ set_transient('getQueryDataByArgs', $query, SGPB_TRANSIENT_TIMEOUT_HOUR);
34
+ }
35
 
36
  return $query;
37
  }
162
 
163
  public static function getPostsAllCategories($postType = 'post', $taxonomies = array())
164
  {
165
+ $cats = get_transient('getPostsAllCategories');
166
+ if (($cats = get_transient('getPostsAllCategories')) === false) {
167
+ $cats = get_terms(
168
+ array(
169
+ 'taxonomy' => $taxonomies,
170
+ 'hide_empty' => false,
171
+ 'type' => $postType,
172
+ 'orderby' => 'name',
173
+ 'order' => 'ASC'
174
+ )
175
+ );
176
+ set_transient('getPostsAllCategories', $cats, SGPB_TRANSIENT_TIMEOUT_HOUR);
177
+ }
178
+
179
  $supportedTaxonomies = array('category');
180
  if (!empty($taxonomies)) {
181
  $supportedTaxonomies = $taxonomies;
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.53
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.54
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/theme.css CHANGED
@@ -13,7 +13,7 @@ iframe{margin:0
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:initial !important;opacity:0.9}.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{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,
19
  .sgpb-popup-content-direction-right .sgpb-alert{text-align:right !important}/**/@charset "UTF-8";.sg-animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:none;animation-fill-mode:none}.sg-animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.sg-animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.sg-animated.bounceIn,.sg-animated.bounceOut,.sg-animated.flipOutX,.sg-animated.flipOutY{-webkit-animation-duration: .75s;animation-duration: .75s}@-webkit-keyframes
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:initial !important;opacity:0.9}.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-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,
19
  .sgpb-popup-content-direction-right .sgpb-alert{text-align:right !important}/**/@charset "UTF-8";.sg-animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:none;animation-fill-mode:none}.sg-animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.sg-animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.sg-animated.bounceIn,.sg-animated.bounceOut,.sg-animated.flipOutX,.sg-animated.flipOutY{-webkit-animation-duration: .75s;animation-duration: .75s}@-webkit-keyframes
public/js/Backend.js CHANGED
@@ -78,6 +78,7 @@ SGPBBackend.prototype.sgInit = function()
78
  this.editPopupSettingsForFullscreenMode();
79
  this.autosave();
80
  this.popupBuilderButton();
 
81
  };
82
 
83
  SGPBBackend.prototype.changeTab = function(tab)
@@ -98,6 +99,15 @@ SGPBBackend.prototype.changeTab = function(tab)
98
  this.rangeSlider();
99
  };
100
 
 
 
 
 
 
 
 
 
 
101
  SGPBBackend.prototype.resetCssEditorContent = function() {
102
  jQuery('.editor-content-css').val(SGPB_CSS_EDITOR_DEFAULT_CONTENT[0]);
103
  }
78
  this.editPopupSettingsForFullscreenMode();
79
  this.autosave();
80
  this.popupBuilderButton();
81
+ this.downloadSystemInfoFile();
82
  };
83
 
84
  SGPBBackend.prototype.changeTab = function(tab)
99
  this.rangeSlider();
100
  };
101
 
102
+ SGPBBackend.prototype.downloadSystemInfoFile = function() {
103
+ if (!jQuery('.sgpb-download-system-info').length) {
104
+ return false;
105
+ }
106
+ jQuery('.sgpb-download-system-info').bind('click', function() {
107
+ window.location.href = SGPB_JS_PARAMS.postUrl+'?action=sgpb_system_info';
108
+ });
109
+ }
110
+
111
  SGPBBackend.prototype.resetCssEditorContent = function() {
112
  jQuery('.editor-content-css').val(SGPB_CSS_EDITOR_DEFAULT_CONTENT[0]);
113
  }
public/js/NotificationCenter.js CHANGED
@@ -28,6 +28,9 @@ SGPBNotificationCenter.prototype.dismiss = function()
28
  jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);
29
  jQuery('.sgpb-notifications-count-span').html(response['count']);
30
  jQuery('.sgpb-menu-item-notification').html(response['count']);
 
 
 
31
  that.init();
32
  });
33
  });
28
  jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);
29
  jQuery('.sgpb-notifications-count-span').html(response['count']);
30
  jQuery('.sgpb-menu-item-notification').html(response['count']);
31
+ if (response['count'] == 0) {
32
+ jQuery('.sgpb-notification-center-wrapper').hide();
33
+ }
34
  that.init();
35
  });
36
  });
public/js/PopupBuilder.js CHANGED
@@ -432,15 +432,27 @@ SGPBPopup.prototype.prepareOpen = function()
432
  var that = this;
433
  var popupConfig = this.getPopupConfig();
434
 
435
- popupConfig.customShouldOpen = function() {
 
 
 
 
 
 
 
 
 
436
  var instructions = popupData['sgpb-ShouldOpen'];
 
437
  var F = new Function (instructions);
438
 
439
  return(F());
440
  }
441
 
442
- popupConfig.customShouldClose = function() {
 
443
  var instructions = popupData['sgpb-ShouldClose'];
 
444
  var F = new Function (instructions);
445
 
446
  return(F());
432
  var that = this;
433
  var popupConfig = this.getPopupConfig();
434
 
435
+ function decodeEntities(encodedString)
436
+ {
437
+ var textArea = document.createElement('textarea');
438
+ textArea.innerHTML = encodedString;
439
+
440
+ return textArea.value;
441
+ }
442
+
443
+ popupConfig.customShouldOpen = function()
444
+ {
445
  var instructions = popupData['sgpb-ShouldOpen'];
446
+ instructions = decodeEntities(instructions);
447
  var F = new Function (instructions);
448
 
449
  return(F());
450
  }
451
 
452
+ popupConfig.customShouldClose = function()
453
+ {
454
  var instructions = popupData['sgpb-ShouldClose'];
455
+ instructions = decodeEntities(instructions);
456
  var F = new Function (instructions);
457
 
458
  return(F());
public/js/PopupConfig.js CHANGED
@@ -9,6 +9,8 @@ else{var param=functionName.replace(/^set/g,"").firstToLowerCase();this[param]=a
9
  {if(this.isIE()){var event=document.createEvent('CustomEvent');event.initCustomEvent(eventName,true,true,args);}
10
  else{var event=new CustomEvent(eventName,{detail:args,bubbles:true,cancelable:true});}
11
  window.dispatchEvent(event);};PopupConfig.prototype.combineConfigObj=function()
12
- {var that=this;var eventSendArgs={'popupId':that.popupId,'popupData':that.popupData,'currentObj':that.currentObj};window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var config={popupId:that.popupId,openDelay:this.openDelay,popupTheme:this.popupTheme,popupType:this.popupType,closeBehavior:{allowed:this.allowed,showButton:this.showButton,buttonPosition:this.buttonPosition,buttonInside:this.buttonInside,autoclose:this.autoclose,overlayShouldClose:this.overlayShouldClose,contentShouldClose:this.contentShouldClose,escShouldClose:this.escShouldClose,right:this.closeButtonPositionRight,top:this.closeButtonPositionTop,bottom:this.closeButtonPositionBottom,left:this.closeButtonPositionLeft},openAnimation:{type:this.openAnimationEffect,speed:this.openAnimationSpeed,status:this.openAnimationStatus},closeAnimation:{type:this.closeAnimationEffect,speed:this.closeAnimationSpeed,status:this.closeAnimationStatus},closeButton:{data:this.buttonImage,width:this.closeButtonWidth,height:this.closeButtonHeight,widthType:this.closeButtonWidthType,heightType:this.closeButtonHeightType,type:this.closeButtonType,text:this.closeButtonText},overlay:{visible:this.overlayVisible,color:this.overlayColor,opacity:this.overlayOpacity,addClass:this.overlayAddClass},contentBox:{padding:this.contentPadding,zIndex:this.zIndex,showBackground:this.contentShowBackground,backgroundColor:this.contentBackgroundColor,backgroundImage:this.contentBackgroundImage,backgroundMode:this.contentBackgroundMode,backgroundPosition:this.contentBackgroundPosition,borderStyle:this.contentBorderStyle,borderRadius:this.contentBorderRadius,borderRadiusType:this.contentBorderRadiusType,borderColor:this.contentBorderColor,borderWidth:this.contentBorderWidth,boxBorderWidth:this.boxBorderWidth,shadowColor:this.contentShadowColor,shadowBlur:this.contentShadowBlur,scrollingEnabled:this.scrollingEnabled,shadowSpread:this.shadowSpread,addClass:this.contentAddClass},contents:this.contents,inline:this.srcElement,iframe:false,position:{right:this.positionRight,top:this.positionTop,bottom:this.positionBottom,left:this.positionLeft},sizingRanges:[{screenFrom:{width:0,height:0},screenTo:{width:300,height:3000},width:'100%',height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight},{screenFrom:{width:300,height:0},screenTo:{width:3000,height:3000},width:this.width,height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight}],shouldOpen:function(){return true;},willOpen:function(){that.addCustomEvent('sgpbWillOpen',eventSendArgs);},didOpen:function(args){var finalArgs=Object.assign(args,eventSendArgs);that.addCustomEvent('sgpbDidOpen',finalArgs);},shouldClose:function(){return true;},willClose:function(){that.addCustomEvent('sgpbWillClose',eventSendArgs);},didClose:function(){that.addCustomEvent('sgpbDidClose',eventSendArgs);}};if(this.customShouldOpen){config.shouldOpen=this.customShouldOpen;}
 
 
13
  if(this.customShouldClose){config.shouldClose=this.customShouldClose;}
14
  return config;};var obj=new PopupConfig();
9
  {if(this.isIE()){var event=document.createEvent('CustomEvent');event.initCustomEvent(eventName,true,true,args);}
10
  else{var event=new CustomEvent(eventName,{detail:args,bubbles:true,cancelable:true});}
11
  window.dispatchEvent(event);};PopupConfig.prototype.combineConfigObj=function()
12
+ {var that=this;var eventSendArgs={'popupId':that.popupId,'popupData':that.popupData,'currentObj':that.currentObj};window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var config={popupId:that.popupId,openDelay:this.openDelay,popupTheme:this.popupTheme,popupType:this.popupType,closeBehavior:{allowed:this.allowed,showButton:this.showButton,buttonPosition:this.buttonPosition,buttonInside:this.buttonInside,autoclose:this.autoclose,overlayShouldClose:this.overlayShouldClose,contentShouldClose:this.contentShouldClose,escShouldClose:this.escShouldClose,right:this.closeButtonPositionRight,top:this.closeButtonPositionTop,bottom:this.closeButtonPositionBottom,left:this.closeButtonPositionLeft},openAnimation:{type:this.openAnimationEffect,speed:this.openAnimationSpeed,status:this.openAnimationStatus},closeAnimation:{type:this.closeAnimationEffect,speed:this.closeAnimationSpeed,status:this.closeAnimationStatus},closeButton:{data:this.buttonImage,width:this.closeButtonWidth,height:this.closeButtonHeight,widthType:this.closeButtonWidthType,heightType:this.closeButtonHeightType,type:this.closeButtonType,text:this.closeButtonText},overlay:{visible:this.overlayVisible,color:this.overlayColor,opacity:this.overlayOpacity,addClass:this.overlayAddClass},contentBox:{padding:this.contentPadding,zIndex:this.zIndex,showBackground:this.contentShowBackground,backgroundColor:this.contentBackgroundColor,backgroundImage:this.contentBackgroundImage,backgroundMode:this.contentBackgroundMode,backgroundPosition:this.contentBackgroundPosition,borderStyle:this.contentBorderStyle,borderRadius:this.contentBorderRadius,borderRadiusType:this.contentBorderRadiusType,borderColor:this.contentBorderColor,borderWidth:this.contentBorderWidth,boxBorderWidth:this.boxBorderWidth,shadowColor:this.contentShadowColor,shadowBlur:this.contentShadowBlur,scrollingEnabled:this.scrollingEnabled,shadowSpread:this.shadowSpread,addClass:this.contentAddClass},contents:this.contents,inline:this.srcElement,iframe:false,position:{right:this.positionRight,top:this.positionTop,bottom:this.positionBottom,left:this.positionLeft},sizingRanges:[{screenFrom:{width:0,height:0},screenTo:{width:300,height:3000},width:'100%',height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight},{screenFrom:{width:300,height:0},screenTo:{width:3000,height:3000},width:this.width,height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight}],shouldOpen:function(){return true;},willOpen:function(){that.addCustomEvent('sgpbWillOpen',eventSendArgs);},didOpen:function(args){if(that.isIE()){var finalArgs=[args,eventSendArgs],finalArgs=finalArgs.reduce(function(r,o){Object.keys(o).forEach(function(k){r[k]=o[k];});return r;},{});}
13
+ else{var finalArgs=Object.assign(args,eventSendArgs);}
14
+ that.addCustomEvent('sgpbDidOpen',finalArgs);},shouldClose:function(){return true;},willClose:function(){that.addCustomEvent('sgpbWillClose',eventSendArgs);},didClose:function(){that.addCustomEvent('sgpbDidClose',eventSendArgs);}};if(this.customShouldOpen){config.shouldOpen=this.customShouldOpen;}
15
  if(this.customShouldClose){config.shouldClose=this.customShouldClose;}
16
  return config;};var obj=new PopupConfig();
public/views/settingsOptions.php CHANGED
@@ -7,6 +7,7 @@
7
  $deleteData = 'checked';
8
  }
9
 
 
10
  $userSavedRoles = get_option('sgpb-user-roles');
11
  ?>
12
 
@@ -60,6 +61,35 @@
60
  </div>
61
  </div>
62
  </div>
63
- <div class="col-md-6"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
-
7
  $deleteData = 'checked';
8
  }
9
 
10
+ $systemInfo = AdminHelper::getSystemInfoText();
11
  $userSavedRoles = get_option('sgpb-user-roles');
12
  ?>
13
 
61
  </div>
62
  </div>
63
  </div>
64
+ <div class="col-md-6">
65
+ <div id="post-body" class="metabox-holder columns-2">
66
+ <div id="postbox-container-2" class="postbox-container">
67
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
68
+ <div class="postbox popup-builder-special-postbox">
69
+ <div class="handlediv js-special-title" title="Click to toggle"><br></div>
70
+ <h3 class="hndle ui-sortable-handle js-special-title">
71
+ <span><?php _e('Debug tools', SG_POPUP_TEXT_DOMAIN); ?></span>
72
+ </h3>
73
+ <div class="sgpb-options-content">
74
+ <div class="row form-group">
75
+ <div class="col-md-4 sgpb-static-padding-top">
76
+ <label for="sgpb-dont-delete-data"><?php _e('System information', SG_POPUP_TEXT_DOMAIN)?></label>:
77
+ </div>
78
+ </div>
79
+ <div class="row form-group">
80
+ <div class="col-md-12">
81
+ <textarea onclick="this.select();" rows="10" class="form-control" readonly><?php echo $systemInfo ;?></textarea>
82
+ </div>
83
+ </div>
84
+ <div class="row form-group">
85
+ <div class="col-md-12">
86
+ <input type="button" class="sgpb-download-system-info button-primary" value="<?php _e('Download', SG_POPUP_TEXT_DOMAIN)?>" class="button-primary">
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </div>
95
  </div>
 
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.53
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,6 +185,15 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
 
188
  = Version 3.53 =
189
  * Added missing text domain.
190
  * Fixes regarding cron tasks.
@@ -197,10 +206,10 @@ Go to the Popup Builder settings and set your desired options.
197
  * Fixed compatibility issues with Beaver Builder (page builder) plugin.
198
  * Speed improvements, related to getting popup data from a database.
199
  * JS code improvements related to popup opening, there were issues with old/new browsers.
200
- * Image popup improvements, when there is an incorrect image used: with incorrect URL, in this case, we will show the default no image placeholder.
201
  * Deprecated functions updated (JS).
202
  * Unneeded CSS code removed, which affected on the admin panel of the plugin.
203
- * New Archive page added in Display Rules => Page types.
204
  * JS error fixed, which affected on correct work of extra events.
205
 
206
  = Version 3.51 =
@@ -1086,7 +1095,7 @@ Leave us a good review :)
1086
 
1087
  == Upgrade Notice ==
1088
 
1089
- Current Version of Popup Builder is 3.52
1090
 
1091
  == Other Notes ==
1092
 
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.54
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.54 =
189
+ * Custom js issue related to code symbols (not encoded as expected).
190
+ * Internet explorer compatibility issue fixed.
191
+ * Popup speed improvements, decreasing of requests count to DB, AJAX.
192
+ * System info view added which will help us to debug errors.
193
+ * Duplicate queries were removed.
194
+ * New types in the notification center added (separated by colors)
195
+ * Safari overlay issue fixed
196
+
197
  = Version 3.53 =
198
  * Added missing text domain.
199
  * Fixes regarding cron tasks.
206
  * Fixed compatibility issues with Beaver Builder (page builder) plugin.
207
  * Speed improvements, related to getting popup data from a database.
208
  * JS code improvements related to popup opening, there were issues with old/new browsers.
209
+ * Image popup improvements, when there is an incorrect image used: with incorrect URL, in this case, we will show the default "no image" placeholder.
210
  * Deprecated functions updated (JS).
211
  * Unneeded CSS code removed, which affected on the admin panel of the plugin.
212
+ * New 'Archive' page added in Display Rules => Page types.
213
  * JS error fixed, which affected on correct work of extra events.
214
 
215
  = Version 3.51 =
1095
 
1096
  == Upgrade Notice ==
1097
 
1098
+ Current Version of Popup Builder is 3.54
1099
 
1100
  == Other Notes ==
1101