Popup Builder – Responsive WordPress Pop up - Version 3.1.7

Version Description

Current Version of Popup Builder is 3.1.7

Download this release

Release Info

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

Code changes from version 3.1.6.1 to 3.1.7

com/classes/Actions.php CHANGED
@@ -7,6 +7,7 @@ use \SgpbDataConfig;
7
  class Actions
8
  {
9
  public $customPostTypeObj;
 
10
 
11
  public function __construct()
12
  {
@@ -22,6 +23,7 @@ class Actions
22
  add_filter('get_sample_permalink_html', array($this, 'removePostPermalink'), 1, 1);
23
  add_action('manage_'.SG_POPUP_POST_TYPE.'_posts_custom_column' , array($this, 'popupsTableColumnsValues'), 10, 2);
24
  add_action('media_buttons', array($this, 'popupMediaButton'));
 
25
  add_action('admin_enqueue_scripts', array('sgpb\Style', 'enqueueStyles'));
26
  add_action('admin_enqueue_scripts', array('sgpb\Javascript', 'enqueueScripts'));
27
  add_action('add_meta_boxes', array($this, 'popupMetaboxes'), 100);
@@ -52,7 +54,6 @@ class Actions
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
-
56
  // activate extensions
57
  add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
58
  new Ajax();
@@ -65,6 +66,9 @@ class Actions
65
  update_option('sgpb-banner-remote-get', $bannerContent);
66
  // right metabox banner content
67
  $metaboxBannerContent = AdminHelper::getFileFromURL(SGPB_METABOX_BANNER_CRON_TEXT_URL);
 
 
 
68
  update_option('sgpb-metabox-banner-remote-get', $metaboxBannerContent);
69
 
70
  return true;
@@ -94,7 +98,7 @@ class Actions
94
  $popupBuilderLangDir = SG_POPUP_BUILDER_PATH.'/languages/';
95
  $popupBuilderLangDir = apply_filters('popupBuilderLanguagesDirectory', $popupBuilderLangDir);
96
 
97
- $locale = apply_filters('sgpb_plugin_locale', get_locale(), SG_POPUP_TEXT_DOMAIN);
98
  $mofile = sprintf('%1$s-%2$s.mo', SG_POPUP_TEXT_DOMAIN, $locale);
99
 
100
  $mofileLocal = $popupBuilderLangDir.$mofile;
@@ -123,13 +127,15 @@ class Actions
123
  global $post_type;
124
  $currentPostType = $post_type;
125
  }
126
-
127
- if (!is_admin() && SG_POPUP_POST_TYPE == $currentPostType && !is_preview()) {
128
- // it's for seo optimization
129
- status_header(301);
130
- $homeURL = home_url();
131
- wp_redirect($homeURL);
132
- exit();
 
 
133
  }
134
  }
135
 
@@ -156,6 +162,7 @@ class Actions
156
  $query->set('orderby', 'ID');
157
  $query->set('order', 'desc');
158
  }
 
159
 
160
  return true;
161
  }
@@ -249,7 +256,18 @@ class Actions
249
 
250
  public function popupMediaButton()
251
  {
252
- echo new MediaButton();
 
 
 
 
 
 
 
 
 
 
 
253
  }
254
 
255
  public function userRolesCaps()
@@ -285,6 +303,7 @@ class Actions
285
  $role->add_cap('sgpb_manage_options');
286
  $role->add_cap('manage_popup_terms');
287
  $role->add_cap('manage_popup_categories_terms');
 
288
  }
289
 
290
  return true;
@@ -325,6 +344,7 @@ class Actions
325
  }
326
 
327
  $popup = SGPopup::find($popupId);
 
328
 
329
  $event = preg_replace('/on/', '', @$args['event']);
330
  // when popup does not exists or popup post status it's not publish ex when popup in trash
@@ -402,6 +422,7 @@ class Actions
402
  if (isset($event) && $event != 'onload' && !empty($content)) {
403
  $shortcodeContent = SGPopup::renderPopupContentShortcode($content, $argsId, $event, $args);
404
  }
 
405
 
406
  return do_shortcode($shortcodeContent);
407
  }
@@ -421,6 +442,7 @@ class Actions
421
  'interval' => SGPB_CRON_REPEAT_INTERVAL * 60,
422
  'display' => __('Once Every Minute', SG_POPUP_TEXT_DOMAIN)
423
  );
 
424
 
425
  return $schedules;
426
  }
@@ -476,6 +498,8 @@ class Actions
476
  $getAllDataSql = $wpdb->prepare('SELECT id, firstName, lastName, email FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE unsubscribed = 0 and id >= %d and subscriptionType = %s limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
477
  $subscribers = $wpdb->get_results($getAllDataSql, ARRAY_A);
478
 
 
 
479
  $blogInfo = get_bloginfo();
480
  $headers = array(
481
  'From: "'.$blogInfo.'" <'.$fromEmail.'>' ,
@@ -509,6 +533,9 @@ class Actions
509
  $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
510
  $emailMessageCustom = preg_replace($patternUnsubscribe, $replacementUnsubscribe, $emailMessageCustom);
511
  $emailMessageCustom = stripslashes($emailMessageCustom);
 
 
 
512
  $mailStatus = wp_mail($subscriber['email'], $mailSubject, $emailMessageCustom, $headers);
513
 
514
  if (!$mailStatus) {
@@ -646,6 +673,8 @@ class Actions
646
  'post_status' => 'inherit'
647
  )
648
  );
 
 
649
  while ($query->have_posts()) {
650
  $query->the_post();
651
  if (empty($posts)) {
@@ -996,6 +1025,7 @@ class Actions
996
  $messages['post'][6] = __('Popup published.', SG_POPUP_TEXT_DOMAIN);
997
  }
998
  }
 
999
 
1000
  return $messages;
1001
  }
@@ -1021,6 +1051,9 @@ class Actions
1021
  }
1022
  $content .= "\n";
1023
  $subscribers = $wpdb->get_results($query, ARRAY_A);
 
 
 
1024
  foreach($subscribers as $values) {
1025
  foreach ($values as $key => $value) {
1026
  $content .= $value;
7
  class Actions
8
  {
9
  public $customPostTypeObj;
10
+ public $mediaButton = false;
11
 
12
  public function __construct()
13
  {
23
  add_filter('get_sample_permalink_html', array($this, 'removePostPermalink'), 1, 1);
24
  add_action('manage_'.SG_POPUP_POST_TYPE.'_posts_custom_column' , array($this, 'popupsTableColumnsValues'), 10, 2);
25
  add_action('media_buttons', array($this, 'popupMediaButton'));
26
+ add_action('mce_external_plugins', array($this, 'editorButton'));
27
  add_action('admin_enqueue_scripts', array('sgpb\Style', 'enqueueStyles'));
28
  add_action('admin_enqueue_scripts', array('sgpb\Javascript', 'enqueueScripts'));
29
  add_action('add_meta_boxes', array($this, 'popupMetaboxes'), 100);
54
  add_action('pre_get_posts', array($this, 'preGetPosts'));
55
  add_action('template_redirect', array($this, 'redirectFromPopupPage'));
56
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
 
57
  // activate extensions
58
  add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
59
  new Ajax();
66
  update_option('sgpb-banner-remote-get', $bannerContent);
67
  // right metabox banner content
68
  $metaboxBannerContent = AdminHelper::getFileFromURL(SGPB_METABOX_BANNER_CRON_TEXT_URL);
69
+
70
+ $metaboxBannerContent = apply_filters('sgpbGetBannerContent', $metaboxBannerContent);
71
+
72
  update_option('sgpb-metabox-banner-remote-get', $metaboxBannerContent);
73
 
74
  return true;
98
  $popupBuilderLangDir = SG_POPUP_BUILDER_PATH.'/languages/';
99
  $popupBuilderLangDir = apply_filters('popupBuilderLanguagesDirectory', $popupBuilderLangDir);
100
 
101
+ $locale = apply_filters('sgpbPluginLocale', get_locale(), SG_POPUP_TEXT_DOMAIN);
102
  $mofile = sprintf('%1$s-%2$s.mo', SG_POPUP_TEXT_DOMAIN, $locale);
103
 
104
  $mofileLocal = $popupBuilderLangDir.$mofile;
127
  global $post_type;
128
  $currentPostType = $post_type;
129
  }
130
+ // for editing popup content via page builders on backend
131
+ if (!isset($_GET) || empty($_GET)) {
132
+ if (!is_admin() && SG_POPUP_POST_TYPE == $currentPostType && !is_preview()) {
133
+ // it's for seo optimization
134
+ status_header(301);
135
+ $homeURL = home_url();
136
+ wp_redirect($homeURL);
137
+ exit();
138
+ }
139
  }
140
  }
141
 
162
  $query->set('orderby', 'ID');
163
  $query->set('order', 'desc');
164
  }
165
+ $query = apply_filters('sgpbPreGetPosts', $query);
166
 
167
  return true;
168
  }
256
 
257
  public function popupMediaButton()
258
  {
259
+ if (!$this->mediaButton) {
260
+ $this->mediaButton = true;
261
+ echo new MediaButton();
262
+ }
263
+ }
264
+
265
+ public function editorButton()
266
+ {
267
+ if (!$this->mediaButton) {
268
+ $this->mediaButton = true;
269
+ echo new MediaButton(false);
270
+ }
271
  }
272
 
273
  public function userRolesCaps()
303
  $role->add_cap('sgpb_manage_options');
304
  $role->add_cap('manage_popup_terms');
305
  $role->add_cap('manage_popup_categories_terms');
306
+ $role = apply_filters('sgpbUserRoleCap', $role);
307
  }
308
 
309
  return true;
344
  }
345
 
346
  $popup = SGPopup::find($popupId);
347
+ $popup = apply_filters('sgpbShortCodePopupObj', $popup);
348
 
349
  $event = preg_replace('/on/', '', @$args['event']);
350
  // when popup does not exists or popup post status it's not publish ex when popup in trash
422
  if (isset($event) && $event != 'onload' && !empty($content)) {
423
  $shortcodeContent = SGPopup::renderPopupContentShortcode($content, $argsId, $event, $args);
424
  }
425
+ $shortcodeContent = apply_filters('sgpbPopupShortCodeContent', $shortcodeContent);
426
 
427
  return do_shortcode($shortcodeContent);
428
  }
442
  'interval' => SGPB_CRON_REPEAT_INTERVAL * 60,
443
  'display' => __('Once Every Minute', SG_POPUP_TEXT_DOMAIN)
444
  );
445
+ $schedules = apply_filters('sgpNewsletterSendMinute', $schedules);
446
 
447
  return $schedules;
448
  }
498
  $getAllDataSql = $wpdb->prepare('SELECT id, firstName, lastName, email FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE unsubscribed = 0 and id >= %d and subscriptionType = %s limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
499
  $subscribers = $wpdb->get_results($getAllDataSql, ARRAY_A);
500
 
501
+ $subscribers = apply_filters('sgpNewsletterSendingSubscribers', $subscribers);
502
+
503
  $blogInfo = get_bloginfo();
504
  $headers = array(
505
  'From: "'.$blogInfo.'" <'.$fromEmail.'>' ,
533
  $emailMessageCustom = preg_replace($patternUserName, $replacementUserName, $emailMessageCustom);
534
  $emailMessageCustom = preg_replace($patternUnsubscribe, $replacementUnsubscribe, $emailMessageCustom);
535
  $emailMessageCustom = stripslashes($emailMessageCustom);
536
+
537
+ $emailMessageCustom = apply_filters('sgpNewsletterSendingMessage', $emailMessageCustom);
538
+
539
  $mailStatus = wp_mail($subscriber['email'], $mailSubject, $emailMessageCustom, $headers);
540
 
541
  if (!$mailStatus) {
673
  'post_status' => 'inherit'
674
  )
675
  );
676
+ $query = apply_filters('sgpbSavePostQuery', $query);
677
+
678
  while ($query->have_posts()) {
679
  $query->the_post();
680
  if (empty($posts)) {
1025
  $messages['post'][6] = __('Popup published.', SG_POPUP_TEXT_DOMAIN);
1026
  }
1027
  }
1028
+ $messages = apply_filters('sgpbPostUpdateMessage', $messages);
1029
 
1030
  return $messages;
1031
  }
1051
  }
1052
  $content .= "\n";
1053
  $subscribers = $wpdb->get_results($query, ARRAY_A);
1054
+
1055
+ $subscribers = apply_filters('sgpbSubscribersCsv', $subscribers);
1056
+
1057
  foreach($subscribers as $values) {
1058
  foreach ($values as $key => $value) {
1059
  $content .= $value;
com/classes/ConditionBuilder.php CHANGED
@@ -211,6 +211,8 @@ class ConditionBuilder
211
  if (empty($dataObj)) {
212
  return array();
213
  }
 
 
214
 
215
  foreach ($dataObj as $data) {
216
  if (empty($data['conditionName'])) {
@@ -218,8 +220,9 @@ class ConditionBuilder
218
  }
219
  $conditionName = $data['conditionName'];
220
  unset($data['conditionName']);
221
-
222
  foreach ($data as $groupId => $groupData) {
 
223
  if (empty($groupData)) {
224
  continue;
225
  }
@@ -233,11 +236,12 @@ class ConditionBuilder
233
  $builderObj->setConditionName($conditionName);
234
  $builderObj->setGroupTotal(count($groupData) - 1);
235
  $builderObj->setTakeValueFrom('operator');
236
- $dataObj[$conditionName] = $builderObj;
237
  }
238
  }
 
239
  }
240
 
241
- return $dataObj;
242
  }
243
  }
211
  if (empty($dataObj)) {
212
  return array();
213
  }
214
+ $allCondition = array();
215
+ $result = array();
216
 
217
  foreach ($dataObj as $data) {
218
  if (empty($data['conditionName'])) {
220
  }
221
  $conditionName = $data['conditionName'];
222
  unset($data['conditionName']);
223
+
224
  foreach ($data as $groupId => $groupData) {
225
+
226
  if (empty($groupData)) {
227
  continue;
228
  }
236
  $builderObj->setConditionName($conditionName);
237
  $builderObj->setGroupTotal(count($groupData) - 1);
238
  $builderObj->setTakeValueFrom('operator');
239
+ $allCondition[] = $builderObj;
240
  }
241
  }
242
+ $result[$conditionName] = $allCondition;
243
  }
244
 
245
+ return $result;
246
  }
247
  }
com/classes/ConvertToNewVersion.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
  namespace sgpb;
 
 
3
 
4
  class ConvertToNewVersion
5
  {
@@ -108,7 +110,6 @@ class ConvertToNewVersion
108
  );
109
  $id = $popupObj->getId();
110
  $newOptions = $this->getNewOptionsFormSavedData($popupObj);
111
-
112
  $newPopupId = @wp_insert_post($args);
113
  $newOptions['sgpb-post-id'] = $newPopupId;
114
  $this->saveOtherOptions($newOptions);
@@ -118,12 +119,43 @@ class ConvertToNewVersion
118
  }
119
 
120
  $this->convertCounter($idsMapping);
 
121
 
122
  update_option('sgpbConvertedIds', $idsMapping);
123
 
