Popup Builder – Responsive WordPress Pop up - Version 3.61

Version Description

Current Version of Popup Builder is 3.61

Download this release

Release Info

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

Code changes from version 3.60 to 3.61

com/classes/Actions.php CHANGED
@@ -28,7 +28,6 @@ class Actions
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
  add_action('transition_post_status', array($this, 'deletePopup'), 100, 3);
34
  // activate extensions
@@ -171,12 +170,8 @@ class Actions
171
 
172
  public function getBannerContent()
173
  {
174
- // main banner content
175
- $bannerContent = AdminHelper::getFileFromURL(SGPB_BANNER_CRON_TEXT_URL);
176
- update_option('sgpb-banner-remote-get', $bannerContent);
177
  // right metabox banner content
178
  $metaboxBannerContent = AdminHelper::getFileFromURL(SGPB_METABOX_BANNER_CRON_TEXT_URL);
179
-
180
  update_option('sgpb-metabox-banner-remote-get', $metaboxBannerContent);
181
 
182
  return true;
@@ -262,19 +257,6 @@ class Actions
262
  return true;
263
  }
264
 
265
- public function promotionalBanner()
266
- {
267
- global $post_type;
268
-
269
- if (!get_option('SGPB_PROMOTIONAL_BANNER_CLOSED')) {
270
- require_once(SG_POPUP_VIEWS_PATH.'mainRateUsBanner.php');
271
- }
272
-
273
- /*if (!get_option('SGPB_ASK_FOR_REVIEW_BANNER_CLOSED') && $post_type == SG_POPUP_POST_TYPE) {
274
- echo AdminHelper::showReviewPopup();
275
- }*/
276
- }
277
-
278
  public function pluginNotices()
279
  {
280
  if (function_exists('get_current_screen')) {
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_init', array($this, 'pluginLoaded'));
32
  add_action('transition_post_status', array($this, 'deletePopup'), 100, 3);
33
  // activate extensions
170
 
171
  public function getBannerContent()
172
  {
 
 
 
173
  // right metabox banner content
174
  $metaboxBannerContent = AdminHelper::getFileFromURL(SGPB_METABOX_BANNER_CRON_TEXT_URL);
 
175
  update_option('sgpb-metabox-banner-remote-get', $metaboxBannerContent);
176
 
177
  return true;
257
  return true;
258
  }
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  public function pluginNotices()
261
  {
262
  if (function_exists('get_current_screen')) {
com/classes/Ajax.php CHANGED
@@ -109,7 +109,8 @@ class Ajax
109
  public function dontShowReviewPopup()
110
  {
111
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
112
- update_option('SGPBCloseReviewPopup-1', true);
 
113
  wp_die();
114
  }
115
 
@@ -197,14 +198,15 @@ class Ajax
197
  public function closeMainRateUsBanner()
198
  {
199
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
200
- update_option('SGPB_PROMOTIONAL_BANNER_CLOSED', 'SGPB_PROMOTIONAL_BANNER_CLOSED');
 
201
  wp_die();
202
  }
203
 
204
  public function closeLicenseNoticeBanner()
205
  {
206
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
207
- update_option('sgpb-hide-license-notice-banner', 'sgpb-hide-license-notice-banner');
208
  wp_die();
209
  }
210
 
109
  public function dontShowReviewPopup()
110
  {
111
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
112
+ update_option('SGPBCloseReviewPopup-notification', true);
113
+ do_action('sgpbGetNotifications');
114
  wp_die();
115
  }
116
 
198
  public function closeMainRateUsBanner()
199
  {
200
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
201
+ update_option('sgpb-hide-support-banner', 1);
202
+ do_action('sgpbGetNotifications');
203
  wp_die();
204
  }
205
 
206
  public function closeLicenseNoticeBanner()
207
  {
208
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
209
+ update_option('sgpb-hide-license-notice-banner', 1);
210
  wp_die();
211
  }
212
 
com/classes/Filters.php CHANGED
@@ -69,7 +69,71 @@ class Filters
69
  return $content;
70
  }
71
 
72
- public function sgpbExtraNotifications($notifications)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  {
74
  $inactiveExtensionNotice = array();
75
  $dontShowLicenseBanner = get_option('sgpb-hide-license-notice-banner');
@@ -99,14 +163,12 @@ class Filters
99
  $message .= '<b>'.$partOfContent.'</b>';
100
 
101
  $inactiveExtensionNotice['priority'] = 1;
102
- $inactiveExtensionNotice['type'] = 1;
103
  $inactiveExtensionNotice['id'] = 'sgpbMainActiveInactiveLicense';
104
  $inactiveExtensionNotice['message'] = $message;
105
-
106
- $notifications[] = $inactiveExtensionNotice;
107
  }
108
 
109
- return $notifications;
110
  }
111
 
112
  public function excludeSitemapsYoast($exclude = false, $postType)
69
  return $content;
70
  }
71
 
72
+ public function sgpbExtraNotifications($notifications = array())
73
+ {
74
+ $license = self::licenseNotification();
75
+ if (!empty($license)) {
76
+ $notifications[] = $license;
77
+ }
78
+
79
+ $promotional = self::promotionalNotifications();
80
+ if (!empty($promotional)) {
81
+ $notifications[] = $promotional;
82
+ }
83
+
84
+ $supportBanner = self::supportBannerNotifcations();
85
+ if (!empty($supportBanner)) {
86
+ $notifications[] = $supportBanner;
87
+ }
88
+
89
+ return $notifications;
90
+ }
91
+
92
+ public static function supportBannerNotifcations()
93
+ {
94
+ $hideSupportBanner = get_option('sgpb-hide-support-banner');
95
+ if (!empty($hideSupportBanner)) {
96
+ return array();
97
+ }
98
+ $message = AdminHelper::supportBannerNotification();
99
+ $notification['id'] = SGPB_SUPPORT_BANNER_NOTIFICATION_ID;
100
+ $notification['priority'] = 1;
101
+ $notification['type'] = 1;
102
+ $notification['message'] = $message;
103
+
104
+ return $notification;
105
+ }
106
+
107
+ public static function promotionalNotifications()
108
+ {
109
+ $alreadyDone = get_option('SGPBCloseReviewPopup-notification');
110
+ if (!empty($alreadyDone)) {
111
+ return array();
112
+ }
113
+ $id = SGPB_RATE_US_NOTIFICATION_ID;
114
+ $type = 1;
115
+ $priority = 1;
116
+
117
+ $maxOpenPopupStatus = AdminHelper::shouldOpenForMaxOpenPopupMessage();
118
+ // popup opening count notification
119
+ if ($maxOpenPopupStatus) {
120
+ $message = AdminHelper::getMaxOpenPopupsMessage();
121
+ }
122
+
123
+ $shouldOpenForDays = AdminHelper::shouldOpenReviewPopupForDays();
124
+ if ($shouldOpenForDays && !$maxOpenPopupStatus) {
125
+ $message = AdminHelper::getMaxOpenDaysMessage();
126
+ }
127
+
128
+ $alternateNotification['priority'] = $priority;
129
+ $alternateNotification['type'] = $type;
130
+ $alternateNotification['id'] = $id;
131
+ $alternateNotification['message'] = $message;
132
+
133
+ return $alternateNotification;
134
+ }
135
+
136
+ public function licenseNotification()
137
  {
138
  $inactiveExtensionNotice = array();
139
  $dontShowLicenseBanner = get_option('sgpb-hide-license-notice-banner');
163
  $message .= '<b>'.$partOfContent.'</b>';
164
 
165
  $inactiveExtensionNotice['priority'] = 1;
166
+ $inactiveExtensionNotice['type'] = 2;
167
  $inactiveExtensionNotice['id'] = 'sgpbMainActiveInactiveLicense';
168
  $inactiveExtensionNotice['message'] = $message;
 
 
169
  }
170
 
171
+ return $inactiveExtensionNotice;
172
  }
173
 
174
  public function excludeSitemapsYoast($exclude = false, $postType)
com/classes/Notification.php CHANGED
@@ -82,6 +82,10 @@ class Notification
82
  public function getCloseBtnById($id)
83
  {
84
  $dismissedNotification = SGPBNotificationCenter::getAllDismissedNotifications();
85
- return '<button data-id="'.$id.'" class="button dismiss sgpb-dismiss-notification-js"><span class="dashicons dashicons-no-alt"></span></button>';
 
 
 
 
86
  }
87
  }
82
  public function getCloseBtnById($id)
83
  {
84
  $dismissedNotification = SGPBNotificationCenter::getAllDismissedNotifications();
85
+ if (isset($dismissedNotification[$id])) {
86
+ return '<button data-id="'.$id.'" class="button dismiss sgpb-activate-notification-js"><span class="dashicons dashicons-hidden"></span></button>';
87
+ }
88
+
89
+ return '<button data-id="'.$id.'" class="button dismiss sgpb-dismiss-notification-js"><span class="dashicons dashicons-visibility"></span></button>';
90
  }
91
  }
com/classes/NotificationCenter.php CHANGED
@@ -18,20 +18,23 @@ class SGPBNotificationCenter
18
  add_filter('sgpbCronTimeoutSettings', array($this, 'cronAddMinutes'), 10, 1);
