Popup Builder – Responsive WordPress Pop up - Version 3.1.3

Version Description

Current Version of Popup Builder is 3.1

Download this release

Release Info

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

Code changes from version 3.1.2 to 3.1.3

com/classes/Actions.php CHANGED
@@ -50,7 +50,7 @@ class Actions
50
  add_filter('wp_insert_post_data', array($this, 'editPublishSettings'), 100, 1);
51
  // for change admin popup list order
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
  }
@@ -118,7 +118,7 @@ class Actions
118
  $currentPostType = $post_type;
119
  }
120
 
121
- if (is_single() && SG_POPUP_POST_TYPE == $currentPostType && !is_preview()) {
122
  // it's for seo optimization
123
  status_header(301);
124
  $homeURL = home_url();
50
  add_filter('wp_insert_post_data', array($this, 'editPublishSettings'), 100, 1);
51
  // for change admin popup list order
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
  }
118
  $currentPostType = $post_type;
119
  }
120
 
121
+ if (!is_admin() && SG_POPUP_POST_TYPE == $currentPostType && !is_preview()) {
122
  // it's for seo optimization
123
  status_header(301);
124
  $homeURL = home_url();
com/classes/Ajax.php CHANGED
@@ -69,6 +69,8 @@ class Ajax
69
  /*Extension notification panel*/
70
  add_action('wp_ajax_sgpb_dont_show_extension_panel', array($this, 'extensionNotificationPanel'));
71
  add_action('wp_ajax_sgpb_dont_show_problem_alert', array($this, 'dontShowProblemAlert'));
 
 
72
  }
73
 
74
  public function dontShowReviewPopup()
@@ -360,14 +362,7 @@ class Ajax
360
  $wpdb->query($sql);
361
  $res = 1;
362
  }
363
-
364
  if ($res) {
365
- $userData = array(
366
- 'email' => $email,
367
- 'firstName' => $firstName,
368
- 'lastName' => $lastName
369
- );
370
- $sendEmails = $this->sendSuccessEmails($popupPostId, $userData);
371
  $status = SGPB_AJAX_STATUS_TRUE;
372
  }
373
 
@@ -375,6 +370,30 @@ class Ajax
375
  wp_die();
376
  }
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  public function sendSuccessEmails($popupPostId, $subscriptionDetails)
379
  {
380
  global $wpdb;
@@ -409,8 +428,6 @@ class Ajax
409
  $reviewEmailTemplate = preg_replace('/\[adminUserName]/', $adminUserName, $reviewEmailTemplate);
410
  $sendStatus = wp_mail($adminEmail, $newSubscriberEmailTitle, $reviewEmailTemplate, $newSubscriberEmailHeader); //return true or false
411
  }
412
-
413
- do_action('sgpbSubscriptionPlusNotifications', $popupPostId, $subscriptionDetails);
414
  }
415
 
416
  public function select2SearchData()
69
  /*Extension notification panel*/
70
  add_action('wp_ajax_sgpb_dont_show_extension_panel', array($this, 'extensionNotificationPanel'));
71
  add_action('wp_ajax_sgpb_dont_show_problem_alert', array($this, 'dontShowProblemAlert'));
72
+ add_action('wp_ajax_sgpb_process_after_submission', array($this, 'sgpbSubsciptionFormSubmittedAction'));
73
+ add_action('wp_ajax_nopriv_sgpb_process_after_submission', array($this, 'sgpbSubsciptionFormSubmittedAction'));
74
  }
75
 
76
  public function dontShowReviewPopup()
362
  $wpdb->query($sql);
363
  $res = 1;
364
  }
 
365
  if ($res) {
 
 
 
 
 
 
366
  $status = SGPB_AJAX_STATUS_TRUE;
367
  }
368
 
370
  wp_die();
371
  }
372
 
373
+ public function sgpbSubsciptionFormSubmittedAction()
374
+ {
375
+ check_ajax_referer(SG_AJAX_NONCE, 'nonce');
376
+ $this->setPostData($_POST);
377
+
378
+ $submissionData = $this->getValueFromPost('formData');
379
+ $popupPostId = (int)$this->getValueFromPost('popupPostId');
380
+ parse_str($submissionData, $formData);
381
+ if (empty($_POST)) {
382
+ echo SGPB_AJAX_STATUS_FALSE;
383
+ wp_die();
384
+ }
385
+ $email = sanitize_email($_POST['emailValue']);
386
+ $firstName = sanitize_text_field($_POST['firstNameValue']);
387
+ $lastName = sanitize_text_field($_POST['lastNameValue']);
388
+ $userData = array(
389
+ 'email' => $email,
390
+ 'firstName' => $firstName,
391
+ 'lastName' => $lastName
392
+ );
393
+ $this->sendSuccessEmails($popupPostId, $userData);
394
+ do_action('sgpbProcessAfterSuccessfulSubmission', $popupPostId, $userData);
395
+ }
396
+
397
  public function sendSuccessEmails($popupPostId, $subscriptionDetails)
398
  {
399
  global $wpdb;
428
  $reviewEmailTemplate = preg_replace('/\[adminUserName]/', $adminUserName, $reviewEmailTemplate);
429
  $sendStatus = wp_mail($adminEmail, $newSubscriberEmailTitle, $reviewEmailTemplate, $newSubscriberEmailHeader); //return true or false
430
  }
 
 
431
  }
432
 
433
  public function select2SearchData()
com/classes/Filters.php CHANGED
@@ -1,8 +1,21 @@
1
  <?php
2
  namespace sgpb;
 
3
 
4
  class Filters
