Popup Builder – Responsive WordPress Pop up - Version 2.4.3

Version Description

Current Version of Popup Builder is 2.4.2

Download this release

Release Info

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

Code changes from version 2.4.2 to 2.4.3

classes/SGFblikePopup.php CHANGED
@@ -72,6 +72,22 @@ class SGFblikePopup extends SGPopup
72
  $this->setFblikeOptions($arr['options']);
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  protected function getExtraRenderOptions()
76
  {
77
  $options = json_decode($this->getFblikeOptions(), true);
@@ -104,19 +120,15 @@ class SGFblikePopup extends SGPopup
104
  if($hasShortcode) {
105
 
106
  $content = $this->improveContent($content);
107
- $content = base64_encode($content);
108
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
109
  $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
110
 
111
- echo "<script type=\"text/javascript\">
112
- jQuery(document).ready(function() {
113
- jQuery('body').append(jQuery('".$currentPopupContent."'));
114
- });
115
- </script>";
116
  $content = ' ';
117
  }
118
  else {
119
- $content = base64_encode($content);
120
  }
121
 
122
  return array('html'=>$content);
72
  $this->setFblikeOptions($arr['options']);
73
  }
74
 
75
+ /**
76
+ * Add popup data to footer
77
+ *
78
+ * @since 2.4.3
79
+ *
80
+ * @param string $currentPopupContent popup html content
81
+ *
82
+ * @return void
83
+ *
84
+ */
85
+
86
+ public function addPopupContentToFooter($currentPopupContent) {
87
+
88
+ echo $currentPopupContent;
89
+ }
90
+
91
  protected function getExtraRenderOptions()
92
  {
93
  $options = json_decode($this->getFblikeOptions(), true);
120
  if($hasShortcode) {
121
 
122
  $content = $this->improveContent($content);
 
123
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
124
  $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
125
 
126
+ add_action('wp_footer', array($this, 'addPopupContentToFooter'), 100, 1);
127
+ do_action("wp_footer", $currentPopupContent);
 
 
 
128
  $content = ' ';
129
  }
130
  else {
131
+ $content = trim($content);
132
  }
133
 
134
  return array('html'=>$content);
classes/SGHtmlPopup.php CHANGED
@@ -47,26 +47,37 @@ class SGHtmlPopup extends SGPopup {
47
  $this->setContent($arr['content']);
48
  }
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  protected function getExtraRenderOptions() {
51
- $content = $this->getContent();
52
  $hasShortcode = $this->hasPopupContentShortcode($content);
53
-
54
  if($hasShortcode) {
55
 
56
  $content = $this->improveContent($content);
57
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
58
- $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".base64_encode($content)."</div></div>";
59
 
60
- echo "<script type=\"text/javascript\">
61
- jQuery(document).ready(function() {
62
- jQuery('body').append(jQuery('".$currentPopupContent."'));
63
- });
64
- </script>";
65
  $content = ' ';
66
  }
67
- else {
68
- $content = base64_encode($content);
69
- }
70
 
71
  return array('html' => $content);
72
  }
47
  $this->setContent($arr['content']);
48
  }
49
 
50
+ /**
51
+ * Add popup data to footer
52
+ *
53
+ * @since 2.4.3
54
+ *
55
+ * @param string $currentPopupContent popup html content
56
+ *
57
+ * @return void
58
+ *
59
+ */
60
+
61
+ public function addPopupContentToFooter($currentPopupContent) {
62
+
63
+ echo $currentPopupContent;
64
+ }
65
+
66
  protected function getExtraRenderOptions() {
67
+ $content = trim($this->getContent());
68
  $hasShortcode = $this->hasPopupContentShortcode($content);
69
+
70
  if($hasShortcode) {
71
 
72
  $content = $this->improveContent($content);
73
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
74
+ $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
75
 
76
+ add_action('wp_footer', array($this, 'addPopupContentToFooter'), 100, 1);
77
+ do_action("wp_footer", $currentPopupContent);
78
+
 
 
79
  $content = ' ';
80
  }
 
 
 
81
 
82
  return array('html' => $content);
83
  }
classes/SGShortcodePopup.php CHANGED
@@ -43,19 +43,32 @@ class SGShortcodePopup extends SGPopup {
43
 
44
  $this->setShortcode($arr['url']);
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  protected function getExtraRenderOptions() {
47
  $content = do_shortcode($this->getShortcode());
48
-
49
- $content = base64_encode($content);
50
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
51
  $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
52
-
53
  /*Append to body for shortcode break to new line*/
54
- echo "<script type=\"text/javascript\">
55
- jQuery(document).ready(function() {
56
- jQuery('body').append(jQuery('".$currentPopupContent."'));
57
- });
58
- </script>";
59
 
60
  return array('shortcode'=> ' ');
61
  }
43
 
44
  $this->setShortcode($arr['url']);
45
  }