124
  return $arr;
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  /**
128
  * Convert settings section saved options to new version
129
  *
@@ -140,9 +172,9 @@ class ConvertToNewVersion
140
  return false;
141
  }
142
  $settings = json_decode($settings['options'], true);
143
-
144
  $deleteData = 0;
145
-
146
  if (!empty($settings['tables-delete-status'])) {
147
  $deleteData = 1;
148
  }
@@ -151,14 +183,14 @@ class ConvertToNewVersion
151
  if (empty($userRoles) || !is_array($userRoles)) {
152
  $userRoles = array();
153
  }
154
-
155
  $userRoles = array_map(function($role) {
156
  // it's remove sgpb_ keyword from selected values
157
  $role = substr($role, 5, strlen($role)-1);
158
-
159
  return $role;
160
  }, $userRoles);
161
-
162
  update_option('sgpb-user-roles', $userRoles);
163
  update_option('sgpb-dont-delete-data', $deleteData);
164
 
@@ -215,7 +247,7 @@ class ConvertToNewVersion
215
  }
216
 
217
  $newData['sgpb-type'] = $type;
218
-
219
  foreach ($names as $oldName => $newName) {
220
  if (isset($options[$oldName])) {
221
  $optionName = $this->changeOldValues($oldName, $options[$oldName]);
@@ -231,36 +263,117 @@ class ConvertToNewVersion
231
  private function saveOtherOptions($options)
232
  {
233
  $popupId = (int)$options['sgpb-post-id'];
234
-
235
- if (isset($options['sgpb-option-exit-intent-enable'])) {
236
- $eventsInitialData = array(
237
- array(
238
- array(
239
- 'param' => 'exitIntent',
240
- 'value' => @$options['sgpb-option-exit-intent-type'],
241
- 'hiddenOption' => array(
242
- 'sgpb-exit-intent-expire-time' => @$options['sgpb-exit-intent-expire-time'],
243
- 'sgpb-exit-intent-cookie-level' => @$options['sgpb-exit-intent-cookie-level'],
244
- 'sgpb-exit-intent-soft-from-top' => @$options['sgpb-exit-intent-soft-from-top']
245
- )
246
- )
 
 
 
 
 
247
  )
248
  );
249
- update_post_meta($popupId, 'sg_popup_events', $eventsInitialData);
250
- }
251
- else if(isset($options['sgpb-option-enable-ad-block'])) {
252
- $eventsInitialData = array(
253
- array(
254
- array(
255
- 'param' => 'AdBlock',
256
- 'value' => $options['sgpb-popup-delay'],
257
- 'hiddenOption' => array()
258
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  )
260
  );
261
- update_post_meta($popupId, 'sg_popup_events', $eventsInitialData);
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  // MailChimp
265
  $mailchimpApiKey = get_option("SG_MAILCHIMP_API_KEY");
266
 
@@ -282,6 +395,111 @@ class ConvertToNewVersion
282
  return $options;
283
  }
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  /**
286
  * Get Addons options
287
  *
@@ -340,7 +558,7 @@ class ConvertToNewVersion
340
  if (empty($options['sgTheme3BorderColor'])) {
341
  $options['sgTheme3BorderColor'] = '#000000';
342
  }
343
-
344
  if (@$options['popupContentBackgroundRepeat'] != 'no-repeat' && $options['popupContentBackgroundSize'] == 'auto') {
345
  $options['popupContentBackgroundSize'] = 'repeat';
346
  }
@@ -353,11 +571,35 @@ class ConvertToNewVersion
353
  if (isset($options['aweber-success-behavior']) && $options['aweber-success-behavior'] == 'redirectToUrl') {
354
  $options['aweber-success-behavior'] = 'redirectToURL';
355
  }
356
- // if there is saved any extension option we do deactivate that popup
357
- if (isset($options['option-exit-intent-enable']) || isset($options['option-enable-ad-block'])) {
358
- $options['isActiveStatus'] = '';
 
 
 
 
 
 
 
 
 
 
 
359
  }
360
-
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  if (isset($options['popup-content-padding'])) {
362
  // add theme default padding to content padding
363
  switch ($themeNumber) {
@@ -404,9 +646,54 @@ class ConvertToNewVersion
404
  $buttonImageHeight = 0;
405
  }
406
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  $options['sgpb-button-image-width'] = $buttonImageWidth;
408
  $options['sgpb-button-image-height'] = $buttonImageHeight;
409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  return $options;
411
  }
412
 
@@ -435,7 +722,7 @@ class ConvertToNewVersion
435
  $this->setType($type);
436
  $this->setTitle($arr['title']);
437
  $this->setContent('');
438
-
439
  switch ($type) {
440
  case 'image':
441
  $query = $wpdb->prepare('SELECT `url` FROM '.$wpdb->prefix.'sg_image_popup WHERE id = %d', $arr['id']);
@@ -475,6 +762,96 @@ class ConvertToNewVersion
475
  $this->setContent($result['url']);
476
  }
477
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  case 'mailchimp':
479
  $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_popup_mailchimp WHERE id = %d', $arr['id']);
480
  $result = $wpdb->get_row($query, ARRAY_A);
@@ -514,71 +891,242 @@ class ConvertToNewVersion
514
 
515
  public function getNamesMapping()
516
  {
517
- $names = array(
518
- 'type' => 'sgpb-type',
519
- 'delay' => 'sgpb-popup-delay',
520
- 'isActiveStatus' => 'sgpb-is-active',
521
- 'image-url' => 'sgpb-image-url',
522
- 'theme' => 'sgpb-popup-themes',
523
- 'effect' => 'sgpb-open-animation-effect',
524
- 'duration' => 'sgpb-open-animation-speed',
525
- 'popupOpenSound' => 'sgpb-open-sound',
526
- 'popupOpenSoundFile' => 'sgpb-sound-url',
527
- 'popup-dimension-mode' => 'sgpb-popup-dimension-mode',
528
- 'popup-responsive-dimension-measure' => 'sgpb-responsive-dimension-measure',
529
- 'width' => 'sgpb-width',
530
- 'height' => 'sgpb-height',
531
- 'maxWidth' => 'sgpb-max-width',
532
- 'maxHeight' => 'sgpb-max-height',
533
- 'escKey' => 'sgpb-esc-key',
534
- 'closeButton' => 'sgpb-enable-close-button',
535
- 'buttonDelayValue' => 'sgpb-close-button-delay',
536
- 'scrolling' => 'sgpb-enable-content-scrolling',
537
- 'disable-page-scrolling' => 'sgpb-disable-page-scrolling',
538
- 'overlayClose' => 'sgpb-overlay-click',
539
- 'contentClick' => 'sgpb-content-click',
540
- 'content-click-behavior' => 'sgpb-content-click-behavior',
541
- 'click-redirect-to-url' => 'sgpb-click-redirect-to-url',
542
- 'redirect-to-new-tab' => 'sgpb-redirect-to-new-tab',
543
- 'reopenAfterSubmission' => 'sgpb-reopen-after-form-submission',
544
- 'repeatPopup' => 'sgpb-show-popup-same-user',
545
- 'popup-appear-number-limit' => 'sgpb-show-popup-same-user-count',
546
- 'onceExpiresTime' => 'sgpb-show-popup-same-user-expiry',
547
- 'save-cookie-page-level' => 'sgpb-show-popup-same-user-page-level',
548
- 'popupContentBgImage' => 'sgpb-show-background',
549
- 'popupContentBackgroundSize' => 'sgpb-background-image-mode',
550
- 'popupContentBgImageUrl' => 'sgpb-background-image',
551
- 'sgOverlayColor' => 'sgpb-overlay-color',
552
- 'sg-content-background-color' => 'sgpb-background-color',
553
- 'popup-background-opacity' => 'sgpb-content-opacity',
554
- 'opacity' => 'sgpb-overlay-opacity',
555
- 'sgOverlayCustomClasss' => 'sgpb-overlay-custom-class',
556
- 'sgContentCustomClasss' => 'sgpb-content-custom-class',
557
- 'popup-z-index' => 'sgpb-popup-z-index',
558
- 'popup-content-padding' => 'sgpb-content-padding',
559
- 'popupFixed' => 'sgpb-popup-fixed',
560
- 'fixedPostion' => 'sgpb-popup-fixed-position',
561
- 'sgpb-open-animation' => 'sgpb-open-animation',
562
- 'theme-close-text' => 'sgpb-button-text',
563
- 'sgTheme3BorderRadius' => 'sgpb-border-radius',
564
- 'sgTheme3BorderColor' => 'sgpb-border-color',
565
- 'fblike-like-url' => 'sgpb-fblike-like-url',
566
- 'fblike-layout' => 'sgpb-fblike-layout',
567
- 'fblike-dont-show-share-button' => 'sgpb-fblike-dont-show-share-button',
568
- 'sgpb-button-image-width' => 'sgpb-button-image-width',
569
- 'sgpb-button-image-height' => 'sgpb-button-image-height'
570
- );
571
-
572
- // Exit Intent extension names
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  $names['option-exit-intent-enable'] = 'sgpb-option-exit-intent-enable';
574
  $names['option-exit-intent-type'] = 'sgpb-option-exit-intent-type';
575
  $names['option-exit-intent-expire-time'] = 'sgpb-exit-intent-expire-time';
576
  $names['option-exit-intent-cookie-level'] = 'sgpb-exit-intent-cookie-level';
577
  $names['option-exit-intent-soft-from-top'] = 'sgpb-exit-intent-soft-from-top';
578
-
579
  // Adblock extension names
580
  $names['option-enable-ad-block'] = 'sgpb-option-enable-ad-block';
581
-
582
  // MailChimp extension names
583
  $names['mailchimp-list-id'] = 'sgpb-mailchimp-lists';
584
  $names['mailchimp-double-optin'] = 'sgpb-enable-double-optin';
@@ -614,7 +1162,6 @@ class ConvertToNewVersion
614
  $names['mailchimp-success-redirect-new-tab'] = 'sgpb-mailchimp-success-redirect-new-tab';
615
  $names['mailchimp-success-popups-list'] = 'sgpb-mailchimp-success-popup';
616
  $names['mailchimp-close-popup-already-subscribed'] = 'sgpb-mailchimp-close-popup-already-subscribed';
617
-
618
  // AWeber extension
619
  $names['sg-aweber-list'] = 'sgpb-aweber-list';
620
  $names['sg-aweber-webform'] = 'sgpb-aweber-signup-form';
@@ -724,4 +1271,4 @@ function sgpGetCorrectPopupId($popupId)
724
  }
725
 
726
  return $convertedIds[$popupId];
727
- }
1
  <?php
2
  namespace sgpb;
3
+ use sgpb\AdminHelper;
4
+ use \ConfigDataHelper;
5
 
6
  class ConvertToNewVersion
7
  {
110
  );
111
  $id = $popupObj->getId();
112
  $newOptions = $this->getNewOptionsFormSavedData($popupObj);
 
113
  $newPopupId = @wp_insert_post($args);
114
  $newOptions['sgpb-post-id'] = $newPopupId;
115
  $this->saveOtherOptions($newOptions);
119
  }
120
 
121
  $this->convertCounter($idsMapping);
122
+ $this->convertSubscribers();
123
 
124
  update_option('sgpbConvertedIds', $idsMapping);
125
 
126
  return $arr;
127
  }
128
 
129
+ public function convertSubscribers()
130
+ {
131
+ global $wpdb;
132
+ $subscribersSql = 'SELECT `id`, `firstName`, `lastName`, `email`, `subscriptionType`, `status` from '.$wpdb->prefix.'sg_subscribers';
133
+ $subscribers = $wpdb->get_results($subscribersSql, ARRAY_A);
134
+
135
+ if (empty($subscribers)) {
136
+ return false;
137
+ }
138
+
139
+ foreach ($subscribers as $subscriber) {
140
+ $subscriber['subscriptionType'] = $this->getPostByTitle($subscriber['subscriptionType']);
141
+
142
+ $date = date('Y-m-d');
143
+ $sql = $wpdb->prepare('INSERT INTO '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' (`firstName`, `lastName`, `email`, `cDate`, `subscriptionType`, `unsubscribed`) VALUES (%s, %s, %s, %s, %d, %d) ', $subscriber['firstName'], $subscriber['lastName'], $subscriber['email'], $date, $subscriber['subscriptionType'], 0);
144
+ $wpdb->query($sql);
145
+ }
146
+ }
147
+
148
+ private function getPostByTitle($pageTitle, $output = OBJECT)
149
+ {
150
+ global $wpdb;
151
+ $post = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='popupbuilder'", $pageTitle));
152
+ if (!empty($post)) {
153
+ return get_post($post, $output)->ID;
154
+ }
155
+
156
+ return null;
157
+ }
158
+
159
  /**
160
  * Convert settings section saved options to new version
161
  *
172
  return false;
173
  }
174
  $settings = json_decode($settings['options'], true);
175
+
176
  $deleteData = 0;
177
+
178
  if (!empty($settings['tables-delete-status'])) {
179
  $deleteData = 1;
180
  }
183
  if (empty($userRoles) || !is_array($userRoles)) {
184
  $userRoles = array();
185
  }
186
+
187
  $userRoles = array_map(function($role) {
188
  // it's remove sgpb_ keyword from selected values
189
  $role = substr($role, 5, strlen($role)-1);
190
+
191
  return $role;
192
  }, $userRoles);
193
+
194
  update_option('sgpb-user-roles', $userRoles);
195
  update_option('sgpb-dont-delete-data', $deleteData);
196
 
247
  }
248
 
249
  $newData['sgpb-type'] = $type;
250
+
251
  foreach ($names as $oldName => $newName) {
252
  if (isset($options[$oldName])) {
253
  $optionName = $this->changeOldValues($oldName, $options[$oldName]);
263
  private function saveOtherOptions($options)
264
  {
265
  $popupId = (int)$options['sgpb-post-id'];
266
+ $mobileOperator = '';
267
+ $conditions = array();
268
+ $conditions['sgpb-target'] = array(array(array('param' => 'not_rule')));
269
+ $conditions['sgpb-conditions'] = array(array());
270
+
271
+ $eventsInitialData = array(
272
+ array(
273
+ )
274
+ );
275
+
276
+ if (!empty($options['sgpb-option-exit-intent-enable'])) {
277
+ $eventsInitialData[0][] = array(
278
+ 'param' => 'exitIntent',
279
+ 'value' => @$options['sgpb-option-exit-intent-type'],
280
+ 'hiddenOption' => array(
281
+ 'sgpb-exit-intent-expire-time' => @$options['sgpb-exit-intent-expire-time'],
282
+ 'sgpb-exit-intent-cookie-level' => @$options['sgpb-exit-intent-cookie-level'],
283
+ 'sgpb-exit-intent-soft-from-top' => @$options['sgpb-exit-intent-soft-from-top']
284
  )
285
  );
286
+ }
287
+ else if (!empty($options['sgpb-option-enable-ad-block'])) {
288
+ $eventsInitialData[0][] = array(
289
+ 'param' => 'AdBlock',
290
+ 'value' => $options['sgpb-popup-delay'],
291
+ 'hiddenOption' => array()
292
+ );
293
+ }
294
+
295
+ // after inactivity
296
+ if (!empty($options['sgpb-inactivity-status'])) {
297
+ $eventsInitialData[0][] = array(
298
+ 'param' => 'inactivity',
299
+ 'value' => @$options['sgpb-inactivity-timer'],
300
+ 'hiddenOption' => array()
301
+ );
302
+ }
303
+
304
+ // after scroll
305
+ if (!empty($options['sgpb-onscroll-status'])) {
306
+ $eventsInitialData[0][] = array(
307
+ 'param' => 'onScroll',
308
+ 'value' => @$options['sgpb-onscroll-percentage'],
309
+ 'hiddenOption' => array()
310
+ );
311
+ }
312
+
313
+ if (empty($eventsInitialData[0])) {
314
+ $eventsInitialData[0][] = array('param' => 'load', 'value' => '');
315
+ }
316
+
317
+ update_post_meta($popupId, 'sg_popup_events', $eventsInitialData);
318
+
319
+ // by user status (logged in/out)
320
+ if (!empty($options['sgpb-by-user-status'])) {
321
+ $operator = '==';
322
+ if (isset($options['sgpb-for-logged-in-user']) && $options['sgpb-for-logged-in-user'] === 'false') {
323
+ $operator = '!=';
324
+ }
325
+ $conditions['sgpb-conditions'][0][] = array(
326
+ 'param' => 'groups_user_role',
327
+ 'operator' => $operator,
328
+ 'value' => 'loggedIn'
329
+ );
330
+ }
331
+
332
+ // hide or show on mobile
333
+ if (isset($options['sgpb-hide-on-mobile']) && $options['sgpb-hide-on-mobile'] == 'on') {
334
+ $conditions['sgpb-conditions'][0][] = array(
335
+ 'param' => 'groups_devices',
336
+ 'operator' => '!=',
337
+ 'value' => array(
338
+ 'is_mobile'
339
+ )
340
+ );
341
+ }
342
+ if (isset($options['sgpb-only-on-mobile']) && $options['sgpb-only-on-mobile'] == 'on') {
343
+ $conditions['sgpb-conditions'][0][] = array(
344
+ 'param' => 'groups_devices',
345
+ 'operator' => '==',
346
+ 'value' => array(
347
+ 'is_mobile'
348
  )
349
  );
 
350
  }
351
 
352
+ // detect by country
353
+ if (isset($options['sgpb-by-country']) && $options['sgpb-by-country'] == 'on') {
354
+ if (isset($options['sgpb-allow-countries'])) {
355
+ $options['sgpb-allow-countries'] = '!=';
356
+ if ($options['sgpb-allow-countries'] == 'allow') {
357
+ $options['sgpb-allow-countries'] = '==';
358
+ }
359
+ }
360
+ $conditions['sgpb-conditions'][0][] = array(
361
+ 'param' => 'groups_countries',
362
+ 'operator' => @$options['sgpb-allow-countries'],
363
+ 'value' => explode(',', @$options['sgpb-countries-iso'])
364
+ );
365
+ }
366
+
367
+ update_post_meta($popupId, 'sg_popup_target', $conditions);
368
+
369
+ // random popup
370
+ if (isset($options['sgpb-random-popup']) && $options['sgpb-random-popup'] == 'on') {
371
+ $randomPopupCategory = AdminHelper::getTaxonomyBySlug(SG_RANDOM_TAXONOMY_SLUG);
372
+ wp_set_object_terms($popupId, SG_RANDOM_TAXONOMY_SLUG, SG_POPUP_CATEGORY_TAXONOMY, true);
373
+ }
374
+
375
+ $this->saveProTarget($options);
376
+
377
  // MailChimp
378
  $mailchimpApiKey = get_option("SG_MAILCHIMP_API_KEY");
379
 
395
  return $options;
396
  }
397
 
398
+ public function saveProTarget($options)
399
+ {
400
+ if (empty($options)) {
401
+ return;
402
+ }
403
+ $popupId = (int)$options['sgpb-post-id'];
404
+ // It's got already saved targets for do not override already saved data
405
+ $popupSavedTarget = get_post_meta($popupId, 'sg_popup_target');
406
+ $target = array();
407
+ $target['sgpb-target'] = array();
408
+ $target['sgpb-conditions'] = array();
409
+
410
+ if (!empty($popupSavedTarget[0]['sgpb-conditions'])) {
411
+ $target['sgpb-conditions'] = $popupSavedTarget[0]['sgpb-conditions'];
412
+ }
413
+ $isSavedToHome = false;
414
+
415
+ if (!empty($options['allPagesStatus'])) {
416
+
417
+ if ($options['allPages'] == 'selected') {
418
+ $savedPages = (array)@$options['allSelectedPages'];
419
+ $savedPagesValues = array_values($savedPages);
420
+
421
+ // -1 mean saved for home page
422
+ if (in_array('-1', $savedPagesValues)) {
423
+ $isSavedToHome = true;
424
+ }
425
+ $args = array(
426
+ 'post__in' => $savedPagesValues,
427
+ 'posts_per_page' => 10,
428
+ 'post_type' => 'page'
429
+ );
430
+
431
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
432
+ if (!empty($searchResults)) {
433
+ $target['sgpb-target'][0][] = array('param' => 'page_selected', 'operator' => '==', 'value' => $searchResults);
434
+ }
435
+ }
436
+ else {
437
+ $target['sgpb-target'][0][] = array('param' => 'page_all', 'operator' => '==');
438
+ }
439
+ }
440
+
441
+ if (!empty($options['allPostsStatus'])) {
442
+ $allPosts = $options['allPosts'];
443
+ if ($allPosts == 'selected') {
444
+ $savedPosts = (array)$options['allSelectedPosts'];
445
+ $savedPostsValues = array_values($savedPosts);
446
+ // -1 mean saved for home page
447
+ if (in_array('-1', $savedPostsValues)) {
448
+ $isSavedToHome = true;
449
+ }
450
+ $args = array(
451
+ 'post__in' => $savedPostsValues,
452
+ 'posts_per_page' => 10,
453
+ 'post_type' => 'post'
454
+ );
455
+
456
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
457
+ if (!empty($searchResults)) {
458
+ $target['sgpb-target'][0][] = array('param' => 'post_selected', 'operator' => '==', 'value' => $searchResults);
459
+ }
460
+ }
461
+ else if ($allPosts == 'all') {
462
+ $target['sgpb-target'][0][] = array('param' => 'post_all', 'operator' => '==');
463
+ }
464
+ else {
465
+ $selectedPostCategories = array_values($options['posts-all-categories']);
466
+ $target['sgpb-target'][0][] = array('param' => 'post_category', 'operator' => '==', 'value' => $selectedPostCategories);
467
+ }
468
+ }
469
+
470
+ if ($isSavedToHome) {
471
+ $target['sgpb-target'][0][] = array('param' => 'page_type', 'operator' => '==', 'value' => array('is_home_page', 'is_home'));
472
+ }
473
+
474
+ if (!empty($options['allCustomPostsStatus'])) {
475
+ $customPostTypes = $options['all-custom-posts'];
476
+ if (!empty($customPostTypes)) {
477
+ $selectedCustomPosts = $options['allSelectedCustomPosts'];
478
+ if ($options['showAllCustomPosts'] == 'selected') {
479
+ foreach ($customPostTypes as $customPostType) {
480
+ $args = array(
481
+ 'post__in' => array_values($selectedCustomPosts),
482
+ 'posts_per_page' => 10,
483
+ 'post_type' => $customPostType
484
+ );
485
+
486
+ $searchResults = ConfigDataHelper::getPostTypeData($args);
487
+ if (!empty($searchResults)) {
488
+ $target['sgpb-target'][0][] = array('param' => $customPostType.'_selected', 'operator' => '==', 'value' => $searchResults);
489
+ }
490
+ }
491
+ }
492
+
493
+ else {
494
+ $target['sgpb-target'][0][] = array('param' => 'post_type', 'operator' => '==', 'value' => array_values($customPostTypes));
495
+
496
+ }
497
+ }
498
+ }
499
+
500
+ update_post_meta($popupId, 'sg_popup_target', $target);
501
+ }
502
+
503
  /**
504
  * Get Addons options
505
  *
558
  if (empty($options['sgTheme3BorderColor'])) {
559
  $options['sgTheme3BorderColor'] = '#000000';
560
  }
561
+
562
  if (@$options['popupContentBackgroundRepeat'] != 'no-repeat' && $options['popupContentBackgroundSize'] == 'auto') {
563
  $options['popupContentBackgroundSize'] = 'repeat';
564
  }
571
  if (isset($options['aweber-success-behavior']) && $options['aweber-success-behavior'] == 'redirectToUrl') {
572
  $options['aweber-success-behavior'] = 'redirectToURL';
573
  }
574
+
575
+ // pro options
576
+ if (isset($options['disablePopupOverlay'])) {
577
+ $options['sgpb-enable-popup-overlay'] = '';
578
+ }
579
+ // contact form new options
580
+ if (isset($options['contact-success-behavior']) && $options['contact-success-behavior'] == 'redirectToUrl') {
581
+ $options['contact-success-behavior'] = 'redirectToURL';
582
+ }
583
+ if (isset($options['contact-text-input-bgcolor'])) {
584
+ $options['sgpb-contact-message-bg-color'] = $options['contact-text-input-bgcolor'];
585
+ }
586
+ if (isset($options['contact-text-bordercolor'])) {
587
+ $options['sgpb-contact-message-border-color'] = $options['contact-text-bordercolor'];
588
  }
589
+ if (isset($options['contact-inputs-color'])) {
590
+ $options['sgpb-contact-message-text-color'] = $options['contact-inputs-color'];
591
+ }
592
+ if (isset($options['contact-placeholder-color'])) {
593
+ $options['sgpb-contact-message-placeholder-color'] = $options['contact-placeholder-color'];
594
+ }
595
+ if (isset($options['contact-inputs-border-width'])) {
596
+ $options['sgpb-contact-message-border-width'] = $options['contact-inputs-border-width'];
597
+ }
598
+
599
+ if (isset($options['contact-success-popups-list'])) {
600
+ $options['contact-success-popups-list'] = sgpGetCorrectPopupId($options['contact-success-popups-list']);
601
+ }
602
+
603
  if (isset($options['popup-content-padding'])) {
604
  // add theme default padding to content padding
605
  switch ($themeNumber) {
646
  $buttonImageHeight = 0;
647
  }
648
 
649
+ // social popup add to default value
650
+ if (empty($options['sgMailLable'])) {
651
+ $options['sgMailLable'] = 'E-mail';
652
+ }
653
+ if (empty($options['fbShareLabel'])) {
654
+ $options['fbShareLabel'] = 'Share';
655
+ }
656
+ if (empty($options['lindkinLabel'])) {
657
+ $options['lindkinLabel'] = 'Share';
658
+ }
659
+ if (empty($options['googLelabel'])) {
660
+ $options['googLelabel'] = '+1';
661
+ }
662
+ if (empty($options['twitterLabel'])) {
663
+ $options['twitterLabel'] = 'Tweet';
664
+ }
665
+ if (empty($options['pinterestLabel'])) {
666
+ $options['pinterestLabel'] = 'Pin it';
667
+ }
668
+
669
+ if (isset($options['subs-success-behavior']) && $options['subs-success-behavior'] == 'redirectToUrl') {
670
+ $options['subs-success-behavior'] = 'redirectToURL';
671
+ }
672
+
673
+ $options['sgpb-subs-form-bg-color'] = '#FFFFFF';
674
  $options['sgpb-button-image-width'] = $buttonImageWidth;
675
  $options['sgpb-button-image-height'] = $buttonImageHeight;
676
 
677
+ // pro options customizations
678
+ if (SGPB_POPUP_PKG > SGPB_POPUP_PKG_FREE) {
679
+ if (empty($options['sgpb-restriction-yes-btn-radius-type'])) {
680
+ $options['sgpb-restriction-yes-btn-radius-type'] = '%';
681
+ }
682
+
683
+ if (empty($options['sgpb-restriction-no-btn-radius-type'])) {
684
+ $options['sgpb-restriction-no-btn-radius-type'] = '%';
685
+ }
686
+
687
+ if (empty($options['sgpb-restriction-yes-btn-border-color'])) {
688
+ // border color should be like background color
689
+ $options['sgpb-restriction-yes-btn-border-color'] = $options['yesButtonBackgroundColor'];
690
+ }
691
+ if (empty($options['sgpb-restriction-no-btn-border-color'])) {
692
+ // border color should be like background color
693
+ $options['sgpb-restriction-no-btn-border-color'] = $options['noButtonBackgroundColor'];
694
+ }
695
+ }
696
+
697
  return $options;
698
  }
699
 
722
  $this->setType($type);
723
  $this->setTitle($arr['title']);
724
  $this->setContent('');
725
+
726
  switch ($type) {
727
  case 'image':
728
  $query = $wpdb->prepare('SELECT `url` FROM '.$wpdb->prefix.'sg_image_popup WHERE id = %d', $arr['id']);
762
  $this->setContent($result['url']);
763
  }
764
  break;
765
+ case 'iframe':
766
+ $query = $wpdb->prepare('SELECT `url` FROM '.$wpdb->prefix.'sg_iframe_popup WHERE id = %d', $arr['id']);
767
+ $result = $wpdb->get_row($query, ARRAY_A);
768
+ if (!empty($result['url'])) {
769
+ $options['iframe-url'] = $result['url'];
770
+ }
771
+ break;
772
+ case 'video':
773
+ $query = $wpdb->prepare('SELECT `url`, `options` FROM '.$wpdb->prefix.'sg_video_popup WHERE id = %d', $arr['id']);
774
+ $result = $wpdb->get_row($query, ARRAY_A);
775
+ if (!empty($result['url'])) {
776
+ $options['video-url'] = $result['url'];
777
+ }
778
+
779
+ $customOptions = $result['options'];
780
+ $customOptions = json_decode($customOptions, true);
781
+
782
+ if (!empty($customOptions)) {
783
+ $this->setCustomOptions($customOptions);
784
+ }
785
+ break;
786
+ case 'ageRestriction':
787
+ $query = $wpdb->prepare('SELECT `content`, `yesButton` as `yesButtonLabel`, `noButton` as `noButtonLabel`, `url` as `restrictionUrl` FROM '.$wpdb->prefix.'sg_age_restriction_popup WHERE id = %d', $arr['id']);
788
+ $result = $wpdb->get_row($query, ARRAY_A);
789
+ if (!empty($result['content'])) {
790
+ $this->setContent($result['content']);
791
+ }
792
+ unset($result['content']);
793
+ if (!empty($result)) {
794
+ $this->setCustomOptions($result);
795
+ }
796
+ break;
797
+ case 'social':
798
+ $query = $wpdb->prepare('SELECT `socialContent`, `buttons`, `socialOptions` FROM '.$wpdb->prefix.'sg_social_popup WHERE id = %d', $arr['id']);
799
+ $result = $wpdb->get_row($query, ARRAY_A);
800
+
801
+ if (!empty($result['socialContent'])) {
802
+ $this->setContent($result['socialContent']);
803
+ }
804
+
805
+ $buttons = json_decode($result['buttons'], true);
806
+ $socialOptions = json_decode($result['socialOptions'], true);
807
+
808
+ $socialAllOptions = array_merge($buttons, $socialOptions);
809
+
810
+ $this->setCustomOptions($socialAllOptions);
811
+ break;
812
+ case 'subscription':
813
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_subscription_popup WHERE id = %d', $arr['id']);
814
+ $result = $wpdb->get_row($query, ARRAY_A);
815
+
816
+ if (!empty($result['content'])) {
817
+ $this->setContent($result['content']);
818
+ }
819
+
820
+ $subsOptions = $result['options'];
821
+ $subsOptions = json_decode($subsOptions, true);
822
+
823
+ if (!empty($subsOptions)) {
824
+ $this->setCustomOptions($subsOptions);
825
+ }
826
+ break;
827
+ case 'countdown':
828
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_countdown_popup WHERE id = %d', $arr['id']);
829
+ $result = $wpdb->get_row($query, ARRAY_A);
830
+
831
+ if (!empty($result['content'])) {
832
+ $this->setContent($result['content']);
833
+ }
834
+ $customOptions = $result['options'];
835
+ $customOptions = json_decode($customOptions, true);
836
+
837
+ if (!empty($options)) {
838
+ $this->setCustomOptions($customOptions);
839
+ }
840
+ break;
841
+ case 'contactForm':
842
+ $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_contact_form_popup WHERE id = %d', $arr['id']);
843
+ $result = $wpdb->get_row($query, ARRAY_A);
844
+
845
+ if (!empty($result['content'])) {
846
+ $this->setContent($result['content']);
847
+ }
848
+ $customOptions = $result['options'];
849
+ $customOptions = json_decode($customOptions, true);
850
+
851
+ if (!empty($options)) {
852
+ $this->setCustomOptions($customOptions);
853
+ }
854
+ break;
855
  case 'mailchimp':
856
  $query = $wpdb->prepare('SELECT `content`, `options` FROM '.$wpdb->prefix.'sg_popup_mailchimp WHERE id = %d', $arr['id']);
857
  $result = $wpdb->get_row($query, ARRAY_A);
891
 
892
  public function getNamesMapping()
893
  {
894
+ $names = array(
895
+ 'type' => 'sgpb-type',
896
+ 'delay' => 'sgpb-popup-delay',
897
+ 'isActiveStatus' => 'sgpb-is-active',
898
+ 'image-url' => 'sgpb-image-url',
899
+ 'theme' => 'sgpb-popup-themes',
900
+ 'effect' => 'sgpb-open-animation-effect',
901
+ 'duration' => 'sgpb-open-animation-speed',
902
+ 'popupOpenSound' => 'sgpb-open-sound',
903
+ 'popupOpenSoundFile' => 'sgpb-sound-url',
904
+ 'popup-dimension-mode' => 'sgpb-popup-dimension-mode',
905
+ 'popup-responsive-dimension-measure' => 'sgpb-responsive-dimension-measure',
906
+ 'width' => 'sgpb-width',
907
+ 'height' => 'sgpb-height',
908
+ 'maxWidth' => 'sgpb-max-width',
909
+ 'maxHeight' => 'sgpb-max-height',
910
+ 'escKey' => 'sgpb-esc-key',
911
+ 'closeButton' => 'sgpb-enable-close-button',
912
+ 'buttonDelayValue' => 'sgpb-close-button-delay',
913
+ 'scrolling' => 'sgpb-enable-content-scrolling',
914
+ 'disable-page-scrolling' => 'sgpb-disable-page-scrolling',
915
+ 'overlayClose' => 'sgpb-overlay-click',
916
+ 'contentClick' => 'sgpb-content-click',
917
+ 'content-click-behavior' => 'sgpb-content-click-behavior',
918
+ 'click-redirect-to-url' => 'sgpb-click-redirect-to-url',
919
+ 'redirect-to-new-tab' => 'sgpb-redirect-to-new-tab',
920
+ 'reopenAfterSubmission' => 'sgpb-reopen-after-form-submission',
921
+ 'repeatPopup' => 'sgpb-show-popup-same-user',
922
+ 'popup-appear-number-limit' => 'sgpb-show-popup-same-user-count',
923
+ 'onceExpiresTime' => 'sgpb-show-popup-same-user-expiry',
924
+ 'save-cookie-page-level' => 'sgpb-show-popup-same-user-page-level',
925
+ 'popupContentBgImage' => 'sgpb-show-background',
926
+ 'popupContentBackgroundSize' => 'sgpb-background-image-mode',
927
+ 'popupContentBgImageUrl' => 'sgpb-background-image',
928
+ 'sgOverlayColor' => 'sgpb-overlay-color',
929
+ 'sg-content-background-color' => 'sgpb-background-color',
930
+ 'popup-background-opacity' => 'sgpb-content-opacity',
931
+ 'opacity' => 'sgpb-overlay-opacity',
932
+ 'sgOverlayCustomClasss' => 'sgpb-overlay-custom-class',
933
+ 'sgContentCustomClasss' => 'sgpb-content-custom-class',
934
+ 'popup-z-index' => 'sgpb-popup-z-index',
935
+ 'popup-content-padding' => 'sgpb-content-padding',
936
+ 'popupFixed' => 'sgpb-popup-fixed',
937
+ 'fixedPostion' => 'sgpb-popup-fixed-position',
938
+ 'sgpb-open-animation' => 'sgpb-open-animation',
939
+ 'theme-close-text' => 'sgpb-button-text',
940
+ 'sgTheme3BorderRadius' => 'sgpb-border-radius',
941
+ 'sgTheme3BorderColor' => 'sgpb-border-color',
942
+ 'fblike-like-url' => 'sgpb-fblike-like-url',
943
+ 'fblike-layout' => 'sgpb-fblike-layout',
944
+ 'fblike-dont-show-share-button' => 'sgpb-fblike-dont-show-share-button',
945
+ 'sgpb-button-image-width' => 'sgpb-button-image-width',
946
+ 'sgpb-button-image-height' => 'sgpb-button-image-height'
947
+ );
948
+ // iframe pro popup type
949
+ $names['iframe-url'] = 'sgpb-iframe-url';
950
+
951
+ // video pro popup type
952
+ $names['video-url'] = 'sgpb-video-url';
953
+ $names['video-autoplay'] = 'sgpb-video-autoplay';
954
+
955
+ // age restriction
956
+ $names['yesButtonLabel'] = 'sgpb-restriction-yes-btn';
957
+ $names['noButtonLabel'] = 'sgpb-restriction-no-btn';
958
+ $names['restrictionUrl'] = 'sgpb-restriction-no-url';
959
+ $names['yesButtonBackgroundColor'] = 'sgpb-restriction-yes-btn-bg-color';
960
+ $names['yesButtonTextColor'] = 'sgpb-restriction-yes-btn-text-color';
961
+ $names['yesButtonRadius'] = 'sgpb-restriction-yes-btn-radius';
962
+ $names['sgRestrictionExpirationTime'] = 'sgpb-restriction-yes-expiration-time';
963
+ $names['restrictionCookeSavingLevel'] = 'sgpb-restriction-cookie-level';
964
+ $names['noButtonBackgroundColor'] = 'sgpb-restriction-no-btn-bg-color';
965
+ $names['noButtonTextColor'] = 'sgpb-restriction-no-btn-text-color';
966
+ $names['noButtonRadius'] = 'sgpb-restriction-no-btn-radius';
967
+
968
+ // age restriction new options
969
+ $names['sgpb-restriction-yes-btn-radius-type'] = 'sgpb-restriction-yes-btn-radius-type';
970
+ $names['sgpb-restriction-no-btn-radius-type'] = 'sgpb-restriction-no-btn-radius-type';
971
+ $names['sgpb-restriction-yes-btn-border-color'] = 'sgpb-restriction-yes-btn-border-color';
972
+ $names['sgpb-restriction-no-btn-border-color'] = 'sgpb-restriction-no-btn-border-color';
973
+
974
+ $proNames = array(
975
+ 'autoClosePopup' => 'sgpb-auto-close',
976
+ 'popupClosingTimer' => 'sgpb-auto-close-time',
977
+ 'disablePopupOverlay' => 'sgpb-enable-popup-overlay',
978
+ 'disablePopup' => 'sgpb-disable-popup-closing',
979
+ 'popup-schedule-status' => 'sgpb-schedule-status',
980
+ 'schedule-start-weeks' => 'sgpb-schedule-weeks',
981
+ 'schedule-start-time' => 'sgpb-schedule-start-time',
982
+ 'schedule-end-time' => 'sgpb-schedule-end-time',
983
+ 'popup-timer-status' => 'sgpb-popup-timer-status',
984
+ 'popup-start-timer' => 'sgpb-popup-start-timer',
985
+ 'popup-finish-timer' => 'sgpb-popup-end-timer',
986
+ 'inActivityStatus' => 'sgpb-inactivity-status',
987
+ 'inactivity-timout' => 'sgpb-inactivity-timer',
988
+ 'onScrolling' => 'sgpb-onscroll-status',
989
+ 'beforeScrolingPrsent' => 'sgpb-onscroll-percentage',
990
+ 'sg-user-status' => 'sgpb-by-user-status',
991
+ 'loggedin-user' => 'sgpb-for-logged-in-user',
992
+ 'forMobile' => 'sgpb-hide-on-mobile',
993
+ 'openMobile' => 'sgpb-only-on-mobile',
994
+ 'countryStatus' => 'sgpb-by-country',
995
+ 'allowCountries' => 'sgpb-allow-countries',
996
+ 'countryIso' => 'sgpb-countries-iso',
997
+ 'randomPopup' => 'sgpb-random-popup'
998
+ );
999
+ $names = array_merge($names, $proNames);
1000
+
1001
+ // pro options
1002
+ $names['allPagesStatus'] = 'allPagesStatus';
1003
+ $names['showAllPages'] = 'allPages';
1004
+ $names['allSelectedPages'] = 'allSelectedPages';
1005
+ $names['allPostsStatus'] = 'allPostsStatus';
1006
+ $names['showAllPosts'] = 'allPosts';
1007
+ $names['allSelectedPosts'] = 'allSelectedPosts';
1008
+ $names['posts-all-categories'] = 'posts-all-categories';
1009
+ $names['allCustomPostsStatus'] = 'allCustomPostsStatus';
1010
+ $names['all-custom-posts'] = 'all-custom-posts';
1011
+ $names['showAllCustomPosts'] = 'showAllCustomPosts';
1012
+ $names['allSelectedCustomPosts'] = 'allSelectedCustomPosts';
1013
+ // countdown pro popup type
1014
+ $names['countdownNumbersBgColor'] = 'sgpb-counter-background-color';
1015
+ $names['countdownNumbersTextColor'] = 'sgpb-counter-text-color';
1016
+ $names['sg-due-date'] = 'sgpb-countdown-due-date';
1017
+ $names['sg-countdown-type'] = 'sgpb-countdown-type';
1018
+ $names['sg-time-zone'] = 'sgpb-countdown-timezone';
1019
+ $names['counts-language'] = 'sgpb-countdown-language';
1020
+ $names['pushToBottom'] = 'sgpb-countdown-show-on-top';
1021
+ $names['countdown-autoclose'] = 'sgpb-countdown-close-timeout';
1022
+ // contact form pro popup type
1023
+ $names['show-form-to-top'] = 'sgpb-contact-show-form-to-top';
1024
+ $names['contact-name-status'] = 'sgpb-contact-field-name';
1025
+ $names['contact-name'] = 'sgpb-contact-name-placeholder';
1026
+ $names['contact-name-required'] = 'sgpb-contact-name-required';
1027
+ $names['contact-subject-status'] = 'sgpb-contact-field-subject';
1028
+ $names['contact-subject'] = 'sgpb-contact-subject-placeholder';
1029
+ $names['contact-subject-required'] = 'sgpb-contact-subject-required';
1030
+ $names['contact-email'] = 'sgpb-contact-email-placeholder';
1031
+ $names['contact-message'] = 'sgpb-contact-message-placeholder';
1032
+ $names['contact-fail-message'] = 'sgpb-contact-error-message';
1033
+ $names['contact-receive-email'] = 'sgpb-contact-to-email';
1034
+ $names['contact-validation-message'] = 'sgpb-contact-required-message';
1035
+ $names['contact-validate-email'] = 'sgpb-contact-invalid-email-message';
1036
+ $names['contact-inputs-width'] = 'sgpb-contact-inputs-width';
1037
+ $names['contact-inputs-height'] = 'sgpb-contact-inputs-height';
1038
+ $names['contact-inputs-border-width'] = 'sgpb-contact-inputs-border-width';
1039
+ $names['contact-text-input-bgcolor'] = 'sgpb-contact-inputs-bg-color';
1040
+ $names['contact-text-bordercolor'] = 'sgpb-contact-inputs-border-color';
1041
+ $names['contact-inputs-color'] = 'sgpb-contact-inputs-text-color';
1042
+ $names['contact-placeholder-color'] = 'sgpb-contact-inputs-placeholder-color';
1043
+ $names['contact-area-width'] = 'sgpb-contact-message-width';
1044
+ $names['contact-area-height'] = 'sgpb-contact-message-height';
1045
+ $names['sg-contact-resize'] = 'sgpb-contact-message-resize';
1046
+ $names['contact-btn-width'] = 'sgpb-contact-submit-width';
1047
+ $names['contact-btn-height'] = 'sgpb-contact-submit-height';
1048
+ $names['contact-btn-title'] = 'sgpb-contact-submit-title';
1049
+ $names['contact-btn-progress-title'] = 'sgpb-contact-submit-title-progress';
1050
+ $names['contact-button-bgcolor'] = 'sgpb-contact-submit-bg-color';
1051
+ $names['contact-button-color'] = 'sgpb-contact-submit-text-color';
1052
+ $names['dont-show-content-to-contacted-user'] = 'sgpb-contact-hide-for-contacted-users';
1053
+ $names['contact-success-behavior'] = 'sgpb-contact-success-behavior';
1054
+ $names['contact-success-message'] = 'sgpb-contact-success-message';
1055
+ $names['contact-success-redirect-url'] = 'sgpb-contact-success-redirect-URL';
1056
+ $names['contact-success-redirect-new-tab'] = 'sgpb-contact-success-redirect-new-tab';
1057
+ $names['contact-success-popups-list'] = 'sgpb-contact-success-popup';
1058
+ $names['contact-gdpr'] = 'sgpb-contact-gdpr-status';
1059
+ $names['contact-gdpr-label'] = 'sgpb-contact-gdpr-label';
1060
+ $names['contact-gdpr-text'] = 'sgpb-contact-gdpr-text';
1061
+ $names['sgpb-contact-message-bg-color'] = 'sgpb-contact-message-bg-color';
1062
+ $names['sgpb-contact-message-border-color'] = 'sgpb-contact-message-border-color';
1063
+ $names['sgpb-contact-message-text-color'] = 'sgpb-contact-message-text-color';
1064
+ $names['sgpb-contact-message-placeholder-color'] = 'sgpb-contact-message-placeholder-color';
1065
+ $names['sgpb-contact-message-border-width'] = 'sgpb-contact-message-border-width';
1066
+
1067
+ // Social
1068
+ $names['shareUrlType'] = 'sgpb-social-share-url-type';
1069
+ $names['sgShareUrl'] = 'sgpb-social-share-url';
1070
+ $names['sgSocialTheme'] = 'sgpb-social-share-theme';
1071
+ $names['sgSocialButtonsSize'] = 'sgpb-social-theme-size';
1072
+ $names['sgSocialLabel'] = 'sgpb-social-show-labels';
1073
+ $names['sgSocialShareCount'] = 'sgpb-social-share-count';
1074
+ $names['sgRoundButton'] = 'sgpb-social-round-buttons';
1075
+ $names['sgEmailStatus'] = 'sgpb-social-status-email';
1076
+ $names['sgMailLable'] = 'sgpb-social-label-email';
1077
+ $names['sgFbStatus'] = 'sgpb-social-status-facebook';
1078
+ $names['fbShareLabel'] = 'sgpb-social-label-facebook';
1079
+ $names['sgLinkedinStatus'] = 'sgpb-social-status-linkedin';
1080
+ $names['lindkinLabel'] = 'sgpb-social-label-linkedin';
1081
+ $names['sgGoogleStatus'] = 'sgpb-social-status-googleplus';
1082
+ $names['googLelabel'] = 'sgpb-social-label-googleplus';
1083
+ $names['sgTwitterStatus'] = 'sgpb-social-status-twitter';
1084
+ $names['twitterLabel'] = 'sgpb-social-label-twitter';
1085
+ $names['sgPinterestStatus'] = 'sgpb-social-status-pinterest';
1086
+ $names['pinterestLabel'] = 'sgpb-social-label-pinterest';
1087
+
1088
+ // Subscription
1089
+ $names['subscription-email'] = 'sgpb-subs-email-placeholder';
1090
+ $names['subs-gdpr'] = 'sgpb-subs-gdpr-status';
1091
+ $names['subs-gdpr-label'] = 'sgpb-subs-gdpr-label';
1092
+ $names['subs-gdpr-text'] = 'sgpb-subs-gdpr-text';
1093
+ $names['subs-first-name-status'] = 'sgpb-subs-first-name-status';
1094
+ $names['subs-first-name'] = 'sgpb-subs-first-placeholder';
1095
+ $names['subs-first-name-required'] = 'sgpb-subs-first-name-required';
1096
+ $names['subs-last-name-status'] = 'sgpb-subs-last-name-status';
1097
+ $names['subs-last-name'] = 'sgpb-subs-last-placeholder';
1098
+ $names['subs-last-name-required'] = 'sgpb-subs-last-name-required';
1099
+ $names['subs-validation-message'] = 'sgpb-subs-validation-message';
1100
+ $names['subs-text-width'] = 'sgpb-subs-text-width';
1101
+ $names['subs-text-height'] = 'sgpb-subs-text-height';
1102
+ $names['subs-text-border-width'] = 'sgpb-subs-text-border-width';
1103
+ $names['subs-text-input-bgColor'] = 'sgpb-subs-text-bg-color';
1104
+ $names['subs-text-borderColor'] = 'sgpb-subs-text-border-color';
1105
+ $names['subs-inputs-color'] = 'sgpb-subs-text-color';
1106
+ $names['subs-placeholder-color'] = 'sgpb-subs-text-placeholder-color';
1107
+ $names['subs-btn-width'] = 'sgpb-subs-btn-width';
1108
+ $names['subs-btn-height'] = 'sgpb-subs-btn-height';
1109
+ $names['subs-btn-title'] = 'sgpb-subs-btn-title';
1110
+ $names['subs-btn-progress-title'] = 'sgpb-subs-btn-progress-title';
1111
+ $names['subs-button-bgColor'] = 'sgpb-subs-btn-bg-color';
1112
+ $names['subs-button-color'] = 'sgpb-subs-btn-text-color';
1113
+ $names['subs-success-behavior'] = 'sgpb-subs-success-behavior';
1114
+ $names['subs-success-message'] = 'sgpb-subs-success-message';
1115
+ $names['subs-success-redirect-url'] = 'sgpb-subs-success-redirect-URL';
1116
+ $names['subs-success-redirect-new-tab'] = 'sgpb-subs-success-redirect-new-tab';
1117
+ $names['subs-success-popups-list'] = 'sgpb-subs-success-popup';
1118
+ // Subscription new option
1119
+ $names['sgpb-subs-form-bg-color'] = 'sgpb-subs-form-bg-color';
1120
+
1121
+ // Exit Intent extension names
1122
  $names['option-exit-intent-enable'] = 'sgpb-option-exit-intent-enable';
1123
  $names['option-exit-intent-type'] = 'sgpb-option-exit-intent-type';
1124
  $names['option-exit-intent-expire-time'] = 'sgpb-exit-intent-expire-time';
1125
  $names['option-exit-intent-cookie-level'] = 'sgpb-exit-intent-cookie-level';
1126
  $names['option-exit-intent-soft-from-top'] = 'sgpb-exit-intent-soft-from-top';
1127
+
1128
  // Adblock extension names
1129
  $names['option-enable-ad-block'] = 'sgpb-option-enable-ad-block';
 
1130
  // MailChimp extension names
1131
  $names['mailchimp-list-id'] = 'sgpb-mailchimp-lists';
1132
  $names['mailchimp-double-optin'] = 'sgpb-enable-double-optin';
1162
  $names['mailchimp-success-redirect-new-tab'] = 'sgpb-mailchimp-success-redirect-new-tab';
1163
  $names['mailchimp-success-popups-list'] = 'sgpb-mailchimp-success-popup';
1164
  $names['mailchimp-close-popup-already-subscribed'] = 'sgpb-mailchimp-close-popup-already-subscribed';
 
1165
  // AWeber extension
1166
  $names['sg-aweber-list'] = 'sgpb-aweber-list';
1167
  $names['sg-aweber-webform'] = 'sgpb-aweber-signup-form';
1271
  }
1272
 
1273
  return $convertedIds[$popupId];
1274
+ }
com/classes/Installer.php CHANGED
@@ -191,6 +191,8 @@ class Installer
191
 
192
  $terms = $wpdb->get_results($customTermsQuery);
193
 
 
 
194
  foreach ($terms as $term) {
195
  if (empty($term)) {
196
  continue;
@@ -224,6 +226,7 @@ class Installer
224
  )
225
  )
226
  );
 
227
 
228
  foreach ($popups as $popup) {
229
  if (empty($popup)) {
@@ -318,6 +321,7 @@ class Installer
318
  'boxLabel' => __('Popup Builder License', SG_POPUP_TEXT_DOMAIN)
319
  )
320
  );
 
321
  }
322
 
323
  @SgpbPopupExtensionRegister::register($pluginName, $classPath, $className, $options);
191
 
192
  $terms = $wpdb->get_results($customTermsQuery);
193
 
194
+ $terms = apply_filters('sgpbDeleteTerms', $terms);
195
+
196
  foreach ($terms as $term) {
197
  if (empty($term)) {
198
  continue;
226
  )
227
  )
228
  );
229
+ $popups = apply_filters('sgpbDeletePopups', $popups);
230
 
231
  foreach ($popups as $popup) {
232
  if (empty($popup)) {
321
  'boxLabel' => __('Popup Builder License', SG_POPUP_TEXT_DOMAIN)
322
  )
323
  );
324
+ $options = apply_filters('sgpbRegisterOptions', $options);
325
  }
326
 
327
  @SgpbPopupExtensionRegister::register($pluginName, $classPath, $className, $options);
com/classes/Javascript.php CHANGED
@@ -17,7 +17,7 @@ class Javascript
17
  $popupType = AdminHelper::getCurrentPopupType();
18
  $currentPostType = AdminHelper::getCurrentPostType();
19
 
20
- if($hook == 'popupbuilder_page_popupbuilder') {
21
  $pageName = 'popupType';
22
  }
23
  else if(($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
@@ -26,8 +26,8 @@ class Javascript
26
  else if($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
27
  $pageName = 'popupspage';
28
  }
29
- else if ($hook == 'popupbuilder_page_subscribers') {
30
- $pageName = 'sgpbSubscribers';
31
  }
32
 
33
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
17
  $popupType = AdminHelper::getCurrentPopupType();
18
  $currentPostType = AdminHelper::getCurrentPostType();
19
 
20
+ if($hook == SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_POST_TYPE) {
21
  $pageName = 'popupType';
22
  }
23
  else if(($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
26
  else if($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
27
  $pageName = 'popupspage';
28
  }
29
+ else if ($hook == SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_SUBSCRIBERS_PAGE) {
30
+ $pageName = SG_POPUP_SUBSCRIBERS_PAGE;
31
  }
32
 
33
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
com/classes/MediaButton.php CHANGED
@@ -3,11 +3,18 @@ namespace sgpb;
3
 
4
  class MediaButton
5
  {
 
 
6
  public function __toString()
7
  {
8
  return $this->render();
9
  }
10
 
 
 
 
 
 
11
  public static function allowToShow()
12
  {
13
  global $pagenow, $typenow;
@@ -40,6 +47,9 @@ class MediaButton
40
 
41
  public function render()
42
  {
 
 
 
43
  $output = $this->mediaButton();
44
  $output .= $this->insertJsVariable();
45
 
@@ -60,7 +70,10 @@ class MediaButton
60
 
61
  $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
62
  $output = '<a data-id="sgpb-js-variable-wrapper" href="javascript:void(0);" class="button sgpb-insert-js-variable" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
63
-
 
 
 
64
  return $output.$jsVariableContent;
65
  }
66
 
@@ -86,6 +99,9 @@ class MediaButton
86
 
87
  $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
88
  $output = '<a data-id="sgpb-hidden-media-popup" href="javascript:void(0);" class="button sgpb-insert-media-button-js" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
 
 
 
89
 
90
  return $output.$mediaButtonContent;
91
  }
3
 
4
  class MediaButton
5
  {
6
+ private $hideMediaButton = true;
7
+
8
  public function __toString()
9
  {
10
  return $this->render();
11
  }
12
 
13
+ public function __construct($hideMediaButton = true)
14
+ {
15
+ $this->hideMediaButton = $hideMediaButton;
16
+ }
17
+
18
  public static function allowToShow()
19
  {
20
  global $pagenow, $typenow;
47
 
48
  public function render()
49
  {
50
+ if (!$this->hideMediaButton && $this->allowToShowJsVariable()) {
51
+ return '';
52
+ }
53
  $output = $this->mediaButton();
54
  $output .= $this->insertJsVariable();
55
 
70
 
71
  $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
72
  $output = '<a data-id="sgpb-js-variable-wrapper" href="javascript:void(0);" class="button sgpb-insert-js-variable" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
73
+ if (!$this->hideMediaButton) {
74
+ $output = '';
75
+ }
76
+
77
  return $output.$jsVariableContent;
78
  }
79
 
99
 
100
  $img = '<span class="dashicons dashicons-welcome-widgets-menus" style="padding: 3px 2px 0px 0px"></span>';
101
  $output = '<a data-id="sgpb-hidden-media-popup" href="javascript:void(0);" class="button sgpb-insert-media-button-js" title="'.$buttonTitle.'" style="padding-left: .4em;">'. $img.$buttonTitle.'</a>';
102
+ if (!$this->hideMediaButton) {
103
+ $output = '';
104
+ }
105
 
106
  return $output.$mediaButtonContent;
107
  }
com/classes/PopupChecker.php CHANGED
@@ -155,12 +155,14 @@ class PopupChecker
155
  foreach ($permissiveOptions as $permissiveOption) {
156
  $isPermissiveConditions = $this->isSatisfyForConditionsOptions($permissiveOption);
157
 
158
- if ($isPermissiveConditions === false) {
159
  return $isPermissiveConditions;
160
  }
161
  }
 
 
162
  }
163
- // proEndSilver
164
  return true;
165
  }
166
 
@@ -169,6 +171,7 @@ class PopupChecker
169
  global $post;
170
  $paramName = $option['param'];
171
  $defaultStatus = false;
 
172
 
173
  // proStartSilver
174
  if ($paramName == 'select_role') {
@@ -179,7 +182,9 @@ class PopupChecker
179
  $defaultStatus = true;
180
  }
181
  // proEndSilver
182
- $isAllowedConditionFilters = apply_filters('isAllowedConditionFilters', array($option));
 
 
183
  if (isset($isAllowedConditionFilters['status']) && $isAllowedConditionFilters['status'] === true) {
184
  $defaultStatus = true;
185
  }
155
  foreach ($permissiveOptions as $permissiveOption) {
156
  $isPermissiveConditions = $this->isSatisfyForConditionsOptions($permissiveOption);
157
 
158
+ if ($isPermissiveConditions) {
159
  return $isPermissiveConditions;
160
  }
161
  }
162
+
163
+ return false;
164
  }
165
+
166
  return true;
167
  }
168
 
171
  global $post;
172
  $paramName = $option['param'];
173
  $defaultStatus = false;
174
+ $isAllowedConditionFilters = array();
175
 
176
  // proStartSilver
177
  if ($paramName == 'select_role') {
182
  $defaultStatus = true;
183
  }
184
  // proEndSilver
185
+ if (!isset($isAllowedConditionFilters['status']) || $isAllowedConditionFilters['status'] == false) {
186
+ $isAllowedConditionFilters = apply_filters('isAllowedConditionFilters', array($option));
187
+ }
188
  if (isset($isAllowedConditionFilters['status']) && $isAllowedConditionFilters['status'] === true) {
189
  $defaultStatus = true;
190
  }
com/classes/RegisterPostType.php CHANGED
@@ -326,7 +326,7 @@ class RegisterPostType
326
  __('Support', SG_POPUP_TEXT_DOMAIN),
327
  __('Support', SG_POPUP_TEXT_DOMAIN),
328
  'sgpb_manage_options',
329
- 'support',
330
  array($this, 'supportLink')
331
  );
332
  }
@@ -347,7 +347,7 @@ class RegisterPostType
347
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
348
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
349
  'sgpb_manage_options',
350
- 'sgpbSubscribers',
351
  array($this, 'subscribersPage')
352
  );
353
 
326
  __('Support', SG_POPUP_TEXT_DOMAIN),
327
  __('Support', SG_POPUP_TEXT_DOMAIN),
328
  'sgpb_manage_options',
329
+ SG_POPUP_SUPPORT_PAGE,
330
  array($this, 'supportLink')
331
  );
332
  }
347
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
348
  __('Subscribers', SG_POPUP_TEXT_DOMAIN),
349
  'sgpb_manage_options',
350
+ SG_POPUP_SUBSCRIBERS_PAGE,
351
  array($this, 'subscribersPage')
352
  );
353
 
com/classes/ScriptsLoader.php CHANGED
@@ -102,6 +102,7 @@ class ScriptsLoader
102
  $events = json_encode($events);
103
 
104
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
 
105
 
106
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
107
  $footerPopupContent = '<div style="position:fixed;bottom: -999999999999999999999px;">
102
  $events = json_encode($events);
103
 
104
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
105
+ $popupOptions = apply_filters('sgpbLoadToFooterOptions', $popupOptions);
106
 
107
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
108
  $footerPopupContent = '<div style="position:fixed;bottom: -999999999999999999999px;">
com/classes/Style.php CHANGED
@@ -19,7 +19,7 @@ class Style
19
  $popupType = AdminHelper::getCurrentPopupType();
20
  $currentPostType = AdminHelper::getCurrentPostType();
21
 
22
- if ($hook == 'popupbuilder_page_popupbuilder') {
23
  $pageName = 'popupType';
24
  }
25
  else if (($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
@@ -28,8 +28,8 @@ class Style
28
  else if ($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
29
  $pageName = 'popupspage';
30
  }
31
- else if ($hook == 'popupbuilder_page_subscribers') {
32
- $pageName = 'sgpbSubscribers';
33
  }
34
 
35
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
19
  $popupType = AdminHelper::getCurrentPopupType();
20
  $currentPostType = AdminHelper::getCurrentPostType();
21
 
22
+ if($hook == SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_POST_TYPE) {
23
  $pageName = 'popupType';
24
  }
25
  else if (($hook == 'post-new.php' || $hook == 'post.php') && $currentPostType == SG_POPUP_POST_TYPE) {
28
  else if ($hook == 'edit.php' && !empty($currentPostType) && $currentPostType == SG_POPUP_POST_TYPE) {
29
  $pageName = 'popupspage';
30
  }
31
+ else if ($hook == SG_POPUP_POST_TYPE.'_page_'.SG_POPUP_SUBSCRIBERS_PAGE) {
32
+ $pageName = SG_POPUP_SUBSCRIBERS_PAGE;
33
  }
34
 
35
  $registeredPlugins = get_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS');
com/classes/dataTable/Subscribers.php CHANGED
@@ -94,7 +94,7 @@ class Subscribers extends SGPBTable
94
  ob_start();
95
  ?>
96
  <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo $selectedPopup;?>">
97
- <input type="hidden" name="page" value="sgpbSubscribers" />
98
 
99
  <select name="sgpb-subscription-popup" id="sgpb-subscription-popup">
100
  <?php
94
  ob_start();
95
  ?>
96
  <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo $selectedPopup;?>">
97
+ <input type="hidden" name="page" value="<?php echo SG_POPUP_SUBSCRIBERS_PAGE; ?>" >
98
 
99
  <select name="sgpb-subscription-popup" id="sgpb-subscription-popup">
100
  <?php
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -89,7 +89,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
89
 
90
  if (in_array($pageName, $allowPages) || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE) {
91
  $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
92
- $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
93
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
94
 
95
 
@@ -139,7 +139,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
139
  'data' => SG_POPUP_PUBLIC_URL
140
  );
141
  }
142
- else if ($pageName == 'popupbuilder_page_sgpbSubscribers' || $pageName == 'sgpbSubscribers') {
143
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
144
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
145
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Subscribers.js');
@@ -232,7 +232,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
232
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'theme.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
233
  $cssFiles[] = array('folderUrl' => '', 'filename' => 'wp-color-picker');
234
  }
235
- else if ($pageName == 'sgpbSubscribers') {
236
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
237
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
238
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
89
 
90
  if (in_array($pageName, $allowPages) || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE) {
91
  $jsFiles[] = array('folderUrl'=> '', 'filename' => 'wp-color-picker');
92
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js');
93
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
94
 
95
 
139
  'data' => SG_POPUP_PUBLIC_URL
140
  );
141
  }
142
+ else if ($pageName == SG_POPUP_SUBSCRIBERS_PAGE) {
143
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'select2.min.js', 'dep' => '', 'ver' => '3.86', 'inFooter' => '');
144
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgpbSelect2.js');
145
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Subscribers.js');
232
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'theme.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
233
  $cssFiles[] = array('folderUrl' => '', 'filename' => 'wp-color-picker');
234
  }
235
+ else if ($pageName == SG_POPUP_SUBSCRIBERS_PAGE) {
236
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'sgbp-bootstrap.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
237
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'popupAdminStyles.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
238
  $cssFiles[] = array('folderUrl' => SG_POPUP_CSS_URL, 'filename' => 'select2.min.css', 'dep' => array(), 'ver' => SG_POPUP_VERSION, 'inFooter' => false);
com/classes/extension/SgpbPopupExtensionRegister.php CHANGED
@@ -22,7 +22,7 @@ class SgpbPopupExtensionRegister
22
  if(!empty($registeredData[$pluginName])) {
23
  /*Delete the plugin from the registered plugins' list if the class name or the class path is empty.*/
