Popup Builder – Responsive WordPress Pop up - Version 3.65.2

Version Description

Current Version of Popup Builder is 3.65.2

Download this release

Release Info

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

Code changes from version 3.65.1 to 3.65.2

com/classes/Filters.php CHANGED
@@ -48,6 +48,60 @@ class Filters
48
  add_filter('sgpbPopupContentLoadToPage', array($this, 'popupContentLoadToPage'), 10, 2);
49
  add_filter('sgpbExtraNotifications', array($this, 'sgpbExtraNotifications'), 10, 1);
50
  add_filter('sgpbSystemInformation', array($this, 'systemInformation'), 10, 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  public function systemInformation($infoContent)
48
  add_filter('sgpbPopupContentLoadToPage', array($this, 'popupContentLoadToPage'), 10, 2);
49
  add_filter('sgpbExtraNotifications', array($this, 'sgpbExtraNotifications'), 10, 1);
50
  add_filter('sgpbSystemInformation', array($this, 'systemInformation'), 10, 1);
51
+ add_filter('plugin_action_links', array($this, 'pluginActionLinks'), 10, 4);
52
+ add_filter('plugin_row_meta', array( $this, 'pluginRowMetas'), 10, 4);
53
+ }
54
+
55
+ public function pluginRowMetas($pluginMeta, $pluginFile, $pluginData, $status)
56
+ {
57
+ if (empty($pluginFile)) {
58
+ return $pluginMeta;
59
+ }
60
+
61
+ $allExtensions = \SgpbDataConfig::allExtensionsKeys();
62
+ $allExtensions = wp_list_pluck($allExtensions, 'pluginKey');
63
+ $allExtensions[] = SG_POPUP_FILE_NAME;
64
+
65
+ $rowMeta = array(
66
+ 'rateus' => '<a href="'.SG_POPUP_RATE_US_URL.'" target="_blank">'.esc_html__('Rate us', SG_POPUP_TEXT_DOMAIN).'</a>',
67
+ 'support' => '<a href="'.SG_POPUP_SUPPORT_URL.'" target="_blank">'.esc_html__('Support', SG_POPUP_TEXT_DOMAIN).'</a>'
68
+ );
69
+
70
+ if (in_array($pluginFile, $allExtensions)) {
71
+ $pluginMeta = array_merge($pluginMeta, $rowMeta);
72
+ }
73
+
74
+ return $pluginMeta;
75
+ }
76
+
77
+ public function pluginActionLinks($actions, $pluginFile, $pluginData, $context)
78
+ {
79
+ if (empty($pluginFile)) {
80
+ return $actions;
81
+ }
82
+
83
+ $allExtensions = \SgpbDataConfig::allExtensionsKeys();
84
+ $allExtensions = wp_list_pluck($allExtensions, 'pluginKey');
85
+ $allExtensions[] = SG_POPUP_FILE_NAME;
86
+
87
+ $settingPageUrl = admin_url().'edit.php?post_type='.SG_POPUP_POST_TYPE.'&page='.SG_POPUP_SETTINGS_PAGE;
88
+
89
+ $links = array(
90
+ 'settings' => '<a href="'.$settingPageUrl.'" target="_blank">'.esc_html__('Settings', SG_POPUP_TEXT_DOMAIN).'</a>',
91
+ 'docs' => '<a href="'.SG_POPUP_TICKET_URL.'" target="_blank">'.esc_html__('Docs', SG_POPUP_TEXT_DOMAIN).'</a>'
92
+ );
93
+
94
+ if (in_array($pluginFile, $allExtensions)) {
95
+ if ($pluginFile == SG_POPUP_FILE_NAME) {
96
+ $getActiveExtensions = AdminHelper::getAllExtensions();
97
+ if (empty($getActiveExtensions['active'])) {
98
+ $links['upgrade'] = '<a style="color: #4364eb;" href="'.SG_POPUP_BUNDLE_URL.'" target="_blank">'.esc_html__('Upgrade', SG_POPUP_TEXT_DOMAIN).'</a>';
99
+ }
100
+ }
101
+ $actions = array_merge($links, $actions);
102
+ }
103
+
104
+ return $actions;
105
  }
