Popup Builder – Responsive WordPress Pop up - Version 2.4.0

Version Description

Current Version of Popup Builder is 2.3.9

Download this release

Release Info

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

Code changes from version 2.3.9.1 to 2.4.0

config.php CHANGED
@@ -9,7 +9,7 @@ define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
9
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
10
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
11
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
12
- define('SG_POPUP_VERSION', 2.391);
13
  define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
14
  define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
15
  define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
9
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
10
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
11
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
12
+ define('SG_POPUP_VERSION', 2.40);
13
  define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
14
  define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
15
  define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
files/sg_popup_create_new.php CHANGED
@@ -97,6 +97,7 @@
97
  $sgContentClick = @$jsonData['contentClick'];
98
  $sgContentClickBehavior = @$jsonData['content-click-behavior'];
99
  $sgClickRedirectToUrl = @$jsonData['click-redirect-to-url'];
 
100
  $sgOpacity = @$jsonData['opacity'];
101
  $sgPopupFixed = @$jsonData['popupFixed'];
102
  $sgFixedPostion = @$jsonData['fixedPostion'];
@@ -287,6 +288,7 @@
287
  'repetPopup' => false,
288
  'disablePopup' => false,
289
  'disablePopupOverlay' => false,
 
290
  'autoClosePopup' => false,
291
  'fbStatus' => true,
292
  'twitterStatus' => true,
@@ -451,6 +453,7 @@
451
  $contactFailMessage = $popupProDefaultValues['contact-fail-message'];
452
  $overlayCustomClasss = $popupProDefaultValues['overlay-custom-classs'];
453
  $contentCustomClasss = $popupProDefaultValues['content-custom-classs'];
 
454
 
455
  function sgBoolToChecked($var)