24
  unset($registeredData[$pluginName]);
25
- update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
26
  }
27
 
28
  return;
@@ -34,7 +34,7 @@ class SgpbPopupExtensionRegister
34
  $registeredData[$pluginName] = $pluginData;
35
  $registeredData = json_encode($registeredData);
36
 
37
- update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
38
  }
39
 
40
  public static function remove($pluginName)
@@ -57,7 +57,7 @@ class SgpbPopupExtensionRegister
57
  unset($registeredData[$pluginName]);
58
  $registeredData = json_encode($registeredData);
59
 
60
- update_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
61
 
62
  return true;
63
  }
22
  if(!empty($registeredData[$pluginName])) {
23
  /*Delete the plugin from the registered plugins' list if the class name or the class path is empty.*/
24
  unset($registeredData[$pluginName]);
25
+ update_site_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
26
  }
27
 
28
  return;
34
  $registeredData[$pluginName] = $pluginData;
35
  $registeredData = json_encode($registeredData);
36
 
37
+ update_site_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
38
  }
39
 
40
  public static function remove($pluginName)
57
  unset($registeredData[$pluginName]);
58
  $registeredData = json_encode($registeredData);
59
 
60
+ update_site_option('SG_POPUP_BUILDER_REGISTERED_PLUGINS', $registeredData);
61
 