5
  {
 
 
 
 
 
 
 
 
 
 
 
 
6
  public function __construct()
7
  {
8
  $this->init();
@@ -18,7 +31,8 @@ class Filters
18
  add_filter('sgpbAdminCssFiles', array($this, 'sgpbAdminCssFiles'), 1, 1);
19
  add_filter('sgpbPopupContentLoadToPage', array($this, 'filterPopupContent'), 10, 1);
20
  add_filter('the_content', array($this, 'clearContentPreviewMode'), 10, 1);
21
- add_filter('posts_where' , array($this, 'excludePostsToShow'), 10, 1);
 
22
  add_filter('preview_post_link', array($this, 'editPopupPreviewLink'), 10, 2);
23
  add_filter('upgrader_pre_download', array($this, 'maybeShortenEddFilename'), 10, 4);
24
  add_filter('sgpbSavedPostData', array($this, 'savedPostData'), 10, 1);
@@ -28,6 +42,14 @@ class Filters
28
  add_filter('export_wp_filename', array($this, 'exportFileName'), 10, 1);
29
  }
30
 
 
 
 
 
 
 
 
 
31
  public function exportFileName($fileName)
32
  {
33
  if (!empty($_GET['sgpbExportAction'])) {
@@ -226,7 +248,7 @@ class Filters
226
  $screen instanceof \WP_Screen &&
227
  $screen->id === 'edit-popupbuilder') {
228
  if (class_exists('sgpb\SGPopup')) {
229
- $activePopupsQuery = SGPopup::getActivePopupsQueryString();
230
  if ($activePopupsQuery && $activePopupsQuery != '') {
231
  $where .= $activePopupsQuery;
232
  }
1
  <?php
2
  namespace sgpb;
3
+ use \SgpbPopupConfig;
4
 
5
  class Filters
6
  {
7
+ private $activePopupsQueryString = '';
8
+
9
+ public function setQueryString($activePopupsQueryString)
10
+ {
11
+ $this->activePopupsQueryString = $activePopupsQueryString;
12
+ }
13
+
14
+ public function getQueryString()
15
+ {
16
+ return $this->activePopupsQueryString;
17
+ }
18
+
19
  public function __construct()
20
  {
21
  $this->init();
31
  add_filter('sgpbAdminCssFiles', array($this, 'sgpbAdminCssFiles'), 1, 1);
32
  add_filter('sgpbPopupContentLoadToPage', array($this, 'filterPopupContent'), 10, 1);
33
  add_filter('the_content', array($this, 'clearContentPreviewMode'), 10, 1);
34
+ // The priority of this action should be higher than the extensions' init priority.
35
+ add_action('init', array($this, 'excludePostToShowPrepare'), 99999999);
36
  add_filter('preview_post_link', array($this, 'editPopupPreviewLink'), 10, 2);
37
  add_filter('upgrader_pre_download', array($this, 'maybeShortenEddFilename'), 10, 4);
38
  add_filter('sgpbSavedPostData', array($this, 'savedPostData'), 10, 1);
42
  add_filter('export_wp_filename', array($this, 'exportFileName'), 10, 1);
43
  }
44
 
45
+ public function excludePostToShowPrepare()
46
+ {
47
+ SgpbPopupConfig::popupTypesInit();
48
+ $queryString = SGPopup::getActivePopupsQueryString();
49
+ $this->setQueryString($queryString);
50
+ add_filter('posts_where' , array($this, 'excludePostsToShow'), 10, 1);
51
+ }
52
+
53
  public function exportFileName($fileName)
54
  {
55
  if (!empty($_GET['sgpbExportAction'])) {
248
  $screen instanceof \WP_Screen &&
249
  $screen->id === 'edit-popupbuilder') {
250
  if (class_exists('sgpb\SGPopup')) {
251
+ $activePopupsQuery = $this->getQueryString();
252
  if ($activePopupsQuery && $activePopupsQuery != '') {
253
  $where .= $activePopupsQuery;
254
  }
com/classes/Installer.php CHANGED
File without changes
com/classes/PopupChecker.php CHANGED
@@ -371,7 +371,8 @@ class PopupChecker
371
  }
372
  else if ($targetData['param'] == 'post_tags_ids') {
373
  $tagsObj = wp_get_post_tags($postId);
374
- $selectedTags = array_values($targetData['value']);
 
375
 
376
  foreach ($tagsObj as $tagObj) {
377
  if (in_array($tagObj->slug, $selectedTags)) {
371
  }
372
  else if ($targetData['param'] == 'post_tags_ids') {
373
  $tagsObj = wp_get_post_tags($postId);
374
+ $postTagsValues = (array)@$targetData['value'];
375
+ $selectedTags = array_values($postTagsValues);
376
 
377
  foreach ($tagsObj as $tagObj) {
378
  if (in_array($tagObj->slug, $selectedTags)) {
com/classes/RegisterPostType.php CHANGED
@@ -63,7 +63,7 @@ class RegisterPostType
63
  // Exclude_from_search
64
  'exclude_from_search' => true,
65
  'public' => true,
66
- 'has_archive' => true,
67
  // Where to show the post type in the admin menu
68
  'show_ui' => true,
69
  'query_var' => false,
63
  // Exclude_from_search
64
  'exclude_from_search' => true,
65
  'public' => true,
66
+ 'has_archive' => false,
67
  // Where to show the post type in the admin menu
68
  'show_ui' => true,
69
  'query_var' => false,
com/classes/popups/SGPopup.php CHANGED
@@ -235,7 +235,7 @@ abstract class SGPopup
235
 
236
  $saveMode = '';
237
  global $post;
238
- if ((is_preview() && $post->ID == $popupId) || isset($args['preview'])) {
239
  $saveMode = '_preview';
240
  }
241
  if (isset($args['insidePopup']) && $args['insidePopup'] == 'on') {
235
 
236
  $saveMode = '';
237
  global $post;
238
+ if ((@is_preview() && $post->ID == $popupId) || isset($args['preview'])) {
239
  $saveMode = '_preview';
240
  }
241
  if (isset($args['insidePopup']) && $args['insidePopup'] == 'on') {
com/classes/popups/SubscriptionPopup.php CHANGED
@@ -5,12 +5,14 @@ require_once(dirname(__FILE__).'/SGPopup.php');
5
  class SubscriptionPopup extends SGPopup
6
  {
7
  private $data;
 
8
 
9
  public function __construct()
10
  {
11
  add_filter('sgpbPopupRenderOptions', array($this, 'renderOptions'), 12, 1);
12
  add_filter('sgpbAdminJsFiles', array($this, 'adminJsFilter'), 1, 1);
13
  add_filter('sgpbAdminCssFiles', array($this, 'adminCssFilter'), 1, 1);
 
14
  }
15
 
16
  private function frontendFilters()
@@ -29,6 +31,16 @@ class SubscriptionPopup extends SGPopup
29
  return $this->data;
30
  }
31
 
 
 
 
 
 
 
 
 
 
 
32
  public static function getTablesSql()
33
  {
34
  $tablesSql = array();
@@ -124,6 +136,7 @@ class SubscriptionPopup extends SGPopup
124
  {
125
  $this->setData($postData);
126
  $this->setPostData($postData);
 
127
  $postData['sgpb-subs-fields'] = $this->createFormFieldsData();
128
 
129
  return $postData;
@@ -486,12 +499,25 @@ class SubscriptionPopup extends SGPopup
486
  public function getPopupTypeContent()
487
  {
488
  $this->frontendFilters();
 
 
489
  $popupContent = $this->getContent();
490
- $popupOptions = $this->getOptions();
491
- $subsFields = $this->getOptionValue('sgpb-subs-fields');
 
 
 
 
 
 
 
 
 
 
 
492
 
493
  if (empty($subsFields)) {
494
- $subsFields = $this->createFormFieldsData();
495
  }
496
 
497
  $subsRequiredMessages = '';
@@ -510,12 +536,14 @@ class SubscriptionPopup extends SGPopup
510
  'formBackgroundOpacity' => @$popupOptions['sgpb-subs-form-bg-opacity']
511
  );
512
 
513
- $validateScript = $this->createValidateObj($subsFields, $validationMessages);
514
- $popupContent .= $this->getSubscriptionForm($subsFields);
515
- $popupContent .= $this->getSubscriptionValidationScripts($validateScript);
516
- $popupContent .= $this->getFormCustomStyles($styleData);
 
 
517
 
518
- return $popupContent;
519
  }
520
 
521
  public function getSubPopupObj()
5
  class SubscriptionPopup extends SGPopup
6
  {
7
  private $data;
8
+ private $formContent = '';
9
 
10
  public function __construct()
11
  {
12
  add_filter('sgpbPopupRenderOptions', array($this, 'renderOptions'), 12, 1);
13
  add_filter('sgpbAdminJsFiles', array($this, 'adminJsFilter'), 1, 1);
14
  add_filter('sgpbAdminCssFiles', array($this, 'adminCssFilter'), 1, 1);
15
+ add_filter('sgpbSubscriptionForm', array($this, 'subscriptionForm'), 1, 1);
16
  }
17
 
18
  private function frontendFilters()
31
  return $this->data;
32
  }
33
 
34
+ public function setFormContent($formContent)
35
+ {
36
+ $this->formContent = $formContent;
37
+ }
38
+
39
+ public function getFormContent()
40
+ {
41
+ return $this->formContent;
42
+ }
43
+
44
  public static function getTablesSql()
45
  {
46
  $tablesSql = array();
136
  {
137
  $this->setData($postData);
138
  $this->setPostData($postData);
139
+
140
  $postData['sgpb-subs-fields'] = $this->createFormFieldsData();
141
 
142
  return $postData;
499
  public function getPopupTypeContent()
500
  {
501
  $this->frontendFilters();
502
+
503
+ apply_filters('sgpbSubscriptionForm', $this);
504
  $popupContent = $this->getContent();
505
+ $formContent = $this->getFormContent();
506
+
507
+ return $popupContent.$formContent;
508
+ }
509
+
510
+ public function subscriptionForm($popupObj)
511
+ {
512
+ if (!is_object($popupObj)) {
513
+ return '';
514
+ }
515
+ $popupContent = '';
516
+ $popupOptions = $popupObj->getOptions();
517
+ $subsFields = $popupObj->getOptionValue('sgpb-subs-fields');
518
 
519
  if (empty($subsFields)) {
520
+ $subsFields = $popupObj->createFormFieldsData();
521
  }
522
 
523
  $subsRequiredMessages = '';
536
  'formBackgroundOpacity' => @$popupOptions['sgpb-subs-form-bg-opacity']
537
  );
538
 
539
+ $validateScript = $popupObj->createValidateObj($subsFields, $validationMessages);
540
+ $popupContent .= $popupObj->getSubscriptionForm($subsFields);
541
+ $popupContent .= $popupObj->getSubscriptionValidationScripts($validateScript);
542
+ $popupContent .= $popupObj->getFormCustomStyles($styleData);
543
+
544
+ $popupObj->setFormContent($popupContent);
545
 
546
+ return $popupObj;
547
  }
548
 
549
  public function getSubPopupObj()
com/config/config.php CHANGED
File without changes
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.1.2');
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.3');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
File without changes
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.2
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.3
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/SubscriptionForm.css CHANGED
@@ -105,3 +105,48 @@
105
  font-size: 13px;
106
  font-family: BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
107
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  font-size: 13px;
106
  font-family: BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
107
  }
108
+
109
+ /*form builder styles*/
110
+ .sgpb-form-wrapper select {
111
+ width: 100%;
112
+ padding: 7px;
113
+ border: 1px solid #CCCCCC;
114
+ }
115
+
116
+ .sgpb-choice-option-label,
117
+ .sgpb-choice-option-wrapper {
118
+ display: inline-block !important;
119
+ }
120
+
121
+ .sgpb-choice-option-wrapper input,
122
+ .sgpb-field-gdpr-wrapper input[type=checkbox] {
123
+ margin: 0 10px 0 0px;
124
+ }
125
+
126
+ .sgpb-buttons-wrapper,
127
+ .sgpb-field-gdpr-wrapper {
128
+ text-align: left;
129
+ }
130
+
131
+ .sgpb-subs-text-checkbox-gdpr {
132
+ font-size: 13px;
133
+ text-align: left;
134
+ }
135
+
136
+ .sgpb-label-wrapper {
137
+ text-align: left;
138
+ font-weight: 900;
139
+ }
140
+
141
+ .sgpb-field-gdpr-wrapper,
142
+ .sgpb-label-gdpr-wrapper {
143
+ display: inline-block;
144
+ }
145
+
146
+ .sgpb-field-wrapper {
147
+ max-width: 100% !important;
148
+ }
149
+
150
+ .sgpb-subscription-plus-form-error-placement label {
151
+ color: #ff0000;
152
+ }
public/css/popupAdminStyles.css CHANGED
File without changes
public/js/PopupBuilder.js CHANGED
@@ -426,7 +426,7 @@ SGPBPopup.prototype.setPopupLimitationCookie = function(popupData)
426
  }
427
  cookie.openingCount = openingCount + 1;
428
  cookie.openingPage = currentUrl;
429
- var popupShowingLimitExpiry = popupData['sgpb-show-popup-same-user-expiry'];
430
 
431
  SGPBPopup.setCookie(cookieData.cookieName, JSON.stringify(cookie), popupShowingLimitExpiry, currentUrl);
432
  }
@@ -1897,14 +1897,24 @@ SGPBPopup.setCookie = function(cName, cValue, exDays, cPageLevel)
1897
  var cookiePageLevel = 'path=/;';
1898
  var cookieExpirationData = 1;
1899
  if (!exDays || isNaN(exDays)) {
1900
- exDays = 365*50;
 
 
 
 
 
1901
  }
1902
  if (typeof cPageLevel == 'undefined') {
1903
  cPageLevel = false;
1904
  }
1905
 
1906
- expirationDate.setDate(parseInt(expirationDate.getDate() + parseInt(exDays)));
1907
- cookieExpirationData = expirationDate.toUTCString();
 
 
 
 
 
1908
  var expires = 'expires='+cookieExpirationData;
1909
 
1910
  if (exDays == -1) {
@@ -2149,7 +2159,10 @@ SgpbEventListener.prototype.sgpbInsideclick = function(listenerObj, eventData)
2149
 
2150
  targetClick.each(function() {
2151
  jQuery(this).unbind('click').bind('click', function() {
2152
- SGPBPopup.closePopup();
 
 
 
2153
  popupObj.prepareOpen();
2154
  });
2155
  });
@@ -2363,7 +2376,7 @@ SgpbEventListener.CF7EventListener = function(popupId, options)
2363
  popupId: popupId,
2364
  eventName: 'sgpbCF7Success'
2365
  };
2366
- jQuery(window).trigger('sgpbCF7Success', settings);
2367
  });
2368
  }
2369
  };
426
  }
427
  cookie.openingCount = openingCount + 1;
428
  cookie.openingPage = currentUrl;
429
+ var popupShowingLimitExpiry = parseInt(popupData['sgpb-show-popup-same-user-expiry']);
430
 
431
  SGPBPopup.setCookie(cookieData.cookieName, JSON.stringify(cookie), popupShowingLimitExpiry, currentUrl);
432
  }
1897
  var cookiePageLevel = 'path=/;';
1898
  var cookieExpirationData = 1;
1899
  if (!exDays || isNaN(exDays)) {
1900
+ if (!exDays && exDays === 0) {
1901
+ exDays = 'session';
1902
+ }
1903
+ else {
1904
+ exDays = 365*50;
1905
+ }
1906
  }
1907
  if (typeof cPageLevel == 'undefined') {
1908
  cPageLevel = false;
1909
  }
1910
 
1911
+ if (exDays == 'session') {
1912
+ cookieExpirationData = 0;
1913
+ }
1914
+ else {
1915
+ expirationDate.setDate(parseInt(expirationDate.getDate() + parseInt(exDays)));
1916
+ cookieExpirationData = expirationDate.toUTCString();
1917
+ }
1918
  var expires = 'expires='+cookieExpirationData;
1919
 
1920
  if (exDays == -1) {
2159
 
2160
  targetClick.each(function() {
2161
  jQuery(this).unbind('click').bind('click', function() {
2162
+ var dontCloseCurrentPopup = jQuery(this).attr('dontCloseCurrentPopup');
2163
+ if (typeof dontCloseCurrentPopup == 'undefined' || dontCloseCurrentPopup != 'on') {
2164
+ SGPBPopup.closePopup();
2165
+ }
2166
  popupObj.prepareOpen();
2167
  });
2168
  });
2376
  popupId: popupId,
2377
  eventName: 'sgpbCF7Success'
2378
  };
2379
+ jQuery(window).trigger('sgpbCF7Success', settings);
2380
  });
2381
  }
2382
  };
public/js/Subscription.js CHANGED
@@ -1,45 +1 @@
1
- function SGPBSubscription()
2
- {this.expiryTime=365;this.submissionPopupId=0;this.newWindow=null;this.init();}
3
- SGPBSubscription.cookieName='SGPBSubscription';SGPBSubscription.prototype.init=function()
4
- {this.livePreview();this.formSubmission();};SGPBSubscription.prototype.formSubmission=function()
5
- {var that=this;if(typeof sgAddEvent=='undefined'){return false;}
6
- 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;}
7
- 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()
8
- {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);})};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.showMessages=function(res)
9
- {var that=this;if(res['res']==1){this.subscriptionSuccessBehavior();}
10
- else{if(that.newWindow!=null){that.newWindow.close();}
11
- this.showErrorMessage();}
12
- window.dispatchEvent(new Event('resize'));return true;};SGPBSubscription.prototype.showErrorMessage=function()
13
- {var popupId=parseInt(this.submissionPopupId);jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-danger').removeClass('sg-hide-element');};SGPBSubscription.prototype.subscriptionSuccessBehavior=function()
14
- {var settings={popupId:this.submissionPopupId,eventName:'sgpbSubscriptionSuccess'};jQuery(window).trigger('sgpbFormSuccess',settings);var popupId=parseInt(this.submissionPopupId);var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var behavior='showMessage';jQuery('.sgpb-subs-form-'+popupId+' form').remove();this.setSubscriptionCookie(popupId);if(typeof popupOptions['sgpb-subs-success-behavior']!='undefined'){behavior=popupOptions['sgpb-subs-success-behavior'];}
15
- this.resetFieldsValues();switch(behavior){case'showMessage':jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-success').removeClass('sg-hide-element');break;case'redirectToURL':this.redirectToURL(popupOptions);break;case'openPopup':this.openSuccessPopup(popupOptions);break;case'hidePopup':SGPBPopup.closePopupById(this.submissionPopupId);break;}};SGPBSubscription.prototype.openSuccessPopup=function(popupOptions)
16
- {var that=this;setTimeout(function(){SGPBPopup.closePopupById(that.submissionPopupId);},0);if(typeof popupOptions['sgpb-subs-success-popup']!='undefined'){sgAddEvent(window,'sgpbDidClose',this.openPopup(popupOptions));}};SGPBSubscription.prototype.openPopup=function(popupOptions)
17
- {if(typeof popupOptions['sgpb-subs-success-popup']=='undefined'){return false;}
18
- var subPopupId=parseInt(popupOptions['sgpb-subs-success-popup']);var subPopupOptions=SGPBPopup.getPopupOptionsById(subPopupId);var popupObj=new SGPBPopup();popupObj.setPopupId(subPopupId);popupObj.setPopupData(subPopupOptions);setTimeout(function(){popupObj.prepareOpen();},500);};SGPBSubscription.prototype.setSubscriptionCookie=function(popupId)
19
- {var currentUrl=window.location.href;var cookieName=SGPBSubscription.cookieName+popupId;var expiryTime=this.expiryTime;if(SGPopup.getCookie(cookieName)==''){var cookieObject=[currentUrl];SGPBPopup.setCookie(cookieName,JSON.stringify(cookieObject),expiryTime);}};SGPBSubscription.prototype.redirectToURL=function(popupOptions)
20
- {var redirectURL=popupOptions['sgpb-subs-success-redirect-URL'];var redirectToNewTab=popupOptions['sgpb-subs-success-redirect-new-tab'];SGPBPopup.closePopupById(this.submissionPopupId);if(redirectToNewTab){return true;}
21
- window.location.href=redirectURL;};SGPBSubscription.prototype.resetFieldsValues=function()
22
- {if(!jQuery('.js-subs-text-inputs').length){return false;}
23
- jQuery('.js-subs-text-inputs').each(function(){jQuery(this).val('');});};SGPBSubscription.prototype.livePreview=function()
24
- {this.binding();this.changeLabels();this.changeButtonTitle();this.changeColor();this.changeOpacity();this.changePadding();this.changeDimension();this.preventDefaultSubmission();if(typeof SGPBBackend=='function'){SGPBBackend.makeContactAndSubscriptionFieldsRequired();}};SGPBSubscription.prototype.preventDefaultSubmission=function()
25
- {var formSubmitButton=jQuery('.sgpb-subscription-admin-wrapper input[type="submit"]');if(!formSubmitButton.length){return false;}
26
- formSubmitButton.bind('click',function(e){e.preventDefault();});};SGPBSubscription.prototype.changeDimension=function()
27
- {var that=this;jQuery('.js-subs-dimension').change(function(){var element=jQuery(this);var dimension=that.changeDimensionMode(element.val());var styleType=element.attr('data-style-type');var fieldtype=element.attr('data-field-type');var selector=element.attr('data-subs-rel');if(fieldtype=='input'){jQuery('.sgpb-gdpr-label-wrapper').css('width',dimension);jQuery('.sgpb-gdpr-info').css('width',dimension);}
28
- var styleObj={};styleObj[styleType]=dimension;jQuery('.'+selector).css(styleObj);});};SGPBSubscription.prototype.changePadding=function()
29
- {jQuery('.js-sgpb-form-padding').on('change keydown keyup',function(){var padding=jQuery(this).val();jQuery('.sgpb-subscription-admin-wrapper').css('padding',padding+'px');});};SGPBSubscription.prototype.changeColor=function()
30
- {var that=this;if(typeof jQuery.wp=='undefined'||typeof jQuery.wp.wpColorPicker!=='function'){return false;}
31
- jQuery('.js-subs-color-picker').each(function(){var currentColorPicker=jQuery(this);currentColorPicker.wpColorPicker({change:function(){that.colorPickerChange(jQuery(this));}});});jQuery('.wp-picker-holder').mouseover(function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});};SGPBSubscription.prototype.changeOpacity=function()
32
- {var that=this;jQuery('.js-subs-bg-opacity').next().find('.range-handle').on('change mousemove',function(){that.colorPickerChange(jQuery('input[name=sgpb-subs-form-bg-color]'));});};SGPBSubscription.prototype.setupPlaceholderColor=function(element,color)
33
- {jQuery('.'+element).each(function(){jQuery('#sgpb-placeholder-style').remove();var styleContent='.'+element+'::-webkit-input-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-moz-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-ms-placeholder {color: '+color+' !important;}';var styleBlock='<style id="sgpb-placeholder-style">'+styleContent+'</style>';jQuery('head').append(styleBlock);});};SGPBSubscription.prototype.colorPickerChange=function(colorPicker)
34
- {var that=this;var opacity=jQuery('input[name=sgpb-subs-form-bg-opacity]').val();var colorValue=colorPicker.val();colorValue=SGPBBackend.hexToRgba(colorValue,opacity);var styleType=colorPicker.attr('data-style-type');var selector=colorPicker.attr('data-subs-rel');if('placeholder'==styleType){that.setupPlaceholderColor(selector,colorValue);return false;}
35
- var styleObj={};styleObj[styleType]=colorValue;jQuery('.'+selector).each(function(){jQuery(this).css(styleObj);})};SGPBSubscription.prototype.changeButtonTitle=function()
36
- {jQuery('.js-subs-btn-title').bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var val=jQuery(this).val();jQuery('.'+className).val(val);});};SGPBSubscription.prototype.changeLabels=function()
37
- {jQuery('#sgpb-subs-gdpr-text').on('keyup',function(){var text=jQuery(this).val();jQuery(this).text('');jQuery(this).text(text);jQuery('.sgpb-gdpr-text-js').text(text);});jQuery('.js-subs-field-placeholder').each(function(){jQuery(this).bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var placeholderText=jQuery(this).val();if(className=='js-subs-gdpr-label'){jQuery('.'+className).next().text(placeholderText);}
38
- else{jQuery('.'+className).attr('placeholder',placeholderText);}});});};SGPBSubscription.prototype.binding=function()
39
- {var that=this;jQuery('.js-checkbox-field-status').bind('click',function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-field-wrapper');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});jQuery('.js-checkbox-acordion').each(function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-rel');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});};SGPBSubscription.prototype.toggleVisible=function(toggleElement,elementStatus)
40
- {if(elementStatus){toggleElement.css({'display':'block'});}
41
- else{toggleElement.css({'display':'none'});}};SGPBSubscription.prototype.changeDimensionMode=function(dimension)
42
- {var size;size=parseInt(dimension)+'px';if(dimension.indexOf('%')!=-1||dimension.indexOf('px')!=-1){size=dimension;}
43
- return size;};SGPBSubscription.prototype.allowToOpen=function(popupId)
44
- {var allowStatus=true;var cookieName=SGPBSubscription.cookieName+popupId;if(SGPopup.getCookie(cookieName)!=''){allowStatus=false;}
45
- return allowStatus;};jQuery(document).ready(function(){new SGPBSubscription();});
1
+ function SGPBSubscription(){this.expiryTime=365,this.submissionPopupId=0,this.newWindow=null,this.init()}SGPBSubscription.cookieName="SGPBSubscription",SGPBSubscription.prototype.init=function(){this.livePreview(),this.formSubmission()},SGPBSubscription.prototype.formSubmission=function(){var e=this;if("undefined"==typeof sgAddEvent)return!1;sgAddEvent(window,"sgpbDidOpen",function(s){var i=s.detail.popupId,t=SGPBPopup.getPopupOptionsById(i),o={},r=jQuery("#sgpb-popup-dialog-main-div .sgpb-subs-form-"+i+" form"),n=r.find(".js-subs-submit-btn");if("object"!=typeof sgpbSubsValidateObj)return!1;jQuery.validator.setDefaults({errorPlacement:function(e,s){var t=jQuery(s).attr("data-error-message-class");jQuery(".sgpb-subs-form-"+i+" ."+t).html(e)}}),sgpbSubsValidateObj.submitHandler=function(){var s=r.serialize(),u={action:"sgpb_subscription_submission",nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){n.val(n.attr("data-progress-title")),"redirectToURL"==t["sgpb-subs-success-behavior"]&&t["sgpb-subs-success-redirect-new-tab"]&&(e.newWindow=window.open(t["sgpb-subs-success-redirect-URL"]))},formData:s,popupPostId:i};jQuery.post(SGPB_JS_PARAMS.ajaxUrl,u,function(s){e.submissionPopupId=i,jQuery(".sgpb-subs-form-"+i+" .sgpb-alert").addClass("sg-hide-element"),n.val(n.attr("data-title")),o.res=s,e.showMessages(o),e.processAfterSuccessfulSubmission(u)})},r.validate(sgpbSubsValidateObj),jQuery.extend(jQuery.validator.messages,{email:t["sgpb-subs-invalid-message"],required:t["sgpb-subs-validation-message"]})}),jQuery(window).on("sgpbDidClose",function(e){var s=e.detail.popupId;jQuery(".sgpb-subs-form-"+s+" form label.error").hide()})},SGPBSubscription.prototype.processAfterSuccessfulSubmission=function(e){if(jQuery.isEmptyObject(e))return!1;e.action="sgpb_process_after_submission",jQuery.post(SGPB_JS_PARAMS.ajaxUrl,e,function(e){})},SGPBSubscription.prototype.showMessages=function(e){return 1==e.res?this.subscriptionSuccessBehavior():(null!=this.newWindow&&this.newWindow.close(),this.showErrorMessage()),window.dispatchEvent(new Event("resize")),!0},SGPBSubscription.prototype.showErrorMessage=function(){var e=parseInt(this.submissionPopupId);jQuery(".sgpb-subs-form-"+e+" .sgpb-alert-danger").removeClass("sg-hide-element")},SGPBSubscription.prototype.subscriptionSuccessBehavior=function(){var e={popupId:this.submissionPopupId,eventName:"sgpbSubscriptionSuccess"};jQuery(window).trigger("sgpbFormSuccess",e);var s=parseInt(this.submissionPopupId),i=SGPBPopup.getPopupOptionsById(s),t="showMessage";switch(jQuery(".sgpb-subs-form-"+s+" form").remove(),this.setSubscriptionCookie(s),void 0!==i["sgpb-subs-success-behavior"]&&(t=i["sgpb-subs-success-behavior"]),this.resetFieldsValues(),t){case"showMessage":jQuery(".sgpb-subs-form-"+s+" .sgpb-alert-success").removeClass("sg-hide-element");break;case"redirectToURL":this.redirectToURL(i);break;case"openPopup":this.openSuccessPopup(i);break;case"hidePopup":SGPBPopup.closePopupById(this.submissionPopupId)}},SGPBSubscription.prototype.openSuccessPopup=function(e){var s=this;setTimeout(function(){SGPBPopup.closePopupById(s.submissionPopupId)},0),void 0!==e["sgpb-subs-success-popup"]&&sgAddEvent(window,"sgpbDidClose",this.openPopup(e))},SGPBSubscription.prototype.openPopup=function(e){if(void 0===e["sgpb-subs-success-popup"])return!1;var s=parseInt(e["sgpb-subs-success-popup"]),i=SGPBPopup.getPopupOptionsById(s),t=new SGPBPopup;t.setPopupId(s),t.setPopupData(i),setTimeout(function(){t.prepareOpen()},500)},SGPBSubscription.prototype.setSubscriptionCookie=function(e){var s=window.location.href,i=SGPBSubscription.cookieName+e,t=this.expiryTime;if(""==SGPopup.getCookie(i)){var o=[s];SGPBPopup.setCookie(i,JSON.stringify(o),t)}},SGPBSubscription.prototype.redirectToURL=function(e){var s=e["sgpb-subs-success-redirect-URL"],i=e["sgpb-subs-success-redirect-new-tab"];if(SGPBPopup.closePopupById(this.submissionPopupId),i)return!0;window.location.href=s},SGPBSubscription.prototype.resetFieldsValues=function(){if(!jQuery(".js-subs-text-inputs").length)return!1;jQuery(".js-subs-text-inputs").each(function(){jQuery(this).val("")})},SGPBSubscription.prototype.livePreview=function(){this.binding(),this.changeLabels(),this.changeButtonTitle(),this.changeColor(),this.changeOpacity(),this.changePadding(),this.changeDimension(),this.preventDefaultSubmission(),"function"==typeof SGPBBackend&&SGPBBackend.makeContactAndSubscriptionFieldsRequired()},SGPBSubscription.prototype.preventDefaultSubmission=function(){var e=jQuery('.sgpb-subscription-admin-wrapper input[type="submit"]');if(!e.length)return!1;e.bind("click",function(e){e.preventDefault()})},SGPBSubscription.prototype.changeDimension=function(){var e=this;jQuery(".js-subs-dimension").change(function(){var s=jQuery(this),i=e.changeDimensionMode(s.val()),t=s.attr("data-style-type"),o=s.attr("data-field-type"),r=s.attr("data-subs-rel");"input"==o&&(jQuery(".sgpb-gdpr-label-wrapper").css("width",i),jQuery(".sgpb-gdpr-info").css("width",i));var n={};n[t]=i,jQuery("."+r).css(n)})},SGPBSubscription.prototype.changePadding=function(){jQuery(".js-sgpb-form-padding").on("change keydown keyup",function(){var e=jQuery(this).val();jQuery(".sgpb-subscription-admin-wrapper").css("padding",e+"px")})},SGPBSubscription.prototype.changeColor=function(){var e=this;if(void 0===jQuery.wp||"function"!=typeof jQuery.wp.wpColorPicker)return!1;jQuery(".js-subs-color-picker").each(function(){jQuery(this).wpColorPicker({change:function(){e.colorPickerChange(jQuery(this))}})}),jQuery(".wp-picker-holder").mouseover(function(){var s=jQuery(this).prev().find(".js-subs-color-picker");e.colorPickerChange(s)}),jQuery(".wp-picker-holder").bind("click",function(){var s=jQuery(this).prev().find(".js-subs-color-picker");e.colorPickerChange(s)})},SGPBSubscription.prototype.changeOpacity=function(){var e=this;jQuery(".js-subs-bg-opacity").next().find(".range-handle").on("change mousemove",function(){e.colorPickerChange(jQuery("input[name=sgpb-subs-form-bg-color]"))})},SGPBSubscription.prototype.setupPlaceholderColor=function(e,s){jQuery("."+e).each(function(){jQuery("#sgpb-placeholder-style").remove();var i="."+e+"::-webkit-input-placeholder {color: "+s+" !important;}";i+="."+e+"::-moz-placeholder {color: "+s+" !important;}";var t='<style id="sgpb-placeholder-style">'+(i+="."+e+"::-ms-placeholder {color: "+s+" !important;}")+"</style>";jQuery("head").append(t)})},SGPBSubscription.prototype.colorPickerChange=function(e){var s=jQuery("input[name=sgpb-subs-form-bg-opacity]").val(),i=e.val();i=SGPBBackend.hexToRgba(i,s);var t=e.attr("data-style-type"),o=e.attr("data-subs-rel");if("placeholder"==t)return this.setupPlaceholderColor(o,i),!1;var r={};r[t]=i,jQuery("."+o).each(function(){jQuery(this).css(r)})},SGPBSubscription.prototype.changeButtonTitle=function(){jQuery(".js-subs-btn-title").bind("input",function(){var e=jQuery(this).attr("data-subs-rel"),s=jQuery(this).val();jQuery("."+e).val(s)})},SGPBSubscription.prototype.changeLabels=function(){jQuery("#sgpb-subs-gdpr-text").on("keyup",function(){var e=jQuery(this).val();jQuery(this).text(""),jQuery(this).text(e),jQuery(".sgpb-gdpr-text-js").text(e)}),jQuery(".js-subs-field-placeholder").each(function(){jQuery(this).bind("input",function(){var e=jQuery(this).attr("data-subs-rel"),s=jQuery(this).val();"js-subs-gdpr-label"==e?jQuery("."+e).next().text(s):jQuery("."+e).attr("placeholder",s)})})},SGPBSubscription.prototype.binding=function(){var e=this;jQuery(".js-checkbox-field-status").bind("click",function(){var s=jQuery(this).is(":checked"),i=jQuery(this).attr("data-subs-field-wrapper"),t=jQuery("."+i);e.toggleVisible(t,s)}),jQuery(".js-checkbox-acordion").each(function(){var s=jQuery(this).is(":checked"),i=jQuery(this).attr("data-subs-rel"),t=jQuery("."+i);e.toggleVisible(t,s)})},SGPBSubscription.prototype.toggleVisible=function(e,s){s?e.css({display:"block"}):e.css({display:"none"})},SGPBSubscription.prototype.changeDimensionMode=function(e){var s;return s=parseInt(e)+"px",-1==e.indexOf("%")&&-1==e.indexOf("px")||(s=e),s},SGPBSubscription.prototype.allowToOpen=function(e){var s=!0,i=SGPBSubscription.cookieName+e;return""!=SGPopup.getCookie(i)&&(s=!1),s},jQuery(document).ready(function(){new SGPBSubscription});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/views/closeSettingsView.php CHANGED
File without changes
public/views/conditionsView.php CHANGED
File without changes
public/views/options/subscription.php CHANGED
@@ -194,7 +194,7 @@
194
  <?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
