Popup Builder – Responsive WordPress Pop up - Version 3.43

Version Description

Current Version of Popup Builder is 3.43

Download this release

Release Info

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

Code changes from version 3.42 to 3.43

com/classes/Actions.php CHANGED
File without changes
com/classes/Ajax.php CHANGED
@@ -81,6 +81,10 @@ class Ajax
81
 
82
  public function sgpbAutosave()
83
  {
 
 
 
 
84
  $popupData = SGPopup::parsePopupDataFromData($_POST['allPopupData']);
85
  do_action('save_post_popupbuilder');
86
  $popupType = $popupData['sgpb-type'];
@@ -98,7 +102,7 @@ class Ajax
98
  public function dontShowReviewPopup()
99
  {
100
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
101
- update_option('SGPBCloseReviewPopup', true);
102
  wp_die();
103
  }
104
 
81
 
82
  public function sgpbAutosave()
83
  {
84
+ if (!isset($_POST['allPopupData'])) {
85
+ echo true;
86
+ wp_die();
87
+ }
88
  $popupData = SGPopup::parsePopupDataFromData($_POST['allPopupData']);
89
  do_action('save_post_popupbuilder');
90
  $popupType = $popupData['sgpb-type'];
102
  public function dontShowReviewPopup()
103
  {
104
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
105
+ update_option('SGPBCloseReviewPopup-1', true);
106
  wp_die();
107
  }
108
 
com/classes/Updates.php CHANGED
@@ -87,7 +87,7 @@ class Updates
87
  'version' => $version, // current version number
88
  'license' => $licenseKey, // license key (used get_option above to retrieve from DB)
89
  'item_id' => $license['itemId'], // id of this plugin
90
- 'item_name' => $license['itemName'], // id of this plugin
91
  'author' => $license['autor'], // author of this plugin
92
  'url' => home_url(),
93
  'beta' => false // set to true if you wish customers to receive update notifications of beta releases
87
  'version' => $version, // current version number
88
  'license' => $licenseKey, // license key (used get_option above to retrieve from DB)
89
  'item_id' => $license['itemId'], // id of this plugin
90
+ 'item_name' => $license['itemName'], // name of this plugin
91
  'author' => $license['autor'], // author of this plugin
92
  'url' => home_url(),
93
  'beta' => false // set to true if you wish customers to receive update notifications of beta releases
com/classes/popups/HtmlPopup.php CHANGED
@@ -23,18 +23,10 @@ class HtmlPopup extends SGPopup
23
  {
24
  $htmlContent = '';
25
  $popupContent = $this->getContent();
26
- $htmlContent .= '<div class="sgpb-scroll-wrapper sgpb-main-html-content-wrapper">';
27
  $htmlContent .= $popupContent;
28
  $htmlContent .= '</div>';
29
 
30
- $htmlContent .= '<style>';
31
- $htmlContent .= '.sgpb-popup-builder-content-html {';
32
- $htmlContent .= 'width: 100%;';
33
- $htmlContent .= 'height: 100%;';
34
- $htmlContent .= 'overflow: auto;}';
35
- $htmlContent .= '.sgpb-main-html-content-wrapper{overflow: auto !important;}';
36
- $htmlContent .= '</style>';
37
-
38
  return $htmlContent;
39
  }
40
 
@@ -43,3 +35,4 @@ class HtmlPopup extends SGPopup
43
  return array();
44
  }
45
  }
 
23
  {
24
  $htmlContent = '';
25
  $popupContent = $this->getContent();
26
+ $htmlContent .= '<div class="sgpb-main-html-content-wrapper">';
27
  $htmlContent .= $popupContent;
28
  $htmlContent .= '</div>';
29
 
 
 
 
 
 
 
 
 
30
  return $htmlContent;
31
  }
32
 
35
  return array();
36
  }
37
  }
38
+
com/classes/popups/SGPopup.php CHANGED
@@ -781,7 +781,8 @@ abstract class SGPopup
781
  public static function getPopupOptionsById($popupId, $saveMode = '')