106
 
107
  public function systemInformation($infoContent)
com/classes/popups/ImagePopup.php CHANGED
@@ -17,10 +17,6 @@ class ImagePopup extends SGPopup
17
  $savedImageUrl = $savedPopup->getOptionValue('sgpb-image-url');
18
  }
19
 
20
- if ($imageUrl != $savedImageUrl) {
21
- $imageUrl = AdminHelper::getImageDataFromUrl($imageUrl, true);
22
- }
23
-
24
  $data['sgpb-image-url'] = $imageUrl;
25
  $this->setSanitizedData($data);
26
 
17
  $savedImageUrl = $savedPopup->getOptionValue('sgpb-image-url');
18
  }
19
 
 
 
 
 
20
  $data['sgpb-image-url'] = $imageUrl;
21
  $this->setSanitizedData($data);
22
 
com/config/config.php CHANGED
@@ -19,6 +19,7 @@ class SgpbPopupConfig
19
  self::addDefine('SGPB_POPUP_PKG_GOLD', 3);
20
  self::addDefine('SGPB_POPUP_PKG_PLATINUM', 4);
21
  self::addDefine('SG_POPUP_PRO_URL', 'https://popup-builder.com/#prices');
 
22
  self::addDefine('SG_POPUP_EXTENSIONS_URL', 'https://popup-builder.com/#extensions');
23
  self::addDefine('SG_POPUP_SUPPORT_URL', 'https://wordpress.org/support/plugin/popup-builder');
24
  self::addDefine('SG_POPUP_TICKET_URL', 'https://help.popup-builder.com');
19
  self::addDefine('SGPB_POPUP_PKG_GOLD', 3);
20
  self::addDefine('SGPB_POPUP_PKG_PLATINUM', 4);
21
  self::addDefine('SG_POPUP_PRO_URL', 'https://popup-builder.com/#prices');
22
+ self::addDefine('SG_POPUP_BUNDLE_URL', 'https://popup-builder.com/bundle/');
23
  self::addDefine('SG_POPUP_EXTENSIONS_URL', 'https://popup-builder.com/#extensions');
24
  self::addDefine('SG_POPUP_SUPPORT_URL', 'https://wordpress.org/support/plugin/popup-builder');
25
  self::addDefine('SG_POPUP_TICKET_URL', 'https://help.popup-builder.com');
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.65.1');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '3.65.2');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -1677,7 +1677,10 @@ class AdminHelper
1677
  $defaultData = \ConfigDataHelper::defaultData();
1678
 
1679
  // get scripts
1680
- $jsPostMeta = @$postMeta['js'];
 
 
 
1681
  $jsDefaultData = $defaultData['customEditorContent']['js']['helperText'];
1682
  $suspiciousStrings = array('document.createElement', 'createElement', 'String.fromCharCode', 'fromCharCode', '<!--', '-->');
1683
  $finalContent = '';
@@ -1836,7 +1839,7 @@ class AdminHelper
1836
  $key = $singleExntensionData['options']['licence']['key'];
1837
  $name = $singleExntensionData['options']['licence']['itemName'];
1838
  $licenseKey = __('No license');
1839
- if (!empty(self::getOption('sgpb-license-key-'.$key))) {
1840
  $licenseKey = self::getOption('sgpb-license-key-'.$key);
1841
  }
1842
  $licenseStatus = 'Inactive';
@@ -1990,7 +1993,7 @@ class AdminHelper
1990
  }
1991
  }
1992
 