46
+
47
+ /**
48
+ * Add popup data to footer
49
+ *
50
+ * @since 2.4.3
51
+ *
52
+ * @param string $currentPopupContent popup html content
53
+ *
54
+ * @return void
55
+ *
56
+ */
57
+
58
+ public function addPopupContentToFooter($currentPopupContent) {
59
+
60
+ echo $currentPopupContent;
61
+ }
62
+
63
  protected function getExtraRenderOptions() {
64
  $content = do_shortcode($this->getShortcode());
65
+
 
66
  /*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
67
  $currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\">&nbsp;<div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
68
+
69
  /*Append to body for shortcode break to new line*/
70
+ add_action('wp_footer', array($this, 'addPopupContentToFooter'), 100, 1);
71
+ do_action("wp_footer", $currentPopupContent);
 
 
 
72
 
73
  return array('shortcode'=> ' ');
74
  }
classes/index.php ADDED
File without changes
config.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
 
3
  define("SG_APP_POPUP_PATH", dirname(__FILE__));
4
  define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
@@ -9,7 +12,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.42);
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/');
1
  <?php
2
+ if (!defined( 'ABSPATH' )) {
3
+ exit();
4
+ }
5
 
6
  define("SG_APP_POPUP_PATH", dirname(__FILE__));
7
  define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
12
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
13
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
14
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
15
+ define('SG_POPUP_VERSION', 2.43);
16
  define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
17
  define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
18
  define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
files/index.php ADDED
File without changes
helpers/index.php ADDED
File without changes
img/index.php ADDED
File without changes
index.php ADDED
File without changes
javascript/index.php ADDED
File without changes
javascript/sg_popup_frontend.js CHANGED
@@ -271,21 +271,6 @@ SGPopup.prototype.getPositionPercent = function(needPercent, screenDimension, di
271
  return sgPosition;
272
  }
273
 
274
- SGPopup.prototype.decodeBase64 = function(s) {
275
- if(typeof window.atob == 'function') {
276
- return decodeURIComponent(escape(window.atob(s)));
277
- }
278
-
279
- var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
280
- var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
281
- for(i=0;i<64;i++){e[A.charAt(i)]=i;}
282
- for(x=0;x<L;x++){
283
- c=e[s.charAt(x)];b=(b<<6)+c;l+=6;
284
- while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}
285
- }
286
- return r;
287
- }
288
-
289
  SGPopup.prototype.showPopup = function(id, isOnLoad) {
290
  var that = this;
291
 
@@ -389,7 +374,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
389
  }
390
 
391
  if(popupHtml != ' ') {
392
- popupHtml = that.decodeBase64(popupHtml);
393
  }
394
 
395
  if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
271
  return sgPosition;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  SGPopup.prototype.showPopup = function(id, isOnLoad) {
275
  var that = this;
276
 
374
  }
375
 
376
  if(popupHtml != ' ') {
377
+ popupHtml = popupHtml;
378
  }
379
 
380
  if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
javascript/sg_popup_init.js CHANGED
@@ -12,7 +12,7 @@ SgPopupInit.prototype.cloneToHtmlPopup = function() {
12
  return;
13
  }
14
 
15
- jQuery('.sg-current-popup-'+currentPopupId).append(this.decodeBase64(jQuery("#sgpb-all-content-"+currentPopupId).html()));
16
 
17
  this.popupResizing(currentPopupId);
18
  jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
@@ -36,22 +36,6 @@ SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
36
  }
37
  }
38
 
39
-
40
- SgPopupInit.prototype.decodeBase64 = function(s) {
41
- if(typeof window.atob == 'function') {
42
- return decodeURIComponent(escape(window.atob(s)));
43
- }
44
-
45
- var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
46
- var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
47
- for(i=0;i<64;i++){e[A.charAt(i)]=i;}
48
- for(x=0;x<L;x++){
49
- c=e[s.charAt(x)];b=(b<<6)+c;l+=6;
50
- while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}
51
- }
52
- return r;
53
- }
54
-
55
  SgPopupInit.prototype.popupResizing = function(currentPopupId) {
56
 
57
  var width = this.popupData['width'];
12
  return;
13
  }
14
 
15
+ jQuery("#sgpb-all-content-"+currentPopupId).appendTo(jQuery('.sg-current-popup-'+currentPopupId));
16
 
17
  this.popupResizing(currentPopupId);
18
  jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
36
  }
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  SgPopupInit.prototype.popupResizing = function(currentPopupId) {
40
 
41
  var width = this.popupData['width'];
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.4.2
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.4.3
7
  * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
readme.txt CHANGED
@@ -155,6 +155,12 @@ Go to the Popup Builder settings and set your desired options.
155
 
156
  == Changelog ==
157
 
 
 
 
 
 
 
158
  = Version 2.4.2 =
159
  * Added option to open from URL. Example http://popup-builder.com/index.php?sg_popup_id=1
160
  * Added option to reopen popup after any form submission.
155
 
156
  == Changelog ==
157
 
158
+ = Version 2.4.3 =
159
+ * Added empty index.php file inside every directory to prevent directory listing.
160
+ * Shortcode functionality improvements.
161
+ * Prevented direct access to plugin’s php file.
162
+ * Bug fixes.
163
+
164
  = Version 2.4.2 =
165
  * Added option to open from URL. Example http://popup-builder.com/index.php?sg_popup_id=1
166
  * Added option to reopen popup after any form submission.
style/index.php ADDED
File without changes