Popup Builder – Responsive WordPress Pop up - Version 2.6.4.5.1

Version Description

Current Version of Popup Builder is 2.6.4.4

Download this release

Release Info

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

Code changes from version 2.6.4.4 to 2.6.4.5.1

classes/SGHtmlPopup.php CHANGED
@@ -47,6 +47,33 @@ class SGHtmlPopup extends SGPopup {
47
  $this->setContent($arr['content']);
48
  }
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  protected function getExtraRenderOptions() {
51
  $content = trim($this->getContent());
52
  $hasShortcode = $this->hasPopupContentShortcode($content);
@@ -55,6 +82,8 @@ class SGHtmlPopup extends SGPopup {
55
  if($hasShortcode) {
56
  $content = $this->improveContent($content);
57
  }
 
 
58
  $this->sgAddPopupContentToFooter($content, $popupId);
59
 
60
  return array('html' => $content);
47
  $this->setContent($arr['content']);
48
  }
49
 
50
+ private function filterContentForAutoPlayIframe($content)
51
+ {
52
+ // $match array 0 => content 1 => Iframe url
53
+ preg_match('/<iframe.*?src="(.*?)".*?<\/iframe>/', $content, $match);
54
+
55
+ if(empty($match[1])) {
56
+ return $content;
57
+ }
58
+ $iframeUrl = $match[1];
59
+ $isAutoPlay = stripos($iframeUrl,'autoplay=1');
60
+
61
+ if(!$isAutoPlay) {
62
+ return $content;
63
+ }
64
+ $popupOptions = $this->getOptions();
65
+ $popupOptions = json_decode($popupOptions, true);
66
+
67
+ if(empty($popupOptions)) {
68
+ return $content;
69
+ }
70
+ $popupOptions['htmlIframeUrl'] = $iframeUrl;
71
+ $popupOptions = json_encode($popupOptions);
72
+ $this->setOptions($popupOptions);
73
+
74
+ return str_replace($iframeUrl,' ',$content);
75
+ }
76
+
77
  protected function getExtraRenderOptions() {
78
  $content = trim($this->getContent());
79
  $hasShortcode = $this->hasPopupContentShortcode($content);
82
  if($hasShortcode) {
83
  $content = $this->improveContent($content);
84
  }
85
+ $content = $this->filterContentForAutoPlayIframe($content);
86
+
87
  $this->sgAddPopupContentToFooter($content, $popupId);
88
 
89
  return array('html' => $content);
classes/sgDataTable/SGPopupTable.php CHANGED
@@ -6,7 +6,9 @@ class SGPB_PopupsView extends SGPB_Table
6
  public function __construct()
7
  {
8
  global $wpdb;
9
- parent::__construct('');
 
 
10
 
11
  $this->setRowsPerPage(SG_APP_POPUP_TABLE_LIMIT);
12
  $this->setTablename($wpdb->prefix.'sg_popup');
6
  public function __construct()
7
  {
8
  global $wpdb;
9
+ $popupPreviewId = get_option('popupPreviewId');
10
+
11
+ parent::__construct('', $popupPreviewId);
12
 
13
  $this->setRowsPerPage(SG_APP_POPUP_TABLE_LIMIT);
14
  $this->setTablename($wpdb->prefix.'sg_popup');
classes/sgDataTable/Table.php CHANGED
@@ -11,10 +11,12 @@ class SGPB_Table extends SGPB_ListTable
11
  protected $tablename = '';
12
  protected $rowsPerPage = 10;
13
  protected $initialOrder = array();
 
14
 
15
- public function __construct($id)
16
  {
17
  $this->id = $id;
 
18
  parent::__construct(array(
19
  'singular'=> 'wp_'.$id, //singular label
20
  'plural' => 'wp_'.$id.'s', //plural label
@@ -77,6 +79,9 @@ class SGPB_Table extends SGPB_ListTable
77
 
78
  $totalItems = count($wpdb->get_results($query)); //return the total number of affected rows
79
 
 
 
 
80
  $perPage = $this->rowsPerPage;
81
 
82
  $totalPages = ceil($totalItems/$perPage);
11
  protected $tablename = '';
12
  protected $rowsPerPage = 10;
13
  protected $initialOrder = array();
14
+ private $previewPopup = false;
15
 
16
+ public function __construct($id, $popupPreviewId = false)
17
  {
18
  $this->id = $id;
19
+ $this->previewPopup = $popupPreviewId;
20
  parent::__construct(array(
21
  'singular'=> 'wp_'.$id, //singular label
22
  'plural' => 'wp_'.$id.'s', //plural label
79
 
80
  $totalItems = count($wpdb->get_results($query)); //return the total number of affected rows
81
 
82
+ if($this->previewPopup) {
83
+ $totalItems -= 1;
84
+ }
85
  $perPage = $this->rowsPerPage;
86
 
87
  $totalPages = ceil($totalItems/$perPage);
config.php CHANGED
@@ -24,8 +24,8 @@ if(!class_exists('SgPopupBuilderConfig')) {
24
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
25
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
26
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
27
- define('SG_POPUP_VERSION', 2.644);
28
- define('SG_POPUP_PRO_VERSION', 3.374);
29
  define('SG_POPUP_PRO_URL', 'https://popup-builder.com/');
30
  define('SG_POPUP_EXTENSION_URL', 'https://popup-builder.com/extensions');
31
  define('SG_MAILCHIMP_EXTENSION_URL', 'https://popup-builder.com/downloads/mailchimp/');
24
  define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
25
  define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
26
  define('SG_APP_POPUP_TABLE_LIMIT', 15);
27
+ define('SG_POPUP_VERSION', 2.645);
28
+ define('SG_POPUP_PRO_VERSION', 3.375);
29
  define('SG_POPUP_PRO_URL', 'https://popup-builder.com/');
30
  define('SG_POPUP_EXTENSION_URL', 'https://popup-builder.com/extensions');
31
  define('SG_MAILCHIMP_EXTENSION_URL', 'https://popup-builder.com/downloads/mailchimp/');
files/sg_popup_media_button.php CHANGED
@@ -69,7 +69,7 @@ function sgPopupMediaButtonThickboxs()
69
  if ($checkPage && $typenow != 'download') :
70
  $orderBy = 'id DESC';
71
  $allPopups = SGPopup::findAll($orderBy);
72
-
73
  ?>
74
  <script type="text/javascript">
75
  jQuery(document).ready(function ($) {
@@ -123,7 +123,7 @@ function sgPopupMediaButtonThickboxs()
123
  $popupType = $popup->getType();
124
  $popupTitle = $popup->getTitle();
125
 
126
- if(empty($popupId) || empty($popupType)) {
127
  continue;
128
  }
129
 
69
  if ($checkPage && $typenow != 'download') :
70
  $orderBy = 'id DESC';
71
  $allPopups = SGPopup::findAll($orderBy);
72
+ $popupPreviewId = get_option('popupPreviewId');
73
  ?>
74
  <script type="text/javascript">
75
  jQuery(document).ready(function ($) {
123
  $popupType = $popup->getType();
124
  $popupTitle = $popup->getTitle();
125
 
126
+ if(empty($popupId) || empty($popupType) || $popupId == $popupPreviewId) {
127
  continue;
128
  }
129
 
files/sg_popup_page_selection.php CHANGED
@@ -21,9 +21,11 @@ function sgPopupCallback($post)
21
  global $wpdb;
22
  $proposedTypes = array();
23
  $orderBy = 'id DESC';
 
24
  $proposedTypes = SGPopup::findAll($orderBy);
25
  function sgCreateSelect($options,$name,$selecteOption) {
26
 
 
27
  $str = "";
28
  $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
29
  $str .= "<option value='-1'>Not selected</option>";
@@ -35,6 +37,9 @@ function sgPopupCallback($post)
35
  $title = $option->getTitle();
36
  $type = $option->getType();
37
  $id = $option->getId();
 
 
 
38
  if ($selecteOption == $id) {
39
  $selected = "selected";
40
  }
21
  global $wpdb;
22
  $proposedTypes = array();
23
  $orderBy = 'id DESC';
24
+
25
  $proposedTypes = SGPopup::findAll($orderBy);
26
  function sgCreateSelect($options,$name,$selecteOption) {
27
 
28
+ $popupPreviewId = get_option('popupPreviewId');
29
  $str = "";
30
  $str .= "<select class=\"choose-popup-type\" name=\"$name\">";
31
  $str .= "<option value='-1'>Not selected</option>";
37
  $title = $option->getTitle();
38
  $type = $option->getType();
39
  $id = $option->getId();
40
+ if($id == $popupPreviewId) {
41
+ continue;
42
+ }
43
  if ($selecteOption == $id) {
44
  $selected = "selected";
45
  }
javascript/sg_popup_frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- function SGPopup() {
2
 
3
  this.positionLeft = '';
4
  this.positionTop = '';
@@ -753,6 +753,29 @@ SGPopup.prototype.contentClickRedirect = function () {
753
  });
754
  };
755
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
756
  SGPopup.prototype.colorboxEventsListener = function () {
757
 
758
  var that = this;
@@ -783,9 +806,14 @@ SGPopup.prototype.colorboxEventsListener = function () {
783
 
784
  that.addToCounter(popupId);
785
 
 
 
 
 
786
  if(that.popupContentClick) {
787
  that.contentClickRedirect();
788
  }
 
789
  clearInterval(repetitiveTimeout);
790
  if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
791
  /*
@@ -832,6 +860,9 @@ SGPopup.prototype.colorboxEventsListener = function () {
832
  if(disablePageScrolling) {
833
  jQuery('body').removeClass('sgpb-disable-page-scrolling');
834
  }
 
 
 
835
  });
836
 
837
  };
1
+ function SGPopup() {
2
 
3
  this.positionLeft = '';
4
  this.positionTop = '';
753
  });
754
  };
755
 
756
+ SGPopup.prototype.htmlIframeFilterForOpen = function (popupEventName) {
757
+
758
+ var popupId = this.popupData['id'];
759
+ var popupContentWrapper = jQuery('#sg-popup-content-wrapper-'+popupId);
760
+
761
+ if(!popupContentWrapper.length) {
762
+ return;
763
+ }
764
+
765
+ if(!popupContentWrapper.find('iframe').length) {
766
+ return;
767
+ }
768
+
769
+ if(popupEventName == 'open') {
770
+ var iframeUrl = this.popupData['htmlIframeUrl'];
771
+ popupContentWrapper.find('iframe').attr('src', iframeUrl);
772
+ return;
773
+ }
774
+
775
+ popupContentWrapper.find('iframe').attr('src', ' ');
776
+ return;
777
+ };
778
+
779
  SGPopup.prototype.colorboxEventsListener = function () {
780
 
781
  var that = this;
806
 
807
  that.addToCounter(popupId);
808
 
809
+ if(that.popupData['type'] == 'html') {
810
+ that.htmlIframeFilterForOpen('open');
811
+ }
812
+
813
  if(that.popupContentClick) {
814
  that.contentClickRedirect();
815
  }
816
+
817
  clearInterval(repetitiveTimeout);
818
  if(that.varToBool(that.popupData['popupOpenSound']) && popupOpenSoundFile) {
819
  /*
860
  if(disablePageScrolling) {
861
  jQuery('body').removeClass('sgpb-disable-page-scrolling');
862
  }
863
+ if(that.popupData['type'] == 'html') {
864
+ that.htmlIframeFilterForOpen('close');
865
+ }
866
  });
867
 
868
  };
popup-builder.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /**
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: 2.6.4.4
7
- * Author: Popup Builder
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
10
  */
1
  <?php
2
  /**
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.6.4.5.1
7
+ * Author: Sygnoos
8
  * Author URI: http://www.sygnoos.com
9
  * License: GPLv2
10
  */
readme.txt CHANGED
@@ -166,6 +166,15 @@ Go to the Popup Builder settings and set your desired options.
166
 
167
  == Changelog ==
168
 
 
 
 
 
 
 
 
 
 
169
  = Version 2.6.4.4 =
170
  * Added an option to close facebook popup after liking the page.
171
  * Added an option to hide share button inside the facebook popup.
166
 
167
  == Changelog ==
168
 
169
+ = Version 2.6.4.5.1 =
170
+ * HOTFIX
171
+
172
+ = Version 2.6.4.5 =
173
+ * Popup preview improvements.
174
+ * Fixed auto play issue for iframe inside html popup content.
175
+ * Fixed popup preview for mailchimp issue.
176
+ * Facebook popup Optimization.
177
+
178
  = Version 2.6.4.4 =
179
  * Added an option to close facebook popup after liking the page.
180
  * Added an option to hide share button inside the facebook popup.