19
  add_action('sgpbGetNotifications', array($this, 'updateNotificationsArray'));
20
  add_action('wp_ajax_sgpb_dismiss_notification', array($this, 'dismissNotification'));
 
21
  add_action('admin_head', array($this, 'menuItemCounter'));
22
  }
23
 
24
  public function menuItemCounter()
25
  {
26
- $count = count(self::getAllActiveNotifications());
27
- if (!empty($count)) {
28
- echo "<script>
 
 
 
29
  jQuery(document).ready(function() {
30
  jQuery('.sgpb-menu-item-notification').remove();
31
- jQuery('.dashicons-menu-icon-sgpb').next().append('<span class=\"sgpb-menu-item-notification\">".$count."</span>');
32
  });
33
  </script>";
34
- }
35
  }
36
 
37
  public function setCronTimeout($cronTimeout)
@@ -60,6 +63,10 @@ class SGPBNotificationCenter
60
  $content = AdminHelper::getFileFromURL($requestUrl);
61
  $content = json_decode($content, true);
62
  $content = apply_filters('sgpbExtraNotifications', $content);
 
 
 
 
63
  $content = json_encode($content);
64
  update_option('sgpb-all-notifications-data', $content);
65
  }
@@ -92,7 +99,7 @@ class SGPBNotificationCenter
92
  return $schedules;
93
  }
94
 
95
- public static function getAllActiveNotifications()
96
  {
97
  $activeNotifications = array();
98
  $notifications = get_option('sgpb-all-notifications-data');
@@ -105,8 +112,10 @@ class SGPBNotificationCenter
105
  $dismissedNotifications = json_decode($dismissedNotifications, true);
106
  foreach ($notifications as $notification) {
107
  $id = @$notification['id'];
108
- if (isset($dismissedNotifications[$id])) {
109
- continue;
 
 
110
  }
111
  $activeNotifications[] = $notification;
112
  }
@@ -132,7 +141,7 @@ class SGPBNotificationCenter
132
  return $content;
133
  }
134
 
135
- $count = count($allNotifications);
136
 
137
  foreach ($allNotifications as $notification) {
138
  $newNotification = new Notification();
@@ -143,6 +152,7 @@ class SGPBNotificationCenter
143
  $content .= $newNotification->render();
144
  }
145
  $count = '(<span class="sgpb-notifications-count-span">'.$count.'</span>)';
 
146
  if ($withoutWrapper) {
147
  return $content;
148
  }
@@ -174,7 +184,27 @@ class SGPBNotificationCenter
174
  update_option('sgpb-all-dismissed-notifications', $allDismissedNotifications);
175
  $result = array();
176
  $result['content'] = self::displayNotifications(true);
177
- $result['count'] = count(self::getAllActiveNotifications());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
 
179
  echo json_encode($result);
180
  wp_die();
18
  add_filter('sgpbCronTimeoutSettings', array($this, 'cronAddMinutes'), 10, 1);
19
  add_action('sgpbGetNotifications', array($this, 'updateNotificationsArray'));
20
  add_action('wp_ajax_sgpb_dismiss_notification', array($this, 'dismissNotification'));
21
+ add_action('wp_ajax_sgpb_reactivate_notification', array($this, 'reactivateNotification'));
22
  add_action('admin_head', array($this, 'menuItemCounter'));
23
  }
24
 
25
  public function menuItemCounter()
26
  {
27
+ $count = count(self::getAllActiveNotifications(true));
28
+ $hidden = '';
29
+ if (empty($count)) {
30
+ $hidden = ' sgpb-hide-add-button';
31
+ }
32
+ echo "<script>
33
  jQuery(document).ready(function() {
34
  jQuery('.sgpb-menu-item-notification').remove();
35
+ jQuery('.dashicons-menu-icon-sgpb').next().append('<span class=\"sgpb-menu-item-notification".$hidden."\">".$count."</span>');
36
  });
37
  </script>";
 
38
  }
39
 
40
  public function setCronTimeout($cronTimeout)
63
  $content = AdminHelper::getFileFromURL($requestUrl);
64
  $content = json_decode($content, true);
65
  $content = apply_filters('sgpbExtraNotifications', $content);
66
+ // check later
67
+ /*if (empty($content)) {
68
+ update_option('sgpb-all-dismissed-notifications', array());
69
+ }*/
70
  $content = json_encode($content);
71
  update_option('sgpb-all-notifications-data', $content);
72
  }
99
  return $schedules;
100
  }
101
 
102
+ public static function getAllActiveNotifications($hideDismissed = false)
103
  {
104
  $activeNotifications = array();
105
  $notifications = get_option('sgpb-all-notifications-data');
112
  $dismissedNotifications = json_decode($dismissedNotifications, true);
113
  foreach ($notifications as $notification) {
114
  $id = @$notification['id'];
115
+ if ($hideDismissed) {
116
+ if (isset($dismissedNotifications[$id])) {
117
+ continue;
118
+ }
119
  }
120
  $activeNotifications[] = $notification;
121
  }
141
  return $content;
142
  }
143
 
144
+ $count = count(self::getAllActiveNotifications(true));
145
 
146
  foreach ($allNotifications as $notification) {
147
  $newNotification = new Notification();
152
  $content .= $newNotification->render();
153
  }
154
  $count = '(<span class="sgpb-notifications-count-span">'.$count.'</span>)';
155
+
156
  if ($withoutWrapper) {
157
  return $content;
158
  }
184
  update_option('sgpb-all-dismissed-notifications', $allDismissedNotifications);
185
  $result = array();
186
  $result['content'] = self::displayNotifications(true);
187
+ $result['count'] = count(self::getAllActiveNotifications(true));
188
+
189
+ echo json_encode($result);
190
+ wp_die();
191
+ }
192
+
193
+ public function reactivateNotification()
194
+ {
195
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
196
+
197
+ $notificationId = sanitize_text_field($_POST['id']);
198
+ $allDismissedNotifications = self::getAllDismissedNotifications();
199
+ if (isset($allDismissedNotifications[$notificationId])) {
200
+ unset($allDismissedNotifications[$notificationId]);
201
+ }
202
+ $allDismissedNotifications = json_encode($allDismissedNotifications);
203
+
204
+ update_option('sgpb-all-dismissed-notifications', $allDismissedNotifications);
205
+ $result = array();
206
+ $result['content'] = self::displayNotifications(true);
207
+ $result['count'] = count(self::getAllActiveNotifications(true));
208
 
209
  echo json_encode($result);
210
  wp_die();
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -41,15 +41,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
41
  'reviewUrl' => SG_POPUP_RATE_US_URL
42
  )
43
  );
44
-
45
- $defaultData = ConfigDataHelper::defaultData();
46
- $defaultData = $defaultData['customEditorContent']['css'];
47
- $localizeData[] = array(
48
- 'handle' => 'Backend.js',
49
- 'name' => 'SGPB_CSS_EDITOR_DEFAULT_CONTENT',
50
- 'data' => $defaultData
51
- );
52
-
53
  $allowPages = array(
54
  'popupType',
55
  'editpage',
41
  'reviewUrl' => SG_POPUP_RATE_US_URL
42
  )
43
  );
44
+
 
 
 
 
 
 
 
 
45
  $allowPages = array(
46
  'popupType',
47
  'editpage',
com/classes/extension/SgpbPopupExtensionRegister.php CHANGED
@@ -29,6 +29,7 @@ class SgpbPopupExtensionRegister
29
 
30
  return;
31
  }
 
32
  $pluginData['classPath'] = $classPath;
33
  $pluginData['className'] = $className;
34
  $pluginData['options'] = $options;
29
 
30
  return;
31
  }
32
+ $classPath = str_replace(SG_POPUP_PLUGIN_PATH, '', $classPath);
33
  $pluginData['classPath'] = $classPath;
34
  $pluginData['className'] = $className;
35
  $pluginData['options'] = $options;
com/classes/popups/SGPopup.php CHANGED
@@ -550,16 +550,22 @@ abstract class SGPopup
550
  $popupContent = $this->getContent();
551
 
552
  $defaultData = ConfigDataHelper::defaultData();
553
- $defaultDataJs = $defaultData['customEditorContent']['js'];
554
- $defaultDataCss = $defaultData['customEditorContent']['css'];
555
-
556
  $finalData = array('js' => array(), 'css' => array());
557
  $alreadySavedData = get_post_meta($popupId, 'sg_popup_scripts', true);
558
 
559
  // get styles
560
  $finalData['css'] = htmlspecialchars($data['sgpb-css-editor']);
 
 
 
 
 
561
  unset($data['sgpb-css-editor']);
562
- if ($finalData['css'] === $defaultDataCss[0]) {
 
563
  unset($finalData['css']);
564
  }
565
 
@@ -798,7 +804,10 @@ abstract class SGPopup
798
  }
799
  }
800
 
801
- $popupSavedData = array_merge($popupSavedData, self::getPopupOptionsById($popupId, $saveMode));
 
 
 
802
 
803
  return $popupSavedData;
804
  }
