Popup Builder – Responsive WordPress Pop up - Version 2.6.4.6

Version Description

Current Version of Popup Builder is 2.6.4.6

Download this release

Release Info

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

Code changes from version 2.6.4.5.1 to 2.6.4.6

classes/SGPopup.php CHANGED
@@ -245,7 +245,7 @@ abstract class SGPopup {
245
 
246
  public function improveContent($content) {
247
  $hasSameShortcode = strpos($content,'sg_popup id="'.$this->getId().'"');
248
-
249
  if(POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE && !$hasSameShortcode) {
250
  require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
251
  return SgPopupPro::sgPopupExtraSanitize($content);
@@ -273,6 +273,7 @@ abstract class SGPopup {
273
  }
274
 
275
  private function addPopupStyles() {
 
276
  $popupId = $this->getId();
277
  $options = $this->getOptions();
278
  $options = json_decode($options, true);
@@ -288,21 +289,31 @@ abstract class SGPopup {
288
  else {
289
  $popupZIndex = $options['popup-z-index'];
290
  }
291
-
292
  if(!empty($options['popup-content-padding'])) {
293
  $contentPadding = $options['popup-content-padding'];
294
  }
295
-
296
- echo '<style type="text/css">
297
-
298
- .sg-popup-overlay-'.$popupId.',
299
- .sg-popup-content-'.$popupId.' {
300
- z-index: '.$popupZIndex.' !important;
301
- }
302
- #sg-popup-content-wrapper-'.$popupId.' {
303
- padding: '.$contentPadding.'px !important;
304
- }
305
- </style>';
 
 
 
 
 
 
 
 
 
 
306
  }
307
 
308
  public function render() {
@@ -329,7 +340,7 @@ abstract class SGPopup {
329
  return $sgPopupVars;
330
  }
331
  return '';
332
-
333
  }
334
  public static function getTotalRowCount() {
335
  global $wpdb;
@@ -339,7 +350,7 @@ abstract class SGPopup {
339
 
340
  public static function getPagePopupId($page,$popup) {
341
  global $wpdb;
342
- $sql = $wpdb->prepare("SELECT meta_value FROM ". $wpdb->prefix ."postmeta WHERE post_id = %d AND meta_key = %s",$page,$popup);
343
  $row = $wpdb->get_row($sql);
344
  $id = 0;
345
  if($row) {
@@ -358,7 +369,7 @@ abstract class SGPopup {
358
 
359
  $isInArray = true;
360
  $options = json_decode($obj->getOptions(), true);
361
-
362
  $countryStatus = $options['countryStatus'];
363
  $countryIso = $options['countryIso'];
364
  $allowCountries = $options['allowCountries'];
@@ -386,7 +397,7 @@ abstract class SGPopup {
386
  global $wpdb;
387
 
388
  $insertPreapre = array();
389
- $insertQuery = "INSERT INTO ". $wpdb->prefix ."sg_popup_in_pages(popupId, pageId, type) VALUES ";
390
 
391
  foreach ($selectedData as $value) {
392
  $insertPreapre[] .= $wpdb->prepare( "(%d,%s,%s)", $id, $value, $type);
@@ -410,7 +421,7 @@ abstract class SGPopup {
410
 
411
  if(is_array($allPages)) {
412
  $key = array_search($id, $allPages);
413
-
414
  if ($key !== false) {
415
  unset($allPages[$key]);
416
  }
@@ -418,7 +429,7 @@ abstract class SGPopup {
418
  }
419
  if(is_array($allPosts)) {
420
  $key = array_search($id, $allPosts);
421
-
422
  if ($key !== false) {
423
  unset($allPosts[$key]);
424
  }
@@ -431,7 +442,7 @@ abstract class SGPopup {
431
  global $wpdb;
432
 
433
  $deletePrepare = array();
434
- $deleteQuery = "DELETE FROM ". $wpdb->prefix ."sg_popup_in_pages WHERE pageId IN (";
435
 
436
  foreach ($selectedPages as $value) {
437
  $deletePrepare[] .= $wpdb->prepare("%d", $value );
@@ -445,7 +456,7 @@ abstract class SGPopup {
445
  public static function findInAllSelectedPages($pageId, $type) {
446
  global $wpdb;
447
 
448
- $st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_in_pages WHERE pageId = %s and type=%s", $pageId, $type);
449
  $arr = $wpdb->get_results($st, ARRAY_A);
450
  if(!$arr) return false;
451
  return $arr;
245
 
246
  public function improveContent($content) {
247
  $hasSameShortcode = strpos($content,'sg_popup id="'.$this->getId().'"');
248
+
249
  if(POPUP_BUILDER_PKG !== POPUP_BUILDER_PKG_FREE && !$hasSameShortcode) {
250
  require_once(SG_APP_POPUP_FILES ."/sg_popup_pro.php");
251
  return SgPopupPro::sgPopupExtraSanitize($content);
273
  }
274
 
275
  private function addPopupStyles() {
276
+ $styles = '';
277
  $popupId = $this->getId();
278
  $options = $this->getOptions();
279
  $options = json_decode($options, true);
289
  else {
290
  $popupZIndex = $options['popup-z-index'];
291
  }
292
+
293
  if(!empty($options['popup-content-padding'])) {
294
  $contentPadding = $options['popup-content-padding'];
295
  }
296
+
297
+ $styles .= '<style type="text/css">';
298
+
299
+ $styles .= '.sg-popup-overlay-'.$popupId.',
300
+ .sg-popup-content-'.$popupId.' {
301
+ z-index: '.$popupZIndex.' !important;
302
+ }
303
+ #sg-popup-content-wrapper-'.$popupId.' {
304
+ padding: '.$contentPadding.'px !important;
305
+ }';
306
+
307
+ /* if popup close button has delay,hide it */
308
+ if (@$options['closeButton'] && @$options['buttonDelayValue']) {
309
+ $styles .= '.sg-popup-content-'.$popupId.' #sgcboxClose {
310
+ display: none !important;
311
+ }';
312
+ }
313
+
314
+ $styles .= '</style>';
315
+
316
+ echo $styles;
317
  }
318
 
319
  public function render() {
340
  return $sgPopupVars;
341
  }
342
  return '';
343
+
344
  }
345
  public static function getTotalRowCount() {
346
  global $wpdb;
350
 
351
  public static function getPagePopupId($page,$popup) {
352
  global $wpdb;
353
+ $sql = $wpdb->prepare('SELECT meta_value FROM '. $wpdb->prefix .'postmeta WHERE post_id = %d AND meta_key = %s',$page,$popup);
354
  $row = $wpdb->get_row($sql);
355
  $id = 0;
356
  if($row) {
369
 
370
  $isInArray = true;
371
  $options = json_decode($obj->getOptions(), true);
372
+
373
  $countryStatus = $options['countryStatus'];
374
  $countryIso = $options['countryIso'];
375
  $allowCountries = $options['allowCountries'];
397
  global $wpdb;
398
 
399
  $insertPreapre = array();
400
+ $insertQuery = 'INSERT INTO '. $wpdb->prefix .'sg_popup_in_pages(popupId, pageId, type) VALUES ';
401
 
402
  foreach ($selectedData as $value) {
403
  $insertPreapre[] .= $wpdb->prepare( "(%d,%s,%s)", $id, $value, $type);
421
 
422
  if(is_array($allPages)) {
423
  $key = array_search($id, $allPages);
424
+
425
  if ($key !== false) {
426
  unset($allPages[$key]);
427
  }
429
  }
430
  if(is_array($allPosts)) {
431
  $key = array_search($id, $allPosts);
432
+
433
  if ($key !== false) {
434
  unset($allPosts[$key]);
435
  }
442
  global $wpdb;
443
 
444
  $deletePrepare = array();
445
+ $deleteQuery = 'DELETE FROM '. $wpdb->prefix .'sg_popup_in_pages WHERE pageId IN (';
446
 
447
  foreach ($selectedPages as $value) {
448
  $deletePrepare[] .= $wpdb->prepare("%d", $value );
456
  public static function findInAllSelectedPages($pageId, $type) {
457
  global $wpdb;
458
 
459
+ $st = $wpdb->prepare('SELECT * FROM '. $wpdb->prefix .'sg_popup_in_pages WHERE pageId = %s and type=%s', $pageId, $type);
460
  $arr = $wpdb->get_results($st, ARRAY_A);
461
  if(!$arr) return false;
462
  return $arr;
config.php CHANGED
@@ -24,8 +24,8 @@ if(!class_exists('SgPopupBuilderConfig')) {
24
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
25
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
26
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
27
- define('SG_POPUP_VERSION', 2.645);
28
- define('SG_POPUP_PRO_VERSION', 3.375);
29
  define('SG_POPUP_PRO_URL', 'https://popup-builder.com/');
30
  define('SG_POPUP_EXTENSION_URL', 'https://popup-builder.com/extensions');
31
  define('SG_MAILCHIMP_EXTENSION_URL', 'https://popup-builder.com/downloads/mailchimp/');
24
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
25
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
26
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
27
+ define('SG_POPUP_VERSION', 2.6546);
28
+ define('SG_POPUP_PRO_VERSION', 3.376);
29
  define('SG_POPUP_PRO_URL', 'https://popup-builder.com/');
30
  define('SG_POPUP_EXTENSION_URL', 'https://popup-builder.com/extensions');
31
  define('SG_MAILCHIMP_EXTENSION_URL', 'https://popup-builder.com/downloads/mailchimp/');
files/sg_functions.php CHANGED
@@ -507,13 +507,14 @@ class SGFunctions
507
  $value = @$radioElement['value'];
508
  $brValue = @$radioElement['newline'];
509
  $additionalHtml = @$radioElement['additionalHtml'];
 
510
  if($checkedValue == $value) {
511
  $checked = 'checked';
512
  }
513
  if($brValue) {
514
  $br = "<br>";
515
  }
516
- $content .= '<input class="radio-btn-fix" type="radio" name="'.$name.'" value="'.$value.'" '.$checked.'>';
517
  $content .= $additionalHtml.$br;
518
  }
519
  return $content;
@@ -880,4 +881,4 @@ class SGFunctions
880
  <option value="ZW">Zimbabwe</option>
881
  </select>';
882
  }
883
- }
507
  $value = @$radioElement['value'];
508
  $brValue = @$radioElement['newline'];
509
  $additionalHtml = @$radioElement['additionalHtml'];
510
+ $labelId = 'sg-select-'.$name.'-'.$i;
511
  if($checkedValue == $value) {
512
  $checked = 'checked';
513
  }
514
  if($brValue) {
515
  $br = "<br>";
516
  }
517
+ $content .= '<label for="'.$labelId.'"><input id="'.$labelId.'" class="radio-btn-fix" type="radio" name="'.$name.'" value="'.$value.'" '.$checked.'>';
518
  $content .= $additionalHtml.$br;
519
  }
520
  return $content;
881
  <option value="ZW">Zimbabwe</option>
882
  </select>';
883
  }
884
+ }
files/sg_popup_ajax.php CHANGED
@@ -98,7 +98,7 @@ function sgContactForm()
98
  }
99
  $message .= '<b>Name</b>: '.$name."<br>";
100
  }
101
-
102
  $message .= '<b>E-mail</b>: '.$mail."<br>";
103
  if(isset($subject)) {
104
  if($subject == '') {
@@ -106,7 +106,7 @@ function sgContactForm()
106
  }
107
  $message .= '<b>Subject</b>: '.$subject."<br>";
108
  }
109
-
110
  $message .= '<b>Message</b>: '.$userMessage."<br>";
111
  $headers = 'MIME-Version: 1.0'."\r\n";
112
  $headers = 'From: '.$adminMail.''."\r\n";
@@ -147,7 +147,7 @@ function sgImportPopups()
147
  foreach ($contents['wpOptions'] as $key => $option) {
148
  update_option($key,$option);
149
  }
150
-
151
  foreach ($contents['exportArray'] as $content) {
152
  //Main popup table data
153
  $popupData = $content['mainPopupData'];
@@ -171,20 +171,18 @@ function sgImportPopups()
171
  //Child popup table columns
172
  $values = '';
173
  $columns = implode(array_keys($childPopup), ', ');
174
- //$values = "'".implode(array_values($childPopup), "','")."'";
175
  foreach (array_values($childPopup) as $value) {
176
  $values .= "'".addslashes($value)."', ";
177
  }
178
  $values = rtrim($values, ', ');
179
-
180
  $queryValues = str_repeat("%s, ", count(array_keys($childPopup)));
181
  $queryValues = "%d, ".rtrim($queryValues, ', ');
182
-
183
  $queryStr = 'INSERT INTO '.$wpdb->prefix.$childPopupTableName.'(id, '.$columns.') VALUES ('.$lastInsertId.','. $values.')';
184
- //$sql = $wpdb->prepare($queryStr,$lastInsertId, $valuess);
185
-
186
- $resa = $wpdb->query($queryStr);
187
-
188
  echo 'ChildRes: '.$resa;
189
  }
190
  echo 'MainRes: '.$res;
@@ -196,7 +194,7 @@ add_action('wp_ajax_import_popups', 'sgImportPopups');
196
  function sgCloseReviewPanel()
197
  {
198
  check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
199
- update_option('SG_COLOSE_REVIEW_BLOCK', true);
200
  die();
201
  }
202
  add_action('wp_ajax_close_review_panel', 'sgCloseReviewPanel');
@@ -204,8 +202,8 @@ add_action('wp_ajax_close_review_panel', 'sgCloseReviewPanel');
204
  function sgDontShowReviewPopup()
205
  {
206
  check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
207
- update_option('SGPBCloseReviewPopup', true);
208
- die();
209
  }
210
  add_action('wp_ajax_dont_show_review_popup', 'sgDontShowReviewPopup');
211
 
@@ -253,14 +251,18 @@ function addToSubscribers() {
253
  $subsType = array_map( 'sanitize_text_field', $_POST['subsType']);
254
 
255
  foreach ($subsType as $subType) {
256
- $selectSql = $wpdb->prepare("SELECT id FROM ".$wpdb->prefix."sg_subscribers WHERE email=%s AND subscriptionType=%s", $email, $subType);
257
  $res = $wpdb->get_row($selectSql, ARRAY_A);
258
  if(empty($res)) {
259
- $sql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix."sg_subscribers (firstName, lastName, email, subscriptionType) VALUES (%s, %s, %s, %s) ", $firstName, $lastName, $email, $subType);
 
 
 
 
260
  $wpdb->query($sql);
261
  }
262
  }
263
-
264
  die();
265
  }
266
  add_action('wp_ajax_add_to_subsribers', 'addToSubscribers');
@@ -285,7 +287,7 @@ function sgIsHaveErrorLog() {
285
  check_ajax_referer('sgPopupBuilderSubsLogNonce', 'ajaxNonce');
286
  $countRows = '';
287
  $popupType = sgSanitizeAjaxField($_POST['subsType']);
288
-
289
  $getErrorCounteSql = $wpdb->prepare("SELECT count(*) FROM ". $wpdb->prefix ."sg_subscription_error_log WHERE popupType=%s",$popupType);
290
  $countRows = $wpdb->get_var($getErrorCounteSql);
291
  echo $countRows;
@@ -302,7 +304,7 @@ function sgChangePopupStatus() {
302
  $options['isActiveStatus'] = sgSanitizeAjaxField($_POST['popupStatus']);
303
  $obj->setOptions(json_encode($options));
304
  $obj->save();
305
- }
306
  add_action('wp_ajax_change_popup_status', 'sgChangePopupStatus');
307
 
308
  function savePopupPreviewData() {
98
  }
99
  $message .= '<b>Name</b>: '.$name."<br>";
100
  }
101
+
102
  $message .= '<b>E-mail</b>: '.$mail."<br>";
103
  if(isset($subject)) {
104
  if($subject == '') {
106
  }
107
  $message .= '<b>Subject</b>: '.$subject."<br>";
108
  }
109
+
110
  $message .= '<b>Message</b>: '.$userMessage."<br>";
111
  $headers = 'MIME-Version: 1.0'."\r\n";
112
  $headers = 'From: '.$adminMail.''."\r\n";
147
  foreach ($contents['wpOptions'] as $key => $option) {
148
  update_option($key,$option);
149
  }
150
+
151
  foreach ($contents['exportArray'] as $content) {
152
  //Main popup table data
153
  $popupData = $content['mainPopupData'];
171
  //Child popup table columns
172
  $values = '';
173
  $columns = implode(array_keys($childPopup), ', ');
 
174
  foreach (array_values($childPopup) as $value) {
175
  $values .= "'".addslashes($value)."', ";
176
  }
177
  $values = rtrim($values, ', ');
178
+
179
  $queryValues = str_repeat("%s, ", count(array_keys($childPopup)));
180
  $queryValues = "%d, ".rtrim($queryValues, ', ');
181
+
182
  $queryStr = 'INSERT INTO '.$wpdb->prefix.$childPopupTableName.'(id, '.$columns.') VALUES ('.$lastInsertId.','. $values.')';
183
+
184
+ $resa = (int)$wpdb->query($queryStr);
185
+
 
186
  echo 'ChildRes: '.$resa;
187
  }
188
  echo 'MainRes: '.$res;
194
  function sgCloseReviewPanel()
195
  {
196
  check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
197
+ update_option('SG_COLOSE_REVIEW_BLOCK', true);
198
  die();
199
  }
200
  add_action('wp_ajax_close_review_panel', 'sgCloseReviewPanel');
202
  function sgDontShowReviewPopup()
203
  {
204
  check_ajax_referer('sgPopupBuilderReview', 'ajaxNonce');
205
+ update_option('SGPBCloseReviewPopup', true);
206
+ die();
207
  }
208
  add_action('wp_ajax_dont_show_review_popup', 'sgDontShowReviewPopup');
209
 
251
  $subsType = array_map( 'sanitize_text_field', $_POST['subsType']);
252
 
253
  foreach ($subsType as $subType) {
254
+ $selectSql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.'sg_subscribers WHERE email = %s AND subscriptionType = %s', $email, $subType);
255
  $res = $wpdb->get_row($selectSql, ARRAY_A);
256
  if(empty($res)) {
257
+ $sql = $wpdb->prepare('INSERT INTO '.$wpdb->prefix.'sg_subscribers (firstName, lastName, email, subscriptionType) VALUES (%s, %s, %s, %s) ', $firstName, $lastName, $email, $subType);
258
+ $wpdb->query($sql);
259
+ }
260
+ else {
261
+ $sql = $wpdb->prepare('UPDATE '.$wpdb->prefix.'sg_subscribers SET firstName = %s, lastName = %s, email = %s, subscriptionType = %s WHERE id = %s', $firstName, $lastName, $email, $subType, $res['id']);
262
  $wpdb->query($sql);
263
  }
264
  }
265
+
266
  die();
267
  }
268
  add_action('wp_ajax_add_to_subsribers', 'addToSubscribers');
287
  check_ajax_referer('sgPopupBuilderSubsLogNonce', 'ajaxNonce');
288
  $countRows = '';
289
  $popupType = sgSanitizeAjaxField($_POST['subsType']);
290
+
291
  $getErrorCounteSql = $wpdb->prepare("SELECT count(*) FROM ". $wpdb->prefix ."sg_subscription_error_log WHERE popupType=%s",$popupType);
292
  $countRows = $wpdb->get_var($getErrorCounteSql);
293
  echo $countRows;
304
  $options['isActiveStatus'] = sgSanitizeAjaxField($_POST['popupStatus']);
305
  $obj->setOptions(json_encode($options));
306
  $obj->save();
307
+ }
308
  add_action('wp_ajax_change_popup_status', 'sgChangePopupStatus');
309
 
310
  function savePopupPreviewData() {
files/sg_popup_create_new.php CHANGED
@@ -121,6 +121,8 @@ if (isset($_GET['id'])) {
121
  $beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
122
  $duration = @$jsonData['duration'];
123
  $delay = @$jsonData['delay'];
 
 
124
  $sgTheme3BorderColor = @$jsonData['sgTheme3BorderColor'];
125
  $sgTheme3BorderRadius = @$jsonData['sgTheme3BorderRadius'];
126
  $sgThemeCloseText = @$jsonData['theme-close-text'];
@@ -297,6 +299,7 @@ if(!isset($id)) {
297
  $dataPopupId = "-1";
298
  }
299
 
 
300
  $sgPopup = array(
301
  'escKey'=> true,
302
  'closeButton' => true,
@@ -325,6 +328,7 @@ $sgPopup = array(
325
  'left' => false,
326
  'duration' => 1,
327
  'delay' => 0,
 
328
  'theme-close-text' => 'Close',
329
  'content-click-behavior' => 'close',
330
  'sgTheme3BorderRadius' => 0,
@@ -416,10 +420,10 @@ $popupProDefaultValues = array(
416
  'subs-validation-message' => 'This field is required.',
417
  'subs-btn-progress-title' => 'Please wait...',
418
  'subs-success-behavior' => 'showMessage',
419
- 'subs-success-redirect-url' => '',
420
- 'subs-success-popups-list' => '',
421
- 'subs-first-name-required' => '',
422
- 'subs-last-name-required' => '',
423
  'subs-success-redirect-new-tab' => false,
424
  'contact-name' => 'Name *',
425
  'contact-name-required' => true,
@@ -455,6 +459,8 @@ $contentClick = sgBoolToChecked($sgPopup['contentClick']);
455
  $repetitivePopup = sgBoolToChecked($sgPopup['repetitivePopup']);
456
  $fblikeDontShowShareButton = sgBoolToChecked($sgPopup['fblike-dont-show-share-button']);
457
  $fblikeClosePopupAfterLike = sgBoolToChecked($sgPopup['fblike-close-popup-after-like']);
 
 
458
  $contentClickBehavior = $sgPopup['content-click-behavior'];
459
  $theme3BorderRadius = $sgPopup['sgTheme3BorderRadius'];
460
  $popupZIndex = $sgPopup['popup-z-index'];
@@ -594,6 +600,7 @@ $maxHeight = $sgPopup['maxHeight'];
594
  $deafultFixed = $sgPopup['fixed'];
595
  $defaultDuration = $sgPopup['duration'];
596
  $defaultDelay = $sgPopup['delay'];
 
597
  $themeCloseText = $sgPopup['theme-close-text'];
598
 
599
  $sgCloseButton = @sgSetChecked($sgCloseButton, $closeButton);
@@ -697,6 +704,8 @@ $sgOnceExpiresTime = @sgGetValue($sgOnceExpiresTime, $onceExpiresTime);
697
  $sgPopupAppearNumberLimit = @sgGetValue($sgPopupAppearNumberLimit, $popupAppearNumberLimit);
698
  $sgRepetitivePopupPeriod = @sgGetValue($sgRepetitivePopupPeriod, $repetitivePopupPeriod);
699
  $delay = @sgGetValue($delay, $defaultDelay);
 
 
700
  $sgInactivityTimout = @sgGetValue($sgInactivityTimout, $inactivityTimout);
701
  $sgContentClickBehavior = @sgGetValue($sgContentClickBehavior, $contentClickBehavior);
702
  $sgPopupStartTimer = @sgGetValue($sgPopupStartTimer, $popupStartTimer);
@@ -817,13 +826,13 @@ $usersGroup = array(
817
  array(
818
  'name'=>'loggedin-user',
819
  'value'=>'true',
820
- 'additionalHtml'=>'<span class="countries-radio-text allow-countries">logged in</span>',
821
  'newline' => false
822
  ),
823
  array(
824
  'name'=>'loggedin-user',
825
  'value'=>'false',
826
- 'additionalHtml'=>'<span class="countries-radio-text">not logged in</span>',
827
  'newline' => true
828
  )
829
  );
@@ -1201,7 +1210,7 @@ function sgCreateSelect($options,$name,$selecteOption)
1201
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
1202
  $str .= "<select name=$name class=$popup_style_name input-width-static >";
1203
  foreach ($options as $key => $option) {
1204
-
1205
  $selected ='';
1206
 
1207
  if ($key == $selecteOption) {
@@ -1226,32 +1235,38 @@ if (isset($_GET['saved']) && $_GET['saved']==1) {
1226
  echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
1227
  }
1228
  if (isset($_GET["titleError"])): ?>
1229
- <div class="error notice" id="title-error-message">
1230
- <p>Invalid Title</p>
1231
- </div>
1232
  <?php endif; ?>
1233
- <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
1234
- <?php
1235
- if(function_exists('wp_nonce_field')) {
1236
- wp_nonce_field('sgPopupBuilderSave');
1237
- }
1238
- ?>
1239
- <input type="hidden" name="action" value="<?php echo $currentActionName;?>">
1240
- <div class="crud-wrapper">
1241
- <div class="cereate-title-wrapper">
1242
- <div class="sg-title-crud">
1243
  <?php if (isset($id)): ?>
1244
- <h2>Edit popup</h2>
1245
  <?php else: ?>
1246
- <h2>Create new popup</h2>
1247
  <?php endif; ?>
1248
  <?php $pageUrl = SgPopupGetData::getPageUrl(); ?>
1249
  </div>
1250
  <div class="button-wrapper">
1251
- <input type="submit" id="sg-save-button" class="button-primary" value="<?php echo 'Save Changes'; ?>">
1252
- <?php if( !empty($pageUrl)): ?>
1253
- <input type="button" class="sg-popup-preview button-primary sg-popup-general-option" data-page-url="<?php echo $pageUrl; ?>" value="Preview">
1254
- <?php endif; ?>
 
 
 
 
 
 
1255
  <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
1256
  <input class="crud-to-pro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
1257
  <?php endif; ?>
@@ -1275,160 +1290,167 @@ if (isset($_GET["titleError"])): ?>
1275
  <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
1276
  <div class="generalContent sgSameWidthPostBox">
1277
  <?php require_once($popupFilesPath."/main_section/".$popupType.".php");?>
1278
- <input type="hidden" name="type" value="<?php echo $popupType;?>">
1279
- <span class="liquid-width" id="theme-span">Popup theme:</span>
1280
  <?php echo sgCreateSelect($sgPopupTheme,'theme',esc_html(@$sgColorboxTheme));?>
1281
- <div class="theme1 sg-hide"></div>
1282
- <div class="theme2 sg-hide"></div>
1283
- <div class="theme3 sg-hide"></div>
1284
- <div class="theme4 sg-hide"></div>
1285
- <div class="theme5 sg-hide"></div>
1286
- <div class="theme6 sg-hide"></div>
1287
- <div class="sg-popup-theme-3 themes-suboptions sg-hide">
1288
- <span class="liquid-width">Border color:</span>
1289
- <div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgTheme3BorderColor" value="<?php echo esc_attr(@$sgTheme3BorderColor); ?>" /></div>
1290
- <br><span class="liquid-width">Border radius:</span>
1291
- <input class="input-width-percent" type="number" min="0" max="50" name="sgTheme3BorderRadius" value="<?php echo esc_attr(@$sgTheme3BorderRadius); ?>">
1292
- <span class="span-percent">%</span>
1293
- </div>
1294
- <div class="sg-popup-theme-4 themes-suboptions sg-hide">
1295
- <span class="liquid-width">Close button text:</span>
1296
- <input type="text" name="theme-close-text" value="<?php echo esc_attr($sgThemeCloseText);?>">
1297
- </div>
1298
- </div>
1299
- </div>
1300
-
1301
- </div>
1302
- </div>
1303
- </div>
1304
- </div>
1305
- <div id="effect">
1306
- <div id="post-body" class="metabox-holder columns-2">
1307
- <div id="postbox-container-2" class="postbox-container">
1308
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1309
- <div class="postbox popupBuilder_effect_postbox sgSameWidthPostBox" style="display: block;">
1310
- <div class="handlediv effectTitle" title="Click to toggle"><br></div>
1311
- <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
1312
- <div class="effectsContent">
1313
- <span class="liquid-width">Effect type:</span>
1314
  <?php echo sgCreateSelect($sgPopupEffects,'effect',esc_html(@$effect));?>
1315
- <span class="js-preview-effect"></span>
1316
- <div class="effectWrapper"><div id="effectShow" ></div></div>
1317
-
1318
- <span class="liquid-width">Effect duration:</span>
1319
- <input class="input-width-static" type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
1320
-
1321
- <span class="liquid-width">Popup open sound:</span>
1322
- <div class="input-width-static sg-display-inline">
1323
- <input class="input-width-static js-checkbox-sound-option" type="checkbox" name="popupOpenSound" <?php echo $sgPopupOpenSound;?>></div><span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option enabled a sound will play after popup opened.Sound option is not available on mobile devices, as there are restrictions on sound auto-play options for mobile devices.</span><br>
1324
- <div class="acordion-main-div-content js-checkbox-sound-option-wrapper">
1325
- <div class="sound-uploader-wrapper">
1326
- <div class="liquid-width-div sg-vertical-top"><input id="js-upload-open-sound-button" class="button" type="button" value="Change the sound">
1327
- <button data-default-song="<?php echo $popupOpenSoundFile; ?> " id="reset-to-default" class="button">Reset</button>
1328
- </div>
1329
- <input class="input-width-static sg-margin-top-0" id="js-upload-open-sound" type="text" size="36" name="popupOpenSoundFile" value="<?php echo esc_attr($sgPopupOpenSoundFile); ?>" required readonly>
1330
- <span class="dashicons dashicons-controls-volumeon sg-preview-sound"></span>
1331
- </div>
1332
- </div>
1333
-
1334
- <span class="liquid-width">Popup opening delay:</span>
1335
- <input class="input-width-static" type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
1336
- </div>
1337
- </div>
1338
-
1339
- </div>
1340
- </div>
1341
- </div>
1342
- </div>
1343
  <?php
1344
- require_once($popupFilesPath."/options_section/".$popupType.".php");
1345
- echo $extensionManagerObj->optionsInclude($popupType);
1346
  ?>
1347
- </div>
1348
- <div id="right-main-div">
1349
- <div id="right-main">
1350
- <div id="dimentions">
1351
- <div id="post-body" class="metabox-holder columns-2">
1352
- <div id="postbox-container-2" class="postbox-container">
1353
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1354
- <div class="postbox popupBuilder_dimention_postbox sgSameWidthPostBox" style="display: block;">
1355
- <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
1356
- <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
1357
- <div class="dimensionsContent">
1358
- <div class="sg-radio-option-behavior">
1359
- <?php $responsiveMode = getResponsiveData($popupType);?>
1360
- <?php createRadiobuttons($responsiveMode, 'popup-dimension-mode', true, esc_html($sgPopupDimensionMode), "liquid-width");?>
1361
- </div>
1362
- <div class="js-accordion-responsiveMode js-radio-accordion sg-accordion-content">
1363
- <span class="liquid-width">size</span>
1364
- <?php echo sgCreateSelect($sgResponsiveMeasure,'popup-responsive-dimension-measure',esc_html(@$sgPopupResponsiveDimensionMeasure));?>
1365
- </div>
1366
- <div class="js-accordion-customMode js-radio-accordion sg-accordion-content">
1367
- <span class="liquid-width">Width:</span>
1368
- <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1369
- <span class="liquid-width">Height:</span>
1370
- <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1371
- <span class="liquid-width">Initial width:</span>
1372
- <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1373
- <span class="liquid-width">Initial height:</span>
1374
- <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1375
- </div>
1376
- <span class="liquid-width">Max width:</span>
1377
- <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1378
- <span class="liquid-width">Max height:</span>
1379
- <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1380
- </div>
1381
- </div>
1382
-
1383
- </div>
1384
- </div>
1385
- </div>
1386
- </div>
1387
- <div id="options">
1388
- <div id="post-body" class="metabox-holder columns-2">
1389
- <div id="postbox-container-2" class="postbox-container">
1390
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1391
- <div class="postbox popupBuilder_options_postbox sgSameWidthPostBox" style="display: block;">
1392
- <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
1393
- <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
1394
- <div class="optionsContent">
1395
- <span class="liquid-width">Dismiss on &quot;esc&quot; key:</span><input class="input-width-static" type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
1396
- <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
1397
-
1398
- <span class="liquid-width" id="createDescribeClose">Show &quot;close&quot; button:</span><input class="input-width-static" type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
1399
- <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
1400
-
1401
- <span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
1402
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the content is larger than the specified dimensions, then the content will be scrollable.</span><br>
1403
-
1404
- <span class="liquid-width">Disable page scrolling:</span><input class="input-width-static" type="checkbox" name="disable-page-scrolling" <?php echo $sgDisablePageScrolling; ?>>
1405
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If this option is enabled, the page scrolling will be disabled when the popup is open.</span><br>
1406
-
1407
- <span class="liquid-width">Enable reposition:</span><input class="input-width-static" type="checkbox" name="reposition" <?php echo $sgReposition;?> />
1408
- <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
1409
-
1410
- <span class="liquid-width">Enable scaling:</span><input class="input-width-static" type="checkbox" name="scaling" <?php echo $sgScaling;?> />
1411
- <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScaling samefontStyle">Resize popup according to screen size</span><br>
1412
-
1413
- <span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
1414
- <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
 
 
 
 
 
 
 
1415
 
1416
  <?php if(!sgRemoveOption('contentClick')): ?>
1417
- <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static js-checkbox-contnet-click" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
1418
- <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
1419
-
1420
- <div class="sg-hide sg-full-width js-content-click-wrraper">
1421
- <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1422
- <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1423
- <span class="liquid-width">URL:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1424
- <span class="liquid-width">redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1425
- </div>
1426
- </div>
1427
  <?php endif;?>
1428
 
1429
- <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1430
- <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1431
-
1432
  <?php if(!sgRemoveOption('showOnlyOnce')): ?>
1433
  <span class="liquid-width">Show popup this often:</span><input class="input-width-static js-checkbox-acordion" id="js-popup-only-once" type="checkbox" name="repeatPopup" <?php echo $sgRepeatPopup;?>>
1434
  <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show the popup to a user only once.</span><br>
@@ -1500,46 +1522,68 @@ if (isset($_GET["titleError"])): ?>
1500
  <span class="liquid-width">Popup z-index:</span><input class="input-width-static" type="number" name="popup-z-index" value="<?php echo esc_attr($sgPopupZIndex);?>">
1501
  <br>
1502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1503
  <?php if (!sgRemoveOption('popup-content-padding')): ?>
1504
- <span class="liquid-width">Content padding:</span><input class="input-width-static" type="number" name="popup-content-padding" value="<?php echo esc_attr($sgPopupContentPadding);?>">
1505
- <br>
1506
  <?php endif; ?>
1507
 
1508
- <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popupFixed" <?php echo $sgPopupFixed;?> />
1509
- <div class="js-popop-fixeds">
1510
- <span class="fix-wrapper-style" >&nbsp;</span>
1511
- <div class="fixed-wrapper">
1512
- <div class="js-fixed-position-style" id="fixed-position1" data-sgvalue="1"></div>
1513
- <div class="js-fixed-position-style" id="fixed-position2"data-sgvalue="2"></div>
1514
- <div class="js-fixed-position-style" id="fixed-position3" data-sgvalue="3"></div>
1515
- <div class="js-fixed-position-style" id="fixed-position4" data-sgvalue="4"></div>
1516
- <div class="js-fixed-position-style" id="fixed-position5" data-sgvalue="5"></div>
1517
- <div class="js-fixed-position-style" id="fixed-position6" data-sgvalue="6"></div>
1518
- <div class="js-fixed-position-style" id="fixed-position7" data-sgvalue="7"></div>
1519
- <div class="js-fixed-position-style" id="fixed-position8" data-sgvalue="8"></div>
1520
- <div class="js-fixed-position-style" id="fixed-position9" data-sgvalue="9"></div>
1521
- </div>
1522
- </div>
1523
- <input type="hidden" name="fixedPostion" class="js-fixed-postion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
1524
- </div>
1525
- </div>
1526
-
1527
- </div>
1528
- </div>
1529
- </div>
1530
- </div>
1531
  <?php require_once("options_section/pro.php"); ?>
1532
- </div>
1533
- </div>
1534
- <div class="clear"></div>
1535
  <?php
1536
  $isActivePopup = SgPopupGetData::isActivePopup(@$id);
1537
  if(!@$id) $isActivePopup = 'checked';
1538
  ?>
1539
- <input class="sg-hide-element" name="isActiveStatus" data-switch-id="'.$id.'" type="checkbox" <?php echo $isActivePopup; ?> >
1540
- <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
1541
- </div>
1542
- </div>
1543
- </form>
1544
  <?php
1545
- SGFunctions::showInfo();
121
  $beforeScrolingPrsent = @$jsonData['beforeScrolingPrsent'];
122
  $duration = @$jsonData['duration'];
123
  $delay = @$jsonData['delay'];
124
+
125
+ $sgCloseButtonDelay = @$jsonData['buttonDelayValue'];
126
  $sgTheme3BorderColor = @$jsonData['sgTheme3BorderColor'];
127
  $sgTheme3BorderRadius = @$jsonData['sgTheme3BorderRadius'];
128
  $sgThemeCloseText = @$jsonData['theme-close-text'];
299
  $dataPopupId = "-1";
300
  }
301
 
302
+ /* FREE options default values */
303
  $sgPopup = array(
304
  'escKey'=> true,
305
  'closeButton' => true,
328
  'left' => false,
329
  'duration' => 1,
330
  'delay' => 0,
331
+ 'buttonDelayValue' => 0,
332
  'theme-close-text' => 'Close',
333
  'content-click-behavior' => 'close',
334
  'sgTheme3BorderRadius' => 0,
420
  'subs-validation-message' => 'This field is required.',
421
  'subs-btn-progress-title' => 'Please wait...',
422
  'subs-success-behavior' => 'showMessage',
423
+ 'subs-success-redirect-url' => '',
424
+ 'subs-success-popups-list' => '',
425
+ 'subs-first-name-required' => '',
426
+ 'subs-last-name-required' => '',
427
  'subs-success-redirect-new-tab' => false,
428
  'contact-name' => 'Name *',
429
  'contact-name-required' => true,
459
  $repetitivePopup = sgBoolToChecked($sgPopup['repetitivePopup']);
460
  $fblikeDontShowShareButton = sgBoolToChecked($sgPopup['fblike-dont-show-share-button']);
461
  $fblikeClosePopupAfterLike = sgBoolToChecked($sgPopup['fblike-close-popup-after-like']);
462
+
463
+ $buttonDelayValue = $sgPopup['buttonDelayValue'];
464
  $contentClickBehavior = $sgPopup['content-click-behavior'];
465
  $theme3BorderRadius = $sgPopup['sgTheme3BorderRadius'];
466
  $popupZIndex = $sgPopup['popup-z-index'];
600
  $deafultFixed = $sgPopup['fixed'];
601
  $defaultDuration = $sgPopup['duration'];
602
  $defaultDelay = $sgPopup['delay'];
603
+ $defaultButtonDelayValue = $sgPopup['buttonDelayValue'];
604
  $themeCloseText = $sgPopup['theme-close-text'];
605
 
606
  $sgCloseButton = @sgSetChecked($sgCloseButton, $closeButton);
704
  $sgPopupAppearNumberLimit = @sgGetValue($sgPopupAppearNumberLimit, $popupAppearNumberLimit);
705
  $sgRepetitivePopupPeriod = @sgGetValue($sgRepetitivePopupPeriod, $repetitivePopupPeriod);
706
  $delay = @sgGetValue($delay, $defaultDelay);
707
+ $sgCloseButtonDelay = @sgGetValue($sgCloseButtonDelay, $buttonDelayValue);
708
+
709
  $sgInactivityTimout = @sgGetValue($sgInactivityTimout, $inactivityTimout);
710
  $sgContentClickBehavior = @sgGetValue($sgContentClickBehavior, $contentClickBehavior);
711
  $sgPopupStartTimer = @sgGetValue($sgPopupStartTimer, $popupStartTimer);
826
  array(
827
  'name'=>'loggedin-user',
828
  'value'=>'true',
829
+ 'additionalHtml'=>'<span id="sg-radio-logged-in" class="countries-radio-text allow-countries">logged in</span></label>',
830
  'newline' => false
831
  ),
832
  array(
833
  'name'=>'loggedin-user',
834
  'value'=>'false',
835
+ 'additionalHtml'=>'<span id="sg-radio-not-logged-in" class="countries-radio-text">not logged in</span></label>',
836
  'newline' => true
837
  )
838
  );
1210
  @$popup_style_name = ($popup_style_name) ? $popup_style_name : '';
1211
  $str .= "<select name=$name class=$popup_style_name input-width-static >";
1212
  foreach ($options as $key => $option) {
1213
+
1214
  $selected ='';
1215
 
1216
  if ($key == $selecteOption) {
1235
  echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
1236
  }
1237
  if (isset($_GET["titleError"])): ?>
1238
+ <div class="error notice" id="title-error-message">
1239
+ <p>Invalid Title</p>
1240
+ </div>
1241
  <?php endif; ?>
1242
+ <form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php" id="add-form">
1243
+ <?php
1244
+ if(function_exists('wp_nonce_field')) {
1245
+ wp_nonce_field('sgPopupBuilderSave');
1246
+ }
1247
+ ?>
1248
+ <input type="hidden" name="action" value="<?php echo $currentActionName;?>">
1249
+ <div class="crud-wrapper">
1250
+ <div class="cereate-title-wrapper">
1251
+ <div class="sg-title-crud">
1252
  <?php if (isset($id)): ?>
1253
+ <h2>Edit popup</h2>
1254
  <?php else: ?>
1255
+ <h2>Create new popup</h2>
1256
  <?php endif; ?>
1257
  <?php $pageUrl = SgPopupGetData::getPageUrl(); ?>
1258
  </div>
1259
  <div class="button-wrapper">
1260
+ <div class="sg-tooltip">
1261
+ <input type="submit" id="sg-save-button" class="button-primary" value="<?php echo 'Save Changes'; ?>">
1262
+ <?php if( !empty($pageUrl)): ?>
1263
+ <input type="button" class="sg-popup-preview button-primary sg-popup-general-option" data-page-url="<?php echo $pageUrl; ?>" value="Preview">
1264
+ <?php endif; ?>
1265
+ <span class="sg-tooltip-text">
1266
+ Liked the preview of your popup?
1267
+ <a href="https://sygnoos.ladesk.com/377214-How-to-insert-popups-on-a-pagepost">Don't forget to insert it in any post/page</a>.
1268
+ </span>
1269
+ </div>
1270
  <?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
1271
  <input class="crud-to-pro" type="button" value="Upgrade to PRO version" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"><div class="clear"></div>
1272
  <?php endif; ?>
1290
  <h3 class="hndle ui-sortable-handle generalTitle" style="cursor: pointer"><span>General</span></h3>
1291
  <div class="generalContent sgSameWidthPostBox">
1292
  <?php require_once($popupFilesPath."/main_section/".$popupType.".php");?>
1293
+ <input type="hidden" name="type" value="<?php echo $popupType;?>">
1294
+ <span class="liquid-width" id="theme-span">Popup theme:</span>
1295
  <?php echo sgCreateSelect($sgPopupTheme,'theme',esc_html(@$sgColorboxTheme));?>
1296
+ <div class="theme1 sg-hide"></div>
1297
+ <div class="theme2 sg-hide"></div>
1298
+ <div class="theme3 sg-hide"></div>
1299
+ <div class="theme4 sg-hide"></div>
1300
+ <div class="theme5 sg-hide"></div>
1301
+ <div class="theme6 sg-hide"></div>
1302
+ <div class="sg-popup-theme-3 themes-suboptions sg-hide">
1303
+ <span class="liquid-width">Border color:</span>
1304
+ <div id="color-picker"><input class="sgOverlayColor" id="sgOverlayColor" type="text" name="sgTheme3BorderColor" value="<?php echo esc_attr(@$sgTheme3BorderColor); ?>" /></div>
1305
+ <br><span class="liquid-width">Border radius:</span>
1306
+ <input class="input-width-percent" type="number" min="0" max="50" name="sgTheme3BorderRadius" value="<?php echo esc_attr(@$sgTheme3BorderRadius); ?>">
1307
+ <span class="span-percent">%</span>
1308
+ </div>
1309
+ <div class="sg-popup-theme-4 themes-suboptions sg-hide">
1310
+ <span class="liquid-width">Close button text:</span>
1311
+ <input type="text" name="theme-close-text" value="<?php echo esc_attr($sgThemeCloseText);?>">
1312
+ </div>
1313
+ </div>
1314
+ </div>
1315
+
1316
+ </div>
1317
+ </div>
1318
+ </div>
1319
+ </div>
1320
+ <div id="effect">
1321
+ <div id="post-body" class="metabox-holder columns-2">
1322
+ <div id="postbox-container-2" class="postbox-container">
1323
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1324
+ <div class="postbox popupBuilder_effect_postbox sgSameWidthPostBox" style="display: block;">
1325
+ <div class="handlediv effectTitle" title="Click to toggle"><br></div>
1326
+ <h3 class="hndle ui-sortable-handle effectTitle" style="cursor: pointer"><span>Effects</span></h3>
1327
+ <div class="effectsContent">
1328
+ <span class="liquid-width">Effect type:</span>
1329
  <?php echo sgCreateSelect($sgPopupEffects,'effect',esc_html(@$effect));?>
1330
+ <span class="js-preview-effect"></span>
1331
+ <div class="effectWrapper"><div id="effectShow" ></div></div>
1332
+
1333
+ <span class="liquid-width">Effect duration:</span>
1334
+ <input class="input-width-static" type="text" name="duration" value="<?php echo esc_attr($duration); ?>" pattern = "\d+" title="It must be number" /><span class="dashicons dashicons-info contentClick infoImageDuration sameImageStyle"></span><span class="infoDuration samefontStyle">Specify how long the popup appearance animation should take (in sec).</span></br>
1335
+
1336
+ <span class="liquid-width">Popup open sound:</span>
1337
+ <div class="input-width-static sg-display-inline">
1338
+ <input class="input-width-static js-checkbox-sound-option" type="checkbox" name="popupOpenSound" <?php echo $sgPopupOpenSound;?>></div><span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">If this option enabled a sound will play after popup opened.Sound option is not available on mobile devices, as there are restrictions on sound auto-play options for mobile devices.</span><br>
1339
+ <div class="acordion-main-div-content js-checkbox-sound-option-wrapper">
1340
+ <div class="sound-uploader-wrapper">
1341
+ <div class="liquid-width-div sg-vertical-top"><input id="js-upload-open-sound-button" class="button" type="button" value="Change the sound">
1342
+ <button data-default-song="<?php echo $popupOpenSoundFile; ?> " id="reset-to-default" class="button">Reset</button>
1343
+ </div>
1344
+ <input class="input-width-static sg-margin-top-0" id="js-upload-open-sound" type="text" size="36" name="popupOpenSoundFile" value="<?php echo esc_attr($sgPopupOpenSoundFile); ?>" required readonly>
1345
+ <span class="dashicons dashicons-controls-volumeon sg-preview-sound"></span>
1346
+ </div>
1347
+ </div>
1348
+
1349
+ <span class="liquid-width">Popup opening delay:</span>
1350
+ <input class="input-width-static" type="text" name="delay" value="<?php echo esc_attr($delay);?>" pattern = "\d+" title="It must be number"/><span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span><span class="infoDelay samefontStyle">Specify how long the popup appearance should be delayed after loading the page (in sec).</span></br>
1351
+ </div>
1352
+ </div>
1353
+
1354
+ </div>
1355
+ </div>
1356
+ </div>
1357
+ </div>
1358
  <?php
1359
+ require_once($popupFilesPath."/options_section/".$popupType.".php");
1360
+ echo $extensionManagerObj->optionsInclude($popupType);
1361
  ?>
1362
+ </div>
1363
+ <div id="right-main-div">
1364
+ <div id="right-main">
1365
+ <div id="dimentions">
1366
+ <div id="post-body" class="metabox-holder columns-2">
1367
+ <div id="postbox-container-2" class="postbox-container">
1368
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1369
+ <div class="postbox popupBuilder_dimention_postbox sgSameWidthPostBox" style="display: block;">
1370
+ <div class="handlediv dimentionsTitle" title="Click to toggle"><br></div>
1371
+ <h3 class="hndle ui-sortable-handle dimentionsTitle" style="cursor: pointer"><span>Dimensions</span></h3>
1372
+ <div class="dimensionsContent">
1373
+ <div class="sg-radio-option-behavior">
1374
+ <?php $responsiveMode = getResponsiveData($popupType);?>
1375
+ <?php createRadiobuttons($responsiveMode, 'popup-dimension-mode', true, esc_html($sgPopupDimensionMode), "liquid-width");?>
1376
+ </div>
1377
+ <div class="js-accordion-responsiveMode js-radio-accordion sg-accordion-content">
1378
+ <span class="liquid-width">size</span>
1379
+ <?php echo sgCreateSelect($sgResponsiveMeasure,'popup-responsive-dimension-measure',esc_html(@$sgPopupResponsiveDimensionMeasure));?>
1380
+ </div>
1381
+ <div class="js-accordion-customMode js-radio-accordion sg-accordion-content">
1382
+ <span class="liquid-width">Width:</span>
1383
+ <input class="input-width-static" type="text" name="width" value="<?php echo esc_attr($sgWidth); ?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1384
+ <span class="liquid-width">Height:</span>
1385
+ <input class="input-width-static" type="text" name="height" value="<?php echo esc_attr($sgHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1386
+ <span class="liquid-width">Initial width:</span>
1387
+ <input class="input-width-static" type="text" name="initialWidth" value="<?php echo esc_attr($sgInitialWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1388
+ <span class="liquid-width">Initial height:</span>
1389
+ <input class="input-width-static" type="text" name="initialHeight" value="<?php echo esc_attr($sgInitialHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1390
+ </div>
1391
+ <span class="liquid-width">Max width:</span>
1392
+ <input class="input-width-static" type="text" name="maxWidth" value="<?php echo esc_attr($sgMaxWidth);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1393
+ <span class="liquid-width">Max height:</span>
1394
+ <input class="input-width-static" type="text" name="maxHeight" value="<?php echo esc_attr(@$sgMaxHeight);?>" pattern = "\d+(([px]+|%)|)" title="It must be number + px or %" /><img class='errorInfo' src="<?php echo plugins_url('img/info-error.png', dirname(__FILE__).'../') ?>"><span class="validateError">It must be a number + px or %</span><br>
1395
+ </div>
1396
+ </div>
1397
+
1398
+ </div>
1399
+ </div>
1400
+ </div>
1401
+ </div>
1402
+ <div id="options">
1403
+ <div id="post-body" class="metabox-holder columns-2">
1404
+ <div id="postbox-container-2" class="postbox-container">
1405
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1406
+ <div class="postbox popupBuilder_options_postbox sgSameWidthPostBox" style="display: block;">
1407
+ <div class="handlediv optionsTitle" title="Click to toggle"><br></div>
1408
+ <h3 class="hndle ui-sortable-handle optionsTitle" style="cursor: pointer"><span>Options</span></h3>
1409
+ <div class="optionsContent">
1410
+ <span class="liquid-width">Dismiss on &quot;esc&quot; key:</span><input class="input-width-static" type="checkbox" name="escKey" <?php echo $sgEscKey;?>/>
1411
+ <span class="dashicons dashicons-info escKeyImg sameImageStyle"></span><span class="infoEscKey samefontStyle">The popup will be dismissed when user presses on 'esc' key.</span></br>
1412
+
1413
+ <span class="liquid-width" id="createDescribeClose">Show &quot;close&quot; button:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="closeButton" <?php echo $sgCloseButton;?> />
1414
+ <span class="dashicons dashicons-info CloseImg sameImageStyle"></span><span class="infoCloseButton samefontStyle">The popup will contain 'close' button.</span><br>
1415
+
1416
+ <div class="acordion-main-div-content">
1417
+ <span class="liquid-width" style="margin-left: 10px;">&quot;close&quot; button delay:</span>
1418
+ <input class="input-width-static sg-close-button-delay" type="number" min="0" name="buttonDelayValue" value="<?php echo esc_attr($sgCloseButtonDelay);?>" title="It must be number"/>
1419
+ <span class="dashicons dashicons-info contentClick infoImageDelay sameImageStyle"></span>
1420
+ <span class="infoDelay samefontStyle">Add seconds after which the close button will appear.If no seconds are mentioned, the close button will be shown by default.</span></br>
1421
+ </div>
1422
+
1423
+ <span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
1424
+ <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the content is larger than the specified dimensions, then the content will be scrollable.</span><br>
1425
+
1426
+ <span class="liquid-width">Disable page scrolling:</span><input class="input-width-static" type="checkbox" name="disable-page-scrolling" <?php echo $sgDisablePageScrolling; ?>>
1427
+ <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If this option is enabled, the page scrolling will be disabled when the popup is open.</span><br>
1428
+
1429
+ <span class="liquid-width">Enable reposition:</span><input class="input-width-static" type="checkbox" name="reposition" <?php echo $sgReposition;?> />
1430
+ <span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
1431
+
1432
+ <span class="liquid-width">Enable scaling:</span><input class="input-width-static" type="checkbox" name="scaling" <?php echo $sgScaling;?> />
1433
+ <span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScaling samefontStyle">Resize popup according to screen size</span><br>
1434
+
1435
+ <span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
1436
+ <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoOverlayClose samefontStyle">The popup will be dismissed when user clicks beyond of the popup area.</span><br>
1437
 
1438
  <?php if(!sgRemoveOption('contentClick')): ?>
1439
+ <span class="liquid-width">Dismiss on content click:</span><input class="input-width-static js-checkbox-contnet-click" type="checkbox" name="contentClick" <?php echo $sgContentClick;?> />
1440
+ <span class="dashicons dashicons-info contentClick sameImageStyle"></span><span class="infoContentClick samefontStyle">The popup will be dismissed when user clicks inside popup area.</span><br>
1441
+
1442
+ <div class="sg-hide sg-full-width js-content-click-wrraper">
1443
+ <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1444
+ <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1445
+ <span class="liquid-width">URL:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1446
+ <span class="liquid-width">redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1447
+ </div>
1448
+ </div>
1449
  <?php endif;?>
1450
 
1451
+ <span class="liquid-width">Reopen after form submission:</span><input class="input-width-static" type="checkbox" name="reopenAfterSubmission" <?php echo $sgReopenAfterSubmission;?> />
1452
+ <span class="dashicons dashicons-info overlayImg sameImageStyle"></span><span class="infoReopenSubmiting samefontStyle">If checked, the popup will reopen after form submission.</span><br>
1453
+
1454
  <?php if(!sgRemoveOption('showOnlyOnce')): ?>
1455
  <span class="liquid-width">Show popup this often:</span><input class="input-width-static js-checkbox-acordion" id="js-popup-only-once" type="checkbox" name="repeatPopup" <?php echo $sgRepeatPopup;?>>
1456
  <span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Show the popup to a user only once.</span><br>
1522
  <span class="liquid-width">Popup z-index:</span><input class="input-width-static" type="number" name="popup-z-index" value="<?php echo esc_attr($sgPopupZIndex);?>">
1523
  <br>
1524
 
1525
+ <?php if(!sgRemoveOption('popupContentBgImage')): ?>
1526
+ <span class="liquid-width">Popup background image:</span><input class="input-width-static js-popup-content-bg-image" type="checkbox" name="popupContentBgImage" <?php echo $sgPopupContentBgImage;?>><span class="dashicons dashicons-info repeatPopup same-image-style"></span><span class="infoSelectRepeat samefontStyle">Enable this option if you need to have background image for popup.</span><br>
1527
+ <div class="acordion-main-div-content js-popup-content-bg-image-wrapper">
1528
+ <span class="liquid-width">Background size:</span>
1529
+ <?php echo sgCreateSelect($sgPopupBgSizes,'popupContentBackgroundSize',esc_html(@$sgPopupContentBackgroundSize));?>
1530
+ <span class="liquid-width">Background repeat:</span>
1531
+ <?php echo sgCreateSelect($sgPopupBgRepeat,'popupContentBackgroundRepeat',esc_html(@$sgPopupContentBackgroundRepeat));?>
1532
+
1533
+ <div class="sg-wp-editor-container">
1534
+ <div class="liquid-width-div sg-vertical-top">
1535
+ <input id="js-upload-image-button" class="button popup-content-bg-image-btn" type="button" value="Select image">
1536
+ </div>
1537
+ <input class="input-width-static popup-content-bg-image-url" id="js-upload-image" type="text" size="36" name="popupContentBgImageUrl" value="<?php echo esc_attr($sgPopupContentBgImageUrl); ?>" >
1538
+ <span class="liquid-width-div"></span>
1539
+ <div class="show-image-contenier popup-content-bg-image-preview">
1540
+ <span class="no-image">(No image selected)</span>
1541
+ </div>
1542
+ </div>
1543
+
1544
+ </div>
1545
+ <?php endif; ?>
1546
+
1547
  <?php if (!sgRemoveOption('popup-content-padding')): ?>
1548
+ <span class="liquid-width">Content padding:</span><input class="input-width-static" type="number" name="popup-content-padding" value="<?php echo esc_attr($sgPopupContentPadding);?>">
1549
+ <br>
1550
  <?php endif; ?>
1551
 
1552
+ <span class="liquid-width" id="createDescribeFixed">Popup location:</span><input class="input-width-static js-checkbox-acordion" type="checkbox" name="popupFixed" <?php echo $sgPopupFixed;?> />
1553
+ <div class="js-popop-fixeds">
1554
+ <span class="fix-wrapper-style" >&nbsp;</span>
1555
+ <div class="fixed-wrapper">
1556
+ <div class="js-fixed-position-style" id="fixed-position1" data-sgvalue="1"></div>
1557
+ <div class="js-fixed-position-style" id="fixed-position2"data-sgvalue="2"></div>
1558
+ <div class="js-fixed-position-style" id="fixed-position3" data-sgvalue="3"></div>
1559
+ <div class="js-fixed-position-style" id="fixed-position4" data-sgvalue="4"></div>
1560
+ <div class="js-fixed-position-style" id="fixed-position5" data-sgvalue="5"></div>
1561
+ <div class="js-fixed-position-style" id="fixed-position6" data-sgvalue="6"></div>
1562
+ <div class="js-fixed-position-style" id="fixed-position7" data-sgvalue="7"></div>
1563
+ <div class="js-fixed-position-style" id="fixed-position8" data-sgvalue="8"></div>
1564
+ <div class="js-fixed-position-style" id="fixed-position9" data-sgvalue="9"></div>
1565
+ </div>
1566
+ </div>
1567
+ <input type="hidden" name="fixedPostion" class="js-fixed-postion" value="<?php echo esc_attr(@$sgFixedPostion);?>">
1568
+ </div>
1569
+ </div>
1570
+
1571
+ </div>
1572
+ </div>
1573
+ </div>
1574
+ </div>
1575
  <?php require_once("options_section/pro.php"); ?>
1576
+ </div>
1577
+ </div>
1578
+ <div class="clear"></div>
1579
  <?php
1580
  $isActivePopup = SgPopupGetData::isActivePopup(@$id);
1581
  if(!@$id) $isActivePopup = 'checked';
1582
  ?>
1583
+ <input class="sg-hide-element" name="isActiveStatus" data-switch-id="'.$id.'" type="checkbox" <?php echo $isActivePopup; ?> >
1584
+ <input type="hidden" class="button-primary" value="<?php echo esc_attr(@$id);?>" name="hidden_popup_number" />
1585
+ </div>
1586
+ </div>
1587
+ </form>
1588
  <?php
1589
+ SGFunctions::showInfo();
helpers/Integrate_external_settings.php CHANGED
@@ -60,7 +60,7 @@ Class IntegrateExternalSettings {
60
  public static function getCurrentPopupAppPaths($popupType) {
61
 
62
  $pathsArray = array();
63
-
64
  global $wpdb;
65
  $sql = $wpdb->prepare("SELECT paths FROM ". $wpdb->prefix ."sg_popup_addons WHERE name=%s", $popupType);
66
  $ressults = $wpdb->get_results($sql, ARRAY_A);
@@ -94,6 +94,7 @@ Class IntegrateExternalSettings {
94
  'width' => sgSanitize('width'),
95
  'height' => sgSanitize('height'),
96
  'delay' => (int)sgSanitize('delay'),
 
97
  'duration' => (int)sgSanitize('duration'),
98
  'effect' => sgSanitize('effect'),
99
  'escKey' => sgSanitize('escKey'),
@@ -198,4 +199,4 @@ Class IntegrateExternalSettings {
198
 
199
  return $options;
200
  }
201
- }
60
  public static function getCurrentPopupAppPaths($popupType) {
61
 
62
  $pathsArray = array();
63
+
64
  global $wpdb;
65
  $sql = $wpdb->prepare("SELECT paths FROM ". $wpdb->prefix ."sg_popup_addons WHERE name=%s", $popupType);
66
  $ressults = $wpdb->get_results($sql, ARRAY_A);
94
  'width' => sgSanitize('width'),
95
  'height' => sgSanitize('height'),
96
  'delay' => (int)sgSanitize('delay'),
97
+ 'buttonDelayValue' => (int)sgSanitize('buttonDelayValue'),
98
  'duration' => (int)sgSanitize('duration'),
99
  'effect' => sgSanitize('effect'),
100
  'escKey' => sgSanitize('escKey'),
199
 
200
  return $options;
201
  }
202
+ }
javascript/sg_popup_backend.js CHANGED
@@ -652,4 +652,4 @@ beckend.prototype.popupPreview = function () {
652
  jQuery(document).ready(function($){
653
  var sgBeckeendObj = new beckend();
654
  sgBeckeendObj.sgInit();
655
- });
652
  jQuery(document).ready(function($){
653
  var sgBeckeendObj = new beckend();
654
  sgBeckeendObj.sgInit();
655
+ });
javascript/sg_popup_frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- function SGPopup() {
2
 
3
  this.positionLeft = '';
4
  this.positionTop = '';
@@ -476,10 +476,10 @@ SGPopup.prototype.showPopup = function (id, isOnLoad) {
476
  return;
477
  }
478
 
479
- this.popupData = SG_POPUP_DATA[id];
480
- if (typeof this.popupData == "undefined") {
481
  return;
482
  }
 
483
  this.popupType = this.popupData['type'];
484
  this.isOnLoad = isOnLoad;
485
  this.openOnce = this.varToBool(this.popupData['repeatPopup']);
@@ -753,6 +753,14 @@ SGPopup.prototype.contentClickRedirect = function () {
753
  });
754
  };
755
 
 
 
 
 
 
 
 
 
756
  SGPopup.prototype.htmlIframeFilterForOpen = function (popupEventName) {
757
 
758
  var popupId = this.popupData['id'];
@@ -788,6 +796,8 @@ SGPopup.prototype.colorboxEventsListener = function () {
788
  var popupContentBackgroundRepeat = this.popupData['popupContentBackgroundRepeat'];
789
  var repetitivePopup = this.popupData['repetitivePopup'];
790
  var repetitivePopupPeriod = this.popupData['repetitivePopupPeriod'];
 
 
791
  repetitivePopupPeriod = parseInt(repetitivePopupPeriod)*1000;
792
  var repetitiveTimeout = null;
793
 
@@ -810,10 +820,15 @@ SGPopup.prototype.colorboxEventsListener = function () {
810
  that.htmlIframeFilterForOpen('open');
811
  }
812
 
 
 
 
 
 
813
  if(that.popupContentClick) {
814
  that.contentClickRedirect();
815
  }
816
-
817
  clearInterval(repetitiveTimeout);
818
  if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
819
  /*
1
+ function SGPopup() {
2
 
3
  this.positionLeft = '';
4
  this.positionTop = '';
476
  return;
477
  }
478
 
479
+ if (typeof SG_POPUP_DATA[id] == "undefined") {
 
480
  return;
481
  }
482
+ this.popupData = SG_POPUP_DATA[id];
483
  this.popupType = this.popupData['type'];
484
  this.isOnLoad = isOnLoad;
485
  this.openOnce = this.varToBool(this.popupData['repeatPopup']);
753
  });
754
  };
755
 
756
+ SGPopup.prototype.closeButtonDelay = function (buttonDelayValue) {
757
+ setTimeout(function(){
758
+ jQuery('#sgcboxClose').attr('style', 'display: block !important;');
759
+ },
760
+ buttonDelayValue * 1000 /* received values covert to seconds */
761
+ );
762
+ }
763
+
764
  SGPopup.prototype.htmlIframeFilterForOpen = function (popupEventName) {
765
 
766
  var popupId = this.popupData['id'];
796
  var popupContentBackgroundRepeat = this.popupData['popupContentBackgroundRepeat'];
797
  var repetitivePopup = this.popupData['repetitivePopup'];
798
  var repetitivePopupPeriod = this.popupData['repetitivePopupPeriod'];
799
+ var buttonDelayValue = this.popupData['buttonDelayValue'];
800
+ /*this.popupCloseButton*/
801
  repetitivePopupPeriod = parseInt(repetitivePopupPeriod)*1000;
802
  var repetitiveTimeout = null;
803
 
820
  that.htmlIframeFilterForOpen('open');
821
  }
822
 
823
+ /* if close button is set to be shown and has delay value */
824
+ if (that.popupCloseButton && buttonDelayValue) {
825
+ that.closeButtonDelay(buttonDelayValue);
826
+ }
827
+
828
  if(that.popupContentClick) {
829
  that.contentClickRedirect();
830
  }
831
+
832
  clearInterval(repetitiveTimeout);
833
  if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
834
  /*
popup-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: http://sygnoos.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: 2.6.4.5.1
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: http://sygnoos.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: 2.6.4.6
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
readme.txt CHANGED
@@ -166,6 +166,12 @@ Go to the Popup Builder settings and set your desired options.
166
 
167
  == Changelog ==
168
 
 
 
 
 
 
 
169
  = Version 2.6.4.5.1 =
170
  * HOTFIX
171
 
@@ -730,7 +736,7 @@ Leave us a good review :)
730
 
731
  == Upgrade Notice ==
732
 
733
- Current Version of Popup Builder is 2.6.4.4
734
 
735
  == Other Notes ==
736
 
166
 
167
  == Changelog ==
168
 
169
+ = Version 2.6.4.6 =
170
+ * Added a new option, to show the popup close button with configurable delay option.
171
+ * Added tooltip next to Preview button, to show how to setup popup in page or post.
172
+ * Bug fixed connected to Popup Type inside the JS variable.
173
+ * Code optimization and typo fixes.
174
+
175
  = Version 2.6.4.5.1 =
176
  * HOTFIX
177
 
736
 
737
  == Upgrade Notice ==
738
 
739
+ Current Version of Popup Builder is 2.6.4.6
740
 
741
  == Other Notes ==
742
 
style/sg_popup_style.css CHANGED
@@ -1605,6 +1605,58 @@ div.popup-content-bg-image-preview {
1605
  min-width: 165px !important;
1606
  }
1607
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1608
  @media(max-width: 1042px) {
1609
  .sg-black-info {
1610
  width: 200px;
1605
  min-width: 165px !important;
1606
  }
1607
 
1608
+ .sg-tooltip {
1609
+ float: right;
1610
+ position: relative;
1611
+ display: inline-block;
1612
+ }
1613
+
1614
+ .sg-tooltip .sg-tooltip-text {
1615
+ visibility: hidden;
1616
+ width: 100%;
1617
+ background-color: #252B32;
1618
+ color: #fff;
1619
+ text-align: center;
1620
+ border-radius: 6px;
1621
+ padding: 5px 0;
1622
+ /* Position the tooltip */
1623
+ position: absolute;
1624
+ z-index: 1;
1625
+ top: 114%;
1626
+ left: 14%;
1627
+ margin-left: -60px;
1628
+ }
1629
+
1630
+ .sg-tooltip .sg-tooltip-text a {
1631
+ color: #1ac6ff;
1632
+ }
1633
+
1634
+ .sg-tooltip .sg-tooltip-text a:hover {
1635
+ color: #0085BA;
1636
+ }
1637
+
1638
+ .sg-tooltip:hover .sg-tooltip-text {
1639
+ visibility: visible;
1640
+ }
1641
+
1642
+ .sg-tooltip-text::after {
1643
+ content: "";
1644
+ position: absolute;
1645
+ bottom: 100%;
1646
+ left: 29%;
1647
+ margin-left: -5px;
1648
+ border-width: 5px;
1649
+ border-style: solid;
1650
+ border-color: transparent transparent #23282D transparent;
1651
+ }
1652
+
1653
+ .sg-close-button-delay {
1654
+ width: 8%;
1655
+ margin-left: -45px;
1656
+ min-width: 20px;
1657
+ max-width: 50px;
1658
+ }
1659
+
1660
  @media(max-width: 1042px) {
1661
  .sg-black-info {
1662
  width: 200px;