1993
- public function getBrowser()
1994
  {
1995
  $uAgent = 'Unknown';
1996
  if (isset($_SERVER['HTTP_USER_AGENT'])) {
@@ -2131,6 +2134,9 @@ class AdminHelper
2131
  $rolesToBeRestricted = $savedUserRoles;
2132
  }
2133
  foreach ($rolesToBeRestricted as $roleToBeRestricted) {
 
 
 
2134
  foreach ($caps as $cap) {
2135
  // only for the activation hook we need to add our capabilities back
2136
  if ($hook == 'activate') {
1677
  $defaultData = \ConfigDataHelper::defaultData();
1678
 
1679
  // get scripts
1680
+ if (!isset($postMeta['js'])) {
1681
+ $postMeta['js'] = array();
1682
+ }
1683
+ $jsPostMeta = $postMeta['js'];
1684
  $jsDefaultData = $defaultData['customEditorContent']['js']['helperText'];
1685
  $suspiciousStrings = array('document.createElement', 'createElement', 'String.fromCharCode', 'fromCharCode', '<!--', '-->');
1686
  $finalContent = '';
1839
  $key = $singleExntensionData['options']['licence']['key'];
1840
  $name = $singleExntensionData['options']['licence']['itemName'];
1841
  $licenseKey = __('No license');
1842
+ if (!empty($key)) {
1843
  $licenseKey = self::getOption('sgpb-license-key-'.$key);
1844
  }
1845
  $licenseStatus = 'Inactive';
1993
  }
1994
  }
1995
 
1996
+ public static function getBrowser()
1997
  {
1998
  $uAgent = 'Unknown';
1999
  if (isset($_SERVER['HTTP_USER_AGENT'])) {
2134
  $rolesToBeRestricted = $savedUserRoles;
2135
  }
2136
  foreach ($rolesToBeRestricted as $roleToBeRestricted) {
2137
+ if ($roleToBeRestricted == 'administrator' || $roleToBeRestricted == 'admin') {
2138
+ continue;
2139
+ }
2140
  foreach ($caps as $cap) {
2141
  // only for the activation hook we need to add our capabilities back
2142
  if ($hook == 'activate') {
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.65.1
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.65.2
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/js/Backend.js CHANGED
@@ -1,4 +1,4 @@
1
- function SGPBBackend(){this.closeButtonDefaultPositions={};this.closeButtonDefaultPositions[1]={'left':9,'right':9,'bottom':9};this.closeButtonDefaultPositions[2]={'left':0,'right':0,'top':parseInt('-20'),'bottom':parseInt('-20')};this.closeButtonDefaultPositions[3]={'right':4,'bottom':4,'left':4,'top':4};this.closeButtonDefaultPositions[4]={'left':12,'right':12,'bottom':9};this.closeButtonDefaultPositions[5]={'left':8,'right':8,'bottom':8};this.closeButtonDefaultPositions[6]={'left':parseInt('-18.5'),'right':parseInt('-18.5'),'bottom':parseInt('-18.5'),'top':parseInt('-18.5')};}
2
  SGPBBackend.sgAddEvent=function(element,eventName,fn)
3
  {if(element.addEventListener){element.addEventListener(eventName,fn,false);}
4
  else if(element.attachEvent){element.attachEvent('on'+eventName,fn);}};SGPBBackend.prototype.sgInit=function()
@@ -159,7 +159,9 @@ else{that.changePopupStatus('',popupId);}});};SGPBBackend.prototype.changePopupS
159
  colorPicker.wpColorPicker({change:function(){var colorPickerElement=jQuery(this);that.changeColor(colorPickerElement);}});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.sgpb-color-picker');that.changeColor(selectedInput);});};SGPBBackend.prototype.changeColor=function(element)
160
  {var selectedName=element.attr("name");var elementVal=element.val();if(selectedName=='sgpb-counter-text-color'){jQuery('#sgpb-counts-text').remove();jQuery('body').append('<style id="sgpb-counts-text">.sgpb-counts-content.sgpb-flipclock-js-'+SgpbCountdownParams.id+'.flip-clock-wrapper ul li a div div.inn { color: '+elementVal+'; }</style>');}
161
  if(selectedName=='sgpb-counter-background-color'){jQuery('#sgpb-counts-style').remove();jQuery('body').append('<style id="sgpb-counts-style">.sgpb-counts-content.sgpb-flipclock-js-'+SgpbCountdownParams.id+'.flip-clock-wrapper ul li a div div.inn { background-color: '+elementVal+'; }</style>');}};SGPBBackend.prototype.previewInit=function()
162
- {jQuery('input').on('change',function(){jQuery('.wrap').on('click',function(){setTimeout(function(){SGPBBackend.prototype.autosave();},3000);})});jQuery('#post-preview').click(function(){SGPBBackend.prototype.autosave();jQuery('#sgpb-is-preview').val('1');});jQuery('#title').on('change',function(){setTimeout(function(){SGPBBackend.prototype.autosave();},1000);});jQuery('#publish').click(function(){jQuery('#sgpb-is-preview').val('0');});};SGPBBackend.makeContactAndSubscriptionFieldsRequired=function()
 
 
163
  {if(jQuery('.subs-redirect-to-URL').length){jQuery('input[name=sgpb-subs-success-behavior]').on('change',function(){if(jQuery('.subs-redirect-to-URL').is(':checked')){jQuery('#sgpb-subs-success-redirect-URL').attr('required','required');}
164
  else{jQuery('#sgpb-subs-success-redirect-URL').removeAttr('required');}});}
165
  else if(jQuery('.contact-redirect-to-URL').length){jQuery('input[name=sgpb-contact-success-behavior]').on('change',function(){if(jQuery('.contact-redirect-to-URL').is(':checked')){jQuery('#sgpb-contact-success-redirect-URL').attr('required','required');}
@@ -185,6 +187,4 @@ responsiveModeSelector.change(function(){var selectedMode=jQuery(this).val();if(
185
  {var c;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){c=hex.substring(1).split('');if(c.length==3){c=[c[0],c[0],c[1],c[1],c[2],c[2]];}
186
  c='0x'+c.join('');return'rgba('+[(c>>16)&255,(c>>8)&255,c&255].join(',')+','+opacity+')';}
187
  throw new Error('Bad Hex');};SGPBBackend.resetCount=function(popupId)
188
- {if(confirm(SGPB_JS_LOCALIZATION.areYouSure)){var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reset_popup_opening_count',popupId:popupId};jQuery.post(ajaxurl,data,function(response){location.reload();});}};SGPBBackend.prototype.autosave=function()
189
- {if(!jQuery('#titlediv').length){return false;}
190
- var allPopupData=jQuery('form#post').serializeArray();var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_autosave',allPopupData:allPopupData};jQuery.post(ajaxurl,data,function(response){});};jQuery(document).ready(function(){var sgpbBackendObj=new SGPBBackend();sgpbBackendObj.sgInit();});
1
+ function SGPBBackend(){this.closeButtonDefaultPositions={};this.closeButtonDefaultPositions[1]={'left':9,'right':9,'bottom':9};this.closeButtonDefaultPositions[2]={'left':0,'right':0,'top':parseInt('-20'),'bottom':parseInt('-20')};this.closeButtonDefaultPositions[3]={'right':4,'bottom':4,'left':4,'top':4};this.closeButtonDefaultPositions[4]={'left':12,'right':12,'bottom':9};this.closeButtonDefaultPositions[5]={'left':8,'right':8,'bottom':8};this.closeButtonDefaultPositions[6]={'left':parseInt('-18.5'),'right':parseInt('-18.5'),'bottom':parseInt('-18.5'),'top':parseInt('-18.5')};this.autoSaveCount=0;}
2
  SGPBBackend.sgAddEvent=function(element,eventName,fn)
3
  {if(element.addEventListener){element.addEventListener(eventName,fn,false);}
4
  else if(element.attachEvent){element.attachEvent('on'+eventName,fn);}};SGPBBackend.prototype.sgInit=function()
159
  colorPicker.wpColorPicker({change:function(){var colorPickerElement=jQuery(this);that.changeColor(colorPickerElement);}});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.sgpb-color-picker');that.changeColor(selectedInput);});};SGPBBackend.prototype.changeColor=function(element)
160
  {var selectedName=element.attr("name");var elementVal=element.val();if(selectedName=='sgpb-counter-text-color'){jQuery('#sgpb-counts-text').remove();jQuery('body').append('<style id="sgpb-counts-text">.sgpb-counts-content.sgpb-flipclock-js-'+SgpbCountdownParams.id+'.flip-clock-wrapper ul li a div div.inn { color: '+elementVal+'; }</style>');}
161
  if(selectedName=='sgpb-counter-background-color'){jQuery('#sgpb-counts-style').remove();jQuery('body').append('<style id="sgpb-counts-style">.sgpb-counts-content.sgpb-flipclock-js-'+SgpbCountdownParams.id+'.flip-clock-wrapper ul li a div div.inn { background-color: '+elementVal+'; }</style>');}};SGPBBackend.prototype.previewInit=function()
162
+ {var that=this;jQuery('input').on('change',function(){if(!that.autoSaveCount){SGPBBackend.prototype.autosave();that.autoSaveCount=1;}});jQuery('#post-preview').click(function(){SGPBBackend.prototype.autosave();jQuery('#sgpb-is-preview').val('1');});jQuery('#publish').click(function(){jQuery('#sgpb-is-preview').val('0');});};SGPBBackend.prototype.autosave=function()
163
+ {if(!jQuery('#titlediv').length){return false;}
164
+ var allPopupData=jQuery('form#post').serializeArray();var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_autosave',allPopupData:allPopupData};jQuery.post(ajaxurl,data,function(response){});};SGPBBackend.makeContactAndSubscriptionFieldsRequired=function()
165
  {if(jQuery('.subs-redirect-to-URL').length){jQuery('input[name=sgpb-subs-success-behavior]').on('change',function(){if(jQuery('.subs-redirect-to-URL').is(':checked')){jQuery('#sgpb-subs-success-redirect-URL').attr('required','required');}
166
  else{jQuery('#sgpb-subs-success-redirect-URL').removeAttr('required');}});}
167
  else if(jQuery('.contact-redirect-to-URL').length){jQuery('input[name=sgpb-contact-success-behavior]').on('change',function(){if(jQuery('.contact-redirect-to-URL').is(':checked')){jQuery('#sgpb-contact-success-redirect-URL').attr('required','required');}
187
  {var c;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){c=hex.substring(1).split('');if(c.length==3){c=[c[0],c[0],c[1],c[1],c[2],c[2]];}
188
  c='0x'+c.join('');return'rgba('+[(c>>16)&255,(c>>8)&255,c&255].join(',')+','+opacity+')';}
189
  throw new Error('Bad Hex');};SGPBBackend.resetCount=function(popupId)
190
+ {if(confirm(SGPB_JS_LOCALIZATION.areYouSure)){var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reset_popup_opening_count',popupId:popupId};jQuery.post(ajaxurl,data,function(response){location.reload();});}};jQuery(document).ready(function(){var sgpbBackendObj=new SGPBBackend();sgpbBackendObj.sgInit();});
 
 
public/js/PopupBuilder.js CHANGED
@@ -118,7 +118,10 @@ SGPBPopup.listeners = function () {
118
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
119
  /*for mobile landscape issue*/
120
  if (typeof (Event) === 'function') {
121
- var event = new Event('resize');
 
 
 
122
  }
123
  else {
124
  if (SGPBPopup.isIE()) {
118
  sgAddEvent(window, 'sgpbDidOpen', function(e) {
119
  /*for mobile landscape issue*/
120
  if (typeof (Event) === 'function') {
121
+ var event = new CustomEvent('resize', {
122
+ bubbles: true,
123
+ cancelable: true
124
+ });
125
  }
126
  else {
127
  if (SGPBPopup.isIE()) {
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.3
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.65.1
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,6 +185,12 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
188
  = Version 3.65.1 =
189
  * Added filter for custom JS input to sanitize invalid symbols.
190
 
@@ -1160,7 +1166,7 @@ Leave us a good review :)
1160
 
1161
  == Upgrade Notice ==
1162
 
1163
- Current Version of Popup Builder is 3.65.1
1164
 
1165
  == Other Notes ==
1166
 
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.4
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.65.2
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.65.2 =
189
+ * Added support links.
190
+ * Bug fixed related to mobile landscape view.
191
+ * User roles compatibility issues fixed.
192
+ * Tested with WordPress 5.4
193
+
194
  = Version 3.65.1 =
195
  * Added filter for custom JS input to sanitize invalid symbols.
196
 
1166
 
1167
  == Upgrade Notice ==
1168
 
1169
+ Current Version of Popup Builder is 3.65.2
1170
 
1171
  == Other Notes ==
1172