195
  </label>
196
  <div class="col-md-6">
197
- <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-text-inputs" data-style-type="height" type="text" name="sgpb-subs-text-height" id="subs-text-height" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-height')); ?>">
198
  </div>
199
  </div>
200
  <div class="row form-group">
@@ -202,7 +202,7 @@
202
  <?php _e('Border width', SG_POPUP_TEXT_DOMAIN); ?>:
203
  </label>
204
  <div class="col-md-6">
205
- <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-text-inputs" data-style-type="border-width" type="text" name="sgpb-subs-text-border-width" id="subs-text-border-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-border-width')); ?>">
206
  </div>
207
  </div>
208
  <div class="row form-group">
@@ -211,7 +211,7 @@
211
  </label>
212
  <div class="col-md-6">
213
  <div class="sgpb-color-picker-wrapper">
214
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="js-subs-text-inputs" data-style-type="background-color" type="text" name="sgpb-subs-text-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-bg-color')); ?>" >
215
  </div>
216
  </div>
217
  </div>
@@ -221,7 +221,7 @@
221
  </label>
222
  <div class="col-md-6">
223
  <div class="sgpb-color-picker-wrapper">
224
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="js-subs-text-inputs" data-style-type="border-color" type="text" name="sgpb-subs-text-border-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-border-color')); ?>" >
225
  </div>