550
  $popupContent = $this->getContent();
551
 
552
  $defaultData = ConfigDataHelper::defaultData();
553
+ $defaultDataJs = $defaultData['customEditorContent']['js']['helperText'];
554
+ $defaultDataCss = $defaultData['customEditorContent']['css']['oldDefaultValue'];
555
+
556
  $finalData = array('js' => array(), 'css' => array());
557
  $alreadySavedData = get_post_meta($popupId, 'sg_popup_scripts', true);
558
 
559
  // get styles
560
  $finalData['css'] = htmlspecialchars($data['sgpb-css-editor']);
561
+ $defaultDataCss = htmlspecialchars($defaultDataCss[0]);
562
+
563
+ $defaultDataCss = preg_replace('/\s/', '', $defaultDataCss);
564
+ $temp = preg_replace('/\s/', '', $finalData['css']);
565
+
566
  unset($data['sgpb-css-editor']);
567
+
568
+ if ($temp == $defaultDataCss) {
569
  unset($finalData['css']);
570
  }
571
 
804
  }
805
  }
806
 
807
+ $popupOptions = self::getPopupOptionsById($popupId, $saveMode);
808
+ if (is_array($popupSavedData) && is_array($popupOptions)) {
809
+ $popupSavedData = array_merge($popupSavedData, $popupOptions);
810
+ }
811
 
812
  return $popupSavedData;
813
  }
com/config/config.php CHANGED
@@ -22,7 +22,7 @@ class SgpbPopupConfig
22
  self::addDefine('SG_POPUP_EXTENSIONS_URL', 'https://popup-builder.com/#extensions');
23
  self::addDefine('SG_POPUP_SUPPORT_URL', 'https://wordpress.org/support/plugin/popup-builder');
24
  self::addDefine('SG_POPUP_TICKET_URL', 'https://help.popup-builder.com');
25
- self::addDefine('SG_POPUP_RATE_US_URL', 'https://wordpress.org/support/plugin/popup-builder/reviews/?filter=5');
26
  self::addDefine('SG_POPUP_IFRAME_URL', 'https://popup-builder.com/downloads/iframe/');
27
  self::addDefine('SG_POPUP_SCROLL_URL', 'https://popup-builder.com/downloads/scroll/');
28
  self::addDefine('SG_POPUP_AD_BLOCK_URL', 'https://popup-builder.com/downloads/adblock/');
@@ -102,7 +102,6 @@ class SgpbPopupConfig
102
  self::addDefine('SGPB_SUBSCRIBERS_ERROR_TABLE_NAME', 'sgpb_subscription_error_log');
103
  self::addDefine('SGPB_CRON_REPEAT_INTERVAL', 1);
104
  self::addDefine('SGPB_NOTIFICATIONS_CRON_REPEAT_INTERVAL', 1);
105
- self::addDefine('SGPB_BANNER_CRON_TEXT_URL', 'https://popup-builder.com/sgpb-banner.php?banner=main');
106
  self::addDefine('SGPB_METABOX_BANNER_CRON_TEXT_URL', 'https://popup-builder.com/sgpb-banner.php?banner=sidebar1');
107
  self::addDefine('SGPB_FACEBOOK_APP_ID', 540547196484707);
108
  self::addDefine('SGPB_POPUP_TYPE_RESTRICTION', 'ageRestriction');
@@ -137,6 +136,8 @@ class SgpbPopupConfig
137
  self::addDefine('SGPB_TRANSIENT_POPUPS_TERMS', 'sgpbGetPopupsByTermSlug');
138
  self::addDefine('SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES', 'sgpbGetPostsAllCategories');
139
  self::addDefine('SGPB_REGISTERED_PLUGINS_PATHS_MODIFIED', 'sgpbModifiedRegisteredPluginsPaths1');
 
 
140
  self::popupTypesInit();
141
  }
142
 
22
  self::addDefine('SG_POPUP_EXTENSIONS_URL', 'https://popup-builder.com/#extensions');
23
  self::addDefine('SG_POPUP_SUPPORT_URL', 'https://wordpress.org/support/plugin/popup-builder');
24
  self::addDefine('SG_POPUP_TICKET_URL', 'https://help.popup-builder.com');
25
+ self::addDefine('SG_POPUP_RATE_US_URL', 'http://bit.ly/sgpbPluginSource');
26
  self::addDefine('SG_POPUP_IFRAME_URL', 'https://popup-builder.com/downloads/iframe/');
27
  self::addDefine('SG_POPUP_SCROLL_URL', 'https://popup-builder.com/downloads/scroll/');
28
  self::addDefine('SG_POPUP_AD_BLOCK_URL', 'https://popup-builder.com/downloads/adblock/');
102
  self::addDefine('SGPB_SUBSCRIBERS_ERROR_TABLE_NAME', 'sgpb_subscription_error_log');
103
  self::addDefine('SGPB_CRON_REPEAT_INTERVAL', 1);
104
  self::addDefine('SGPB_NOTIFICATIONS_CRON_REPEAT_INTERVAL', 1);
 
105
  self::addDefine('SGPB_METABOX_BANNER_CRON_TEXT_URL', 'https://popup-builder.com/sgpb-banner.php?banner=sidebar1');
106
  self::addDefine('SGPB_FACEBOOK_APP_ID', 540547196484707);
107
  self::addDefine('SGPB_POPUP_TYPE_RESTRICTION', 'ageRestriction');
136
  self::addDefine('SGPB_TRANSIENT_POPUPS_TERMS', 'sgpbGetPopupsByTermSlug');
137
  self::addDefine('SGPB_TRANSIENT_POPUPS_ALL_CATEGORIES', 'sgpbGetPostsAllCategories');
138
  self::addDefine('SGPB_REGISTERED_PLUGINS_PATHS_MODIFIED', 'sgpbModifiedRegisteredPluginsPaths1');
139
+ self::addDefine('SGPB_RATE_US_NOTIFICATION_ID', 'sgpbMainRateUsNotification');
140
+ self::addDefine('SGPB_SUPPORT_BANNER_NOTIFICATION_ID', 'sgpbMainSupportBanner');
141
  self::popupTypesInit();
142
  }