782
  {
783
  $currentPost = get_post($popupId);
784
- if ($currentPost->post_status == 'draft') {
 
785
  $saveMode = '_preview';
786
  }
787
  $optionsData = array();
781
  public static function getPopupOptionsById($popupId, $saveMode = '')
782
  {
783
  $currentPost = get_post($popupId);
784
+
785
+ if (!empty($currentPost) && $currentPost->post_status == 'draft') {
786
  $saveMode = '_preview';
787
  }
788
  $optionsData = array();
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.42');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '3.43');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -809,6 +809,7 @@ class SgpbDataConfig
809
  $options[] = array('name' => 'sgpb-enable-content-scrolling', 'type' => 'checkbox', 'defaultValue' => 'on');
810
  $options[] = array('name' => 'sgpb-overlay-click', 'type' => 'checkbox', 'defaultValue' => 'on');
811
  $options[] = array('name' => 'sgpb-content-click', 'type' => 'checkbox', 'defaultValue' => '');
 
812
  $options[] = array('name' => 'sgpb-content-click-behavior', 'type' => 'text', 'defaultValue' => 'close');
813
  $options[] = array('name' => 'sgpb-click-redirect-to-url', 'type' => 'text', 'defaultValue' => '');
814
  $options[] = array('name' => 'sgpb-redirect-to-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
809
  $options[] = array('name' => 'sgpb-enable-content-scrolling', 'type' => 'checkbox', 'defaultValue' => 'on');
810
  $options[] = array('name' => 'sgpb-overlay-click', 'type' => 'checkbox', 'defaultValue' => 'on');
811
  $options[] = array('name' => 'sgpb-content-click', 'type' => 'checkbox', 'defaultValue' => '');
812
+ $options[] = array('name' => 'sgpb-subs-hide-subs-users', 'type' => 'checkbox', 'defaultValue' => 'on');
813
  $options[] = array('name' => 'sgpb-content-click-behavior', 'type' => 'text', 'defaultValue' => 'close');
814
  $options[] = array('name' => 'sgpb-click-redirect-to-url', 'type' => 'text', 'defaultValue' => '');
815
  $options[] = array('name' => 'sgpb-redirect-to-new-tab', 'type' => 'checkbox', 'defaultValue' => '');
com/helpers/AdminHelper.php CHANGED
@@ -998,11 +998,11 @@ class AdminHelper
998
  $popupContent = '';
999
  $maxOpenPopupStatus = self::shouldOpenForMaxOpenPopupMessage();
1000
 
1001
- if ($maxOpenPopupStatus) {
1002
  $popupContent = self::getMaxOpenPopupsMessage();
1003
  self::addContentToFooter($popupContent);
1004
  return;
1005
- }
1006
 
1007
  $shouldOpenForDays = self::shouldOpenReviewPopupForDays();
1008
 
@@ -1059,6 +1059,9 @@ class AdminHelper
1059
  border:2px solid #03A9F4;
1060
  color: #FFF;
1061
  }
 
 
 
1062
  .sgpb-review-wrapper{
1063
  text-align: center;
1064
  padding: 20px;
@@ -1103,16 +1106,95 @@ class AdminHelper
1103
  return $popupContent;
1104
  }
1105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1106
  public static function shouldOpenReviewPopupForDays()
1107
  {
1108
  $shouldOpen = true;
1109
- $dontShowAgain = get_option('SGPBCloseReviewPopup');
1110
  $periodNextTime = get_option('SGPBOpenNextTime');
1111
 
1112
- if ($dontShowAgain) {
 
 
 
1113
  return false;
1114
  }
1115
-
1116
  // When period next time does not exits it means the user is old
1117
  if (!$periodNextTime) {
1118
  $usageDays = self::getPopupMainTableCreationDate();
@@ -1168,6 +1250,7 @@ class AdminHelper
1168
 
1169
  public static function addContentToBanner($popupContent)
1170
  {
 
1171
  echo '<div class="sgpb-wrapper sgpb-review-popup-banner-wrapper">'.$popupContent.'</div>';
1172
  }
1173
 
@@ -1201,7 +1284,7 @@ class AdminHelper
1201
  if (empty($counterMaxPopup)) {
1202
  return false;
1203
  }
1204
- $dontShowAgain = get_option('SGPBCloseReviewPopup');
1205
  $maxCountDefine = get_option('SGPBMaxOpenCount');
1206
 
1207
  if (!$maxCountDefine) {
@@ -1667,4 +1750,18 @@ class AdminHelper
1667
 
1668
  return array();
1669
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1670
  }
998
  $popupContent = '';
999
  $maxOpenPopupStatus = self::shouldOpenForMaxOpenPopupMessage();
1000
 
1001
+ /*if ($maxOpenPopupStatus) {
1002
  $popupContent = self::getMaxOpenPopupsMessage();
1003
  self::addContentToFooter($popupContent);
1004
  return;
1005
+ }*/
1006
 
1007
  $shouldOpenForDays = self::shouldOpenReviewPopupForDays();
1008
 
1059
  border:2px solid #03A9F4;
1060
  color: #FFF;
1061
  }
1062
+ .sgpb-buttons-wrapper {
1063
+ text-align: center;
1064
+ }
1065
  .sgpb-review-wrapper{
1066
  text-align: center;
1067
  padding: 20px;
1106
  return $popupContent;
1107
  }
1108
 
1109
+ public static function getReviewBannerContent()
1110
+ {
1111
+ ob_start();
1112
+ ?>
1113
+ <style>
1114
+ .sgpb-buttons-wrapper .press{
1115
+ box-sizing:border-box;
1116
+ cursor:pointer;
1117
+ display:inline-block;
1118
+ font-size:1em;
1119
+ margin:0;
1120
+ padding:0.5em 0.75em;
1121
+ text-decoration:none;
1122
+ transition:background 0.15s linear
1123
+ }
1124
+ .sgpb-buttons-wrapper .press-grey {
1125
+ background-color:#9E9E9E;
1126
+ border:2px solid #9E9E9E;
1127
+ color: #FFF;
1128
+ }
1129
+ .sgpb-buttons-wrapper .press-lightblue {
1130
+ background-color:#03A9F4;
1131
+ border:2px solid #03A9F4;
1132
+ color: #FFF;
1133
+ }
1134
+ .sgpb-review-wrapper .sgpb-buttons-wrapper {
1135
+ text-align: center;
1136
+ }
1137
+ .sgpb-review-wrapper{
1138
+ text-align: center;
1139
+ padding: 20px;
1140
+ padding-top: 0;
1141
+ }
1142
+ .sgpb-review-wrapper p {
1143
+ color: black;
1144
+ }
1145
+ .sgpb-review-h1 {
1146
+ font-size: 22px;
1147
+ font-weight: normal;
1148
+ line-height: 1.384;
1149
+ }
1150
+ .sgrb-review-h2 {
1151
+ font-size: 20px;
1152
+ font-weight: normal;
1153
+ margin-top: 0 !important;
1154
+ }
1155
+ :root {
1156
+ --main-bg-color: #1ac6ff;
1157
+ }
1158
+ .sgrb-review-strong{
1159
+ color: var(--main-bg-color);
1160
+ }
1161
+ .sgrb-review-mt20{
1162
+ margin-top: 20px
1163
+ }
1164
+ .sgpb-review-description h1:first-child {
1165
+ font-size: 30px !important;
1166
+ }
1167
+ </style>
1168
+ <div class="sgpb-review-wrapper">
1169
+ <div class="sgpb-review-description">
1170
+ <h1 class="sgpb-review-h1"><strong class="sgrb-review-strong"><?php _e('Wow!', SG_POPUP_TEXT_DOMAIN); ?></strong></h1>
1171
+ <h1 class="sgpb-review-h1"><?php _e('You\'ve got a lot of conversion with Popup Builder! Congratulations!', SG_POPUP_TEXT_DOMAIN); ?></h1>
1172
+ <h2 class="sgrb-review-h2"><?php _e('Share your positive feedback to keep our service up for better results!', SG_POPUP_TEXT_DOMAIN); ?></h2>
1173
+ </div>
1174
+ <div class="sgpb-buttons-wrapper">
1175
+ <button class="press press-grey sgpb-button-1 sg-already-did-review"><?php _e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1176
+ <button class="press press-lightblue sgpb-button-3 sg-you-worth-it"><?php _e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1177
+ <button class="press press-grey sgpb-button-2 sg-show-popup-period" data-message-type="hide"><?php _e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
1178
+ <div> </div>
1179
+ </div>
1180
+ <?php
1181
+ $popupContent = ob_get_clean();
1182
+
1183
+ return $popupContent;
1184
+ }
1185
+
1186
  public static function shouldOpenReviewPopupForDays()
1187
  {
1188
  $shouldOpen = true;
1189
+ $dontShowAgain = get_option('SGPBCloseReviewPopup-1');
1190
  $periodNextTime = get_option('SGPBOpenNextTime');
1191
 
1192
+ if (!$dontShowAgain) {
1193
+ return true;
1194
+ }
1195
+ else {
1196
  return false;
1197
  }
 
1198
  // When period next time does not exits it means the user is old
1199
  if (!$periodNextTime) {
1200
  $usageDays = self::getPopupMainTableCreationDate();
1250
 
1251
  public static function addContentToBanner($popupContent)
1252
  {
1253
+ $popupContent = self::getReviewBannerContent();
1254
  echo '<div class="sgpb-wrapper sgpb-review-popup-banner-wrapper">'.$popupContent.'</div>';
1255
  }
1256
 
1284
  if (empty($counterMaxPopup)) {
1285
  return false;
1286
  }
1287
+ $dontShowAgain = get_option('SGPBCloseReviewPopup-1');
1288
  $maxCountDefine = get_option('SGPBMaxOpenCount');
1289
 
1290
  if (!$maxCountDefine) {
1750
 
1751
  return array();
1752
  }
1753
+
1754
+ public static function removeAllNonPrintableCharacters($title, $defaultValue)
1755
+ {
1756
+ $titleRes = $title;
1757
+ $pattern ='/[\\\^£$%&*()}{@#~?><>,|=_+¬-]/';
1758
+ $title = preg_replace($pattern, '', $title);
1759
+ $title = mb_ereg_replace($pattern, '', $title);
1760
+ $title = htmlspecialchars($title, ENT_IGNORE, 'UTF-8');
1761
+ if (empty(str_replace(' ', '', $title))) {
1762
+ $titleRes = $defaultValue;
1763
+ }
1764
+
1765
+ return $titleRes;
1766
+ }
1767
  }
com/helpers/Functions.php CHANGED
@@ -77,7 +77,7 @@ class Functions
77
  }
78
  }
79
 
80
- if (!$formField['isShow']) {
81
  $hideClassName = 'sg-js-hide';
82
  }
83
 
77
  }
78
  }