62
  return true;
63
  }
com/classes/popups/HtmlPopup.php CHANGED
@@ -23,7 +23,6 @@ class HtmlPopup extends SGPopup
23
  {
24
  $htmlContent = '';
25
  $popupContent = $this->getContent();
26
-
27
  $htmlContent .= '<div class="sgpb-main-html-content-wrapper">';
28
  $htmlContent .= $popupContent;
29
  $htmlContent .= '</div>';
23
  {
24
  $htmlContent = '';
25
  $popupContent = $this->getContent();
 
26
  $htmlContent .= '<div class="sgpb-main-html-content-wrapper">';
27
  $htmlContent .= $popupContent;
28
  $htmlContent .= '</div>';
com/classes/popups/SGPopup.php CHANGED
@@ -158,7 +158,14 @@ abstract class SGPopup
158
 
159
  public function getContent()
160
  {
161
- return wpautop($this->content);
 
 
 
 
 
 
 
162
  }
163
 
164
  public function setPostData($postData)
@@ -245,6 +252,8 @@ abstract class SGPopup
245
  require_once(dirname(__FILE__).'/PopupData.php');
246
  $savedData = PopupData::getPopupDataById($popupId, $saveMode);
247
 
 
 
248
  if (empty($savedData)) {
249
  return false;
250
  }
@@ -299,7 +308,7 @@ abstract class SGPopup
299
  }
300
  }
301
 
302
- return $eventsData;
303
  }
304
 
305
  public static function getPopupClassNameFormType($type)
@@ -307,7 +316,7 @@ abstract class SGPopup
307
  $popupName = ucfirst(strtolower($type));
308
  $popupClassName = $popupName.'Popup';
309
 
310
- return $popupClassName;
311
  }
312
 
313
  public static function getPopupTypeClassPath($type)
@@ -326,7 +335,12 @@ abstract class SGPopup
326
  {
327
  switch ($type) {
328
  case 'string':
329
- $sanitizedValue = htmlspecialchars($value);
 
 
 
 
 
330
  break;
331
  case 'text':
332
  $sanitizedValue = htmlspecialchars($value);
@@ -426,6 +440,8 @@ abstract class SGPopup
426
  $obj->setSavedPopupById($data['sgpb-post-id']);
427
  $result = $obj->save();
428
 
 
 
429
  if ($result) {
430
  return $obj;
431
  }
@@ -494,6 +510,8 @@ abstract class SGPopup
494
 
495
  $data['sgpb-button-image-data'] = $buttonImageData;
496
  $data['sgpb-background-image-data'] = $contentBackgroundImageData;
 
 
497
  $this->setSanitizedData($data);
498
  }
499
 
@@ -557,6 +575,8 @@ abstract class SGPopup
557
  return true;
558
  }
559
 
 
 
560
  return update_post_meta($popupId, 'sg_popup_target'.$saveMode, $popupTarget);
561
  }
562
 
@@ -601,6 +621,8 @@ abstract class SGPopup
601
  $eventsFromPopup[] = $SGPB_DATA_CONFIG_ARRAY['events']['initialData'];
602
  }
603
 
 
 
604
  return update_post_meta($popupId, 'sg_popup_events'.$saveMode, $eventsFromPopup);
605
  }
606
 
@@ -636,6 +658,8 @@ abstract class SGPopup
636
  return true;
637
  }
638
 
 
 
639
  return update_post_meta($popupId, 'sg_popup_options'.$saveMode, $popupOptions);
640
  }
641
 
@@ -938,6 +962,9 @@ abstract class SGPopup
938
  }
939
  }
940
 
 
 
 
941
  self::saveToTargetFromPage($targetData);
942
  self::saveToEventsFromPage($eventsData);
943
  }
@@ -1186,7 +1213,7 @@ abstract class SGPopup
1186
  }
1187
  }
1188
 
1189
- return $options;
1190
  }
1191
 
