Popup Builder – Responsive WordPress Pop up - Version 3.1.5

Version Description

Current Version of Popup Builder is 3.1.5

Download this release

Release Info

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

Code changes from version 3.1.4.1 to 3.1.5

PopupBuilderInit.php CHANGED
@@ -38,6 +38,7 @@ class PopupBuilderInit
38
  private function includeData()
39
  {
40
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
 
41
  require_once(SG_POPUP_CLASSES_PATH.'Installer.php');
42
  require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
43
  require_once(SG_POPUP_HELPERS_PATH.'Functions.php');
38
  private function includeData()
39
  {
40
  require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionRegister.php');
41
+ require_once(SG_POPUP_EXTENSION_PATH.'SgpbPopupExtensionActivator.php');
42
  require_once(SG_POPUP_CLASSES_PATH.'Installer.php');
43
  require_once(SG_POPUP_HELPERS_PATH.'AdminHelper.php');
44
  require_once(SG_POPUP_HELPERS_PATH.'Functions.php');
com/classes/Actions.php CHANGED
@@ -52,6 +52,9 @@ class Actions
52
  add_action('pre_get_posts', array($this, 'preGetPosts'));
53
  add_action('template_redirect', array($this, 'redirectFromPopupPage'));
54
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
 
 
 
55
  new Ajax();
56
  }
57
 
@@ -287,6 +290,15 @@ class Actions
287
  return true;
288
  }
289
 
 
 
 
 
 
 
 
 
 
290
  public function disableAutosave()
291
  {
292
  if (!empty($_GET['post_type']) && $_GET['post_type'] == SG_POPUP_POST_TYPE) {
@@ -325,6 +337,15 @@ class Actions
325
  if (!isset($args['event']) && isset($args['insidepopup'])) {
326
  unset($args['insidepopup']);
327
  $event = 'insideclick';
 
 
 
 
 
 
 
 
 
328
  }
329
  // if no event attribute is set, or old shortcode
330
  if (!isset($args['event']) || $oldShortcode || $isInherit) {
52
  add_action('pre_get_posts', array($this, 'preGetPosts'));
53
  add_action('template_redirect', array($this, 'redirectFromPopupPage'));
54
  add_filter('views_edit-popupbuilder', array($this, 'mainActionButtons'), 10, 1);
55
+
56
+ // activate extensions
57
+ add_action('wp_before_admin_bar_render', array($this, 'pluginActivated'), 10, 2);
58
  new Ajax();
59
  }
60
 
290
  return true;
291
  }
292
 
293
+ public function pluginActivated()
294
+ {
295
+ if (!get_option('sgpbActivateExtensions') && SGPB_POPUP_PKG != SGPB_POPUP_PKG_FREE) {
296
+ $obj = new PopupExtensionActivator();
297
+ $obj->activate();
298
+ update_option('sgpbActivateExtensions', 1);
299
+ }
300
+ }
301
+
302
  public function disableAutosave()
303
  {
304
  if (!empty($_GET['post_type']) && $_GET['post_type'] == SG_POPUP_POST_TYPE) {
337
  if (!isset($args['event']) && isset($args['insidepopup'])) {
338
  unset($args['insidepopup']);
339
  $event = 'insideclick';
340
+ $insideShortcodeKey = $popupId.$event;
341
+
342
+ // for prevent infinity chain
343
+ if (in_array($insideShortcodeKey, $this->insideShortcodes)) {
344
+ $shortcodeContent = SGPopup::renderPopupContentShortcode($content, $argsId, $event, $args);
345
+
346
+ return $shortcodeContent;
347
+ }
348
+ $this->insideShortcodes[] = $insideShortcodeKey;
349
  }
350
  // if no event attribute is set, or old shortcode
351
  if (!isset($args['event']) || $oldShortcode || $isInherit) {
com/classes/Ajax.php CHANGED
@@ -173,17 +173,22 @@ class Ajax
173
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
174
 
175
  $popupParams = $_POST['params'];
176
- $popupId = (int)$popupParams['popupId'];
 
177
  $popupsCounterData = get_option('SgpbCounter');
178
 
179
  if ($popupsCounterData === false) {
180
  $popupsCounterData = array();
181
  }
182
 
183
- if (empty($popupsCounterData[$popupId])) {
184
- $popupsCounterData[$popupId] = 0;
 
 
 
 
 
185
  }
186
- $popupsCounterData[$popupId] += 1;
187
 
188
  update_option('SgpbCounter', $popupsCounterData);
189
  wp_die();
173
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
174
 
175
  $popupParams = $_POST['params'];
176
+ $popupsIdCollection = $popupParams['popupsIdCollection'];
177
+
178
  $popupsCounterData = get_option('SgpbCounter');
179
 
180
  if ($popupsCounterData === false) {
181
  $popupsCounterData = array();
182
  }
183
 
184
+ if (!empty($popupsIdCollection)) {
185
+ foreach ($popupsIdCollection as $popupId => $popupCount) {
186
+ if (empty($popupsCounterData[$popupId])) {
187
+ $popupsCounterData[$popupId] = 0;
188
+ }
189
+ $popupsCounterData[$popupId] += $popupCount;
190
+ }
191
  }
 
192
 
193
  update_option('SgpbCounter', $popupsCounterData);
194
  wp_die();
com/classes/Filters.php CHANGED
File without changes
com/classes/Installer.php CHANGED
@@ -97,6 +97,10 @@ class Installer
97
  }
98
  }
99
  }
 
 
 
 
100
  }