79
 
80
+ if (!isset($formField['isShow'])) {
81
  $hideClassName = 'sg-js-hide';
82
  }
83
 
popup-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
- * Version: 3.42
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.43
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/js/MediaButton.js CHANGED
@@ -14,7 +14,7 @@ jQuery(window).bind('sgpbDidOpen',function(){that.closingActions(popup);});};SGP
14
  {jQuery('.sg-already-did-review').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
15
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}});});});jQuery('.sg-you-worth-it').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
16
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}
17
- window.location=SGPB_JS_EXTENSIONS_PARAMS.reviewUrl;});});});jQuery('.sg-show-popup-period').click(function(){var messageType=jQuery(this).attr('data-message-type');var ajaxData={action:'sgpb_change_review_popup_show_period',messageType:messageType,nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
18
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}})});jQuery('.sgpb-dont-show-ask-review-popup').click(function(){var ajaxData={action:'sgpb_hide_ask_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(res){popup.close();}})});}
19
  SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
20
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.closeReviewPopup=function(popup)
@@ -34,4 +34,4 @@ jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_ed
34
  {if(!jQuery('.js-sg-select2').length){return;}
35
  jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){if(typeof SGPB_JS_PARAMS=='undefined'){return;}
36
  options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
37
- jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});});
14
  {jQuery('.sg-already-did-review').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
15
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}});});});jQuery('.sg-you-worth-it').each(function(){jQuery(this).click(function(){var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
16
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}
17
+ window.location=SGPB_JS_EXTENSIONS_PARAMS.reviewUrl;});});});jQuery('.sg-show-popup-period').click(function(){jQuery('.sgpb-review-popup-banner-wrapper').remove();var messageType=jQuery(this).attr('data-message-type');var ajaxData={action:'sgpb_change_review_popup_show_period',messageType:messageType,nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(typeof popup!='undefined'){popup.close();}
18
  if(jQuery('.sgpb-review-popup-banner-wrapper').length){jQuery('.sgpb-review-popup-banner-wrapper').remove();}})});jQuery('.sgpb-dont-show-ask-review-popup').click(function(){var ajaxData={action:'sgpb_hide_ask_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(res){popup.close();}})});}
19
  SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
20
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.closeReviewPopup=function(popup)
34
  {if(!jQuery('.js-sg-select2').length){return;}
35
  jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){if(typeof SGPB_JS_PARAMS=='undefined'){return;}
36
  options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
37
+ jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});mediaButton.openAskReviewBannerPopup();});
public/js/Newsletter.js CHANGED
File without changes
public/js/PopupBuilder.js CHANGED
@@ -1134,6 +1134,7 @@ SGPBPopup.prototype.htmlIframeFilterForOpen = function(popupId, popupEventName)
1134
  }