1192
  /**
158
 
159
  public function getContent()
160
  {
161
+ $postId = $this->getId();
162
+ $popupContent = wpautop($this->content);
163
+ $editorContent = AdminHelper::checkEditorByPopupId($postId);
164
+ if (!empty($editorContent)) {
165
+ $popupContent = $editorContent;
166
+ }
167
+
168
+ return $popupContent;
169
  }
170
 
171
  public function setPostData($postData)
252
  require_once(dirname(__FILE__).'/PopupData.php');
253
  $savedData = PopupData::getPopupDataById($popupId, $saveMode);
254
 
255
+ $savedData = apply_filters('sgpbPopupSavedData', $savedData);
256
+
257
  if (empty($savedData)) {
258
  return false;
259
  }
308
  }
309
  }
310
 
311
+ return apply_filters('sgpbEventsToOneArray', $eventsData);
312
  }
313
 
314
  public static function getPopupClassNameFormType($type)
316
  $popupName = ucfirst(strtolower($type));
317
  $popupClassName = $popupName.'Popup';
318
 
319
+ return apply_filters('sgpbPopupClassNameFromType', $popupClassName);
320
  }
321
 
322
  public static function getPopupTypeClassPath($type)
335
  {
336
  switch ($type) {
337
  case 'string':
338
+ if (is_array($value)) {
339
+ $sanitizedValue = $this->recursiveSanitizeTextField($value);
340
+ }
341
+ else {
342
+ $sanitizedValue = htmlspecialchars($value);
343
+ }
344
  break;
345
  case 'text':
346
  $sanitizedValue = htmlspecialchars($value);
440
  $obj->setSavedPopupById($data['sgpb-post-id']);
441
  $result = $obj->save();
442
 
443
+ $result = apply_filters('sgpbPopupCreateResult', $result);
444
+
445
  if ($result) {
446
  return $obj;
447
  }
510
 
511
  $data['sgpb-button-image-data'] = $buttonImageData;
512
  $data['sgpb-background-image-data'] = $contentBackgroundImageData;
513
+
514
+ $data = apply_filters('sgpbConvertImagesToData', $data);
515
  $this->setSanitizedData($data);
516
  }
517
 
575
  return true;
576
  }
577
 
578
+ $popupTarget = apply_filters('sgpbPopupTargetMetaData', $popupTarget);
579
+
580
  return update_post_meta($popupId, 'sg_popup_target'.$saveMode, $popupTarget);
581
  }
582
 
621
  $eventsFromPopup[] = $SGPB_DATA_CONFIG_ARRAY['events']['initialData'];
622
  }
623
 
624
+ $eventsFromPopup = apply_filters('sgpbPopupEventsMetadata', $eventsFromPopup);
625
+
626
  return update_post_meta($popupId, 'sg_popup_events'.$saveMode, $eventsFromPopup);
627
  }
628
 
658
  return true;
659
  }
660
 
661
+ $popupOptions = apply_filters('sgpbPopupSavedOptionsMetaData', $popupOptions);
662
+
663
  return update_post_meta($popupId, 'sg_popup_options'.$saveMode, $popupOptions);
664
  }
665
 
962
  }
963
  }
964
 
965
+ $targetData = apply_filters('sgpbPopupTargetData', $targetData);
966
+ $eventsData = apply_filters('sgpbPopupEventsData', $eventsData);
967
+
968
  self::saveToTargetFromPage($targetData);
969
  self::saveToEventsFromPage($eventsData);
970
  }
1213
  }
1214
  }
1215
 
1216
+ return apply_filters('sgpbPopupInsideShortcodes', $options);
1217
  }
1218
 
1219
  /**
com/classes/popups/SubscriptionPopup.php CHANGED
@@ -165,7 +165,7 @@ class SubscriptionPopup extends SGPopup
165
  private function getFieldValue($optionName)
166
  {
167
  $optionValue = '';
168
- $postData = $this->getData();
169
 
170
  if (!empty($postData[$optionName])) {
171
  return $postData[$optionName];
@@ -193,7 +193,6 @@ class SubscriptionPopup extends SGPopup
193
  $formData = array();
194
  $inputStyles = array();
195
  $submitStyles = array();
196
- $postData = $this->getData();
197
  $emailPlaceholder = $this->getFieldValue('sgpb-subs-email-placeholder');
198
  if ($this->getFieldValue('sgpb-subs-text-width')) {
199
  $inputWidth = $this->getFieldValue('sgpb-subs-text-width');
165
  private function getFieldValue($optionName)
166
  {
167
  $optionValue = '';
168
+ $postData = $this->getPostData();
169
 
170
  if (!empty($postData[$optionName])) {
171
  return $postData[$optionName];
193
  $formData = array();
194
  $inputStyles = array();
195
  $submitStyles = array();
 
196
  $emailPlaceholder = $this->getFieldValue('sgpb-subs-email-placeholder');
197
  if ($this->getFieldValue('sgpb-subs-text-width')) {
198
  $inputWidth = $this->getFieldValue('sgpb-subs-text-width');
com/config/config.php CHANGED
@@ -75,8 +75,10 @@ class SgpbPopupConfig
75
  self::addDefine('SG_POPUP_CATEGORY_TAXONOMY', 'popup-categories');
76
  self::addDefine('SG_POPUP_MINIMUM_PHP_VERSION', '5.3.3');
77
  self::addDefine('SG_POPUP_POST_TYPE', 'popupbuilder');
78
- self::addDefine('SG_POPUP_NEWSLETTER_PAGE', 'newsletter');
79
- self::addDefine('SG_POPUP_SETTINGS_PAGE', 'settings');
 
 
80
  self::addDefine('SGPB_POPUP_LICENSE', 'license');
81
  self::addDefine('SG_POPUP_EXTEND_PAGE', 'extend');
82
  self::addDefine('SGPB_FILTER_REPEAT_INTERVAL', 50);
75
  self::addDefine('SG_POPUP_CATEGORY_TAXONOMY', 'popup-categories');
76
  self::addDefine('SG_POPUP_MINIMUM_PHP_VERSION', '5.3.3');
77
  self::addDefine('SG_POPUP_POST_TYPE', 'popupbuilder');
78
+ self::addDefine('SG_POPUP_NEWSLETTER_PAGE', 'sgpbNewsletter');
79
+ self::addDefine('SG_POPUP_SETTINGS_PAGE', 'sgpbSettings');
80
+ self::addDefine('SG_POPUP_SUBSCRIBERS_PAGE', 'sgpbSubscribers');
81
+ self::addDefine('SG_POPUP_SUPPORT_PAGE', 'sgpbSupport');
82
  self::addDefine('SGPB_POPUP_LICENSE', 'license');
83
  self::addDefine('SG_POPUP_EXTEND_PAGE', 'extend');
84
  self::addDefine('SGPB_FILTER_REPEAT_INTERVAL', 50);
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.1.6.1');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '3.1.7');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -69,8 +69,8 @@ class SgpbDataConfig
69
  $targetDataParams['post_selected'] = apply_filters('sgPopupTargetPostData', array());
70
  $targetDataParams['page_selected'] = apply_filters('sgPopupTargetPageSelected', array());
71
  $targetDataParams['post_type'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getAllCustomPostTypes());
72
- $targetDataParams['post_category'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getPostsAllCategories());
73
- $targetDataParams['page_type'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getPageTypes());
74
  $targetDataParams['page_template'] = apply_filters('sgPopupPageTemplates', array());
75
  $targetDataParams['post_tags_ids'] = apply_filters('sgPopupTags', ConfigDataHelper::getAllTags());
76
  $targetDataParams['everywhere'] = null;
@@ -206,7 +206,7 @@ class SgpbDataConfig
206
  $popupTarget['columnTypes'] = apply_filters('sgPopupTargetTypes', $targetElementTypes);
207
  $popupTarget['paramsData'] = apply_filters('sgPopupTargetData', $targetDataParams);
208
  $popupTarget['initialData'] = apply_filters('sgPopupTargetInitialData', $targetInitialData);
209
- $popupTarget['operators'] = apply_filters('sgPopupTargetOperators', $targetOperators);
210
  $popupTarget['attrs'] = apply_filters('sgPopupTargetAttrs', $targetAttrs);
211
 
212
  $SGPB_DATA_CONFIG_ARRAY['target'] = $popupTarget;
@@ -432,8 +432,8 @@ class SgpbDataConfig
432
  array('param' => 'select_role', 'operator' => '==', 'value' => '')
433
  );
434
 
435
- $targetDataParams['param'] = apply_filters('sgPopupTargetParams', $targetParams);
436
- $targetDataParams['operator'] = apply_filters('sgPopupTargetOperator', $targetDataOperator);
437
 
438
  $targetDataParams['select_role'] = null;
439
 
@@ -747,8 +747,8 @@ class SgpbDataConfig
747
  $config['paramsData'] = apply_filters('sgPopupSpecialEventsParams', $params);
748
  $config['initialData'] = apply_filters('sgPopupSpecialEventsInitialData', $initialData);
749
  $config['attrs'] = apply_filters('sgPopupSpecialEventsAttrs', $attrs);
750
- $config['operators'] = apply_filters('sgPopupSpecialEventsOperators', array());
751
- $config['specialDefaultOperator'] = apply_filters('sgPopupSpecialEventsOperators', ' ');
752
 
753
  return $config;
754
  }
@@ -832,38 +832,6 @@ class SgpbDataConfig
832
  $options[] = array('name' => 'sgpb-button-image-width', 'type' => 'text', 'defaultValue' => 21);
833
  $options[] = array('name' => 'sgpb-button-image-height', 'type' => 'text', 'defaultValue' => 21);
834
  $options[] = array('name' => 'sgpb-is-active', 'type' => 'checkbox', 'defaultValue' => 'on');
835
- // proStartSilver
836
- $options[] = array('name' => 'sgpb-restriction-cookie-level', 'type' => 'checkbox', 'defaultValue' => '');
837
- $options[] = array('name' => 'sgpb-restriction-yes-btn-radius', 'type' => 'number', 'defaultValue' => '');
838
- $options[] = array('name' => 'sgpb-restriction-no-btn-radius', 'type' => 'number', 'defaultValue' => '');
839
- $options[] = array('name' => 'sgpb-restriction-yes-btn-radius-type', 'type' => 'text', 'defaultValue' => '');
840
- $options[] = array('name' => 'sgpb-restriction-no-btn-radius-type', 'type' => 'text', 'defaultValue' => '');
841
- $options[] = array('name' => 'sgpb-restriction-yes-btn-bg-color', 'type' => 'text', 'defaultValue' => '#222222');
842
- $options[] = array('name' => 'sgpb-restriction-no-btn-bg-color', 'type' => 'text', 'defaultValue' => '#222222');
843
- $options[] = array('name' => 'sgpb-restriction-yes-btn-text-color', 'type' => 'text', 'defaultValue' => '#ffffff');
844
- $options[] = array('name' => 'sgpb-restriction-yes-btn-border-color', 'type' => 'text', 'defaultValue' => '#222222');
845
- $options[] = array('name' => 'sgpb-restriction-yes-btn-border-width', 'type' => 'number', 'defaultValue' => 2);
846
- $options[] = array('name' => 'sgpb-restriction-no-btn-border-color', 'type' => 'text', 'defaultValue' => '#222222');
847
- $options[] = array('name' => 'sgpb-restriction-no-btn-border-width', 'type' => 'number', 'defaultValue' => 2);
848
- $options[] = array('name' => 'sgpb-restriction-no-btn-text-color', 'type' => 'text', 'defaultValue' => '#ffffff');
849
- $options[] = array('name' => 'sgpb-restriction-yes-expiration-time', 'type' => 'number', 'defaultValue' => 365);
850
- $options[] = array('name' => 'sgpb-restriction-save-choice', 'type' => 'checkbox', 'defaultValue' => 'on');
851
- $options[] = array('name' => 'sgpb-restriction-yes-btn', 'type' => 'text', 'defaultValue' => __('Yes', SG_POPUP_TEXT_DOMAIN));
852
- $options[] = array('name' => 'sgpb-restriction-to-bottom', 'type' => 'checkbox', 'defaultValue' => '');
853
- $options[] = array('name' => 'sgpb-restriction-no-btn', 'type' => 'text', 'defaultValue' => __('No', SG_POPUP_TEXT_DOMAIN));
854
- $options[] = array('name' => 'sgpb-countdown-show-on-top', 'type' => 'checkbox', 'defaultValue' => 'on');
855
- $options[] = array('name' => 'sgpb-countdown-close-timeout', 'type' => 'checkbox', 'defaultValue' => 'on');
856
- $options[] = array('name' => 'sgpb-countdown-repetitive-timer', 'type' => 'checkbox', 'defaultValue' => '');
857
- $options[] = array('name' => 'sgpb-counter-background-color', 'type' => 'text', 'defaultValue' => '#333333');
858
- $options[] = array('name' => 'sgpb-counter-text-color', 'type' => 'text', 'defaultValue' => '#cccccc');
859
- $options[] = array('name' => 'sgpb-countdown-timezone', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getDefaultTimezone());
860
- $options[] = array('name' => 'sgpb-countdown-due-date', 'type' => 'text', 'defaultValue' => ConfigDataHelper::getCurrentDateTime());
861
- $options[] = array('name' => 'sgpb-countdown-date-format', 'type' => 'text', 'defaultValue' => 'date');
862
- $options[] = array('name' => 'sgpb-countdown-repetitive-seconds', 'type' => 'text', 'defaultValue' => '');
863
- $options[] = array('name' => 'sgpb-countdown-date-days', 'type' => 'text', 'defaultValue' => '1');
864
- $options[] = array('name' => 'sgpb-countdown-date-hours', 'type' => 'number', 'defaultValue' => '0');
865
- $options[] = array('name' => 'sgpb-countdown-date-minutes', 'type' => 'number', 'defaultValue' => '0');
866
- // proEndSilver
867
  $options[] = array('name' => 'sgpb-subs-form-bg-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
868
  $options[] = array('name' => 'sgpb-subs-form-bg-opacity', 'type' => 'text', 'defaultValue' => 0.8);
869
  $options[] = array('name' => 'sgpb-subs-form-padding', 'type' => 'number', 'defaultValue' => 2);
@@ -897,78 +865,10 @@ class SgpbDataConfig
897
  $options[] = array('name' => 'sgpb-subs-gdpr-status', 'type' => 'checkbox', 'defaultValue' => '');
898
  $options[] = array('name' => 'sgpb-subs-gdpr-label', 'type' => 'text', 'defaultValue' => __('Accept Terms', SG_POPUP_TEXT_DOMAIN));
899
  $options[] = array('name' => 'sgpb-subs-gdpr-text', 'type' => 'text', 'defaultValue' => __(get_bloginfo().' will use the information you provide on this form to be in touch with you and to provide updates and marketing.', SG_POPUP_TEXT_DOMAIN));
900
- // proStartSilver
901
- $options[] = array('name' => 'sgpb-contact-form-bg-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
902
- $options[] = array('name' => 'sgpb-contact-form-bg-opacity', 'type' => 'text', 'defaultValue' => 0.8);
903
- $options[] = array('name' => 'sgpb-contact-form-padding', 'type' => 'number', 'defaultValue' => 2);
904
- $options[] = array('name' => 'sgpb-contact-show-form-to-top', 'type' => 'checkbox', 'defaultValue' => '');
905
- $options[] = array('name' => 'sgpb-contact-field-name', 'type' => 'checkbox', 'defaultValue' => 'on');
906
- $options[] = array('name' => 'sgpb-contact-name-placeholder', 'type' => 'text', 'defaultValue' => __('Name *', SG_POPUP_TEXT_DOMAIN));
907
- $options[] = array('name' => 'sgpb-contact-name-required', 'type' => 'checkbox', 'defaultValue' => 'on');
908
- $options[] = array('name' => 'sgpb-contact-field-subject', 'type' => 'checkbox', 'defaultValue' => 'on');
909
- $options[] = array('name' => 'sgpb-contact-subject-placeholder', 'type' => 'text', 'defaultValue' => __('Subject *', SG_POPUP_TEXT_DOMAIN));
910
- $options[] = array('name' => 'sgpb-contact-subject-required', 'type' => 'checkbox', 'defaultValue' => 'on');
911
- $options[] = array('name' => 'sgpb-contact-email-placeholder', 'type' => 'text', 'defaultValue' => __('E-mail *', SG_POPUP_TEXT_DOMAIN));
912
- $options[] = array('name' => 'sgpb-contact-message-placeholder', 'type' => 'text', 'defaultValue' => __('Message *', SG_POPUP_TEXT_DOMAIN));
913
- $options[] = array('name' => 'sgpb-contact-receiver-email', 'type' => 'text', 'defaultValue' => get_option('admin_email'));
914
- $options[] = array('name' => 'sgpb-contact-error-message', 'type' => 'text', 'defaultValue' => __('Unable to send.', SG_POPUP_TEXT_DOMAIN));
915
- $options[] = array('name' => 'sgpb-contact-required-message', 'type' => 'text', 'defaultValue' => __('This field is required.', SG_POPUP_TEXT_DOMAIN));
916
- $options[] = array('name' => 'sgpb-contact-invalid-email-message', 'type' => 'text', 'defaultValue' => __('Please enter a valid email.', SG_POPUP_TEXT_DOMAIN));
917
- $options[] = array('name' => 'sgpb-contact-inputs-width', 'type' => 'text', 'defaultValue' => '300px');
918
- $options[] = array('name' => 'sgpb-contact-inputs-height', 'type' => 'text', 'defaultValue' => '40px');
919
- $options[] = array('name' => 'sgpb-contact-inputs-border-width', 'type' => 'text', 'defaultValue' => '2px');
920
- $options[] = array('name' => 'sgpb-contact-inputs-bg-color', 'type' => 'text', 'defaultValue' => '#ffffff');
921
- $options[] = array('name' => 'sgpb-contact-inputs-border-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
922
- $options[] = array('name' => 'sgpb-contact-inputs-text-color', 'type' => 'text', 'defaultValue' => '#000000');
923
- $options[] = array('name' => 'sgpb-contact-inputs-placeholder-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
924
- $options[] = array('name' => 'sgpb-contact-message-width', 'type' => 'text', 'defaultValue' => '300px');
925
- $options[] = array('name' => 'sgpb-contact-message-height', 'type' => 'text', 'defaultValue' => '50px');
926
- $options[] = array('name' => 'sgpb-contact-message-resize', 'type' => 'text', 'defaultValue' => 'both');
927
- $options[] = array('name' => 'sgpb-contact-message-border-width', 'type' => 'text', 'defaultValue' => '2px');
928
- $options[] = array('name' => 'sgpb-contact-message-border-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
929
- $options[] = array('name' => 'sgpb-contact-submit-width', 'type' => 'text', 'defaultValue' => '300px');
930
- $options[] = array('name' => 'sgpb-contact-submit-height', 'type' => 'text', 'defaultValue' => '40px');
931
- $options[] = array('name' => 'sgpb-contact-submit-title', 'type' => 'text', 'defaultValue' => __('Submit', SG_POPUP_TEXT_DOMAIN));
932
- $options[] = array('name' => 'sgpb-contact-submit-title-progress', 'type' => 'text', 'defaultValue' => __('Please wait...', SG_POPUP_TEXT_DOMAIN));
933
- $options[] = array('name' => 'sgpb-contact-submit-bg-color', 'type' => 'text', 'defaultValue' => '#4CAF50');
934
- $options[] = array('name' => 'sgpb-contact-submit-text-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
935
- $options[] = array('name' => 'sgpb-contact-message-placeholder-color', 'type' => 'text', 'defaultValue' => '#CCCCCC');
936
- $options[] = array('name' => 'sgpb-contact-message-text-color', 'type' => 'text', 'defaultValue' => '#000000');
937
- $options[] = array('name' => 'sgpb-contact-message-bg-color', 'type' => 'text', 'defaultValue' => '#ffffff');
938
- $options[] = array('name' => 'sgpb-contact-success-behavior', 'type' => 'text', 'defaultValue' => 'showMessage');
939
- $options[] = array('name' => 'sgpb-contact-hide-for-contacted-users', 'type' => 'checkbox', 'defaultValue' => '');
940
- $options[] = array('name' => 'sgpb-contact-success-message', 'type' => 'text', 'defaultValue' => __('Your message has been successfully sent', SG_POPUP_TEXT_DOMAIN));
941
- $options[] = array('name' => 'sgpb-contact-success-redirect-URL', 'type' => 'text', 'defaultValue' => '');
942
- $options[] = array('name' => 'sgpb-contact-success-redirect-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
943
- $options[] = array('name' => 'sgpb-contact-gdpr-status', 'type' => 'checkbox', 'defaultValue' => '');
944
- $options[] = array('name' => 'sgpb-contact-gdpr-label', 'type' => 'text', 'defaultValue' => __('Accept Terms', SG_POPUP_TEXT_DOMAIN));
945
- $options[] = array('name' => 'sgpb-contact-gdpr-text', 'type' => 'text', 'defaultValue' => __(get_bloginfo().' will use the information you provide on this form to be in touch with you and to provide updates and marketing.', SG_POPUP_TEXT_DOMAIN));
946
- $options[] = array('name' => 'sgpb-social-share-url-type', 'type' => 'text', 'defaultValue' => 'shareUrl');
947
- $options[] = array('name' => 'sgpb-social-share-url', 'type' => 'text', 'defaultValue' => '');
948
- $options[] = array('name' => 'sgpb-social-share-theme', 'type' => 'text', 'defaultValue' => 'classic');
949
- $options[] = array('name' => 'sgpb-social-theme-size', 'type' => 'text', 'defaultValue' => 14);
950
- $options[] = array('name' => 'sgpb-social-show-labels', 'type' => 'checkbox', 'defaultValue' => 'on');
951
- $options[] = array('name' => 'sgpb-social-share-count', 'type' => 'text', 'defaultValue' => 'true');
952
- $options[] = array('name' => 'sgpb-social-round-buttons', 'type' => 'checkbox', 'defaultValue' => '');
953
- $options[] = array('name' => 'sgpb-social-status-email', 'type' => 'checkbox', 'defaultValue' => 'on');
954
- $options[] = array('name' => 'sgpb-social-label-email', 'type' => 'text', 'defaultValue' => __('E-mail', SG_POPUP_TEXT_DOMAIN));
955
- $options[] = array('name' => 'sgpb-social-status-facebook', 'type' => 'checkbox', 'defaultValue' => 'on');
956
- $options[] = array('name' => 'sgpb-social-label-facebook', 'type' => 'text', 'defaultValue' => __('Share', SG_POPUP_TEXT_DOMAIN));
957
- $options[] = array('name' => 'sgpb-social-status-linkedin', 'type' => 'checkbox', 'defaultValue' => 'on');
958
- $options[] = array('name' => 'sgpb-social-label-linkedin', 'type' => 'text', 'defaultValue' => __('Share', SG_POPUP_TEXT_DOMAIN));
959
- $options[] = array('name' => 'sgpb-social-status-googleplus', 'type' => 'checkbox', 'defaultValue' => 'on');
960
- $options[] = array('name' => 'sgpb-social-label-googleplus', 'type' => 'text', 'defaultValue' => __('+1', SG_POPUP_TEXT_DOMAIN));
961
- $options[] = array('name' => 'sgpb-social-status-twitter', 'type' => 'checkbox', 'defaultValue' => 'on');
962
- $options[] = array('name' => 'sgpb-social-label-twitter', 'type' => 'text', 'defaultValue' => __('Tweet', SG_POPUP_TEXT_DOMAIN));
963
- $options[] = array('name' => 'sgpb-social-status-pinterest', 'type' => 'checkbox', 'defaultValue' => 'on');
964
- $options[] = array('name' => 'sgpb-social-label-pinterest', 'type' => 'text', 'defaultValue' => __('Pin it', SG_POPUP_TEXT_DOMAIN));
965
- $options[] = array('name' => 'sgpb-social-to-bottom', 'type' => 'checkbox', 'defaultValue' => '');
966
- // proEndSilver
967
  $options[] = array('name' => 'sgpb-fblike-like-url', 'type' => 'text', 'defaultValue' => '');
968
  $options[] = array('name' => 'sgpb-fblike-layout', 'type' => 'text', 'defaultValue' => 'standard');
969
  $options[] = array('name' => 'sgpb-fblike-dont-show-share-button', 'type' => 'checkbox', 'defaultValue' => '');
970
- $options[] = array('name' => 'sgpb-subs-fields', 'type' => 'sgpb', 'defaultValue' => '');
971
- $options[] = array('name' => 'sgpb-contact-fields', 'type' => 'sgpb', 'defaultValue' => '');
972
  $options[] = array('name' => 'sgpb-border-color', 'type' => 'text', 'defaultValue' => '#000000');
973
  $options[] = array('name' => 'sgpb-border-radius', 'type' => 'text', 'defaultValue' => 0);
974
  $options[] = array('name' => 'sgpb-show-popup-same-user', 'type' => 'checkbox', 'defaultValue' => '');
69
  $targetDataParams['post_selected'] = apply_filters('sgPopupTargetPostData', array());
70
  $targetDataParams['page_selected'] = apply_filters('sgPopupTargetPageSelected', array());
71
  $targetDataParams['post_type'] = apply_filters('sgPopupTargetPostType', ConfigDataHelper::getAllCustomPostTypes());
72
+ $targetDataParams['post_category'] = apply_filters('sgPopupTargetPostCategory', ConfigDataHelper::getPostsAllCategories());
73
+ $targetDataParams['page_type'] = apply_filters('sgPopupTargetPageType', ConfigDataHelper::getPageTypes());
74
  $targetDataParams['page_template'] = apply_filters('sgPopupPageTemplates', array());
75
  $targetDataParams['post_tags_ids'] = apply_filters('sgPopupTags', ConfigDataHelper::getAllTags());
76
  $targetDataParams['everywhere'] = null;
206
  $popupTarget['columnTypes'] = apply_filters('sgPopupTargetTypes', $targetElementTypes);
207
  $popupTarget['paramsData'] = apply_filters('sgPopupTargetData', $targetDataParams);
208
  $popupTarget['initialData'] = apply_filters('sgPopupTargetInitialData', $targetInitialData);
209
+ $popupTarget['operators'] = apply_filters('sgpbPopupEventsOperators', $targetOperators);
210
  $popupTarget['attrs'] = apply_filters('sgPopupTargetAttrs', $targetAttrs);
211
 
212
  $SGPB_DATA_CONFIG_ARRAY['target'] = $popupTarget;
432
  array('param' => 'select_role', 'operator' => '==', 'value' => '')
433
  );
434
 
435
+ $targetDataParams['param'] = apply_filters('sgpbPopupSpecialEventsParams', $targetParams);
436
+ $targetDataParams['operator'] = apply_filters('sgpbPopupConditionsOperator', $targetDataOperator);
437
 
438
  $targetDataParams['select_role'] = null;
439
 
747
  $config['paramsData'] = apply_filters('sgPopupSpecialEventsParams', $params);
748
  $config['initialData'] = apply_filters('sgPopupSpecialEventsInitialData', $initialData);
749
  $config['attrs'] = apply_filters('sgPopupSpecialEventsAttrs', $attrs);
750
+ $config['operators'] = apply_filters('sgpbPopupSpecialEventsOperators', array());
751
+ $config['specialDefaultOperator'] = apply_filters('sgpbPopupSpecialEventsDefaultOperators', ' ');
752
 
753
  return $config;
754
  }
832
  $options[] = array('name' => 'sgpb-button-image-width', 'type' => 'text', 'defaultValue' => 21);
833
  $options[] = array('name' => 'sgpb-button-image-height', 'type' => 'text', 'defaultValue' => 21);
834
  $options[] = array('name' => 'sgpb-is-active', 'type' => 'checkbox', 'defaultValue' => 'on');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
835
  $options[] = array('name' => 'sgpb-subs-form-bg-color', 'type' => 'text', 'defaultValue' => '#FFFFFF');
836
  $options[] = array('name' => 'sgpb-subs-form-bg-opacity', 'type' => 'text', 'defaultValue' => 0.8);
837
  $options[] = array('name' => 'sgpb-subs-form-padding', 'type' => 'number', 'defaultValue' => 2);
865
  $options[] = array('name' => 'sgpb-subs-gdpr-status', 'type' => 'checkbox', 'defaultValue' => '');
866
  $options[] = array('name' => 'sgpb-subs-gdpr-label', 'type' => 'text', 'defaultValue' => __('Accept Terms', SG_POPUP_TEXT_DOMAIN));
867
  $options[] = array('name' => 'sgpb-subs-gdpr-text', 'type' => 'text', 'defaultValue' => __(get_bloginfo().' will use the information you provide on this form to be in touch with you and to provide updates and marketing.', SG_POPUP_TEXT_DOMAIN));
868
+ $options[] = array('name' => 'sgpb-subs-fields', 'type' => 'sgpb', 'defaultValue' => '');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
  $options[] = array('name' => 'sgpb-fblike-like-url', 'type' => 'text', 'defaultValue' => '');
870
  $options[] = array('name' => 'sgpb-fblike-layout', 'type' => 'text', 'defaultValue' => 'standard');
871
  $options[] = array('name' => 'sgpb-fblike-dont-show-share-button', 'type' => 'checkbox', 'defaultValue' => '');
 
 
872
  $options[] = array('name' => 'sgpb-border-color', 'type' => 'text', 'defaultValue' => '#000000');
873
  $options[] = array('name' => 'sgpb-border-radius', 'type' => 'text', 'defaultValue' => 0);
874
  $options[] = array('name' => 'sgpb-show-popup-same-user', 'type' => 'checkbox', 'defaultValue' => '');
com/helpers/AdminHelper.php CHANGED
@@ -3,6 +3,7 @@ namespace sgpb;
3
  use \DateTime;
4
  use \DateTimeZone;
5
  use \SgpbDataConfig;
 
6
 
7
  class AdminHelper
8
  {
@@ -35,7 +36,7 @@ class AdminHelper
35
  'popupConditionsSection'
36
  );
37
 
38
- return $extensionOptions;
39
  }
40
 
41
  public static function getPopupTypesPageURL()
@@ -265,46 +266,6 @@ class AdminHelper
265
  echo $str;
266
  }
267
 
268
- // countdown popup (number) styles
269
- public static function renderCountdownStyles($popupId = 0, $countdownBgColor, $countdownTextColor)
270
- {
271
- return "<style type='text/css'>
272
- .sgpb-counts-content.sgpb-flipclock-js-$popupId.flip-clock-wrapper ul li a div div.inn {
273
- background-color: $countdownBgColor;
274
- color: $countdownTextColor;
275
- }
276
- .sgpb-countdown-wrapper {
277
- width: 446px;
278
- height: 130px;
279
- padding-top: 22px;
280
- box-sizing: border-box;
281
- margin: 0 auto;
282
- }
283
- .sgpb-counts-content {
284
- display: inline-block;
285
- }
286
- .sgpb-counts-content > ul.flip {
287
- width: 40px;
288
- margin: 4px;
289
- }
290
- </style>";
291
- }
292
-
293
- // countdown popup scripts and params
294
- public static function renderCountdownScript($id, $seconds, $type, $language, $timezone, $autoclose)
295
- {
296
- $params = array(
297
- 'id' => $id,
298
- 'seconds' => $seconds,
299
- 'type' => $type,
300
- 'language' => $language,
301
- 'timezone' => $timezone,
302
- 'autoclose' => $autoclose
303
- );
304
-
305
- return $params;
306
- }
307
-
308
  public static function getDateObjFromDate($dueDate, $timezone = 'America/Los_Angeles', $format = 'Y-m-d H:i:s')
309
  {
310
  $dateObj = new DateTime($dueDate, new DateTimeZone($timezone));
@@ -313,23 +274,6 @@ class AdminHelper
313
  return $dateObj;
314
  }
315
 
316
- // convert date to seconds
317
- public static function dateToSeconds($dueDate, $timezone)
318
- {
319
- if (empty($timezone)) {
320
- return '';
321
- }
322
-
323
- $dateObj = self::getDateObjFromDate('now', $timezone);
324
- $timeNow = @strtotime($dateObj);
325
- $seconds = @strtotime($dueDate)-$timeNow;
326
- if ($seconds < 0) {
327
- $seconds = 0;
328
- }
329
-
330
- return $seconds;
331
- }
332
-
333
  /**
334
  * Serialize data
335
  *
@@ -370,33 +314,6 @@ class AdminHelper
370
  return $size;
371
  }
372
 
373
- /**
374
- * Get site protocol
375
- *
376
- * @since 1.0.0
377
- *
378
- * @return string $protocol
379
- *
380
- */
381
- public static function getSiteProtocol()
382
- {
383
- $protocol = 'http';
384
-
385
- if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
386
- $protocol = 'https';
387
- }
388
-
389
- return $protocol;
390
- }
391
-
392
- public static function getCurrentUrl()
393
- {
394
- $protocol = self::getSiteProtocol();
395
- $currentUrl = $protocol."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
396
-
397
- return $currentUrl;
398
- }
399
-
400
  public static function deleteSubscriptionPopupSubscribers($popupId)