226
  </div>
227
  </div>
@@ -231,7 +231,7 @@
231
  </label>
232
  <div class="col-md-6">
233
  <div class="sgpb-color-picker-wrapper">
234
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="js-subs-text-inputs" data-style-type="color" type="text" name="sgpb-subs-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-color')); ?>" >
235
  </div>
236
  </div>
237
  </div>
@@ -241,7 +241,7 @@
241
  </label>
242
  <div class="col-md-6">
243
  <div class="sgpb-color-picker-wrapper">
244
- <input class="sgpb-color-picker js-subs-color-picker sgpb-full-width-events" data-subs-rel="js-subs-text-inputs" data-style-type="placeholder" type="text" name="sgpb-subs-text-placeholder-color" value="<?php echo esc_html($placeholderColor); ?>" >
245
  </div>
246
  </div>
247
  </div>
@@ -260,7 +260,7 @@
260
  <?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:
261
  </label>
262
  <div class="col-md-6">
263
- <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-submit-btn" data-style-type="width" type="text" name="sgpb-subs-btn-width" id="subs-btn-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-width')); ?>">
264
  </div>
265
  </div>
266
  <div class="row form-group">
@@ -268,7 +268,7 @@
268
  <?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
269
  </label>
270
  <div class="col-md-6">
271
- <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-submit-btn" data-style-type="height" type="text" name="sgpb-subs-btn-height" id="subs-btn-height" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-height')); ?>">
272
  </div>