1135
 
1136
  popupContent.find('iframe').each(function() {
 
1137
  if (popupEventName != 'open') {
1138
  /* for do not affect facebook type buttons iframe only */
1139
  if (jQuery(this).closest('.fb_iframe_widget').length) {
@@ -1157,7 +1158,6 @@ SGPBPopup.prototype.htmlIframeFilterForOpen = function(popupId, popupEventName)
1157
  }
1158
  return true;
1159
  }
1160
-
1161
  }
1162
  else {
1163
  /*open*/
@@ -1166,6 +1166,7 @@ SGPBPopup.prototype.htmlIframeFilterForOpen = function(popupId, popupEventName)
1166
  if (src != '') {
1167
  jQuery(this).attr('data-attr-src', src);
1168
  }
 
1169
  return true;
1170
  }
1171
  else {
@@ -1180,6 +1181,27 @@ SGPBPopup.prototype.htmlIframeFilterForOpen = function(popupId, popupEventName)
1180
  });
1181
  };
1182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  SGPBPopup.prototype.getSearchDataFromContent = function(content)
1184
  {
1185
  var pattern = /\[(\[?)(pbvariable)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]\*+(?:\[(?!\/\2\])[^\[]\*+)\*+)\[\/\2\])?)(\]?)/gi;
@@ -1208,7 +1230,6 @@ SGPBPopup.prototype.replaceWithCustomShortcode = function(popupId)
1208
  {
1209
  var currentHtmlContent = jQuery('.sgpb-content-'+popupId).html();
1210
  var searchData = this.getSearchDataFromContent(currentHtmlContent);
1211
-
1212
  var that = this;
1213
 
1214
  if (!searchData.length) {
@@ -1242,7 +1263,6 @@ SGPBPopup.prototype.replaceWithCustomShortcode = function(popupId)
1242
  var replaceName = jQuery(searchAttributes['selector']).attr(searchAttributes['attribute']);
1243
  }
1244
 
1245
-
1246
  if (typeof replaceName == 'undefined') {
1247
  that.replaceShortCode(currentSearchData['replaceString'], '', popupId);
1248
  continue;
@@ -1273,9 +1293,9 @@ SGPBPopup.prototype.replaceShortCode = function(shortCode, replaceText, popupId)
1273
  return false;
1274
  }
1275
 
1276
- currentHtmlContent.html(function(i, v) {
1277
  if (typeof v != 'undefined') {
1278
- return v.replace(shortCode, replaceText);
1279
  }
1280
  });
1281
  });