143
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.60');
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.61');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -850,8 +850,13 @@ class AdminHelper
850
  {
851
  $remoteData = wp_remote_get($imageUrl);
852
  $originalImageUrl = $imageUrl;
853
- if (is_wp_error($remoteData) || (isset($remoteData['response']) && $remoteData['response']['code'] != 200)) {
854
- $imageUrl = SG_POPUP_IMG_URL.'NoImage.png';
 
 
 
 
 
855
  }
856
  if (!$shouldNotConvertBase64) {
857
  $imageData = wp_remote_retrieve_body($remoteData);
@@ -1002,30 +1007,24 @@ class AdminHelper
1002
  return $result;
1003
  }
1004
 
1005
- public static function showReviewPopup()
1006
  {
1007
- $popupContent = '';
1008
- $maxOpenPopupStatus = self::shouldOpenForMaxOpenPopupMessage();
1009
-
1010
- /*if ($maxOpenPopupStatus) {
1011
- $popupContent = self::getMaxOpenPopupsMessage();
1012
- self::addContentToFooter($popupContent);
1013
- return;
1014
- }*/
1015
 
1016
- $shouldOpenForDays = self::shouldOpenReviewPopupForDays();
1017
-
1018
- if ($shouldOpenForDays) {
1019
- $popupContent = self::getMaxOpenDaysMessage();
1020
- self::addContentToBanner($popupContent);
1021
- return;
1022
- }
1023
  }
1024
 
1025
  public static function getMaxOpenDaysMessage()
1026
  {
1027
  $getUsageDays = self::getPopupUsageDays();
1028
- $firstHeader = '<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">'.__('Wow!', SG_POPUP_TEXT_DOMAIN).'</strong>'.__('You have been using Popup Builder on your site for '.$getUsageDays.' days', SG_POPUP_TEXT_DOMAIN).'</h1>';
1029
  $popupContent = self::getMaxOpenPopupContent($firstHeader, 'days');
1030
 
1031
  return $popupContent;
@@ -1104,86 +1103,9 @@ class AdminHelper
1104
  <p class="sgrb-review-mt20"><?php _e('Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!', SG_POPUP_TEXT_DOMAIN); ?></p>
1105
  </div>
1106
  <div class="sgpb-buttons-wrapper">
1107
- <button class="press press-grey sgpb-button-1 sg-already-did-review"><?php _e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1108
- <button class="press press-lightblue sgpb-button-3 sg-you-worth-it"><?php _e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1109
- <button class="press press-grey sgpb-button-2 sg-show-popup-period" data-message-type="<?php echo $type; ?>"><?php _e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
1110
- <div> </div>
1111
- </div>
1112
- <?php
1113
- $popupContent = ob_get_clean();
1114
-
1115
- return $popupContent;
1116
- }
1117
-
1118
- public static function getReviewBannerContent()
1119
- {
1120
- ob_start();
1121
- ?>
1122
- <style>
1123
- .sgpb-buttons-wrapper .press{
1124
- box-sizing:border-box;
1125
- cursor:pointer;
1126
- display:inline-block;
1127
- font-size:1em;
1128
- margin:0;
1129
- padding:0.5em 0.75em;
1130
- text-decoration:none;
1131
- transition:background 0.15s linear
1132
- }
1133
- .sgpb-buttons-wrapper .press-grey {
1134
- background-color:#9E9E9E;
1135
- border:2px solid #9E9E9E;
1136
- color: #FFF;
1137
- }
1138
- .sgpb-buttons-wrapper .press-lightblue {
1139
- background-color:#03A9F4;
1140
- border:2px solid #03A9F4;
1141
- color: #FFF;
1142
- }
1143
- .sgpb-review-wrapper .sgpb-buttons-wrapper {
1144
- text-align: center;
1145
- }
1146
- .sgpb-review-wrapper{
1147
- text-align: center;
1148
- padding: 20px;
1149
- padding-top: 0;
1150
- }
1151
- .sgpb-review-wrapper p {
1152
- color: black;
1153
- }
1154
- .sgpb-review-h1 {
1155
- font-size: 22px;
1156
- font-weight: normal;
1157
- line-height: 1.384;
1158
- }
1159
- .sgrb-review-h2 {
1160
- font-size: 20px;
1161
- font-weight: normal;
1162
- margin-top: 0 !important;
1163
- }
1164
- :root {
1165
- --main-bg-color: #1ac6ff;
1166
- }
1167
- .sgrb-review-strong{
1168
- color: var(--main-bg-color);
1169
- }
1170
- .sgrb-review-mt20{
1171
- margin-top: 20px
1172
- }
1173
- .sgpb-review-description h1:first-child {
1174
- font-size: 30px !important;
1175
- }
1176
- </style>
1177
- <div class="sgpb-review-wrapper">
1178
- <div class="sgpb-review-description">
1179
- <h1 class="sgpb-review-h1"><strong class="sgrb-review-strong"><?php _e('Wow!', SG_POPUP_TEXT_DOMAIN); ?></strong></h1>
1180
- <h1 class="sgpb-review-h1"><?php _e('You\'ve got a lot of conversion with Popup Builder! Congratulations!', SG_POPUP_TEXT_DOMAIN); ?></h1>
1181
- <h2 class="sgrb-review-h2"><?php _e('Share your positive feedback to keep our service up for better results!', SG_POPUP_TEXT_DOMAIN); ?></h2>
1182
- </div>
1183
- <div class="sgpb-buttons-wrapper">
1184
- <button class="press press-grey sgpb-button-1 sg-already-did-review"><?php _e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1185
- <button class="press press-lightblue sgpb-button-3 sg-you-worth-it"><?php _e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1186
- <button class="press press-grey sgpb-button-2 sg-show-popup-period" data-message-type="hide"><?php _e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
1187
  <div> </div>
1188
  </div>
1189
  <?php
@@ -1195,15 +1117,14 @@ class AdminHelper
1195
  public static function shouldOpenReviewPopupForDays()
1196
  {
1197
  $shouldOpen = true;
1198
- $dontShowAgain = get_option('SGPBCloseReviewPopup-1');
1199
  $periodNextTime = get_option('SGPBOpenNextTime');
1200
-
1201
- if (!$dontShowAgain) {
1202
  return true;
1203
  }
1204
  else {
1205
  return false;
1206
- }
1207
  // When period next time does not exits it means the user is old
1208
  if (!$periodNextTime) {
1209
  $usageDays = self::getPopupMainTableCreationDate();
@@ -1257,35 +1178,6 @@ class AdminHelper
1257
  return $days;
1258
  }
1259
 
1260
- public static function addContentToBanner($popupContent)
1261
- {
1262
- $popupContent = self::getReviewBannerContent();
1263
- echo '<div class="sgpb-wrapper sgpb-review-popup-banner-wrapper">'.$popupContent.'</div>';
1264
- }
1265
-
1266
- public static function addContentToFooter($popupContent)
1267
- {
1268
- if (function_exists('get_current_screen')) {
1269
- $screen = get_current_screen();
1270
- if ($screen->base == 'post') {
1271
- self::addContentToBanner($popupContent);
1272
- return;
1273
- }
1274
- }
1275
- add_action('admin_footer', function() use ($popupContent) {
1276
- $popupId = 0;
1277
- $events = array(array('onload'));
1278
- $events = json_encode($events);
1279
- $popupContent = '<div style="position:absolute;top: -999999999999999999999px;">
1280
- <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.$popupId.'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="">
1281
- <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
1282
- </div>
1283
- </div>';
1284
-
1285
- echo $popupContent;
1286
- });
1287
- }
1288
-
1289
  public static function shouldOpenForMaxOpenPopupMessage()
1290
  {
1291
  $counterMaxPopup = self::getMaxOpenPopupId();
@@ -1293,7 +1185,7 @@ class AdminHelper
1293
  if (empty($counterMaxPopup)) {
1294
  return false;
1295
  }
1296
- $dontShowAgain = get_option('SGPBCloseReviewPopup-1');
1297
  $maxCountDefine = get_option('SGPBMaxOpenCount');
1298
 
1299
  if (!$maxCountDefine) {
@@ -1333,7 +1225,7 @@ class AdminHelper
1333
  $maxCountDefine = $counterMaxPopup['maxCount'];
1334
  }
1335
 
1336
- $firstHeader = __('<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">Wow!</strong> <b>Popup Builder</b> plugin helped you to share your message via <strong class="sgrb-review-strong">'.$popupTitle.'</strong> popup with your users for <strong class="sgrb-review-strong">'.$maxCountDefine.' times!</strong></h1>', SG_POPUP_TEXT_DOMAIN);
1337
  $popupContent = self::getMaxOpenPopupContent($firstHeader, 'count');
1338
 
1339
  return $popupContent;
@@ -1784,10 +1676,10 @@ class AdminHelper
1784
 
1785
  // get scripts
1786
  $jsPostMeta = @$postMeta['js'];
1787
- $jsDefaultData = $defaultData['customEditorContent']['js'];
1788
- $customScripts = '<script id="sgpb-custom-script-'.$popupId.'">';
1789
  $finalContent = '';
1790
  if (!empty($jsPostMeta)) {
 
1791
  foreach ($jsDefaultData as $key => $value) {
1792
  $eventName = 'sgpb'.$key;
1793
  $content = @$jsPostMeta['sgpb-'.$key];
@@ -1803,23 +1695,25 @@ class AdminHelper
1803
  $finalContent .= '};';
1804
  $finalContent .= '});';
1805
  }
 
 
 
1806
  }
1807
- $customScripts .= $finalContent;
1808
- $customScripts .= '</script>';
1809
 
1810
  // get styles
1811
  $cssPostMeta = @$postMeta['css'];
1812
- $customStyles = '<style id="sgpb-custom-style-'.$popupId.'">';
1813
  $finalContent = '';
1814
  if (!empty($cssPostMeta)) {
 
1815
  $finalContent = str_replace('popupId', $popupId, $cssPostMeta);
1816
  $finalContent = html_entity_decode($finalContent);
 
 
 
 
1817
  }
1818
- $customStyles .= $finalContent;
1819
- $customStyles .= '</style>';
1820
 
1821
- $finalResult .= $customScripts;
1822
- $finalResult .= $customStyles;
1823
 
1824
  return $finalResult;
1825
  }
850
  {
851
  $remoteData = wp_remote_get($imageUrl);
852
  $originalImageUrl = $imageUrl;
853
+ if (is_wp_error($remoteData) && isset($remoteData['response']) && $remoteData['response']['code'] == 404) {
854
+ if ($shouldNotConvertBase64) {
855
+ $imageUrl = SG_POPUP_IMG_URL.'NoImage.png';
856
+ }
857
+ }
858
+ else {
859
+ $imageUrl = $originalImageUrl;
860
  }
861
  if (!$shouldNotConvertBase64) {
862
  $imageData = wp_remote_retrieve_body($remoteData);
1007
  return $result;
1008
  }
1009
 
1010
+ public static function supportBannerNotification()
1011
  {
1012
+ $content = '<div class="sgpb-support-notification-wrapper sgpb-wrapper"><h4 class="sgpb-support-notification-title">'.__('Need some help?', SG_POPUP_TEXT_DOMAIN).'</h4>';
1013
+ $content .= '<h4 class="sgpb-support-notification-title">'.__('Let us know what you think.', SG_POPUP_TEXT_DOMAIN).'</h4>';
1014
+ $content .= '<a class="btn btn-info" target="_blank" href="'.SG_POPUP_RATE_US_URL.'"><span class="dashicons sgpb-dashicons-heart sgpb-info-text-white"></span><span class="sg-info-text">'.__('Rate Us', SG_POPUP_TEXT_DOMAIN).'</span></a>';
1015
+ $content .= '<a class="btn btn-info" target="_blank" href="'.SG_POPUP_TICKET_URL.'"><span class="dashicons sgpb-dashicons-megaphone sgpb-info-text-white"></span>'.__('Support Potal', SG_POPUP_TEXT_DOMAIN).'</a>';
1016
+ $content .= '<a class="btn btn-info" target="_blank" href="https://wordpress.org/support/plugin/popup-builder"><span class="dashicons sgpb-dashicons-admin-plugins sgpb-info-text-white"></span>'.__('Support Forum', SG_POPUP_TEXT_DOMAIN).'</a>';
1017
+ $content .= '<a class="btn btn-info" target="_blank" href="'.SG_POPUP_STORE_URL.'"><span class="dashicons sgpb-dashicons-editor-help sgpb-info-text-white"></span>'.__('LIVE chat', SG_POPUP_TEXT_DOMAIN).'</a>';
1018
+ $content .= '<a class="btn btn-info" target="_blank" href="mailto:support@popup-builder.com?subject=Hello"><span class="dashicons sgpb-dashicons-email-alt sgpb-info-text-white"></span>'.__('Email', SG_POPUP_TEXT_DOMAIN).'</a></div>';
1019
+ $content .= '<div class="sgpb-support-notification-dont-show">'.__('Bored of this?').'<a class="sgpb-dont-show-again-support-notification" href="javascript:void(0)">'.__(' Press here ').'</a>'.__('and we will not show it again!').'</div>';
1020
 
1021
+ return $content;
 
 
 
 
 
 
1022
  }
1023
 
1024
  public static function getMaxOpenDaysMessage()
1025
  {
1026
  $getUsageDays = self::getPopupUsageDays();
1027
+ $firstHeader = __('<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">This is great!</strong> We have noticed that you are using Popup Builder plugin on your site for '.$getUsageDays.' days, we are thankful for that.</h1>', SG_POPUP_TEXT_DOMAIN);
1028
  $popupContent = self::getMaxOpenPopupContent($firstHeader, 'days');
1029
 
1030
  return $popupContent;
1103
  <p class="sgrb-review-mt20"><?php _e('Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!', SG_POPUP_TEXT_DOMAIN); ?></p>
1104
  </div>
1105
  <div class="sgpb-buttons-wrapper">
1106
+ <button class="press press-grey sgpb-button-1 sgpb-close-promo-notification" data-action="sg-already-did-review"><?php _e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1107
+ <button class="press press-lightblue sgpb-button-3 sgpb-close-promo-notification" data-action="sg-you-worth-it"><?php _e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1108
+ <button class="press press-grey sgpb-button-2 sgpb-close-promo-notification" data-action="sg-show-popup-period" data-message-type="<?php echo $type; ?>"><?php _e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1109
  <div> </div>
1110
  </div>
1111
  <?php
1117
  public static function shouldOpenReviewPopupForDays()
1118
  {
1119
  $shouldOpen = true;
1120
+ $dontShowAgain = get_option('SGPBCloseReviewPopup-notification');
1121
  $periodNextTime = get_option('SGPBOpenNextTime');
1122
+ /*if (!$dontShowAgain) {
 
1123
  return true;
1124
  }
1125
  else {
1126
  return false;
1127
+ }*/
1128
  // When period next time does not exits it means the user is old
1129
  if (!$periodNextTime) {
1130
  $usageDays = self::getPopupMainTableCreationDate();
1178
  return $days;
1179
  }
1180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
  public static function shouldOpenForMaxOpenPopupMessage()
1182
  {
1183
  $counterMaxPopup = self::getMaxOpenPopupId();
1185
  if (empty($counterMaxPopup)) {
1186
  return false;
1187
  }
1188
+ $dontShowAgain = get_option('SGPBCloseReviewPopup-notification');
1189
  $maxCountDefine = get_option('SGPBMaxOpenCount');
1190
 
1191
  if (!$maxCountDefine) {
1225
  $maxCountDefine = $counterMaxPopup['maxCount'];
1226
  }
1227
 
1228
+ $firstHeader = __('<h1 class="sgpb-review-h1"><strong class="sgrb-review-strong">Awesome news!</strong> <b>Popup Builder</b> plugin helped you to share your message via <strong class="sgrb-review-strong">'.$popupTitle.'</strong> popup with your visitors for <strong class="sgrb-review-strong">'.$maxCountDefine.' times!</strong></h1>', SG_POPUP_TEXT_DOMAIN);
1229
  $popupContent = self::getMaxOpenPopupContent($firstHeader, 'count');
1230
 
1231
  return $popupContent;
1676
 
1677
  // get scripts
1678
  $jsPostMeta = @$postMeta['js'];
1679
+ $jsDefaultData = $defaultData['customEditorContent']['js']['helperText'];
 
1680
  $finalContent = '';
1681
  if (!empty($jsPostMeta)) {
1682
+ $customScripts = '<script id="sgpb-custom-script-'.$popupId.'">';
1683
  foreach ($jsDefaultData as $key => $value) {
1684
  $eventName = 'sgpb'.$key;
1685
  $content = @$jsPostMeta['sgpb-'.$key];
1695
  $finalContent .= '};';
1696
  $finalContent .= '});';
1697
  }
1698
+ $customScripts .= $finalContent;
1699
+ $customScripts .= '</script>';
1700
+ $finalResult .= $customScripts;
1701
  }
 
 
1702
 
1703
  // get styles
1704
  $cssPostMeta = @$postMeta['css'];
1705
+
1706
  $finalContent = '';
1707
  if (!empty($cssPostMeta)) {
1708
+ $customStyles = '<style id="sgpb-custom-style-'.$popupId.'">';
1709
  $finalContent = str_replace('popupId', $popupId, $cssPostMeta);
1710
  $finalContent = html_entity_decode($finalContent);
1711
+
1712
+ $customStyles .= $finalContent;
1713
+ $customStyles .= '</style>';
1714
+ $finalResult .= $customStyles;
1715
  }
 
 
1716
 
 
 
1717
 
1718
  return $finalResult;
1719
  }
com/helpers/ConfigDataHelper.php CHANGED
@@ -297,23 +297,40 @@ class ConfigDataHelper
297
  );
298
 
299
  $data['customEditorContent'] = array(
300
- 'js' => array(
301
- 'ShouldOpen' => '<b>Opening events:</b><br><br><b>#1</b> Add the code you want to run <b>before</b> the popup opening. This will be a condition for opening the popup, that is processed and defined before the popup opening. If the return value is <b>"true"</b> then the popup will open, if the value is <b>"false"</b> the popup won\'t open.',
302
- 'WillOpen' => '<b>#2</b> Add the code you want to run <b>before</b> the popup opens. This will be the code that will work in the process of opening the popup. <b>true/false</b> conditions will not work in this phase.',
303
- 'DidOpen' => '<b>#3</b> Add the code you want to run <b>after</b> the popup opens. This code will work when the popup is already open on the page.',
304
- 'ShouldClose' => '<b>Closing events:</b><br><br><b>#1</b> Add the code that will be fired <b>before</b> the popup closes. This will be a condition for the popup closing. If the return value is <b>"true"</b> then the popup will close, if the value is <b>"false"</b> the popup won\'t close.',
305
- 'WillClose' => '<b>#2</b> Add the code you want to run <b>before</b> the popup closes. This will be the code that will work in the process of closing the popup. <b>true/false</b> conditions will not work in this phase.',
306
- 'DidClose' => '<b>#3</b> Add the code you want to run <b>after</b> the popup closes. This code will work when the popup is already closed on the page.'
 
 
 
 
 
307
  ),
308
  'css' => array(
309
- '/*popup content wrapper*/'."\n".
310
- '.sgpb-content-popupId {'."\n\n".'}'."\n\n".
 
 
311
 
312
- '/*overlay*/'."\n".
313
- '.sgpb-popup-overlay-popupId {'."\n\n".'}'."\n\n".
314
 
315
- '/*popup wrapper*/'."\n".
316
- '.sgpb-popup-builder-content-popupId {'."\n\n".'}'."\n\n"
 
 
 
 
 
 
 
 
 
 
317
  )
318
  );
319
 
297
  );
298
 
299
  $data['customEditorContent'] = array(
300
+ 'js' => array(
301
+ 'helperText' => array(
302
+ 'ShouldOpen' => '<b>Opening events:</b><br><br><b>#1</b> Add the code you want to run <b>before</b> the popup opening. This will be a condition for opening the popup, that is processed and defined before the popup opening. If the return value is <b>"true"</b> then the popup will open, if the value is <b>"false"</b> the popup won\'t open.',
303
+ 'WillOpen' => '<b>#2</b> Add the code you want to run <b>before</b> the popup opens. This will be the code that will work in the process of opening the popup. <b>true/false</b> conditions will not work in this phase.',
304
+ 'DidOpen' => '<b>#3</b> Add the code you want to run <b>after</b> the popup opens. This code will work when the popup is already open on the page.',
305
+ 'ShouldClose' => '<b>Closing events:</b><br><br><b>#1</b> Add the code that will be fired <b>before</b> the popup closes. This will be a condition for the popup closing. If the return value is <b>"true"</b> then the popup will close, if the value is <b>"false"</b> the popup won\'t close.',
306
+ 'WillClose' => '<b>#2</b> Add the code you want to run <b>before</b> the popup closes. This will be the code that will work in the process of closing the popup. <b>true/false</b> conditions will not work in this phase.',
307
+ 'DidClose' => '<b>#3</b> Add the code you want to run <b>after</b> the popup closes. This code will work when the popup is already closed on the page.'
308
+ ),
309
+ 'description' => array(
310
+ __('If you need the popup id number in the custom code, you may use the following variable to get the ID: <code>popupId</code>', SG_POPUP_TEXT_DOMAIN)
311
+ )
312
  ),
313
  'css' => array(
314
+ // we need this oldDefaultValue for the backward compatibility
315
+ 'oldDefaultValue' => array(
316
+ '/*popup content wrapper*/'."\n".
317
+ '.sgpb-content-popupId {'."\n\n".'}'."\n\n".
318
 
319
+ '/*overlay*/'."\n".
320
+ '.sgpb-popup-overlay-popupId {'."\n\n".'}'."\n\n".
321
 
322
+ '/*popup wrapper*/'."\n".
323
+ '.sgpb-popup-builder-content-popupId {'."\n\n".'}'."\n\n"
324
+ ),
325
+ 'description' => array(
326
+ __('If you need the popup id number in the custom code, you may use the following variable to get the ID: <code>popupId</code>', SG_POPUP_TEXT_DOMAIN),
327
+ '<br>/*popup content wrapper*/',
328
+ '.sgpb-content-popupId',
329
+ '<br>/*overlay*/',
330
+ '.sgpb-popup-overlay-popupId',
331
+ '<br>/*popup wrapper*/',
332
+ '.sgpb-popup-builder-content-popupId'
333
+ )
334
  )
335
  );
336
 
com/helpers/Functions.php CHANGED
@@ -254,6 +254,10 @@ class Functions
254
  {
255
  global $SGPB_TRANSIENT_CONFIG;
256
 
 
 
 
 
257
  foreach ($SGPB_TRANSIENT_CONFIG as $eachTransient) {
258
  delete_transient($eachTransient);
259
  }
254
  {
255
  global $SGPB_TRANSIENT_CONFIG;
256
 
257
+ if (empty($SGPB_TRANSIENT_CONFIG)) {
258
+ return true;
259
+ }
260
+
261
  foreach ($SGPB_TRANSIENT_CONFIG as $eachTransient) {
262
  delete_transient($eachTransient);
263
  }
com/libs/EDD_SL_Plugin_Updater.php CHANGED
@@ -115,7 +115,7 @@ class EDD_SL_Plugin_Updater {
115
  // Remove our filter on the site transient
116
  remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
117
  $update_cache = get_site_transient( 'update_plugins' );
118
- $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
119
  if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
120
  $version_info = $this->get_cached_version_info();
121
  if ( false === $version_info ) {
@@ -368,4 +368,4 @@ class EDD_SL_Plugin_Updater {
368
  private function verify_ssl() {
369
  return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
370
  }
371
- }
115
  // Remove our filter on the site transient
116
  remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
117
  $update_cache = get_site_transient( 'update_plugins' );
118
+ $update_cache = is_object( $update_cache ) ? $update_cache : new \stdClass();
119
  if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
120
  $version_info = $this->get_cached_version_info();
121
  if ( false === $version_info ) {
368
  private function verify_ssl() {
369
  return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
370
  }
371
+ }
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.60
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.61
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/popupAdminStyles.css CHANGED
@@ -1480,7 +1480,7 @@ input:checked + .sgpb-slider:before {
1480
  }
1481
 
1482
  .sgpb-hide-add-button {
1483
- display: none;
1484
  }
1485
 
1486
  .sgpb-tab-content-options label {
@@ -2405,14 +2405,14 @@ input:checked + .sgpb-slider:before {
2405
 
2406
  /* notification center styles */
2407
  .sgpb-notification-center-wrapper {
2408
- display: inline-block;
2409
- max-width: 1240px;
2410
- width: 98%;
2411
- margin: 20px 0 1px;
2412
- /*padding: 20px 20px 0;*/
2413
- border: 1px solid #e5e5e5;
2414
- background-color: #fdfdfd;
2415
- box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
2416
  }
2417
 
2418
  .sgpb-notification-center-wrapper h3 {
@@ -2497,3 +2497,29 @@ input:checked + .sgpb-slider:before {
2497
  text-align: center;
2498
  z-index: 26;
2499
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1480
  }
1481
 
1482
  .sgpb-hide-add-button {
1483
+ display: none !important;
1484
  }
1485
 
1486
  .sgpb-tab-content-options label {
2405
 
2406
  /* notification center styles */
2407
  .sgpb-notification-center-wrapper {
2408
+ margin-right: 21px;
2409
+ padding: 20px 20px 0 !important;
2410
+ border: 1px solid
2411
+ #e5e5e5;
2412
+ background-color:
2413
+ #fdfdfd;
2414
+ box-shadow: 0 1px 1px
2415
+ rgba(0, 0, 0, .04);
2416
  }
2417
 
2418
  .sgpb-notification-center-wrapper h3 {
2497
  text-align: center;
2498
  z-index: 26;
2499
  }
2500
+
2501
+ .sgpb-support-notification-wrapper {
2502
+ text-align: center;
2503
+ }
2504
+
2505
+ .sgpb-support-notification-wrapper .btn-info {
2506
+ margin-right: 10px;
2507
+ }
2508
+
2509
+ .sgpb-support-notification-wrapper h4:nth-child(2) {
2510
+ margin-bottom: 25px;
2511
+ }
2512
+
2513
+ .sgpb-support-notification-dont-show {
2514
+ font-size: 12px !important;
2515
+ text-align: right;
2516
+ margin-top: 10px;
2517
+ }
2518
+
2519
+ .sgpb-support-notification-dont-show a {
2520
+ font-size: 12px !important;
2521
+ }
2522
+
2523
+ .sgpb-review-description .sgrb-review-h2 {
2524
+ margin-top: 0 !important;
2525
+ }
public/js/Backend.js CHANGED
@@ -109,7 +109,7 @@ SGPBBackend.prototype.downloadSystemInfoFile = function() {
109
  }
110
 
111
  SGPBBackend.prototype.resetCssEditorContent = function() {
112
- jQuery('.editor-content-css').val(SGPB_CSS_EDITOR_DEFAULT_CONTENT[0]);
113
  }
114
 
115
  SGPBBackend.prototype.popupBuilderButton = function()
109
  }
110
 
111
  SGPBBackend.prototype.resetCssEditorContent = function() {
112
+ jQuery('.editor-content-css').val('');
113
  }
114
 
115
  SGPBBackend.prototype.popupBuilderButton = function()
public/js/Banner.js CHANGED
@@ -15,17 +15,6 @@ SGPBBanner.prototype.close = function() {
15
  jQuery('.sgpb-info-close').click(function() {
16
  jQuery('.sgpb-banner-wrapper').remove();
17
  });
18
-
19
- jQuery('.sgpb-dont-show-again').click(function() {
20
- var data = {
21
- action: 'sgpb_close_banner',
22
- nonce: SGPB_JS_PARAMS.nonce,
23
- };
24
-
25
- jQuery.post(ajaxurl, data, function(response) {
26
- jQuery('.sgpb-banner-wrapper').remove();
27
- });
28
- });
29
  };
30
 
31
  SGPBBanner.prototype.closeLicenseNotice = function() {
15
  jQuery('.sgpb-info-close').click(function() {
16
  jQuery('.sgpb-banner-wrapper').remove();
17
  });
 
 
 
 
 
 
 
 
 
 
 
18
  };
19
 
20
  SGPBBanner.prototype.closeLicenseNotice = function() {
public/js/MediaButton.js CHANGED
@@ -1,24 +1,14 @@
1
  function SGPBMediaButton(){}
2
  SGPBMediaButton.prototype.init=function()
3
- {this.tinymceButton();this.openMediaButtonPopup();this.openAskReviewBannerPopup();};SGPBMediaButton.prototype.tinymceButton=function()
4
  {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderEditorButton')!=-1){return;}
5
  editor.settings.toolbar1+=', popupBuilderEditorButton';editor.addButton('popupBuilderEditorButton',{icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb sgpb-tinymce-button',onclick:function(){that.mediaButtonPopup();}});});};SGPBMediaButton.prototype.openMediaButtonPopup=function()
6
  {var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').unbind('click').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
7
  {var select2Init=1;var that=this;var hiddenDivId=jQuery(currentTag).attr('data-id')||'sgpb-hidden-media-popup';var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setSrcElement',hiddenDivId);popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(mediaButtonParams.currentPostType!=mediaButtonParams.popupBuilderPostType){jQuery('.sgpb-insert-popup-event').addClass('js-sg-select2');if(select2Init==1){that.popupSelect2();}
8
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
9
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
10
- that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.openAskReviewBannerPopup=function()
11
- {var that=this;var select2Init=1;var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setShadowSpread',14);popupConfigObj.magicCall('setOverlayAddClass','sgpb-theme-1-overlay');popupConfigObj.magicCall('setContentShadowColor','#0009');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setMaxWidth','700px');popupConfigObj.magicCall('setOverlayShouldClose',false);popupConfigObj.magicCall('setSrcElement','sg-popup-content-wrapper-0');if(jQuery('#sg-popup-content-wrapper-0').length){var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();}
12
- else{that.closingActions();}
13
- jQuery(window).bind('sgpbDidOpen',function(){that.closingActions(popup);});};SGPBMediaButton.prototype.closingActions=function(popup)
14
- {jQuery('.sg-already-did-review').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
15
- if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}});});});jQuery('.sg-you-worth-it').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
16
- if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}
17
- window.location=SGPB_JS_EXTENSIONS_PARAMS.reviewUrl;});});});jQuery('.sg-show-popup-period').click(function(){jQuery('.sgpb-review-popup-banner-wrapper').remove();var messageType=jQuery(this).attr('data-message-type');var ajaxData={action:'sgpb_change_review_popup_show_period',messageType:messageType,nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
18
- if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}})});jQuery('.sgpb-dont-show-ask-review-popup').click(function(){var ajaxData={action:'sgpb_hide_ask_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(res){popup.close();}})});}
19
- SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
20
- {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.closeReviewPopup=function(popup)
21
- {jQuery('.sgpb-button-2').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
22
  {var insidePopup=false;if(mediaButtonParams.currentPostType==mediaButtonParams.popupBuilderPostType){insidePopup=true;}
23
  jQuery('.sgpb-insert-popup-js').unbind('click').bind('click',function(){var selectedContent='';var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
24
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
@@ -34,4 +24,4 @@ jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_ed
34
  {if(!jQuery('.js-sg-select2').length){return;}
35
  jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){if(typeof SGPB_JS_PARAMS=='undefined'){return;}
36
  options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
37
- jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});mediaButton.openAskReviewBannerPopup();});
1
  function SGPBMediaButton(){}
2
  SGPBMediaButton.prototype.init=function()
3
+ {this.tinymceButton();this.openMediaButtonPopup();};SGPBMediaButton.prototype.tinymceButton=function()
4
  {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderEditorButton')!=-1){return;}
5
  editor.settings.toolbar1+=', popupBuilderEditorButton';editor.addButton('popupBuilderEditorButton',{icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb sgpb-tinymce-button',onclick:function(){that.mediaButtonPopup();}});});};SGPBMediaButton.prototype.openMediaButtonPopup=function()
6
  {var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').unbind('click').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
7
  {var select2Init=1;var that=this;var hiddenDivId=jQuery(currentTag).attr('data-id')||'sgpb-hidden-media-popup';var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setSrcElement',hiddenDivId);popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(mediaButtonParams.currentPostType!=mediaButtonParams.popupBuilderPostType){jQuery('.sgpb-insert-popup-event').addClass('js-sg-select2');if(select2Init==1){that.popupSelect2();}
8
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
9
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
10
+ that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
11
+ {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
 
 
 
 
 
 
 
 
 
 
12
  {var insidePopup=false;if(mediaButtonParams.currentPostType==mediaButtonParams.popupBuilderPostType){insidePopup=true;}
13
  jQuery('.sgpb-insert-popup-js').unbind('click').bind('click',function(){var selectedContent='';var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
14
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
24
  {if(!jQuery('.js-sg-select2').length){return;}
25
  jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){if(typeof SGPB_JS_PARAMS=='undefined'){return;}
26
  options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
27
+ jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});});
public/js/NotificationCenter.js CHANGED
@@ -6,6 +6,7 @@ SGPBNotificationCenter.prototype.init = function()
6
  {
7
  this.dismiss();
8
  this.reactivate();
 
9
  };
10
 
11
  SGPBNotificationCenter.prototype.dismiss = function()
@@ -29,7 +30,7 @@ SGPBNotificationCenter.prototype.dismiss = function()
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
  });
@@ -50,13 +51,56 @@ SGPBNotificationCenter.prototype.reactivate = function()
50
  };
51
 
52
  jQuery.post(ajaxurl, data, function(response) {
 
53
  jQuery('.sgpb-each-notification-wrapper-js').empty();
54
- jQuery('.sgpb-each-notification-wrapper-js').html(response);
 
 
 
55
  that.init();
56
  });
57
  });
58
  };
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  jQuery(document).ready(function() {
61
  var notificationCenter = new SGPBNotificationCenter();
62
  notificationCenter.init();
6
  {
7
  this.dismiss();
8
  this.reactivate();
9
+ this.closePromotionalNotification();
10
  };
11
 
12
  SGPBNotificationCenter.prototype.dismiss = function()
30
  jQuery('.sgpb-notifications-count-span').html(response['count']);
31
  jQuery('.sgpb-menu-item-notification').html(response['count']);
32
  if (response['count'] == 0) {
33
+ jQuery('.sgpb-menu-item-notification').addClass('sgpb-hide-add-button');
34
  }
35
  that.init();
36
  });
51
  };
52
 
53
  jQuery.post(ajaxurl, data, function(response) {
54
+ response = JSON.parse(response);
55
  jQuery('.sgpb-each-notification-wrapper-js').empty();
56
+ jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);
57
+ jQuery('.sgpb-notifications-count-span').html(response['count']);
58
+ jQuery('.sgpb-menu-item-notification').removeClass('sgpb-hide-add-button');
59
+ jQuery('.sgpb-menu-item-notification').html(response['count']);
60
  that.init();
61
  });
62
  });
63
  };
64
 
65
+ SGPBNotificationCenter.prototype.closePromotionalNotification = function()
66
+ {
67
+ var that = this;
68
+ jQuery('.sgpb-dont-show-again-support-notification').click(function() {
69
+ var currentNotification = jQuery(this).parents('.sgpb-single-notification-wrapper');
70
+ currentNotification.addClass('sgpb-disabled');
71
+ var data = {
72
+ action: 'sgpb_close_banner',
73
+ nonce: SGPB_JS_PARAMS.nonce,
74
+ };
75
+
76
+ jQuery.post(ajaxurl, data, function(response) {
77
+ currentNotification.remove();
78
+ });
79
+ });
80
+ jQuery('.sgpb-close-promo-notification').each(function () {
81
+ jQuery(this).click(function() {
82
+ jQuery(this).parents('.sgpb-single-notification-wrapper').addClass('sgpb-disabled');
83
+ var dataAction = jQuery(this).attr('data-action');
84
+ if (dataAction == 'sg-show-popup-period') {
85
+ jQuery(this).parents('.sgpb-single-notification-wrapper').find('.sgpb-dismiss-notification-js').click();
86
+ return true;
87
+ }
88
+ var ajaxData = {
89
+ action: 'sgpb_dont_show_review_popup',
90
+ nonce: SGPB_JS_PARAMS.nonce
91
+ };
92
+ jQuery.post(SGPB_JS_PARAMS.url, ajaxData, function (res) {
93
+ if (jQuery('.sgpb-review-wrapper').length) {
94
+ jQuery('.sgpb-review-wrapper').parents('.sgpb-single-notification-wrapper').remove();
95
+ }
96
+ if (dataAction == 'sg-you-worth-it') {
97
+ window.open(SGPB_JS_EXTENSIONS_PARAMS.reviewUrl, '_blank');
98
+ }
99
+ });
100
+ });
101
+ });
102
+ };
103
+
104
  jQuery(document).ready(function() {
105
  var notificationCenter = new SGPBNotificationCenter();
106
  notificationCenter.init();
public/views/customEditor.php CHANGED
@@ -8,13 +8,10 @@ $jsDefaultData = $defaultData['customEditorContent']['js'];
8
  $cssDefaultData = $defaultData['customEditorContent']['css'];
9
 
10
  $savedData = get_post_meta($popupId , 'sg_popup_scripts', true);
11
- $editorStaticText = array(
12
- __('If you need the popup id number in the custom code, you may use the following variable to get the ID: <code>popupId</code>', SG_POPUP_TEXT_DOMAIN)
13
- );
14
  ?>
15
 
16
- <p><?php _e('This section is for adding custom codes (CSS or JS) for the popup, it requires some coding knowledge', SG_POPUP_TEXT_DOMAIN);?></p>.
17
- <p><?php _e('You may use your custom codes for extra actions connected to the popup opening (before, after, etc.) in the fields below', SG_POPUP_TEXT_DOMAIN);?></p>.
18
 
19
  <div class="sgpb-wrapper">
20
  <!-- editor buttons -->
@@ -28,13 +25,13 @@ $editorStaticText = array(
28
  <div id="sgpb-editor-options-tab-content-wrapper-1" class="sgpb-editor-options-tab-content-wrapper" style="display: block;">
29
  <div class="editor-static-text">
30
  <?php
31
- foreach ($editorStaticText as $text) { ?>
32
  <div><?php echo $text; ?></div>
33
  <?php }
34
  ?></div>
35
  <br>
36
 
37
- <?php foreach ($jsDefaultData as $key => $value) {?>
38
  <div class="editor-static-text"><div><?php echo $value; ?></div></div>
39
  <div class="editor-static-text"><div>
40
  <textarea class="wp-editor-area editor-content"
@@ -54,29 +51,23 @@ $editorStaticText = array(
54
  <div id="sgpb-editor-options-tab-content-wrapper-2" class="sgpb-editor-options-tab-content-wrapper" style="display: none;">
55
  <div class="editor-static-text">
56
  <?php
57
- foreach ($editorStaticText as $text) { ?>
58
  <div><?php echo $text; ?></div>
59
  <?php }
60
  ?></div>
61
  <br>
62
 
63
- <input class="btn reset-button col-md-1" data-attr-custom-tab="reset" value="Reset" readonly onclick="SGPBBackend.prototype.resetCssEditorContent()">
64
  <div class="editor-static-text"><div></div></div>
 
65
  <div class="editor-static-text"><div>
66
  <textarea class="wp-editor-area editor-content editor-content-css"
67
  placeholder=" #... type your code"
68
  mode="<?php echo $editorModeCss; ?>"
69
- name="sgpb-css-editor"
70
- ><?php
71
- if (!isset($savedData['css'])) {
72
- foreach ($cssDefaultData as $value) {
73
- echo $value;
74
- }
75
- }
76
- else {
77
- echo $savedData['css'];
78
- }
79
- ?></textarea>
80
  </div></div>
81
  </div>
82
  </div>
8
  $cssDefaultData = $defaultData['customEditorContent']['css'];
9
 
10
  $savedData = get_post_meta($popupId , 'sg_popup_scripts', true);
 
 
 
11
  ?>
12
 
13
+ <p><?php _e('This section is for adding custom codes (CSS or JS) for the popup, it requires some coding knowledge', SG_POPUP_TEXT_DOMAIN);?>.</p>
14
+ <p><?php _e('You may use your custom codes for extra actions connected to the popup opening (before, after, etc.) in the fields below', SG_POPUP_TEXT_DOMAIN);?>.</p>
15
 
16
  <div class="sgpb-wrapper">
17
  <!-- editor buttons -->
25
  <div id="sgpb-editor-options-tab-content-wrapper-1" class="sgpb-editor-options-tab-content-wrapper" style="display: block;">
26
  <div class="editor-static-text">
27
  <?php
28
+ foreach ($jsDefaultData['description'] as $text) { ?>
29
  <div><?php echo $text; ?></div>
30
  <?php }
31
  ?></div>
32
  <br>
33
 
34
+ <?php foreach ($jsDefaultData['helperText'] as $key => $value) {?>
35
  <div class="editor-static-text"><div><?php echo $value; ?></div></div>
36
  <div class="editor-static-text"><div>
37
  <textarea class="wp-editor-area editor-content"
51
  <div id="sgpb-editor-options-tab-content-wrapper-2" class="sgpb-editor-options-tab-content-wrapper" style="display: none;">
52
  <div class="editor-static-text">
53
  <?php
54
+ foreach ($cssDefaultData['description'] as $text) { ?>
55
  <div><?php echo $text; ?></div>
56
  <?php }
57
  ?></div>
58
  <br>
59
 
60
+ <input class="btn reset-button col-md-1" data-attr-custom-tab="reset" value="Clear" readonly onclick="SGPBBackend.prototype.resetCssEditorContent()">
61
  <div class="editor-static-text"><div></div></div>
62
+
63
  <div class="editor-static-text"><div>
64
  <textarea class="wp-editor-area editor-content editor-content-css"
65
  placeholder=" #... type your code"
66
  mode="<?php echo $editorModeCss; ?>"
67
+ name="sgpb-css-editor"><?php
68
+ if (isset($savedData['css'])) {
69
+ echo $savedData['css'];
70
+ }?></textarea>
 
 
 
 
 
 
 
71
  </div></div>
72
  </div>
73
  </div>
public/views/mainRateUsBanner.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
- use sgpb\AdminHelper;
3
- $upgradeLink = SG_POPUP_RATE_US_URL;
4
- $buttonText = 'RATE US';
5
- if (SGPB_POPUP_PKG == SGPB_POPUP_PKG_FREE) {
6
- $upgradeLink = SG_POPUP_ALL_EXTENSIONS_URL;
7
- $buttonText = 'MORE EXTENSIONS';
8
- }
9
- $banner = AdminHelper::getBannerText();
10
- ?>
11
- <div class="sgpb-wrapper sgpb-banner-wrapper">
12
- <div class="row">
13
- <div class="col-xs-12">
14
- <div class="sgpb-main-rate-us-banner-wrapper">
15
- <div class="row">
16
- <div class="col-xs-3 sgpb-rate-us-banner-1">
17
- <div class="row">
18
- <div class="col-xs-1"></div>
19
- <div class="col-xs-9">
20
- <a href="<?php echo SG_POPUP_ALL_EXTENSIONS_URL ;?>" target="_blank" class="sgpb-banner-logo-link"><div class="sgpb-banner-logo"></div></a>
21
- </div>
22
- </div>
23
- </div>
24
- <div class="col-xs-6 sgpb-rate-us-banner-2">
25
- <div class="row">
26
- <div class="col-xs-12">
27
- <?php echo $banner; ?>
28
- </div>
29
- </div>
30
- </div>
31
- <div class="col-xs-3 sgpb-rate-us-banner-3">
32
- <div class="row">
33
- <div class="col-xs-12">
34
- <ul class="sgpb-info-menu sg-info-text">
35
- <?php if (SGPB_POPUP_PKG == SGPB_POPUP_PKG_FREE): ?>
36
- <li>
37
- <a class="sgpb-banner-links" target="_blank" href="<?php echo SG_POPUP_RATE_US_URL; ?>"><span class="dashicons sgpb-dashicons-heart sgpb-info-text-white"></span><span class="sg-info-text"> <?php _e('Rate Us', SG_POPUP_TEXT_DOMAIN); ?></span></a>
38
- </li>
39
- <?php endif; ?>
40
- <li>
41
- <a class="sgpb-banner-links" target="_blank" href="<?php echo SG_POPUP_TICKET_URL; ?>"><span class="dashicons sgpb-dashicons-megaphone sgpb-info-text-white"></span> <?php _e('Submit Ticket', SG_POPUP_TEXT_DOMAIN); ?></a>
42
- </li>
43
- <li>
44
- <a class="sgpb-banner-links" target="_blank" href="https://wordpress.org/support/plugin/popup-builder"><span class="dashicons sgpb-dashicons-admin-plugins sgpb-info-text-white"></span> <?php _e('Support', SG_POPUP_TEXT_DOMAIN); ?></a>
45
- <a class="btn sgpb-upgrade-banner-btn" href="#" style="display: none;">
46
- <img src="<?php echo SG_POPUP_IMG_URL;?>star.png" width="30px">
47
- <span style="vertical-align: sub;"><?php _e($buttonText, SG_POPUP_TEXT_DOMAIN); ?></span>
48
- </a>
49
- </li>
50
- <li>
51
- <a class="sgpb-banner-links" target="_blank" href="https://wordpress.org/plugins/popup-builder/faq/"><span class="dashicons sgpb-dashicons-editor-help sgpb-info-text-white"></span> <?php _e('FAQ', SG_POPUP_TEXT_DOMAIN); ?></a>
52
- </li>
53
- <li>
54
- <a class="sgpb-banner-links" target="_blank" href="mailto:support@popup-builder.com?subject=Hello"><span class="dashicons sgpb-dashicons-email-alt sgpb-info-text-white"></span> <?php _e('Contact', SG_POPUP_TEXT_DOMAIN); ?></a>
55
- </li>
56
- </ul>
57
- </div>
58
- </div>
59
- </div>
60
- </div>
61
- </div>
62
- <div>
63
- <span class="sgpb-info-close">+</span>
64
- <span class="sgpb-dont-show-again"><?php _e('Don\'t show again.', SG_POPUP_TEXT_DOMAIN); ?></span>
65
- </div>
66
- </div>
67
- </div>
68
- </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.60
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,11 +185,18 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
188
  = Version 3.60 =
189
  * Bug fixed related to image popup saving issue.
190
  * Cron Job task improvements.
191
  * Using a dynamic plugin path when loading resources.
192
- * Improvement related to Disable Page Scrolling when page scrolls to top after the popup opened.
193
  * Minor fixes and improvements.
194
 
195
  = Version 3.59 =
@@ -1121,7 +1128,7 @@ Leave us a good review :)
1121
 
1122
  == Upgrade Notice ==
1123
 
1124
- Current Version of Popup Builder is 3.60
1125
 
1126
  == Other Notes ==
1127
 
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.61
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.61 =
189
+ * Improvement: No code content will be loaded if the custom JS/CSS doesn't contain any code.
190
+ * Improvement: Relative plugin path has been used.
191
+ * Bug fixed related to class namepsace.
192
+ * Improvement: Popup data migration functionality has been modified.
193
+ * Minor fixes and improvements.
194
+
195
  = Version 3.60 =
196
  * Bug fixed related to image popup saving issue.
197
  * Cron Job task improvements.
198
  * Using a dynamic plugin path when loading resources.
199
+ * Improvement related to 'Disable Page Scrolling' when page scrolls to top after the popup opened.
200
  * Minor fixes and improvements.
201
 
202
  = Version 3.59 =
1128
 
1129
  == Upgrade Notice ==
1130
 
1131
+ Current Version of Popup Builder is 3.61
1132
 
1133
  == Other Notes ==
1134