101
 
102
  public static function setupInstallationsDateConfig()
@@ -132,6 +136,8 @@ class Installer
132
  delete_option('sgpb-dont-delete-data');
133
  delete_option('sgpb-new-subscriber');
134
  delete_option('sgpbUnsubscribeColumnFixed');
 
 
135
 
136
  // Trigger popup data delete action
137
  do_action('sgpbDeletePopupData');
97
  }
98
  }
99
  }
100
+
101
+ // install extensions
102
+ $obj = new PopupExtensionActivator();
103
+ $obj->install();
104
  }
105
 
106
  public static function setupInstallationsDateConfig()
136
  delete_option('sgpb-dont-delete-data');
137
  delete_option('sgpb-new-subscriber');
138
  delete_option('sgpbUnsubscribeColumnFixed');
139
+ delete_option('sgpbActivateExtensions');
140
+ delete_option('sgpbExtensionsInfo');
141
 
142
  // Trigger popup data delete action
143
  do_action('sgpbDeletePopupData');
com/classes/PopupChecker.php CHANGED
File without changes
com/classes/RegisterPostType.php CHANGED
File without changes
com/classes/dataTable/Subscribers.php CHANGED
File without changes
com/classes/extension/SgpbPopupExtension.php CHANGED
File without changes
com/classes/extension/SgpbPopupExtensionActivator.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace sgpb;
3
+
4
+ class PopupExtensionActivator
5
+ {
6
+ public function activate()
7
+ {
8
+ $extensions = get_option('sgpbExtensionsInfo');
9
+
10
+ if (empty($extensions)) {
11
+ return false;
12
+ }
13
+
14
+ foreach ($extensions as $folderName => $extension) {
15
+ if (empty($extension['key'])) {
16
+ continue;
17
+ }
18
+ $key = $extension['key'];
19
+
20
+ if ($folderName == 'popupbuilder-woocommerce') {
21
+ $key = $folderName.'/popupbuilderWoocommerce.php';
22
+ }
23
+ else if ($folderName == 'popupbuilder-restriction') {
24
+ $key = $folderName.'/PopupBuilderAgerestriction.php';
25
+ }
26
+ else if ($folderName == 'popupbuilder-aweber') {
27
+ $key = $folderName.'/PopupBuilderAWeber.php';
28
+ }
29
+ else if ($folderName == 'popupbuilder-adblock') {
30
+ $key = $folderName.'/PopupBuilderAdBlock.php';
31
+ }
32
+
33
+ activate_plugin($key);
34
+ }
35
+
36
+ return true;
37
+ }
38
+
39
+ private function getExtensionsInfo()
40
+ {
41
+ $extensionsInfo = array();
42
+ $it = new \RecursiveDirectoryIterator(SG_POPUP_BUILDER_PATH.'extensions', \RecursiveDirectoryIterator::SKIP_DOTS);
43
+
44
+ foreach ($it as $path => $fileInfo) {
45
+ $extensionFolderName = $fileInfo->getFilename();
46
+ $extensionMainFile = $this->getExtensionMainFile($extensionFolderName);
47
+ $extensionKey = $extensionFolderName.'/'.$extensionMainFile;
48
+
49
+ $extensionsInfo[$extensionFolderName] = array('key' => $extensionKey, 'mainFileName' => $extensionMainFile);
50
+ }
51
+
52
+ return $extensionsInfo;
53
+ }
54
+
55
+ public function install()
56
+ {
57
+ $extensionsInfo = $this->getExtensionsInfo();
58
+
59
+ if (!get_option('sgpbExtensionsInfo')) {
60
+ update_option('sgpbExtensionsInfo', $extensionsInfo);
61
+ }
62
+ $this->moveExtensionToPluginsSection($extensionsInfo);
63
+ }
64
+
65
+ private function moveExtensionToPluginsSection($extensionsInfo)
66
+ {
67
+ foreach ($extensionsInfo as $extensionFolder => $extensionsInfo) {
68
+ $passedExtension = WP_PLUGIN_DIR.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
69
+ $originalExtension = SG_POPUP_BUILDER_PATH.'extensions'.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
70
+ @rename($originalExtension,$passedExtension);
71
+ }
72
+ }
73
+
74
+ private function getExtensionMainFile($folderName)
75
+ {
76
+ if (empty($folderName)) {
77
+ return '';
78
+ }
79
+
80
+ $explodedData = explode('-', $folderName);
81
+
82
+ if (empty($explodedData)) {
83
+ return '';
84
+ }
85
+ $explodedData = array_filter(array_values($explodedData), array($this, 'ucifirstElements'));
86
+ $fileName = implode('', $explodedData);
87
+
88
+ return $fileName.'.php';
89
+ }
90
+
91
+ private function ucifirstElements(&$element)
92
+ {
93
+ if ($element == 'popupbuilder') {
94
+ $element = 'PopupBuilder';
95
+ return $element;
96
+ }
97
+ $element = ucfirst($element);
98
+
99
+ return $element;
100
+ }
101
+ }
com/classes/popups/SGPopup.php CHANGED
File without changes
com/classes/popups/SubscriptionPopup.php CHANGED
@@ -18,7 +18,11 @@ class SubscriptionPopup extends SGPopup
18
 