456
  {
@@ -526,6 +529,7 @@
526
  $sgContactSubjectStatus = @sgSetChecked($sgContactSubjectStatus, $contactSubjectStatus);
527
  $sgContactSubjectRequired = @sgSetChecked($sgContactSubjectRequired, $contactSubjectRequired);
528
  $sgShowFormToTop = @sgSetChecked($sgShowFormToTop, $showFormToTop);
 
529
 
530
  function sgSetChecked($optionsParam,$defaultOption)
531
  {
@@ -1145,6 +1149,7 @@
1145
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1146
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1147
  <span class="liquid-width">Url:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
 
1148
  </div>
1149
  </div>
1150
 
97
  $sgContentClick = @$jsonData['contentClick'];
98
  $sgContentClickBehavior = @$jsonData['content-click-behavior'];
99
  $sgClickRedirectToUrl = @$jsonData['click-redirect-to-url'];
100
+ $sgRedirectToNewTab = @$jsonData['redirect-to-new-tab'];
101
  $sgOpacity = @$jsonData['opacity'];
102
  $sgPopupFixed = @$jsonData['popupFixed'];
103
  $sgFixedPostion = @$jsonData['fixedPostion'];
288
  'repetPopup' => false,
289
  'disablePopup' => false,
290
  'disablePopupOverlay' => false,
291
+ 'redirect-to-new-tab' => true,
292
  'autoClosePopup' => false,
293
  'fbStatus' => true,
294
  'twitterStatus' => true,
453
  $contactFailMessage = $popupProDefaultValues['contact-fail-message'];
454
  $overlayCustomClasss = $popupProDefaultValues['overlay-custom-classs'];
455
  $contentCustomClasss = $popupProDefaultValues['content-custom-classs'];
456
+ $redirectToNewTab = $popupProDefaultValues['redirect-to-new-tab'];
457
 
458
  function sgBoolToChecked($var)
459
  {
529
  $sgContactSubjectStatus = @sgSetChecked($sgContactSubjectStatus, $contactSubjectStatus);
530
  $sgContactSubjectRequired = @sgSetChecked($sgContactSubjectRequired, $contactSubjectRequired);
531
  $sgShowFormToTop = @sgSetChecked($sgShowFormToTop, $showFormToTop);
532
+ $sgRedirectToNewTab = @sgSetChecked($sgRedirectToNewTab, $redirectToNewTab);
533
 
534
  function sgSetChecked($optionsParam,$defaultOption)
535
  {
1149
  <?php echo createRadiobuttons($contentClickOptions, "content-click-behavior", true, esc_html($sgContentClickBehavior), "liquid-width"); ?>
1150
  <div class="sg-hide js-readio-buttons-acordion-content sg-full-width">
1151
  <span class="liquid-width">Url:</span><input class="input-width-static" type="text" name='click-redirect-to-url' value="<?php echo esc_attr(@$sgClickRedirectToUrl); ?>">
1152
+ <span class="liquid-width">Redirect to new tab:</span><input type="checkbox" name="redirect-to-new-tab" <?php echo $sgRedirectToNewTab; ?> >
1153
  </div>
1154
  </div>
1155
 
helpers/Integrate_external_settings.php CHANGED
@@ -76,6 +76,7 @@ Class IntegrateExternalSettings {
76
  'contentClick' => sgSanitize('contentClick'),
77
  'content-click-behavior' => sgSanitize('content-click-behavior'),
78
  'click-redirect-to-url' => sgSanitize('click-redirect-to-url'),
 
79
  'opacity' => sgSanitize('opacity'),
80
  'sgOverlayColor' => sgSanitize('sgOverlayColor'),
81
  'sg-content-background-color' => sgSanitize('sg-content-background-color'),
76
  'contentClick' => sgSanitize('contentClick'),
77
  'content-click-behavior' => sgSanitize('content-click-behavior'),
78
  'click-redirect-to-url' => sgSanitize('click-redirect-to-url'),
79
+ 'redirect-to-new-tab' => sgSanitize('redirect-to-new-tab'),
80
  'opacity' => sgSanitize('opacity'),
81
  'sgOverlayColor' => sgSanitize('sgOverlayColor'),
82
  'sg-content-background-color' => sgSanitize('sg-content-background-color'),
javascript/sg_popup_frontend.js CHANGED
@@ -23,7 +23,7 @@ SGPopup.prototype.popupOpenById = function(popupId) {
23
  autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup']: '';
24
  popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer']: '';
25
  sgPoupFrontendObj = new SGPopup();
26
-
27
  if(sgOnScrolling) {
28
  sgPoupFrontendObj.onScrolling(popupId);
29
  }
@@ -50,7 +50,7 @@ SGPopup.prototype.init = function() {
50
  ++sgEventExecuteCount;
51
  if(sgEventExecuteCount > 1) {
52
  return;
53
- }
54
  var sgPopupID = jQuery(this).attr("data-sgpopupid");
55
  that.showPopup(sgPopupID,false);
56
  });
@@ -60,10 +60,64 @@ SGPopup.prototype.init = function() {
60
  jQuery("[class*='sg-popup-id-']").each(function() {
61
  jQuery(this).bind("click", function() {
62
  var className = jQuery(this).attr("class");
63
- var sgPopupID = className.split("sg-popup-id-")['1'];
64
- that.showPopup(sgPopupID,false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  })
66
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
 
69
  SGPopup.prototype.sgCustomizeThemes = function(popupId) {
@@ -83,7 +137,7 @@ SGPopup.prototype.sgCustomizeThemes = function(popupId) {
83
  SGPopup.prototype.onCompleate = function() {
84
 
85
  jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function() {
86
-
87
  /* Scroll only inside popup */
88
  jQuery('#sgcboxLoadedContent').isolatedScroll();
89
  });
@@ -146,8 +200,11 @@ SGPopup.prototype.canOpenPopup = function(id, openOnce, isOnLoad) {
146
  return true;
147
  }
148
  /*If user already subscribed don't show popup for that user*/
149
- if(typeof jQuery.cookie != 'undefined' && typeof jQuery.cookie("subscription"+id) != "undefined") {
150
- return false;
 
 
 
151
  }
152
  if(openOnce && typeof jQuery.cookie('sgPopupDetails'+id) != 'undefined') {
153
  return this.canOpenOnce(id);
@@ -176,9 +233,9 @@ SGPopup.prototype.getPositionPercent = function(needPercent, screenDimension, di
176
  }
177
 
178
  SGPopup.prototype.decodeBase64 = function(s) {
179
- if(typeof window.atob == 'function') {
180
- return decodeURIComponent(escape(window.atob(s)));
181
- }
182
 
183
  var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
184
  var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -245,7 +302,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
245
  var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
246
  var saveCookiePageLevel = that.varToBool(that.popupData['save-cookie-page-level']);
247
  popupClosingTimer = that.popupData['popupClosingTimer'];
248
-
249
  if(popupScaling) {
250
  that.sgPopupScaling();
251
  }
@@ -271,6 +328,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
271
  var popupEffect = that.popupData['effect'];
272
  var contentClickBehavior = that.popupData['content-click-behavior'];
273
  var clickRedirectToUrl = that.popupData['click-redirect-to-url'];
 
274
  var pushToBottom = that.popupData['pushToBottom'];
275
  var onceExpiresTime = parseInt(that.popupData['onceExpiresTime']);
276
  var sgType = that.popupData['type'];
@@ -294,9 +352,9 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
294
  if(popupHtml != ' ') {
295
  popupHtml = that.decodeBase64(popupHtml);
296
  }
297
-
298
  if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
299
-
300
  jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();');
301
  }
302
  if (popupIframeUrl) {
@@ -414,7 +472,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
414
 
415
  jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
416
  that.sgCustomizeThemes(that.popupData['id']);
417
-
418
  },
419
  onLoad: function(){
420
  },
@@ -427,13 +485,13 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
427
  if(popupWidth == '' && popupHeight == '') {
428
  jQuery.sgcolorbox.resize();
429
  }
430
-
431
  var sgpopupInit = new SgPopupInit(that.popupData);
432
  sgpopupInit.overallInit();
433
  /* For specific popup Like Countdown AgeRestcion popups */
434
  sgpopupInit.initByPopupType();
435
  that.sgCustomizeThemes(that.popupData['id']);
436
-
437
  },
438
  onCleanup: function() {
439
  jQuery('#sgcolorbox').trigger("sgPopupCleanup", []);
@@ -466,7 +524,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
466
 
467
  jQuery.sgcolorbox(SG_POPUP_SETTINGS);
468
 
469
-
470
  if(countryStatus == true && typeof SgUserData != "undefined") {
471
  jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, { expires: 365});
472
  }
@@ -476,9 +534,9 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
476
  if(!saveCookiePageLevel) {
477
  jQuery.cookie.defaults = {path:'/'};
478
  }
479
-
480
  var currentCookie = jQuery.cookie('sgPopupDetails'+that.popupData['id']);
481
-
482
  if(typeof currentCookie == 'undefined') {
483
  openCounter = 1;
484
  }
@@ -508,9 +566,14 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
508
  jQuery.sgcolorbox.close();
509
  }
510
  else {
511
- window.location = clickRedirectToUrl;
 
 
 
 
 
512
  }
513
-
514
  });
515
  });
516
  }
23
  autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup']: '';
24
  popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer']: '';
25
  sgPoupFrontendObj = new SGPopup();
26
+
27
  if(sgOnScrolling) {
28
  sgPoupFrontendObj.onScrolling(popupId);
29
  }
50
  ++sgEventExecuteCount;
51
  if(sgEventExecuteCount > 1) {
52
  return;
53
+ }
54
  var sgPopupID = jQuery(this).attr("data-sgpopupid");
55
  that.showPopup(sgPopupID,false);
56
  });
60
  jQuery("[class*='sg-popup-id-']").each(function() {
61
  jQuery(this).bind("click", function() {
62
  var className = jQuery(this).attr("class");
63
+ var sgPopupId = that.findPopupIdFromClassNames(className, "sg-popup-id-");
64
+
65
+ that.showPopup(sgPopupId,false);
66
+ })
67
+ });
68
+
69
+ /* When user set popup by class name */
70
+ jQuery("[class*='sg-iframe-popup-']").each(function() {
71
+ var currentLink = jQuery(this);
72
+ jQuery(this).bind("click", function(e) {
73
+ e.preventDefault();
74
+ var className = jQuery(this).attr("class");
75
+
76
+ var sgPopupId = that.findPopupIdFromClassNames(className, "sg-iframe-popup-");
77
+
78
+ /*This update for dynamic open iframe url for same popup*/
79
+ SG_POPUP_DATA[sgPopupId]['iframe'] = currentLink.attr("href");
80
+
81
+ that.showPopup(sgPopupId,false);
82
  })
83
  });
84
+
85
+ jQuery("[class*='sg-confirm-popup-']").each(function() {
86
+ jQuery(this).bind("click", function(e) {
87
+ e.preventDefault();
88
+ var currentLink = jQuery(this);
89
+ var className = jQuery(this).attr("class");
90
+
91
+ var sgPopupId = that.findPopupIdFromClassNames(className, "sg-confirm-popup-");
92
+
93
+ jQuery('#sgcolorbox').bind("sgPopupClose", function() {
94
+ var target = currentLink.attr("target");
95
+
96
+ if(typeof target == 'undefined') {
97
+ target = "self";
98
+ }
99
+ var href = currentLink.attr("href");
100
+
101
+ if(target == "_blank") {
102
+ window.open(href);
103
+ }
104
+ else {
105
+ window.location.href = href;
106
+ }
107
+ });
108
+ that.showPopup(sgPopupId,false);
109
+ })
110
+ });
111
+ }
112
+
113
+ SGPopup.prototype.findPopupIdFromClassNames = function(className, classKey) {
114
+
115
+ var classSplitArray = className.split(classKey);
116
+ var classIdString = classSplitArray['1'];
117
+ /*Get first all number from string*/
118
+ var popupId = classIdString.match(/^\d+/);
119
+
120
+ return popupId;
121
  }
122
 
123
  SGPopup.prototype.sgCustomizeThemes = function(popupId) {
137
  SGPopup.prototype.onCompleate = function() {
138
 
139
  jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function() {
140
+
141
  /* Scroll only inside popup */
142
  jQuery('#sgcboxLoadedContent').isolatedScroll();
143
  });
200
  return true;
201
  }
202
  /*If user already subscribed don't show popup for that user*/
203
+ if(typeof jQuery.cookie != 'undefined') {
204
+
205
+ if(jQuery.cookie("subscription"+id)) {
206
+ return false;
207
+ }
208
  }
209
  if(openOnce && typeof jQuery.cookie('sgPopupDetails'+id) != 'undefined') {
210
  return this.canOpenOnce(id);
233
  }
234
 
235
  SGPopup.prototype.decodeBase64 = function(s) {
236
+ if(typeof window.atob == 'function') {
237
+ return decodeURIComponent(escape(window.atob(s)));
238
+ }
239
 
240
  var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
241
  var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
302
  var popupAutoClosePopup = that.varToBool(that.popupData['autoClosePopup']);
303
  var saveCookiePageLevel = that.varToBool(that.popupData['save-cookie-page-level']);
304
  popupClosingTimer = that.popupData['popupClosingTimer'];
305
+
306
  if(popupScaling) {
307
  that.sgPopupScaling();
308
  }
328
  var popupEffect = that.popupData['effect'];
329
  var contentClickBehavior = that.popupData['content-click-behavior'];
330
  var clickRedirectToUrl = that.popupData['click-redirect-to-url'];
331
+ var redirectToNewTab = that.popupData['redirect-to-new-tab'];
332
  var pushToBottom = that.popupData['pushToBottom'];
333
  var onceExpiresTime = parseInt(that.popupData['onceExpiresTime']);
334
  var sgType = that.popupData['type'];
352
  if(popupHtml != ' ') {
353
  popupHtml = that.decodeBase64(popupHtml);
354
  }
355
+
356
  if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
357
+
358
  jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();');
359
  }
360
  if (popupIframeUrl) {
472
 
473
  jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
474
  that.sgCustomizeThemes(that.popupData['id']);
475
+
476
  },
477
  onLoad: function(){
478
  },
485
  if(popupWidth == '' && popupHeight == '') {
486
  jQuery.sgcolorbox.resize();
487
  }
488
+
489
  var sgpopupInit = new SgPopupInit(that.popupData);
490
  sgpopupInit.overallInit();
491
  /* For specific popup Like Countdown AgeRestcion popups */
492
  sgpopupInit.initByPopupType();
493
  that.sgCustomizeThemes(that.popupData['id']);
494
+
495
  },
496
  onCleanup: function() {
497
  jQuery('#sgcolorbox').trigger("sgPopupCleanup", []);
524
 
525
  jQuery.sgcolorbox(SG_POPUP_SETTINGS);
526
 
527
+
528
  if(countryStatus == true && typeof SgUserData != "undefined") {
529
  jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, { expires: 365});
530
  }
534
  if(!saveCookiePageLevel) {
535
  jQuery.cookie.defaults = {path:'/'};
536
  }
537
+
538
  var currentCookie = jQuery.cookie('sgPopupDetails'+that.popupData['id']);
539
+
540
  if(typeof currentCookie == 'undefined') {
541
  openCounter = 1;
542
  }
566
  jQuery.sgcolorbox.close();
567
  }