@@ -1291,6 +1311,7 @@ SGPBPopup.prototype.popupTriggeringListeners = function()
1291
 
1292
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
1293
  var args = e.detail;
 
1294
  that.formSubmissionDetection(args);
1295
  var popupOptions = args.popupData;
1296
 
@@ -1305,6 +1326,7 @@ SGPBPopup.prototype.popupTriggeringListeners = function()
1305
  if (SGPBPopup.varToBool(disablePageScrolling)) {
1306
  jQuery('html, body').addClass('sgpb-overflow-hidden');
1307
  }
 
1308
  });
1309
 
1310
  sgAddEvent(window, 'sgpbWillOpen', function(e) {
@@ -2169,8 +2191,8 @@ SGPBPopup.setCookie = function(cName, cValue, exDays, cPageLevel)
2169
  }
2170
  var expires = 'expires='+cookieExpirationData;
2171
  if (exDays == -1) {
2172
- expires = '';
2173
- }
2174
 
2175
  if (cPageLevel && typeof cPageLevel != 'boolean') {
2176
  cookiePageLevel = 'path=' + cPageLevel;
1134
  }
1135
 
1136
  popupContent.find('iframe').each(function() {
1137
+
1138
  if (popupEventName != 'open') {
1139
  /* for do not affect facebook type buttons iframe only */
1140
  if (jQuery(this).closest('.fb_iframe_widget').length) {
1158
  }
1159
  return true;
1160
  }
 
1161
  }
1162
  else {
1163
  /*open*/
1166
  if (src != '') {
1167
  jQuery(this).attr('data-attr-src', src);
1168
  }
1169
+
1170
  return true;
1171
  }
1172
  else {
1181
  });
1182
  };