401
  {
402
  global $wpdb;
@@ -687,20 +604,6 @@ class AdminHelper
687
  return $role;
688
  }
689
 
690
- public static function isAppleMobileDevice()
691
- {
692
- $isIOS = false;
693
-
694
- $useragent = @$_SERVER['HTTP_USER_AGENT'];
695
- preg_match('/iPhone|Android|iPad|iPod|webOS/', $useragent, $matches);
696
- $os = current($matches);
697
- if ($os == 'iPad' || $os == 'iPhone' || $os == 'iPod') {
698
- $isIOS = true;
699
- }
700
-
701
- return $isIOS;
702
- }
703
-
704
  public static function hexToRgba($color, $opacity = false)
705
  {
706
  $default = 'rgb(0,0,0)';
@@ -858,21 +761,6 @@ class AdminHelper
858
  }
859
  }
860
 
861
- // proStartSilver
862
- public static function setPushToBottom($element = '')
863
- {
864
- $style = '<style type="text/css">';
865
- $style .= "$element";
866
- $style .= '{position: absolute !important;';
867
- $style .= 'left: 0 !important;';
868
- $style .= 'right: 0 !important;';
869
- $style .= 'bottom: 2px !important;}';
870
- $style .= '</style>';
871
-
872
- return $style;
873
- }
874
- // proEndSilver
875
-
876
  public static function getCurrentPopupType()
877
  {
878
  $type = '';
@@ -1196,16 +1084,16 @@ class AdminHelper
1196
  if (!$periodNextTime) {
1197
  $usageDays = self::getPopupMainTableCreationDate();
1198
  update_option('SGPBUsageDays', $usageDays);
1199
- if (!defined('SG_REVIEW_POPUP_PERIOD')) {
1200
- define('SG_REVIEW_POPUP_PERIOD', '500');
1201
  }
1202
  // For old users
1203
- if (defined('SG_REVIEW_POPUP_PERIOD') && $usageDays > SG_REVIEW_POPUP_PERIOD && !$dontShowAgain) {
1204
  return $shouldOpen;
1205
  }
1206
- $remainingDays = SG_REVIEW_POPUP_PERIOD - $usageDays;
1207
 
1208
- $popupTimeZone = @SgPopupGetData::getPopupTimeZone();
1209
  $timeDate = new DateTime('now', new DateTimeZone($popupTimeZone));
1210
  $timeDate->modify('+'.$remainingDays.' day');
1211
 
@@ -1390,21 +1278,6 @@ class AdminHelper
1390
  return $bannerText;
1391
  }
1392
 
1393
- public static function findSubscribersByEmail($subscriberEmail = '', $list = 0)
1394
- {
1395
- global $wpdb;
1396
- $subscriber = array();
1397
-
1398
- $prepareSql = $wpdb->prepare('SELECT * FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s AND subscriptionType = %d ', $subscriberEmail, $list);
1399
- $subscriber = $wpdb->get_row($prepareSql, ARRAY_A);
1400
- if (!$list) {
1401
- $prepareSql = $wpdb->prepare('SELECT * FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s ', $subscriberEmail);
1402
- $subscriber = $wpdb->get_results($prepareSql, ARRAY_A);
1403
- }
1404
-
1405
- return $subscriber;
1406
- }
1407
-
1408
  public static function getGutenbergPopupsIdAndTitle($excludesPopups = array())
1409
  {
1410
  $allPopups = SGPopup::getAllPopups();
@@ -1456,4 +1329,143 @@ class AdminHelper
1456
 
1457
  return $data;
1458
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1459
  }
3
  use \DateTime;
4
  use \DateTimeZone;
5
  use \SgpbDataConfig;
6
+ use \Elementor;
7
 
8
  class AdminHelper
9
  {
36
  'popupConditionsSection'
37
  );
38
 
39
+ return $extensionOptions;
40
  }
41
 
42
  public static function getPopupTypesPageURL()
266
  echo $str;
267
  }
268
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  public static function getDateObjFromDate($dueDate, $timezone = 'America/Los_Angeles', $format = 'Y-m-d H:i:s')
270
  {
271
  $dateObj = new DateTime($dueDate, new DateTimeZone($timezone));
274
  return $dateObj;
275
  }
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  /**
278
  * Serialize data
279
  *
314
  return $size;
315
  }
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  public static function deleteSubscriptionPopupSubscribers($popupId)
318
  {
319
  global $wpdb;
604
  return $role;
605
  }
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  public static function hexToRgba($color, $opacity = false)
608
  {
609
  $default = 'rgb(0,0,0)';
761
  }
762
  }
763
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764
  public static function getCurrentPopupType()
765
  {
766
  $type = '';
1084
  if (!$periodNextTime) {
1085
  $usageDays = self::getPopupMainTableCreationDate();
1086
  update_option('SGPBUsageDays', $usageDays);
1087
+ if (!defined('SGPB_REVIEW_POPUP_PERIOD')) {
1088
+ define('SGPB_REVIEW_POPUP_PERIOD', '500');
1089
  }
1090
  // For old users
1091
+ if (defined('SGPB_REVIEW_POPUP_PERIOD') && $usageDays > SGPB_REVIEW_POPUP_PERIOD && !$dontShowAgain) {
1092
  return $shouldOpen;
1093
  }
1094
+ $remainingDays = SGPB_REVIEW_POPUP_PERIOD - $usageDays;
1095
 
1096
+ $popupTimeZone = \ConfigDataHelper::getDefaultTimezone();
1097
  $timeDate = new DateTime('now', new DateTimeZone($popupTimeZone));
1098
  $timeDate->modify('+'.$remainingDays.' day');
1099
 
1278
  return $bannerText;
1279
  }
1280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1281
  public static function getGutenbergPopupsIdAndTitle($excludesPopups = array())
1282
  {
1283
  $allPopups = SGPopup::getAllPopups();
1329
 
1330
  return $data;
1331
  }
1332
+
1333
+ public static function checkEditorByPopupId($popupId)
1334
+ {
1335
+ $popupContent = '';
1336
+ if (class_exists('\Elementor\Plugin')) {
1337
+ $elementorContent = get_post_meta($popupId, '_elementor_edit_mode', true);
1338
+ if (!empty($elementorContent) && $elementorContent == 'builder') {
1339
+ $popupContent = Elementor\Plugin::instance()->frontend->get_builder_content_for_display($popupId);
1340
+ }
1341
+ }
1342
+
1343
+ return $popupContent;
1344
+ }
1345
+
1346
+ // countdown popup
1347
+ public static function renderCountdownStyles($popupId = 0, $countdownBgColor, $countdownTextColor)
1348
+ {
1349
+ return "<style type='text/css'>
1350
+ .sgpb-counts-content.sgpb-flipclock-js-$popupId.flip-clock-wrapper ul li a div div.inn {
1351
+ background-color: $countdownBgColor;
1352
+ color: $countdownTextColor;
1353
+ }
1354
+ .sgpb-countdown-wrapper {
1355
+ width: 446px;
1356
+ height: 130px;
1357
+ padding-top: 22px;
1358
+ box-sizing: border-box;
1359
+ margin: 0 auto;
1360
+ }
1361
+ .sgpb-counts-content {
1362
+ display: inline-block;
1363
+ }
1364
+ .sgpb-counts-content > ul.flip {
1365
+ width: 40px;
1366
+ margin: 4px;
1367
+ }
1368
+ </style>";
1369
+ }
1370
+
1371
+ // countdown popup scripts and params
1372
+ public static function renderCountdownScript($id, $seconds, $type, $language, $timezone, $autoclose)
1373
+ {
1374
+ $params = array(
1375
+ 'id' => $id,
1376
+ 'seconds' => $seconds,
1377
+ 'type' => $type,
1378
+ 'language' => $language,
1379
+ 'timezone' => $timezone,
1380
+ 'autoclose' => $autoclose
1381
+ );
1382
+
1383
+ return $params;
1384
+ }
1385
+
1386
+ // countdown popup, convert date to seconds
1387
+ public static function dateToSeconds($dueDate, $timezone)
1388
+ {
1389
+ if (empty($timezone)) {
1390
+ return '';
1391
+ }
1392
+
1393
+ $dateObj = self::getDateObjFromDate('now', $timezone);
1394
+ $timeNow = @strtotime($dateObj);
1395
+ $seconds = @strtotime($dueDate)-$timeNow;
1396
+ if ($seconds < 0) {
1397
+ $seconds = 0;
1398
+ }
1399
+
1400
+ return $seconds;
1401
+ }
1402
+
1403
+ /**
1404
+ * Get site protocol
1405
+ *
1406
+ * @since 1.0.0
1407
+ *
1408
+ * @return string $protocol
1409
+ *
1410
+ */
1411
+ public static function getSiteProtocol()
1412
+ {
1413
+ $protocol = 'http';
1414
+
1415
+ if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
1416
+ $protocol = 'https';
1417
+ }
1418
+
1419
+ return $protocol;
1420
+ }
1421
+
1422
+ public static function getCurrentUrl()
1423
+ {
1424
+ $protocol = self::getSiteProtocol();
1425
+ $currentUrl = $protocol."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
1426
+
1427
+ return $currentUrl;
1428
+ }
1429
+
1430
+ public static function isAppleMobileDevice()
1431
+ {
1432
+ $isIOS = false;
1433
+
1434
+ $useragent = @$_SERVER['HTTP_USER_AGENT'];
1435
+ preg_match('/iPhone|Android|iPad|iPod|webOS/', $useragent, $matches);
1436
+ $os = current($matches);
1437
+ if ($os == 'iPad' || $os == 'iPhone' || $os == 'iPod') {
1438
+ $isIOS = true;
1439
+ }
1440
+
1441
+ return $isIOS;
1442
+ }
1443
+
1444
+ public static function setPushToBottom($element = '')
1445
+ {
1446
+ $style = '<style type="text/css">';
1447
+ $style .= "$element";
1448
+ $style .= '{position: absolute !important;';
1449
+ $style .= 'left: 0 !important;';
1450
+ $style .= 'right: 0 !important;';
1451
+ $style .= 'bottom: 2px !important;}';
1452
+ $style .= '</style>';
1453
+
1454
+ return $style;
1455
+ }
1456
+
1457
+ public static function findSubscribersByEmail($subscriberEmail = '', $list = 0)
1458
+ {
1459
+ global $wpdb;
1460
+ $subscriber = array();
1461
+
1462
+ $prepareSql = $wpdb->prepare('SELECT * FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s AND subscriptionType = %d ', $subscriberEmail, $list);
1463
+ $subscriber = $wpdb->get_row($prepareSql, ARRAY_A);
1464
+ if (!$list) {
1465
+ $prepareSql = $wpdb->prepare('SELECT * FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s ', $subscriberEmail);
1466
+ $subscriber = $wpdb->get_results($prepareSql, ARRAY_A);
1467
+ }
1468
+
1469
+ return $subscriber;
1470
+ }
1471
  }
com/helpers/ConfigDataHelper.php CHANGED
@@ -168,7 +168,7 @@ class ConfigDataHelper
168
  'order' => 'ASC'
169
  )
170
  );
171
- $supportedTaxonomies = array();
172
  if (!empty($taxonomies)) {
173
  $supportedTaxonomies = $taxonomies;
174
  }
@@ -386,7 +386,8 @@ class ConfigDataHelper
386
  '70' => '70%',
387
  '80' => '80%',
388
  '90' => '90%',
389
- '100' => '100%'
 
390
  );
391
 
392
  $data['freeConditions'] = array(
@@ -419,11 +420,8 @@ class ConfigDataHelper
419
  SG_COUNTDOWN_COUNTER_SECONDS_HIDE => 'DD:HH:MM'
420
  );
421
 
422
- // proStartGold
423
  $data['countdownTimezone'] = self::getPopupTimeZone();
424
- // proEndGold
425
 
426
- // proStartGold
427
  $data['countdownLanguage'] = array(
428
  'English' => 'English',
429
  'German' => 'Deutsche',
@@ -438,7 +436,6 @@ class ConfigDataHelper
438
  'Czech' => 'Čeština',
439
  'Chinese' => '中文'
440
  );
441
- // proEndGold
442
 
443
  $data['weekDaysArray'] = array(
444
  'Mon' => __('Monday', SG_POPUP_TEXT_DOMAIN),
@@ -500,78 +497,6 @@ class ConfigDataHelper
500
  )
501
  );
502
 
503
- $data['popupInsertEventTypes'] = array(
504
- 'inherit' => __('Inherit', SG_POPUP_TEXT_DOMAIN),
505
- 'onLoad' => __('On load', SG_POPUP_TEXT_DOMAIN),
506
- 'click' => __('On click', SG_POPUP_TEXT_DOMAIN),
507
- 'hover' => __('On hover', SG_POPUP_TEXT_DOMAIN)
508
- );
509
-
510
- $data['subscriptionSuccessBehavior'] = array(
511
- 'template' => array(
512
- 'fieldWrapperAttr' => array(
513
- 'class' => 'col-md-6 sgpb-choice-option-wrapper'
514
- ),
515
- 'labelAttr' => array(
516
- 'class' => 'col-md-6 sgpb-choice-option-wrapper sgpb-sub-option-label'
517
- ),
518
- 'groupWrapperAttr' => array(
519
- 'class' => 'row form-group sgpb-choice-wrapper'
520
- )
521
- ),
522
- 'buttonPosition' => 'right',
523
- 'nextNewLine' => true,
524
- 'fields' => array(
525
- array(
526
- 'attr' => array(
527
- 'type' => 'radio',
528
- 'name' => 'sgpb-subs-success-behavior',
529
- 'class' => 'subs-success-message',
530
- 'data-attr-href' => 'subs-show-success-message',
531
- 'value' => 'showMessage'
532
- ),
533
- 'label' => array(
534
- 'name' => __('Success message', SG_POPUP_TEXT_DOMAIN).':'
535
- )
536
- ),
537
- array(
538
- 'attr' => array(
539
- 'type' => 'radio',
540
- 'name' => 'sgpb-subs-success-behavior',
541
- 'class' => 'subs-redirect-to-URL',
542
- 'data-attr-href' => 'subs-redirect-to-URL',
543
- 'value' => 'redirectToURL'
544
- ),
545
- 'label' => array(
546
- 'name' => __('Redirect to url', SG_POPUP_TEXT_DOMAIN).':'
547
- )
548
- ),
549
- array(
550
- 'attr' => array(
551
- 'type' => 'radio',
552
- 'name' => 'sgpb-subs-success-behavior',
553
- 'class' => 'subs-success-open-popup',
554
- 'data-attr-href' => 'subs-open-popup',
555
- 'value' => 'openPopup'
556
- ),
557
- 'label' => array(
558
- 'name' => __('Open popup', SG_POPUP_TEXT_DOMAIN).':'
559
- )
560
- ),
561
- array(
562
- 'attr' => array(
563
- 'type' => 'radio',
564
- 'name' => 'sgpb-subs-success-behavior',
565
- 'class' => 'subs-hide-popup',
566
- 'value' => 'hidePopup'
567
- ),
568
- 'label' => array(
569
- 'name' => __('Hide popup', SG_POPUP_TEXT_DOMAIN).':'
570
- )
571
- )
572
- )
573
- );
574
-
575
  $data['countdownDateFormat'] = array(
576
  'template' => array(
577
  'fieldWrapperAttr' => array(
@@ -703,6 +628,78 @@ class ConfigDataHelper
703
  'inside' => __('Inside', SG_POPUP_TEXT_DOMAIN)
704
  );
705
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  $data['buttonsType'] = array(
707
  'standard' => __('Standard', SG_POPUP_TEXT_DOMAIN),
708
  'box_count' => __('Box with count', SG_POPUP_TEXT_DOMAIN),
@@ -811,7 +808,7 @@ class ConfigDataHelper
811
  // proEndSilver
812
 
813
  // proStartGold
814
- private static function getPopupTimeZone()
815
  {
816
  return array(
817
  'Pacific/Midway' => '(GMT-11:00) Midway',
@@ -1083,7 +1080,19 @@ class ConfigDataHelper
1083
  );
1084
  }
1085
 
1086
- // use in countdown popup
 
 
 
 
 
 
 
 
 
 
 
 
1087
  public static function getCurrentDateTime()
1088
  {
1089
  return date('Y-m-d H:i', strtotime(' +1 day'));
@@ -1098,17 +1107,4 @@ class ConfigDataHelper
1098
 
1099
  return $timezone;
1100
  }
1101
- // proEndGold
1102
-
1103
- public static function getJsLocalizedData()
1104
- {
1105
- $translatedData = array(
1106
- 'imageSupportAlertMessage' => __('Only image files supported', SG_POPUP_TEXT_DOMAIN),
1107
- 'areYouSure' => __('Are you sure?', SG_POPUP_TEXT_DOMAIN),
1108
- 'addButtonSpinner' => __('Add', SG_POPUP_TEXT_DOMAIN),
1109
- 'audioSupportAlertMessage' => __('Only audio files supported (e.g.: mp3, wav, m4a, ogg)', SG_POPUP_TEXT_DOMAIN)
1110
- );
1111
-
1112
- return $translatedData;
1113
- }
1114
  }
168
  'order' => 'ASC'
169
  )
170
  );
