Popup Builder – Responsive WordPress Pop up - Version 3.49

Version Description

Current Version of Popup Builder is 3.49

Download this release

Release Info

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

Code changes from version 3.48 to 3.49

com/classes/popups/ImagePopup.php CHANGED
@@ -18,9 +18,10 @@ class ImagePopup extends SGPopup
18
  }
19
 
20
  if ($imageUrl != $savedImageUrl) {
21
- $imageData = AdminHelper::getImageDataFromUrl($imageUrl);
22
  }
23
- $data['sgpb-image-data'] = $imageData;
 
24
  $this->setSanitizedData($data);
25
 
26
  parent::save();
@@ -77,7 +78,10 @@ class ImagePopup extends SGPopup
77
 
78
  public function getPopupTypeContent()
79
  {
80
- return '';
 
 
 
81
  }
82
 
83
  public function getExtraRenderOptions()
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
 
27
  parent::save();
78
 
79
  public function getPopupTypeContent()
80
  {
81
+ $id = $this->getId();
82
+ $imageUrl = $this->getOptionValue('sgpb-image-url');
83
+
84
+ return '<img width="1" height="1" class="sgpb-preloaded-image-'.$id.'" src="'.$imageUrl.'" style="position:absolute;right:9999999999999px;">';
85
  }
86
 
87
  public function getExtraRenderOptions()
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.48');
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.49');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -840,23 +840,28 @@ class AdminHelper
840
  * Get image encoded data from URL
841
  *
842
  * @param $imageUrl
 
843
  *
844
  * @return string
845
  */
846
- public static function getImageDataFromUrl($imageUrl)
 
847
  {
848
- $data = '';
849
  $remoteData = wp_remote_get($imageUrl);
850
-
851
- if (is_wp_error($remoteData)) {
852
- return $imageUrl;
 
 
 
 
 
853
  }
854
 
855
- $imageData = wp_remote_retrieve_body($remoteData);
856
-
857
- return base64_encode($imageData);
858
  }
859
 
 
860
  public static function deleteUserFromSubscribers($params = array())
861
  {
862
  global $wpdb;
840
  * Get image encoded data from URL
841
  *
842
  * @param $imageUrl
843
+ * @param $boolean
844
  *
845
  * @return string
846
  */
847
+
848
+ public static function getImageDataFromUrl($imageUrl, $boolean = false)
849
  {
 
850
  $remoteData = wp_remote_get($imageUrl);
851
+ if (is_wp_error($remoteData) || (isset($remoteData['response']) && $remoteData['response']['code'] == 404)) {
852
+ if ($boolean) {
853
+ $imageUrl = SG_POPUP_IMG_URL.'NoImage.png';
854
+ }
855
+ }
856
+ if (!$boolean) {
857
+ $imageData = wp_remote_retrieve_body($remoteData);
858
+ $imageUrl = base64_encode($imageData);
859
  }
860
 
861
+ return $imageUrl;
 
 
862
  }
863
 
864
+
865
  public static function deleteUserFromSubscribers($params = array())
866
  {
867
  global $wpdb;
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.48
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.49
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/img/NoImage.png ADDED
Binary file
public/js/PopupBuilder.js CHANGED
@@ -1326,7 +1326,6 @@ SGPBPopup.prototype.popupTriggeringListeners = function()
1326
  if (SGPBPopup.varToBool(disablePageScrolling)) {
1327
  jQuery('html, body').addClass('sgpb-overflow-hidden');
1328
  }
1329
-
1330
  });
1331
 
1332
  sgAddEvent(window, 'sgpbWillOpen', function(e) {
@@ -1687,12 +1686,7 @@ SGPBPopup.prototype.setPopupDimensions = function()
1687
  popupConfig.magicCall('setMinHeight', minHeight);
1688
 
1689
  if (popupType == 'image') {
1690
- if (popupData['sgpb-image-data'] && popupData['sgpb-image-data'].indexOf('http') == -1) {
1691
- popupConfig.magicCall('setContentBackgroundImage', 'data:image/png;base64,'+popupData['sgpb-image-data']);
1692
- }
1693
- else {
1694
- popupConfig.magicCall('setContentBackgroundImage', popupData['sgpb-image-url']);
1695
- }
1696
  popupConfig.magicCall('setContentBackgroundMode', 'contain');
1697
  if (dimensionData == 'customMode') {
1698
  popupConfig.magicCall('setContentBackgroundPosition', 'center center');
1326
  if (SGPBPopup.varToBool(disablePageScrolling)) {
1327
  jQuery('html, body').addClass('sgpb-overflow-hidden');
1328
  }
 
1329
  });
1330
 
1331
  sgAddEvent(window, 'sgpbWillOpen', function(e) {
1686
  popupConfig.magicCall('setMinHeight', minHeight);
1687
 
1688
  if (popupType == 'image') {
1689
+ popupConfig.magicCall('setContentBackgroundImage', popupData['sgpb-image-url']);
 
 
 
 
 
1690
  popupConfig.magicCall('setContentBackgroundMode', 'contain');
1691
  if (dimensionData == 'customMode') {
1692
  popupConfig.magicCall('setContentBackgroundPosition', 'center center');
readme.txt CHANGED
@@ -9,7 +9,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.48
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -185,6 +185,10 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
188
  = Version 3.48 =
189
  * Code improvements and minor bug fixes.
190
  * Popup speed improvements.
@@ -206,7 +210,7 @@ Go to the Popup Builder settings and set your desired options.
206
  = Version 3.45 =
207
  * Improvements of subscription form live preview.
208
  * Changed Support location URL to (Live Chat).
209
- * Bug fixed related to Subscribers Table ordering (credit: Tin Duong of Fortinet’s FortiGuard Labs).
210
  * Banner closing issue fixed.
211
  * Code/speed improvements, php notices have been removed.
212
 
@@ -1052,7 +1056,7 @@ Leave us a good review :)
1052
 
1053
  == Upgrade Notice ==
1054
 
1055
- Current Version of Popup Builder is 3.46
1056
 
1057
  == Other Notes ==
1058
 
9
  Requires at least: 3.8
10
  Tested up to: 5.3
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.49
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.49 =
189
+ * Added async image preloading to make Image popup loads faster.
190
+ * Code improvements and minor bug fixes.
191
+
192
  = Version 3.48 =
193
  * Code improvements and minor bug fixes.
194
  * Popup speed improvements.
210
  = Version 3.45 =
211
  * Improvements of subscription form live preview.
212
  * Changed Support location URL to (Live Chat).
213
+ * Bug fixed related to Subscribers Table ordering (credit: Tin Duong of Fortinets FortiGuard Labs).
214
  * Banner closing issue fixed.
215
  * Code/speed improvements, php notices have been removed.
216
 
1056
 
1057
  == Upgrade Notice ==
1058
 
1059
+ Current Version of Popup Builder is 3.49
1060
 
1061
  == Other Notes ==
1062