273
  </div>
274
  <div class="row form-group">
@@ -276,7 +276,7 @@
276
  <?php _e('Title', SG_POPUP_TEXT_DOMAIN); ?>:
277
  </label>
278
  <div class="col-md-6">
279
- <input type="text" name="sgpb-subs-btn-title" id="subs-btn-title" class="form-control js-subs-btn-title sgpb-full-width-events" data-subs-rel="js-subs-submit-btn" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-title')); ?>">
280
  </div>
281
  </div>
282
  <div class="row form-group">
@@ -293,7 +293,7 @@
293
  </label>
294
  <div class="col-md-6">
295
  <div class="sgpb-color-picker-wrapper">
296
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="js-subs-submit-btn" data-style-type="background-color" type="text" name="sgpb-subs-btn-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-bg-color')); ?>" >
297
  </div>
298
  </div>
299
  </div>
@@ -303,7 +303,7 @@
303
  </label>
304
  <div class="col-md-6">
305
  <div class="sgpb-color-picker-wrapper">
306
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="js-subs-submit-btn" data-style-type="color" type="text" name="sgpb-subs-btn-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-text-color')); ?>" >
307
  </div>
308
  </div>
309
  </div>
194
  <?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
195
  </label>
196
  <div class="col-md-6">
197
+ <input class="form-control js-subs-dimension sgpb-full-width-events" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="height" type="text" name="sgpb-subs-text-height" id="subs-text-height" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-height')); ?>">
198
  </div>