568
  else {
569
+ if(!redirectToNewTab) {
570
+ window.location = clickRedirectToUrl;
571
+ }
572
+ else {
573
+ window.open(clickRedirectToUrl);
574
+ }
575
  }
576
+
577
  });
578
  });
579
  }
javascript/sg_popup_init.js CHANGED
@@ -11,7 +11,7 @@ SgPopupInit.prototype.cloneToHtmlPopup = function() {
11
  if(jQuery("#sgpb-all-content-"+currentPopupId).length == 0) {
12
  return;
13
  }
14
-
15
  jQuery('.sg-current-popup-'+currentPopupId).append(this.decodeBase64(jQuery("#sgpb-all-content-"+currentPopupId).html()));
16
 
17
  this.popupResizing(currentPopupId);
@@ -21,9 +21,9 @@ SgPopupInit.prototype.cloneToHtmlPopup = function() {
21
  }
22
 
23
  SgPopupInit.prototype.decodeBase64 = function(s) {
24
- if(typeof window.atob == 'function') {
25
- return decodeURIComponent(escape(window.atob(s)));
26
- }
27
 
28
  var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
29
  var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -56,9 +56,9 @@ SgPopupInit.prototype.shortcodeInPopupContent = function() {
56
  if(typeof sgInsidePopup == 'undefined' || sgInsidePopup != 'on') {
57
  return false;
58
  }
59
-
60
  jQuery.sgcolorbox.close();
61
-
62
  jQuery('#sgcolorbox').bind("sgPopupClose", function() {
63
  if(sgPopupID == '') {
64
  return;
@@ -110,4 +110,4 @@ SgPopupInit.prototype.initByPopupType = function() {
110
  }
111
 
112
  return popupObj;
113
- }
11
  if(jQuery("#sgpb-all-content-"+currentPopupId).length == 0) {
12
  return;
13
  }
14
+
15
  jQuery('.sg-current-popup-'+currentPopupId).append(this.decodeBase64(jQuery("#sgpb-all-content-"+currentPopupId).html()));
16
 
17
  this.popupResizing(currentPopupId);
21
  }
22
 
23
  SgPopupInit.prototype.decodeBase64 = function(s) {
24
+ if(typeof window.atob == 'function') {
25
+ return decodeURIComponent(escape(window.atob(s)));
26
+ }
27
 
28
  var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
29
  var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
56
  if(typeof sgInsidePopup == 'undefined' || sgInsidePopup != 'on') {
57
  return false;
58
  }
59
+
60
  jQuery.sgcolorbox.close();
61
+
62
  jQuery('#sgcolorbox').bind("sgPopupClose", function() {
63
  if(sgPopupID == '') {
64
  return;
110
  }
111
 
112
  return popupObj;
113
+ }
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.3.9.1
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
@@ -86,7 +86,7 @@ function sgRegisterScripts()
86
  wp_enqueue_script('sg_popup_queue');
87
  }
88
  /* For ajax case */
89
- if (defined( 'DOING_AJAX' ) && DOING_AJAX && !is_admin()) {
90
  wp_print_scripts('sg_popup_frontend');
91
  wp_print_scripts('sg_colorbox');
92
  wp_print_scripts('sg_popup_support_plugins');
@@ -270,19 +270,26 @@ function redenderScriptMode($popupId)
270
  function getPopupIdFromContentByClass($content) {
271
 
272
  $popupsID = array();
 
 
 
 
 
273
 
274
- preg_match_all("/sg-popup-id-+[0-9]+/i", $content, $matchers);
275
- /* when popup doesn't exist */
276
- if(empty($matchers['0'])) {
277
- return $popupsID;
278
- }
279
- foreach ($matchers['0'] as $value) {
280
- $ids = explode("sg-popup-id-", $value);
281
- $id = @$ids[1];
282
- if(!empty($id)) {
283
- array_push($popupsID, $id);
284
- }
 
285
  }
 
286
  return $popupsID;
287
  }
288
 
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.4.0
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
86
  wp_enqueue_script('sg_popup_queue');
87
  }
88
  /* For ajax case */
89
+ if (defined( 'DOING_AJAX' ) && DOING_AJAX && !is_admin()) {
90
  wp_print_scripts('sg_popup_frontend');
91
  wp_print_scripts('sg_colorbox');
92
  wp_print_scripts('sg_popup_support_plugins');
270
  function getPopupIdFromContentByClass($content) {
271
 
272
  $popupsID = array();
273
+ $popupClasses = array(
274
+ 'sg-popup-id-',
275
+ 'sg-iframe-popup-',
276
+ 'sg-confirm-popup-'
277
+ );
278
 
279
+ foreach ($popupClasses as $popupClassName) {
280
+
281
+ preg_match_all("/".$popupClassName."+[0-9]+/i", $content, $matchers);
282
+
283
+ foreach ($matchers['0'] as $value) {
284
+ $ids = explode($popupClassName, $value);
285
+ $id = @$ids[1];
286
+
287
+ if(!empty($id)) {
288
+ array_push($popupsID, $id);
289
+ }
290
+ }
291
  }
292
+
293
  return $popupsID;
294
  }
295
 
readme.txt CHANGED
@@ -153,6 +153,12 @@ Go to the Popup Builder settings and set your desired options.
153
 
154
  == Changelog ==
155
 
 
 
 
 
 
 
156
  = Version 2.3.9.1 =
157
  * UTF-8 issue fixed.
158
 
@@ -376,6 +382,18 @@ You can have as many popups as you want on the same page, but you can only set o
376
 
377
  After creating your popup, go to the desired page or post and you will see a meta box below the content editor, with the following title: "Select popup on page load". Select the popup you want to set and then update the page. You are done! After you go to that page/post the popup will get opened automatically.
378
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  **Can I put a popup to show after clicking something?**
380
 
381
  Yes. There is an "Insert popup" button which will insert the popup shortcode over any element (text, image, button, etc.) you want. Just select the element, click on the button, choose a popup and you are done!
153
 
154
  == Changelog ==
155
 
156
+ = Version 2.4.0 =
157
+ * Availability to add popup for external link. Ex.`<a href="https://sygnoos.com/" class="sg-confirm-popup-1">Popup</a>` where 1 is a popup id.
158
+ * Now you can have one iframe popup instance which can load dynamic external URLs. Ex `<a href="https://sygnoos.com/" class="sg-iframe-popup-1">Popup</a>`(PRO)
159
+ * Page level cookie storing. Now you can decide 'Show this often' option will work on a site level or on a page level.
160
+ * Bug fixed and code optimization.
161
+
162
  = Version 2.3.9.1 =
163
  * UTF-8 issue fixed.
164
 
382
 
383
  After creating your popup, go to the desired page or post and you will see a meta box below the content editor, with the following title: "Select popup on page load". Select the popup you want to set and then update the page. You are done! After you go to that page/post the popup will get opened automatically.
384
 
385
+ **Want to insert a popup on a link, that will open up when clicked on the link?**
386
+
387
+ Simply add the following class to it: sg-confirm-popup-#popupid.
388
+ Ex. `<a href="https://sygnoos.com/" class="sg-confirm-popup-1">Popup</a>`
389
+ This will open a popup before a user goes to the page from the link.
390
+
391
+ **Want to open your links inside the popup without redirecting your users to the other site? (PRO)**
392
+
393
+ You can simply create an empty iframe popup and add the following class to your link: sg-iframe-popup-#popupid number.
394
+ Ex. `<a href="https://sygnoos.com/" class="sg-iframe-popup-1">Popup</a>`
395
+ This way, you'll have an iframe popup on your link, so when a user clicks on your link an iframe popup will open up, with the page of the link inside, so the users won't be redirected by the link.
396
+
397
  **Can I put a popup to show after clicking something?**
398
 
399
  Yes. There is an "Insert popup" button which will insert the popup shortcode over any element (text, image, button, etc.) you want. Just select the element, click on the button, choose a popup and you are done!