19
  private function frontendFilters()
20
  {
21
- add_filter('sgpbFrontendJsFiles', array($this, 'frontJsFilter'), 1, 1);
 
 
 
 
22
  add_filter('sgpbFrontendCssFiles', array($this, 'frontCssFilter'), 1, 1);
23
  }
24
 
@@ -350,13 +354,18 @@ class SubscriptionPopup extends SGPopup
350
  private function createValidateObj($subsFields, $validationMessages)
351
  {
352
  $validateObj = '';
 
 
 
353
 
354
  if (empty($subsFields)) {
355
  return $validateObj;
356
  }
357
 
358
  $rules = 'rules: { ';
359
- $validateObj = 'var sgpbSubsValidateObj = { ';
 
 
360
  foreach ($subsFields as $subsField) {
361
 
362
  if (empty($subsField['attrs'])) {
@@ -380,6 +389,10 @@ class SubscriptionPopup extends SGPopup
380
 
381
  if ($type == 'email') {
382
  $rules .= '"'.$name.'": {required: true, email: true},';
 
 
 
 
383
  continue;
384
  }
385
 
@@ -387,17 +400,20 @@ class SubscriptionPopup extends SGPopup
387
  continue;
388
  }
389
 
 
390
  $rules .= '"'.$name.'" : "required",';
391
 
392
  }
393
  $rules = rtrim($rules, ',');
 
394
 
395
  $rules .= '},';
 
 
396
  $validateObj .= $rules;
 
 
397
  $validateObj .= '};';
398
- $validateObj .= 'jQuery.extend(jQuery.validator.messages, { ';
399
- $validateObj .= 'required: "'.$validationMessages['requiredMessage'].'"';
400
- $validateObj .= ' });';
401
 
402
  return $validateObj;
403
  }
18
 
19
  private function frontendFilters()
20
  {
21
+ $isSubscriptionPlusActive = is_plugin_active(SGPB_POPUP_SUBSCRIPTION_PLUS_EXTENSION_KEY);
22
+
23
+ if (!$isSubscriptionPlusActive) {
24
+ add_filter('sgpbFrontendJsFiles', array($this, 'frontJsFilter'), 1, 1);
25
+ }
26
  add_filter('sgpbFrontendCssFiles', array($this, 'frontCssFilter'), 1, 1);
27
  }
28
 
354
  private function createValidateObj($subsFields, $validationMessages)
355
  {
356
  $validateObj = '';
357
+ $id = $this->getId();
358
+ $requiredMessage = $this->getOptionValue('sgpb-subs-validation-message');
359
+ $emailMessage = $this->getOptionValue('sgpb-subs-invalid-message');
360
 
361
  if (empty($subsFields)) {
362
  return $validateObj;
363
  }
364
 
365
  $rules = 'rules: { ';
366
+ $messages = 'messages: { ';
367
+
368
+ $validateObj = 'var sgpbSubsValidateObj'.$id.' = { ';
369
  foreach ($subsFields as $subsField) {
370
 
371
  if (empty($subsField['attrs'])) {
389
 
390
  if ($type == 'email') {
391
  $rules .= '"'.$name.'": {required: true, email: true},';
392
+ $messages .= '"'.$name.'": {
393
+ "required": "'.$requiredMessage.'",
394
+ "email": "'.$emailMessage.'"
395
+ },';
396
  continue;
397
  }
398
 
400
  continue;
401
  }
402
 
403
+ $messages .= '"'.$name.'": "'.$requiredMessage.'",';
404
  $rules .= '"'.$name.'" : "required",';
405
 
406
  }
407
  $rules = rtrim($rules, ',');
408
+ $messages = rtrim($messages, ',');
409
 
410
  $rules .= '},';
411
+ $messages .= '}';
412
+
413
  $validateObj .= $rules;
414
+ $validateObj .= $messages;
415
+
416
  $validateObj .= '};';
 
 
 
417
 
418
  return $validateObj;
419
  }
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.1.4.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.1.5');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -415,9 +415,7 @@ class SgpbDataConfig
415
  );
416
 
417
  $targetParams = array(
418
- 'select_role' => __('Select role', SG_POPUP_TEXT_DOMAIN),
419
- 'Groups' => array(
420
- )
421
  );
422
 
423
  $targetOperators = array(
415
  );
416
 