199
  </div>
200
  <div class="row form-group">
202
  <?php _e('Border width', SG_POPUP_TEXT_DOMAIN); ?>:
203
  </label>
204
  <div class="col-md-6">
205
+ <input class="form-control js-subs-dimension sgpb-full-width-events" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="border-width" type="text" name="sgpb-subs-text-border-width" id="subs-text-border-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-border-width')); ?>">
206
  </div>
207
  </div>
208
  <div class="row form-group">
211
  </label>
212
  <div class="col-md-6">
213
  <div class="sgpb-color-picker-wrapper">
214
+ <input class="sgpb-color-picker js-subs-color-picker" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="background-color" type="text" name="sgpb-subs-text-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-bg-color')); ?>" >
215
  </div>
216
  </div>
217
  </div>
221
  </label>
222
  <div class="col-md-6">
223
  <div class="sgpb-color-picker-wrapper">
224
+ <input class="sgpb-color-picker js-subs-color-picker" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="border-color" type="text" name="sgpb-subs-text-border-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-border-color')); ?>" >
225
  </div>
226
  </div>
227
  </div>
231
  </label>
232
  <div class="col-md-6">
233
  <div class="sgpb-color-picker-wrapper">
234
+ <input class="sgpb-color-picker js-subs-color-picker" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="color" type="text" name="sgpb-subs-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-color')); ?>" >
235
  </div>