1183
 
1184
+ SGPBPopup.prototype.iframeSizesInHtml = function(args)
1185
+ {
1186
+ var popupId = args['popupId'];
1187
+ var popupOptions = args.popupData;
1188
+ var popupContent = jQuery('.sgpb-content-' + popupId);
1189
+
1190
+ if (!popupContent.length) {
1191
+ return false;
1192
+ }
1193
+ popupContent.find('iframe').each(function() {
1194
+ if (typeof jQuery(this) == 'undefined') {
1195
+ return false;
1196
+ }
1197
+ if (popupOptions['sgpb-popup-dimension-mode'] == 'customMode') {
1198
+ if (typeof jQuery(this).attr('width') == 'undefined' && typeof popupContent.attr('height') == 'undefined') {
1199
+ jQuery(this).css({'width': popupOptions['sgpb-width'], 'height': popupOptions['sgpb-height']});
1200
+ }
1201
+ }
1202
+ });
1203
+ };
1204
+
1205
  SGPBPopup.prototype.getSearchDataFromContent = function(content)
1206
  {
1207
  var pattern = /\[(\[?)(pbvariable)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]\*+(?:\[(?!\/\2\])[^\[]\*+)\*+)\[\/\2\])?)(\]?)/gi;
1230
  {
1231
  var currentHtmlContent = jQuery('.sgpb-content-'+popupId).html();
1232
  var searchData = this.getSearchDataFromContent(currentHtmlContent);
 
1233
  var that = this;
1234
 
1235
  if (!searchData.length) {
1263
  var replaceName = jQuery(searchAttributes['selector']).attr(searchAttributes['attribute']);
1264
  }
1265
 
 
1266
  if (typeof replaceName == 'undefined') {
1267
  that.replaceShortCode(currentSearchData['replaceString'], '', popupId);
1268
  continue;
1293
  return false;
1294
  }
1295
 
1296
+ currentHtmlContent.html(function(i, v) {
1297
  if (typeof v != 'undefined') {
1298
+ return v.replace(shortCode, replaceText);
1299
  }
1300
  });
1301
  });
1311
 
1312
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
1313
  var args = e.detail;
1314
+ that.iframeSizesInHtml(args);
1315
  that.formSubmissionDetection(args);
1316
  var popupOptions = args.popupData;
1317
 
1326
  if (SGPBPopup.varToBool(disablePageScrolling)) {
1327
  jQuery('html, body').addClass('sgpb-overflow-hidden');
1328
  }
1329
+
1330
  });
1331
 