417
  $targetParams = array(
418
+ 'select_role' => __('Select role', SG_POPUP_TEXT_DOMAIN)
 
 
419
  );
420
 
421
  $targetOperators = array(
com/helpers/AdminHelper.php CHANGED
@@ -422,7 +422,7 @@ class AdminHelper
422
  if (isset($_GET['sgpb-subscription-popup-id']) && !empty($_GET['sgpb-subscription-popup-id'])) {
423
  $filterCriteria = esc_sql($_GET['sgpb-subscription-popup-id']);
424
  if ($filterCriteria != 'all') {
425
- $searchQuery .= "(subscriptionType = $filterCriteria)";
426
  }
427
  }
428
  if ($filterCriteria != '' && $filterCriteria != 'all' && isset($_GET['s']) && !empty($_GET['s'])) {
422
  if (isset($_GET['sgpb-subscription-popup-id']) && !empty($_GET['sgpb-subscription-popup-id'])) {
423
  $filterCriteria = esc_sql($_GET['sgpb-subscription-popup-id']);
424
  if ($filterCriteria != 'all') {
425
+ $searchQuery .= " AND (subscriptionType = $filterCriteria)";
426
  }
427
  }
428
  if ($filterCriteria != '' && $filterCriteria != 'all' && isset($_GET['s']) && !empty($_GET['s'])) {
com/helpers/ConfigDataHelper.php CHANGED
@@ -65,7 +65,7 @@ class ConfigDataHelper
65
  {
66
  $allCustomPostTypes = self::getAllCustomPosts();
67
  // for conditions, to exclude other post types, tags etc.
68
- if (isset($targetParams['select_role']) && isset($targetParams['Groups'])) {
69
  return $targetParams;
70
  }
71
 
65
  {
66
  $allCustomPostTypes = self::getAllCustomPosts();
67
  // for conditions, to exclude other post types, tags etc.
68
+ if (isset($targetParams['select_role'])) {
69
  return $targetParams;
70
  }
71
 
com/libs/Table.php CHANGED
@@ -232,7 +232,7 @@ class SGPBTable extends SGPBListTable
232
  <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
233
  <select name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
234
  <?php
235
- $gotDateList = '';
236
  foreach ($uniqueDates as $date) {
237
  if ($selectedDate == $date['date-value']) {
238
  $selected = ' selected';
@@ -240,7 +240,7 @@ class SGPBTable extends SGPBListTable
240
  else {
241
  $selected = '';
242
  }
243
- $gotDateList .= '<option value="'.$date['date-value'].'"'.$selected.'>'.date('d F Y', strtotime($date['date-title'])).'</option>';
244
  }
245
  if (empty($subscribersDates)) {
246
  $gotDateList = '<option value="'.$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
232
  <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
233
  <select name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
234
  <?php
235
+ $gotDateList = '<option value="all">'.__('All dates', SG_POPUP_TEXT_DOMAIN).'</option>';
236
  foreach ($uniqueDates as $date) {
237
  if ($selectedDate == $date['date-value']) {
238
  $selected = ' selected';
240
  else {
241
  $selected = '';
242
  }
243
+ $gotDateList .= '<option value="'.$date['date-value'].'"'.$selected.'>'.$date['date-title'].'</option>';
244
  }
245
  if (empty($subscribersDates)) {
246
  $gotDateList = '<option value="'.$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
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.1.4.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.1.5
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/ResetFormStyle.css CHANGED
File without changes
public/css/SubscriptionForm.css CHANGED
File without changes
public/css/popupAdminStyles.css CHANGED
File without changes
public/css/sgbp-bootstrap.css CHANGED
@@ -252,11 +252,6 @@
252
  border: 1px solid #ddd !important;
253
  }
254
  }
255
- @font-face {
256
- font-family: 'Glyphicons Halflings';
257
- src: url('http://localhost/fonts/glyphicons-halflings-regular.eot');
258
- src: url('http://localhost/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('http://localhost/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('http://localhost/fonts/glyphicons-halflings-regular.woff') format('woff'), url('http://localhost/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('http://localhost/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
259
- }
260
  .sgpb-wrapper .glyphicon {
261
  position: relative;
262
  top: 1px;
@@ -7095,4 +7090,4 @@
7095
  }
7096
  .sgpb-wrapper .popover {
7097
  color: #2c3e50;
7098
- }
252
  border: 1px solid #ddd !important;
253
  }
254
  }
 
 
 
 
 
255
  .sgpb-wrapper .glyphicon {
256
  position: relative;
257
  top: 1px;
7090
  }
7091
  .sgpb-wrapper .popover {
7092
  color: #2c3e50;
7093
+ }
public/img/recentSales.png CHANGED
File without changes
public/js/Backend.js CHANGED
File without changes
public/js/PopupBuilder.js CHANGED
@@ -20,6 +20,44 @@ function SGPBPopup()
20
  this.countPopupOpen = true;
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  SGPBPopup.prototype.setCountPopupOpen = function(countPopupOpen)
24
  {
25
  this.countPopupOpen = countPopupOpen;
@@ -49,7 +87,7 @@ SGPBPopup.prototype.initialsListeners = function()
49
  /* one time calling events (sgpbDidOpen, sgpbDidClose ...) */
50
  window.SGPB_SOUND = [];
51
  var that = this;
52
- sgAddEvent(window, 'sgpbDidOpen', function(e) {that.playMusic(e)});
53
 
54
  sgAddEvent(window, 'sgpbDidClose', function(e) {
55
  var args = e.detail;
@@ -1069,12 +1107,6 @@ SGPBPopup.prototype.popupTriggeringListeners = function()
1069
  if (popupOptions['sgpb-show-popup-same-user']) {
1070
  that.setPopupLimitationCookie(popupOptions);
1071
  }
1072
- /* if no analytics extension */
1073
- if (typeof SGPB_ANALYTICS_PARAMS == 'undefined') {
1074
- if (that.getCountPopupOpen()) {
1075
- that.addToCounter(popupOptions);
1076
- }
1077
- }
1078
 
1079
  var closeButtonDelay = parseInt(popupOptions['sgpb-close-button-delay']);
1080
  if (closeButtonDelay) {
@@ -1136,26 +1168,26 @@ SGPBPopup.prototype.sgpbDontShowPopup = function(popupId)
1136
  SGPBPopup.closePopupById(popupId);
1137
  });
1138
  });
1139
- }
1140
 
1141
  SGPBPopup.prototype.addToCounter = function(popupOptions)
1142
  {
1143
  if (SGPB_POPUP_PARAMS.isPreview != '') {
1144
  return false;
1145
  }
1146
- var params = {};
1147
- var popupId = parseInt(popupOptions['sgpb-post-id']);
1148
- params.popupId = popupId;
1149
 
1150
- var data = {
1151
- action: 'sgpb_send_to_open_counter',
1152
- nonce: SGPB_JS_PARAMS.nonce,
1153
- params: params
1154
- };
1155
 
1156
- jQuery.post(SGPB_JS_PARAMS.ajaxUrl, data, function(res) {
1157
 
1158
- });
 
 
 
 
 
 
1159
  };
1160
 
1161
  /*
@@ -1197,7 +1229,8 @@ SGPBPopup.prototype.open = function(args)
1197
  'eventName': eventName,
1198
  'popupId': popupId,
1199
  'order': window.SGPB_ORDER,
1200
- 'isOpen': true
 
1201
  };
1202
  config.currentObj = currentObj;
1203
  var popupConfig = config.combineConfigObj();
@@ -2226,6 +2259,10 @@ SgpbEventListener.prototype.sgpbClick = function(listenerObj, eventData)
2226
  var delay = parseInt(popupOptions['sgpb-popup-delay']) * 1000;
2227
  var clickCount = 1;
2228
  targetClick.each(function() {
 
 
 
 
2229
  jQuery(this).bind('click', function(e) {
2230
  e.preventDefault();
2231
  if (clickCount > 1) {
@@ -2233,7 +2270,14 @@ SgpbEventListener.prototype.sgpbClick = function(listenerObj, eventData)
2233
  }
2234
  ++clickCount;
2235
  jQuery(window).trigger('sgpbClickEvent', popupOptions);
 
2236
  setTimeout(function() {
 
 
 
 
 
 
2237
  popupObj.prepareOpen();
2238
  clickCount = 1;
2239
  }, delay);
@@ -2274,16 +2318,28 @@ SgpbEventListener.prototype.sgpbHover = function(listenerObj, eventData)
2274
  }
2275
  var hoverCount = 1;
2276
  var delay = parseInt(popupOptions['sgpb-popup-delay']) * 1000;
2277
- hoverSelector.bind('hover', function() {
2278
- if (hoverCount > 1) {
2279
- return false;
 
2280
  }
2281
- ++hoverCount;
2282
- jQuery(window).trigger('sgpbHoverEvent', popupOptions);
2283
- setTimeout(function() {
2284
- popupObj.prepareOpen();
2285
- hoverCount = 1;
2286
- }, delay);
 
 
 
 
 
 
 
 
 
 
 
2287
  });
2288
  }
2289
  };
@@ -2439,4 +2495,5 @@ SgpbEventListener.processCF7MailSent = function(popupId, options)
2439
 
2440
  jQuery(document).ready(function(e) {
2441
  SgpbEventListener.init();
 
2442
  });
20
  this.countPopupOpen = true;
21
  }
22
 
23
+ SGPBPopup.listeners = function () {
24
+ var that = this;
25
+ sgAddEvent(window, 'sgpbDidOpen', function(e) {
26
+ var args = e.detail;
27
+ var popupOptions = args.popupData;
28
+
29
+ var obj = e.detail.currentObj.sgpbPopupObj;
30
+
31
+ /* if no analytics extension */
32
+ if (typeof SGPB_ANALYTICS_PARAMS == 'undefined') {
33
+ if (obj.getCountPopupOpen()) {
34
+ obj.addToCounter(popupOptions);
35
+ }
36
+ }
37
+ });
38
+
39
+ setInterval(function() {
40
+ var openedPopups = window.sgpbOpenedPopup || {};
41
+ if (!Object.keys(openedPopups).length) {
42
+ return false;
43
+ }
44
+ var params = {};
45
+ params.popupsIdCollection = window.sgpbOpenedPopup;
46
+
47
+ var data = {
48
+ action: 'sgpb_send_to_open_counter',
49
+ nonce: SGPB_JS_PARAMS.nonce,
50
+ params: params
51
+ };
52
+
53
+
54
+ window.sgpbOpenedPopup = {};
55
+ jQuery.post(SGPB_JS_PARAMS.ajaxUrl, data, function(res) {
56
+
57
+ });
58
+ }, 600);
59
+ };
60
+
61
  SGPBPopup.prototype.setCountPopupOpen = function(countPopupOpen)
62
  {
63
  this.countPopupOpen = countPopupOpen;
87
  /* one time calling events (sgpbDidOpen, sgpbDidClose ...) */
88
  window.SGPB_SOUND = [];
89
  var that = this;
90
+ sgAddEvent(window, 'sgpbDidOpen', function(e) {that.playMusic(e);});
91
 
92
  sgAddEvent(window, 'sgpbDidClose', function(e) {
93
  var args = e.detail;
1107
  if (popupOptions['sgpb-show-popup-same-user']) {
1108
  that.setPopupLimitationCookie(popupOptions);
1109
  }
 
 
 
 
 
 
1110
 
1111
  var closeButtonDelay = parseInt(popupOptions['sgpb-close-button-delay']);
1112
  if (closeButtonDelay) {
1168
  SGPBPopup.closePopupById(popupId);
1169
  });
1170
  });
1171
+ };
1172
 
1173
  SGPBPopup.prototype.addToCounter = function(popupOptions)
1174
  {
1175
  if (SGPB_POPUP_PARAMS.isPreview != '') {
1176
  return false;
1177
  }
1178
+ var that = this;
1179
+ var openedPopups = window.sgpbOpenedPopup || {};
 
1180
 
 
 
 
 
 
1181
 
1182
+ var popupId = parseInt(popupOptions['sgpb-post-id']);
1183
 
1184
+ if (typeof openedPopups[popupId] == 'undefined') {
1185
+ openedPopups[popupId] = 1;
1186
+ }
1187
+ else {
1188
+ openedPopups[popupId] += 1;
1189
+ }
1190
+ window.sgpbOpenedPopup = openedPopups;
1191
  };
1192
 
1193
  /*
1229
  'eventName': eventName,
1230
  'popupId': popupId,
1231
  'order': window.SGPB_ORDER,
1232
+ 'isOpen': true,
1233
+ 'sgpbPopupObj': this
1234
  };
1235
  config.currentObj = currentObj;
1236
  var popupConfig = config.combineConfigObj();
2259
  var delay = parseInt(popupOptions['sgpb-popup-delay']) * 1000;
2260
  var clickCount = 1;
2261
  targetClick.each(function() {
2262
+ if (!jQuery(this).attr('data-popup-id')) {
2263
+ jQuery(this).attr('data-popup-id', popupId);
2264
+ }
2265
+
2266
  jQuery(this).bind('click', function(e) {
2267
  e.preventDefault();
2268
  if (clickCount > 1) {
2270
  }
2271
  ++clickCount;
2272
  jQuery(window).trigger('sgpbClickEvent', popupOptions);
2273
+ var popupId = jQuery(this).data('popup-id');
2274
  setTimeout(function() {
2275
+
2276
+ var popupObj = SGPBPopup.createPopupObjById(popupId);
2277
+ if (!popupObj) {
2278
+ var mapId = listenerObj.filterPopupId(popupId);
2279
+ popupObj = SGPBPopup.createPopupObjById(mapId);
2280
+ }
2281
  popupObj.prepareOpen();
2282
  clickCount = 1;
2283
  }, delay);
2318
  }
2319
  var hoverCount = 1;
2320
  var delay = parseInt(popupOptions['sgpb-popup-delay']) * 1000;
2321
+
2322
+ hoverSelector.each(function () {
2323
+ if (!jQuery(this).attr('data-popup-id')) {
2324
+ jQuery(this).attr('data-popup-id', popupId);
2325
  }
2326
+ jQuery(this).bind('hover', function() {
2327
+ if (hoverCount > 1) {
2328
+ return false;
2329
+ }
2330
+ ++hoverCount;
2331
+ var popupId = jQuery(this).data('popup-id');
2332
+ jQuery(window).trigger('sgpbHoverEvent', popupOptions);
2333
+ setTimeout(function() {
2334
+ var popupObj = SGPBPopup.createPopupObjById(popupId);
2335
+ if (!popupObj) {
2336
+ var mapId = listenerObj.filterPopupId(popupId);
2337
+ popupObj = SGPBPopup.createPopupObjById(mapId);
2338
+ }
2339
+ popupObj.prepareOpen();
2340
+ hoverCount = 1;
2341
+ }, delay);
2342
+ });
2343
  });
2344
  }
2345
  };
2495
 
2496
  jQuery(document).ready(function(e) {
2497
  SgpbEventListener.init();
2498
+ SGPBPopup.listeners();
2499
  });
public/js/Subscription.js CHANGED
@@ -4,9 +4,11 @@ SGPBSubscription.cookieName='SGPBSubscription';SGPBSubscription.prototype.init=f
4
  {if(typeof SGPBFormBuilder!='undefined'){return false;}
5
  this.livePreview();this.formSubmission();};SGPBSubscription.prototype.formSubmission=function()
6
  {var that=this;if(typeof sgAddEvent=='undefined'){return false;}
7
- sgAddEvent(window,'sgpbDidOpen',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var additionalPopupParams={};var subscriptionForm=jQuery('#sgpb-popup-dialog-main-div .sgpb-subs-form-'+popupId+' form');var submitButton=subscriptionForm.find('.js-subs-submit-btn');if(typeof sgpbSubsValidateObj!='object'){return false;}
 
 
8
  jQuery.validator.setDefaults({errorPlacement:function(error,element){var errorWrapperClassName=jQuery(element).attr('data-error-message-class');jQuery('.sgpb-subs-form-'+popupId+' .'+errorWrapperClassName).html(error);}});sgpbSubsValidateObj.submitHandler=function()
9
- {var formData=subscriptionForm.serialize();var ajaxData={action:'sgpb_subscription_submission',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){submitButton.val(submitButton.attr('data-progress-title'));if(popupOptions['sgpb-subs-success-behavior']=='redirectToURL'&&popupOptions['sgpb-subs-success-redirect-new-tab']){that.newWindow=window.open(popupOptions['sgpb-subs-success-redirect-URL']);}},formData:formData,popupPostId:popupId};jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){that.submissionPopupId=popupId;jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert').addClass('sg-hide-element');submitButton.val(submitButton.attr('data-title'));additionalPopupParams['res']=res;that.showMessages(additionalPopupParams);that.processAfterSuccessfulSubmission(ajaxData);})};subscriptionForm.validate(sgpbSubsValidateObj);jQuery.extend(jQuery.validator.messages,{email:popupOptions['sgpb-subs-invalid-message'],required:popupOptions['sgpb-subs-validation-message']});});jQuery(window).on('sgpbDidClose',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;jQuery('.sgpb-subs-form-'+popupId+' form label.error').hide();});};SGPBSubscription.prototype.processAfterSuccessfulSubmission=function(ajaxData)
10
  {if(jQuery.isEmptyObject(ajaxData)){return false;}
11
  ajaxData.action='sgpb_process_after_submission';jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){});};SGPBSubscription.prototype.showMessages=function(res)
12
  {var that=this;if(res['res']==1){this.subscriptionSuccessBehavior();}
4
  {if(typeof SGPBFormBuilder!='undefined'){return false;}
5
  this.livePreview();this.formSubmission();};SGPBSubscription.prototype.formSubmission=function()
6
  {var that=this;if(typeof sgAddEvent=='undefined'){return false;}
7
+ sgAddEvent(window,'sgpbDidOpen',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var additionalPopupParams={};var subscriptionForm=jQuery('#sgpb-popup-dialog-main-div .sgpb-subs-form-'+popupId+' form');var submitButton=subscriptionForm.find('.js-subs-submit-btn');var sgpbSubsValidateObj={};try{sgpbSubsValidateObj=eval('sgpbSubsValidateObj'+popupId)}
8
+ catch(err){}
9
+ if(typeof sgpbSubsValidateObj!='object'){return false;}
10
  jQuery.validator.setDefaults({errorPlacement:function(error,element){var errorWrapperClassName=jQuery(element).attr('data-error-message-class');jQuery('.sgpb-subs-form-'+popupId+' .'+errorWrapperClassName).html(error);}});sgpbSubsValidateObj.submitHandler=function()
11
+ {var formData=subscriptionForm.serialize();var ajaxData={action:'sgpb_subscription_submission',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){submitButton.val(submitButton.attr('data-progress-title'));if(popupOptions['sgpb-subs-success-behavior']=='redirectToURL'&&popupOptions['sgpb-subs-success-redirect-new-tab']){that.newWindow=window.open(popupOptions['sgpb-subs-success-redirect-URL']);}},formData:formData,popupPostId:popupId};jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){that.submissionPopupId=popupId;jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert').addClass('sg-hide-element');submitButton.val(submitButton.attr('data-title'));additionalPopupParams['res']=res;that.showMessages(additionalPopupParams);that.processAfterSuccessfulSubmission(ajaxData);})};subscriptionForm.validate(sgpbSubsValidateObj);});jQuery(window).on('sgpbDidClose',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;jQuery('.sgpb-subs-form-'+popupId+' form label.error').hide();});};SGPBSubscription.prototype.processAfterSuccessfulSubmission=function(ajaxData)
12
  {if(jQuery.isEmptyObject(ajaxData)){return false;}
13
  ajaxData.action='sgpb_process_after_submission';jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){});};SGPBSubscription.prototype.showMessages=function(res)
14
  {var that=this;if(res['res']==1){this.subscriptionSuccessBehavior();}
public/js/sgpbSelect2.js CHANGED
@@ -3,6 +3,4 @@ SGPBSelect2.prototype.init=function(){if(!jQuery('.js-sg-select2').length){retur
3
  this.hideProOptions();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'){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}})};}}});}
4
  jQuery(this).sgpbselect2(options);});};SGPBSelect2.prototype.hideProOptions=function(){if(typeof SGPB_JS_PACKAGES=='undefined'){return;}
5
  if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['platinum']){var disabledOptions=SGPB_JS_PACKAGES.proEvents;if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['silver']){for(var option in disabledOptions){var disabledOption=disabledOptions[option];jQuery('.sgpb-selectbox-settings option').each(function(){if(jQuery(this).val()==disabledOption){jQuery(this).attr('disabled','disabled');}});}}
6
- if(typeof SGPB_JS_PACKAGES.extensions=='undefined'){return;}
7
- if(SGPB_JS_PACKAGES.extensions['geo-targeting']){return;}
8
- var disabledOptions=['groups_countries'];jQuery('.sgpb-selectbox-settings optgroup option').each(function(){for(var option in disabledOptions){var disabledOption=disabledOptions[option];if(jQuery(this).val()==disabledOption){jQuery(this).attr('disabled','disabled');}}});}};jQuery(document).ready(function(){var sgpbSelect2=new SGPBSelect2();});
3
  this.hideProOptions();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'){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}})};}}});}
4
  jQuery(this).sgpbselect2(options);});};SGPBSelect2.prototype.hideProOptions=function(){if(typeof SGPB_JS_PACKAGES=='undefined'){return;}
5
  if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['platinum']){var disabledOptions=SGPB_JS_PACKAGES.proEvents;if(SGPB_JS_PACKAGES.packages['current']<SGPB_JS_PACKAGES.packages['silver']){for(var option in disabledOptions){var disabledOption=disabledOptions[option];jQuery('.sgpb-selectbox-settings option').each(function(){if(jQuery(this).val()==disabledOption){jQuery(this).attr('disabled','disabled');}});}}
6
+ if(typeof SGPB_JS_PACKAGES.extensions=='undefined'){return;}}};jQuery(document).ready(function(){var sgpbSelect2=new SGPBSelect2();});
 
 
public/views/options/subscription.php CHANGED
File without changes
public/views/subscribers.php CHANGED
File without changes
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
7
  Requires at least: 3.8
8
  Tested up to: 5.0
9
  Requires PHP: 5.3.3
10
- Stable tag: 3.1.4.1
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -84,6 +84,8 @@ With Popup Builder plugin you can insert any type of content, right into your Po
84
 
85
  * Iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe.
86
 
 
 
87
  * Video popup - embed YouTube and Vimeo videos inside your popup.
88
 
89
  * Social popup - this is a great type of a popup if you need to share/like your site. In social popup we have added all popular social networks like Facebook, LinkedIn, Twitter, Google Plus etc.
@@ -178,6 +180,14 @@ Go to the Popup Builder settings and set your desired options.
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
 
 
 
181
  = Version 3.1.4.1 =
182
  * Bug fixed related to JS error for blocks.
183
 
@@ -911,7 +921,7 @@ Leave us a good review :)
911
 
912
  == Upgrade Notice ==
913
 
914
- Current Version of Popup Builder is 3.1
915
 
916
  == Other Notes ==
917
 
7
  Requires at least: 3.8
8
  Tested up to: 5.0
9
  Requires PHP: 5.3.3
10
+ Stable tag: 3.1.5
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
84
 
85
  * Iframe popup - you can set the URL you want to load within an iframe and the popup will load that iframe.
86
 
87
+ * Autoresponder (subscription plus extension) - send targeted emails right after the visitor subscribes to your newsletter. You can send coupon codes or download links.
88
+
89
  * Video popup - embed YouTube and Vimeo videos inside your popup.
90
 
91
  * Social popup - this is a great type of a popup if you need to share/like your site. In social popup we have added all popular social networks like Facebook, LinkedIn, Twitter, Google Plus etc.
180
 
181
  == Changelog ==
182
 
183
+ = Version 3.1.5 =
184
+ * Improvements related to popup analytics.
185
+ * Bug fixed related to onclick with 'set popup by css class' option.
186
+ * Improvements related to some filters inside the subscriber's list section.
187
+ * Bug fixed related to multiple onload subscription popups.
188
+ * Bug fixed related to infinite loop with popups shortcode.
189
+ * Code improvements and minor bug fixes.
190
+
191
  = Version 3.1.4.1 =
192
  * Bug fixed related to JS error for blocks.
193
 
921
 
922
  == Upgrade Notice ==
923
 
924
+ Current Version of Popup Builder is 3.1.5
925
 
926
  == Other Notes ==
927