236
  </div>
237
  </div>
241
  </label>
242
  <div class="col-md-6">
243
  <div class="sgpb-color-picker-wrapper">
244
+ <input class="sgpb-color-picker js-subs-color-picker sgpb-full-width-events" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="placeholder" type="text" name="sgpb-subs-text-placeholder-color" value="<?php echo esc_html($placeholderColor); ?>" >
245
  </div>
246
  </div>
247
  </div>
260
  <?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:
261
  </label>
262
  <div class="col-md-6">
263
+ <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-submit-btn" data-field-type="submit" data-style-type="width" type="text" name="sgpb-subs-btn-width" id="subs-btn-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-width')); ?>">
264
  </div>
265
  </div>
266
  <div class="row form-group">
268
  <?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
269
  </label>
270
  <div class="col-md-6">
271
+ <input class="form-control js-subs-dimension sgpb-full-width-events" data-subs-rel="js-subs-submit-btn" data-field-type="submit" data-style-type="height" type="text" name="sgpb-subs-btn-height" id="subs-btn-height" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-height')); ?>">
272
  </div>
273
  </div>
274
  <div class="row form-group">
276
  <?php _e('Title', SG_POPUP_TEXT_DOMAIN); ?>:
277
  </label>
278
  <div class="col-md-6">