171
+ $supportedTaxonomies = array('category');
172
  if (!empty($taxonomies)) {
173
  $supportedTaxonomies = $taxonomies;
174
  }
386
  '70' => '70%',
387
  '80' => '80%',
388
  '90' => '90%',
389
+ '100' => '100%',
390
+ 'fullScreen' => __('Full screen', SG_POPUP_TEXT_DOMAIN)
391
  );
392
 
393
  $data['freeConditions'] = array(
420
  SG_COUNTDOWN_COUNTER_SECONDS_HIDE => 'DD:HH:MM'
421
  );
422
 
 
423
  $data['countdownTimezone'] = self::getPopupTimeZone();
 
424
 
 
425
  $data['countdownLanguage'] = array(
426
  'English' => 'English',
427
  'German' => 'Deutsche',
436
  'Czech' => 'Čeština',
437
  'Chinese' => '中文'
438
  );
 
439
 
440
  $data['weekDaysArray'] = array(
441
  'Mon' => __('Monday', SG_POPUP_TEXT_DOMAIN),
497
  )
498
  );
499
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
500
  $data['countdownDateFormat'] = array(
501
  'template' => array(
502
  'fieldWrapperAttr' => array(
628
  'inside' => __('Inside', SG_POPUP_TEXT_DOMAIN)
629
  );
630
 
631
+ $data['popupInsertEventTypes'] = array(
632
+ 'inherit' => __('Inherit', SG_POPUP_TEXT_DOMAIN),
633
+ 'onLoad' => __('On load', SG_POPUP_TEXT_DOMAIN),
634
+ 'click' => __('On click', SG_POPUP_TEXT_DOMAIN),
635
+ 'hover' => __('On hover', SG_POPUP_TEXT_DOMAIN)
636
+ );
637
+
638
+ $data['subscriptionSuccessBehavior'] = array(
639
+ 'template' => array(
640
+ 'fieldWrapperAttr' => array(
641
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper'
642
+ ),
643
+ 'labelAttr' => array(
644
+ 'class' => 'col-md-6 sgpb-choice-option-wrapper sgpb-sub-option-label'
645
+ ),
646
+ 'groupWrapperAttr' => array(
647
+ 'class' => 'row form-group sgpb-choice-wrapper'
648
+ )
649
+ ),
650
+ 'buttonPosition' => 'right',
651
+ 'nextNewLine' => true,
652
+ 'fields' => array(
653
+ array(
654
+ 'attr' => array(
655
+ 'type' => 'radio',
656
+ 'name' => 'sgpb-subs-success-behavior',
657
+ 'class' => 'subs-success-message',
658
+ 'data-attr-href' => 'subs-show-success-message',
659
+ 'value' => 'showMessage'
660
+ ),
661
+ 'label' => array(
662
+ 'name' => __('Success message', SG_POPUP_TEXT_DOMAIN).':'
663
+ )
664
+ ),
665
+ array(
666
+ 'attr' => array(
667
+ 'type' => 'radio',
668
+ 'name' => 'sgpb-subs-success-behavior',
669
+ 'class' => 'subs-redirect-to-URL',
670
+ 'data-attr-href' => 'subs-redirect-to-URL',
671
+ 'value' => 'redirectToURL'
672
+ ),
673
+ 'label' => array(
674
+ 'name' => __('Redirect to url', SG_POPUP_TEXT_DOMAIN).':'
675
+ )
676
+ ),
677
+ array(
678
+ 'attr' => array(
679
+ 'type' => 'radio',
680
+ 'name' => 'sgpb-subs-success-behavior',
681
+ 'class' => 'subs-success-open-popup',
682
+ 'data-attr-href' => 'subs-open-popup',
683
+ 'value' => 'openPopup'
684
+ ),
685
+ 'label' => array(
686
+ 'name' => __('Open popup', SG_POPUP_TEXT_DOMAIN).':'
687
+ )
688
+ ),
689
+ array(
690
+ 'attr' => array(
691
+ 'type' => 'radio',
692
+ 'name' => 'sgpb-subs-success-behavior',
693
+ 'class' => 'subs-hide-popup',
694
+ 'value' => 'hidePopup'
695
+ ),
696
+ 'label' => array(
697
+ 'name' => __('Hide popup', SG_POPUP_TEXT_DOMAIN).':'
698
+ )
699
+ )
700
+ )
701
+ );
702
+
703
  $data['buttonsType'] = array(
704
  'standard' => __('Standard', SG_POPUP_TEXT_DOMAIN),
705
  'box_count' => __('Box with count', SG_POPUP_TEXT_DOMAIN),
808
  // proEndSilver
809
 
810
  // proStartGold
811
+ public static function getPopupTimeZone()
812
  {
813
  return array(
814
  'Pacific/Midway' => '(GMT-11:00) Midway',
1080
  );
1081
  }
1082
 
1083
+ public static function getJsLocalizedData()
1084
+ {
1085
+ $translatedData = array(
1086
+ 'imageSupportAlertMessage' => __('Only image files supported', SG_POPUP_TEXT_DOMAIN),
1087
+ 'areYouSure' => __('Are you sure?', SG_POPUP_TEXT_DOMAIN),
1088
+ 'addButtonSpinner' => __('Add', SG_POPUP_TEXT_DOMAIN),
1089
+ 'audioSupportAlertMessage' => __('Only audio files supported (e.g.: mp3, wav, m4a, ogg)', SG_POPUP_TEXT_DOMAIN),
1090
+ 'publishPopupBeforeElemntor' => __('Please, publish the popup before starting to use Elementor with it!', SG_POPUP_TEXT_DOMAIN)
1091
+ );
1092
+
1093
+ return $translatedData;
1094
+ }
1095
+
1096
  public static function getCurrentDateTime()
1097
  {
1098
  return date('Y-m-d H:i', strtotime(' +1 day'));
1107
 
1108
  return $timezone;
1109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1110
  }
com/helpers/Functions.php CHANGED
@@ -163,6 +163,24 @@ class Functions
163
  return $inputElement;
164
  }
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  public static function getPopupTypeToAllowToShowMetabox()
167
  {
168
  global $post;
@@ -200,22 +218,4 @@ class Functions
200
 
201
  return $dir;
202
  }
203
-
204
- public static function getDatabaseEngine()
205
- {
206
- global $wpdb;
207
- $dbName = $wpdb->dbname;
208
- $engine = 'InnoDB';
209
- $engineCheckSql = "SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$dbName'";
210
- $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
211
- if (!empty($result)) {
212
- $engineCheckSql = "SHOW TABLE STATUS WHERE Name = '".$wpdb->prefix."users' AND Engine = 'MyISAM'";
213
- $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
214
- if (isset($result[0]['Engine']) && $result[0]['Engine'] == 'MyISAM') {
215
- $engine = 'MyISAM';
216
- }
217
- }
218
-
219
- return $engine;
220
- }
221
  }
163
  return $inputElement;
164
  }
165
 
166
+ public static function getDatabaseEngine()
167
+ {
168
+ global $wpdb;
169
+ $dbName = $wpdb->dbname;
170
+ $engine = 'InnoDB';
171
+ $engineCheckSql = "SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$dbName'";
172
+ $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
173
+ if (!empty($result)) {
174
+ $engineCheckSql = "SHOW TABLE STATUS WHERE Name = '".$wpdb->prefix."users' AND Engine = 'MyISAM'";
175
+ $result = $wpdb->get_results($engineCheckSql, ARRAY_A);
176
+ if (isset($result[0]['Engine']) && $result[0]['Engine'] == 'MyISAM') {
177
+ $engine = 'MyISAM';
178
+ }
179
+ }
180
+
181
+ return $engine;
182
+ }
183
+
184
  public static function getPopupTypeToAllowToShowMetabox()
185
  {
186
  global $post;
218
 
219
  return $dir;
220
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
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.1.6.1
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.1.7
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/popupAdminStyles.css CHANGED
@@ -2050,6 +2050,11 @@ input:checked + .sgpb-slider:before {
2050
  }
2051
  }
2052
 
 
 
 
 
 
2053
 
2054
  @media (max-width: 560px) {
2055
  .sgpb-rate-us-banner-2 {
@@ -2131,3 +2136,11 @@ input:checked + .sgpb-slider:before {
2131
  .subscribers-wrapper .tablenav.bottom {
2132
  margin-left: -8px !important;
2133
  }
 
 
 
 
 
 
 
 
2050
  }
2051
  }
2052
 
2053
+ @media (max-width: 1224px) {
2054
+ .sgpb-event-row .col-sm-3 {
2055
+ width: 100% !important;
2056
+ }
2057
+ }
2058
 
2059
  @media (max-width: 560px) {
2060
  .sgpb-rate-us-banner-2 {
2136
  .subscribers-wrapper .tablenav.bottom {
2137
  margin-left: -8px !important;
2138
  }
2139
+
2140
+ .mce-widget .dashicons-menu-icon-sgpb:before {
2141
+ padding-left: 0px !important;
2142
+ }
2143
+
2144
+ .sgpb-text-warning {
2145
+ color: #007bff !important;
2146
+ }
public/js/Backend.js CHANGED
@@ -75,6 +75,7 @@ SGPBBackend.prototype.sgInit = function()
75
  this.openAnimationPreview();
76
  this.closeAnimationPreview();
77
  this.resetToDefaultValue();
 
78
  };
79
 
80
  SGPBBackend.prototype.resetToDefaultValue = function()
@@ -334,7 +335,9 @@ SGPBBackend.prototype.initRadioAccordions = function()
334
  for (var radioButtonIndex in radioButtonsList) {
335
 
336
  var radioButton = radioButtonsList[radioButtonIndex];
337
-
 
 
338
  var that = this;
339
  radioButton.each(function() {
340
  that.buildRadioAccordionActions(jQuery(this));
@@ -1415,6 +1418,13 @@ SGPBBackend.makeContactAndSubscriptionFieldsRequired = function()
1415
 
1416
  SGPBBackend.prototype.makePopupTitleRequired = function()
1417
  {
 
 
 
 
 
 
 
1418
  if (jQuery('#title').length) {
1419
  var postType = jQuery('#post_type');
1420
  if (postType.length && postType.val() == 'popupbuilder') {
@@ -1538,6 +1548,25 @@ SGPBBackend.prototype.eventsAddButtonSpinner = function(element, showHide)
1538
  }
1539
  };
1540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1541
  SGPBBackend.hexToRgba = function(hex, opacity)
1542
  {
1543
  var c;
75
  this.openAnimationPreview();
76
  this.closeAnimationPreview();
77
  this.resetToDefaultValue();
78
+ this.editPopupSettingsForFullscreenMode();
79
  };
80
 
81
  SGPBBackend.prototype.resetToDefaultValue = function()
335
  for (var radioButtonIndex in radioButtonsList) {
336
 
337
  var radioButton = radioButtonsList[radioButtonIndex];
338
+ if (typeof radioButton != 'object') {
339
+ continue;
340
+ }
341
  var that = this;
342
  radioButton.each(function() {
343
  that.buildRadioAccordionActions(jQuery(this));
1418
 
1419
  SGPBBackend.prototype.makePopupTitleRequired = function()
1420
  {
1421
+ var editModeBtn = jQuery('#elementor-switch-mode-button');
1422
+ if (editModeBtn.length) {
1423
+ if (!SGPBBackend.getParamFromUrl('post')) {
1424
+ editModeBtn.attr('disabled', 'disabled');
1425
+ editModeBtn.after('<p class="sgpb-text-warning">'+SGPB_JS_LOCALIZATION.publishPopupBeforeElemntor+'</p>');
1426
+ }
1427
+ }
1428
  if (jQuery('#title').length) {
1429
  var postType = jQuery('#post_type');
1430
  if (postType.length && postType.val() == 'popupbuilder') {
1548
  }
1549
  };
1550
 
1551
+ SGPBBackend.prototype.editPopupSettingsForFullscreenMode = function(popupId)
1552
+ {
1553
+ var responsiveModeSelector = jQuery('.sgpb-responsive-mode-change-js');
1554
+ var that = this;
1555
+ var closeButtonCheckbox = jQuery('#close-button');
1556
+
1557
+ if (typeof responsiveModeSelector == 'undefined') {
1558
+ return false;
1559
+ }
1560
+ responsiveModeSelector.change(function() {
1561
+ var selectedMode = jQuery(this).val();
1562
+ if (selectedMode == 'fullScreen') {
1563
+ if (closeButtonCheckbox.is(':checked')) {
1564
+ closeButtonCheckbox.click();
1565
+ }
1566
+ }
1567
+ });
1568
+ };
1569
+
1570
  SGPBBackend.hexToRgba = function(hex, opacity)
1571
  {
1572
  var c;
public/js/MediaButton.js CHANGED
@@ -1,10 +1,12 @@
1
  function SGPBMediaButton(){}
2
  SGPBMediaButton.prototype.init=function()
3
- {this.openMediaButtonPopup();this.openAskReviewBannerPopup();};SGPBMediaButton.prototype.openMediaButtonPopup=function()
4
- {var that=this;var select2Init=1;jQuery('.sgpb-insert-media-button-js, .sgpb-insert-js-variable').bind('click',function(e){e.preventDefault();var hiddenDivId=jQuery(this).attr('data-id');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();}
5
- select2Init++;console.log(jQuery('.select2-container--below').length);jQuery('.select2-container--below').remove();that.popupSelect2();}
 
 
6
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
7
- that.closeMediaButtonPopup(popup);});that.insertPopup(popup);});};SGPBMediaButton.prototype.openAskReviewBannerPopup=function()
8
  {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();}
9
  else{that.closingActions();}
10
  jQuery(window).bind('sgpbDidOpen',function(){that.closingActions(popup);});};SGPBMediaButton.prototype.closingActions=function(popup)
@@ -17,14 +19,14 @@ SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
17
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.closeReviewPopup=function(popup)
18
  {jQuery('.sgpb-button-2').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
19
  {var insidePopup=false;if(mediaButtonParams.currentPostType==mediaButtonParams.popupBuilderPostType){insidePopup=true;}
20
- jQuery('.sgpb-insert-popup-js').bind('click',function(){var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
21
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
22
  if(selectedPopup==''||selectedPopup==null){popup.close();return;}
23
  if(selectedPopupEvent=='onLoad'&&!insidePopup){window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+'][/sg_popup]');popup.close();return;}
24
  if(typeof tinyMCE.editors.content!='undefined'&&(document.getElementById('content').offsetParent===null)){selectedContent=(tinyMCE.activeEditor.selection.getContent())?tinyMCE.activeEditor.selection.getContent():'';}
25
  else{var content=document.getElementById('content');var selectedContent;if(typeof document.selection!='undefined'){content.focus();var sel=document.selection.createRange();selectedContent=sel.text;}
26
- else if(typeof content.selectionStart!='undefined'){var startPos=content.selectionStart;var endPos=content.selectionEnd;selectedContent=content.value.substring(startPos,endPos)}}
27
- window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+']'+selectedContent+'[/sg_popup]');popup.close();});jQuery('.sgpb-insert-js-variable-to-editor').bind('click',function(){var jsVariableSelector=jQuery('.sgpb-js-variable-selector').val();var jsVariableAttribute=jQuery('.sgpb-js-variable-attribute').val();jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');var valid=true;if(jsVariableSelector==''){valid=false;jQuery('.sgpb-js-variable-selector-error').removeClass('sg-hide-element');}
28
  if(jsVariableAttribute==''){valid=false;jQuery('.sgpb-js-variable-attribute-error').removeClass('sg-hide-element');}
29
  if(!valid){return false;}
30
  jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_editor('[pbvariable selector="'+jsVariableSelector+'" attribute="'+jsVariableAttribute+'"]');popup.close();});};SGPBMediaButton.prototype.popupSelect2=function()
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){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()
5
+ {var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
6
+ {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();}
7
+ select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
8
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
9
+ that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.openAskReviewBannerPopup=function()
10
  {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();}
11
  else{that.closingActions();}
12
  jQuery(window).bind('sgpbDidOpen',function(){that.closingActions(popup);});};SGPBMediaButton.prototype.closingActions=function(popup)
19
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.closeReviewPopup=function(popup)
20
  {jQuery('.sgpb-button-2').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
21
  {var insidePopup=false;if(mediaButtonParams.currentPostType==mediaButtonParams.popupBuilderPostType){insidePopup=true;}
22
+ jQuery('.sgpb-insert-popup-js').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+'"';}
23
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
24
  if(selectedPopup==''||selectedPopup==null){popup.close();return;}
25
  if(selectedPopupEvent=='onLoad'&&!insidePopup){window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+'][/sg_popup]');popup.close();return;}
26
  if(typeof tinyMCE.editors.content!='undefined'&&(document.getElementById('content').offsetParent===null)){selectedContent=(tinyMCE.activeEditor.selection.getContent())?tinyMCE.activeEditor.selection.getContent():'';}
27
  else{var content=document.getElementById('content');var selectedContent;if(typeof document.selection!='undefined'){content.focus();var sel=document.selection.createRange();selectedContent=sel.text;}
28
+ else if(typeof content!='undefined'&&content!=null){if(typeof content.selectionStart!='undefined'){var startPos=content.selectionStart;var endPos=content.selectionEnd;selectedContent=content.value.substring(startPos,endPos);}}}
29
+ window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+']'+selectedContent+'[/sg_popup]');popup.close();});jQuery('.sgpb-insert-js-variable-to-editor').bind('click',function(){var jsVariableSelector=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-selector').val();var jsVariableAttribute=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-attribute').val();jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');var valid=true;if(jsVariableSelector==''){valid=false;jQuery('.sgpb-js-variable-selector-error').removeClass('sg-hide-element');}
30
  if(jsVariableAttribute==''){valid=false;jQuery('.sgpb-js-variable-attribute-error').removeClass('sg-hide-element');}
31
  if(!valid){return false;}
32
  jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_editor('[pbvariable selector="'+jsVariableSelector+'" attribute="'+jsVariableAttribute+'"]');popup.close();});};SGPBMediaButton.prototype.popupSelect2=function()
public/js/Popup.js CHANGED
@@ -22,7 +22,8 @@ if(contentBox.borderColor){mainDiv.style.borderColor=contentBox.borderColor;}
22
  if(contentBox.borderRadius){var borderRadiusMeasure='%';if(contentBox.borderRadiusType){var borderRadiusMeasure=contentBox.borderRadiusType;}
23
  mainDiv.style.borderRadius=contentBox.borderRadius+borderRadiusMeasure;}
24
  mainDiv.style.borderWidth=contentBox.borderWidth+"px";if(contentBox.padding){mainDiv.style.padding=contentBox.padding+"px";}
25
- var widthToSet=sizeConfig.width||defaultWidth;if(widthToSet.indexOf("%")>-1){var widthNum=parseFloat(widthToSet);var closeButtonWidthToSubtract=parseInt(closeButton.width);if(closeBehavior.showButton==false||config.closeButton.type=='button'){closeButtonWidthToSubtract=0;}
 
26
  widthToSet=(((widthNum/100)*window.innerWidth)-(2*(contentBox.padding?contentBox.padding:0))-parseFloat(mainDiv.style.borderLeftWidth)-parseFloat(mainDiv.style.borderRightWidth)-(parseFloat(contentBox.shadowSpread)/2)-closeButtonWidthToSubtract)+'px';}
27
  else{widthToSet=parseFloat(widthToSet)-2*(contentBox.padding?contentBox.padding:0)+'px';}