1332
  sgAddEvent(window, 'sgpbWillOpen', function(e) {
2191
  }
2192
  var expires = 'expires='+cookieExpirationData;
2193
  if (exDays == -1) {
2194
+ expires = '';
2195
+ }
2196
 
2197
  if (cPageLevel && typeof cPageLevel != 'boolean') {
2198
  cookiePageLevel = 'path=' + cPageLevel;
public/js/Subscription.js CHANGED
@@ -16,7 +16,8 @@ else{if(that.newWindow!=null){that.newWindow.close();}
16
  this.showErrorMessage();}
17
  window.dispatchEvent(new Event('resize'));return true;};SGPBSubscription.prototype.showErrorMessage=function()
18
  {var popupId=parseInt(this.submissionPopupId);jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-danger').removeClass('sg-hide-element');};SGPBSubscription.prototype.subscriptionSuccessBehavior=function()
19
- {var settings={popupId:this.submissionPopupId,eventName:'sgpbSubscriptionSuccess'};jQuery(window).trigger('sgpbFormSuccess',settings);var popupId=parseInt(this.submissionPopupId);var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var behavior='showMessage';jQuery('.sgpb-subs-form-'+popupId+' form').remove();this.setSubscriptionCookie(popupId);if(typeof popupOptions['sgpb-subs-success-behavior']!='undefined'){behavior=popupOptions['sgpb-subs-success-behavior'];}
 
20
  this.resetFieldsValues();switch(behavior){case'showMessage':jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-success').removeClass('sg-hide-element');break;case'redirectToURL':this.redirectToURL(popupOptions);break;case'openPopup':this.openSuccessPopup(popupOptions);break;case'hidePopup':SGPBPopup.closePopupById(this.submissionPopupId);break;}};SGPBSubscription.prototype.openSuccessPopup=function(popupOptions)
21
  {var that=this;setTimeout(function(){SGPBPopup.closePopupById(that.submissionPopupId);},0);if(typeof popupOptions['sgpb-subs-success-popup']!='undefined'){sgAddEvent(window,'sgpbDidClose',this.openPopup(popupOptions));}};SGPBSubscription.prototype.openPopup=function(popupOptions)
22
  {if(typeof popupOptions['sgpb-subs-success-popup']=='undefined'){return false;}
16
  this.showErrorMessage();}
17
  window.dispatchEvent(new Event('resize'));return true;};SGPBSubscription.prototype.showErrorMessage=function()
18
  {var popupId=parseInt(this.submissionPopupId);jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-danger').removeClass('sg-hide-element');};SGPBSubscription.prototype.subscriptionSuccessBehavior=function()
19
+ {var settings={popupId:this.submissionPopupId,eventName:'sgpbSubscriptionSuccess'};jQuery(window).trigger('sgpbFormSuccess',settings);var popupId=parseInt(this.submissionPopupId);var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var behavior='showMessage';jQuery('.sgpb-subs-form-'+popupId+' form').remove();if(typeof popupOptions['sgpb-subs-hide-subs-users']!='undefined'){this.setSubscriptionCookie(popupId);}
20
+ if(typeof popupOptions['sgpb-subs-success-behavior']!='undefined'){behavior=popupOptions['sgpb-subs-success-behavior'];}
21
  this.resetFieldsValues();switch(behavior){case'showMessage':jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-success').removeClass('sg-hide-element');break;case'redirectToURL':this.redirectToURL(popupOptions);break;case'openPopup':this.openSuccessPopup(popupOptions);break;case'hidePopup':SGPBPopup.closePopupById(this.submissionPopupId);break;}};SGPBSubscription.prototype.openSuccessPopup=function(popupOptions)
22
  {var that=this;setTimeout(function(){SGPBPopup.closePopupById(that.submissionPopupId);},0);if(typeof popupOptions['sgpb-subs-success-popup']!='undefined'){sgAddEvent(window,'sgpbDidClose',this.openPopup(popupOptions));}};SGPBSubscription.prototype.openPopup=function(popupOptions)
23
  {if(typeof popupOptions['sgpb-subs-success-popup']=='undefined'){return false;}
public/views/newsletter.php CHANGED
@@ -89,7 +89,7 @@
89
  <p>Super excited to have you on board, we know you’ll just love us.</p>
90
  <p>Sincerely,</p>
91
  <p>[Blog name]</p>
92
- <p>[Unsubscribe]</p>';
93
  $settings = array(
94
  'wpautop' => false,
95
  'tinymce' => array(
@@ -165,7 +165,7 @@
165
  </div>
166
  <div class="row form-group">
167
  <div class="col-md-6">
168
- <code><?php _e('[Unsubscribe]', SG_POPUP_TEXT_DOMAIN); ?></code>
169
  </div>
170
  <div class="col-md-6">
171
  <?php _e('Unsubscribe', SG_POPUP_TEXT_DOMAIN); ?>
@@ -202,7 +202,6 @@
202
  <?php echo @$field['fieldName']; ?>
203
  </div>
204
  </div>
205
-
206
  <?php
207
  }
208
  ?>
89
  <p>Super excited to have you on board, we know you’ll just love us.</p>
90
  <p>Sincerely,</p>
91
  <p>[Blog name]</p>
92
+ <p>[Unsubscribe title="Unsubscribe"]</p>';
93
  $settings = array(
94
  'wpautop' => false,
95
  'tinymce' => array(
165
  </div>
166
  <div class="row form-group">
167
  <div class="col-md-6">
168
+ <code><?php _e('[Unsubscribe title="Unsubscribe"]', SG_POPUP_TEXT_DOMAIN); ?></code>
169
  </div>
170
  <div class="col-md-6">
171
  <?php _e('Unsubscribe', SG_POPUP_TEXT_DOMAIN); ?>
202
  <?php echo @$field['fieldName']; ?>
203
  </div>
204
  </div>
 
205
  <?php
206
  }
207
  ?>
public/views/options/subscription.php CHANGED
@@ -358,7 +358,17 @@
358
  <input type="checkbox" id="sgpb-subs-show-form-to-top" name="sgpb-subs-show-form-to-top" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-show-form-to-top')); ?>>
359
  </div>
360
  </div>
 
 
 
 
 
 
 
 
 
361
  <!-- submit styles end -->
 
362
  <div class="row form-group">
363
  <label class="col-md-12 control-label sgpb-static-padding-top">
364
  <?php _e('After successful subscription', SG_POPUP_TEXT_DOMAIN); ?>:
358
  <input type="checkbox" id="sgpb-subs-show-form-to-top" name="sgpb-subs-show-form-to-top" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-show-form-to-top')); ?>>
359
  </div>
360
  </div>
361
+ <div class="row form-group">
362
+ <label class="col-md-6 control-label sgpb-static-padding-top" for="sgpb-subs-hide-subs-users">
363
+ <?php _e('Hide for already subscribed users', SG_POPUP_TEXT_DOMAIN); ?>:
364
+ </label>
365
+ <div class="col-md-6">
366
+ <input type="checkbox" id="sgpb-subs-hide-subs-users" name="sgpb-subs-hide-subs-users" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-hide-subs-users')); ?>>
367
+ </div>
368
+ </div>
369
+
370
  <!-- submit styles end -->
371
+
372
  <div class="row form-group">
373
  <label class="col-md-12 control-label sgpb-static-padding-top">
374
  <?php _e('After successful subscription', SG_POPUP_TEXT_DOMAIN); ?>:
readme.txt CHANGED
@@ -7,9 +7,9 @@ Plugin URI: https://popup-builder.com
7
  Donate link: https://popup-builder.com
8
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
9
  Requires at least: 3.8
10
- Tested up to: 5.2
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.42
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,6 +185,14 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
188
  = Version 3.41- 3.42 =
189
  * Added new shortcodes which can be used inside the Newsletter
190
  * PHP > 7 notices fixed
@@ -1014,7 +1022,7 @@ Leave us a good review :)
1014
 
1015
  == Upgrade Notice ==
1016
 
1017
- Current Version of Popup Builder is 3.41
1018
 
1019
  == Other Notes ==
1020
 
7
  Donate link: https://popup-builder.com
8
  Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
9
  Requires at least: 3.8
10
+ Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.43
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
185
 
186
  == Changelog ==
187
 
188
+ = Version 3.43 =
189
+ * Iframes (dimensions) in html works correctly, with correct sizes and without scroll issue.
190
+ * Don't show again button added in license notice banner.
191
+ * License keys issue fixed, now if you have already activated/deactivated the keys on another site, you will see the actual error.
192
+ * Added new option which allows to show Subscription popup to already subscribed users.
193
+ * Added new option to change the unsubscribe link title in the newsletter.
194
+ * Code/speed improvements, php notices have been removed.
195
+
196
  = Version 3.41- 3.42 =
197
  * Added new shortcodes which can be used inside the Newsletter
198
  * PHP > 7 notices fixed
1022
 
1023
  == Upgrade Notice ==
1024
 
1025
+ Current Version of Popup Builder is 3.43
1026
 
1027
  == Other Notes ==
1028