279
+ <input type="text" name="sgpb-subs-btn-title" id="subs-btn-title" class="form-control js-subs-btn-title sgpb-full-width-events" data-field-type="submit" data-subs-rel="js-subs-submit-btn" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-title')); ?>">
280
  </div>
281
  </div>
282
  <div class="row form-group">
293
  </label>
294
  <div class="col-md-6">
295
  <div class="sgpb-color-picker-wrapper">
296
+ <input class="sgpb-color-picker js-subs-color-picker" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="background-color" type="text" name="sgpb-subs-btn-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-bg-color')); ?>" >
297
  </div>
298
  </div>
299
  </div>
303
  </label>
304
  <div class="col-md-6">
305
  <div class="sgpb-color-picker-wrapper">
306
+ <input class="sgpb-color-picker js-subs-color-picker" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="color" type="text" name="sgpb-subs-btn-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-text-color')); ?>" >
307
  </div>
308
  </div>
309
  </div>
public/views/optionsView.php CHANGED
@@ -119,12 +119,12 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
119
  <?php _e('Popup showing expiry', SG_POPUP_TEXT_DOMAIN)?>:
120
  </label>
121
  <div class="col-md-6">
122
- <input type="number" min="1" disabled required id="sgpb-show-popup-same-user-expiry" class="sgpb-full-width-events form-control" name="sgpb-show-popup-same-user-expiry" value="<?php echo $popupTypeObj->getOptionValue('sgpb-show-popup-same-user-expiry'); ?>" placeholder="e.g.: 1">
123
  </div>
124
  <div class="col-md-1 sgpb-info-wrapper">
125
  <span class="dashicons dashicons-editor-help sgpb-info-icon sgpb-info-icon-align"></span>
126
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
127
- <?php _e('Select the count of the days after which the popup will be shown to the same user.', SG_POPUP_TEXT_DOMAIN);?>
128
  </span>
129
  </div>
130
  </div>
119
  <?php _e('Popup showing expiry', SG_POPUP_TEXT_DOMAIN)?>:
120
  </label>
121
  <div class="col-md-6">
122
+ <input type="number" min="0" disabled required id="sgpb-show-popup-same-user-expiry" class="sgpb-full-width-events form-control" name="sgpb-show-popup-same-user-expiry" value="<?php echo $popupTypeObj->getOptionValue('sgpb-show-popup-same-user-expiry'); ?>" placeholder="e.g.: 1">
123
  </div>
124
  <div class="col-md-1 sgpb-info-wrapper">
125
  <span class="dashicons dashicons-editor-help sgpb-info-icon sgpb-info-icon-align"></span>
126
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
127
+ <?php _e('Select the count of the days after which the popup will be shown to the same user, or set the value "0" if you want to save cookies by session.', SG_POPUP_TEXT_DOMAIN);?>
128
  </span>
129
  </div>
130
  </div>
public/views/popupDesignView.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.2
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -178,6 +178,15 @@ Go to the Popup Builder settings and set your desired options.
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
 
 
 
 
181
  = Version 3.1.2 =
182
  * Bug fixed related to popup view limitation (getting JS error if Popup Limitation is set up).
183
  * Improvements on popup preview functionality.
7
  Requires at least: 3.8
8
  Tested up to: 5.0
9
  Requires PHP: 5.3.3
10
+ Stable tag: 3.1.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
178
 
179
  == Changelog ==
180
 
181
+ = Version 3.1.3 =
182
+ * Bug fixed related to banner closing.
183
+ * Popup Builder archive page removed.
184
+ * Bug fixed related to blank page of the popups data table.
185
+ * Added popup showing limitation to remember by session.
186
+ * If the user requests Popup's post type page it will be redreceted to homepage.
187
+ * Added new option to not close the initial popup when the second popup is opened with "popup inside another popup" option.
188
+ * Code improvements and minor bug fixes.
189
+
190
  = Version 3.1.2 =
191
  * Bug fixed related to popup view limitation (getting JS error if Popup Limitation is set up).
192
  * Improvements on popup preview functionality.