28
  mainDiv.style.width=widthToSet;if(config.popupType=='image'){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
@@ -34,7 +35,7 @@ else if(contentBox.backgroundMode=='fit'){if(!fitBackgroundImg){fitBackgroundImg
34
  else{mainDiv.style.backgroundRepeat="no-repeat";}}
35
  if(window.sgWindowOldWidth!=window.innerWidth||window.sgWindowOldHeight!=window.innerHeight){window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var images=document.getElementsByClassName('sgpb-background-image-'+config.popupId);if(images.length){changePopupDimensionRelatedImage(images[0]);}}
36
  mainDiv.style.backgroundPosition=contentBox.backgroundPosition;var heightToSet=sizeConfig.height||defaultHeight;if(typeof heightToSet!='undefined'&&heightToSet.indexOf("%")>-1){var heightNum=parseFloat(heightToSet);heightToSet=(((heightNum/100)*window.innerHeight)-(2*(contentBox.padding?contentBox.padding:0))-parseInt(mainDiv.style.borderTopWidth)-parseInt(mainDiv.style.borderBottomWidth))+"px";}
37
- else{heightToSet=parseInt(heightToSet)-2*(contentBox.padding?contentBox.padding:0)+"px";}
38
  mainDiv.style.height=heightToSet;if(contentBox.showBackground&&contentBox.backgroundColor){mainDiv.style.backgroundColor=contentBox.backgroundColor;}
39
  if(contentBox.shadowColor){mainDiv.style.boxShadow="0 0 "+contentBox.shadowBlur+"px "+contentBox.shadowSpread+"px "+contentBox.shadowColor;}
40
  if(contentBox.scrollingEnabled){mainDiv.style.overflow="auto";}
@@ -48,7 +49,8 @@ var widthDifference=imageWidth-maxWidth;var heightDifference=imageHeight-maxHeig
48
  else if(imageWidth>maxWidth){var modifiedWidthPercent=Math.floor((widthDifference/imageWidth)*100);var heightMustDecrease=Math.floor((imageHeight*modifiedWidthPercent)/100);var modifiedHeight=imageHeight-heightMustDecrease;imageWidth-=widthDifference;imageHeight-=heightMustDecrease;}
49
  var result={width:imageWidth,height:imageHeight};return result;}
50
  function calculateMaxWidth(maxWidth)
51
- {var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*2;var borderWidth=(contentBox.borderWidth||0)*2;var boxBorderWidth=(contentBox.boxBorderWidth||0)*4;var closeButtonRight=(parseInt(closeBehavior.right)||0)*2;var closeButtonLeft=(parseInt(closeBehavior.left)||0)*2;maxWidth-=contentPadding;maxWidth-=34;maxWidth-=shadowSpread;maxWidth-=borderWidth;maxWidth-=boxBorderWidth;if(!closeBehavior.buttonInside){if(closeButtonRight){maxWidth-=Math.abs(closeButtonRight);}
 
52
  if(closeButtonLeft){maxWidth-=Math.abs(closeButtonLeft);}}
53
  if(maxWidth<0){return'30px';}
54
  return maxWidth+'px';}
@@ -56,9 +58,10 @@ function setFitBackground()
56
  {if(!fitBackgroundImg)return;var imgHeight=fitBackgroundImg.height;var imgWidth=fitBackgroundImg.width;var winHeight=window.innerHeight;var winWidth=window.innerWidth;var minMargin=40;var popupWidth=0,popupHeight=0;if(imgWidth<(winWidth-2*minMargin)&&imgHeight<(winHeight-2*minMargin)){popupWidth=imgWidth;popupHeight=imgHeight;}else{var widthDif=winWidth-imgWidth;var heightDif=winHeight-imgHeight;if(widthDif<heightDif){popupWidth=winWidth-2*minMargin;popupHeight=popupWidth*imgHeight/imgWidth;}else{popupHeight=winHeight-2*minMargin;popupWidth=popupHeight*imgWidth/imgHeight;}}
57
  var sizeConfig=getSizeConfig();var maxWidth=sizeConfig.maxWidth;var maxHeight=sizeConfig.maxHeight;var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;var shadow=contentBox.shadowSpread||0;popupWidth=parseInt(popupWidth-2);sizeConfig.height=popupHeight+'px';}
58
  function calculateMaxHeight(maxHeight)
59
- {var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*4;var borderHeight=(contentBox.borderWidth||0)*2;var boxBorderHeight=(contentBox.boxBorderWidth||0)*4;var closeButtonTop=(parseInt(closeBehavior.top)||0)*2;var closeButtonBottom=(parseInt(closeBehavior.bottom)||0)*2;maxHeight-=contentPadding;if(shadowSpread){maxHeight-=shadowSpread;maxHeight-=35;}
 
60
  maxHeight-=borderHeight;maxHeight-=boxBorderHeight;if(!closeBehavior.buttonInside){if(closeButtonBottom){maxHeight-=Math.abs(closeButtonBottom);}
61
- if(closeButtonTop){maxHeight-=Math.abs(closeButtonTop);}}
62
  if(maxHeight<0){return'30px';}
63
  return maxHeight+'px';}
64
  function positionPopup()
22
  if(contentBox.borderRadius){var borderRadiusMeasure='%';if(contentBox.borderRadiusType){var borderRadiusMeasure=contentBox.borderRadiusType;}
23
  mainDiv.style.borderRadius=contentBox.borderRadius+borderRadiusMeasure;}
24
  mainDiv.style.borderWidth=contentBox.borderWidth+"px";if(contentBox.padding){mainDiv.style.padding=contentBox.padding+"px";}
25
+ var widthToSet=sizeConfig.width||defaultWidth;if(widthToSet.indexOf("%")>-1){var widthNum=parseFloat(widthToSet);if(widthToSet.indexOf("fullScreen")>-1){widthNum=window.innerWidth;}
26
+ var closeButtonWidthToSubtract=parseInt(closeButton.width);if(closeBehavior.showButton==false||config.closeButton.type=='button'){closeButtonWidthToSubtract=0;}
27
  widthToSet=(((widthNum/100)*window.innerWidth)-(2*(contentBox.padding?contentBox.padding:0))-parseFloat(mainDiv.style.borderLeftWidth)-parseFloat(mainDiv.style.borderRightWidth)-(parseFloat(contentBox.shadowSpread)/2)-closeButtonWidthToSubtract)+'px';}
28
  else{widthToSet=parseFloat(widthToSet)-2*(contentBox.padding?contentBox.padding:0)+'px';}
29
  mainDiv.style.width=widthToSet;if(config.popupType=='image'){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
35
  else{mainDiv.style.backgroundRepeat="no-repeat";}}
36
  if(window.sgWindowOldWidth!=window.innerWidth||window.sgWindowOldHeight!=window.innerHeight){window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var images=document.getElementsByClassName('sgpb-background-image-'+config.popupId);if(images.length){changePopupDimensionRelatedImage(images[0]);}}
37
  mainDiv.style.backgroundPosition=contentBox.backgroundPosition;var heightToSet=sizeConfig.height||defaultHeight;if(typeof heightToSet!='undefined'&&heightToSet.indexOf("%")>-1){var heightNum=parseFloat(heightToSet);heightToSet=(((heightNum/100)*window.innerHeight)-(2*(contentBox.padding?contentBox.padding:0))-parseInt(mainDiv.style.borderTopWidth)-parseInt(mainDiv.style.borderBottomWidth))+"px";}
38
+ else{heightToSet=parseInt(heightToSet)-2*(contentBox.padding?contentBox.padding:0)+"px";if(sizeConfig.width.indexOf("fullScreen")>-1){heightToSet=(window.innerHeight)+"px";}}
39
  mainDiv.style.height=heightToSet;if(contentBox.showBackground&&contentBox.backgroundColor){mainDiv.style.backgroundColor=contentBox.backgroundColor;}
40
  if(contentBox.shadowColor){mainDiv.style.boxShadow="0 0 "+contentBox.shadowBlur+"px "+contentBox.shadowSpread+"px "+contentBox.shadowColor;}
41
  if(contentBox.scrollingEnabled){mainDiv.style.overflow="auto";}
49
  else if(imageWidth>maxWidth){var modifiedWidthPercent=Math.floor((widthDifference/imageWidth)*100);var heightMustDecrease=Math.floor((imageHeight*modifiedWidthPercent)/100);var modifiedHeight=imageHeight-heightMustDecrease;imageWidth-=widthDifference;imageHeight-=heightMustDecrease;}
50
  var result={width:imageWidth,height:imageHeight};return result;}
51
  function calculateMaxWidth(maxWidth)
52
+ {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*2;var borderWidth=(contentBox.borderWidth||0)*2;var boxBorderWidth=(contentBox.boxBorderWidth||0)*4;var closeButtonRight=(parseInt(closeBehavior.right)||0)*2;var closeButtonLeft=(parseInt(closeBehavior.left)||0)*2;if(dimension.indexOf('fullScreen')=='-1'){maxWidth-=contentPadding;maxWidth-=34;maxWidth-=shadowSpread;maxWidth-=borderWidth;maxWidth-=boxBorderWidth;}
53
+ if(!closeBehavior.buttonInside){if(closeButtonRight){maxWidth-=Math.abs(closeButtonRight);}
54
  if(closeButtonLeft){maxWidth-=Math.abs(closeButtonLeft);}}
55
  if(maxWidth<0){return'30px';}
56
  return maxWidth+'px';}
58
  {if(!fitBackgroundImg)return;var imgHeight=fitBackgroundImg.height;var imgWidth=fitBackgroundImg.width;var winHeight=window.innerHeight;var winWidth=window.innerWidth;var minMargin=40;var popupWidth=0,popupHeight=0;if(imgWidth<(winWidth-2*minMargin)&&imgHeight<(winHeight-2*minMargin)){popupWidth=imgWidth;popupHeight=imgHeight;}else{var widthDif=winWidth-imgWidth;var heightDif=winHeight-imgHeight;if(widthDif<heightDif){popupWidth=winWidth-2*minMargin;popupHeight=popupWidth*imgHeight/imgWidth;}else{popupHeight=winHeight-2*minMargin;popupWidth=popupHeight*imgWidth/imgHeight;}}
59
  var sizeConfig=getSizeConfig();var maxWidth=sizeConfig.maxWidth;var maxHeight=sizeConfig.maxHeight;var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;var shadow=contentBox.shadowSpread||0;popupWidth=parseInt(popupWidth-2);sizeConfig.height=popupHeight+'px';}
60
  function calculateMaxHeight(maxHeight)
61
+ {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*4;var borderHeight=(contentBox.borderWidth||0)*2;var boxBorderHeight=(contentBox.boxBorderWidth||0)*4;var closeButtonTop=(parseInt(closeBehavior.top)||0)*2;var closeButtonBottom=(parseInt(closeBehavior.bottom)||0)*2;if(dimension.indexOf('fullScreen')!='-1'){}
62
+ else{maxHeight-=contentPadding;if(shadowSpread){maxHeight-=shadowSpread;maxHeight-=35;}
63
  maxHeight-=borderHeight;maxHeight-=boxBorderHeight;if(!closeBehavior.buttonInside){if(closeButtonBottom){maxHeight-=Math.abs(closeButtonBottom);}
64
+ if(closeButtonTop){maxHeight-=Math.abs(closeButtonTop);}}}
65
  if(maxHeight<0){return'30px';}
66
  return maxHeight+'px';}
67
  function positionPopup()
public/js/PopupBuilder.js CHANGED
@@ -121,7 +121,13 @@ SGPBPopup.prototype.initialsListeners = function()
121
  /* one time calling events (sgpbDidOpen, sgpbDidClose ...) */
122
  window.SGPB_SOUND = [];
123
  var that = this;
124
- sgAddEvent(window, 'sgpbDidOpen', function(e) {that.playMusic(e);});
 
 
 
 
 
 
125
 
126
  sgAddEvent(window, 'sgpbDidClose', function(e) {
127
  var args = e.detail;
@@ -139,14 +145,6 @@ SGPBPopup.prototype.onceListener = function()
139
  var that = this;
140
 
141
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
142
- jQuery('.sg-popup-close').click(function(){
143
- var currentPopup = that.getPopupIdForNextEsc();
144
- if (!currentPopup) {
145
- return false;
146
- }
147
-
148
- SGPBPopup.closePopupById(currentPopup.popupId);
149
- });
150
  document.onkeydown = function(e) {
151
  e = e || window.event;
152
 
@@ -922,7 +920,7 @@ SGPBPopup.prototype.themeCreator = function()
922
  }
923
  }
924
  else {
925
- popupConfig.magicCall('setButtonImage', popupData['sgpb-button-image-data']);
926
  if (popupData['sgpb-button-image-data'] == '' || popupData['sgpb-button-image-data'].indexOf('http') != -1) {
927
  popupConfig.magicCall('setButtonImage', popupData['sgpb-button-image']);
928
  }
@@ -982,11 +980,15 @@ SGPBPopup.prototype.themeCustomizations = function()
982
 
983
  var overlayClasses = popupTheme+'-overlay sgpb-popup-overlay-'+popupId;
984
  /* for old users, which didn't have enable/disable overlay option */
985
- var popupOverlayEnable = true;
 
 
986
  if (SGPB_JS_PACKAGES.extensions['advanced-closing'] && !SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
987
- popupOverlayEnable = false;
988
  }
989
- popupConfig.magicCall('setOverlayVisible', popupOverlayEnable);
 
 
990
  if (SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
991
  popupConfig.magicCall('setOverlayAddClass', overlayClasses + ' ' + popupData['sgpb-overlay-custom-class']);
992
  var overlayOpacity = popupData['sgpb-overlay-opacity'] || 0.8;
@@ -1569,16 +1571,17 @@ SGPBPopup.prototype.setPopupDimensions = function()
1569
  }
1570
  }
1571
  if (dimensionData == 'responsiveMode') {
 
1572
  /* for image popup type and responsive mode, set background image to fit */
1573
- if (popupType == 'image') {
1574
  popupConfig.magicCall('setContentBackgroundMode', 'fit');
1575
  this.setMaxWidthForResponsiveImage();
1576
  }
1577
 
1578
- var dimensionMeasure = popupData['sgpb-responsive-dimension-measure'];
1579
  var popupConfig = this.getPopupConfig();
1580
  if (dimensionMeasure != 'auto') {
1581
  popupConfig.magicCall('setWidth', dimensionMeasure+'%');
 
1582
  popupConfig.magicCall('setContentBackgroundPosition', 'center');
1583
  }
1584
  else {
@@ -1591,7 +1594,11 @@ SGPBPopup.prototype.setPopupDimensions = function()
1591
  popupConfig.magicCall('setContentBackgroundPosition', 'center center');
1592
  widthToSet += 'px';
1593
  }
 
1594
  popupConfig.magicCall('setWidth', widthToSet);
 
 
 
1595
  }
1596
 
1597
  return popupConfig;
@@ -2249,13 +2256,12 @@ SgpbEventListener.prototype.sgpbLoad = function(listenerObj, eventData)
2249
  timeout = timeout*1000;
2250
  var timerId,
2251
  repetitiveTimeout = null;
2252
-
2253
- sgAddEvent(window, 'load', function() {
2254
- clearInterval(timerId);
2255
- timerId = setTimeout(function() {
2256
  popupObj.prepareOpen();
2257
  }, timeout);
2258
- });
 
2259
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
2260
  var args = e.detail;
2261
  clearInterval(repetitiveTimeout);
121
  /* one time calling events (sgpbDidOpen, sgpbDidClose ...) */
122
  window.SGPB_SOUND = [];
123
  var that = this;
124
+ sgAddEvent(window, 'sgpbDidOpen', function(e) {
125
+ that.playMusic(e);
126
+ jQuery('.sg-popup-close').unbind('click').bind('click',function(){
127
+ var currentPopupId = jQuery(this).parents('.sg-popup-builder-content').attr('data-id');
128
+ SGPBPopup.closePopupById(currentPopupId);
129
+ });
130
+ });
131
 
132
  sgAddEvent(window, 'sgpbDidClose', function(e) {
133
  var args = e.detail;
145
  var that = this;
146
 
147
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
 
 
 
 
 
 
 
 
148
  document.onkeydown = function(e) {
149
  e = e || window.event;
150
 
920
  }
921
  }
922
  else {
923
+ popupConfig.magicCall('setButtonImage', 'data:image/png;base64,'+popupData['sgpb-button-image-data']);
924
  if (popupData['sgpb-button-image-data'] == '' || popupData['sgpb-button-image-data'].indexOf('http') != -1) {
925
  popupConfig.magicCall('setButtonImage', popupData['sgpb-button-image']);
926
  }
980
 
981
  var overlayClasses = popupTheme+'-overlay sgpb-popup-overlay-'+popupId;
982
  /* for old users, which didn't have enable/disable overlay option */
983
+ if (typeof popupData['sgpb-enable-popup-overlay'] == 'undefined') {
984
+ popupData['sgpb-enable-popup-overlay'] = true;
985
+ }
986
  if (SGPB_JS_PACKAGES.extensions['advanced-closing'] && !SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
987
+ popupData['sgpb-enable-popup-overlay'] = false;
988
  }
989
+
990
+
991
+ popupConfig.magicCall('setOverlayVisible', SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay']));
992
  if (SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])) {
993
  popupConfig.magicCall('setOverlayAddClass', overlayClasses + ' ' + popupData['sgpb-overlay-custom-class']);
994
  var overlayOpacity = popupData['sgpb-overlay-opacity'] || 0.8;
1571
  }
1572
  }
1573
  if (dimensionData == 'responsiveMode') {
1574
+ var dimensionMeasure = popupData['sgpb-responsive-dimension-measure'];
1575
  /* for image popup type and responsive mode, set background image to fit */
1576
+ if (popupType == 'image' && dimensionMeasure != 'fullScreen') {
1577
  popupConfig.magicCall('setContentBackgroundMode', 'fit');
1578
  this.setMaxWidthForResponsiveImage();
1579
  }
1580
 
 
1581
  var popupConfig = this.getPopupConfig();
1582
  if (dimensionMeasure != 'auto') {
1583
  popupConfig.magicCall('setWidth', dimensionMeasure+'%');
1584
+
1585
  popupConfig.magicCall('setContentBackgroundPosition', 'center');
1586
  }
1587
  else {
1594
  popupConfig.magicCall('setContentBackgroundPosition', 'center center');
1595
  widthToSet += 'px';
1596
  }
1597
+
1598
  popupConfig.magicCall('setWidth', widthToSet);
1599
+ if (dimensionMeasure == 'fullScreen') {
1600
+ popupConfig.magicCall('setHeight', widthToSet);
1601
+ }
1602
  }
1603
 
1604
  return popupConfig;
2256
  timeout = timeout*1000;
2257
  var timerId,
2258
  repetitiveTimeout = null;
2259
+ var openOnLoadPopup = function() {
2260
+ setTimeout(function() {
 
 
2261
  popupObj.prepareOpen();
2262
  }, timeout);
2263
+ };
2264
+ sgAddEvent(window, 'load', openOnLoadPopup(timeout, popupObj));
2265
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
2266
  var args = e.detail;
2267
  clearInterval(repetitiveTimeout);
public/views/dimensionsView.php CHANGED
@@ -30,7 +30,7 @@
30
  <div class="sg-hide sg-full-width" id="responsive-dimension-wrapper">
31
  <div class="row form-group">
32
  <label class="col-md-5<?php echo $subOptionClass; ?>" for="max-height"><?php _e('Size', SG_POPUP_TEXT_DOMAIN) ?>:</label>
33
- <div class="col-md-6"><?php echo AdminHelper::createSelectBox($defaultData['responsiveDimensions'], esc_html($popupTypeObj->getOptionValue('sgpb-responsive-dimension-measure')), array('name' => 'sgpb-responsive-dimension-measure', 'class'=>'js-sg-select2')); ?></div>
34
  </div>
35
  </div>
36
  <div class="row form-group">
30
  <div class="sg-hide sg-full-width" id="responsive-dimension-wrapper">
31
  <div class="row form-group">
32
  <label class="col-md-5<?php echo $subOptionClass; ?>" for="max-height"><?php _e('Size', SG_POPUP_TEXT_DOMAIN) ?>:</label>
33
+ <div class="col-md-6"><?php echo AdminHelper::createSelectBox($defaultData['responsiveDimensions'], esc_html($popupTypeObj->getOptionValue('sgpb-responsive-dimension-measure')), array('name' => 'sgpb-responsive-dimension-measure', 'class'=>'js-sg-select2 sgpb-responsive-mode-change-js')); ?></div>
34
  </div>
35
  </div>
36
  <div class="row form-group">
public/views/mediaButton.php CHANGED
@@ -6,7 +6,7 @@
6
  $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
7
  ?>
8
 
9
- <div class="sgpb-hide">
10
  <div id="sgpb-hidden-media-popup" class="sgpb-wrapper">
11
  <div class="row">
12
  <div class="col-sm-10">
6
  $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
7
  ?>
8
 
9
+ <div class="sgpb-hide" style="display: none">
10
  <div id="sgpb-hidden-media-popup" class="sgpb-wrapper">
11
  <div class="row">
12
  <div class="col-sm-10">
readme.txt CHANGED
@@ -2,12 +2,14 @@
2
  Plugin Name: Popup Builder - Responsive Wordpress Pop up
3
  Contributors: Popup By Sygnoos, Sygnoos
4
  Author: Popup Builder
 
 
5
  Donate link: https://popup-builder.com
6
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
7
  Requires at least: 3.8
8
- Tested up to: 5.0.3
9
  Requires PHP: 5.3.3
10
- Stable tag: 3.1.6.1
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -180,6 +182,16 @@ Go to the Popup Builder settings and set your desired options.
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
 
 
 
183
  = Version 3.1.6.1 =
184
  * Bug fixed related to overlay issue.
185
  * Mailchimp update issue fixed.
@@ -943,7 +955,7 @@ Leave us a good review :)
943
 
944
  == Upgrade Notice ==
945
 
946
- Current Version of Popup Builder is 3.1.5
947
 
948
  == Other Notes ==
949
 
@@ -1048,4 +1060,4 @@ This popup can be built up to your preferences, as there is a range of options a
1048
 
1049
  More marketing popup descriptions/solutions are coming soon.
1050
 
1051
- Popup Builder Team.
2
  Plugin Name: Popup Builder - Responsive Wordpress Pop up
3
  Contributors: Popup By Sygnoos, Sygnoos
4
  Author: Popup Builder
5
+ Author URI: https://popup-builder.com
6
+ Plugin URI: https://popup-builder.com
7
  Donate link: https://popup-builder.com
8
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
9
  Requires at least: 3.8
10
+ Tested up to: 5.1
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.1.7
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
182
 
183
  == Changelog ==
184
 
185
+ = Version 3.1.7 =
186
+ * Added Popup Builder button inside the TinyMCE editor, which will allow adding the popup shortcode inside the page/post content.
187
+ * Added compatability with page builders.
188
+ * Bug fixed related to Autoresponder conditions.
189
+ * Bug fixed related to cache of the select box element.
190
+ * Improvements related to script including for wordpress multisites.
191
+ * Conflict resolved related to some extensions.
192
+ * Bug fixed related to post category search action.
193
+ * Code cleanup and improvements.
194
+
195
  = Version 3.1.6.1 =
196
  * Bug fixed related to overlay issue.
197
  * Mailchimp update issue fixed.
955
 
956
  == Upgrade Notice ==
957
 
958
+ Current Version of Popup Builder is 3.1.7
959
 
960
  == Other Notes ==
961
 
1060
 
1061
  More marketing popup descriptions/solutions are coming soon.
1062
 
1063
+ Popup Builder Team.