Popup Builder – Responsive WordPress Pop up - Version 4.1.1

Version Description

Download this release

Release Info

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

Code changes from version 4.1.0 to 4.1.1

Files changed (50) hide show
  1. com/classes/Actions.php +114 -75
  2. com/classes/Ajax.php +104 -72
  3. com/classes/ConditionCreator.php +14 -14
  4. com/classes/Feedback.php +10 -6
  5. com/classes/Notification.php +2 -2
  6. com/classes/NotificationCenter.php +11 -8
  7. com/classes/PopupChecker.php +1 -1
  8. com/classes/RegisterPostType.php +2 -2
  9. com/classes/SGPBRequirementsChecker.php +1 -1
  10. com/classes/ScriptsLoader.php +3 -3
  11. com/classes/Updates.php +3 -3
  12. com/classes/components/Menu.php +2 -2
  13. com/classes/dataTable/Subscribers.php +17 -14
  14. com/classes/popups/FblikePopup.php +5 -4
  15. com/classes/popups/SGPopup.php +10 -8
  16. com/config/configPackage.php +1 -1
  17. com/helpers/AdminHelper.php +147 -20
  18. com/helpers/Functions.php +2 -1
  19. com/helpers/MultipleChoiceButton.php +2 -1
  20. com/libs/ListTable.php +42 -38
  21. com/libs/Table.php +18 -17
  22. popup-builder.php +1 -1
  23. public/views/behaviorAfterSpecialEventsView.php +1 -1
  24. public/views/closeSettingsView.php +52 -52
  25. public/views/conditionsView.php +18 -18
  26. public/views/customEditor.php +2 -2
  27. public/views/debugReport.php +2 -4
  28. public/views/dimensionsView.php +18 -16
  29. public/views/eventsView.php +2 -1
  30. public/views/floatingButton.php +31 -31
  31. public/views/htmlCustomButtonElement.php +32 -32
  32. public/views/importConfigView.php +5 -5
  33. public/views/importPopupsView.php +1 -1
  34. public/views/jsVariableView.php +10 -10
  35. public/views/license.php +7 -7
  36. public/views/main/image.php +1 -1
  37. public/views/mainActionButtons.php +6 -6
  38. public/views/mediaButton.php +9 -8
  39. public/views/newsletter.php +27 -27
  40. public/views/options/facebook.php +6 -4
  41. public/views/options/subscription.php +79 -77
  42. public/views/optionsView.php +49 -47
  43. public/views/otherConditionsView.php +5 -5
  44. public/views/popupDesignView.php +41 -41
  45. public/views/popupOpeningCounter.php +3 -3
  46. public/views/popupTypes.php +14 -13
  47. public/views/settings.php +14 -14
  48. public/views/subscribers.php +22 -22
  49. public/views/targetView.php +4 -2
  50. readme.txt +8 -2
com/classes/Actions.php CHANGED
@@ -74,29 +74,29 @@ class Actions
74
  public function custom_admin_js()
75
  {
76
  $currentPostType = AdminHelper::getCurrentPostType();
77
- if (!empty($currentPostType) && ($currentPostType == SG_POPUP_POST_TYPE || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE || $currentPostType == SG_POPUP_TEMPLATE_POST_TYPE)) {
78
- ?>
79
- <script type="text/javascript">
80
- jQuery(document).ready(function($) {
81
- const myForm = $('#posts-filter');
82
- myForm.addClass('sgpb-table');
83
- const searchValue = $('#post-search-input').val();
84
- $('#posts-filter .tablenav.top .tablenav-pages').append($('.subsubsub').addClass('show'));
85
- myForm.append($('#posts-filter .tablenav.bottom .tablenav-pages:not(.no-pages, .one-page) .pagination-links'));
86
- $('#sgpbSearchInPosts').val(searchValue);
87
- $('#sgpbSearchInPosts').keyup('enter', function (e) {
88
- if (e.key === 'Enter') {
89
- $('#post-search-input').val(this.value);
90
- $(myForm).submit();
91
- }
92
- });
93
- $('#sgpbSearchInPostsSubmit').on('click', function () {
94
- $('#post-search-input').val($('#sgpbSearchInPosts').val());
95
- $(myForm).submit();
96
- })
97
- });
98
- </script>
99
- <?php
100
  }
101
  }
102
 
@@ -113,7 +113,7 @@ class Actions
113
 
114
  public function removeUnneededMetaboxesFromPopups()
115
  {
116
- if (isset($_GET['post_type']) && $_GET['post_type'] == SG_POPUP_POST_TYPE) {
117
  $exlcudeTrPopupTypes = array(
118
  'image',
119
  'video',
@@ -122,7 +122,7 @@ class Actions
122
  'pdf'
123
  );
124
  $exlcudeTrPopupTypes = apply_filters('sgpbNoMcePopupTypes', $exlcudeTrPopupTypes);
125
- if (isset($_GET['sgpb_type']) && in_array($_GET['sgpb_type'], $exlcudeTrPopupTypes)) {
126
  remove_meta_box('icl_div', SG_POPUP_POST_TYPE, 'side');
127
  }
128
  }
@@ -141,31 +141,57 @@ class Actions
141
  {
142
  $currentPostType = AdminHelper::getCurrentPostType();
143
  if (!empty($currentPostType) && ($currentPostType == SG_POPUP_POST_TYPE || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE || $currentPostType == SG_POPUP_TEMPLATE_POST_TYPE)) {
144
- echo '<style>
145
- #save-post {
 
 
 
146
  display:none !important;
147
  }
148
- .subsubsub {
 
 
 
149
  display:none !important;
150
  }
151
- .subsubsub.show {
 
 
 
152
  display:block !important;
153
  }
154
- .search-box {
 
 
 
155
  display:none !important;
156
  }
157
- .search-box.show {
 
 
 
158
  display:block !important;
159
  }
160
- .tablenav-pages.no-pages {
 
 
 
161
  display: block;
162
  }
163
- .tablenav-pages *:not(.subsubsub, .subsubsub *),
164
- .tablenav-pages.no-pages *:not(.subsubsub, .subsubsub *),
165
- .tablenav-pages.one-page *:not(.subsubsub, .subsubsub *) {
 
 
 
 
 
 
 
166
  display: none;
167
  }
168
  </style>';
 
169
  }
170
  }
171
 
@@ -187,7 +213,7 @@ class Actions
187
 
188
  }
189
  $licenseSectionUrl = menu_page_url(SGPB_POPUP_LICENSE, false);
190
- $partOfContent = '<br><br>'.__('<a href="'.esc_url($licenseSectionUrl).'">Follow the link</a> to finalize the activation.', SG_POPUP_TEXT_DOMAIN);
191
  if (function_exists('get_current_screen')) {
192
  $screen = get_current_screen();
193
  $screenId = $screen->id;
@@ -202,19 +228,19 @@ class Actions
202
  ?>
203
  <div id="welcome-panel" class="update-nag sgpb-extensions-notices sgpb-license-notice">
204
  <div class="welcome-panel-content">
205
- <b><?php _e('Thank you for choosing our plugin!', SG_POPUP_TEXT_DOMAIN) ?></b>
206
  <br>
207
  <br>
208
- <b><?php _e('You have activated Popup Builder extension(s). Please, don\'t forget to activate the license key(s) as well.', SG_POPUP_TEXT_DOMAIN) ?></b>
209
- <b><?php echo $partOfContent; ?></b>
210
  </div>
211
- <button type="button" class="notice-dismiss" onclick="jQuery('.sgpb-license-notice').remove();"><span class="screen-reader-text"><?php _e('Dismiss this notice.', SG_POPUP_TEXT_DOMAIN) ?></span></button>
212
- <span class="sgpb-dont-show-again-license-notice"><?php _e('Don\'t show again.', SG_POPUP_TEXT_DOMAIN); ?></span>
213
  </div>
214
  <?php
215
  $content = ob_get_clean();
216
 
217
- echo $content;
218
  return true;
219
  }
220
  }
@@ -225,13 +251,14 @@ class Actions
225
  return false;
226
  }
227
 
228
- echo '<style>
229
  #misc-publishing-actions .edit-post-status,
230
  #misc-publishing-actions .edit-timestamp,
231
  #misc-publishing-actions .edit-visibility {
232
  display:none !important;
233
  }
234
  </style>';
 
235
  }
236
 
237
  public function hidePageBuilderEditButtons($postId = 0, $post = array())
@@ -248,11 +275,12 @@ class Actions
248
 
249
  $popupType = AdminHelper::getCurrentPopupType();
250
  if (in_array($popupType, $excludedPopupTypesFromPageBuildersFunctionality)) {
251
- echo '<style>
252
  #elementor-switch-mode, #elementor-editor {
253
  display:none !important;
254
  }
255
  </style>';
 
256
  }
257
  }
258
 
@@ -363,7 +391,7 @@ class Actions
363
 
364
  public function preGetPosts($query)
365
  {
366
- if (!is_admin() || !isset($_GET['post_type']) || $_GET['post_type'] != SG_POPUP_POST_TYPE) {
367
  return false;
368
  }
369
 
@@ -384,7 +412,7 @@ class Actions
384
  $screenId = $screen->id;
385
  if ($screenId == 'edit-popupbuilder') {
386
  $notificationsObj = new SGPBNotificationCenter();
387
- echo $notificationsObj->displayNotifications();
388
  }
389
  }
390
  $extensions = AdminHelper::getAllActiveExtensions();
@@ -400,7 +428,7 @@ class Actions
400
  $alertProblem = get_option('sgpb_alert_problems');
401
  // for old users show alert about problems
402
  if (!$alertProblem) {
403
- echo AdminHelper::renderAlertProblem();
404
  }
405
 
406
  // Don't show the banner if there's not any extension of Popup Builder or if the user has clicked "don't show"
@@ -412,13 +440,13 @@ class Actions
412
  ?>
413
  <div id="welcome-panel" class="update-nag sgpb-extensions-notices">
414
  <div class="welcome-panel-content">
415
- <?php echo AdminHelper::renderExtensionsContent(); ?>
416
  </div>
417
  </div>
418
  <?php
419
  $content = ob_get_clean();
420
 
421
- echo $content;
422
  return true;
423
  }
424
 
@@ -458,7 +486,7 @@ class Actions
458
  if (function_exists('get_current_screen')) {
459
  $screen = get_current_screen();
460
  if (!empty($screen)) {
461
- echo new MediaButton();
462
  }
463
  }
464
  }
@@ -470,7 +498,7 @@ class Actions
470
  $this->mediaButton = true;
471
  add_action('admin_footer', function() {
472
  self::enqueueScriptsForPageBuilders();
473
- echo new MediaButton(false);
474
  });
475
  }
476
 
@@ -853,14 +881,14 @@ class Actions
853
 
854
  public function postTypeInit()
855
  {
856
- if (isset($_POST['sgpb-is-preview']) && $_POST['sgpb-is-preview'] == 1) {
857
  $postId = sanitize_text_field($_POST['post_ID']);
858
  $post = get_post($postId);
859
  $this->savePost($postId, $post, false);
860
  }
861
  $adminUrl = admin_url();
862
 
863
- if (isset($_GET['page']) && $_GET['page'] == 'PopupBuilder') {
864
  _e('<span>Popup Builder plugin has been successfully updated. Please <a href="'.esc_url($adminUrl).'edit.php?post_type='.SG_POPUP_POST_TYPE.'">click here</a> to go to the new Dashboard of the plugin.</span>', SG_POPUP_TEXT_DOMAIN);
865
  wp_die();
866
  }
@@ -923,7 +951,10 @@ class Actions
923
  }
924
  $allowToAction = AdminHelper::userCanAccessTo();
925
  Functions::clearAllTransients();
926
- array_walk_recursive($_POST, 'sanitize_text_field');
 
 
 
927
  $postData = SGPopup::parsePopupDataFromData($_POST);
928
  $saveMode = '';
929
  $postData['sgpb-post-id'] = $postId;
@@ -1032,14 +1063,17 @@ class Actions
1032
  }
1033
 
1034
  if ($column == 'shortcode') {
1035
- echo '<input type="text" onfocus="this.select();" readonly value="[sg_popup id='.esc_attr($postId).']" class="large-text code">';
 
1036
  }
1037
  if ($column == 'className') {
1038
- echo '<input type="text" onfocus="this.select();" readonly value="sg-popup-id-'.esc_attr($postId).'" class="large-text code">';
 
1039
  }
1040
  else if ($column == 'counter') {
1041
  $count = $popup->getPopupOpeningCountById($postId);
1042
- echo '<div ><span>'.$count.'</span>'.'<input onclick="SGPBBackend.resetCount('.esc_attr($postId).', true);" type="button" name="" class="sgpb-btn sgpb-btn-dark-outline" value="'.__('reset', SG_POPUP_TEXT_DOMAIN).'"></div>';
 
1043
  }
1044
  else if ($column == 'type') {
1045
  global $SGPB_POPUP_TYPES;
@@ -1047,22 +1081,23 @@ class Actions
1047
  if (isset($SGPB_POPUP_TYPES['typeLabels'][$type])) {
1048
  $type = $SGPB_POPUP_TYPES['typeLabels'][$type];
1049
  }
1050
- echo $type;
1051
  }
1052
  else if ($column == 'onOff') {
1053
  $popupPostStatus = get_post_status($postId);
1054
- if ($popupPostStatus == 'publish' || $popupPostStatus == 'draft') {
1055
  $isActive = $popup->getOptionValue('sgpb-is-active', true);
1056
  }
1057
  $checked = isset($isActive) && $isActive ? 'checked' : '';
1058
- echo '<label class="sgpb-switch">
1059
- <input class="sg-switch-checkbox sgpb-popup-status-js" value="1" data-switch-id="'.esc_attr($postId).'" type="checkbox" '.esc_html($checked).'>
1060
  <div class="sgpb-slider sgpb-round"></div>
1061
  </label>';
 
1062
  }
1063
  else if ($column == 'sgpbIsRandomEnabled') {
1064
  $showValues = apply_filters('sgpbAddRandomTableColumnValues', $postId);
1065
- echo $showValues;
1066
  }
1067
  else if ($column == 'options') {
1068
  $cloneUrl = AdminHelper::popupGetClonePostLink($postId);
@@ -1076,7 +1111,7 @@ class Actions
1076
  <img src="'.SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg" alt="Remove" class="icon_remove" onclick="location.href=\''.get_delete_post_link($postId).'\'">
1077
  </div>';
1078
 
1079
- echo $actionButtons;
1080
  }
1081
  }
1082
 
@@ -1086,7 +1121,7 @@ class Actions
1086
  */
1087
  public function popupSaveAsNew($status = '')
1088
  {
1089
- if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'popupSaveAsNew' == $_REQUEST['action']))) {
1090
  wp_die(esc_html__('No post to duplicate has been supplied!', SG_POPUP_TEXT_DOMAIN));
1091
  }
1092
  // Get the original post
@@ -1130,7 +1165,7 @@ class Actions
1130
 
1131
  }
1132
  else {
1133
- wp_die(esc_html__('Copy creation failed, could not find original:', SG_POPUP_TEXT_DOMAIN).' '.htmlspecialchars($id));
1134
  }
1135
  }
1136
 
@@ -1390,7 +1425,7 @@ class Actions
1390
  header('Content-Type: application/octet-stream');
1391
  header('Content-Disposition: attachment; filename=subscribersList.csv;');
1392
  header('Content-Transfer-Encoding: binary');
1393
- echo $content;
1394
  }
1395
 
1396
  public function getSystemInfoFile()
@@ -1410,7 +1445,7 @@ class Actions
1410
  header('Content-Disposition: attachment; filename=popupBuilderSystemInfo.txt;');
1411
  header('Content-Transfer-Encoding: binary');
1412
 
1413
- echo $content;
1414
  }
1415
 
1416
  public function saveSettings()
@@ -1421,23 +1456,27 @@ class Actions
1421
  exit();
1422
  }
1423
 
1424
- array_walk_recursive($_POST, 'sanitize_text_field');
1425
- $postData = $_POST;
1426
  $deleteData = 0;
1427
  $enableDebugMode = 0;
 
1428
 
1429
- if (isset($postData['sgpb-dont-delete-data'])) {
1430
  $deleteData = 1;
1431
  }
1432
- if (isset($postData['sgpb-enable-debug-mode'])) {
1433
  $enableDebugMode = 1;
1434
  }
1435
- if (isset($postData['sgpb-disable-analytics-general'])) {
1436
  $disableAnalytics = 1;
1437
  }
1438
- $userRoles = @$postData['sgpb-user-roles'];
1439
-
1440
- update_option('sgpb-user-roles', $userRoles);
 
 
 
 
 
1441
  update_option('sgpb-dont-delete-data', $deleteData);
1442
  update_option('sgpb-enable-debug-mode', $enableDebugMode);
1443
  update_option('sgpb-disable-analytics-general', $disableAnalytics);
74
  public function custom_admin_js()
75
  {
76
  $currentPostType = AdminHelper::getCurrentPostType();
77
+ if(!empty($currentPostType) && ($currentPostType == SG_POPUP_POST_TYPE || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE || $currentPostType == SG_POPUP_TEMPLATE_POST_TYPE)) {
78
+ ?>
79
+ <script type="text/javascript">
80
+ jQuery(document).ready(function ($) {
81
+ const myForm = $('.post-type-popupbuilder #posts-filter, .post-type-sgpbtemplate #posts-filter, .post-type-sgpbtemplate #posts-filter');
82
+ myForm.addClass('sgpb-table');
83
+ const searchValue = $('.post-type-popupbuilder #post-search-input, .post-type-sgpbtemplate #posts-filter, .post-type-sgpbautoresponder #posts-filter').val();
84
+ $('.post-type-popupbuilder #posts-filter .tablenav.top .tablenav-pages, .post-type-sgpbtemplate #posts-filter .tablenav.top .tablenav-pages, .post-type-sgpbautoresponder #posts-filter .tablenav.top .tablenav-pages').append($('.subsubsub').addClass('show'));
85
+ myForm.append($('.post-type-popupbuilder #posts-filter .tablenav.bottom .tablenav-pages:not(.no-pages, .one-page) .pagination-links, .post-type-sgpbtemplate #posts-filter .tablenav.bottom .tablenav-pages:not(.no-pages, .one-page) .pagination-links, .post-type-sgpbautoresponder #posts-filter .tablenav.bottom .tablenav-pages:not(.no-pages, .one-page) .pagination-links'));
86
+ $('#sgpbSearchInPosts').val(searchValue);
87
+ $('#sgpbSearchInPosts').keyup('enter', function (e) {
88
+ if (e.key === 'Enter') {
89
+ $('.post-type-popupbuilder #post-search-input, .post-type-sgpbtemplate #post-search-input, .post-type-sgpbautoresponder #post-search-input').val(this.value);
90
+ $(myForm).submit();
91
+ }
92
+ });
93
+ $('#sgpbSearchInPostsSubmit').on('click', function () {
94
+ $('.post-type-popupbuilder #post-search-input, .post-type-sgpbtemplate #post-search-input, .post-type-sgpbautoresponder #post-search-input').val($('#sgpbSearchInPosts').val());
95
+ $(myForm).submit();
96
+ })
97
+ });
98
+ </script>
99
+ <?php
100
  }
101
  }
102
 
113
 
114
  public function removeUnneededMetaboxesFromPopups()
115
  {
116
+ if (isset($_GET['post_type']) && sanitize_text_field($_GET['post_type']) == SG_POPUP_POST_TYPE) {
117
  $exlcudeTrPopupTypes = array(
118
  'image',
119
  'video',
122
  'pdf'
123
  );
124
  $exlcudeTrPopupTypes = apply_filters('sgpbNoMcePopupTypes', $exlcudeTrPopupTypes);
125
+ if (isset($_GET['sgpb_type']) && in_array(sanitize_text_field($_GET['sgpb_type']), $exlcudeTrPopupTypes)) {
126
  remove_meta_box('icl_div', SG_POPUP_POST_TYPE, 'side');
127
  }
128
  }
141
  {
142
  $currentPostType = AdminHelper::getCurrentPostType();
143
  if (!empty($currentPostType) && ($currentPostType == SG_POPUP_POST_TYPE || $currentPostType == SG_POPUP_AUTORESPONDER_POST_TYPE || $currentPostType == SG_POPUP_TEMPLATE_POST_TYPE)) {
144
+ $styles = '<style>
145
+ .post-type-popupbuilder #save-post,
146
+ .post-type-sgpbtemplate #save-post,
147
+ .post-type-sgpbautoresponder #save-post
148
+ {
149
  display:none !important;
150
  }
151
+ .post-type-popupbuilder .subsubsub,
152
+ .post-type-sgpbtemplate .subsubsub,
153
+ .post-type-sgpbautoresponder .subsubsub
154
+ {
155
  display:none !important;
156
  }
157
+ .post-type-popupbuilder .subsubsub.show,
158
+ .post-type-sgpbtemplate .subsubsub.show,
159
+ .post-type-sgpbautoresponder .subsubsub.show
160
+ {
161
  display:block !important;
162
  }
163
+ .post-type-popupbuilder .search-box,
164
+ .post-type-sgpbtemplate .search-box,
165
+ .post-type-sgpbautoresponder .search-box
166
+ {
167
  display:none !important;
168
  }
169
+ .post-type-popupbuilder .search-box.show,
170
+ .post-type-sgpbtemplate .search-box.show,
171
+ .post-type-sgpbautoresponder .search-box.show
172
+ {
173
  display:block !important;
174
  }
175
+ .post-type-popupbuilder .tablenav-pages.no-pages,
176
+ .post-type-sgpbtemplate .tablenav-pages.no-pages,
177
+ .post-type-sgpbautoresponder .tablenav-pages.no-pages
178
+ {
179
  display: block;
180
  }
181
+ .post-type-popupbuilder .tablenav-pages *:not(.subsubsub, .subsubsub *),
182
+ .post-type-sgpbtemplate .tablenav-pages *:not(.subsubsub, .subsubsub *),
183
+ .post-type-sgpbautoresponder .tablenav-pages *:not(.subsubsub, .subsubsub *),
184
+ .post-type-popupbuilder .tablenav-pages.no-pages *:not(.subsubsub, .subsubsub *),
185
+ .post-type-sgpbtemplate .tablenav-pages.no-pages *:not(.subsubsub, .subsubsub *),
186
+ .post-type-sgpbautoresponder .tablenav-pages.no-pages *:not(.subsubsub, .subsubsub *),
187
+ .post-type-popupbuilder .tablenav-pages.one-page *:not(.subsubsub, .subsubsub *),
188
+ .post-type-sgpbtemplate .tablenav-pages.one-page *:not(.subsubsub, .subsubsub *),
189
+ .post-type-sgpbautoresponder .tablenav-pages.one-page *:not(.subsubsub, .subsubsub *)
190
+ {
191
  display: none;
192
  }
193
  </style>';
194
+ echo wp_kses($styles, AdminHelper::allowed_html_tags());
195
  }
196
  }
197
 
213
 
214
  }
215
  $licenseSectionUrl = menu_page_url(SGPB_POPUP_LICENSE, false);
216
+ $partOfContent = '<br><br><a href="'.esc_url($licenseSectionUrl).'">'.__('Follow the link', SG_POPUP_TEXT_DOMAIN).'</a> '.__('to finalize the activation.', SG_POPUP_TEXT_DOMAIN);
217
  if (function_exists('get_current_screen')) {
218
  $screen = get_current_screen();
219
  $screenId = $screen->id;
228
  ?>
229
  <div id="welcome-panel" class="update-nag sgpb-extensions-notices sgpb-license-notice">
230
  <div class="welcome-panel-content">
231
+ <b><?php esc_html_e('Thank you for choosing our plugin!', SG_POPUP_TEXT_DOMAIN) ?></b>
232
  <br>
233
  <br>
234
+ <b><?php esc_html_e('You have activated Popup Builder extension(s). Please, don\'t forget to activate the license key(s) as well.', SG_POPUP_TEXT_DOMAIN) ?></b>
235
+ <b><?php echo wp_kses($partOfContent, AdminHelper::allowed_html_tags()); ?></b>
236
  </div>
237
+ <button type="button" class="notice-dismiss" onclick="jQuery('.sgpb-license-notice').remove();"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', SG_POPUP_TEXT_DOMAIN) ?></span></button>
238
+ <span class="sgpb-dont-show-again-license-notice"><?php esc_html_e('Don\'t show again.', SG_POPUP_TEXT_DOMAIN); ?></span>
239
  </div>
240
  <?php
241
  $content = ob_get_clean();
242
 
243
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
244
  return true;
245
  }
246
  }
251
  return false;
252
  }
253
 
254
+ $styles = '<style>
255
  #misc-publishing-actions .edit-post-status,
256
  #misc-publishing-actions .edit-timestamp,
257
  #misc-publishing-actions .edit-visibility {
258
  display:none !important;
259
  }
260
  </style>';
261
+ echo wp_kses($styles, AdminHelper::allowed_html_tags());
262
  }
263
 
264
  public function hidePageBuilderEditButtons($postId = 0, $post = array())
275
 
276
  $popupType = AdminHelper::getCurrentPopupType();
277
  if (in_array($popupType, $excludedPopupTypesFromPageBuildersFunctionality)) {
278
+ $style = '<style>
279
  #elementor-switch-mode, #elementor-editor {
280
  display:none !important;
281
  }
282
  </style>';
283
+ echo wp_kses($style, AdminHelper::allowed_html_tags());
284
  }
285
  }
286
 
391
 
392
  public function preGetPosts($query)
393
  {
394
+ if (!is_admin() || !isset($_GET['post_type']) || sanitize_text_field($_GET['post_type']) != SG_POPUP_POST_TYPE) {
395
  return false;
396
  }
397
 
412
  $screenId = $screen->id;
413
  if ($screenId == 'edit-popupbuilder') {
414
  $notificationsObj = new SGPBNotificationCenter();
415
+ echo wp_kses($notificationsObj->displayNotifications(), AdminHelper::allowed_html_tags());
416
  }
417
  }
418
  $extensions = AdminHelper::getAllActiveExtensions();
428
  $alertProblem = get_option('sgpb_alert_problems');
429
  // for old users show alert about problems
430
  if (!$alertProblem) {
431
+ echo wp_kses(AdminHelper::renderAlertProblem(), AdminHelper::allowed_html_tags());
432
  }
433
 
434
  // Don't show the banner if there's not any extension of Popup Builder or if the user has clicked "don't show"
440
  ?>
441
  <div id="welcome-panel" class="update-nag sgpb-extensions-notices">
442
  <div class="welcome-panel-content">
443
+ <?php echo wp_kses(AdminHelper::renderExtensionsContent(), AdminHelper::allowed_html_tags()); ?>
444
  </div>
445
  </div>
446
  <?php
447
  $content = ob_get_clean();
448
 
449
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
450
  return true;
451
  }
452
 
486
  if (function_exists('get_current_screen')) {
487
  $screen = get_current_screen();
488
  if (!empty($screen)) {
489
+ echo wp_kses(new MediaButton(), AdminHelper::allowed_html_tags());
490
  }
491
  }
492
  }
498
  $this->mediaButton = true;
499
  add_action('admin_footer', function() {
500
  self::enqueueScriptsForPageBuilders();
501
+ echo wp_kses(new MediaButton(false), AdminHelper::allowed_html_tags());
502
  });
503
  }
504
 
881
 
882
  public function postTypeInit()
883
  {
884
+ if (isset($_POST['sgpb-is-preview']) && $_POST['sgpb-is-preview'] == 1 && isset($_POST['post_ID'])) {
885
  $postId = sanitize_text_field($_POST['post_ID']);
886
  $post = get_post($postId);
887
  $this->savePost($postId, $post, false);
888
  }
889
  $adminUrl = admin_url();
890
 
891
+ if (isset($_GET['page']) && sanitize_text_field($_GET['page']) == 'PopupBuilder') {
892
  _e('<span>Popup Builder plugin has been successfully updated. Please <a href="'.esc_url($adminUrl).'edit.php?post_type='.SG_POPUP_POST_TYPE.'">click here</a> to go to the new Dashboard of the plugin.</span>', SG_POPUP_TEXT_DOMAIN);
893
  wp_die();
894
  }
951
  }
952
  $allowToAction = AdminHelper::userCanAccessTo();
953
  Functions::clearAllTransients();
954
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
955
+ array_walk_recursive($_POST, function(&$item){
956
+ $item = sanitize_text_field($item);
957
+ });
958
  $postData = SGPopup::parsePopupDataFromData($_POST);
959
  $saveMode = '';
960
  $postData['sgpb-post-id'] = $postId;
1063
  }
1064
 
1065
  if ($column == 'shortcode') {
1066
+ $shortcodeInput = '<input type="text" onfocus="this.select();" readonly value="[sg_popup id='.esc_attr($postId).']" class="large-text code">';
1067
+ echo wp_kses($shortcodeInput, AdminHelper::allowed_html_tags());
1068
  }
1069
  if ($column == 'className') {
1070
+ $className = '<input type="text" onfocus="this.select();" readonly value="sg-popup-id-'.esc_attr($postId).'" class="large-text code">';
1071
+ echo wp_kses($className, AdminHelper::allowed_html_tags());
1072
  }
1073
  else if ($column == 'counter') {
1074
  $count = $popup->getPopupOpeningCountById($postId);
1075
+ $counter = '<div ><span>'.$count.'</span>'.'<input onclick="SGPBBackend.resetCount('.esc_attr($postId).', true);" type="button" name="" class="sgpb-btn sgpb-btn-dark-outline" value="'.__('reset', SG_POPUP_TEXT_DOMAIN).'"></div>';
1076
+ echo wp_kses($counter, AdminHelper::allowed_html_tags());
1077
  }
1078
  else if ($column == 'type') {
1079
  global $SGPB_POPUP_TYPES;
1081
  if (isset($SGPB_POPUP_TYPES['typeLabels'][$type])) {
1082
  $type = $SGPB_POPUP_TYPES['typeLabels'][$type];
1083
  }
1084
+ echo esc_html($type);
1085
  }
1086
  else if ($column == 'onOff') {
1087
  $popupPostStatus = get_post_status($postId);
1088
+ if ($popupPostStatus == 'publish' || $popupPostStatus == 'draft'|| $popupPostStatus == 'private') {
1089
  $isActive = $popup->getOptionValue('sgpb-is-active', true);
1090
  }
1091
  $checked = isset($isActive) && $isActive ? 'checked' : '';
1092
+ $switcher = '<label class="sgpb-switch">
1093
+ <input class="sg-switch-checkbox sgpb-popup-status-js" value="1" data-switch-id="'.esc_attr($postId).'" type="checkbox" '.esc_attr($checked).'>
1094
  <div class="sgpb-slider sgpb-round"></div>
1095
  </label>';
1096
+ echo wp_kses($switcher, AdminHelper::allowed_html_tags());
1097
  }
1098
  else if ($column == 'sgpbIsRandomEnabled') {
1099
  $showValues = apply_filters('sgpbAddRandomTableColumnValues', $postId);
1100
+ echo wp_kses($showValues, AdminHelper::allowed_html_tags());
1101
  }
1102
  else if ($column == 'options') {
1103
  $cloneUrl = AdminHelper::popupGetClonePostLink($postId);
1111
  <img src="'.SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg" alt="Remove" class="icon_remove" onclick="location.href=\''.get_delete_post_link($postId).'\'">
1112
  </div>';
1113
 
1114
+ echo wp_kses($actionButtons, AdminHelper::allowed_html_tags());
1115
  }
1116
  }
1117
 
1121
  */
1122
  public function popupSaveAsNew($status = '')
1123
  {
1124
+ if (!(isset($_GET['post']) || isset($_POST['post']) || (isset($_REQUEST['action']) && 'popupSaveAsNew' == sanitize_text_field($_REQUEST['action'])))) {
1125
  wp_die(esc_html__('No post to duplicate has been supplied!', SG_POPUP_TEXT_DOMAIN));
1126
  }
1127
  // Get the original post
1165
 
1166
  }
1167
  else {
1168
+ wp_die(esc_html__('Copy creation failed, could not find original: '.$id, SG_POPUP_TEXT_DOMAIN));
1169
  }
1170
  }
1171
 
1425
  header('Content-Type: application/octet-stream');
1426
  header('Content-Disposition: attachment; filename=subscribersList.csv;');
1427
  header('Content-Transfer-Encoding: binary');
1428
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
1429
  }
1430
 
1431
  public function getSystemInfoFile()
1445
  header('Content-Disposition: attachment; filename=popupBuilderSystemInfo.txt;');
1446
  header('Content-Transfer-Encoding: binary');
1447
 
1448
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
1449
  }
1450
 
1451
  public function saveSettings()
1456
  exit();
1457
  }
1458
 
 
 
1459
  $deleteData = 0;
1460
  $enableDebugMode = 0;
1461
+ $disableAnalytics = 0;
1462
 
1463
+ if (isset($_POST['sgpb-dont-delete-data'])) {
1464
  $deleteData = 1;
1465
  }
1466
+ if (isset($_POST['sgpb-enable-debug-mode'])) {
1467
  $enableDebugMode = 1;
1468
  }
1469
+ if (isset($_POST['sgpb-disable-analytics-general'])) {
1470
  $disableAnalytics = 1;
1471
  }
1472
+ if (!empty($_POST['sgpb-user-roles'])){
1473
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1474
+ $userRoles = $_POST['sgpb-user-roles'];
1475
+ array_walk_recursive($userRoles, function(&$item){
1476
+ $item = sanitize_text_field($item);
1477
+ });
1478
+ update_option('sgpb-user-roles', $userRoles);
1479
+ }
1480
  update_option('sgpb-dont-delete-data', $deleteData);
1481
  update_option('sgpb-enable-debug-mode', $enableDebugMode);
1482
  update_option('sgpb-disable-analytics-general', $disableAnalytics);
com/classes/Ajax.php CHANGED
@@ -92,8 +92,10 @@ class Ajax
92
  wp_die('');
93
  }
94
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
95
-
96
- $popupId = @(int)sanitize_text_field($_POST['post_ID']);
 
 
97
  $postStatus = get_post_status($popupId);
98
  if($postStatus == 'publish') {
99
  wp_die('');
@@ -102,8 +104,12 @@ class Ajax
102
  if(!isset($_POST['allPopupData'])) {
103
  wp_die(true);
104
  }
105
- array_walk_recursive($_POST['allPopupData'], 'sanitize_text_field');
106
- $allPopupData = $_POST['allPopupData'];
 
 
 
 
107
  $popupData = SGPopup::parsePopupDataFromData($allPopupData);
108
  do_action('save_post_popupbuilder');
109
  $popupType = $popupData['sgpb-type'];
@@ -129,7 +135,7 @@ class Ajax
129
  public function changeReviewPopupPeriod()
130
  {
131
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
132
- $messageType = sanitize_text_field($_POST['messageType']);
133
 
134
  if($messageType == 'count') {
135
  $maxPopupCount = get_option('SGPBMaxOpenCount');
@@ -164,7 +170,9 @@ class Ajax
164
  public function resetPopupOpeningCount()
165
  {
166
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
167
-
 
 
168
  global $wpdb;
169
 
170
  $tableName = $wpdb->prefix.'sgpb_analytics';
@@ -174,7 +182,8 @@ class Ajax
174
  SGPopup::deleteAnalyticsDataByPopupId($popupId);
175
  }
176
  if(empty($allPopupsCount)) {
177
- echo SGPB_AJAX_STATUS_FALSE;
 
178
  wp_die();
179
  }
180
  if(isset($allPopupsCount[$popupId])) {
@@ -193,7 +202,7 @@ class Ajax
193
  {
194
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
195
  update_option('sgpbDontShowAskReviewBanner', 1);
196
- echo SGPB_AJAX_STATUS_TRUE;
197
  wp_die();
198
  }
199
 
@@ -201,7 +210,7 @@ class Ajax
201
  {
202
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
203
  update_option('sgpb_alert_problems', 1);
204
- echo SGPB_AJAX_STATUS_TRUE;
205
  wp_die();
206
  }
207
 
@@ -209,7 +218,7 @@ class Ajax
209
  {
210
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
211
  update_option('sgpb_extensions_updated', 1);
212
- echo SGPB_AJAX_STATUS_TRUE;
213
  wp_die();
214
  }
215
 
@@ -235,10 +244,13 @@ class Ajax
235
  if(isset($_GET['sg_popup_preview_id']) && !isset($_POST['params'])) {
236
  wp_die(0);
237
  }
238
-
239
- /* Sanitizing multidimensional array */
240
- array_walk_recursive($_POST['params'], 'sanitize_text_field');
241
  $popupParams = $_POST['params'];
 
 
 
 
242
 
243
  $popupsIdCollection = is_array($popupParams['popupsIdCollection']) ? $popupParams['popupsIdCollection'] : array();
244
  $popupsCounterData = get_option('SgpbCounter');
@@ -264,6 +276,9 @@ class Ajax
264
 
265
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
266
 
 
 
 
267
  $subscribersId = array_map('sanitize_text_field', $_POST['subscribersId']);
268
 
269
  foreach($subscribersId as $subscriberId) {
@@ -278,12 +293,17 @@ class Ajax
278
 
279
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
280
  $status = SGPB_AJAX_STATUS_FALSE;
281
- $firstName = sanitize_text_field($_POST['firstName']);
282
- $lastName = sanitize_text_field($_POST['lastName']);
283
- $email = sanitize_text_field($_POST['email']);
284
  $date = date('Y-m-d');
285
- array_walk_recursive($_POST['popups'], 'sanitize_text_field');
286
- $subscriptionPopupsId = $_POST['popups'];
 
 
 
 
 
287
 
288
  foreach($subscriptionPopupsId as $subscriptionPopupId) {
289
  $selectSql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s AND subscriptionType = %d', $email, $subscriptionPopupId);
@@ -304,21 +324,21 @@ class Ajax
304
  }
305
  }
306
 
307
- echo $status;
308
  wp_die();
309
  }
310
 
311
  public function importSubscribers()
312
  {
313
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
314
- $formId = (int)sanitize_text_field($_POST['popupSubscriptionList']);
315
- $fileURL = sanitize_text_field($_POST['importListURL']);
316
  ob_start();
317
  require_once SG_POPUP_VIEWS_PATH.'importConfigView.php';
318
  $content = ob_get_contents();
319
  ob_end_clean();
320
 
321
- echo $content;
322
  wp_die();
323
  }
324
 
@@ -330,7 +350,7 @@ class Ajax
330
  $content = ob_get_contents();
331
  ob_end_clean();
332
 
333
- echo $content;
334
  wp_die();
335
  }
336
 
@@ -338,10 +358,14 @@ class Ajax
338
  {
339
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
340
  @ini_set('auto_detect_line_endings', '1');
341
- $formId = (int)sanitize_text_field($_POST['popupSubscriptionList']);
342
- $fileURL = sanitize_text_field($_POST['importListURL']);
343
- array_walk_recursive($_POST['namesMapping'], 'sanitize_text_field' );
344
- $mapping = $_POST['namesMapping'];
 
 
 
 
345
 
346
  $fileContent = AdminHelper::getFileFromURL($fileURL);
347
  $csvFileArray = array_map('str_getcsv', file($fileURL));
@@ -370,7 +394,7 @@ class Ajax
370
  }
371
  }
372
 
373
- echo SGPB_AJAX_STATUS_TRUE;
374
  wp_die();
375
  }
376
 
@@ -384,7 +408,12 @@ class Ajax
384
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
385
  global $wpdb;
386
 
387
- $newsletterData = stripslashes_deep($_POST['newsletterData']);
 
 
 
 
 
388
  if(isset($newsletterData['testSendingStatus']) && $newsletterData['testSendingStatus'] == 'test') {
389
  AdminHelper::sendTestNewsletter($newsletterData);
390
  }
@@ -405,13 +434,13 @@ class Ajax
405
  {
406
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
407
 
408
- $url = esc_url_raw($_POST['iframeUrl']);
409
  $status = SGPB_AJAX_STATUS_FALSE;
410
 
411
  $remoteGet = wp_remote_get($url);
412
 
413
  if(is_array($remoteGet) && !empty($remoteGet['headers']['x-frame-options'])) {
414
- $siteUrl = esc_url_raw($_POST['siteUrl']);
415
  $xFrameOptions = $remoteGet['headers']['x-frame-options'];
416
  $mayNotShow = false;
417
 
@@ -428,7 +457,7 @@ class Ajax
428
  }
429
 
430
  if($mayNotShow) {
431
- echo $status;
432
  wp_die();
433
  }
434
  }
@@ -438,7 +467,7 @@ class Ajax
438
  $status = SGPB_AJAX_STATUS_TRUE;
439
  }
440
 
441
- echo $status;
442
  wp_die();
443
  }
444
 
@@ -446,6 +475,10 @@ class Ajax
446
 
447
  public function changePopupStatus()
448
  {
 
 
 
 
449
  $popupId = (int)sanitize_text_field($_POST['popupId']);
450
  $obj = SGPopup::find($popupId);
451
  $isDraft = '';
@@ -455,30 +488,30 @@ class Ajax
455
  }
456
 
457
  if(!$obj || !is_object($obj)) {
458
- wp_die(SGPB_AJAX_STATUS_FALSE);
459
  }
460
  $options = $obj->getOptions();
461
- $options['sgpb-is-active'] = sanitize_text_field($_POST['popupStatus']);
462
 
463
  unset($options['sgpb-conditions']);
464
  update_post_meta($popupId, 'sg_popup_options'.$isDraft, $options);
465
 
466
- wp_die($popupId);
467
  }
468
 
469
  public function subscriptionSubmission()
470
  {
471
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
472
- $postData = $_POST;
473
- array_walk_recursive($postData, 'sanitize_text_field');
474
- $this->setPostData($postData);
475
- $submissionData = $this->getValueFromPost('formData');
476
- $popupPostId = (int)$this->getValueFromPost('popupPostId');
477
-
478
  parse_str($submissionData, $formData);
 
 
 
 
479
 
480
  if(empty($formData)) {
481
- echo SGPB_AJAX_STATUS_FALSE;
482
  wp_die();
483
  }
484
 
@@ -486,7 +519,7 @@ class Ajax
486
 
487
  // this check is made to protect ourselves from bot
488
  if(!empty($hiddenChecker)) {
489
- echo 'Bot';
490
  wp_die();
491
  }
492
  global $wpdb;
@@ -515,27 +548,27 @@ class Ajax
515
  $status = SGPB_AJAX_STATUS_TRUE;
516
  }
517
 
518
- echo $status;
519
  wp_die();
520
  }
521
 
522
  public function sgpbSubsciptionFormSubmittedAction()
523
  {
524
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
525
- $postData = $_POST;
526
- array_walk_recursive($postData, 'sanitize_text_field');
527
- $this->setPostData($postData);
528
-
529
- $submissionData = $this->getValueFromPost('formData');
530
- $popupPostId = (int)$this->getValueFromPost('popupPostId');
531
  parse_str($submissionData, $formData);
 
 
 
 
532
  if(empty($_POST)) {
533
- echo SGPB_AJAX_STATUS_FALSE;
534
  wp_die();
535
  }
536
- $email = sanitize_email($_POST['emailValue']);
537
- $firstName = sanitize_text_field($_POST['firstNameValue']);
538
- $lastName = sanitize_text_field($_POST['lastNameValue']);
539
  $userData = array(
540
  'email' => $email,
541
  'firstName' => $firstName,
@@ -585,8 +618,8 @@ class Ajax
585
  {
586
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
587
 
588
- $postTypeName = sanitize_text_field($_POST['searchKey']);
589
- $search = sanitize_text_field($_POST['searchTerm']);
590
  $searchResults = $this->selectFromPost($postTypeName, $search);
591
 
592
  if(isset($_POST['searchCallback'])) {
@@ -606,8 +639,7 @@ class Ajax
606
  );
607
  }
608
 
609
- echo json_encode($results);
610
- wp_die();
611
  }
612
 
613
  private function selectFromPost($postTypeName, $search)
@@ -629,8 +661,8 @@ class Ajax
629
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
630
  global $SGPB_DATA_CONFIG_ARRAY;
631
 
632
- $groupId = (int)sanitize_text_field($_POST['groupId']);
633
- $targetType = sanitize_text_field($_POST['conditionName']);
634
  $addedObj = array();
635
 
636
  $builderObj = new ConditionBuilder();
@@ -642,7 +674,7 @@ class Ajax
642
  $addedObj[] = $builderObj;
643
 
644
  $creator = new ConditionCreator($addedObj);
645
- echo $creator->render();
646
  wp_die();
647
  }
648
 
@@ -651,11 +683,11 @@ class Ajax
651
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
652
  $data = '';
653
  global $SGPB_DATA_CONFIG_ARRAY;
654
- $targetType = sanitize_text_field($_POST['conditionName']);
655
  $builderObj = new ConditionBuilder();
656
 
657
- $groupId = (int)sanitize_text_field($_POST['groupId']);
658
- $ruleId = (int)sanitize_text_field($_POST['ruleId']);
659
 
660
  $builderObj->setGroupId($groupId);
661
  $builderObj->setRuleId($ruleId);
@@ -664,7 +696,7 @@ class Ajax
664
 
665
  $data .= ConditionCreator::createConditionRuleRow($builderObj);
666
 
667
- echo $data;
668
  wp_die();
669
  }
670
 
@@ -674,13 +706,13 @@ class Ajax
674
  $data = '';
675
  global $SGPB_DATA_CONFIG_ARRAY;
676
 
677
- $targetType = sanitize_text_field($_POST['conditionName']);
678
  $builderObj = new ConditionBuilder();
679
  $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$targetType];
680
- $groupId = (int)sanitize_text_field($_POST['groupId']);
681
- $ruleId = (int)sanitize_text_field($_POST['ruleId']);
682
- $popupId = (int)sanitize_text_field($_POST['popupId']);
683
- $paramName = sanitize_text_field($_POST['paramName']);
684
 
685
  $savedData = array(
686
  'param' => $paramName
@@ -723,7 +755,7 @@ class Ajax
723
 
724
  $data .= ConditionCreator::createConditionRuleRow($builderObj);
725
 
726
- echo $data;
727
  wp_die();
728
  }
729
  }
92
  wp_die('');
93
  }
94
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
95
+ if (!isset($_POST['post_ID'])){
96
+ wp_die(0);
97
+ }
98
+ $popupId = (int)sanitize_text_field($_POST['post_ID']);
99
  $postStatus = get_post_status($popupId);
100
  if($postStatus == 'publish') {
101
  wp_die('');
104
  if(!isset($_POST['allPopupData'])) {
105
  wp_die(true);
106
  }
107
+ // we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
108
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
109
+ $allPopupData = $_POST['allPopupData']; //
110
+ array_walk_recursive($allPopupData, function(&$item){
111
+ $item = sanitize_text_field($item);
112
+ });
113
  $popupData = SGPopup::parsePopupDataFromData($allPopupData);
114
  do_action('save_post_popupbuilder');
115
  $popupType = $popupData['sgpb-type'];
135
  public function changeReviewPopupPeriod()
136
  {
137
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
138
+ $messageType = isset($_POST['messageType']) ? sanitize_text_field($_POST['messageType']) : '';
139
 
140
  if($messageType == 'count') {
141
  $maxPopupCount = get_option('SGPBMaxOpenCount');
170
  public function resetPopupOpeningCount()
171
  {
172
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
173
+ if (!isset($_POST['popupId'])){
174
+ wp_die(0);
175
+ }
176
  global $wpdb;
177
 
178
  $tableName = $wpdb->prefix.'sgpb_analytics';
182
  SGPopup::deleteAnalyticsDataByPopupId($popupId);
183
  }
184
  if(empty($allPopupsCount)) {
185
+ // TODO ASAP remove echo use only wp_die
186
+ echo esc_html(SGPB_AJAX_STATUS_FALSE);
187
  wp_die();
188
  }
189
  if(isset($allPopupsCount[$popupId])) {
202
  {
203
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
204
  update_option('sgpbDontShowAskReviewBanner', 1);
205
+ echo esc_html(SGPB_AJAX_STATUS_TRUE);
206
  wp_die();
207
  }
208
 
210
  {
211
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
212
  update_option('sgpb_alert_problems', 1);
213
+ echo esc_html(SGPB_AJAX_STATUS_TRUE);
214
  wp_die();
215
  }
216
 
218
  {
219
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
220
  update_option('sgpb_extensions_updated', 1);
221
+ echo esc_html(SGPB_AJAX_STATUS_TRUE);
222
  wp_die();
223
  }
224
 
244
  if(isset($_GET['sg_popup_preview_id']) && !isset($_POST['params'])) {
245
  wp_die(0);
246
  }
247
+ // we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
248
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
 
249
  $popupParams = $_POST['params'];
250
+ /* Sanitizing multidimensional array */
251
+ array_walk_recursive($popupParams, function(&$item){
252
+ $item = sanitize_text_field($item);
253
+ });
254
 
255
  $popupsIdCollection = is_array($popupParams['popupsIdCollection']) ? $popupParams['popupsIdCollection'] : array();
256
  $popupsCounterData = get_option('SgpbCounter');
276
 
277
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
278
 
279
+ if (empty($_POST['subscribersId'])){
280
+ wp_die();
281
+ }
282
  $subscribersId = array_map('sanitize_text_field', $_POST['subscribersId']);
283
 
284
  foreach($subscribersId as $subscriberId) {
293
 
294
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
295
  $status = SGPB_AJAX_STATUS_FALSE;
296
+ $firstName = isset($_POST['firstName']) ? sanitize_text_field($_POST['firstName']) : '';
297
+ $lastName = isset($_POST['lastName']) ? sanitize_text_field($_POST['lastName']) : '';
298
+ $email = isset($_POST['email']) ? sanitize_text_field($_POST['email']) : '';
299
  $date = date('Y-m-d');
300
+
301
+ // we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
302
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
303
+ $subscriptionPopupsId = !empty($_POST['popups']) ? $_POST['popups'] : [];
304
+ array_walk_recursive($subscriptionPopupsId, function(&$item){
305
+ $item = sanitize_text_field($item);
306
+ });
307
 
308
  foreach($subscriptionPopupsId as $subscriptionPopupId) {
309
  $selectSql = $wpdb->prepare('SELECT id FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE email = %s AND subscriptionType = %d', $email, $subscriptionPopupId);
324
  }
325
  }
326
 
327
+ echo esc_html($status);
328
  wp_die();
329
  }
330
 
331
  public function importSubscribers()
332
  {
333
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
334
+ $formId = isset($_POST['popupSubscriptionList']) ? (int)sanitize_text_field($_POST['popupSubscriptionList']) : '';
335
+ $fileURL = isset($_POST['importListURL']) ? sanitize_text_field($_POST['importListURL']) : '';
336
  ob_start();
337
  require_once SG_POPUP_VIEWS_PATH.'importConfigView.php';
338
  $content = ob_get_contents();
339
  ob_end_clean();
340
 
341
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
342
  wp_die();
343
  }
344
 
350
  $content = ob_get_contents();
351
  ob_end_clean();
352
 
353
+ echo wp_kses($content, AdminHelper::allowed_html_tags());
354
  wp_die();
355
  }
356
 
358
  {
359
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
360
  @ini_set('auto_detect_line_endings', '1');
361
+ $formId = isset($_POST['popupSubscriptionList']) ? (int)sanitize_text_field($_POST['popupSubscriptionList']) : '';
362
+ $fileURL = isset($_POST['importListURL']) ? sanitize_text_field($_POST['importListURL']) : '';
363
+ // we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
364
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
365
+ $mapping = !empty($_POST['namesMapping']) ? $_POST['namesMapping'] : [];
366
+ array_walk_recursive($mapping, function(&$item){
367
+ $item = sanitize_text_field($item);
368
+ });
369
 
370
  $fileContent = AdminHelper::getFileFromURL($fileURL);
371
  $csvFileArray = array_map('str_getcsv', file($fileURL));
394
  }
395
  }
396
 
397
+ echo esc_html(SGPB_AJAX_STATUS_TRUE);
398
  wp_die();
399
  }
400
 
408
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
409
  global $wpdb;
410
 
411
+ // we will use array_walk_recursive method for sanitizing current data because we can receive an multidimensional array!
412
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
413
+ $newsletterData = isset($_POST['newsletterData']) ? stripslashes_deep($_POST['newsletterData']) : [];
414
+ array_walk_recursive($newsletterData, function(&$item){
415
+ $item = sanitize_text_field($item);
416
+ });
417
  if(isset($newsletterData['testSendingStatus']) && $newsletterData['testSendingStatus'] == 'test') {
418
  AdminHelper::sendTestNewsletter($newsletterData);
419
  }
434
  {
435
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
436
 
437
+ $url = isset($_POST['iframeUrl']) ? esc_url_raw($_POST['iframeUrl']) : '';
438
  $status = SGPB_AJAX_STATUS_FALSE;
439
 
440
  $remoteGet = wp_remote_get($url);
441
 
442
  if(is_array($remoteGet) && !empty($remoteGet['headers']['x-frame-options'])) {
443
+ $siteUrl = isset($_POST['siteUrl']) ? esc_url_raw($_POST['siteUrl']) : '';
444
  $xFrameOptions = $remoteGet['headers']['x-frame-options'];
445
  $mayNotShow = false;
446
 
457
  }
458
 
459
  if($mayNotShow) {
460
+ echo esc_html($status);
461
  wp_die();
462
  }
463
  }
467
  $status = SGPB_AJAX_STATUS_TRUE;
468
  }
469
 
470
+ echo esc_html($status);
471
  wp_die();
472
  }
473
 
475
 
476
  public function changePopupStatus()
477
  {
478
+ check_ajax_referer(SG_AJAX_NONCE, 'ajaxNonce');
479
+ if (!isset($_POST['popupId'])){
480
+ wp_die(esc_html(SGPB_AJAX_STATUS_FALSE));
481
+ }
482
  $popupId = (int)sanitize_text_field($_POST['popupId']);
483
  $obj = SGPopup::find($popupId);
484
  $isDraft = '';
488
  }
489
 
490
  if(!$obj || !is_object($obj)) {
491
+ wp_die(esc_html(SGPB_AJAX_STATUS_FALSE));
492
  }
493
  $options = $obj->getOptions();
494
+ $options['sgpb-is-active'] = isset($_POST['popupStatus'])? sanitize_text_field($_POST['popupStatus']) : '';
495
 
496
  unset($options['sgpb-conditions']);
497
  update_post_meta($popupId, 'sg_popup_options'.$isDraft, $options);
498
 
499
+ wp_die(esc_html($popupId));
500
  }
501
 
502
  public function subscriptionSubmission()
503
  {
504
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
505
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
506
+ $submissionData = isset($_POST['formData']) ? $_POST['formData'] : "[]";
 
 
 
 
507
  parse_str($submissionData, $formData);
508
+ array_walk_recursive($formData, function(&$item){
509
+ $item = sanitize_text_field($item);
510
+ });
511
+ $popupPostId = isset($_POST['popupPostId']) ? (int)sanitize_text_field($_POST['popupPostId']) : '';
512
 
513
  if(empty($formData)) {
514
+ echo esc_html(SGPB_AJAX_STATUS_FALSE);
515
  wp_die();
516
  }
517
 
519
 
520
  // this check is made to protect ourselves from bot
521
  if(!empty($hiddenChecker)) {
522
+ echo esc_html('Bot');
523
  wp_die();
524
  }
525
  global $wpdb;
548
  $status = SGPB_AJAX_STATUS_TRUE;
549
  }
550
 
551
+ echo esc_html($status);
552
  wp_die();
553
  }
554
 
555
  public function sgpbSubsciptionFormSubmittedAction()
556
  {
557
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
558
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
559
+ $submissionData = isset($_POST['formData']) ? $_POST['formData'] : "[]";
 
 
 
 
560
  parse_str($submissionData, $formData);
561
+ array_walk_recursive($formData, function(&$item){
562
+ $item = sanitize_text_field($item);
563
+ });
564
+ $popupPostId = isset($_POST['popupPostId']) ? (int)sanitize_text_field($_POST['popupPostId']) : '';
565
  if(empty($_POST)) {
566
+ echo esc_html(SGPB_AJAX_STATUS_FALSE);
567
  wp_die();
568
  }
569
+ $email = isset($_POST['emailValue']) ? sanitize_email($_POST['emailValue']) : '';
570
+ $firstName = isset($_POST['firstNameValue']) ? sanitize_text_field($_POST['firstNameValue']) : '';
571
+ $lastName = isset($_POST['lastNameValue']) ? sanitize_text_field($_POST['lastNameValue']) : '';
572
  $userData = array(
573
  'email' => $email,
574
  'firstName' => $firstName,
618
  {
619
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
620
 
621
+ $postTypeName = isset($_POST['searchKey']) ? sanitize_text_field($_POST['searchKey']) : '';
622
+ $search = isset($_POST['searchTerm']) ? sanitize_text_field($_POST['searchTerm']) : '';
623
  $searchResults = $this->selectFromPost($postTypeName, $search);
624
 
625
  if(isset($_POST['searchCallback'])) {
639
  );
640
  }
641
 
642
+ wp_send_json($results);
 
643
  }
644
 
645
  private function selectFromPost($postTypeName, $search)
661
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
662
  global $SGPB_DATA_CONFIG_ARRAY;
663
 
664
+ $groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
665
+ $targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
666
  $addedObj = array();
667
 
668
  $builderObj = new ConditionBuilder();
674
  $addedObj[] = $builderObj;
675
 
676
  $creator = new ConditionCreator($addedObj);
677
+ echo wp_kses($creator->render(), AdminHelper::allowed_html_tags());
678
  wp_die();
679
  }
680
 
683
  check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
684
  $data = '';
685
  global $SGPB_DATA_CONFIG_ARRAY;
686
+ $targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
687
  $builderObj = new ConditionBuilder();
688
 
689
+ $groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
690
+ $ruleId = isset($_POST['ruleId']) ? (int)sanitize_text_field($_POST['ruleId']) : '';
691
 
692
  $builderObj->setGroupId($groupId);
693
  $builderObj->setRuleId($ruleId);
696
 
697
  $data .= ConditionCreator::createConditionRuleRow($builderObj);
698
 
699
+ echo wp_kses($data, AdminHelper::allowed_html_tags());
700
  wp_die();
701
  }
702
 
706
  $data = '';
707
  global $SGPB_DATA_CONFIG_ARRAY;
708
 
709
+ $targetType = isset($_POST['conditionName']) ? sanitize_text_field($_POST['conditionName']) : '';
710
  $builderObj = new ConditionBuilder();
711
  $conditionConfig = $SGPB_DATA_CONFIG_ARRAY[$targetType];
712
+ $groupId = isset($_POST['groupId']) ? (int)sanitize_text_field($_POST['groupId']) : '';
713
+ $ruleId = isset($_POST['ruleId']) ? (int)sanitize_text_field($_POST['ruleId']) : '';
714
+ $popupId = isset($_POST['popupId']) ? (int)sanitize_text_field($_POST['popupId']) : '';
715
+ $paramName = isset($_POST['paramName']) ? sanitize_text_field($_POST['paramName']) : '';
716
 
717
  $savedData = array(
718
  'param' => $paramName
755
 
756
  $data .= ConditionCreator::createConditionRuleRow($builderObj);
757
 
758
+ echo wp_kses($data, AdminHelper::allowed_html_tags());
759
  wp_die();
760
  }
761
  }
com/classes/ConditionCreator.php CHANGED
@@ -105,20 +105,20 @@ class ConditionCreator
105
  $showRowStatusClass = ($hideStatus) ? 'sgpb-hide-condition-row' : $showRowStatusClass;
106
  ?>
107
  <?php if ($conditionName != 'hiddenOption'): ?>
108
- <div data-condition-name="<?php echo esc_attr($conditionName);?>" class="<?php echo 'inputBlock sg-condition-'.esc_attr($conditionName).'-wrapper'.' '.esc_attr($showRowStatusClass); ?>">
109
  <?php
110
  if (!$hideStatus) {
111
- echo self::createConditionElement($conditionDataObj, $conditionName);
112
  }
113
  ?>
114
  </div>
115
  <?php endif; ?>
116
  <?php if (($conditionName == 'hiddenOption')): ?>
117
  <?php $hiddenContent = self::getHiddenDataContent($conditionDataObj); ?>
118
- <div class="sgpb-hide-condition-row"><div id="<?php echo esc_attr($idHiddenDiv);?>"><?php echo $hiddenContent; ?></div></div>
119
  <?php endif; ?>
120
  <?php endforeach;?>
121
- <?php echo self::createConditionOperators($conditionDataObj, $idHiddenDiv); ?>
122
  </div>
123
  </div>
124
  <?php
@@ -518,13 +518,13 @@ class ConditionCreator
518
  $activeClassName = 'sgpb-active';
519
  }
520
  ?>
521
- <button class="tablinks sgpb-tab-links <?php echo esc_attr($activeClassName);?>" data-rule-id="<?php echo esc_attr($ruleId); ?>" data-content-id="<?php echo esc_attr($tab.'-'.$ruleId); ?>"><?php echo ucfirst($tab); ?></button>
522
  <?php endforeach;?>
523
  </div>
524
- <?php echo self::createHiddenFields($hiddenOptionsData, $conditionDataObj, $ruleId); ?>
525
  <div class="modal-footer">
526
- <button type="button" class="sgpb-no-button events-option-close sgpb-modal-cancel sgpb-btn sgpb-btn-gray-light" href="#"><?php _e('Cancel', SG_POPUP_TEXT_DOMAIN); ?></button>
527
- <button class="sgpb-btn sgpb-btn-blue sgpb-popup-option-save"><?php _e('Save', SG_POPUP_TEXT_DOMAIN); ?></button>
528
  </div>
529
  </div>
530
  <?php
@@ -551,10 +551,10 @@ class ConditionCreator
551
  ?>
552
  <div class="row form-group formItem sgpb-margin-y-10">
553
  <div class="col-md-6">
554
- <?php echo self::createConditionFieldHeader($conditionDataObj, $name); ?>
555
  </div>
556
  <div class="col-md-<?php echo esc_attr($colMdValue); ?>">
557
- <?php echo self::createConditionField($conditionDataObj, $name); ?>
558
  </div>
559
  <?php if (!empty($hiddenOptionsView)): ?>
560
  <div class="col-md-4">
@@ -589,15 +589,15 @@ class ConditionCreator
589
  $name = $parentOptionName;
590
  ob_start();
591
  ?>
592
- <div class="row <?php echo 'sgpb-popup-hidden-content-'.$name.'-'.$conditionDataObj->getRuleId().'-wrapper'?> form-group">
593
  <?php foreach ($subOptions as $subOption): ?>
594
  <div class="col-md-6">
595
- <?php echo self::createConditionFieldHeader($conditionDataObj, $subOption); ?>
596
  </div>
597
  <div class="col-md-6">
598
- <?php echo self::createConditionField($conditionDataObj, $subOption); ?>
599
  </div>
600
- <?php echo self::hiddenSubOptionsView($subOption, $conditionDataObj)?>
601
  <?php endforeach;?>
602
  </div>
603
  <?php
105
  $showRowStatusClass = ($hideStatus) ? 'sgpb-hide-condition-row' : $showRowStatusClass;
106
  ?>
107
  <?php if ($conditionName != 'hiddenOption'): ?>
108
+ <div data-condition-name="<?php echo esc_attr($conditionName);?>" class="<?php echo esc_attr('inputBlock sg-condition-'.$conditionName.'-wrapper'.' '.$showRowStatusClass); ?>">
109
  <?php
110
  if (!$hideStatus) {
111
+ echo wp_kses(self::createConditionElement($conditionDataObj, $conditionName), AdminHelper::allowed_html_tags());
112
  }
113
  ?>
114
  </div>
115
  <?php endif; ?>
116
  <?php if (($conditionName == 'hiddenOption')): ?>
117
  <?php $hiddenContent = self::getHiddenDataContent($conditionDataObj); ?>
118
+ <div class="sgpb-hide-condition-row"><div id="<?php echo esc_attr($idHiddenDiv);?>"><?php echo wp_kses($hiddenContent, AdminHelper::allowed_html_tags()); ?></div></div>
119
  <?php endif; ?>
120
  <?php endforeach;?>
121
+ <?php echo wp_kses(self::createConditionOperators($conditionDataObj, $idHiddenDiv), AdminHelper::allowed_html_tags()); ?>
122
  </div>
123
  </div>
124
  <?php
518
  $activeClassName = 'sgpb-active';
519
  }
520
  ?>
521
+ <button class="tablinks sgpb-tab-links <?php echo esc_attr($activeClassName);?>" data-rule-id="<?php echo esc_attr($ruleId); ?>" data-content-id="<?php echo esc_attr($tab.'-'.$ruleId); ?>"><?php echo esc_html(ucfirst($tab)); ?></button>
522
  <?php endforeach;?>
523
  </div>
524
+ <?php echo wp_kses(self::createHiddenFields($hiddenOptionsData, $conditionDataObj, $ruleId), AdminHelper::allowed_html_tags()); ?>
525
  <div class="modal-footer">
526
+ <button type="button" class="sgpb-no-button events-option-close sgpb-modal-cancel sgpb-btn sgpb-btn-gray-light" href="#"><?php esc_html_e('Cancel', SG_POPUP_TEXT_DOMAIN); ?></button>
527
+ <button class="sgpb-btn sgpb-btn-blue sgpb-popup-option-save"><?php esc_html_e('Save', SG_POPUP_TEXT_DOMAIN); ?></button>
528
  </div>
529
  </div>
530
  <?php
551
  ?>
552
  <div class="row form-group formItem sgpb-margin-y-10">
553
  <div class="col-md-6">
554
+ <?php echo wp_kses(self::createConditionFieldHeader($conditionDataObj, $name), AdminHelper::allowed_html_tags()); ?>
555
  </div>
556
  <div class="col-md-<?php echo esc_attr($colMdValue); ?>">
557
+ <?php echo wp_kses(self::createConditionField($conditionDataObj, $name), AdminHelper::allowed_html_tags()); ?>
558
  </div>
559
  <?php if (!empty($hiddenOptionsView)): ?>
560
  <div class="col-md-4">
589
  $name = $parentOptionName;
590
  ob_start();
591
  ?>
592
+ <div class="row <?php echo esc_attr('sgpb-popup-hidden-content-'.$name.'-'.$conditionDataObj->getRuleId().'-wrapper')?> form-group">
593
  <?php foreach ($subOptions as $subOption): ?>
594
  <div class="col-md-6">
595
+ <?php echo wp_kses(self::createConditionFieldHeader($conditionDataObj, $subOption), AdminHelper::allowed_html_tags()); ?>
596
  </div>
597
  <div class="col-md-6">
598
+ <?php echo wp_kses(self::createConditionField($conditionDataObj, $subOption), AdminHelper::allowed_html_tags()); ?>
599
  </div>
600
+ <?php echo wp_kses(self::hiddenSubOptionsView($subOption, $conditionDataObj), AdminHelper::allowed_html_tags())?>
601
  <?php endforeach;?>
602
  </div>
603
  <?php
com/classes/Feedback.php CHANGED
@@ -32,8 +32,12 @@ class SGPBFeedback
32
  {
33
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
34
  if (!empty($_POST['formData'])) {
 
35
  parse_str($_POST['formData'],$submissionData);
36
  }
 
 
 
37
  $feedbackKey = $feedbackText = 'Skipped';
38
  if (!empty($submissionData['reasonKey'])) {
39
  $feedbackKey = $submissionData['reasonKey'];
@@ -88,20 +92,20 @@ class SGPBFeedback
88
  <div class="row sgpb-feedback-popup-header sgpb-position-relative">
89
  <div class="col-sm-3 sgpb-add-subscriber-header-column">
90
  <h4>
91
- <?php _e('Quick Feedback', SG_POPUP_TEXT_DOMAIN)?>
92
  </h4>
93
  </div>
94
  <div class="col-sm-1 sgpb-add-subscriber-header-spinner-column">
95
- <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" alt="gif" class="sgpb-subscribers-add-spinner js-sg-spinner js-sgpb-add-spinner sg-hide-element js-sg-import-gif" width="20px">
96
  </div>
97
- <img src="<?php echo SG_POPUP_IMG_URL.'subscribers_close.png'; ?>" alt="gif" class="sgpb-add-subscriber-popup-close-btn sgpb-subscriber-data-popup-close-btn-js" width="20px">
98
  </div>
99
  <div class="row">
100
  <div class="col-md-12">
101
  <h4 class="sgpb-feedback-descritpion">
102
  <?php _e('If you have a moment, please share why you are deactivating <b>Popup Builder</b>', SG_POPUP_TEXT_DOMAIN)?>:
103
  </h4>
104
- <p class="sgpb-feedback-error-message sg-hide-element"><?php _e('Please, select an option.', SG_POPUP_TEXT_DOMAIN)?></p>
105
  </div>
106
  </div>
107
  <div class="row">
@@ -125,10 +129,10 @@ class SGPBFeedback
125
  <?php endforeach; ?>
126
  <div class="row sgpb-feedback-btns-wrapper">
127
  <div class="col-md-6">
128
- <input type="button" class="btn btn-sm btn-success sgpb-feedback-submit" name="sgpb-feedback-submit" value="<?php _e('Submit & Deactivate', SG_POPUP_TEXT_DOMAIN); ?>">
129
  </div>
130
  <div class="col-md-6">
131
- <input type="button" class="btn btn-sm sgpb-feedback-submit-skip" name="sgpb-feedback-submit-skip" value="<?php _e('Skip & Deactivate', SG_POPUP_TEXT_DOMAIN); ?>">
132
  </div>
133
  </div>
134
  </form>
32
  {
33
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
34
  if (!empty($_POST['formData'])) {
35
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
36
  parse_str($_POST['formData'],$submissionData);
37
  }
38
+ array_walk_recursive($submissionData, function(&$item){
39
+ $item = sanitize_text_field($item);
40
+ });
41
  $feedbackKey = $feedbackText = 'Skipped';
42
  if (!empty($submissionData['reasonKey'])) {
43
  $feedbackKey = $submissionData['reasonKey'];
92
  <div class="row sgpb-feedback-popup-header sgpb-position-relative">
93
  <div class="col-sm-3 sgpb-add-subscriber-header-column">
94
  <h4>
95
+ <?php esc_html_e('Quick Feedback', SG_POPUP_TEXT_DOMAIN)?>
96
  </h4>
97
  </div>
98
  <div class="col-sm-1 sgpb-add-subscriber-header-spinner-column">
99
+ <img src="<?php echo esc_attr(SG_POPUP_IMG_URL.'ajaxSpinner.gif'); ?>" alt="gif" class="sgpb-subscribers-add-spinner js-sg-spinner js-sgpb-add-spinner sg-hide-element js-sg-import-gif" width="20px">
100
  </div>
101
+ <img src="<?php echo esc_attr(SG_POPUP_IMG_URL.'subscribers_close.png'); ?>" alt="gif" class="sgpb-add-subscriber-popup-close-btn sgpb-subscriber-data-popup-close-btn-js" width="20px">
102
  </div>
103
  <div class="row">
104
  <div class="col-md-12">
105
  <h4 class="sgpb-feedback-descritpion">
106
  <?php _e('If you have a moment, please share why you are deactivating <b>Popup Builder</b>', SG_POPUP_TEXT_DOMAIN)?>:
107
  </h4>
108
+ <p class="sgpb-feedback-error-message sg-hide-element"><?php esc_html_e('Please, select an option.', SG_POPUP_TEXT_DOMAIN)?></p>
109
  </div>
110
  </div>
111
  <div class="row">
129
  <?php endforeach; ?>
130
  <div class="row sgpb-feedback-btns-wrapper">
131
  <div class="col-md-6">
132
+ <input type="button" class="btn btn-sm btn-success sgpb-feedback-submit" name="sgpb-feedback-submit" value="<?php esc_html_e('Submit & Deactivate', SG_POPUP_TEXT_DOMAIN); ?>">
133
  </div>
134
  <div class="col-md-6">
135
+ <input type="button" class="btn btn-sm sgpb-feedback-submit-skip" name="sgpb-feedback-submit-skip" value="<?php esc_html_e('Skip & Deactivate', SG_POPUP_TEXT_DOMAIN); ?>">
136
  </div>
137
  </div>
138
  </form>
com/classes/Notification.php CHANGED
@@ -65,12 +65,12 @@ class Notification
65
  break;
66
  }
67
 
68
- $style = 'style="border-color:'.$color.';"';
69
  $priority = $this->getPriority();
70
  $message = $this->getMessage();
71
  $btnHtml = $this->getCloseBtnById($id);
72
  $content = '<div class="sgpb-single-notification-wrapper">
73
- <div class="sgpb-single-notification"'.$style.'>
74
  <span class="dashicons dashicons-no-alt sgpb-hide-notification-at-all" data-id="'.$id.'"></span>
75
  '.$message.'
76
  </div>
65
  break;
66
  }
67
 
68
+ $style = 'style="border-color: '.$color.';"';
69
  $priority = $this->getPriority();
70
  $message = $this->getMessage();
71
  $btnHtml = $this->getCloseBtnById($id);
72
  $content = '<div class="sgpb-single-notification-wrapper">
73
+ <div class="sgpb-single-notification" '.$style.'>
74
  <span class="dashicons dashicons-no-alt sgpb-hide-notification-at-all" data-id="'.$id.'"></span>
75
  '.$message.'
76
  </div>
com/classes/NotificationCenter.php CHANGED
@@ -30,12 +30,13 @@ class SGPBNotificationCenter
30
  if (empty($count)) {
31
  $hidden = ' sgpb-hide-add-button';
32
  }
33
- echo "<script>
34
  jQuery(document).ready(function() {
35
  jQuery('.sgpb-menu-item-notification').remove();
36
  jQuery('.dashicons-menu-icon-sgpb').next().append('<span class=\"sgpb-menu-item-notification".esc_attr($hidden)."\">".esc_html($count)."</span>');
37
  });
38
  </script>";
 
39
  }
40
 
41
  public function setCronTimeout($cronTimeout)
@@ -233,7 +234,7 @@ class SGPBNotificationCenter
233
  {
234
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
235
 
236
- $notificationId = sanitize_text_field($_POST['id']);
237
  $allDismissedNotifications = self::getAllDismissedNotifications();
238
  $allDismissedNotifications[$notificationId] = $notificationId;
239
  $allDismissedNotifications = json_encode($allDismissedNotifications);
@@ -243,14 +244,15 @@ class SGPBNotificationCenter
243
  $result['content'] = self::displayNotifications(true);
244
  $result['count'] = count(self::getAllActiveNotifications(true));
245
 
246
- echo json_encode($result);
247
- wp_die();
248
  }
249
 
250
  public function removeNotification()
251
  {
252
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
253
-
 
 
254
  $notificationId = sanitize_text_field($_POST['id']);
255
  $allRemovedNotifications = self::getAllRemovedNotifications();
256
  $allRemovedNotifications[$notificationId] = $notificationId;
@@ -264,7 +266,9 @@ class SGPBNotificationCenter
264
  public function reactivateNotification()
265
  {
266
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
267
-
 
 
268
  $notificationId = sanitize_text_field($_POST['id']);
269
  $allDismissedNotifications = self::getAllDismissedNotifications();
270
  if (isset($allDismissedNotifications[$notificationId])) {
@@ -277,8 +281,7 @@ class SGPBNotificationCenter
277
  $result['content'] = self::displayNotifications(true);
278
  $result['count'] = count(self::getAllActiveNotifications(true));
279
 
280
- echo json_encode($result);
281
- wp_die();
282
  }
283
 
284
  public function activateCron()
30
  if (empty($count)) {
31
  $hidden = ' sgpb-hide-add-button';
32
  }
33
+ $script = "<script>
34
  jQuery(document).ready(function() {
35
  jQuery('.sgpb-menu-item-notification').remove();
36
  jQuery('.dashicons-menu-icon-sgpb').next().append('<span class=\"sgpb-menu-item-notification".esc_attr($hidden)."\">".esc_html($count)."</span>');
37
  });
38
  </script>";
39
+ echo wp_kses($script, AdminHelper::allowed_html_tags());
40
  }
41
 
42
  public function setCronTimeout($cronTimeout)
234
  {
235
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
236
 
237
+ $notificationId = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : '';
238
  $allDismissedNotifications = self::getAllDismissedNotifications();
239
  $allDismissedNotifications[$notificationId] = $notificationId;
240
  $allDismissedNotifications = json_encode($allDismissedNotifications);
244
  $result['content'] = self::displayNotifications(true);
245
  $result['count'] = count(self::getAllActiveNotifications(true));
246
 
247
+ wp_send_json($result);
 
248
  }
249
 
250
  public function removeNotification()
251
  {
252
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
253
+ if (!isset($_POST['id'])){
254
+ wp_die(0);
255
+ }
256
  $notificationId = sanitize_text_field($_POST['id']);
257
  $allRemovedNotifications = self::getAllRemovedNotifications();
258
  $allRemovedNotifications[$notificationId] = $notificationId;
266
  public function reactivateNotification()
267
  {
268
  check_ajax_referer(SG_AJAX_NONCE, 'nonce');
269
+ if (!isset($_POST['id'])){
270
+ wp_die(0);
271
+ }
272
  $notificationId = sanitize_text_field($_POST['id']);
273
  $allDismissedNotifications = self::getAllDismissedNotifications();
274
  if (isset($allDismissedNotifications[$notificationId])) {
281
  $result['content'] = self::displayNotifications(true);
282
  $result['count'] = count(self::getAllActiveNotifications(true));
283
 
284
+ wp_send_json($result);
 
285
  }
286
 
287
  public function activateCron()
com/classes/PopupChecker.php CHANGED
@@ -620,7 +620,7 @@ class PopupChecker
620
  if (is_wp_error($postLanguage)) {
621
  return true;
622
  }
623
- if (!empty($_GET['lang']) && ($_GET['lang'] == $popupLanguage)) {
624
  return true;
625
  }
626
  if ($postLanguage['language_code'] != $popupLanguage) {
620
  if (is_wp_error($postLanguage)) {
621
  return true;
622
  }
623
+ if (!empty($_GET['lang']) && (sanitize_text_field($_GET['lang']) == $popupLanguage)) {
624
  return true;
625
  }
626
  if ($postLanguage['language_code'] != $popupLanguage) {
com/classes/RegisterPostType.php CHANGED
@@ -203,7 +203,7 @@ class RegisterPostType
203
  $popupClassName = $this->getPopupClassNameFromPopupType($popupType);
204
 
205
  if (!file_exists($typePath.$popupClassName.'.php')) {
206
- die(__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
207
  }
208
  require_once($typePath.$popupClassName.'.php');
209
  $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
@@ -473,6 +473,6 @@ class RegisterPostType
473
  public function popupTypeRightBannerView()
474
  {
475
  $banner = AdminHelper::getRightMetaboxBannerText();
476
- echo $banner;
477
  }
478
  }
203
  $popupClassName = $this->getPopupClassNameFromPopupType($popupType);
204
 
205
  if (!file_exists($typePath.$popupClassName.'.php')) {
206
+ die(esc_html__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
207
  }
208
  require_once($typePath.$popupClassName.'.php');
209
  $popupClassName = __NAMESPACE__.'\\'.$popupClassName;
473
  public function popupTypeRightBannerView()
474
  {
475
  $banner = AdminHelper::getRightMetaboxBannerText();
476
+ echo esc_html($banner);
477
  }
478
  }
com/classes/SGPBRequirementsChecker.php CHANGED
@@ -9,7 +9,7 @@ class SGPBRequirementsChecker
9
  public static function checkPhpVersion()
10
  {
11
  if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
12
- wp_die('Popup Builder plugin requires PHP version >= '.SG_POPUP_MINIMUM_PHP_VERSION.' version required. You server using PHP version = '.PHP_VERSION);
13
  }
14
  }
15
  }
9
  public static function checkPhpVersion()
10
  {
11
  if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
12
+ wp_die(esc_html__('Popup Builder plugin requires PHP version >= '.SG_POPUP_MINIMUM_PHP_VERSION.' version required. You server using PHP version = '.PHP_VERSION));
13
  }
14
  }
15
  }
com/classes/ScriptsLoader.php CHANGED
@@ -159,13 +159,13 @@ class ScriptsLoader
159
  $footerContentAjax .= $footerPopupContent;
160
  } else {
161
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent, $extraContent) {
162
- $footerPopupContent = '<div class="sgpb-main-popup-data-container-'.esc_attr($popupId).'" style="position:fixed;opacity: 0;filter: opacity(0%);transform: scale(0);">
163
  <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.esc_attr($popupId).'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
164
  <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
165
  </div>
166
  </div>';
167
  $footerPopupContent .= $extraContent;
168
- echo $footerPopupContent;
169
  });
170
  }
171
  }
@@ -199,7 +199,7 @@ class ScriptsLoader
199
  </div>
200
  </div>';
201
 
202
- echo $footerPopupContent;
203
  });
204
  }
205
  $this->includeScripts();
159
  $footerContentAjax .= $footerPopupContent;
160
  } else {
161
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent, $extraContent) {
162
+ $footerPopupContent = '<style>.sgpb-main-popup-data-container-'.esc_attr($popupId).' {position:fixed;opacity: 0;filter: opacity(0%);transform: scale(0);}</style><div class="sgpb-main-popup-data-container-'.esc_attr($popupId).'">
163
  <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.esc_attr($popupId).'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
164
  <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
165
  </div>
166
  </div>';
167
  $footerPopupContent .= $extraContent;
168
+ echo wp_kses($footerPopupContent, AdminHelper::allowed_html_tags());
169
  });
170
  }
171
  }
199
  </div>
200
  </div>';
201
 
202
+ echo wp_kses($footerPopupContent, AdminHelper::allowed_html_tags());
203
  });
204
  }
205
  $this->includeScripts();
com/classes/Updates.php CHANGED
@@ -97,7 +97,7 @@ class Updates
97
  $this->licenseKey = $key;
98
 
99
  if (isset($_POST['sgpb-license-key-'.$key])) {
100
- $this->sanitizeLicense($_POST['sgpb-license-key-'.$key]);
101
  }
102
 
103
  // listen for our activate button to be clicked
@@ -164,10 +164,10 @@ class Updates
164
  if (isset($_GET['sl_activation']) && !empty($_GET['message'])) {
165
  switch (sanitize_text_field($_GET['sl_activation'])) {
166
  case 'false':
167
- $message = urldecode($_GET['message']);
168
  ?>
169
  <div class="error">
170
- <h3><?php echo $message; ?></h3>
171
  </div>
172
  <?php
173
  break;
97
  $this->licenseKey = $key;
98
 
99
  if (isset($_POST['sgpb-license-key-'.$key])) {
100
+ $this->sanitizeLicense(sanitize_key($_POST['sgpb-license-key-'.$key]));
101
  }
102
 
103
  // listen for our activate button to be clicked
164
  if (isset($_GET['sl_activation']) && !empty($_GET['message'])) {
165
  switch (sanitize_text_field($_GET['sl_activation'])) {
166
  case 'false':
167
+ $message = urldecode(sanitize_text_field($_GET['message']));
168
  ?>
169
  <div class="error">
170
+ <h3><?php echo esc_html($message); ?></h3>
171
  </div>
172
  <?php
173
  break;
com/classes/components/Menu.php CHANGED
@@ -199,7 +199,7 @@ class SGPBMenu
199
  { ?>
200
  <div class="description description-wide">
201
  <label for="edit-menu-item-pb-<?php echo esc_attr($item->ID); ?>">
202
- <?php _e('Select a Popup', SG_POPUP_TEXT_DOMAIN); ?><br/>
203
  <select class="widefat" name="menu-item-pb[<?php echo esc_attr($item->ID); ?>][popup]"
204
  id="edit-menu-item-pb-<?php echo esc_attr($item->ID); ?>">
205
  <option value=""></option>
@@ -209,7 +209,7 @@ class SGPBMenu
209
  </option>
210
  <?php endforeach; ?>
211
  </select>
212
- <span class="description"><?php _e('Open a popup once this item is clicked.', SG_POPUP_TEXT_DOMAIN); ?></span>
213
  </label>
214
  </div>
215
  <?php
199
  { ?>
200
  <div class="description description-wide">
201
  <label for="edit-menu-item-pb-<?php echo esc_attr($item->ID); ?>">
202
+ <?php esc_html_e('Select a Popup', SG_POPUP_TEXT_DOMAIN); ?><br/>
203
  <select class="widefat" name="menu-item-pb[<?php echo esc_attr($item->ID); ?>][popup]"
204
  id="edit-menu-item-pb-<?php echo esc_attr($item->ID); ?>">
205
  <option value=""></option>
209
  </option>
210
  <?php endforeach; ?>
211
  </select>
212
+ <span class="description"><?php esc_html_e('Open a popup once this item is clicked.', SG_POPUP_TEXT_DOMAIN); ?></span>
213
  </label>
214
  </div>
215
  <?php
com/classes/dataTable/Subscribers.php CHANGED
@@ -99,11 +99,11 @@ class Subscribers extends SGPBTable
99
  if (isset($_GET['sgpb-subscription-popup-id'])) {
100
  $selectedPopup = (int)sanitize_text_field($_GET['sgpb-subscription-popup-id']);
101
  }
102
-
103
  ob_start();
104
  ?>
105
- <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo esc_html($selectedPopup);?>">
106
- <input type="hidden" name="page" value="<?php echo SG_POPUP_SUBSCRIBERS_PAGE; ?>" >
107
 
108
  <select class="select__select sgpb-margin-right-10" name="sgpb-subscription-popup" id="sgpb-subscription-popup">
109
  <?php
@@ -117,7 +117,7 @@ class Subscribers extends SGPBTable
117
  }
118
  $list .= '<option value="'.esc_attr($popupId).'"'.esc_attr($selected).'>'.esc_html($popupTitle).'</option>';
119
  }
120
- echo $list;
121
  ?>
122
  </select>
123
  <?php
@@ -141,12 +141,13 @@ class Subscribers extends SGPBTable
141
  $selected = '';
142
 
143
  if (isset($_GET['sgpb-subscribers-date'])) {
144
- $selectedDate = esc_attr($_GET['sgpb-subscribers-date']);
145
  }
 
146
 
147
  ob_start();
148
  ?>
149
- <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo $selectedDate;?>">
150
  <select class="select__select sgpb-margin-right-10" name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
151
  <?php
152
  $gotDateList = '<option value="all">'.__('All dates', SG_POPUP_TEXT_DOMAIN).'</option>';
@@ -162,7 +163,7 @@ class Subscribers extends SGPBTable
162
  if (empty($subscribersDates)) {
163
  $gotDateList = '<option value="'.@$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
164
  }
165
- echo $dateList.$gotDateList;
166
  ?>
167
  </select>
168
  <?php
@@ -180,21 +181,23 @@ class Subscribers extends SGPBTable
180
  if (!$isVisibleExtraNav) {
181
  return '';
182
  }
 
 
183
  ?>
184
  <div class="sgpb-display-flex sgpb-justify-content-between actions">
185
  <div>
186
- <label class="screen-reader-text" for="sgpb-subscription-popup"><?php _e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
187
- <?php echo $this->getNavPopupsConditions(); ?>
188
- <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php _e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
189
- <?php echo $this->getNavDateConditions(); ?>
190
- <input name="filter_action" id="post-query-submit" class="buttonGroup__button buttonGroup__button_blueBg buttonGroup__button_unrounded" value="<?php _e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
191
  </div>
192
  <div>
193
  <?php
194
  if ($which == 'top') {
195
  ?>
196
- <button type="button" class="sgpb-btn sgpb-btn-danger sgpb-btn-disabled sgpb-btn--rounded sg-subs-delete-button" data-ajaxNonce="<?php echo SG_AJAX_NONCE;?>">
197
- <?php _e('Delete subscriber(s)', SG_POPUP_TEXT_DOMAIN)?>
198
  </button>
199
  <?php
200
  }
99
  if (isset($_GET['sgpb-subscription-popup-id'])) {
100
  $selectedPopup = (int)sanitize_text_field($_GET['sgpb-subscription-popup-id']);
101
  }
102
+ $allowed_html = AdminHelper::allowed_html_tags();
103
  ob_start();
104
  ?>
105
+ <input type="hidden" class="sgpb-subscription-popup-id" name="sgpb-subscription-popup-id" value="<?php echo esc_attr($selectedPopup);?>">
106
+ <input type="hidden" name="page" value="<?php echo esc_attr(SG_POPUP_SUBSCRIBERS_PAGE); ?>" >
107
 
108
  <select class="select__select sgpb-margin-right-10" name="sgpb-subscription-popup" id="sgpb-subscription-popup">
109
  <?php
117
  }
118
  $list .= '<option value="'.esc_attr($popupId).'"'.esc_attr($selected).'>'.esc_html($popupTitle).'</option>';
119
  }
120
+ echo wp_kses($list, $allowed_html);
121
  ?>
122
  </select>
123
  <?php
141
  $selected = '';
142
 
143
  if (isset($_GET['sgpb-subscribers-date'])) {
144
+ $selectedDate = sanitize_text_field($_GET['sgpb-subscribers-date']);
145
  }
146
+ $allowed_html = AdminHelper::allowed_html_tags();
147
 
148
  ob_start();
149
  ?>
150
+ <input type="hidden" class="sgpb-subscribers-date" name="sgpb-subscribers-date" value="<?php echo esc_attr($selectedDate);?>">
151
  <select class="select__select sgpb-margin-right-10" name="sgpb-subscribers-dates" id="sgpb-subscribers-dates">
152
  <?php
153
  $gotDateList = '<option value="all">'.__('All dates', SG_POPUP_TEXT_DOMAIN).'</option>';
163
  if (empty($subscribersDates)) {
164
  $gotDateList = '<option value="'.@$date['date-value'].'"'.$selected.'>'.__('Date', SG_POPUP_TEXT_DOMAIN).'</option>';
165
  }
166
+ echo wp_kses($dateList.$gotDateList, $allowed_html);
167
  ?>
168
  </select>
169
  <?php
181
  if (!$isVisibleExtraNav) {
182
  return '';
183
  }
184
+ $allowed_html = AdminHelper::allowed_html_tags();
185
+
186
  ?>
187
  <div class="sgpb-display-flex sgpb-justify-content-between actions">
188
  <div>
189
+ <label class="screen-reader-text" for="sgpb-subscription-popup"><?php esc_html_e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
190
+ <?php echo wp_kses($this->getNavPopupsConditions(), $allowed_html); ?>
191
+ <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php esc_html_e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
192
+ <?php echo wp_kses($this->getNavDateConditions(), $allowed_html); ?>
193
+ <input name="filter_action" id="post-query-submit" class="buttonGroup__button buttonGroup__button_blueBg buttonGroup__button_unrounded" value="<?php esc_html_e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
194
  </div>
195
  <div>
196
  <?php
197
  if ($which == 'top') {
198
  ?>
199
+ <button type="button" class="sgpb-btn sgpb-btn-danger sgpb-btn-disabled sgpb-btn--rounded sg-subs-delete-button" data-ajaxNonce="<?php echo esc_attr(SG_AJAX_NONCE);?>">
200
+ <?php esc_html_e('Delete subscriber(s)', SG_POPUP_TEXT_DOMAIN)?>
201
  </button>
202
  <?php
203
  }
com/classes/popups/FblikePopup.php CHANGED
@@ -32,14 +32,14 @@ class FblikePopup extends SGPopup
32
  sgpbOldCB();
33
  }
34
  FB.init({
35
- appId: <?php echo SGPB_FACEBOOK_APP_ID;?>
36
  });
37
  };
38
  (function(d, s, id) {
39
  var js, fjs = d.getElementsByTagName(s)[0];
40
  if (d.getElementById(id)) return;
41
  js = d.createElement(s); js.id = id;
42
- js.src = 'https://connect.facebook.net/<?php echo $locale;?>/all.js#xfbml=1&version=v2.11&appId=<?php echo SGPB_FACEBOOK_APP_ID;?>';
43
  fjs.parentNode.insertBefore(js, fjs);
44
  }(document, 'script', 'facebook-jssdk'));
45
  });
@@ -84,12 +84,13 @@ class FblikePopup extends SGPopup
84
 
85
  $scripts = $this->getScripts();
86
  $buttonConfig = $this->getButtonConfig($shareUrl, $layout, $shareButtonStatus);
 
87
  ob_start();
88
  ?>
89
  <div id="sg-facebook-like">
90
  <div id="fb-root"></div>
91
- <?php echo $buttonConfig; ?>
92
- <?php echo $scripts; ?>
93
  </div>
94
  <?php
95
  $content = ob_get_contents();
32
  sgpbOldCB();
33
  }
34
  FB.init({
35
+ appId: <?php echo esc_html(SGPB_FACEBOOK_APP_ID);?>
36
  });
37
  };
38
  (function(d, s, id) {
39
  var js, fjs = d.getElementsByTagName(s)[0];
40
  if (d.getElementById(id)) return;
41
  js = d.createElement(s); js.id = id;
42
+ js.src = 'https://connect.facebook.net/<?php echo esc_html($locale);?>/all.js#xfbml=1&version=v2.11&appId=<?php echo esc_html(SGPB_FACEBOOK_APP_ID);?>';
43
  fjs.parentNode.insertBefore(js, fjs);
44
  }(document, 'script', 'facebook-jssdk'));
45
  });
84
 
85
  $scripts = $this->getScripts();
86
  $buttonConfig = $this->getButtonConfig($shareUrl, $layout, $shareButtonStatus);
87
+ $allowed_html = AdminHelper::allowed_html_tags();
88
  ob_start();
89
  ?>
90
  <div id="sg-facebook-like">
91
  <div id="fb-root"></div>
92
+ <?php echo wp_kses($buttonConfig, $allowed_html); ?>
93
+ <?php echo wp_kses($scripts, $allowed_html); ?>
94
  </div>
95
  <?php
96
  $content = ob_get_contents();
com/classes/popups/SGPopup.php CHANGED
@@ -274,7 +274,7 @@ abstract class SGPopup
274
  $status = get_post_status($popupId);
275
  $popupContent = $popupPost->post_content;
276
  }
277
- $allowedStatus = array('publish', 'draft');
278
 
279
  if (!empty($args['status'])) {
280
  $allowedStatus = $args['status'];
@@ -1287,17 +1287,19 @@ abstract class SGPopup
1287
  unset($args['event']);
1288
  unset($args['id']);
1289
  $attr = AdminHelper::createAttrs($args);
 
 
1290
  ?>
1291
- <<?php echo $wrap; ?>
1292
  <?php if ($wrap == 'a') : ?>
1293
  href="javascript:void(0)"
1294
  <?php endif ?>
1295
- class="sgpb-show-popup <?php echo 'sgpb-popup-id-'.$popupId; ?>"
1296
  data-sgpbpopupid="<?php echo esc_attr($popupId); ?>"
1297
- data-popup-event="<?php echo $event; ?>"
1298
- <?php echo $attr; ?>>
1299
- <?php echo $content; ?>
1300
- </<?php echo $wrap; ?>>
1301
  <?php
1302
 
1303
  $shortcodeContent = ob_get_contents();
@@ -1478,7 +1480,7 @@ abstract class SGPopup
1478
  }
1479
 
1480
  if (!file_exists($typePath.$popupClassName.'.php')) {
1481
- wp_die(__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
1482
  }
1483
  require_once($typePath.$popupClassName.'.php');
1484
 
274
  $status = get_post_status($popupId);
275
  $popupContent = $popupPost->post_content;
276
  }
277
+ $allowedStatus = array('publish', 'draft', 'private');
278
 
279
  if (!empty($args['status'])) {
280
  $allowedStatus = $args['status'];
1287
  unset($args['event']);
1288
  unset($args['id']);
1289
  $attr = AdminHelper::createAttrs($args);
1290
+ $allowed_html = AdminHelper::allowed_html_tags();
1291
+
1292
  ?>
1293
+ <<?php echo esc_attr($wrap); ?>
1294
  <?php if ($wrap == 'a') : ?>
1295
  href="javascript:void(0)"
1296
  <?php endif ?>
1297
+ class="sgpb-show-popup <?php echo esc_attr('sgpb-popup-id-'.$popupId); ?>"
1298
  data-sgpbpopupid="<?php echo esc_attr($popupId); ?>"
1299
+ data-popup-event="<?php echo esc_attr($event); ?>"
1300
+ <?php echo esc_attr($attr); ?>>
1301
+ <?php echo wp_kses($content, $allowed_html); ?>
1302
+ </<?php echo esc_attr($wrap); ?>>
1303
  <?php
1304
 
1305
  $shortcodeContent = ob_get_contents();
1480
  }
1481
 
1482
  if (!file_exists($typePath.$popupClassName.'.php')) {
1483
+ wp_die(esc_html__('Popup class does not exist', SG_POPUP_TEXT_DOMAIN));
1484
  }
1485
  require_once($typePath.$popupClassName.'.php');
1486
 
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '4.1.0');
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', '4.1.1');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/helpers/AdminHelper.php CHANGED
@@ -217,6 +217,7 @@ class AdminHelper
217
  public static function createRadioButtons($elements, $name, $selectedInput, $lineMode = false, $extraHtmlAfterInput = '')
218
  {
219
  $str = '';
 
220
 
221
  foreach ($elements as $key => $element) {
222
  $value = '';
@@ -270,7 +271,7 @@ class AdminHelper
270
  }
271
  }
272
 
273
- echo $str;
274
  }
275
 
276
  public static function getDateObjFromDate($dueDate, $timezone = 'America/Los_Angeles', $format = 'Y-m-d H:i:s')
@@ -347,7 +348,7 @@ class AdminHelper
347
  if (isset($_GET['sgpb-subscription-popup-id']) && !empty($_GET['sgpb-subscription-popup-id'])) {
348
  $filterCriteria = sanitize_text_field($_GET['sgpb-subscription-popup-id']);
349
  if ($filterCriteria != 'all') {
350
- $searchQuery .= " AND (subscriptionType = $filterCriteria)";
351
  }
352
  }
353
  if ($filterCriteria != '' && $filterCriteria != 'all' && isset($_GET['s']) && !empty($_GET['s'])) {
@@ -359,15 +360,16 @@ class AdminHelper
359
  if (strpos($lastPartOfTheQuery, 'AND') <= 0) {
360
  $searchQuery .= ' AND ';
361
  }
362
- $searchQuery .= "(firstName LIKE '%$searchCriteria%' or lastName LIKE '%$searchCriteria%' or email LIKE '%$searchCriteria%' or $postsTablename.post_title LIKE '%$searchCriteria%')";
 
363
  }
364
  if (isset($_GET['sgpb-subscribers-date']) && !empty($_GET['sgpb-subscribers-date'])) {
365
- $filterCriteria = sanitize_text_field($_GET['sgpb-subscribers-date']);
366
- if ($filterCriteria != 'all') {
367
  if ($searchQuery != '') {
368
  $searchQuery .= ' AND ';
369
  }
370
- $searchQuery .= " cDate LIKE '$filterCriteria%'";
371
  }
372
  }
373
  if ($searchQuery != '') {
@@ -666,8 +668,8 @@ class AdminHelper
666
  <p class="sgpb-extension-notice-close">x</p>
667
  <div class="sgpb-extensions-list-wrapper">
668
  <div class="sgpb-notice-header">
669
- <h3><?php _e('Popup Builder plugin has been successfully updated', SG_POPUP_TEXT_DOMAIN); ?></h3>
670
- <h4><?php _e('The following extensions need to be updated manually', SG_POPUP_TEXT_DOMAIN); ?></h4>
671
  </div>
672
  <ul class="sgpb-extensions-list">
673
  <?php foreach ($extensions as $extensionName): ?>
@@ -675,7 +677,7 @@ class AdminHelper
675
  <?php endforeach; ?>
676
  </ul>
677
  </div>
678
- <p class="sgpb-extension-notice-dont-show"><?php _e('Don\'t show again', SG_POPUP_TEXT_DOMAIN)?></p>
679
  <?php
680
  $content = ob_get_contents();
681
  ob_get_clean();
@@ -751,11 +753,11 @@ class AdminHelper
751
  <div class="welcome-panel-content">
752
  <p class="sgpb-problem-notice-close">x</p>
753
  <div class="sgpb-alert-problem-text-wrapper">
754
- <h3><?php _e('Popup Builder plugin has been updated to the new version 3.', SG_POPUP_TEXT_DOMAIN); ?></h3>
755
- <h5><?php _e('A lot of changes and improvements have been made.', SG_POPUP_TEXT_DOMAIN); ?></h5>
756
  <h5><?php _e('In case of any issues, please contact us <a href="<?php echo SG_POPUP_TICKET_URL; ?>" target="_blank">here</a>.', SG_POPUP_TEXT_DOMAIN); ?></h5>
757
  </div>
758
- <p class="sgpb-problem-notice-dont-show"><?php _e('Don\'t show again', SG_POPUP_TEXT_DOMAIN); ?></p>
759
  </div>
760
  </div>
761
  <?php
@@ -1049,13 +1051,13 @@ class AdminHelper
1049
  <div class="sgpb-review-wrapper">
1050
  <div class="sgpb-review-description">
1051
  <?php echo wp_kses($firstHeader, 'post'); ?>
1052
- <h2 class="sgrb-review-h2"><?php _e('This is really great for your website score.', SG_POPUP_TEXT_DOMAIN); ?></h2>
1053
  <p class="sgrb-review-mt20"><?php _e('Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!', SG_POPUP_TEXT_DOMAIN); ?></p>
1054
  </div>
1055
  <div class="sgpb-buttons-wrapper">
1056
- <button class="press press-grey sgpb-button-1 sgpb-close-promo-notification" data-action="sg-already-did-review"><?php _e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1057
- <button class="press press-lightblue sgpb-button-3 sgpb-close-promo-notification" data-action="sg-you-worth-it"><?php _e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1058
- <button class="press press-grey sgpb-button-2 sgpb-close-promo-notification" data-action="sg-show-popup-period" data-message-type="<?php echo esc_attr($type); ?>"><?php _e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
1059
  <div> </div>
1060
  </div>
1061
  <?php
@@ -1770,7 +1772,7 @@ class AdminHelper
1770
  $systemInfoContent .= "\n".'-- Webserver Configuration'."\n\n";
1771
  $systemInfoContent .= 'PHP Version: '.PHP_VERSION."\n";
1772
  $systemInfoContent .= 'MySQL Version: '.$wpdb->db_version()."\n";
1773
- $systemInfoContent .= 'Webserver Info: '.$_SERVER['SERVER_SOFTWARE']."\n";
1774
 
1775
  // PHP configs... now we're getting to the important stuff
1776
  $systemInfoContent .= "\n".'-- PHP Configuration'."\n\n";
@@ -1841,12 +1843,12 @@ class AdminHelper
1841
  else if (strpos(DB_HOST, '.sysfix.eu') !== false) {
1842
  return 'SysFix.eu Power Hosting';
1843
  }
1844
- else if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
1845
  return 'Flywheel';
1846
  }
1847
  else {
1848
  // Adding a general fallback for data gathering
1849
- return 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME'];
1850
  }
1851
  }
1852
 
@@ -2075,7 +2077,7 @@ class AdminHelper
2075
 
2076
  $mailStatus = wp_mail($emails, $mailSubject, $emailMessage, $headers);
2077
 
2078
- wp_die($newsletterData['testSendingStatus']);
2079
  }
2080
 
2081
  // wp uploaded images
@@ -2204,4 +2206,129 @@ class AdminHelper
2204
  );
2205
  }
2206
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2207
  }
217
  public static function createRadioButtons($elements, $name, $selectedInput, $lineMode = false, $extraHtmlAfterInput = '')
218
  {
219
  $str = '';
220
+ $allowed_html = self::allowed_html_tags();
221
 
222
  foreach ($elements as $key => $element) {
223
  $value = '';
271
  }
272
  }
273
 
274
+ echo wp_kses($str, $allowed_html);
275
  }
276
 
277
  public static function getDateObjFromDate($dueDate, $timezone = 'America/Los_Angeles', $format = 'Y-m-d H:i:s')
348
  if (isset($_GET['sgpb-subscription-popup-id']) && !empty($_GET['sgpb-subscription-popup-id'])) {
349
  $filterCriteria = sanitize_text_field($_GET['sgpb-subscription-popup-id']);
350
  if ($filterCriteria != 'all') {
351
+ $searchQuery .= " AND (subscriptionType = '".esc_sql((int)$filterCriteria)."')";
352
  }
353
  }
354
  if ($filterCriteria != '' && $filterCriteria != 'all' && isset($_GET['s']) && !empty($_GET['s'])) {
360
  if (strpos($lastPartOfTheQuery, 'AND') <= 0) {
361
  $searchQuery .= ' AND ';
362
  }
363
+ $searchCriteria = "%" . esc_sql($wpdb->esc_like( $searchCriteria )) . "%";
364
+ $searchQuery .= "(firstName LIKE '$searchCriteria' or lastName LIKE '$searchCriteria' or email LIKE '$searchCriteria' or $postsTablename.post_title LIKE '$searchCriteria')";
365
  }
366
  if (isset($_GET['sgpb-subscribers-date']) && !empty($_GET['sgpb-subscribers-date'])) {
367
+ $filterCriteriaDate = sanitize_text_field($_GET['sgpb-subscribers-date']);
368
+ if ($filterCriteriaDate != 'all') {
369
  if ($searchQuery != '') {
370
  $searchQuery .= ' AND ';
371
  }
372
+ $searchQuery .= " cDate LIKE '".esc_sql( $wpdb->esc_like($filterCriteriaDate))."%'";
373
  }
374
  }
375
  if ($searchQuery != '') {
668
  <p class="sgpb-extension-notice-close">x</p>
669
  <div class="sgpb-extensions-list-wrapper">
670
  <div class="sgpb-notice-header">
671
+ <h3><?php esc_html_e('Popup Builder plugin has been successfully updated', SG_POPUP_TEXT_DOMAIN); ?></h3>
672
+ <h4><?php esc_html_e('The following extensions need to be updated manually', SG_POPUP_TEXT_DOMAIN); ?></h4>
673
  </div>
674
  <ul class="sgpb-extensions-list">
675
  <?php foreach ($extensions as $extensionName): ?>
677
  <?php endforeach; ?>
678
  </ul>
679
  </div>
680
+ <p class="sgpb-extension-notice-dont-show"><?php esc_html_e('Don\'t show again', SG_POPUP_TEXT_DOMAIN)?></p>
681
  <?php
682
  $content = ob_get_contents();
683
  ob_get_clean();
753
  <div class="welcome-panel-content">
754
  <p class="sgpb-problem-notice-close">x</p>
755
  <div class="sgpb-alert-problem-text-wrapper">
756
+ <h3><?php esc_html_e('Popup Builder plugin has been updated to the new version 3.', SG_POPUP_TEXT_DOMAIN); ?></h3>
757
+ <h5><?php esc_html_e('A lot of changes and improvements have been made.', SG_POPUP_TEXT_DOMAIN); ?></h5>
758
  <h5><?php _e('In case of any issues, please contact us <a href="<?php echo SG_POPUP_TICKET_URL; ?>" target="_blank">here</a>.', SG_POPUP_TEXT_DOMAIN); ?></h5>
759
  </div>
760
+ <p class="sgpb-problem-notice-dont-show"><?php esc_html_e('Don\'t show again', SG_POPUP_TEXT_DOMAIN); ?></p>
761
  </div>
762
  </div>
763
  <?php
1051
  <div class="sgpb-review-wrapper">
1052
  <div class="sgpb-review-description">
1053
  <?php echo wp_kses($firstHeader, 'post'); ?>
1054
+ <h2 class="sgrb-review-h2"><?php esc_html_e('This is really great for your website score.', SG_POPUP_TEXT_DOMAIN); ?></h2>
1055
  <p class="sgrb-review-mt20"><?php _e('Have your input in the development of our plugin, and we’ll provide better conversions for your site!<br /> Leave your 5-star positive review and help us go further to the perfection!', SG_POPUP_TEXT_DOMAIN); ?></p>
1056
  </div>
1057
  <div class="sgpb-buttons-wrapper">
1058
+ <button class="press press-grey sgpb-button-1 sgpb-close-promo-notification" data-action="sg-already-did-review"><?php esc_html_e('I already did', SG_POPUP_TEXT_DOMAIN); ?></button>
1059
+ <button class="press press-lightblue sgpb-button-3 sgpb-close-promo-notification" data-action="sg-you-worth-it"><?php esc_html_e('You worth it!', SG_POPUP_TEXT_DOMAIN); ?></button>
1060
+ <button class="press press-grey sgpb-button-2 sgpb-close-promo-notification" data-action="sg-show-popup-period" data-message-type="<?php echo esc_attr($type); ?>"><?php esc_html_e('Maybe later', SG_POPUP_TEXT_DOMAIN); ?></button></div>
1061
  <div> </div>
1062
  </div>
1063
  <?php
1772
  $systemInfoContent .= "\n".'-- Webserver Configuration'."\n\n";
1773
  $systemInfoContent .= 'PHP Version: '.PHP_VERSION."\n";
1774
  $systemInfoContent .= 'MySQL Version: '.$wpdb->db_version()."\n";
1775
+ $systemInfoContent .= 'Webserver Info: '.isset($_SERVER['SERVER_SOFTWARE'])?$_SERVER['SERVER_SOFTWARE']:''."\n";
1776
 
1777
  // PHP configs... now we're getting to the important stuff
1778
  $systemInfoContent .= "\n".'-- PHP Configuration'."\n\n";
1843
  else if (strpos(DB_HOST, '.sysfix.eu') !== false) {
1844
  return 'SysFix.eu Power Hosting';
1845
  }
1846
+ else if (isset($_SERVER['SERVER_NAME']) && strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
1847
  return 'Flywheel';
1848
  }
1849
  else {
1850
  // Adding a general fallback for data gathering
1851
+ return 'DBH: '.DB_HOST.', SRV: '.(isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '');
1852
  }
1853
  }
1854
 
2077
 
2078
  $mailStatus = wp_mail($emails, $mailSubject, $emailMessage, $headers);
2079
 
2080
+ wp_die(esc_html($newsletterData['testSendingStatus']));
2081
  }
2082
 
2083
  // wp uploaded images
2206
  );
2207
  }
2208
  }
2209
+
2210
+ public static function allowed_html_tags()
2211
+ {
2212
+ $allowedPostTags = array();
2213
+ $allowedPostTags = wp_kses_allowed_html('post');
2214
+ $allowed_atts = array(
2215
+ 'role' => array(),
2216
+ 'onclick' => array(),
2217
+ 'checked' => array(),
2218
+ 'align' => array(),
2219
+ 'preload' => array(),
2220
+ 'aria-live' => array(),
2221
+ 'aria-label' => array(),
2222
+ 'aria-disabled' => array(),
2223
+ 'aria-atomic' => array(),
2224
+ 'aria-required' => array(),
2225
+ 'aria-invalid' => array(),
2226
+ 'aria-hidden' => array(),
2227
+ 'aria-valuenow' => array(),
2228
+ 'aria-valuemin' => array(),
2229
+ 'aria-haspopup' => array(),
2230
+ 'aria-expanded' => array(),
2231
+ 'aria-valuemax' => array(),
2232
+ 'aria-labelledby' => array(),
2233
+ 'aria-checked' => array(),
2234
+ 'aria-describedby' => array(),
2235
+ 'aria-valuetext' => array(),
2236
+ 'placeholder' => array(),
2237
+ 'controls' => array(),
2238
+ 'allowfullscreen' => array(),
2239
+ 'class' => array(),
2240
+ 'type' => array(),
2241
+ 'id' => array(),
2242
+ 'dir' => array(),
2243
+ 'size' => array(),
2244
+ 'cols' => array(),
2245
+ 'rows' => array(),
2246
+ 'lang' => array(),
2247
+ 'muted' => array(),
2248
+ 'style' => array(),
2249
+ 'xml:lang' => array(),
2250
+ 'src' => array(),
2251
+ 'autocomplete' => array(),
2252
+ 'maxlength' => array(),
2253
+ 'pattern' => array(),
2254
+ 'alt' => array(),
2255
+ 'href' => array(),
2256
+ 'rel' => array(),
2257
+ 'rev' => array(),
2258
+ 'target' => array(),
2259
+ 'novalidate' => array(),
2260
+ 'value' => array(),
2261
+ 'name' => array(),
2262
+ 'tabindex' => array(),
2263
+ 'action' => array(),
2264
+ 'method' => array(),
2265
+ 'for' => array(),
2266
+ 'width' => array(),
2267
+ 'height' => array(),
2268
+ 'data-*' => true,
2269
+ 'title' => array(),
2270
+ 'enctype' => array(),
2271
+ 'attr' => array(),
2272
+ 'label' => array(),
2273
+ 'selected' => array(),
2274
+ 'multiple' => array()
2275
+ );
2276
+ $allowedPostTags['select'] = $allowed_atts;
2277
+ $allowedPostTags['optgroup'] = $allowed_atts;
2278
+ $allowedPostTags['option'] = $allowed_atts;
2279
+ $allowedPostTags['form'] = $allowed_atts;
2280
+ $allowedPostTags['fieldset'] = $allowed_atts;
2281
+ $allowedPostTags['legend'] = $allowed_atts;
2282
+ $allowedPostTags['label'] = $allowed_atts;
2283
+ $allowedPostTags['input'] = $allowed_atts;
2284
+ $allowedPostTags['video'] = $allowed_atts;
2285
+ $allowedPostTags['source'] = $allowed_atts;
2286
+ $allowedPostTags['textarea'] = $allowed_atts;
2287
+ $allowedPostTags['iframe'] = $allowed_atts;
2288
+ $allowedPostTags['script'] = $allowed_atts;
2289
+ $allowedPostTags['style'] = $allowed_atts;
2290
+ $allowedPostTags['strong'] = $allowed_atts;
2291
+ $allowedPostTags['small'] = $allowed_atts;
2292
+ $allowedPostTags['table'] = $allowed_atts;
2293
+ $allowedPostTags['span'] = $allowed_atts;
2294
+ $allowedPostTags['abbr'] = $allowed_atts;
2295
+ $allowedPostTags['code'] = $allowed_atts;
2296
+ $allowedPostTags['pre'] = $allowed_atts;
2297
+ $allowedPostTags['div'] = $allowed_atts;
2298
+ $allowedPostTags['img'] = $allowed_atts;
2299
+ $allowedPostTags['h1'] = $allowed_atts;
2300
+ $allowedPostTags['h2'] = $allowed_atts;
2301
+ $allowedPostTags['h3'] = $allowed_atts;
2302
+ $allowedPostTags['h4'] = $allowed_atts;
2303
+ $allowedPostTags['h5'] = $allowed_atts;
2304
+ $allowedPostTags['h6'] = $allowed_atts;
2305
+ $allowedPostTags['ol'] = $allowed_atts;
2306
+ $allowedPostTags['ul'] = $allowed_atts;
2307
+ $allowedPostTags['li'] = $allowed_atts;
2308
+ $allowedPostTags['em'] = $allowed_atts;
2309
+ $allowedPostTags['hr'] = $allowed_atts;
2310
+ $allowedPostTags['br'] = $allowed_atts;
2311
+ $allowedPostTags['tr'] = $allowed_atts;
2312
+ $allowedPostTags['td'] = $allowed_atts;
2313
+ $allowedPostTags['p'] = $allowed_atts;
2314
+ $allowedPostTags['a'] = $allowed_atts;
2315
+ $allowedPostTags['b'] = $allowed_atts;
2316
+ $allowedPostTags['i'] = $allowed_atts;
2317
+ add_filter('safe_style_css', function($styles){
2318
+ $styles[] = 'position';
2319
+ $styles[] = 'opacity';
2320
+ $styles[] = 'inset';
2321
+ $styles[] = 'margin';
2322
+ $styles[] = 'display';
2323
+ $styles[] = 'z-index';
2324
+ $styles[] = 'top';
2325
+ $styles[] = 'left';
2326
+ $styles[] = 'bottom';
2327
+ $styles[] = 'right';
2328
+
2329
+ return $styles;
2330
+ }, 10, 1);
2331
+
2332
+ return $allowedPostTags;
2333
+ }
2334
  }
com/helpers/Functions.php CHANGED
@@ -6,6 +6,7 @@ class Functions
6
  public static function renderForm($formFields)
7
  {
8
  $form = '';
 
9
 
10
  if (empty($formFields) || !is_array($formFields)) {
11
  return $form;
@@ -115,7 +116,7 @@ class Functions
115
  ob_start();
116
  ?>
117
  <div class="sgpb-inputs-wrapper js-<?php echo esc_attr($fieldKey); ?>-wrapper js-sgpb-form-field-<?php echo esc_attr($fieldKey); ?>-wrapper <?php echo esc_attr($hideClassName); ?>">
118
- <?php echo $htmlElement; ?>
119
  </div>
120
  <?php
121
  $fields .= ob_get_contents();
6
  public static function renderForm($formFields)
7
  {
8
  $form = '';
9
+ $allowed_html = AdminHelper::allowed_html_tags();
10
 
11
  if (empty($formFields) || !is_array($formFields)) {
12
  return $form;
116
  ob_start();
117
  ?>
118
  <div class="sgpb-inputs-wrapper js-<?php echo esc_attr($fieldKey); ?>-wrapper js-sgpb-form-field-<?php echo esc_attr($fieldKey); ?>-wrapper <?php echo esc_attr($hideClassName); ?>">
119
+ <?php echo wp_kses($htmlElement, $allowed_html); ?>
120
  </div>
121
  <?php
122
  $fields .= ob_get_contents();
com/helpers/MultipleChoiceButton.php CHANGED
@@ -124,10 +124,11 @@ class MultipleChoiceButton
124
 
125
  public function render()
126
  {
 
127
  ob_start();
128
  ?>
129
 
130
- <?php echo $this->renderFields()?>
131
 
132
  <?php
133
  $content = ob_get_contents();
124
 
125
  public function render()
126
  {
127
+ $allowed_html = AdminHelper::allowed_html_tags();
128
  ob_start();
129
  ?>
130
 
131
+ <?php echo wp_kses($this->renderFields(), $allowed_html);?>
132
 
133
  <?php
134
  $content = ob_get_contents();
com/libs/ListTable.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
 
3
  namespace sgpbDataTable;
 
 
4
  /**
5
  * Base class for displaying a list of items in an ajaxified HTML table.
6
  *
@@ -311,7 +313,7 @@ class SGPBListTable {
311
  * @access public
312
  */
313
  public function no_items() {
314
- _e( 'No items found.' );
315
  }
316
 
317
  /**
@@ -329,16 +331,16 @@ class SGPBListTable {
329
  $input_id = $input_id . '-search-input';
330
 
331
  if ( ! empty( $_REQUEST['orderby'] ) )
332
- echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
333
  if ( ! empty( $_REQUEST['order'] ) )
334
- echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
335
  if ( ! empty( $_REQUEST['post_mime_type'] ) )
336
- echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
337
  if ( ! empty( $_REQUEST['detached'] ) )
338
- echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
339
  ?>
340
  <p class="search-box">
341
- <label class="screen-reader-text" for="<?php echo esc_html($input_id) ?>"><?php echo esc_html($text); ?>:</label>
342
  <input type="search" id="<?php echo esc_attr($input_id) ?>" name="s" value="<?php _admin_search_query(); ?>" />
343
  <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
344
  </p>
@@ -385,7 +387,7 @@ class SGPBListTable {
385
  foreach ( $views as $class => $view ) {
386
  $views[ $class ] = "\t<li class='$class'>$view";
387
  }
388
- echo implode( " |</li>\n", $views ) . "</li>\n";
389
  echo "</ul>";
390
  }
391
 
@@ -436,14 +438,14 @@ class SGPBListTable {
436
  if ( empty( $this->_actions ) )
437
  return;
438
 
439
- echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>";
440
- echo "<select name='action".esc_html($two)."' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
441
- echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
442
 
443
  foreach ( $this->_actions as $name => $title ) {
444
  $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
445
 
446
- echo "\t<option value='$name'$class>".esc_html($title)."</option>\n";
447
  }
448
 
449
  echo "</select>\n";
@@ -465,10 +467,10 @@ class SGPBListTable {
465
  return false;
466
 
467
  if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
468
- return $_REQUEST['action'];
469
 
470
  if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
471
- return $_REQUEST['action2'];
472
 
473
  return false;
474
  }
@@ -553,9 +555,9 @@ class SGPBListTable {
553
 
554
  $m = isset( $_GET['m'] ) ? (int) sanitize_text_field($_GET['m']) : 0;
555
  ?>
556
- <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
557
  <select name="m" id="filter-by-date">
558
- <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
559
  <?php
560
  foreach ( $months as $arc_row ) {
561
  if ( 0 == $arc_row->year )
@@ -568,7 +570,7 @@ class SGPBListTable {
568
  selected( $m, $year . $month, false ),
569
  esc_attr( $arc_row->year . $month ),
570
  /* translators: 1: month name, 2: 4-digit year */
571
- sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
572
  );
573
  }
574
  ?>
@@ -596,8 +598,8 @@ class SGPBListTable {
596
  printf(
597
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
598
  esc_url( add_query_arg( 'mode', $mode ) ),
599
- implode( ' ', $classes ),
600
- $title
601
  );
602
  }
603
  ?>
@@ -627,27 +629,27 @@ class SGPBListTable {
627
  // No comments at all.
628
  if ( ! $approved_comments && ! $pending_comments ) {
629
  printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
630
- __( 'No comments' )
631
  );
632
  // Approved comments have different display depending on some conditions.
633
  } elseif ( $approved_comments ) {
634
  printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
635
  esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
636
  $approved_comments_number,
637
- $pending_comments ? $approved_phrase : $approved_only_phrase
638
  );
639
  } else {
640
  printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
641
  $approved_comments_number,
642
- $pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
643
  );
644
  }
645
 
646
  if ( $pending_comments ) {
647
  printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
648
  esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
649
- $pending_comments_number,
650
- $pending_phrase
651
  );
652
  }
653
  }
@@ -724,7 +726,8 @@ class SGPBListTable {
724
 
725
  $current = $this->get_pagenum();
726
 
727
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
 
728
 
729
  $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
730
 
@@ -816,7 +819,7 @@ class SGPBListTable {
816
  }
817
  $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
818
 
819
- echo $this->_pagination;
820
  }
821
 
822
  /**
@@ -993,7 +996,8 @@ class SGPBListTable {
993
  public function print_column_headers( $with_id = true ) {
994
  list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
995
 
996
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
 
997
  $current_url = remove_query_arg( 'paged', $current_url );
998
 
999
  if ( isset( $_GET['orderby'] ) )
@@ -1001,7 +1005,7 @@ class SGPBListTable {
1001
  else
1002
  $current_orderby = '';
1003
 
1004
- if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
1005
  $current_order = 'desc';
1006
  else
1007
  $current_order = 'asc';
@@ -1051,7 +1055,7 @@ class SGPBListTable {
1051
 
1052
  if ( !empty( $class ) )
1053
  $class = "class='" . join( ' ', $class ) . "'";
1054
- echo "<$tag $scope $id $class>$column_display_name</$tag>";
1055
  }
1056
  }
1057
 
@@ -1066,7 +1070,7 @@ class SGPBListTable {
1066
 
1067
  $this->display_tablenav( 'top' );
1068
  ?>
1069
- <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
1070
  <thead>
1071
  <tr>
1072
  <?php $this->print_column_headers(); ?>
@@ -1075,7 +1079,7 @@ class SGPBListTable {
1075
 
1076
  <tbody id="the-list"<?php
1077
  if ( $singular ) {
1078
- echo " data-wp-lists='list:$singular'";
1079
  } ?>>
1080
  <?php $this->display_rows_or_placeholder(); ?>
1081
  </tbody>
@@ -1149,7 +1153,7 @@ class SGPBListTable {
1149
  if ( $this->has_items() ) {
1150
  $this->display_rows();
1151
  } else {
1152
- echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1153
  $this->no_items();
1154
  echo '</td></tr>';
1155
  }
@@ -1222,26 +1226,26 @@ class SGPBListTable {
1222
 
1223
  if ( 'cb' == $column_name ) {
1224
  echo '<th scope="row" class="check-column">';
1225
- echo $this->column_cb( $item );
1226
  echo '</th>';
1227
  } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
1228
- echo call_user_func(
1229
  array( $this, '_column_' . $column_name ),
1230
  $item,
1231
  $classes,
1232
  $data,
1233
  $primary
1234
- );
1235
  } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1236
  //<div class="table__data">01</div>
1237
  echo "<td ".esc_attr($attributes).">";
1238
- echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1239
- echo $this->handle_row_actions( $item, $column_name, $primary );
1240
  echo '</td>';
1241
  } else {
1242
  echo "<td ".esc_attr($attributes).">";
1243
- echo $this->column_default( $item, $column_name );
1244
- echo $this->handle_row_actions( $item, $column_name, $primary );
1245
  echo '</td>';
1246
  }
1247
  }
1
  <?php
2
 
3
  namespace sgpbDataTable;
4
+ use sgpb\AdminHelper;
5
+
6
  /**
7
  * Base class for displaying a list of items in an ajaxified HTML table.
8
  *
313
  * @access public
314
  */
315
  public function no_items() {
316
+ esc_html_e( 'No items found.' );
317
  }
318
 
319
  /**
331
  $input_id = $input_id . '-search-input';
332
 
333
  if ( ! empty( $_REQUEST['orderby'] ) )
334
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( sanitize_text_field($_REQUEST['orderby']) ) . '" />';
335
  if ( ! empty( $_REQUEST['order'] ) )
336
+ echo '<input type="hidden" name="order" value="' . esc_attr( sanitize_text_field($_REQUEST['order']) ) . '" />';
337
  if ( ! empty( $_REQUEST['post_mime_type'] ) )
338
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( sanitize_text_field($_REQUEST['post_mime_type']) ) . '" />';
339
  if ( ! empty( $_REQUEST['detached'] ) )
340
+ echo '<input type="hidden" name="detached" value="' . esc_attr( sanitize_text_field($_REQUEST['detached']) ) . '" />';
341
  ?>
342
  <p class="search-box">
343
+ <label class="screen-reader-text" for="<?php echo esc_attr($input_id) ?>"><?php echo esc_html($text); ?>:</label>
344
  <input type="search" id="<?php echo esc_attr($input_id) ?>" name="s" value="<?php _admin_search_query(); ?>" />
345
  <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
346
  </p>
387
  foreach ( $views as $class => $view ) {
388
  $views[ $class ] = "\t<li class='$class'>$view";
389
  }
390
+ echo wp_kses(implode( " |</li>\n", $views ) . "</li>\n", AdminHelper::allowed_html_tags());
391
  echo "</ul>";
392
  }
393
 
438
  if ( empty( $this->_actions ) )
439
  return;
440
 
441
+ echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_html__( 'Select bulk action' ) . "</label>";
442
+ echo "<select name='action".esc_attr($two)."' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
443
+ echo "<option value='-1' selected='selected'>" . esc_html__( 'Bulk Actions' ) . "</option>\n";
444
 
445
  foreach ( $this->_actions as $name => $title ) {
446
  $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
447
 
448
+ echo "\t<option value='".esc_attr($name)."'".esc_attr($class).">".esc_html($title)."</option>\n";
449
  }
450
 
451
  echo "</select>\n";
467
  return false;
468
 
469
  if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
470
+ return sanitize_text_field($_REQUEST['action']);
471
 
472
  if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
473
+ return sanitize_text_field($_REQUEST['action2']);
474
 
475
  return false;
476
  }
555
 
556
  $m = isset( $_GET['m'] ) ? (int) sanitize_text_field($_GET['m']) : 0;
557
  ?>
558
+ <label for="filter-by-date" class="screen-reader-text"><?php esc_html_e( 'Filter by date' ); ?></label>
559
  <select name="m" id="filter-by-date">
560
+ <option<?php selected( $m, 0 ); ?> value="0"><?php esc_html_e( 'All dates' ); ?></option>
561
  <?php
562
  foreach ( $months as $arc_row ) {
563
  if ( 0 == $arc_row->year )
570
  selected( $m, $year . $month, false ),
571
  esc_attr( $arc_row->year . $month ),
572
  /* translators: 1: month name, 2: 4-digit year */
573
+ sprintf( esc_html__( '%1$s %2$d' ), esc_html($wp_locale->get_month( $month )), esc_html($year) )
574
  );
575
  }
576
  ?>
598
  printf(
599
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
600
  esc_url( add_query_arg( 'mode', $mode ) ),
601
+ esc_html(implode( ' ', $classes )),
602
+ esc_html($title)
603
  );
604
  }
605
  ?>
629
  // No comments at all.
630
  if ( ! $approved_comments && ! $pending_comments ) {
631
  printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
632
+ esc_html__( 'No comments' )
633
  );
634
  // Approved comments have different display depending on some conditions.
635
  } elseif ( $approved_comments ) {
636
  printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
637
  esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
638
  $approved_comments_number,
639
+ $pending_comments ? esc_html($approved_phrase) : esc_html($approved_only_phrase)
640
  );
641
  } else {
642
  printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
643
  $approved_comments_number,
644
+ $pending_comments ? esc_html__( 'No approved comments' ) : esc_html__( 'No comments' )
645
  );
646
  }
647
 
648
  if ( $pending_comments ) {
649
  printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
650
  esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
651
+ esc_html($pending_comments_number),
652
+ esc_html($pending_phrase)
653
  );
654
  }
655
  }
726
 
727
  $current = $this->get_pagenum();
728
 
729
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
730
+ $current_url = set_url_scheme( 'http://' . (isset($_SERVER['HTTP_HOST'])? $_SERVER['HTTP_HOST'] : '') . (isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI'] : '') );
731
 
732
  $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
733
 
819
  }
820
  $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
821
 
822
+ echo wp_kses($this->_pagination, AdminHelper::allowed_html_tags());
823
  }
824
 
825
  /**
996
  public function print_column_headers( $with_id = true ) {
997
  list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
998
 
999
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
1000
+ $current_url = set_url_scheme( 'http://' . (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:'') . (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '') );
1001
  $current_url = remove_query_arg( 'paged', $current_url );
1002
 
1003
  if ( isset( $_GET['orderby'] ) )
1005
  else
1006
  $current_orderby = '';
1007
 
1008
+ if ( isset( $_GET['order'] ) && 'desc' == sanitize_text_field($_GET['order']) )
1009
  $current_order = 'desc';
1010
  else
1011
  $current_order = 'asc';
1055
 
1056
  if ( !empty( $class ) )
1057
  $class = "class='" . join( ' ', $class ) . "'";
1058
+ echo wp_kses("<$tag $scope $id $class>$column_display_name</$tag>", AdminHelper::allowed_html_tags());
1059
  }
1060
  }
1061
 
1070
 
1071
  $this->display_tablenav( 'top' );
1072
  ?>
1073
+ <table class="wp-list-table <?php echo esc_attr(implode( ' ', $this->get_table_classes() )); ?>">
1074
  <thead>
1075
  <tr>
1076
  <?php $this->print_column_headers(); ?>
1079
 
1080
  <tbody id="the-list"<?php
1081
  if ( $singular ) {
1082
+ echo esc_attr(" data-wp-lists='list:$singular'");
1083
  } ?>>
1084
  <?php $this->display_rows_or_placeholder(); ?>
1085
  </tbody>
1153
  if ( $this->has_items() ) {
1154
  $this->display_rows();
1155
  } else {
1156
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . esc_attr($this->get_column_count()) . '">';
1157
  $this->no_items();
1158
  echo '</td></tr>';
1159
  }
1226
 
1227
  if ( 'cb' == $column_name ) {
1228
  echo '<th scope="row" class="check-column">';
1229
+ echo wp_kses($this->column_cb( $item ), AdminHelper::allowed_html_tags());
1230
  echo '</th>';
1231
  } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
1232
+ echo wp_kses(call_user_func(
1233
  array( $this, '_column_' . $column_name ),
1234
  $item,
1235
  $classes,
1236
  $data,
1237
  $primary
1238
+ ), AdminHelper::allowed_html_tags());
1239
  } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1240
  //<div class="table__data">01</div>
1241
  echo "<td ".esc_attr($attributes).">";
1242
+ echo wp_kses(call_user_func( array( $this, 'column_' . $column_name ), $item ), AdminHelper::allowed_html_tags());
1243
+ echo wp_kses($this->handle_row_actions( $item, $column_name, $primary ), AdminHelper::allowed_html_tags());
1244
  echo '</td>';
1245
  } else {
1246
  echo "<td ".esc_attr($attributes).">";
1247
+ echo wp_kses($this->column_default( $item, $column_name ), AdminHelper::allowed_html_tags());
1248
+ echo wp_kses($this->handle_row_actions( $item, $column_name, $primary ), AdminHelper::allowed_html_tags());
1249
  echo '</td>';
1250
  }
1251
  }
com/libs/Table.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace sgpbDataTable;
4
 
 
5
  use sgpb\SubscriptionPopup;
6
  require_once(dirname(__FILE__).'/ListTable.php');
7
  file_exists(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php') && require_once(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php');
@@ -172,9 +173,9 @@ class SGPBTable extends SGPBListTable
172
 
173
  foreach ($rec as $k => $item) {
174
  if (0 === $k) {
175
- echo '<th scope="row" class="check-column">'.$item.'</th>';
176
  } else {
177
- echo '<td>'.stripslashes($item).'</td>';
178
  }
179
  }
180
  echo '</tr>';
@@ -215,13 +216,13 @@ class SGPBTable extends SGPBListTable
215
  }
216
  ?>
217
  <div class="alignleft actions daterangeactions">
218
- <label class="screen-reader-text" for="sgpb-subscription-popup"><?php _e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
219
- <?php echo $this->getNavPopupsConditions(); ?>
220
 
221
- <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php _e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
222
- <?php echo $this->getNavDateConditions(); ?>
223
 
224
- <input name="filter_action" id="post-query-submit" class="button" value="<?php _e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
225
  </div>
226
  <?php
227
  }
@@ -232,13 +233,13 @@ class SGPBTable extends SGPBListTable
232
  $input_id = $input_id . '-search-input';
233
 
234
  if ( ! empty( $_REQUEST['orderby'] ) )
235
- echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
236
  if ( ! empty( $_REQUEST['order'] ) )
237
- echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
238
  if ( ! empty( $_REQUEST['post_mime_type'] ) )
239
- echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
240
  if ( ! empty( $_REQUEST['detached'] ) )
241
- echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
242
  ?>
243
  <div class="search search-box">
244
  <input type="search" class="search__input" id="<?php echo esc_attr($input_id) ?>" name="s" value="<?php _admin_search_query(); ?>" />
@@ -254,7 +255,7 @@ class SGPBTable extends SGPBListTable
254
 
255
  $this->display_tablenav( 'top' );
256
  ?>
257
- <table class="table sgpb-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
258
  <thead >
259
  <tr>
260
  <?php $this->print_column_headers(); ?>
@@ -263,7 +264,7 @@ class SGPBTable extends SGPBListTable
263
 
264
  <tbody class='sgpb-table-body'<?php
265
  if ( $singular ) {
266
- echo " data-wp-lists='list:$singular'";
267
  } ?>>
268
  <?php $this->display_rows_or_placeholder(); ?>
269
  </tbody>
@@ -280,14 +281,14 @@ class SGPBTable extends SGPBListTable
280
  if ( $this->has_items() ) {
281
  $this->display_rows();
282
  } else {
283
- echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
284
  $this->no_items();
285
  echo '</td></tr>';
286
  }
287
  }
288
 
289
  public function no_items() {
290
- _e( 'No items found.' );
291
  }
292
 
293
  public function has_items() {
@@ -296,7 +297,7 @@ class SGPBTable extends SGPBListTable
296
 
297
  public function print_column_headers( $with_id = true ) {
298
  list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
299
-
300
  $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
301
  $current_url = remove_query_arg( 'paged', $current_url );
302
 
@@ -356,7 +357,7 @@ class SGPBTable extends SGPBListTable
356
 
357
  if ( !empty( $class ) )
358
  $class = "class='" . join( ' ', $class ) . "'";
359
- echo "<$tag $scope $id $class>$column_display_name</$tag>";
360
  }
361
  }
362
 
2
 
3
  namespace sgpbDataTable;
4
 
5
+ use sgpb\AdminHelper;
6
  use sgpb\SubscriptionPopup;
7
  require_once(dirname(__FILE__).'/ListTable.php');
8
  file_exists(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php') && require_once(SG_POPUP_CLASSES_POPUPS_PATH.'SubscriptionPopup.php');
173
 
174
  foreach ($rec as $k => $item) {
175
  if (0 === $k) {
176
+ echo '<th scope="row" class="check-column">'.wp_kses($item, AdminHelper::allowed_html_tags()).'</th>';
177
  } else {
178
+ echo '<td>'.wp_kses($item, AdminHelper::allowed_html_tags()).'</td>';
179
  }
180
  }
181
  echo '</tr>';
216
  }
217
  ?>
218
  <div class="alignleft actions daterangeactions">
219
+ <label class="screen-reader-text" for="sgpb-subscription-popup"><?php esc_html_e('Filter by popup', SG_POPUP_TEXT_DOMAIN)?></label>
220
+ <?php echo wp_kses($this->getNavPopupsConditions(), AdminHelper::allowed_html_tags()); ?>
221
 
222
+ <label class="screen-reader-text" for="sgpb-subscribers-dates"><?php esc_html_e('Filter by date', SG_POPUP_TEXT_DOMAIN)?></label>
223
+ <?php echo wp_kses($this->getNavDateConditions(), AdminHelper::allowed_html_tags()); ?>
224
 
225
+ <input name="filter_action" id="post-query-submit" class="button" value="<?php esc_html_e('Filter', SG_POPUP_TEXT_DOMAIN)?>" type="submit">
226
  </div>
227
  <?php
228
  }
233
  $input_id = $input_id . '-search-input';
234
 
235
  if ( ! empty( $_REQUEST['orderby'] ) )
236
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( sanitize_text_field($_REQUEST['orderby']) ) . '" />';
237
  if ( ! empty( $_REQUEST['order'] ) )
238
+ echo '<input type="hidden" name="order" value="' . esc_attr( sanitize_text_field($_REQUEST['order']) ) . '" />';
239
  if ( ! empty( $_REQUEST['post_mime_type'] ) )
240
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( sanitize_text_field($_REQUEST['post_mime_type']) ) . '" />';
241
  if ( ! empty( $_REQUEST['detached'] ) )
242
+ echo '<input type="hidden" name="detached" value="' . esc_attr( sanitize_text_field($_REQUEST['detached']) ) . '" />';
243
  ?>
244
  <div class="search search-box">
245
  <input type="search" class="search__input" id="<?php echo esc_attr($input_id) ?>" name="s" value="<?php _admin_search_query(); ?>" />
255
 
256
  $this->display_tablenav( 'top' );
257
  ?>
258
+ <table class="table sgpb-table <?php echo esc_attr(implode( ' ', $this->get_table_classes() )); ?>">
259
  <thead >
260
  <tr>
261
  <?php $this->print_column_headers(); ?>
264
 
265
  <tbody class='sgpb-table-body'<?php
266
  if ( $singular ) {
267
+ echo esc_attr(" data-wp-lists='list:$singular'");
268
  } ?>>
269
  <?php $this->display_rows_or_placeholder(); ?>
270
  </tbody>
281
  if ( $this->has_items() ) {
282
  $this->display_rows();
283
  } else {
284
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . esc_attr($this->get_column_count()) . '">';
285
  $this->no_items();
286
  echo '</td></tr>';
287
  }
288
  }
289
 
290
  public function no_items() {
291
+ esc_html_e( 'No items found.' );
292
  }
293
 
294
  public function has_items() {
297
 
298
  public function print_column_headers( $with_id = true ) {
299
  list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
300
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.InputNotValidated
301
  $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
302
  $current_url = remove_query_arg( 'paged', $current_url );
303
 
357
 
358
  if ( !empty( $class ) )
359
  $class = "class='" . join( ' ', $class ) . "'";
360
+ echo wp_kses("<$tag $scope $id $class>$column_display_name</$tag>", AdminHelper::allowed_html_tags());
361
  }
362
  }
363
 
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: 4.1.0
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: 4.1.1
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/views/behaviorAfterSpecialEventsView.php CHANGED
@@ -7,6 +7,6 @@ $builder = ConditionBuilder::createBehaviorAfterSpecialEventsConditionBuilder($d
7
  <div class="popup-conditions-wrapper popup-special-conditions-wrapper behavior-after-special-events-wrapper" data-condition-type="behavior-after-special-events">
8
  <?php
9
  $creator = new ConditionCreator($builder);
10
- echo $creator->render();
11
  ?>
12
  </div>
7
  <div class="popup-conditions-wrapper popup-special-conditions-wrapper behavior-after-special-events-wrapper" data-condition-type="behavior-after-special-events">
8
  <?php
9
  $creator = new ConditionCreator($builder);
10
+ echo wp_kses($creator->render(), AdminHelper::allowed_html_tags());
11
  ?>
12
  </div>
public/views/closeSettingsView.php CHANGED
@@ -54,7 +54,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
54
  <div class="sgpb-close-settings">
55
  <?php if(empty($removedOptions['sgpb-esc-key'])) : ?>
56
  <div class="formItem">
57
- <span class="formItem__title"><?php _e('Dismiss on "esc" key', SG_POPUP_TEXT_DOMAIN) ?>:</span>
58
  <div class="sgpb-onOffSwitch">
59
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="esc-key"
60
  name="sgpb-esc-key" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-esc-key')); ?>>
@@ -66,7 +66,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
66
  <div class="question-mark">B</div>
67
  <div class="sgpb-info-wrapper">
68
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
69
- <?php _e('The popup will close if the "Esc" key of your keyboard is clicked.', SG_POPUP_TEXT_DOMAIN) ?>
70
  </span>
71
  </div>
72
  </div>
@@ -74,7 +74,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
74
 
75
  <?php if(empty($removedOptions['sgpb-enable-close-button'])) : ?>
76
  <div class="formItem">
77
- <span class="formItem__title"><?php _e('Show "close" button', SG_POPUP_TEXT_DOMAIN) ?>:</span>
78
  <div class="sgpb-onOffSwitch onOffswitch_smallMargin">
79
  <input class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" type="checkbox" id="close-button"
80
  name="sgpb-enable-close-button" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-close-button')); ?>>
@@ -86,7 +86,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
86
  <div class="question-mark">B</div>
87
  <div class="sgpb-info-wrapper">
88
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
89
- <?php _e('Uncheck this option if you don\'t want to show a "close" button on your popup.', SG_POPUP_TEXT_DOMAIN) ?>
90
  </span>
91
  </div>
92
  </div>
@@ -94,7 +94,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
94
  <div class="subForm">
95
  <?php if(empty($removedOptions['sgpb-close-button-delay'])) : ?>
96
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
97
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Button delay', SG_POPUP_TEXT_DOMAIN) ?>:</span>
98
  <input type="number" min="0" id="sgpb-close-button-delay" class="subFormItem__input"
99
  name="sgpb-close-button-delay"
100
  value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-button-delay')); ?>"
@@ -102,22 +102,22 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
102
  <div class="question-mark">B</div>
103
  <div class="sgpb-info-wrapper">
104
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
105
- <?php _e('Specify the time (in seconds) after which the close button will appear. The close button will be shown by default without any delay if no time is specified.', SG_POPUP_TEXT_DOMAIN) ?>
106
  </span>
107
  </div>
108
  </div>
109
  <?php endif; ?>
110
  <?php if(empty($removedOptions['sgpb-close-button-position'])) : ?>
111
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
112
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Button position', SG_POPUP_TEXT_DOMAIN) ?>:</span>
113
- <?php echo AdminHelper::createSelectBox($defaultCloseButtonPositions, $closeButtonPosition, array('name' => 'sgpb-close-button-position',
114
  'class' => 'js-sg-select2 sgpb-close-button-position'
115
- )); ?>
116
  </div>
117
 
118
  <div class="formItem formItem">
119
  <div class="buttonPosition sgpb-button-position-top-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideTopPosition); ?>">
120
- <span class="formItem__direction sgpb-margin-right-30"><?php _e('Top', SG_POPUP_TEXT_DOMAIN) ?></span>
121
  <div class="inputPxWrapper">
122
  <input id="sgpb-button-position-top" class="formItem__input" step="0.5"
123
  type="number" name="sgpb-button-position-top"
@@ -126,7 +126,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
126
  </div>
127
  </div>
128
  <div class="buttonPosition sgpb-button-position-right-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideRightPosition); ?>">
129
- <span class="formItem__direction sgpb-margin-right-20"><?php _e('Right', SG_POPUP_TEXT_DOMAIN) ?></span>
130
  <div class="inputPxWrapper ">
131
  <input id="sgpb-button-position-right" class="formItem__input" step="0.5"
132
  type="number" name="sgpb-button-position-right"
@@ -135,7 +135,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
135
  </div>
136
  </div>
137
  <div class="buttonPosition sgpb-button-position-bottom-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideBottomPosition); ?>">
138
- <span class="formItem__direction sgpb-margin-right-20"><?php _e('Bottom', SG_POPUP_TEXT_DOMAIN) ?></span>
139
  <div class="inputPxWrapper">
140
  <input id="sgpb-button-position-bottom" class="formItem__input" step="0.5"
141
  type="number" name="sgpb-button-position-bottom"
@@ -144,7 +144,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
144
  </div>
145
  </div>
146
  <div class="buttonPosition sgpb-button-position-left-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideLeftPosition); ?>">
147
- <span class="formItem__direction sgpb-margin-right-40"><?php _e('Left', SG_POPUP_TEXT_DOMAIN) ?></span>
148
  <div class="inputPxWrapper">
149
  <input id="sgpb-button-position-left" class="formItem__input" step="0.5"
150
  type="number" name="sgpb-button-position-left"
@@ -154,9 +154,9 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
154
  </div>
155
  </div>
156
  <?php endif; ?>
157
- <div class="<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4') ? 'sgpb-display-none ' : ''; ?>sgpb-close-button-image-option-wrapper">
158
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
159
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Button image', SG_POPUP_TEXT_DOMAIN) ?>:</span>
160
  <div type="text" class="subFormItem__x sgpb-margin-right-10">
161
  <div class="sgpb-show-button-image-container"
162
  style="background-image: url(<?php echo esc_url($buttonImage); ?>);">
@@ -166,13 +166,13 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
166
  <div class="easy-icons-wrapper sgpb-display-inline-flex">
167
  <div class="icons__item icons_blue sgpb-margin-right-10">
168
  <img id="js-button-upload-image-button"
169
- src="<?php echo SG_POPUP_PUBLIC_URL.'icons/cloud.svg'; ?>"
170
- alt="<?php _e('Change image', SG_POPUP_TEXT_DOMAIN) ?>">
171
  </div>
172
- <div class="icons__item icons_pink js-sgpb-remove-close-button-image<?php echo (!$popupTypeObj->getOptionValue('sgpb-button-image')) ? ' sg-hide' : ''; ?>">
173
  <img id="js-button-upload-image-remove-button"
174
- src="<?php echo SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg'; ?>"
175
- alt="<?php _e('Remove', SG_POPUP_TEXT_DOMAIN) ?>">
176
  </div>
177
  <div class="sgpb-button-image-uploader-wrapper">
178
  <input class="sg-hide" id="js-button-upload-image" type="text" size="36"
@@ -184,21 +184,21 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
184
  <div class="formItem_aligne_bottom formItem_itemsCentered">
185
  <div class="buttonPosition__wrapper">
186
  <div class="buttonPosition sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
187
- <span class="formItem__direction sgpb-margin-right-20"><?php _e('Width&nbsp;', SG_POPUP_TEXT_DOMAIN) ?></span>
188
  <div class="inputPxWrapper">
189
  <input class="formItem__input" type="number" min="0"
190
  name="sgpb-button-image-width"
191
- value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-button-image-width')); ?>"
192
  required>
193
  <span class="formItem__inputValueType">px</span>
194
  </div>
195
  </div>
196
  <div class="buttonPosition sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
197
- <span class="formItem__direction sgpb-margin-right-20"><?php _e('Height', SG_POPUP_TEXT_DOMAIN) ?></span>
198
  <div class="inputPxWrapper ">
199
  <input class="formItem__input" type="number" min="0"
200
  name="sgpb-button-image-height"
201
- value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-button-image-height')); ?>"
202
  required>
203
  <span class="formItem__inputValueType">px</span>
204
  </div>
@@ -207,26 +207,26 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
207
  </div>
208
  </div>
209
  </div>
210
- <div class="formItem sgpb-close-button-border-options<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-3') ? ' sg-hide' : ''; ?>">
211
- <span class="formItem__title"><?php _e('Popup border color', SG_POPUP_TEXT_DOMAIN) ?>:</span>
212
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker subFormItem">
213
  <input class="sgpb-color-picker sgpb-border-color" type="text" name="sgpb-border-color"
214
  value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-border-color'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-border-color')) : '#000000'; ?>">
215
  </div>
216
  </div>
217
- <div class="formItem sgpb-close-button-border-options<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-3') ? ' sg-hide' : ''; ?>">
218
- <span class="formItem__title"><?php _e('Popup border radius', SG_POPUP_TEXT_DOMAIN) ?>:</span>
219
  <input class="formItem__input sgpb-margin-right-10" type="number" min="0" name="sgpb-border-radius"
220
  value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-border-radius'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-border-radius')) : '0'; ?>">
221
- <?php echo AdminHelper::createSelectBox($defaultData['pxPercent'], $borderRadiusType, array('name' => 'sgpb-border-radius-type',
222
  'class' => 'sgpb-border-radius-type js-sg-select2'
223
- )); ?>
224
  </div>
225
- <div class="<?php echo ($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-4') ? 'sg-hide ' : ''; ?>sgpb-close-button-text-option-wrapper">
226
  <div class="formItem formItem_itemsCentered">
227
- <span class="formItem__title"><?php _e('Button text', SG_POPUP_TEXT_DOMAIN); ?>:</span>
228
  <input class="formItem__input formItem__input_sgpb-button-text" type="text" name="sgpb-button-text"
229
- value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-button-text'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-button-text')) : __('Close', SG_POPUP_TEXT_DOMAIN); ?>"
230
  autocomplete="off">
231
  </div>
232
  </div>
@@ -234,7 +234,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
234
  <?php endif; ?>
235
  <?php if(empty($removedOptions['sgpb-disable-page-scrolling'])): ?>
236
  <div class="formItem">
237
- <span class="formItem__title"><?php _e('Dismiss on overlay click', SG_POPUP_TEXT_DOMAIN) ?>:</span>
238
  <div class="sgpb-onOffSwitch">
239
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="overlay-click"
240
  name="sgpb-overlay-click" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-overlay-click')); ?>>
@@ -246,7 +246,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
246
  <div class="question-mark">B</div>
247
  <div class="sgpb-info-wrapper">
248
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
249
- <?php _e('The popup will close when clicked on the overlay of the popup.', SG_POPUP_TEXT_DOMAIN) ?>
250
  </span>
251
  </div>
252
  </div>
@@ -255,7 +255,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
255
  <?php if(empty($removedOptions['sgpb-disable-popup-closing'])): ?>
256
  <?php if ($disablePopupClosing): ?>
257
  <div class="formItem">
258
- <span class="formItem__title"><?php _e('Disable popup closing', SG_POPUP_TEXT_DOMAIN)?>:</span>
259
  <div class="sgpb-onOffSwitch">
260
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="popup-closing" name="sgpb-disable-popup-closing" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-popup-closing')); ?>>
261
  <label class="sgpb-onOffSwitch__label" for="popup-closing">
@@ -266,13 +266,13 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
266
  <div class="question-mark">B</div>
267
  <div class="sgpb-info-wrapper">
268
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
269
- <?php _e('The users will not be able to close the popup, if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
270
  </span>
271
  </div>
272
  </div>
273
  <?php else: ?>
274
- <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo SG_POPUP_ADVANCED_CLOSING_URL;?>', '_blank')">
275
- <span class="formItem__title"><?php _e('Disable popup closing', SG_POPUP_TEXT_DOMAIN)?>:</span>
276
  <div class="sgpb-onOffSwitch">
277
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="popup-closing" name="sgpb-disable-popup-closing" disabled>
278
  <label class="sgpb-onOffSwitch__label" for="popup-closing">
@@ -283,14 +283,14 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
283
  <div class="question-mark">B</div>
284
  <div class="sgpb-info-wrapper">
285
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
286
- <?php _e('The users will not be able to close the popup, if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
287
  </span>
288
  </div>
289
  <div class="sgpb-unlock-options">
290
  <div class="sgpb-unlock-options__icon">
291
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg';?>" alt="Time icon" width="45" height="45" />
292
  </div>
293
- <span class="sgpb-unlock-options__title"><?php _e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
294
  </div>
295
  </div>
296
  <?php endif; ?>
@@ -298,7 +298,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
298
  <?php if (empty($removedOptions['sgpb-auto-close'])): ?>
299
  <?php if ($autoClose): ?>
300
  <div class="formItem">
301
- <span class="formItem__title"><?php _e('Auto close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
302
  <div class="sgpb-onOffSwitch">
303
  <input type="checkbox" id="auto-close" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-auto-close" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-auto-close')); ?>>
304
  <label class="sgpb-onOffSwitch__label" for="auto-close">
@@ -308,8 +308,8 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
308
  </div>
309
  </div>
310
  <?php else: ?>
311
- <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo SG_POPUP_ADVANCED_CLOSING_URL;?>', '_blank')">
312
- <span class="formItem__title"><?php _e('Auto close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
313
  <div class="sgpb-onOffSwitch">
314
  <input type="checkbox" id="auto-close" name="sgpb-auto-close" disabled class="sgpb-onOffSwitch-checkbox">
315
  <label class="sgpb-onOffSwitch__label" for="auto-close">
@@ -319,9 +319,9 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
319
  </div>
320
  <div class="sgpb-unlock-options sgpb-margin-left-20">
321
  <div class="sgpb-unlock-options__icon">
322
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg';?>" alt="Time icon" width="45" height="45" />
323
  </div>
324
- <span class="sgpb-unlock-options__title"><?php _e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
325
  </div>
326
  </div>
327
  <?php endif; ?>
@@ -333,7 +333,7 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
333
  <?php if (empty($removedOptions['sgpb-close-after-page-scroll'])): ?>
334
  <?php if ($closeAfterPageScroll): ?>
335
  <div class="formItem">
336
- <span class="formItem__title"><?php _e('Close popup after the page scroll', SG_POPUP_TEXT_DOMAIN); ?>:</span>
337
  <div class="sgpb-onOffSwitch">
338
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-close-after-page-scroll" class="" name="sgpb-close-after-page-scroll" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-after-page-scroll')); ?>>
339
  <label class="sgpb-onOffSwitch__label" for="sgpb-close-after-page-scroll">
@@ -343,8 +343,8 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
343
  </div>
344
  </div>
345
  <?php else: ?>
346
- <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo SG_POPUP_ADVANCED_CLOSING_URL;?>', '_blank')">
347
- <span class="formItem__title"><?php _e('Close popup after the page scroll', SG_POPUP_TEXT_DOMAIN); ?>:</span>
348
  <div class="sgpb-onOffSwitch">
349
  <input type="checkbox" id="sgpb-close-after-page-scroll" name="sgpb-close-after-page-scroll" disabled>
350
  <label class="sgpb-onOffSwitch__label" for="sgpb-close-after-page-scroll">
@@ -354,9 +354,9 @@ $disablePopupClosing = PopupBuilderActivePackage::canUseOption('sgpb-disable-pop
354
  </div>
355
  <div class="sgpb-unlock-options sgpb-margin-left-20">
356
  <div class="sgpb-unlock-options__icon">
357
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg';?>" alt="Time icon" width="45" height="45" />
358
  </div>
359
- <span class="sgpb-unlock-options__title"><?php _e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
360
  </div>
361
  </div>
362
  <?php endif; ?>
54
  <div class="sgpb-close-settings">
55
  <?php if(empty($removedOptions['sgpb-esc-key'])) : ?>
56
  <div class="formItem">
57
+ <span class="formItem__title"><?php esc_html_e('Dismiss on "esc" key', SG_POPUP_TEXT_DOMAIN) ?>:</span>
58
  <div class="sgpb-onOffSwitch">
59
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="esc-key"
60
  name="sgpb-esc-key" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-esc-key')); ?>>
66
  <div class="question-mark">B</div>
67
  <div class="sgpb-info-wrapper">
68
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
69
+ <?php esc_html_e('The popup will close if the "Esc" key of your keyboard is clicked.', SG_POPUP_TEXT_DOMAIN) ?>
70
  </span>
71
  </div>
72
  </div>
74
 
75
  <?php if(empty($removedOptions['sgpb-enable-close-button'])) : ?>
76
  <div class="formItem">
77
+ <span class="formItem__title"><?php esc_html_e('Show "close" button', SG_POPUP_TEXT_DOMAIN) ?>:</span>
78
  <div class="sgpb-onOffSwitch onOffswitch_smallMargin">
79
  <input class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" type="checkbox" id="close-button"
80
  name="sgpb-enable-close-button" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-close-button')); ?>>
86
  <div class="question-mark">B</div>
87
  <div class="sgpb-info-wrapper">
88
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
89
+ <?php esc_html_e('Uncheck this option if you don\'t want to show a "close" button on your popup.', SG_POPUP_TEXT_DOMAIN) ?>
90
  </span>
91
  </div>
92
  </div>
94
  <div class="subForm">
95
  <?php if(empty($removedOptions['sgpb-close-button-delay'])) : ?>
96
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
97
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Button delay', SG_POPUP_TEXT_DOMAIN) ?>:</span>
98
  <input type="number" min="0" id="sgpb-close-button-delay" class="subFormItem__input"
99
  name="sgpb-close-button-delay"
100
  value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-button-delay')); ?>"
102
  <div class="question-mark">B</div>
103
  <div class="sgpb-info-wrapper">
104
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
105
+ <?php esc_html_e('Specify the time (in seconds) after which the close button will appear. The close button will be shown by default without any delay if no time is specified.', SG_POPUP_TEXT_DOMAIN) ?>
106
  </span>
107
  </div>
108
  </div>
109
  <?php endif; ?>
110
  <?php if(empty($removedOptions['sgpb-close-button-position'])) : ?>
111
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
112
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Button position', SG_POPUP_TEXT_DOMAIN) ?>:</span>
113
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultCloseButtonPositions, $closeButtonPosition, array('name' => 'sgpb-close-button-position',
114
  'class' => 'js-sg-select2 sgpb-close-button-position'
115
+ )), AdminHelper::allowed_html_tags()); ?>
116
  </div>
117
 
118
  <div class="formItem formItem">
119
  <div class="buttonPosition sgpb-button-position-top-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideTopPosition); ?>">
120
+ <span class="formItem__direction sgpb-margin-right-30"><?php esc_html_e('Top', SG_POPUP_TEXT_DOMAIN) ?></span>
121
  <div class="inputPxWrapper">
122
  <input id="sgpb-button-position-top" class="formItem__input" step="0.5"
123
  type="number" name="sgpb-button-position-top"
126
  </div>
127
  </div>
128
  <div class="buttonPosition sgpb-button-position-right-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideRightPosition); ?>">
129
+ <span class="formItem__direction sgpb-margin-right-20"><?php esc_html_e('Right', SG_POPUP_TEXT_DOMAIN) ?></span>
130
  <div class="inputPxWrapper ">
131
  <input id="sgpb-button-position-right" class="formItem__input" step="0.5"
132
  type="number" name="sgpb-button-position-right"
135
  </div>
136
  </div>
137
  <div class="buttonPosition sgpb-button-position-bottom-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideBottomPosition); ?>">
138
+ <span class="formItem__direction sgpb-margin-right-20"><?php esc_html_e('Bottom', SG_POPUP_TEXT_DOMAIN) ?></span>
139
  <div class="inputPxWrapper">
140
  <input id="sgpb-button-position-bottom" class="formItem__input" step="0.5"
141
  type="number" name="sgpb-button-position-bottom"
144
  </div>
145
  </div>
146
  <div class="buttonPosition sgpb-button-position-left-js sgpb-display-flex sgpb-align-item-center sgpb-margin-right-20 <?php echo esc_attr($hideLeftPosition); ?>">
147
+ <span class="formItem__direction sgpb-margin-right-40"><?php esc_html_e('Left', SG_POPUP_TEXT_DOMAIN) ?></span>
148
  <div class="inputPxWrapper">
149
  <input id="sgpb-button-position-left" class="formItem__input" step="0.5"
150
  type="number" name="sgpb-button-position-left"
154
  </div>
155
  </div>
156
  <?php endif; ?>
157
+ <div class="<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-popup-themes') == 'sgpb-theme-4') ? 'sgpb-display-none ' : ''); ?>sgpb-close-button-image-option-wrapper">
158
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
159
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Button image', SG_POPUP_TEXT_DOMAIN) ?>:</span>
160
  <div type="text" class="subFormItem__x sgpb-margin-right-10">
161
  <div class="sgpb-show-button-image-container"
162
  style="background-image: url(<?php echo esc_url($buttonImage); ?>);">
166
  <div class="easy-icons-wrapper sgpb-display-inline-flex">
167
  <div class="icons__item icons_blue sgpb-margin-right-10">
168
  <img id="js-button-upload-image-button"
169
+ src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/cloud.svg'); ?>"
170
+ alt="<?php esc_html_e('Change image', SG_POPUP_TEXT_DOMAIN) ?>">
171
  </div>
172
+ <div class="icons__item icons_pink js-sgpb-remove-close-button-image<?php echo esc_attr((!$popupTypeObj->getOptionValue('sgpb-button-image')) ? ' sg-hide' : ''); ?>">
173
  <img id="js-button-upload-image-remove-button"
174
+ src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg'); ?>"
175
+ alt="<?php esc_html_e('Remove', SG_POPUP_TEXT_DOMAIN) ?>">
176
  </div>
177
  <div class="sgpb-button-image-uploader-wrapper">
178
  <input class="sg-hide" id="js-button-upload-image" type="text" size="36"
184
  <div class="formItem_aligne_bottom formItem_itemsCentered">
185
  <div class="buttonPosition__wrapper">
186
  <div class="buttonPosition sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
187
+ <span class="formItem__direction sgpb-margin-right-20"><?php esc_html_e('Width&nbsp;', SG_POPUP_TEXT_DOMAIN) ?></span>
188
  <div class="inputPxWrapper">
189
  <input class="formItem__input" type="number" min="0"
190
  name="sgpb-button-image-width"
191
+ value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-button-image-width')); ?>"
192
  required>
193
  <span class="formItem__inputValueType">px</span>
194
  </div>
195
  </div>
196
  <div class="buttonPosition sgpb-display-flex sgpb-align-item-center sgpb-margin-bottom-20">
197
+ <span class="formItem__direction sgpb-margin-right-20"><?php esc_html_e('Height', SG_POPUP_TEXT_DOMAIN) ?></span>
198
  <div class="inputPxWrapper ">
199
  <input class="formItem__input" type="number" min="0"
200
  name="sgpb-button-image-height"
201
+ value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-button-image-height')); ?>"
202
  required>
203
  <span class="formItem__inputValueType">px</span>
204
  </div>
207
  </div>
208
  </div>
209
  </div>
210
+ <div class="formItem sgpb-close-button-border-options<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-3') ? ' sg-hide' : ''); ?>">
211
+ <span class="formItem__title"><?php esc_html_e('Popup border color', SG_POPUP_TEXT_DOMAIN) ?>:</span>
212
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker subFormItem">
213
  <input class="sgpb-color-picker sgpb-border-color" type="text" name="sgpb-border-color"
214
  value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-border-color'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-border-color')) : '#000000'; ?>">
215
  </div>
216
  </div>
217
+ <div class="formItem sgpb-close-button-border-options<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-3') ? ' sg-hide' : ''); ?>">
218
+ <span class="formItem__title"><?php esc_html_e('Popup border radius', SG_POPUP_TEXT_DOMAIN) ?>:</span>
219
  <input class="formItem__input sgpb-margin-right-10" type="number" min="0" name="sgpb-border-radius"
220
  value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-border-radius'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-border-radius')) : '0'; ?>">
221
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['pxPercent'], $borderRadiusType, array('name' => 'sgpb-border-radius-type',
222
  'class' => 'sgpb-border-radius-type js-sg-select2'
223
+ )), AdminHelper::allowed_html_tags()); ?>
224
  </div>
225
+ <div class="<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-popup-themes') != 'sgpb-theme-4') ? 'sg-hide ' : ''); ?>sgpb-close-button-text-option-wrapper">
226
  <div class="formItem formItem_itemsCentered">
227
+ <span class="formItem__title"><?php esc_html_e('Button text', SG_POPUP_TEXT_DOMAIN); ?>:</span>
228
  <input class="formItem__input formItem__input_sgpb-button-text" type="text" name="sgpb-button-text"
229
+ value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-button-text'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-button-text')) : esc_html__('Close', SG_POPUP_TEXT_DOMAIN); ?>"
230
  autocomplete="off">
231
  </div>
232
  </div>
234
  <?php endif; ?>
235
  <?php if(empty($removedOptions['sgpb-disable-page-scrolling'])): ?>
236
  <div class="formItem">
237
+ <span class="formItem__title"><?php esc_html_e('Dismiss on overlay click', SG_POPUP_TEXT_DOMAIN) ?>:</span>
238
  <div class="sgpb-onOffSwitch">
239
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="overlay-click"
240
  name="sgpb-overlay-click" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-overlay-click')); ?>>
246
  <div class="question-mark">B</div>
247
  <div class="sgpb-info-wrapper">
248
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
249
+ <?php esc_html_e('The popup will close when clicked on the overlay of the popup.', SG_POPUP_TEXT_DOMAIN) ?>
250
  </span>
251
  </div>
252
  </div>
255
  <?php if(empty($removedOptions['sgpb-disable-popup-closing'])): ?>
256
  <?php if ($disablePopupClosing): ?>
257
  <div class="formItem">
258
+ <span class="formItem__title"><?php esc_html_e('Disable popup closing', SG_POPUP_TEXT_DOMAIN)?>:</span>
259
  <div class="sgpb-onOffSwitch">
260
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="popup-closing" name="sgpb-disable-popup-closing" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-popup-closing')); ?>>
261
  <label class="sgpb-onOffSwitch__label" for="popup-closing">
266
  <div class="question-mark">B</div>
267
  <div class="sgpb-info-wrapper">
268
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
269
+ <?php esc_html_e('The users will not be able to close the popup, if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
270
  </span>
271
  </div>
272
  </div>
273
  <?php else: ?>
274
+ <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo esc_url_raw(SG_POPUP_ADVANCED_CLOSING_URL);?>', '_blank')">
275
+ <span class="formItem__title"><?php esc_html_e('Disable popup closing', SG_POPUP_TEXT_DOMAIN)?>:</span>
276
  <div class="sgpb-onOffSwitch">
277
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="popup-closing" name="sgpb-disable-popup-closing" disabled>
278
  <label class="sgpb-onOffSwitch__label" for="popup-closing">
283
  <div class="question-mark">B</div>
284
  <div class="sgpb-info-wrapper">
285
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
286
+ <?php esc_html_e('The users will not be able to close the popup, if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
287
  </span>
288
  </div>
289
  <div class="sgpb-unlock-options">
290
  <div class="sgpb-unlock-options__icon">
291
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg');?>" alt="Time icon" width="45" height="45" />
292
  </div>
293
+ <span class="sgpb-unlock-options__title"><?php esc_html_e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
294
  </div>
295
  </div>
296
  <?php endif; ?>
298
  <?php if (empty($removedOptions['sgpb-auto-close'])): ?>
299
  <?php if ($autoClose): ?>
300
  <div class="formItem">
301
+ <span class="formItem__title"><?php esc_html_e('Auto close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
302
  <div class="sgpb-onOffSwitch">
303
  <input type="checkbox" id="auto-close" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-auto-close" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-auto-close')); ?>>
304
  <label class="sgpb-onOffSwitch__label" for="auto-close">
308
  </div>
309
  </div>
310
  <?php else: ?>
311
+ <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo esc_url_raw(SG_POPUP_ADVANCED_CLOSING_URL);?>', '_blank')">
312
+ <span class="formItem__title"><?php esc_html_e('Auto close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
313
  <div class="sgpb-onOffSwitch">
314
  <input type="checkbox" id="auto-close" name="sgpb-auto-close" disabled class="sgpb-onOffSwitch-checkbox">
315
  <label class="sgpb-onOffSwitch__label" for="auto-close">
319
  </div>
320
  <div class="sgpb-unlock-options sgpb-margin-left-20">
321
  <div class="sgpb-unlock-options__icon">
322
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg');?>" alt="Time icon" width="45" height="45" />
323
  </div>
324
+ <span class="sgpb-unlock-options__title"><?php esc_html_e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
325
  </div>
326
  </div>
327
  <?php endif; ?>
333
  <?php if (empty($removedOptions['sgpb-close-after-page-scroll'])): ?>
334
  <?php if ($closeAfterPageScroll): ?>
335
  <div class="formItem">
336
+ <span class="formItem__title"><?php esc_html_e('Close popup after the page scroll', SG_POPUP_TEXT_DOMAIN); ?>:</span>
337
  <div class="sgpb-onOffSwitch">
338
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-close-after-page-scroll" class="" name="sgpb-close-after-page-scroll" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-after-page-scroll')); ?>>
339
  <label class="sgpb-onOffSwitch__label" for="sgpb-close-after-page-scroll">
343
  </div>
344
  </div>
345
  <?php else: ?>
346
+ <div class="formItem sgpb-padding-20 sgpb-option-disable" onclick="window.open('<?php echo esc_url_raw(SG_POPUP_ADVANCED_CLOSING_URL);?>', '_blank')">
347
+ <span class="formItem__title"><?php esc_html_e('Close popup after the page scroll', SG_POPUP_TEXT_DOMAIN); ?>:</span>
348
  <div class="sgpb-onOffSwitch">
349
  <input type="checkbox" id="sgpb-close-after-page-scroll" name="sgpb-close-after-page-scroll" disabled>
350
  <label class="sgpb-onOffSwitch__label" for="sgpb-close-after-page-scroll">
354
  </div>
355
  <div class="sgpb-unlock-options sgpb-margin-left-20">
356
  <div class="sgpb-unlock-options__icon">
357
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg');?>" alt="Time icon" width="45" height="45" />
358
  </div>
359
+ <span class="sgpb-unlock-options__title"><?php esc_html_e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
360
  </div>
361
  </div>
362
  <?php endif; ?>
public/views/conditionsView.php CHANGED
@@ -8,20 +8,20 @@ $defaultConditionsGeoTargeting = $defaultData['freeConditionsGeoTargeting'];
8
  <div class="sgpb-wrapper">
9
  <div class="formItem sgpb-pro-conditions-main-wrapper sgpb-display-flex">
10
  <div class="sgpb-pro-conditions-box sgpb-margin-right-20">
11
- <img class="sgpb-pro-conditions-extension-icon sgpb-margin-y-20" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/geo-targeting.svg" width="50" height="50">
12
  <span class="sgpb-pro-conditions-title">
13
- <?php _e('Geo Targeting', SG_POPUP_TEXT_DOMAIN);?>
14
  </span>
15
  <span class="sgpb-pro-conditions-text">
16
- <?php _e('If you want to unlock Geo Targeting you need to activate this extension', SG_POPUP_TEXT_DOMAIN);?>.
17
  </span>
18
- <a href="<?php echo SG_POPUP_GEO_TARGETING_URL; ?>" class="sgpb-btn sgpb-btn-blue sgpb-btn--rounded sgpb-margin-y-30">
19
- <?php _e('Buy Now', SG_POPUP_TEXT_DOMAIN);?>
20
  </a>
21
  <div class="sgpb-pro-conditions-inline-border sgpb-margin-bottom-20"></div>
22
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-show-js" href="javascript:void(0)">
23
- <?php _e('More Details', SG_POPUP_TEXT_DOMAIN);?>
24
- <img class="sgpb-pro-conditions-extension-icon" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/arrow-down.png" width="20" height="20">
25
  </a>
26
  <div class="sgpb-pro-conditions-list" style="display: none;">
27
  <?php foreach ($defaultConditionsGeoTargeting as $conditionIndex => $conditionName) : ?>
@@ -30,25 +30,25 @@ $defaultConditionsGeoTargeting = $defaultData['freeConditionsGeoTargeting'];
30
  <?php endforeach; ?>
31
  </div>
32
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-hide-js sgpb-margin-top-20" href="javascript:void(0)" style="display: none;">
33
- <?php _e('See Less', SG_POPUP_TEXT_DOMAIN);?>
34
- <img class="sgpb-pro-conditions-extension-icon" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/arrow-up.png" width="20" height="20">
35
  </a>
36
  </div>
37
  <div class="sgpb-pro-conditions-box">
38
- <img class="sgpb-pro-conditions-extension-icon sgpb-margin-y-20" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/sgpbAdvancedTargeting.svg" width="50" height="50">
39
  <span class="sgpb-pro-conditions-title">
40
- <?php _e('Advanced Targeting', SG_POPUP_TEXT_DOMAIN);?>
41
  </span>
42
  <span class="sgpb-pro-conditions-text ">
43
- <?php _e('If you want to unlock Advanced Targeting you need to activate this extension', SG_POPUP_TEXT_DOMAIN);?>.
44
  </span>
45
- <a href="<?php echo SG_POPUP_ADVANCED_TARGETING_URL; ?>" class="sgpb-btn sgpb-btn-blue sgpb-btn--rounded sgpb-margin-y-30">
46
- <?php _e('Buy Now', SG_POPUP_TEXT_DOMAIN);?>
47
  </a>
48
  <div class="sgpb-pro-conditions-inline-border sgpb-margin-bottom-20"></div>
49
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-show-js" href="javascript:void(0)">
50
- <?php _e('More Details', SG_POPUP_TEXT_DOMAIN);?>
51
- <img class="sgpb-pro-conditions-extension-icon" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/arrow-down.png" width="20" height="20">
52
  </a>
53
  <div class="sgpb-pro-conditions-list" style="display: none;">
54
  <?php foreach ($defaultConditionsAdvancedTargeting as $conditionIndex => $conditionName) : ?>
@@ -57,8 +57,8 @@ $defaultConditionsGeoTargeting = $defaultData['freeConditionsGeoTargeting'];
57
  <?php endforeach; ?>
58
  </div>
59
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-hide-js sgpb-margin-top-20" href="javascript:void(0)" style="display: none;">
60
- <?php _e('See Less', SG_POPUP_TEXT_DOMAIN);?>
61
- <img class="sgpb-pro-conditions-extension-icon" src="<?php echo SG_POPUP_PUBLIC_URL; ?>icons/arrow-up.png" width="20" height="20">
62
  </a>
63
  </div>
64
  </div>
8
  <div class="sgpb-wrapper">
9
  <div class="formItem sgpb-pro-conditions-main-wrapper sgpb-display-flex">
10
  <div class="sgpb-pro-conditions-box sgpb-margin-right-20">
11
+ <img class="sgpb-pro-conditions-extension-icon sgpb-margin-y-20" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/geo-targeting.svg" width="50" height="50">
12
  <span class="sgpb-pro-conditions-title">
13
+ <?php esc_html_e('Geo Targeting', SG_POPUP_TEXT_DOMAIN);?>
14
  </span>
15
  <span class="sgpb-pro-conditions-text">
16
+ <?php esc_html_e('If you want to unlock Geo Targeting you need to activate this extension', SG_POPUP_TEXT_DOMAIN);?>.
17
  </span>
18
+ <a href="<?php echo esc_url_raw(SG_POPUP_GEO_TARGETING_URL); ?>" class="sgpb-btn sgpb-btn-blue sgpb-btn--rounded sgpb-margin-y-30">
19
+ <?php esc_html_e('Buy Now', SG_POPUP_TEXT_DOMAIN);?>
20
  </a>
21
  <div class="sgpb-pro-conditions-inline-border sgpb-margin-bottom-20"></div>
22
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-show-js" href="javascript:void(0)">
23
+ <?php esc_html_e('More Details', SG_POPUP_TEXT_DOMAIN);?>
24
+ <img class="sgpb-pro-conditions-extension-icon" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/arrow-down.png" width="20" height="20">
25
  </a>
26
  <div class="sgpb-pro-conditions-list" style="display: none;">
27
  <?php foreach ($defaultConditionsGeoTargeting as $conditionIndex => $conditionName) : ?>
30
  <?php endforeach; ?>
31
  </div>
32
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-hide-js sgpb-margin-top-20" href="javascript:void(0)" style="display: none;">
33
+ <?php esc_html_e('See Less', SG_POPUP_TEXT_DOMAIN);?>
34
+ <img class="sgpb-pro-conditions-extension-icon" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/arrow-up.png" width="20" height="20">
35
  </a>
36
  </div>
37
  <div class="sgpb-pro-conditions-box">
38
+ <img class="sgpb-pro-conditions-extension-icon sgpb-margin-y-20" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/sgpbAdvancedTargeting.svg" width="50" height="50">
39
  <span class="sgpb-pro-conditions-title">
40
+ <?php esc_html_e('Advanced Targeting', SG_POPUP_TEXT_DOMAIN);?>
41
  </span>
42
  <span class="sgpb-pro-conditions-text ">
43
+ <?php esc_html_e('If you want to unlock Advanced Targeting you need to activate this extension', SG_POPUP_TEXT_DOMAIN);?>.
44
  </span>
45
+ <a href="<?php echo esc_url_raw(SG_POPUP_ADVANCED_TARGETING_URL); ?>" class="sgpb-btn sgpb-btn-blue sgpb-btn--rounded sgpb-margin-y-30">
46
+ <?php esc_html_e('Buy Now', SG_POPUP_TEXT_DOMAIN);?>
47
  </a>
48
  <div class="sgpb-pro-conditions-inline-border sgpb-margin-bottom-20"></div>
49
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-show-js" href="javascript:void(0)">
50
+ <?php esc_html_e('More Details', SG_POPUP_TEXT_DOMAIN);?>
51
+ <img class="sgpb-pro-conditions-extension-icon" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/arrow-down.png" width="20" height="20">
52
  </a>
53
  <div class="sgpb-pro-conditions-list" style="display: none;">
54
  <?php foreach ($defaultConditionsAdvancedTargeting as $conditionIndex => $conditionName) : ?>
57
  <?php endforeach; ?>
58
  </div>
59
  <a class="sgpb-pro-conditions-pro-url sgpb-pro-conditions-pro-url-hide-js sgpb-margin-top-20" href="javascript:void(0)" style="display: none;">
60
+ <?php esc_html_e('See Less', SG_POPUP_TEXT_DOMAIN);?>
61
+ <img class="sgpb-pro-conditions-extension-icon" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL); ?>icons/arrow-up.png" width="20" height="20">
62
  </a>
63
  </div>
64
  </div>
public/views/customEditor.php CHANGED
@@ -11,8 +11,8 @@ $savedData = get_post_meta($popupId , 'sg_popup_scripts', true);
11
  ?>
12
 
13
  <div class="sgpb-wrapper sgpb-customJsOrCss">
14
- <p class="sgpb-customJsOrCss_text"><?php _e('This section is for adding custom codes (CSS or JS) for the popup, it requires some coding knowledge', SG_POPUP_TEXT_DOMAIN);?>.</p>
15
- <p class="sgpb-customJsOrCss_text"><?php _e('You may use your custom codes for extra actions connected to the popup opening (before, after, etc.) in the fields below', SG_POPUP_TEXT_DOMAIN);?>.</p>
16
  <!-- editor buttons -->
17
  <div class="sgpb-tabs sgpb-margin-y-30">
18
  <span class="sgpb-tab-link sgpb-tab-active sgpb-tab-1" onclick="SGPBBackend.prototype.changeTab(1)">JS</span>
11
  ?>
12
 
13
  <div class="sgpb-wrapper sgpb-customJsOrCss">
14
+ <p class="sgpb-customJsOrCss_text"><?php esc_html_e('This section is for adding custom codes (CSS or JS) for the popup, it requires some coding knowledge', SG_POPUP_TEXT_DOMAIN);?>.</p>
15
+ <p class="sgpb-customJsOrCss_text"><?php esc_html_e('You may use your custom codes for extra actions connected to the popup opening (before, after, etc.) in the fields below', SG_POPUP_TEXT_DOMAIN);?>.</p>
16
  <!-- editor buttons -->
17
  <div class="sgpb-tabs sgpb-margin-y-30">
18
  <span class="sgpb-tab-link sgpb-tab-active sgpb-tab-1" onclick="SGPBBackend.prototype.changeTab(1)">JS</span>
public/views/debugReport.php CHANGED
@@ -2,12 +2,10 @@
2
  global $SGPB_DEBUG_POPUP_BUILDER_DETAILS;
3
  $SGPB_DEBUG_POPUP_BUILDER_DETAILS = json_encode($SGPB_DEBUG_POPUP_BUILDER_DETAILS);
4
 
5
- echo '<script>var SGPB_DEBUG_POPUP_BUILDER_DETAILS = '.$SGPB_DEBUG_POPUP_BUILDER_DETAILS.';</script>';
6
  ?>
7
- <script type="text/javascript">
8
-
9
- var SGPB_DEBUG_POPUP_BUILDER_DETAILS = <?php echo $SGPB_DEBUG_POPUP_BUILDER_DETAILS; ?>;
10
 
 
11
  function debugModeInit()
12
  {
13
  if (typeof SGPB_DEBUG_POPUP_BUILDER_DETAILS == 'undefined') {
2
  global $SGPB_DEBUG_POPUP_BUILDER_DETAILS;
3
  $SGPB_DEBUG_POPUP_BUILDER_DETAILS = json_encode($SGPB_DEBUG_POPUP_BUILDER_DETAILS);
4
 
5
+ echo wp_kses('<script>var SGPB_DEBUG_POPUP_BUILDER_DETAILS = '.$SGPB_DEBUG_POPUP_BUILDER_DETAILS.';</script>', \sgpb\AdminHelper::allowed_html_tags());
6
  ?>
 
 
 
7
 
8
+ <script type="text/javascript">
9
  function debugModeInit()
10
  {
11
  if (typeof SGPB_DEBUG_POPUP_BUILDER_DETAILS == 'undefined') {
public/views/dimensionsView.php CHANGED
@@ -8,43 +8,45 @@
8
  if (!empty($removedOptions['sgpb-popup-dimension-mode'])) {
9
  $subOptionClass = '';
10
  }
 
 
11
  ?>
12
  <div class="sgpb sgpb-wrapper dimensions ">
13
- <?php echo (!empty($removedOptions['sgpb-popup-dimension-mode'])) ? '' : $multipleChoiceButton; ?>
14
  <div class="sg-hide sg-full-width" id="responsive-dimension-wrapper">
15
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
16
- <span class="subFormItem__title" for="max-height"><?php _e('Size', SG_POPUP_TEXT_DOMAIN) ?>:</span>
17
- <?php echo AdminHelper::createSelectBox($defaultData['responsiveDimensions'], esc_html($popupTypeObj->getOptionValue('sgpb-responsive-dimension-measure')), array('name' => 'sgpb-responsive-dimension-measure', 'class'=>'js-sg-select2 sgpb-responsive-mode-change-js')); ?>
18
  </div>
19
  </div>
20
- <div class="<?php echo (!empty($removedOptions['sgpb-popup-dimension-mode'])) ? '' : 'sg-hide '; ?>sg-full-width formItem" id="custom-dimension-wrapper">
21
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
22
- <span class="subFormItem__title"><?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
23
- <input type="text" id="width" class="subFormItem__input" name="sgpb-width" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-width')) ?>">
24
  </div>
25
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
26
- <span class="subFormItem__title"><?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
27
- <input type="text" id="height" class="subFormItem__input" name="sgpb-height" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-height')) ?>">
28
  </div>
29
  </div>
30
  <div class="formItem bottom">
31
  <div class="minWidth sgpb-display-inline-flex sgpb-align-item-center sgpb-margin-right-20">
32
- <span class="formItem__title formItem__title_equals"><?php _e('Max width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
33
- <input type="text" id="max-width" class="subFormItem__input" name="sgpb-max-width" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-max-width')) ?>">
34
  </div>
35
  <div class="maxHeight sgpb-display-inline-flex sgpb-align-item-center">
36
- <span class="formItem__title formItem__title_equals"><?php _e('Max height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
37
- <input type="text" id="max-height" class="subFormItem__input" name="sgpb-max-height" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-max-height')) ?>">
38
  </div>
39
  </div>
40
  <div class="formItem">
41
  <div class="minWidth sgpb-display-inline-flex sgpb-align-item-center sgpb-margin-right-20">
42
- <span class="formItem__title formItem__title_equals"><?php _e('Min width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
43
- <input type="text" id="min-width" class="subFormItem__input" name="sgpb-min-width" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-min-width')) ?>">
44
  </div>
45
  <div class="maxHeight sgpb-display-inline-flex sgpb-align-item-center">
46
- <span class="formItem__title formItem__title_equals"><?php _e('Min height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
47
- <input type="text" id="min-height" class="subFormItem__input" name="sgpb-min-height" placeholder="<?php _e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php _e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-min-height')) ?>">
48
  </div>
49
  </div>
50
  </div>
8
  if (!empty($removedOptions['sgpb-popup-dimension-mode'])) {
9
  $subOptionClass = '';
10
  }
11
+ $allowed_html = AdminHelper::allowed_html_tags();
12
+
13
  ?>
14
  <div class="sgpb sgpb-wrapper dimensions ">
15
+ <?php echo !empty($removedOptions['sgpb-popup-dimension-mode']) ? esc_html('') : wp_kses($multipleChoiceButton, $allowed_html); ?>
16
  <div class="sg-hide sg-full-width" id="responsive-dimension-wrapper">
17
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
18
+ <span class="subFormItem__title" for="max-height"><?php esc_html_e('Size', SG_POPUP_TEXT_DOMAIN) ?>:</span>
19
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['responsiveDimensions'], $popupTypeObj->getOptionValue('sgpb-responsive-dimension-measure'), array('name' => 'sgpb-responsive-dimension-measure', 'class'=>'js-sg-select2 sgpb-responsive-mode-change-js')), $allowed_html); ?>
20
  </div>
21
  </div>
22
+ <div class="<?php echo (!empty($removedOptions['sgpb-popup-dimension-mode'])) ? esc_attr('') : esc_attr('sg-hide '); ?>sg-full-width formItem" id="custom-dimension-wrapper">
23
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
24
+ <span class="subFormItem__title"><?php esc_html_e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
25
+ <input type="text" id="width" class="subFormItem__input" name="sgpb-width" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-width')) ?>">
26
  </div>
27
  <div class="subFormItem<?php echo esc_attr($subOptionClass); ?>">
28
+ <span class="subFormItem__title"><?php esc_html_e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
29
+ <input type="text" id="height" class="subFormItem__input" name="sgpb-height" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-height')) ?>">
30
  </div>
31
  </div>
32
  <div class="formItem bottom">
33
  <div class="minWidth sgpb-display-inline-flex sgpb-align-item-center sgpb-margin-right-20">
34
+ <span class="formItem__title formItem__title_equals"><?php esc_html_e('Max width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
35
+ <input type="text" id="max-width" class="subFormItem__input" name="sgpb-max-width" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-max-width')) ?>">
36
  </div>
37
  <div class="maxHeight sgpb-display-inline-flex sgpb-align-item-center">
38
+ <span class="formItem__title formItem__title_equals"><?php esc_html_e('Max height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
39
+ <input type="text" id="max-height" class="subFormItem__input" name="sgpb-max-height" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-max-height')) ?>">
40
  </div>
41
  </div>
42
  <div class="formItem">
43
  <div class="minWidth sgpb-display-inline-flex sgpb-align-item-center sgpb-margin-right-20">
44
+ <span class="formItem__title formItem__title_equals"><?php esc_html_e('Min width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
45
+ <input type="text" id="min-width" class="subFormItem__input" name="sgpb-min-width" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-min-width')) ?>">
46
  </div>
47
  <div class="maxHeight sgpb-display-inline-flex sgpb-align-item-center">
48
+ <span class="formItem__title formItem__title_equals"><?php esc_html_e('Min height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
49
+ <input type="text" id="min-height" class="subFormItem__input" name="sgpb-min-height" placeholder="<?php esc_html_e('Ex: 100, 100px or 100%', SG_POPUP_TEXT_DOMAIN)?>" pattern = "\d+(([px]+|%)|)" title="<?php esc_html_e('It must be number + px or %', SG_POPUP_TEXT_DOMAIN) ?>" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-min-height')) ?>">
50
  </div>
51
  </div>
52
  </div>
public/views/eventsView.php CHANGED
@@ -2,11 +2,12 @@
2
  namespace sgpb;
3
  $eventsData = $popupTypeObj->getOptionValue('sgpb-events');
4
  $popupTargetData = ConditionBuilder::createEventsConditionBuilder($eventsData);
 
5
  ?>
6
 
7
  <div class="popup-conditions-wrapper popup-special-conditions-wrapper popup-conditions-events sgpb-wrapper" data-condition-type="events">
8
  <?php
9
  $creator = new ConditionCreator($popupTargetData);
10
- echo $creator->render();
11
  ?>
12
  </div>
2
  namespace sgpb;
3
  $eventsData = $popupTypeObj->getOptionValue('sgpb-events');
4
  $popupTargetData = ConditionBuilder::createEventsConditionBuilder($eventsData);
5
+ $allowed_html = AdminHelper::allowed_html_tags();
6
  ?>
7
 
8
  <div class="popup-conditions-wrapper popup-special-conditions-wrapper popup-conditions-events sgpb-wrapper" data-condition-type="events">
9
  <?php
10
  $creator = new ConditionCreator($popupTargetData);
11
+ echo wp_kses($creator->render(), $allowed_html);
12
  ?>
13
  </div>
public/views/floatingButton.php CHANGED
@@ -8,7 +8,7 @@ if ($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'basic') {
8
  ?>
9
  <div class="sgpb sgpb-wrapper sgpb-floating-btn-wrapper" id="sgpb-floating-btn-wrapper">
10
  <div class="formItem">
11
- <p class="formItem__title"><?php _e('Enable', SG_POPUP_TEXT_DOMAIN)?>:</p>
12
  <div class="sgpb-onOffSwitch">
13
  <input id="sgpb-enable-floating-button" onchange="SGPBFloatingButton.prototype.adminInit()" type="checkbox" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" id="sgpb-enable-floating-button" name="sgpb-enable-floating-button" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-floating-button')); ?>>
14
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-floating-button">
@@ -19,81 +19,81 @@ if ($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'basic') {
19
  </div>
20
  <div class="sgpb-width-100">
21
  <div class="subFormItem noMargin">
22
- <p class="formItem__title sgpb-margin-y-20"><?php _e('Style', SG_POPUP_TEXT_DOMAIN)?>:</p>
23
  <div class="subForm subForm_squared">
24
- <input type="button" class="sgpb-input-button sgpb-margin-right-20 sgpb-floating-button-style-corner js-floating-button-style squares__square buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'corner') ? ' sgpb-input-button-active' : '';?>" value="<?php _e('Corner', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="corner">
25
- <input type="button" class="sgpb-input-button sgpb-floating-button-style-basic js-floating-button-style squares__square buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'basic') ? ' sgpb-input-button' : '';?>" value="<?php _e('Basic', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="basic">
26
 
27
  <input type="hidden" name="sgpb-floating-button-style" id="sgpb-floating-button-style" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-style'));?>">
28
  </div>
29
  </div>
30
  <div class="subFormItem sgpb-margin-bottom-30 sgpb-floating-btn-position-boxes-container">
31
- <p class="formItem__title sgpb-margin-y-20"><?php _e('Position', SG_POPUP_TEXT_DOMAIN)?>:</p>
32
  <div class="subForm subForm_squared">
33
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-top-left js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'corner') ? ' active' : '';?>" value="<?php _e('Top Left', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-left">
34
- <input type="button" class="sgpb-input-button sgpb-margin-x-10 sgpb-floating-button-position-top-center js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Top Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-center">
35
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-top-right js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Top Right', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-right">
36
  </div>
37
  <div class="subForm subForm_squared sgpb-margin-y-10">
38
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-left-center js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Left center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="left-center">
39
  <input type="button" class="sgpb-input-button sgpb-input-button-bg-arrows sgpb-margin-x-10 sgpb-floating-button-position-empty-box sgpb-input-button-disabled buttonGroup__button" disabled="disabled" value="" data-sgvalue="empty-box">
40
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-right-center js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Right Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="right-center">
41
  </div>
42
  <div class="subForm subForm_squared">
43
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-bottom-left js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Bottom Left', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-left">
44
- <input type="button" class="sgpb-input-button sgpb-margin-x-10 sgpb-floating-button-position-bottom-center js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Bottom Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-center">
45
- <input type="button" class="sgpb-input-button sgpb-floating-button-position-bottom-right js-floating-button-position buttonGroup__button<?php echo ($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '';?>" value="<?php _e('Bottom Right', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-right">
46
  </div>
47
  <input type="hidden" name="sgpb-floating-button-position" id="sgpb-floating-button-position" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-position'));?>">
48
  </div>
49
  <div class="formItem formItem_itemsCentered">
50
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Font size', SG_POPUP_TEXT_DOMAIN)?>:</span>
51
- <input type="number" min="0" name="sgpb-floating-button-font-size" id="sgpb-floating-button-font-size" class="formItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-font-size')); ?>">
52
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
53
  </div>
54
  <div class="sgpb-basic-button-style-options-wrapper-js<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'corner') ? ' sgpb-hide' : ''); ?>">
55
  <div class="formItem formItem_itemsCentered">
56
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Position top', SG_POPUP_TEXT_DOMAIN)?>:</span>
57
- <input type="number" min="0" name="sgpb-floating-button-position-top" id="sgpb-floating-button-position-top" class="formItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-position-top')); ?>">
58
  <div class="formItem__inputValueType sgpb-margin-left-10">%</div>
59
  </div>
60
  <div class="formItem formItem_itemsCentered">
61
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Position right', SG_POPUP_TEXT_DOMAIN)?>:</span>
62
- <input type="number" min="0" name="sgpb-floating-button-position-right" id="sgpb-floating-button-position-right" class="formItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-position-right')); ?>">
63
  <div class="formItem__inputValueType sgpb-margin-left-10">%</div>
64
  </div>
65
  <div class="formItem formItem_itemsCentered">
66
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Border size', SG_POPUP_TEXT_DOMAIN)?>:</span>
67
- <input type="number" min="0" name="sgpb-floating-button-border-size" id="sgpb-floating-button-border-size" class="formItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-border-size')); ?>">
68
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
69
  </div>
70
  <div class="formItem formItem_itemsCentered">
71
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Border radius', SG_POPUP_TEXT_DOMAIN)?>:</span>
72
- <input type="number" min="0" name="sgpb-floating-button-border-radius" id="sgpb-floating-button-border-radius" class="formItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-border-radius')); ?>">
73
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
74
  </div>
75
  <div class="formItem">
76
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
77
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
78
- <input id="sgpb-floating-button-border-color" data-type="borderColor" class="sgpb-color-picker sgpb-floating-button-border-color" type="text" name="sgpb-floating-button-border-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-border-color')); ?>" >
79
  </div>
80
  </div>
81
  </div>
82
  <div class="formItem">
83
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
84
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
85
- <input id="sgpb-floating-button-bg-color" data-type="backgroundColor" class="sgpb-color-picker sgpb-floating-button-bg-color" type="text" name="sgpb-floating-button-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-bg-color')); ?>" >
86
  </div>
87
  </div>
88
  <div class="formItem">
89
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
90
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
91
- <input id="sgpb-floating-button-text-color" data-type="color" class="sgpb-color-picker sgpb-floating-button-text-color" type="text" name="sgpb-floating-button-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-text-color')); ?>" >
92
  </div>
93
  </div>
94
  <div class="formItem">
95
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Text', SG_POPUP_TEXT_DOMAIN)?>:</span>
96
- <input id="sgpb-floating-button-text" class="subFormItem__input" type="text" name="sgpb-floating-button-text" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-text')); ?>" >
97
  </div>
98
  </div>
99
  </div>
8
  ?>
9
  <div class="sgpb sgpb-wrapper sgpb-floating-btn-wrapper" id="sgpb-floating-btn-wrapper">
10
  <div class="formItem">
11
+ <p class="formItem__title"><?php esc_html_e('Enable', SG_POPUP_TEXT_DOMAIN)?>:</p>
12
  <div class="sgpb-onOffSwitch">
13
  <input id="sgpb-enable-floating-button" onchange="SGPBFloatingButton.prototype.adminInit()" type="checkbox" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" id="sgpb-enable-floating-button" name="sgpb-enable-floating-button" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-floating-button')); ?>>
14
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-floating-button">
19
  </div>
20
  <div class="sgpb-width-100">
21
  <div class="subFormItem noMargin">
22
+ <p class="formItem__title sgpb-margin-y-20"><?php esc_html_e('Style', SG_POPUP_TEXT_DOMAIN)?>:</p>
23
  <div class="subForm subForm_squared">
24
+ <input type="button" class="sgpb-input-button sgpb-margin-right-20 sgpb-floating-button-style-corner js-floating-button-style squares__square buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'corner') ? ' sgpb-input-button-active' : '');?>" value="<?php esc_html_e('Corner', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="corner">
25
+ <input type="button" class="sgpb-input-button sgpb-floating-button-style-basic js-floating-button-style squares__square buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-style') == 'basic') ? ' sgpb-input-button' : '');?>" value="<?php esc_html_e('Basic', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="basic">
26
 
27
  <input type="hidden" name="sgpb-floating-button-style" id="sgpb-floating-button-style" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-style'));?>">
28
  </div>
29
  </div>
30
  <div class="subFormItem sgpb-margin-bottom-30 sgpb-floating-btn-position-boxes-container">
31
+ <p class="formItem__title sgpb-margin-y-20"><?php esc_html_e('Position', SG_POPUP_TEXT_DOMAIN)?>:</p>
32
  <div class="subForm subForm_squared">
33
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-top-left js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'corner') ? ' active' : '');?>" value="<?php esc_html_e('Top Left', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-left">
34
+ <input type="button" class="sgpb-input-button sgpb-margin-x-10 sgpb-floating-button-position-top-center js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Top Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-center">
35
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-top-right js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Top Right', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="top-right">
36
  </div>
37
  <div class="subForm subForm_squared sgpb-margin-y-10">
38
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-left-center js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Left center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="left-center">
39
  <input type="button" class="sgpb-input-button sgpb-input-button-bg-arrows sgpb-margin-x-10 sgpb-floating-button-position-empty-box sgpb-input-button-disabled buttonGroup__button" disabled="disabled" value="" data-sgvalue="empty-box">
40
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-right-center js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Right Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="right-center">
41
  </div>
42
  <div class="subForm subForm_squared">
43
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-bottom-left js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Bottom Left', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-left">
44
+ <input type="button" class="sgpb-input-button sgpb-margin-x-10 sgpb-floating-button-position-bottom-center js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Bottom Center', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-center">
45
+ <input type="button" class="sgpb-input-button sgpb-floating-button-position-bottom-right js-floating-button-position buttonGroup__button<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'basic') ? ' active' : '');?>" value="<?php esc_html_e('Bottom Right', SG_POPUP_TEXT_DOMAIN)?>" data-sgvalue="bottom-right">
46
  </div>
47
  <input type="hidden" name="sgpb-floating-button-position" id="sgpb-floating-button-position" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-position'));?>">
48
  </div>
49
  <div class="formItem formItem_itemsCentered">
50
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Font size', SG_POPUP_TEXT_DOMAIN)?>:</span>
51
+ <input type="number" min="0" name="sgpb-floating-button-font-size" id="sgpb-floating-button-font-size" class="formItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-font-size')); ?>">
52
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
53
  </div>
54
  <div class="sgpb-basic-button-style-options-wrapper-js<?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-floating-button-position') == 'corner') ? ' sgpb-hide' : ''); ?>">
55
  <div class="formItem formItem_itemsCentered">
56
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Position top', SG_POPUP_TEXT_DOMAIN)?>:</span>
57
+ <input type="number" min="0" name="sgpb-floating-button-position-top" id="sgpb-floating-button-position-top" class="formItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-position-top')); ?>">
58
  <div class="formItem__inputValueType sgpb-margin-left-10">%</div>
59
  </div>
60
  <div class="formItem formItem_itemsCentered">
61
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Position right', SG_POPUP_TEXT_DOMAIN)?>:</span>
62
+ <input type="number" min="0" name="sgpb-floating-button-position-right" id="sgpb-floating-button-position-right" class="formItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-position-right')); ?>">
63
  <div class="formItem__inputValueType sgpb-margin-left-10">%</div>
64
  </div>
65
  <div class="formItem formItem_itemsCentered">
66
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Border size', SG_POPUP_TEXT_DOMAIN)?>:</span>
67
+ <input type="number" min="0" name="sgpb-floating-button-border-size" id="sgpb-floating-button-border-size" class="formItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-border-size')); ?>">
68
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
69
  </div>
70
  <div class="formItem formItem_itemsCentered">
71
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Border radius', SG_POPUP_TEXT_DOMAIN)?>:</span>
72
+ <input type="number" min="0" name="sgpb-floating-button-border-radius" id="sgpb-floating-button-border-radius" class="formItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-border-radius')); ?>">
73
  <div class="formItem__inputValueType sgpb-margin-left-10">px</div>
74
  </div>
75
  <div class="formItem">
76
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
77
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
78
+ <input id="sgpb-floating-button-border-color" data-type="borderColor" class="sgpb-color-picker sgpb-floating-button-border-color" type="text" name="sgpb-floating-button-border-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-border-color')); ?>" >
79
  </div>
80
  </div>
81
  </div>
82
  <div class="formItem">
83
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
84
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
85
+ <input id="sgpb-floating-button-bg-color" data-type="backgroundColor" class="sgpb-color-picker sgpb-floating-button-bg-color" type="text" name="sgpb-floating-button-bg-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-bg-color')); ?>" >
86
  </div>
87
  </div>
88
  <div class="formItem">
89
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
90
  <div class="sgpb-color-picker-wrapper sgpb-overlay-color unhideColorPicker">
91
+ <input id="sgpb-floating-button-text-color" data-type="color" class="sgpb-color-picker sgpb-floating-button-text-color" type="text" name="sgpb-floating-button-text-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-text-color')); ?>" >
92
  </div>
93
  </div>
94
  <div class="formItem">
95
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Text', SG_POPUP_TEXT_DOMAIN)?>:</span>
96
+ <input id="sgpb-floating-button-text" class="subFormItem__input" type="text" name="sgpb-floating-button-text" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-floating-button-text')); ?>" >
97
  </div>
98
  </div>
99
  </div>
public/views/htmlCustomButtonElement.php CHANGED
@@ -22,91 +22,91 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
22
  );
23
  ?>
24
  <div class="sgpb-wrapper">
25
- <img class="sgpb-add-subscriber-popup-close-btn sgpb-custom-button-close-popup sgpb-close-media-popup-js" src="<?php echo SG_POPUP_IMG_URL.'subscribers_close.png'; ?>" width='15px'>
26
  <div class="row form-group">
27
  <label for="sgpb-custom-btn-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
28
- <?php _e('Title', SG_POPUP_TEXT_DOMAIN); ?>:
29
  </label>
30
  <div class="col-md-6">
31
- <input class="form-control sgpb-full-width-events" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="title" type="text" name="sgpb-custom-btn-title" id="sgpb-custom-btn-title" value="<?php echo esc_html($buttonDefaultStyles['title']); ?>">
32
  </div>
33
  </div>
34
  <div class="row form-group">
35
  <div class="col-md-6">
36
  <div class="row form-group">
37
  <label class="col-md-12 control-label">
38
- <?php _e('Custom Button Styles', SG_POPUP_TEXT_DOMAIN); ?>
39
  </label>
40
  </div>
41
  <div class="row form-group">
42
  <label for="sgpb-custom-btn-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
43
- <?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:
44
  </label>
45
  <div class="col-md-6">
46
- <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="width" type="text" name="sgpb-custom-btn-width" id="sgpb-custom-btn-width" value="<?php echo esc_html($buttonDefaultStyles['width']); ?>">
47
  </div>
48
  </div>
49
  <div class="row form-group">
50
  <label for="sgpb-custom-btn-height" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
51
- <?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
52
  </label>
53
  <div class="col-md-6">
54
- <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="height" type="text" name="sgpb-custom-btn-height" id="sgpb-custom-btn-height" value="<?php echo esc_html($buttonDefaultStyles['height']); ?>">
55
  </div>
56
  </div>
57
  <div class="row form-group">
58
  <label for="sgpb-custom-btn-border-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
59
- <?php _e('Border width', SG_POPUP_TEXT_DOMAIN); ?>:
60
  </label>
61
  <div class="col-md-6">
62
- <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="border-width" type="text" name="sgpb-custom-btn-border-width" id="sgpb-custom-btn-border-width" value="<?php echo esc_html($buttonDefaultStyles['borderWidth']); ?>">
63
  </div>
64
  </div>
65
  <div class="row form-group">
66
  <label for="sgpb-custom-btn-border-radius" class="col-md-6 control-label sgpb-sub-option">
67
- <?php _e('Border radius', SG_POPUP_TEXT_DOMAIN); ?>:
68
  </label>
69
  <div class="col-md-6">
70
- <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="border-radius" type="text" name="sgpb-custom-btn-border-radius" id="sgpb-custom-btn-border-radius" value="<?php echo esc_html($buttonDefaultStyles['borderRadius']); ?>">
71
  </div>
72
  </div>
73
  <div class="row form-group">
74
  <label for="sgpb-custom-btn-border-color" class="col-md-6 control-label sgpb-sub-option">
75
- <?php _e('Border color', SG_POPUP_TEXT_DOMAIN); ?>:
76
  </label>
77
  <div class="col-md-6">
78
  <div class="sgpb-color-picker-wrapper">
79
- <input id="sgpb-custom-btn-border-color" class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="border-color" type="text" name="sgpb-custom-btn-border-color" value="<?php echo esc_html($buttonDefaultStyles['borderColor']); ?>">
80
  </div>
81
  </div>
82
  </div>
83
  <div class="row form-group">
84
  <label class="col-md-6 control-label sgpb-sub-option">
85
- <?php _e('Background color', SG_POPUP_TEXT_DOMAIN); ?>:
86
  </label>
87
  <div class="col-md-6">
88
  <div class="sgpb-color-picker-wrapper">
89
- <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="background-color" type="text" name="sgpb-custom-btn-bg-color" value="<?php echo esc_html($buttonDefaultStyles['backgroundColor']); ?>">
90
  </div>
91
  </div>
92
  </div>
93
  <div class="row form-group">
94
  <label class="col-md-6 control-label sgpb-sub-option">
95
- <?php _e('Hover background color', SG_POPUP_TEXT_DOMAIN); ?>:
96
  </label>
97
  <div class="col-md-6">
98
  <div class="sgpb-color-picker-wrapper">
99
- <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="hover-color" type="text" name="sgpb-custom-btn-bg-color" value="<?php echo esc_html($buttonDefaultStyles['backgroundHoverColor']); ?>">
100
  </div>
101
  </div>
102
  </div>
103
  <div class="row form-group">
104
  <label class="col-md-6 control-label sgpb-sub-option">
105
- <?php _e('Text color', SG_POPUP_TEXT_DOMAIN); ?>:
106
  </label>
107
  <div class="col-md-6">
108
  <div class="sgpb-color-picker-wrapper">
109
- <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="color" type="text" name="sgpb-custom-btn-text-color" value="<?php echo esc_html($buttonDefaultStyles['textColor']); ?>">
110
  </div>
111
  </div>
112
  </div>
@@ -114,29 +114,29 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
114
  <div class="col-md-6">
115
  <div class="row form-group">
116
  <label class="col-md-12 control-label">
117
- <?php _e('Button events', SG_POPUP_TEXT_DOMAIN); ?>
118
  </label>
119
  </div>
120
  <?php
121
  $multipleChoiceButton = new \sgpb\MultipleChoiceButton($defaultData['htmlCustomButtonArgs'], 'hidePopup');
122
- echo $multipleChoiceButton;
123
  ?>
124
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-copy">
125
  <div class="row form-group">
126
  <label for="sgpb-custom-button-copy-to-clipboard-text" class="col-md-6 control-label sgpb-double-sub-option">
127
- <?php _e('Text', SG_POPUP_TEXT_DOMAIN)?>:
128
  </label>
129
  <div class="col-md-6"><input name="sgpb-custom-button-copy-to-clipboard-text" id="sgpb-custom-button-copy-to-clipboard-text" class="form-control sgpb-full-width-events" value="some text here"></div>
130
  </div>
131
  <div class="row form-group">
132
  <label for="sgpb-custom-button-copy-to-clipboard-close-popup" class="col-md-6 control-label sgpb-double-sub-option">
133
- <?php _e('Close popup', SG_POPUP_TEXT_DOMAIN)?>:
134
  </label>
135
  <div class="col-md-6"><input type="checkbox" name="sgpb-custom-button-copy-to-clipboard-close-popup" id="sgpb-custom-button-copy-to-clipboard-close-popup"></div>
136
  </div>
137
  <div class="row form-group">
138
  <label for="sgpb-custom-button-copy-to-clipboard-alert" class="col-md-6 control-label sgpb-double-sub-option">
139
- <?php _e('Show alert', SG_POPUP_TEXT_DOMAIN)?>:
140
  </label>
141
  <div class="col-md-6">
142
  <input type="checkbox" id="sgpb-custom-button-copy-to-clipboard-alert" class="js-checkbox-accordion" name="sgpb-custom-button-copy-to-clipboard-alert">
@@ -145,7 +145,7 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
145
  <div class="sg-full-width form-group">
146
  <div class="row">
147
  <label for="col-md-5 sgpb-copy-to-clipboard-message" class="col-md-6 control-label sgpb-double-sub-option">
148
- <?php _e('Message', SG_POPUP_TEXT_DOMAIN)?>:
149
  </label>
150
  <div class="col-md-6">
151
  <input type="text" id="sgpb-custom-button-copy-to-clipboard-message" class="form-control sgpb-full-width-events " name="sgpb-custom-button-copy-to-clipboard-message" value="Copied to clipboard!">
@@ -156,13 +156,13 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
156
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-redirect-to-URL">
157
  <div class="row form-group">
158
  <label for="sgpb-custom-button-redirect-URL" class="col-md-6 control-label sgpb-double-sub-option">
159
- <?php _e('Redirect URL', SG_POPUP_TEXT_DOMAIN)?>:
160
  </label>
161
  <div class="col-md-6"><input type="url" name="sgpb-custom-button-redirect-URL" id="sgpb-custom-button-redirect-URL" placeholder="https://www.example.com" class="form-control sgpb-full-width-events" value=""></div>
162
  </div>
163
  <div class="row form-group">
164
  <label for="sgpb-custom-button-redirect-new-tab" class="col-md-6 control-label sgpb-double-sub-option">
165
- <?php _e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:
166
  </label>
167
  <div class="col-md-6"><input type="checkbox" name="sgpb-custom-button-redirect-new-tab" id="sgpb-custom-button-redirect-new-tab" placeholder="https://www.example.com" ></div>
168
  </div>
@@ -170,10 +170,10 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
170
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-open-popup">
171
  <div class="row form-group">
172
  <label for="sgpb-subs-success-redirect-URL" class="col-md-6 control-label sgpb-double-sub-option">
173
- <?php _e('Select popup', SG_POPUP_TEXT_DOMAIN)?>:
174
  </label>
175
  <div class="col-md-6">
176
- <?php echo sgpb\AdminHelper::createSelectBox($allPopups, '', array('name' => 'sgpb-custom-button-popup', 'class'=>'js-sg-select2 sgpb-full-width-events sgpb-custom-button-popup')); ?>
177
  </div>
178
  </div>
179
  </div>
@@ -182,10 +182,10 @@ $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
182
  </div>
183
  <div class="row">
184
  <div class="col-md-6">
185
- <input type="button" value="<?php _e('Insert', SG_POPUP_TEXT_DOMAIN); ?>" class="btn btn-sm btn-success sgpb-subscriber-popup-btns sgpb-insert-custom-button-to-editor sgpb-close-media-popup-js" data-ajaxnonce="popupBuilderAjaxNonce">
186
  </div>
187
  <div class="col-md-6">
188
- <input type="button" value="<?php _e('Cancel', SG_POPUP_TEXT_DOMAIN); ?>" class="btn btn-sm btn-default sgpb-add-subscriber-popup-close-btn-js sgpb-subscriber-popup-btns sgpb-subscriber-popup-close-btn-js sgpb-close-media-popup-js" data-ajaxnonce="popupBuilderAjaxNonce">
189
  </div>
190
  </div>
191
  </div>
22
  );
23
  ?>
24
  <div class="sgpb-wrapper">
25
+ <img class="sgpb-add-subscriber-popup-close-btn sgpb-custom-button-close-popup sgpb-close-media-popup-js" src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'subscribers_close.png'); ?>" width='15px'>
26
  <div class="row form-group">
27
  <label for="sgpb-custom-btn-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
28
+ <?php esc_html_e('Title', SG_POPUP_TEXT_DOMAIN); ?>:
29
  </label>
30
  <div class="col-md-6">
31
+ <input class="form-control sgpb-full-width-events" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="title" type="text" name="sgpb-custom-btn-title" id="sgpb-custom-btn-title" value="<?php echo esc_attr($buttonDefaultStyles['title']); ?>">
32
  </div>
33
  </div>
34
  <div class="row form-group">
35
  <div class="col-md-6">
36
  <div class="row form-group">
37
  <label class="col-md-12 control-label">
38
+ <?php esc_html_e('Custom Button Styles', SG_POPUP_TEXT_DOMAIN); ?>
39
  </label>
40
  </div>
41
  <div class="row form-group">
42
  <label for="sgpb-custom-btn-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
43
+ <?php esc_html_e('Width', SG_POPUP_TEXT_DOMAIN); ?>:
44
  </label>
45
  <div class="col-md-6">
46
+ <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="width" type="text" name="sgpb-custom-btn-width" id="sgpb-custom-btn-width" value="<?php echo esc_attr($buttonDefaultStyles['width']); ?>">
47
  </div>
48
  </div>
49
  <div class="row form-group">
50
  <label for="sgpb-custom-btn-height" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
51
+ <?php esc_html_e('Height', SG_POPUP_TEXT_DOMAIN); ?>:
52
  </label>
53
  <div class="col-md-6">
54
+ <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="height" type="text" name="sgpb-custom-btn-height" id="sgpb-custom-btn-height" value="<?php echo esc_attr($buttonDefaultStyles['height']); ?>">
55
  </div>
56
  </div>
57
  <div class="row form-group">
58
  <label for="sgpb-custom-btn-border-width" class="col-md-6 control-label sgpb-static-padding-top sgpb-sub-option">
59
+ <?php esc_html_e('Border width', SG_POPUP_TEXT_DOMAIN); ?>:
60
  </label>
61
  <div class="col-md-6">
62
+ <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="border-width" type="text" name="sgpb-custom-btn-border-width" id="sgpb-custom-btn-border-width" value="<?php echo esc_attr($buttonDefaultStyles['borderWidth']); ?>">
63
  </div>
64
  </div>
65
  <div class="row form-group">
66
  <label for="sgpb-custom-btn-border-radius" class="col-md-6 control-label sgpb-sub-option">
67
+ <?php esc_html_e('Border radius', SG_POPUP_TEXT_DOMAIN); ?>:
68
  </label>
69
  <div class="col-md-6">
70
+ <input class="form-control js-contact-dimension sgpb-full-width-events sgpb-custom-button-settings" data-contact-rel="js-contact-submit-btn" data-field-type="button" data-style-type="border-radius" type="text" name="sgpb-custom-btn-border-radius" id="sgpb-custom-btn-border-radius" value="<?php echo esc_attr($buttonDefaultStyles['borderRadius']); ?>">
71
  </div>
72
  </div>
73
  <div class="row form-group">
74
  <label for="sgpb-custom-btn-border-color" class="col-md-6 control-label sgpb-sub-option">
75
+ <?php esc_html_e('Border color', SG_POPUP_TEXT_DOMAIN); ?>:
76
  </label>
77
  <div class="col-md-6">
78
  <div class="sgpb-color-picker-wrapper">
79
+ <input id="sgpb-custom-btn-border-color" class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="border-color" type="text" name="sgpb-custom-btn-border-color" value="<?php echo esc_attr($buttonDefaultStyles['borderColor']); ?>">
80
  </div>
81
  </div>
82
  </div>
83
  <div class="row form-group">
84
  <label class="col-md-6 control-label sgpb-sub-option">
85
+ <?php esc_html_e('Background color', SG_POPUP_TEXT_DOMAIN); ?>:
86
  </label>
87
  <div class="col-md-6">
88
  <div class="sgpb-color-picker-wrapper">
89
+ <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="background-color" type="text" name="sgpb-custom-btn-bg-color" value="<?php echo esc_attr($buttonDefaultStyles['backgroundColor']); ?>">
90
  </div>
91
  </div>
92
  </div>
93
  <div class="row form-group">
94
  <label class="col-md-6 control-label sgpb-sub-option">
95
+ <?php esc_html_e('Hover background color', SG_POPUP_TEXT_DOMAIN); ?>:
96
  </label>
97
  <div class="col-md-6">
98
  <div class="sgpb-color-picker-wrapper">
99
+ <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="hover-color" type="text" name="sgpb-custom-btn-bg-color" value="<?php echo esc_attr($buttonDefaultStyles['backgroundHoverColor']); ?>">
100
  </div>
101
  </div>
102
  </div>
103
  <div class="row form-group">
104
  <label class="col-md-6 control-label sgpb-sub-option">
105
+ <?php esc_html_e('Text color', SG_POPUP_TEXT_DOMAIN); ?>:
106
  </label>
107
  <div class="col-md-6">
108
  <div class="sgpb-color-picker-wrapper">
109
+ <input class="sgpb-custom-button-color-picker sgpb-custom-button-settings" data-field-type="button" data-contact-rel="js-contact-submit-btn" data-style-type="color" type="text" name="sgpb-custom-btn-text-color" value="<?php echo esc_attr($buttonDefaultStyles['textColor']); ?>">
110
  </div>
111
  </div>
112
  </div>
114
  <div class="col-md-6">
115
  <div class="row form-group">
116
  <label class="col-md-12 control-label">
117
+ <?php esc_html_e('Button events', SG_POPUP_TEXT_DOMAIN); ?>
118
  </label>
119
  </div>
120
  <?php
121
  $multipleChoiceButton = new \sgpb\MultipleChoiceButton($defaultData['htmlCustomButtonArgs'], 'hidePopup');
122
+ echo wp_kses($multipleChoiceButton, AdminHelper::allowed_html_tags());
123
  ?>
124
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-copy">
125
  <div class="row form-group">
126
  <label for="sgpb-custom-button-copy-to-clipboard-text" class="col-md-6 control-label sgpb-double-sub-option">
127
+ <?php esc_html_e('Text', SG_POPUP_TEXT_DOMAIN)?>:
128
  </label>
129
  <div class="col-md-6"><input name="sgpb-custom-button-copy-to-clipboard-text" id="sgpb-custom-button-copy-to-clipboard-text" class="form-control sgpb-full-width-events" value="some text here"></div>
130
  </div>
131
  <div class="row form-group">
132
  <label for="sgpb-custom-button-copy-to-clipboard-close-popup" class="col-md-6 control-label sgpb-double-sub-option">
133
+ <?php esc_html_e('Close popup', SG_POPUP_TEXT_DOMAIN)?>:
134
  </label>
135
  <div class="col-md-6"><input type="checkbox" name="sgpb-custom-button-copy-to-clipboard-close-popup" id="sgpb-custom-button-copy-to-clipboard-close-popup"></div>
136
  </div>
137
  <div class="row form-group">
138
  <label for="sgpb-custom-button-copy-to-clipboard-alert" class="col-md-6 control-label sgpb-double-sub-option">
139
+ <?php esc_html_e('Show alert', SG_POPUP_TEXT_DOMAIN)?>:
140
  </label>
141
  <div class="col-md-6">
142
  <input type="checkbox" id="sgpb-custom-button-copy-to-clipboard-alert" class="js-checkbox-accordion" name="sgpb-custom-button-copy-to-clipboard-alert">
145
  <div class="sg-full-width form-group">
146
  <div class="row">
147
  <label for="col-md-5 sgpb-copy-to-clipboard-message" class="col-md-6 control-label sgpb-double-sub-option">
148
+ <?php esc_html_e('Message', SG_POPUP_TEXT_DOMAIN)?>:
149
  </label>
150
  <div class="col-md-6">
151
  <input type="text" id="sgpb-custom-button-copy-to-clipboard-message" class="form-control sgpb-full-width-events " name="sgpb-custom-button-copy-to-clipboard-message" value="Copied to clipboard!">
156
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-redirect-to-URL">
157
  <div class="row form-group">
158
  <label for="sgpb-custom-button-redirect-URL" class="col-md-6 control-label sgpb-double-sub-option">
159
+ <?php esc_html_e('Redirect URL', SG_POPUP_TEXT_DOMAIN)?>:
160
  </label>
161
  <div class="col-md-6"><input type="url" name="sgpb-custom-button-redirect-URL" id="sgpb-custom-button-redirect-URL" placeholder="https://www.example.com" class="form-control sgpb-full-width-events" value=""></div>
162
  </div>
163
  <div class="row form-group">
164
  <label for="sgpb-custom-button-redirect-new-tab" class="col-md-6 control-label sgpb-double-sub-option">
165
+ <?php esc_html_e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:
166
  </label>
167
  <div class="col-md-6"><input type="checkbox" name="sgpb-custom-button-redirect-new-tab" id="sgpb-custom-button-redirect-new-tab" placeholder="https://www.example.com" ></div>
168
  </div>
170
  <div class="sg-hide sg-full-width" id="sgpb-custom-button-open-popup">
171
  <div class="row form-group">
172
  <label for="sgpb-subs-success-redirect-URL" class="col-md-6 control-label sgpb-double-sub-option">
173
+ <?php esc_html_e('Select popup', SG_POPUP_TEXT_DOMAIN)?>:
174
  </label>
175
  <div class="col-md-6">
176
+ <?php echo wp_kses(sgpb\AdminHelper::createSelectBox($allPopups, '', array('name' => 'sgpb-custom-button-popup', 'class'=>'js-sg-select2 sgpb-full-width-events sgpb-custom-button-popup')), AdminHelper::allowed_html_tags()); ?>
177
  </div>
178
  </div>
179
  </div>
182
  </div>
183
  <div class="row">
184
  <div class="col-md-6">
185
+ <input type="button" value="<?php esc_html_e('Insert', SG_POPUP_TEXT_DOMAIN); ?>" class="btn btn-sm btn-success sgpb-subscriber-popup-btns sgpb-insert-custom-button-to-editor sgpb-close-media-popup-js" data-ajaxnonce="popupBuilderAjaxNonce">
186
  </div>
187
  <div class="col-md-6">
188
+ <input type="button" value="<?php esc_html_e('Cancel', SG_POPUP_TEXT_DOMAIN); ?>" class="btn btn-sm btn-default sgpb-add-subscriber-popup-close-btn-js sgpb-subscriber-popup-btns sgpb-subscriber-popup-close-btn-js sgpb-close-media-popup-js" data-ajaxnonce="popupBuilderAjaxNonce">
189
  </div>
190
  </div>
191
  </div>
public/views/importConfigView.php CHANGED
@@ -14,14 +14,14 @@ $formData = array('' => 'Select Field') + AdminHelper::getSubscriptionColumnsBy
14
  ?>
15
 
16
  <div id="importSubscribersSecondStep">
17
- <h1 id="importSubscriberHeader"><?php _e('Match Your Fields', SG_POPUP_TEXT_DOMAIN); ?></h1>
18
  <div id="importSubscriberBody">
19
  <div class="formItem sgpb-justify-content-around">
20
  <div class="formItem__title">
21
- <?php _e('Available fields', SG_POPUP_TEXT_DOMAIN); ?>
22
  </div>
23
  <div class="formItem__title">
24
- <?php _e('Our list fields', SG_POPUP_TEXT_DOMAIN); ?>
25
  </div>
26
  </div>
27
  <?php foreach($csvFileArray[0] as $index => $current): ?>
@@ -35,7 +35,7 @@ $formData = array('' => 'Select Field') + AdminHelper::getSubscriptionColumnsBy
35
  <div>
36
  <?php
37
  $ourFieldsArgs['data-index'] = $index;
38
- echo AdminHelper::createSelectBox($formData, '', $ourFieldsArgs);
39
  ?>
40
  </div>
41
  </div>
@@ -45,7 +45,7 @@ $formData = array('' => 'Select Field') + AdminHelper::getSubscriptionColumnsBy
45
  </div>
46
 
47
  <div id="importSubscriberFooter">
48
- <input type="button" value="<?php _e('Save', SG_POPUP_TEXT_DOMAIN); ?>" class="sgpb-btn sgpb-btn-blue sgpb-save-subscriber" data-ajaxnonce="popupBuilderAjaxNonce">
49
  </div>
50
 
51
  </div>
14
  ?>
15
 
16
  <div id="importSubscribersSecondStep">
17
+ <h1 id="importSubscriberHeader"><?php esc_html_e('Match Your Fields', SG_POPUP_TEXT_DOMAIN); ?></h1>
18
  <div id="importSubscriberBody">
19
  <div class="formItem sgpb-justify-content-around">
20
  <div class="formItem__title">
21
+ <?php esc_html_e('Available fields', SG_POPUP_TEXT_DOMAIN); ?>
22
  </div>
23
  <div class="formItem__title">
24
+ <?php esc_html_e('Our list fields', SG_POPUP_TEXT_DOMAIN); ?>
25
  </div>
26
  </div>
27
  <?php foreach($csvFileArray[0] as $index => $current): ?>
35
  <div>
36
  <?php
37
  $ourFieldsArgs['data-index'] = $index;
38
+ echo wp_kses(AdminHelper::createSelectBox($formData, '', $ourFieldsArgs), AdminHelper::allowed_html_tags());
39
  ?>
40
  </div>
41
  </div>
45
  </div>
46
 
47
  <div id="importSubscriberFooter">
48
+ <input type="button" value="<?php esc_html_e('Save', SG_POPUP_TEXT_DOMAIN); ?>" class="sgpb-btn sgpb-btn-blue sgpb-save-subscriber" data-ajaxnonce="popupBuilderAjaxNonce">
49
  </div>
50
 
51
  </div>
public/views/importPopupsView.php CHANGED
@@ -12,7 +12,7 @@
12
  <div class="sgpb sgpb-wrapper">
13
  <div class="sgpb-import-popups">
14
  <h3 class="sgpb-header-h3">
15
- <span><?php _e('Import popups', SG_POPUP_TEXT_DOMAIN); ?></span>
16
  </h3>
17
  <div class="sgpb-import-popups-form">
18
  <?php
12
  <div class="sgpb sgpb-wrapper">
13
  <div class="sgpb-import-popups">
14
  <h3 class="sgpb-header-h3">
15
+ <span><?php esc_html_e('Import popups', SG_POPUP_TEXT_DOMAIN); ?></span>
16
  </h3>
17
  <div class="sgpb-import-popups-form">
18
  <?php
public/views/jsVariableView.php CHANGED
@@ -6,55 +6,55 @@ namespace sgpb;
6
  <div id="sgpb-js-variable-wrapper" class="sgpb-wrapper sgpb">
7
  <div class="row">
8
  <div class="col-sm-10">
9
- <label><?php _e('Insert JS variable inside the popup', SG_POPUP_TEXT_DOMAIN)?></label>
10
  </div>
11
  <div class="col-sm-2">
12
- <img class="sgpb-add-subscriber-popup-close-btn sgpb-close-media-popup-js" src="<?php echo SG_POPUP_IMG_URL.'subscribers_close.png'; ?>" width='15px'>
13
  </div>
14
  </div>
15
  <div class="sgpb-insert-popup-title-border"></div>
16
  <div class="row form-group">
17
  <div class="col-sm-2 sgpb-static-padding-top">
18
- <label for="sgpb-js-variable-selector"><?php _e('Selector', SG_POPUP_TEXT_DOMAIN)?>:</label>
19
  </div>
20
  <div class="col-sm-5">
21
  <input type="text" id="sgpb-js-variable-selector" class="sgpb-js-variable-selector form-control input-sm">
22
  </div>
23
  <div class="col-sm-5 sgpb-static-padding-top">
24
- <label><?php _e('Ex. #myselector or .myselector', SG_POPUP_TEXT_DOMAIN) ?></label>
25
  </div>
26
  </div>
27
  <div class="row">
28
  <div class="col-md-12">
29
  <div class="sg-hide-element sgpb-js-variable-errors sgpb-js-variable-selector-error">
30
- <label class="sgpb-label-error"><?php _e('This field is required', SG_POPUP_TEXT_DOMAIN) ?>.</label>
31
  </div>
32
  </div>
33
  </div>
34
  <div class="row form-group">
35
  <div class="col-sm-2 sgpb-static-padding-top">
36
- <label for="sgpb-js-variable-attribute"><?php _e('Attribute', SG_POPUP_TEXT_DOMAIN)?>:</label>
37
  </div>
38
  <div class="col-sm-5">
39
  <input type="text" id="sgpb-js-variable-attribute" class="sgpb-js-variable-attribute form-control input-sm">
40
  </div>
41
  <div class="col-sm-5 sgpb-static-padding-top">
42
- <label><?php _e('Ex. value or data-name', SG_POPUP_TEXT_DOMAIN) ?></label>
43
  </div>
44
  </div>
45
  <div class="row">
46
  <div class="col-md-12">
47
  <div class="sg-hide-element sgpb-js-variable-errors sgpb-js-variable-attribute-error">
48
- <label class="sgpb-label-error"><?php _e('This field is required', SG_POPUP_TEXT_DOMAIN) ?>.</label>
49
  </div>
50
  </div>
51
  </div>
52
  <div class="row sgpb-static-padding-top">
53
  <div class="col-sm-3">
54
- <input type="button" class="sgpb-btn sgpb-btn-blue sgpb-insert-js-variable-to-editor sgpb-insert-popup-btns" value="<?php _e('Insert', SG_POPUP_TEXT_DOMAIN)?>">
55
  </div>
56
  <div class="col-sm-3">
57
- <input type="button" class="sgpb-btn sgpb-btn-gray-light sgpb-close-media-popup-js sgpb-insert-popup-btns" value="<?php _e('Cancel', SG_POPUP_TEXT_DOMAIN)?>">
58
  </div>
59
  </div>
60
  </div>
6
  <div id="sgpb-js-variable-wrapper" class="sgpb-wrapper sgpb">
7
  <div class="row">
8
  <div class="col-sm-10">
9
+ <label><?php esc_html_e('Insert JS variable inside the popup', SG_POPUP_TEXT_DOMAIN)?></label>
10
  </div>
11
  <div class="col-sm-2">
12
+ <img class="sgpb-add-subscriber-popup-close-btn sgpb-close-media-popup-js" src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'subscribers_close.png'); ?>" width='15px'>
13
  </div>
14
  </div>
15
  <div class="sgpb-insert-popup-title-border"></div>
16
  <div class="row form-group">
17
  <div class="col-sm-2 sgpb-static-padding-top">
18
+ <label for="sgpb-js-variable-selector"><?php esc_html_e('Selector', SG_POPUP_TEXT_DOMAIN)?>:</label>
19
  </div>
20
  <div class="col-sm-5">
21
  <input type="text" id="sgpb-js-variable-selector" class="sgpb-js-variable-selector form-control input-sm">
22
  </div>
23
  <div class="col-sm-5 sgpb-static-padding-top">
24
+ <label><?php esc_html_e('Ex. #myselector or .myselector', SG_POPUP_TEXT_DOMAIN) ?></label>
25
  </div>
26
  </div>
27
  <div class="row">
28
  <div class="col-md-12">
29
  <div class="sg-hide-element sgpb-js-variable-errors sgpb-js-variable-selector-error">
30
+ <label class="sgpb-label-error"><?php esc_html_e('This field is required', SG_POPUP_TEXT_DOMAIN) ?>.</label>
31
  </div>
32
  </div>
33
  </div>
34
  <div class="row form-group">
35
  <div class="col-sm-2 sgpb-static-padding-top">
36
+ <label for="sgpb-js-variable-attribute"><?php esc_html_e('Attribute', SG_POPUP_TEXT_DOMAIN)?>:</label>
37
  </div>
38
  <div class="col-sm-5">
39
  <input type="text" id="sgpb-js-variable-attribute" class="sgpb-js-variable-attribute form-control input-sm">
40
  </div>
41
  <div class="col-sm-5 sgpb-static-padding-top">
42
+ <label><?php esc_html_e('Ex. value or data-name', SG_POPUP_TEXT_DOMAIN) ?></label>
43
  </div>
44
  </div>
45
  <div class="row">
46
  <div class="col-md-12">
47
  <div class="sg-hide-element sgpb-js-variable-errors sgpb-js-variable-attribute-error">
48
+ <label class="sgpb-label-error"><?php esc_html_e('This field is required', SG_POPUP_TEXT_DOMAIN) ?>.</label>
49
  </div>
50
  </div>
51
  </div>
52
  <div class="row sgpb-static-padding-top">
53
  <div class="col-sm-3">
54
+ <input type="button" class="sgpb-btn sgpb-btn-blue sgpb-insert-js-variable-to-editor sgpb-insert-popup-btns" value="<?php esc_html_e('Insert', SG_POPUP_TEXT_DOMAIN)?>">
55
  </div>
56
  <div class="col-sm-3">
57
+ <input type="button" class="sgpb-btn sgpb-btn-gray-light sgpb-close-media-popup-js sgpb-insert-popup-btns" value="<?php esc_html_e('Cancel', SG_POPUP_TEXT_DOMAIN)?>">
58
  </div>
59
  </div>
60
  </div>
public/views/license.php CHANGED
@@ -23,21 +23,21 @@
23
  <?php endif; ?>
24
  </div>
25
  <div class="licenseKey__form sgpb-margin-top-10 sgpb-margin-bottom-30 sgpb-align-item-center sgpb-display-flex">
26
- <span class="sgpb-width-20"><?php _e( 'License Key', SG_POPUP_TEXT_DOMAIN ); ?></span>
27
  <form method="post" action="options.php" class="sgpb-width-80 sgpb-display-inline-flex">
28
- <input id="<?php echo 'sgpb-license-key-' . esc_attr($key) ?>" type="text" class="sgpb-width-100"
29
  value="<?php esc_attr_e( $license ); ?>"
30
- name="<?php echo 'sgpb-license-key-' . esc_attr( $key ) ?>">
31
  <?php if ( $status !== false && $status == 'valid' ): ?>
32
  <?php wp_nonce_field( 'sgpb_nonce', 'sgpb_nonce' ); ?>
33
  <input type="submit" class="sgpb-btn sgpb-btn-blue"
34
- name="<?php echo 'sgpb-license-deactivate' . esc_attr( $key ); ?>"
35
- value="<?php _e( 'Deactivate', SG_POPUP_TEXT_DOMAIN ); ?>">
36
  <?php else: ?>
37
  <?php wp_nonce_field( 'sgpb_nonce', 'sgpb_nonce' ); ?>
38
  <input type="submit" class="sgpb-btn sgpb-btn-blue"
39
- name="<?php echo 'sgpb-license-activate-' . esc_attr( $key ); ?>"
40
- value="<?php _e( 'Activate', SG_POPUP_TEXT_DOMAIN ); ?>">
41
  <?php endif; ?>
42
  </form>
43
  </div>
23
  <?php endif; ?>
24
  </div>
25
  <div class="licenseKey__form sgpb-margin-top-10 sgpb-margin-bottom-30 sgpb-align-item-center sgpb-display-flex">
26
+ <span class="sgpb-width-20"><?php esc_html_e( 'License Key', SG_POPUP_TEXT_DOMAIN ); ?></span>
27
  <form method="post" action="options.php" class="sgpb-width-80 sgpb-display-inline-flex">
28
+ <input id="<?php echo esc_attr('sgpb-license-key-' . $key) ?>" type="text" class="sgpb-width-100"
29
  value="<?php esc_attr_e( $license ); ?>"
30
+ name="<?php echo esc_attr('sgpb-license-key-' . $key ) ?>">
31
  <?php if ( $status !== false && $status == 'valid' ): ?>
32
  <?php wp_nonce_field( 'sgpb_nonce', 'sgpb_nonce' ); ?>
33
  <input type="submit" class="sgpb-btn sgpb-btn-blue"
34
+ name="<?php echo esc_attr('sgpb-license-deactivate' . $key ); ?>"
35
+ value="<?php esc_html_e( 'Deactivate', SG_POPUP_TEXT_DOMAIN ); ?>">
36
  <?php else: ?>
37
  <?php wp_nonce_field( 'sgpb_nonce', 'sgpb_nonce' ); ?>
38
  <input type="submit" class="sgpb-btn sgpb-btn-blue"
39
+ name="<?php echo esc_attr('sgpb-license-activate-' . $key ); ?>"
40
+ value="<?php esc_html_e( 'Activate', SG_POPUP_TEXT_DOMAIN ); ?>">
41
  <?php endif; ?>
42
  </form>
43
  </div>
public/views/main/image.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="sgpb sgpb-wrapper sgpb-media-upload sgpb-display-flex sgpb-align-item-center sgpb-padding-20">
2
  <div class="formItem sgpb-display-inline-flex sgpb-flex-direction-column sgpb-margin-right-40">
3
- <span class="formItem__title sgpb-margin-0"><?php _e('Please choose your picture');?>:</span>
4
  <input class="formItem__input formItem__input_sgpb-popup-overlay"
5
  id="js-upload-image"
6
  type="text" size="36" name="sgpb-image-url"
1
  <div class="sgpb sgpb-wrapper sgpb-media-upload sgpb-display-flex sgpb-align-item-center sgpb-padding-20">
2
  <div class="formItem sgpb-display-inline-flex sgpb-flex-direction-column sgpb-margin-right-40">
3
+ <span class="formItem__title sgpb-margin-0"><?php esc_html_e('Please choose your picture');?>:</span>
4
  <input class="formItem__input formItem__input_sgpb-popup-overlay"
5
  id="js-upload-image"
6
  type="text" size="36" name="sgpb-image-url"
public/views/mainActionButtons.php CHANGED
@@ -2,19 +2,19 @@
2
  use sgpb\AdminHelper;
3
  ?>
4
  <div class="sgpb sgpb-header">
5
- <h1 class="sgpb-header-h1 sgpb-margin-bottom-30"><?php _e( 'Popups', SG_POPUP_TEXT_DOMAIN ) ?></h1>
6
  <div class="sgpb-margin-bottom-50 sgpb-display-flex sgpb-justify-content-between">
7
  <div>
8
- <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30" href="<?php echo AdminHelper::getPopupTypesPageURL(); ?>">
9
- <?php _e( 'Add New', SG_POPUP_TEXT_DOMAIN ); ?>
10
  </a>
11
- <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30" href="<?php echo AdminHelper::getPopupExportURL(); ?>">
12
- <?php _e( 'Export', SG_POPUP_TEXT_DOMAIN ); ?>
13
  </a>
14
  <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30"
15
  id="sgpbImportSettings"
16
  href="javascript:void(0)">
17
- <?php _e( 'Import', 'easy-digital-downloads' ); ?>
18
  </a>
19
  </div>
20
  <div style="text-align: right" id="sgpbPostSearch">
2
  use sgpb\AdminHelper;
3
  ?>
4
  <div class="sgpb sgpb-header">
5
+ <h1 class="sgpb-header-h1 sgpb-margin-bottom-30"><?php esc_html_e( 'Popups', SG_POPUP_TEXT_DOMAIN ) ?></h1>
6
  <div class="sgpb-margin-bottom-50 sgpb-display-flex sgpb-justify-content-between">
7
  <div>
8
+ <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30" href="<?php echo esc_url_raw(AdminHelper::getPopupTypesPageURL()); ?>">
9
+ <?php esc_html_e( 'Add New', SG_POPUP_TEXT_DOMAIN ); ?>
10
  </a>
11
+ <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30" href="<?php echo esc_url_raw(AdminHelper::getPopupExportURL()); ?>">
12
+ <?php esc_html_e( 'Export', SG_POPUP_TEXT_DOMAIN ); ?>
13
  </a>
14
  <a class="page-title-action sgpb-display-inline-block sgpb-btn sgpb-btn--rounded sgpb-btn-blue--outline sgpb-padding-x-30"
15
  id="sgpbImportSettings"
16
  href="javascript:void(0)">
17
+ <?php esc_html_e( 'Import', 'easy-digital-downloads' ); ?>
18
  </a>
19
  </div>
20
  <div style="text-align: right" id="sgpbPostSearch">
public/views/mediaButton.php CHANGED
@@ -7,43 +7,44 @@
7
  }
8
  $excludedPopups = array($excludePostId);
9
  $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
 
10
  ?>
11
 
12
  <div class="sgpb-hide " style="display: none">
13
  <div id="sgpb-hidden-media-popup" class="sgpb-wrapper sgpb">
14
  <div class="row">
15
  <div class="col-sm-10">
16
- <label><?php _e('Insert the [shortcode]', SG_POPUP_TEXT_DOMAIN)?></label>
17
  </div>
18
  <div class="col-sm-2">
19
- <img class="sgpb-add-subscriber-popup-close-btn sgpb-close-media-popup-js" src="<?php echo SG_POPUP_IMG_URL.'subscribers_close.png'; ?>" width='15px'>
20
  </div>
21
  </div>
22
  <div class="sgpb-insert-popup-title-border"></div>
23
  <div class="row">
24
  <div class="col-sm-4">
25
- <label><?php _e('Select popup', SG_POPUP_TEXT_DOMAIN)?></label>:
26
  </div>
27
  <div class="col-sm-8">
28
- <?php echo AdminHelper::createSelectBox($allPopups, '', array('class'=>'sgpb-insert-popup')); ?>
29
  </div>
30
  </div>
31
  <?php if (get_post_type() != SG_POPUP_POST_TYPE): ?>
32
  <div class="row sgpb-static-padding-top">
33
  <div class="col-sm-4">
34
- <label><?php _e('Select event', SG_POPUP_TEXT_DOMAIN)?></label>:
35
  </div>
36
  <div class="col-sm-8">
37
- <?php echo AdminHelper::createSelectBox($defaultData['popupInsertEventTypes'], '', array('class'=>'sgpb-insert-popup-event')); ?>
38
  </div>
39
  </div>
40
  <?php endif;?>
41
  <div class="row sgpb-static-padding-top ">
42
  <div class="col-sm-3">
43
- <input type="button" class="sgpb-btn sgpb-btn-blue sgpb-insert-popup-js sgpb-insert-popup-btns" value="<?php _e('Insert', SG_POPUP_TEXT_DOMAIN)?>">
44
  </div>
45
  <div class="col-sm-3">
46
- <input type="button" class="sgpb-btn sgpb-btn-gray-light sgpb-close-media-popup-js sgpb-insert-popup-btns" value="<?php _e('Cancel', SG_POPUP_TEXT_DOMAIN)?>">
47
  </div>
48
  </div>
49
  </div>
7
  }
8
  $excludedPopups = array($excludePostId);
9
  $allPopups = AdminHelper::getPopupsIdAndTitle($excludedPopups);
10
+ $allowed_html = AdminHelper::allowed_html_tags();
11
  ?>
12
 
13
  <div class="sgpb-hide " style="display: none">
14
  <div id="sgpb-hidden-media-popup" class="sgpb-wrapper sgpb">
15
  <div class="row">
16
  <div class="col-sm-10">
17
+ <label><?php esc_html_e('Insert the [shortcode]', SG_POPUP_TEXT_DOMAIN)?></label>
18
  </div>
19
  <div class="col-sm-2">
20
+ <img class="sgpb-add-subscriber-popup-close-btn sgpb-close-media-popup-js" src="<?php echo esc_attr(SG_POPUP_IMG_URL.'subscribers_close.png'); ?>" width='15px'>
21
  </div>
22
  </div>
23
  <div class="sgpb-insert-popup-title-border"></div>
24
  <div class="row">
25
  <div class="col-sm-4">
26
+ <label><?php esc_html_e('Select popup', SG_POPUP_TEXT_DOMAIN)?></label>:
27
  </div>
28
  <div class="col-sm-8">
29
+ <?php echo wp_kses(AdminHelper::createSelectBox($allPopups, '', array('class'=>'sgpb-insert-popup')), $allowed_html); ?>
30
  </div>
31
  </div>
32
  <?php if (get_post_type() != SG_POPUP_POST_TYPE): ?>
33
  <div class="row sgpb-static-padding-top">
34
  <div class="col-sm-4">
35
+ <label><?php esc_html_e('Select event', SG_POPUP_TEXT_DOMAIN)?></label>:
36
  </div>
37
  <div class="col-sm-8">
38
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['popupInsertEventTypes'], '', array('class'=>'sgpb-insert-popup-event')), $allowed_html); ?>
39
  </div>
40
  </div>
41
  <?php endif;?>
42
  <div class="row sgpb-static-padding-top ">
43
  <div class="col-sm-3">
44
+ <input type="button" class="sgpb-btn sgpb-btn-blue sgpb-insert-popup-js sgpb-insert-popup-btns" value="<?php esc_html_e('Insert', SG_POPUP_TEXT_DOMAIN)?>">
45
  </div>
46
  <div class="col-sm-3">
47
+ <input type="button" class="sgpb-btn sgpb-btn-gray-light sgpb-close-media-popup-js sgpb-insert-popup-btns" value="<?php esc_html_e('Cancel', SG_POPUP_TEXT_DOMAIN)?>">
48
  </div>
49
  </div>
50
  </div>
public/views/newsletter.php CHANGED
@@ -22,39 +22,39 @@
22
  ?>
23
  <!-- formItem__input_sgpb-popup-overlay -->
24
  <div class="sgpb sgpb-wrapper ">
25
- <h2 class="sgpb-header-h1 sgpb-margin-y-20"><?php _e('Newsletter', SG_POPUP_TEXT_DOMAIN); ?></h2>
26
  <div class="sgpb-newsletter sgpb-display-flex sgpb-padding-20">
27
  <div class="sgpb-width-50 sgpb-padding-x-20">
28
  <div class="sgpb-alert sgpb-newsletter-notice sgpb-alert-info fade in sgpb-hide">
29
- <span class="sgpb-newsletter-success-message sgpb-hide"><?php _e('You will receive an email notification after all emails are sent', SG_POPUP_TEXT_DOMAIN); ?>.</span>
30
- <span class="sgpb-newsletter-test-success-message sgpb-hide"><?php _e('Test email was successfully sent', SG_POPUP_TEXT_DOMAIN); ?>.</span>
31
  </div>
32
  <div class="formItem sgpb-margin-top-0">
33
- <h3 class="formItem__title"><?php _e('Newsletter settings', SG_POPUP_TEXT_DOMAIN); ?></h3>
34
  </div>
35
  <div class="sgpb-bg-black__opacity-02 sgpb-padding-x-30 sgpb-padding-y-10">
36
  <div class="formItem">
37
  <div class="titleQuestionWrapper">
38
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Choose the popup', SG_POPUP_TEXT_DOMAIN); ?></span>
39
  </div>
40
- <?php echo $subscriptionSelectBox; ?>
41
  </div>
42
  <div class="formItem">
43
- <div class="subFormItem__title sgpb-margin-right-10"><?php _e('Emails to send in one flow per 1 minute', SG_POPUP_TEXT_DOMAIN); ?></div>
44
- <input type="number" id="sgpb-emails-in-flow" class="sgpb-emails-in-flow formItem__input" value="<?php echo SGPB_FILTER_REPEAT_INTERVAL; ?>">
45
  </div>
46
  <div class="formItem">
47
- <div class="subFormItem__title sgpb-margin-right-10"><?php _e('From email', SG_POPUP_TEXT_DOMAIN); ?></div>
48
- <input type="email" id="sgpb-newsletter-from-email" class="sgpb-newsletter-from-email formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_html($adminEmail); ?>">
49
  </div>
50
  <div class="formItem">
51
- <div class="subFormItem__title sgpb-margin-right-10"><?php _e('Email\'s subject', SG_POPUP_TEXT_DOMAIN); ?></div>
52
- <input type="email" id="sgpb-newsletter-subject" class="sgpb-newsletter-subject formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_html((empty($newsletterSavedOptions['newsletterSubject'])) ? _e('Your subject here', SG_POPUP_TEXT_DOMAIN) : $newsletterSavedOptions['newsletterSubject']); ?>">
53
  </div>
54
  </div>
55
 
56
  <div class="formItem">
57
- <span class="formItem__title"><?php _e('Edit newsletter email template below', SG_POPUP_TEXT_DOMAIN); ?></span>
58
  </div>
59
  <div class="mediaEditor">
60
  <?php
@@ -82,40 +82,40 @@
82
  <div class="sgpb-display-flex sgpb-justify-content-between">
83
  <div class="formItem">
84
  <input class="sgpb-newlsetter-test-emails sgpb-margin-right-10" type="text" name="sgpb-newlsetter-test-emails">
85
- <input type="submit" class="sgpb-btn sgpb-btn-blue js-send-newsletter" style="line-height: 2;" data-send-type="test" value="<?php _e('Send a Test', SG_POPUP_TEXT_DOMAIN)?>">
86
- <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
87
  </div>
88
  <div>
89
- <input type="submit" class="sgpb-btn sgpb-btn-blue sgpb-margin-top-20 js-send-newsletter sendButton" value="<?php _e('Send newsletter', SG_POPUP_TEXT_DOMAIN)?>">
90
- <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
91
  </div>
92
  </div>
93
 
94
  </div>
95
  <div class="sgpb-width-30">
96
  <div class="sgpb-position-sticky sgpb-border-radius-5px sgpb-padding-20 sgpb-shadow-black-10" style="top: 7%!important;">
97
- <h2 class="sgpb-header-h4"><?php _e('Newsletter Shortcodes', SG_POPUP_TEXT_DOMAIN); ?></h2>
98
  <div class="formItem">
99
- <span class="formItem__title"><?php _e('Default shortcodes', SG_POPUP_TEXT_DOMAIN); ?>:</span>
100
  </div>
101
- <input type="button" id="sgpb-newsletter-shortcode-firstName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php _e('Subscriber First name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[First name]">
102
- <input type="button" id="sgpb-newsletter-shortcode-lastName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php _e('Subscriber Last name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Last name]">
103
- <input type="button" id="sgpb-newsletter-shortcode-blogName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php _e('Your blog name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Blog name]">
104
- <input type="button" id="sgpb-newsletter-shortcode-userName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php _e('Your user name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[User name]">
105
- <input type="button" id="sgpb-newsletter-shortcode-unsubscribe" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php _e('Unsubscribe', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Unsubscribe]">
106
 
107
  <?php if (!empty($subscriptionPopupsCustomFields)) :?>
108
  <div class="formItem">
109
- <span class="formItem__title"><?php _e('Custom fields\' shortcodes', SG_POPUP_TEXT_DOMAIN); ?>:</span>
110
  </div>
111
- <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-custom-fields-spinner">
112
  <?php
113
  foreach ($subscriptionPopupsCustomFields as $index => $field) {
114
  if (empty($field)) {
115
  continue;
116
  }
117
  ?>
118
- <input type="button" id="sgpb-newsletter-shortcode-<?php echo esc_attr($index); ?>" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php echo @$field['fieldName']; ?>" data-value="[<?php echo @$field['fieldName'];?>]">
119
  <?php
120
  }
121
  ?>
22
  ?>
23
  <!-- formItem__input_sgpb-popup-overlay -->
24
  <div class="sgpb sgpb-wrapper ">
25
+ <h2 class="sgpb-header-h1 sgpb-margin-y-20"><?php esc_html_e('Newsletter', SG_POPUP_TEXT_DOMAIN); ?></h2>
26
  <div class="sgpb-newsletter sgpb-display-flex sgpb-padding-20">
27
  <div class="sgpb-width-50 sgpb-padding-x-20">
28
  <div class="sgpb-alert sgpb-newsletter-notice sgpb-alert-info fade in sgpb-hide">
29
+ <span class="sgpb-newsletter-success-message sgpb-hide"><?php esc_html_e('You will receive an email notification after all emails are sent', SG_POPUP_TEXT_DOMAIN); ?>.</span>
30
+ <span class="sgpb-newsletter-test-success-message sgpb-hide"><?php esc_html_e('Test email was successfully sent', SG_POPUP_TEXT_DOMAIN); ?>.</span>
31
  </div>
32
  <div class="formItem sgpb-margin-top-0">
33
+ <h3 class="formItem__title"><?php esc_html_e('Newsletter settings', SG_POPUP_TEXT_DOMAIN); ?></h3>
34
  </div>
35
  <div class="sgpb-bg-black__opacity-02 sgpb-padding-x-30 sgpb-padding-y-10">
36
  <div class="formItem">
37
  <div class="titleQuestionWrapper">
38
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Choose the popup', SG_POPUP_TEXT_DOMAIN); ?></span>
39
  </div>
40
+ <?php echo wp_kses($subscriptionSelectBox, AdminHelper::allowed_html_tags()); ?>
41
  </div>
42
  <div class="formItem">
43
+ <div class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Emails to send in one flow per 1 minute', SG_POPUP_TEXT_DOMAIN); ?></div>
44
+ <input type="number" id="sgpb-emails-in-flow" class="sgpb-emails-in-flow formItem__input" value="<?php echo esc_attr(SGPB_FILTER_REPEAT_INTERVAL); ?>">
45
  </div>
46
  <div class="formItem">
47
+ <div class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('From email', SG_POPUP_TEXT_DOMAIN); ?></div>
48
+ <input type="email" id="sgpb-newsletter-from-email" class="sgpb-newsletter-from-email formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_attr($adminEmail); ?>">
49
  </div>
50
  <div class="formItem">
51
+ <div class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Email\'s subject', SG_POPUP_TEXT_DOMAIN); ?></div>
52
+ <input type="email" id="sgpb-newsletter-subject" class="sgpb-newsletter-subject formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_attr((empty($newsletterSavedOptions['newsletterSubject'])) ? esc_html_e('Your subject here', SG_POPUP_TEXT_DOMAIN) : $newsletterSavedOptions['newsletterSubject']); ?>">
53
  </div>
54
  </div>
55
 
56
  <div class="formItem">
57
+ <span class="formItem__title"><?php esc_html_e('Edit newsletter email template below', SG_POPUP_TEXT_DOMAIN); ?></span>
58
  </div>
59
  <div class="mediaEditor">
60
  <?php
82
  <div class="sgpb-display-flex sgpb-justify-content-between">
83
  <div class="formItem">
84
  <input class="sgpb-newlsetter-test-emails sgpb-margin-right-10" type="text" name="sgpb-newlsetter-test-emails">
85
+ <input type="submit" class="sgpb-btn sgpb-btn-blue js-send-newsletter" style="line-height: 2;" data-send-type="test" value="<?php esc_html_e('Send a Test', SG_POPUP_TEXT_DOMAIN)?>">
86
+ <img src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'ajaxSpinner.gif'); ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
87
  </div>
88
  <div>
89
+ <input type="submit" class="sgpb-btn sgpb-btn-blue sgpb-margin-top-20 js-send-newsletter sendButton" value="<?php esc_html_e('Send newsletter', SG_POPUP_TEXT_DOMAIN)?>">
90
+ <img src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'ajaxSpinner.gif'); ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
91
  </div>
92
  </div>
93
 
94
  </div>
95
  <div class="sgpb-width-30">
96
  <div class="sgpb-position-sticky sgpb-border-radius-5px sgpb-padding-20 sgpb-shadow-black-10" style="top: 7%!important;">
97
+ <h2 class="sgpb-header-h4"><?php esc_html_e('Newsletter Shortcodes', SG_POPUP_TEXT_DOMAIN); ?></h2>
98
  <div class="formItem">
99
+ <span class="formItem__title"><?php esc_html_e('Default shortcodes', SG_POPUP_TEXT_DOMAIN); ?>:</span>
100
  </div>
101
+ <input type="button" id="sgpb-newsletter-shortcode-firstName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php esc_html_e('Subscriber First name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[First name]">
102
+ <input type="button" id="sgpb-newsletter-shortcode-lastName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php esc_html_e('Subscriber Last name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Last name]">
103
+ <input type="button" id="sgpb-newsletter-shortcode-blogName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php esc_html_e('Your blog name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Blog name]">
104
+ <input type="button" id="sgpb-newsletter-shortcode-userName" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php esc_html_e('Your user name', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[User name]">
105
+ <input type="button" id="sgpb-newsletter-shortcode-unsubscribe" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php esc_html_e('Unsubscribe', SG_POPUP_TEXT_DOMAIN); ?>" data-value="[Unsubscribe]">
106
 
107
  <?php if (!empty($subscriptionPopupsCustomFields)) :?>
108
  <div class="formItem">
109
+ <span class="formItem__title"><?php esc_html_e('Custom fields\' shortcodes', SG_POPUP_TEXT_DOMAIN); ?>:</span>
110
  </div>
111
+ <img src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'ajaxSpinner.gif'); ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-custom-fields-spinner">
112
  <?php
113
  foreach ($subscriptionPopupsCustomFields as $index => $field) {
114
  if (empty($field)) {
115
  continue;
116
  }
117
  ?>
118
+ <input type="button" id="sgpb-newsletter-shortcode-<?php echo esc_attr($index); ?>" class="sgpb-btn sgpb-btn-blue-light sgpb-margin-5 buttonGroup__button_shortcodes" value="<?php echo esc_attr(@$field['fieldName']); ?>" data-value="[<?php echo esc_attr(@$field['fieldName']);?>]">
119
  <?php
120
  }
121
  ?>
public/views/options/facebook.php CHANGED
@@ -1,18 +1,20 @@
1
  <?php
2
  use sgpb\AdminHelper;
3
  $defaultData = ConfigDataHelper::defaultData();
 
 
4
  ?>
5
  <div class="sgpb sgpb-wrapper video-popup-options sgpb-fblike-options">
6
  <div class="formItem">
7
- <span class="formItem__title formItem__title_marginBottom "><?php _e("URL", SG_POPUP_TEXT_DOMAIN) ?>:</span>
8
  <input name="sgpb-fblike-like-url" id="sgpb-fblike-like-url" type="url" placeholder="http://" class="grayFormItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-fblike-like-url'))?>" required>
9
  </div>
10
  <div class="formItem">
11
- <span class="formItem__title"><?php _e('Layout', SG_POPUP_TEXT_DOMAIN)?>:</span>
12
- <?php echo AdminHelper::createSelectBox($defaultData['buttonsType'], esc_html($popupTypeObj->getOptionValue('sgpb-fblike-layout')), array('name' => 'sgpb-fblike-layout', 'class'=>'js-sg-select2', 'id'=>'sgpb-fblike-layout')); ?>
13
  </div>
14
  <div class="formItem">
15
- <span class="formItem__title"><?php _e('Don\'t show share button', SG_POPUP_TEXT_DOMAIN);?>:</span>
16
  <div class="sgpb-onOffSwitch">
17
  <input class="sgpb-onOffSwitch-checkbox" name="sgpb-fblike-dont-show-share-button" id="fblike-dont-show-share-button" type="checkbox" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-fblike-dont-show-share-button'));?>>
18
  <label class="sgpb-onOffSwitch__label" for="fblike-dont-show-share-button">
1
  <?php
2
  use sgpb\AdminHelper;
3
  $defaultData = ConfigDataHelper::defaultData();
4
+ $allowed_html = AdminHelper::allowed_html_tags();
5
+
6
  ?>
7
  <div class="sgpb sgpb-wrapper video-popup-options sgpb-fblike-options">
8
  <div class="formItem">
9
+ <span class="formItem__title formItem__title_marginBottom "><?php esc_html_e("URL", SG_POPUP_TEXT_DOMAIN) ?>:</span>
10
  <input name="sgpb-fblike-like-url" id="sgpb-fblike-like-url" type="url" placeholder="http://" class="grayFormItem__input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-fblike-like-url'))?>" required>
11
  </div>
12
  <div class="formItem">
13
+ <span class="formItem__title"><?php esc_html_e('Layout', SG_POPUP_TEXT_DOMAIN)?>:</span>
14
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['buttonsType'], esc_html($popupTypeObj->getOptionValue('sgpb-fblike-layout')), array('name' => 'sgpb-fblike-layout', 'class'=>'js-sg-select2', 'id'=>'sgpb-fblike-layout')), $allowed_html); ?>
15
  </div>
16
  <div class="formItem">
17
+ <span class="formItem__title"><?php esc_html_e('Don\'t show share button', SG_POPUP_TEXT_DOMAIN);?>:</span>
18
  <div class="sgpb-onOffSwitch">
19
  <input class="sgpb-onOffSwitch-checkbox" name="sgpb-fblike-dont-show-share-button" id="fblike-dont-show-share-button" type="checkbox" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-fblike-dont-show-share-button'));?>>
20
  <label class="sgpb-onOffSwitch__label" for="fblike-dont-show-share-button">
public/views/options/subscription.php CHANGED
@@ -2,6 +2,8 @@
2
  use sgpb\AdminHelper;
3
  use sgpb\MultipleChoiceButton;
4
  use sgpb\Functions;
 
 
5
  $defaultData = ConfigDataHelper::defaultData();
6
  $placeholderColor = $popupTypeObj->getOptionValue('sgpb-subs-text-placeholder-color');
7
  $popupId = 0;
@@ -31,44 +33,44 @@
31
  <div class="sgpb-width-70 sgpb-padding-x-20">
32
  <div class="formItem sgpb-margin-top-0">
33
  <div class="sgpb-width-100 sgpb-margin-bottom-40">
34
- <p class="formItem__title"><?php _e('Form background options', SG_POPUP_TEXT_DOMAIN); ?></p>
35
  </div>
36
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
37
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
38
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Form background color', SG_POPUP_TEXT_DOMAIN); ?>:</span>
39
  <div class="colorPicker">
40
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
41
- <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="sgpb-subscription-admin-wrapper" data-style-type="background-color" type="text" name="sgpb-subs-form-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-form-bg-color')); ?>" autocomplete="off">
42
  </div>
43
  </div>
44
  </div>
45
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
46
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Form background opacity', SG_POPUP_TEXT_DOMAIN)?>:</span>
47
  <div class="sgpb-slider-wrapper range-wrap">
48
  <div class="sgpb-slider-wrapper sgpb-range-wrap sgpb-display-inline-flex">
49
  <?php $overlayOpacity = $popupTypeObj->getOptionValue('sgpb-overlay-opacity'); ?>
50
  <input type="range" name="sgpb-subs-form-bg-opacity" class="sgpb-range-input js-subs-bg-opacity sgpb-cursor-pointer"
51
- value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-form-bg-opacity')); ?>"
52
  min="0.0" step="0.1" max="1">
53
  <span class="js-subs-bg-opacity-value sgpb-margin-left-10"><?php echo esc_html($overlayOpacity)?></span>
54
  </div>
55
  </div>
56
  </div>
57
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
58
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Form padding', SG_POPUP_TEXT_DOMAIN)?>:</span>
59
  <input type="number" min="0" data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-subs-form-padding'))?>" class="js-sgpb-form-padding formItem__input" id="sgpb-subs-form-padding" name="sgpb-subs-form-padding" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-form-padding'))?>" autocomplete="off">
60
  <div class="formItem__inputValueType">px</div>
61
  </div>
62
  </div>
63
  </div>
64
  <div class="formItem">
65
- <span class="formItem__title"><?php _e('Email placeholder', SG_POPUP_TEXT_DOMAIN); ?></span>
66
- <input type="text" name="sgpb-subs-email-placeholder" id="subs-email-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-field-placeholder" data-subs-rel="js-subs-email-input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-email-placeholder')); ?>">
67
  </div>
68
  <div class="formItem">
69
- <span class="formItem__title"><?php _e('Enable GDPR', SG_POPUP_TEXT_DOMAIN)?>:</span>
70
  <div class="sgpb-onOffSwitch">
71
- <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-gdpr-status" data-subs-field-wrapper="js-gdpr-wrapper" name="sgpb-subs-gdpr-status" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-gdpr-status')); ?>>
72
  <label class="sgpb-onOffSwitch__label" for="subs-gdpr-status">
73
  <span class="sgpb-onOffSwitch-inner"></span>
74
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -77,18 +79,18 @@
77
  </div>
78
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
79
  <div class="subFormItem sgpb-margin-bottom-20">
80
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Label', SG_POPUP_TEXT_DOMAIN)?>:</span>
81
- <input type="text" name="sgpb-subs-gdpr-label" id="sgpb-subs-gdpr-label" class="js-subs-field-placeholder formItem__input formItem__input_sgpb-popup-overlay" data-subs-rel="js-subs-gdpr-label" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-gdpr-label')); ?>">
82
  </div>
83
  <div class="subFormItem sgpb-display-flex">
84
- <span class="subFormItem__title sgpb-margin-right-10 sgpb-text-nowrap"><?php _e('Confirmation text', SG_POPUP_TEXT_DOMAIN)?>:</span>
85
  <textarea name="sgpb-subs-gdpr-text" id="sgpb-subs-gdpr-text" class="formItem__textarea"><?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-gdpr-text')); ?></textarea>
86
  </div>
87
  </div>
88
  <div class="formItem">
89
- <span class="formItem__title"><?php _e('First name', SG_POPUP_TEXT_DOMAIN)?>:</span>
90
  <div class="sgpb-onOffSwitch">
91
- <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-first-name-status" data-subs-field-wrapper="js-first-name-wrapper" name="sgpb-subs-first-name-status" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-first-name-status')); ?>>
92
  <label class="sgpb-onOffSwitch__label" for="subs-first-name-status">
93
  <span class="sgpb-onOffSwitch-inner"></span>
94
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -97,13 +99,13 @@
97
  </div>
98
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
99
  <div class="subFormItem">
100
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Placeholder', SG_POPUP_TEXT_DOMAIN)?>:</span>
101
- <input type="text" name="sgpb-subs-first-placeholder" id="subs-first-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-field-placeholder" data-subs-rel="js-subs-first-name-input" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-first-placeholder')); ?>">
102
  </div>
103
  <div class="subFormItem sgpb-align-item-center sgpb-display-flex sgpb-margin-top-10">
104
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Required field', SG_POPUP_TEXT_DOMAIN)?>:</span>
105
  <div class="sgpb-onOffSwitch">
106
- <input type="checkbox" name="sgpb-subs-first-name-required" class="sgpb-onOffSwitch-checkbox" id="subs-first-name-required" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-first-name-required')); ?>>
107
  <label class="sgpb-onOffSwitch__label" for="subs-first-name-required">
108
  <span class="sgpb-onOffSwitch-inner"></span>
109
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -112,9 +114,9 @@
112
  </div>
113
  </div>
114
  <div class="formItem">
115
- <span class="formItem__title"><?php _e('Last name', SG_POPUP_TEXT_DOMAIN)?>:</span>
116
  <div class="sgpb-onOffSwitch">
117
- <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-last-name-status" data-subs-field-wrapper="js-last-name-wrapper" name="sgpb-subs-last-name-status" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-last-name-status')); ?>>
118
  <label class="sgpb-onOffSwitch__label" for="subs-last-name-status">
119
  <span class="sgpb-onOffSwitch-inner"></span>
120
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -123,13 +125,13 @@
123
  </div>
124
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
125
  <div class="subFormItem">
126
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Placeholder', SG_POPUP_TEXT_DOMAIN)?>:</span>
127
- <input id="subs-last-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay " data-subs-rel="js-subs-last-name-input" type="text" name="sgpb-subs-last-placeholder" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-last-placeholder')); ?>">
128
  </div>
129
  <div class="subFormItem sgpb-align-item-center sgpb-display-flex sgpb-margin-top-10">
130
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Required field', SG_POPUP_TEXT_DOMAIN)?>:</span>
131
  <div class="sgpb-onOffSwitch">
132
- <input type="checkbox" name="sgpb-subs-last-name-required" class="sgpb-onOffSwitch-checkbox" id="subs-last-name-required" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-last-name-required')); ?>>
133
  <label class="sgpb-onOffSwitch__label" for="subs-last-name-required">
134
  <span class="sgpb-onOffSwitch-inner"></span>
135
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -138,50 +140,50 @@
138
  </div>
139
  </div>
140
  <div class="formItem">
141
- <span class="formItem__title"><?php _e('Required field message', SG_POPUP_TEXT_DOMAIN); ?></span>
142
- <input type="text" name="sgpb-subs-validation-message" id="subs-validation-message" class="formItem__input formItem__input_sgpb-popup-overlay sgpb-full-width-events" maxlength="90" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-validation-message')); ?>">
143
  </div>
144
  <div class="formItem">
145
  <div class="sgpb-width-100">
146
- <span class="formItem__title"><?php _e('Inputs\' style', SG_POPUP_TEXT_DOMAIN); ?></span>
147
  </div>
148
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
149
  <div class="subFormItem bottom">
150
  <div class="maxWidth sgpb-margin-bottom-20">
151
- <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
152
- <input type="text" class="js-subs-dimension subFormItem__input" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="width" name="sgpb-subs-text-width" id="subs-text-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-text-width')); ?>">
153
  </div>
154
  <div class="maxHeight sgpb-margin-bottom-20">
155
- <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
156
- <input class="js-subs-dimension subFormItem__input" 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')); ?>">
157
  </div>
158
  </div>
159
  <div class="subFormItem sgpb-margin-bottom-20">
160
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Border width', SG_POPUP_TEXT_DOMAIN)?>:</span>
161
- <input class="js-subs-dimension formItem__input formItem__input_sgpb-popup-overlay" 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')); ?>">
162
  </div>
163
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
164
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
165
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
166
- <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')); ?>" >
167
  </div>
168
  </div>
169
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
170
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
171
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
172
- <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')); ?>" >
173
  </div>
174
  </div>
175
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
176
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
177
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
178
- <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')); ?>" >
179
  </div>
180
  </div>
181
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
182
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Placeholder color', SG_POPUP_TEXT_DOMAIN)?>:</span>
183
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
184
- <input class="sgpb-color-picker js-subs-color-picker" 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); ?>" >
185
  </div>
186
  </div>
187
  </div>
@@ -189,65 +191,65 @@
189
 
190
  <div class="formItem">
191
  <div class="sgpb-width-100">
192
- <span class="formItem__title"><?php _e('Submit button styles', SG_POPUP_TEXT_DOMAIN); ?></span>
193
  </div>
194
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
195
  <div class="subFormItem bottom">
196
  <div class="maxWidth sgpb-margin-bottom-20">
197
- <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php _e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
198
- <input class="js-subs-dimension subFormItem__input" 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')); ?>">
199
  </div>
200
  <div class="maxHeight sgpb-margin-bottom-20">
201
- <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php _e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
202
- <input class="js-subs-dimension subFormItem__input" 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')); ?>">
203
  </div>
204
  </div>
205
  <div class="subFormItem sgpb-margin-bottom-20">
206
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Border width', SG_POPUP_TEXT_DOMAIN)?>:</span>
207
- <input class="js-subs-dimension formItem__input" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="border-width" type="text" name="sgpb-subs-btn-border-width" id="sgpb-subs-btn-border-width" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-border-width')); ?>">
208
  </div>
209
  <div class="subFormItem sgpb-margin-bottom-20">
210
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Border radius', SG_POPUP_TEXT_DOMAIN)?>:</span>
211
- <input class="js-subs-dimension formItem__input" data-subs-rel="js-subs-submit-btn" data-field-type="submit" data-style-type="border-radius" type="text" name="sgpb-subs-btn-border-radius" id="sgpb-subs-btn-border-radius" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-border-radius')); ?>">
212
  </div>
213
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
214
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
215
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
216
- <input id="sgpb-subs-btn-border-color" class="sgpb-color-picker js-subs-color-picker" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="border-color" type="text" name="sgpb-subs-btn-border-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-border-color')); ?>" >
217
  </div>
218
  </div>
219
  <div class="subFormItem sgpb-margin-bottom-20">
220
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Title', SG_POPUP_TEXT_DOMAIN)?>:</span>
221
- <input type="text" name="sgpb-subs-btn-title" id="subs-btn-title" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-btn-title" data-field-type="submit" data-subs-rel="js-subs-submit-btn" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-title')); ?>">
222
  </div>
223
  <div class="subFormItem sgpb-margin-bottom-20">
224
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Title (in progress)', SG_POPUP_TEXT_DOMAIN)?>:</span>
225
- <input type="text" name="sgpb-subs-btn-progress-title" id="btn-progress-title" class="formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-btn-progress-title')); ?>">
226
  </div>
227
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
228
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
229
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
230
- <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')); ?>" >
231
  </div>
232
  </div>
233
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
234
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
235
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
236
- <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')); ?>" >
237
  </div>
238
  </div>
239
  </div>
240
  </div>
241
  <div class="formItem">
242
- <span class="formItem__title"><?php _e('Error message', SG_POPUP_TEXT_DOMAIN); ?></span>
243
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" name="sgpb-subs-error-message" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-error-message')); ?>">
244
  </div>
245
  <div class="formItem">
246
- <span class="formItem__title"><?php _e('Invalid email message', SG_POPUP_TEXT_DOMAIN); ?></span>
247
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" name="sgpb-subs-invalid-message" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-invalid-message')); ?>">
248
  </div>
249
  <div class="formItem">
250
- <span class="formItem__title"><?php _e('Show form on the Top', SG_POPUP_TEXT_DOMAIN)?>:</span>
251
  <div class="sgpb-onOffSwitch">
252
  <input type="checkbox" id="sgpb-subs-show-form-to-top" class="sgpb-onOffSwitch-checkbox" name="sgpb-subs-show-form-to-top" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-show-form-to-top')); ?>>
253
  <label class="sgpb-onOffSwitch__label" for="sgpb-subs-show-form-to-top">
@@ -257,7 +259,7 @@
257
  </div>
258
  </div>
259
  <div class="formItem">
260
- <span class="formItem__title"><?php _e('Hide for already subscribed users', SG_POPUP_TEXT_DOMAIN)?>:</span>
261
  <div class="sgpb-onOffSwitch">
262
  <input type="checkbox" id="sgpb-subs-hide-subs-users" class="sgpb-onOffSwitch-checkbox" name="sgpb-subs-hide-subs-users" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-hide-subs-users')); ?>>
263
  <label class="sgpb-onOffSwitch__label" for="sgpb-subs-hide-subs-users">
@@ -267,30 +269,30 @@
267
  </div>
268
  </div>
269
  <div class="formItem">
270
- <span class="formItem__title"><?php _e('After successful subscription', SG_POPUP_TEXT_DOMAIN)?>:</span>
271
  </div>
272
  <div class="formItem sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20">
273
  <?php
274
  $multipleChoiceButton = new MultipleChoiceButton($defaultData['subscriptionSuccessBehavior'], $popupTypeObj->getOptionValue('sgpb-subs-success-behavior'));
275
- echo $multipleChoiceButton;
276
  ?>
277
  </div>
278
 
279
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-show-success-message">
280
  <div class="subFormItem">
281
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Success message', SG_POPUP_TEXT_DOMAIN)?>:</span>
282
  <input name="sgpb-subs-success-message" type="text" id="sgpb-subs-success-message" class="grayFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-success-message')); ?>">
283
  </div>
284
  </div>
285
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-redirect-to-URL">
286
  <div class="subFormItem">
287
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Redirect URL', SG_POPUP_TEXT_DOMAIN)?>:</span>
288
  <input type="url" name="sgpb-subs-success-redirect-URL" id="sgpb-subs-success-redirect-URL" placeholder="https://www.example.com" class="grayFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-success-redirect-URL')); ?>">
289
  </div>
290
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
291
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:</span>
292
  <div class="sgpb-onOffSwitch">
293
- <input type="checkbox" name="sgpb-subs-success-redirect-new-tab" id="subs-success-redirect-new-tab" class="sgpb-onOffSwitch-checkbox" placeholder="https://www.example.com" <?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-success-redirect-new-tab')); ?>>
294
  <label class="sgpb-onOffSwitch__label" for="subs-success-redirect-new-tab">
295
  <span class="sgpb-onOffSwitch-inner"></span>
296
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -300,25 +302,25 @@
300
  </div>
301
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-open-popup">
302
  <div class="subFormItem">
303
- <span class="subFormItem__title sgpb-margin-right-10"><?php _e('Select popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
304
- <?php echo AdminHelper::createSelectBox($subscriptionSubPopups, $successPopup, array('name' => 'sgpb-subs-success-popup', 'class'=>'js-sg-select2 select__select')); ?>
305
  </div>
306
  </div>
307
  </div>
308
  <div class="sgpb-width-30">
309
  <div class="sgpb-position-sticky sgpb-overflow-auto">
310
  <div class="livePreview livePreview_centered sgpb-margin-auto sgpb-align-item-center sgpb-btn sgpb-btn-gray-light sgpb-btn--rounded sgpb-display-flex sgpb-justify-content-center">
311
- <img class="sgpb-margin-right-10" src="<?php echo SG_POPUP_PUBLIC_URL.'icons/Black/eye.svg'; ?>" alt="Eye icon">
312
- <span class="livePreview__text"><?php _e('Live Preview', SG_POPUP_TEXT_DOMAIN)?></span>
313
  </div>
314
  <div class="sgpb-margin-top-10 sgpb-subs-form-<?php echo esc_attr($popupId); ?> sgpb-subscription-admin-wrapper<?php echo esc_attr($forceRtlClass); ?>">
315
- <?php echo Functions::renderForm($formData); ?>
316
  </div>
317
  <?php
318
  $styleData = array(
319
  'placeholderColor' => $placeholderColor
320
  );
321
- echo $popupTypeObj->getFormCustomStyles($styleData)
322
  ?>
323
  <div style="max-width: 300px;margin: 0 auto;">
324
  <span class="sgpb-align-center"><?php _e('Get the <a href="'.SG_POPUP_SUBSCRIPTION_PLUS_URL.'">Subscription Plus</a> extension to add or customize the form fields.', SG_POPUP_TEXT_DOMAIN);?></span>
2
  use sgpb\AdminHelper;
3
  use sgpb\MultipleChoiceButton;
4
  use sgpb\Functions;
5
+
6
+ $allowed_html = AdminHelper::allowed_html_tags();
7
  $defaultData = ConfigDataHelper::defaultData();
8
  $placeholderColor = $popupTypeObj->getOptionValue('sgpb-subs-text-placeholder-color');
9
  $popupId = 0;
33
  <div class="sgpb-width-70 sgpb-padding-x-20">
34
  <div class="formItem sgpb-margin-top-0">
35
  <div class="sgpb-width-100 sgpb-margin-bottom-40">
36
+ <p class="formItem__title"><?php esc_html_e('Form background options', SG_POPUP_TEXT_DOMAIN); ?></p>
37
  </div>
38
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
39
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
40
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Form background color', SG_POPUP_TEXT_DOMAIN); ?>:</span>
41
  <div class="colorPicker">
42
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
43
+ <input class="sgpb-color-picker js-subs-color-picker" data-subs-rel="sgpb-subscription-admin-wrapper" data-style-type="background-color" type="text" name="sgpb-subs-form-bg-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-form-bg-color')); ?>" autocomplete="off">
44
  </div>
45
  </div>
46
  </div>
47
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
48
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Form background opacity', SG_POPUP_TEXT_DOMAIN)?>:</span>
49
  <div class="sgpb-slider-wrapper range-wrap">
50
  <div class="sgpb-slider-wrapper sgpb-range-wrap sgpb-display-inline-flex">
51
  <?php $overlayOpacity = $popupTypeObj->getOptionValue('sgpb-overlay-opacity'); ?>
52
  <input type="range" name="sgpb-subs-form-bg-opacity" class="sgpb-range-input js-subs-bg-opacity sgpb-cursor-pointer"
53
+ value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-form-bg-opacity')); ?>"
54
  min="0.0" step="0.1" max="1">
55
  <span class="js-subs-bg-opacity-value sgpb-margin-left-10"><?php echo esc_html($overlayOpacity)?></span>
56
  </div>
57
  </div>
58
  </div>
59
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
60
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Form padding', SG_POPUP_TEXT_DOMAIN)?>:</span>
61
  <input type="number" min="0" data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-subs-form-padding'))?>" class="js-sgpb-form-padding formItem__input" id="sgpb-subs-form-padding" name="sgpb-subs-form-padding" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-form-padding'))?>" autocomplete="off">
62
  <div class="formItem__inputValueType">px</div>
63
  </div>
64
  </div>
65
  </div>
66
  <div class="formItem">
67
+ <span class="formItem__title"><?php esc_html_e('Email placeholder', SG_POPUP_TEXT_DOMAIN); ?></span>
68
+ <input type="text" name="sgpb-subs-email-placeholder" id="subs-email-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-field-placeholder" data-subs-rel="js-subs-email-input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-email-placeholder')); ?>">
69
  </div>
70
  <div class="formItem">
71
+ <span class="formItem__title"><?php esc_html_e('Enable GDPR', SG_POPUP_TEXT_DOMAIN)?>:</span>
72
  <div class="sgpb-onOffSwitch">
73
+ <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-gdpr-status" data-subs-field-wrapper="js-gdpr-wrapper" name="sgpb-subs-gdpr-status" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-gdpr-status')); ?>>
74
  <label class="sgpb-onOffSwitch__label" for="subs-gdpr-status">
75
  <span class="sgpb-onOffSwitch-inner"></span>
76
  <span class="sgpb-onOffSwitch-switch"></span>
79
  </div>
80
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
81
  <div class="subFormItem sgpb-margin-bottom-20">
82
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Label', SG_POPUP_TEXT_DOMAIN)?>:</span>
83
+ <input type="text" name="sgpb-subs-gdpr-label" id="sgpb-subs-gdpr-label" class="js-subs-field-placeholder formItem__input formItem__input_sgpb-popup-overlay" data-subs-rel="js-subs-gdpr-label" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-gdpr-label')); ?>">
84
  </div>
85
  <div class="subFormItem sgpb-display-flex">
86
+ <span class="subFormItem__title sgpb-margin-right-10 sgpb-text-nowrap"><?php esc_html_e('Confirmation text', SG_POPUP_TEXT_DOMAIN)?>:</span>
87
  <textarea name="sgpb-subs-gdpr-text" id="sgpb-subs-gdpr-text" class="formItem__textarea"><?php echo esc_html($popupTypeObj->getOptionValue('sgpb-subs-gdpr-text')); ?></textarea>
88
  </div>
89
  </div>
90
  <div class="formItem">
91
+ <span class="formItem__title"><?php esc_html_e('First name', SG_POPUP_TEXT_DOMAIN)?>:</span>
92
  <div class="sgpb-onOffSwitch">
93
+ <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-first-name-status" data-subs-field-wrapper="js-first-name-wrapper" name="sgpb-subs-first-name-status" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-first-name-status')); ?>>
94
  <label class="sgpb-onOffSwitch__label" for="subs-first-name-status">
95
  <span class="sgpb-onOffSwitch-inner"></span>
96
  <span class="sgpb-onOffSwitch-switch"></span>
99
  </div>
100
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
101
  <div class="subFormItem">
102
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Placeholder', SG_POPUP_TEXT_DOMAIN)?>:</span>
103
+ <input type="text" name="sgpb-subs-first-placeholder" id="subs-first-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-field-placeholder" data-subs-rel="js-subs-first-name-input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-first-placeholder')); ?>">
104
  </div>
105
  <div class="subFormItem sgpb-align-item-center sgpb-display-flex sgpb-margin-top-10">
106
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Required field', SG_POPUP_TEXT_DOMAIN)?>:</span>
107
  <div class="sgpb-onOffSwitch">
108
+ <input type="checkbox" name="sgpb-subs-first-name-required" class="sgpb-onOffSwitch-checkbox" id="subs-first-name-required" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-first-name-required')); ?>>
109
  <label class="sgpb-onOffSwitch__label" for="subs-first-name-required">
110
  <span class="sgpb-onOffSwitch-inner"></span>
111
  <span class="sgpb-onOffSwitch-switch"></span>
114
  </div>
115
  </div>
116
  <div class="formItem">
117
+ <span class="formItem__title"><?php esc_html_e('Last name', SG_POPUP_TEXT_DOMAIN)?>:</span>
118
  <div class="sgpb-onOffSwitch">
119
+ <input type="checkbox" class="js-checkbox-accordion js-checkbox-field-status sgpb-onOffSwitch-checkbox" id="subs-last-name-status" data-subs-field-wrapper="js-last-name-wrapper" name="sgpb-subs-last-name-status" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-last-name-status')); ?>>
120
  <label class="sgpb-onOffSwitch__label" for="subs-last-name-status">
121
  <span class="sgpb-onOffSwitch-inner"></span>
122
  <span class="sgpb-onOffSwitch-switch"></span>
125
  </div>
126
  <div class="formItem sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-padding-20">
127
  <div class="subFormItem">
128
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Placeholder', SG_POPUP_TEXT_DOMAIN)?>:</span>
129
+ <input id="subs-last-placeholder" class="formItem__input formItem__input_sgpb-popup-overlay " data-subs-rel="js-subs-last-name-input" type="text" name="sgpb-subs-last-placeholder" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-last-placeholder')); ?>">
130
  </div>
131
  <div class="subFormItem sgpb-align-item-center sgpb-display-flex sgpb-margin-top-10">
132
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Required field', SG_POPUP_TEXT_DOMAIN)?>:</span>
133
  <div class="sgpb-onOffSwitch">
134
+ <input type="checkbox" name="sgpb-subs-last-name-required" class="sgpb-onOffSwitch-checkbox" id="subs-last-name-required" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-last-name-required')); ?>>
135
  <label class="sgpb-onOffSwitch__label" for="subs-last-name-required">
136
  <span class="sgpb-onOffSwitch-inner"></span>
137
  <span class="sgpb-onOffSwitch-switch"></span>
140
  </div>
141
  </div>
142
  <div class="formItem">
143
+ <span class="formItem__title"><?php esc_html_e('Required field message', SG_POPUP_TEXT_DOMAIN); ?></span>
144
+ <input type="text" name="sgpb-subs-validation-message" id="subs-validation-message" class="formItem__input formItem__input_sgpb-popup-overlay sgpb-full-width-events" maxlength="90" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-validation-message')); ?>">
145
  </div>
146
  <div class="formItem">
147
  <div class="sgpb-width-100">
148
+ <span class="formItem__title"><?php esc_html_e('Inputs\' style', SG_POPUP_TEXT_DOMAIN); ?></span>
149
  </div>
150
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
151
  <div class="subFormItem bottom">
152
  <div class="maxWidth sgpb-margin-bottom-20">
153
+ <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php esc_html_e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
154
+ <input type="text" class="js-subs-dimension subFormItem__input" data-field-type="input" data-subs-rel="js-subs-text-inputs" data-style-type="width" name="sgpb-subs-text-width" id="subs-text-width" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-text-width')); ?>">
155
  </div>
156
  <div class="maxHeight sgpb-margin-bottom-20">
157
+ <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php esc_html_e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
158
+ <input class="js-subs-dimension subFormItem__input" 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_attr($popupTypeObj->getOptionValue('sgpb-subs-text-height')); ?>">
159
  </div>
160
  </div>
161
  <div class="subFormItem sgpb-margin-bottom-20">
162
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Border width', SG_POPUP_TEXT_DOMAIN)?>:</span>
163
+ <input class="js-subs-dimension formItem__input formItem__input_sgpb-popup-overlay" 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_attr($popupTypeObj->getOptionValue('sgpb-subs-text-border-width')); ?>">
164
  </div>
165
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
166
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
167
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
168
+ <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_attr($popupTypeObj->getOptionValue('sgpb-subs-text-bg-color')); ?>" >
169
  </div>
170
  </div>
171
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
172
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
173
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
174
+ <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_attr($popupTypeObj->getOptionValue('sgpb-subs-text-border-color')); ?>" >
175
  </div>
176
  </div>
177
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
178
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
179
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
180
+ <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_attr($popupTypeObj->getOptionValue('sgpb-subs-text-color')); ?>" >
181
  </div>
182
  </div>
183
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
184
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Placeholder color', SG_POPUP_TEXT_DOMAIN)?>:</span>
185
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
186
+ <input class="sgpb-color-picker js-subs-color-picker" 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_attr($placeholderColor); ?>" >
187
  </div>
188
  </div>
189
  </div>
191
 
192
  <div class="formItem">
193
  <div class="sgpb-width-100">
194
+ <span class="formItem__title"><?php esc_html_e('Submit button styles', SG_POPUP_TEXT_DOMAIN); ?></span>
195
  </div>
196
  <div class="subForm sgpb-bg-black__opacity-02 sgpb-padding-30 sgpb-width-100">
197
  <div class="subFormItem bottom">
198
  <div class="maxWidth sgpb-margin-bottom-20">
199
+ <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php esc_html_e('Width', SG_POPUP_TEXT_DOMAIN); ?>:</span>
200
+ <input class="js-subs-dimension subFormItem__input" 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_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-width')); ?>">
201
  </div>
202
  <div class="maxHeight sgpb-margin-bottom-20">
203
+ <span class="subFormItem__title formItem__title_equals sgpb-margin-right-10"><?php esc_html_e('Height', SG_POPUP_TEXT_DOMAIN); ?>:</span>
204
+ <input class="js-subs-dimension subFormItem__input" 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_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-height')); ?>">
205
  </div>
206
  </div>
207
  <div class="subFormItem sgpb-margin-bottom-20">
208
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Border width', SG_POPUP_TEXT_DOMAIN)?>:</span>
209
+ <input class="js-subs-dimension formItem__input" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="border-width" type="text" name="sgpb-subs-btn-border-width" id="sgpb-subs-btn-border-width" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-border-width')); ?>">
210
  </div>
211
  <div class="subFormItem sgpb-margin-bottom-20">
212
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Border radius', SG_POPUP_TEXT_DOMAIN)?>:</span>
213
+ <input class="js-subs-dimension formItem__input" data-subs-rel="js-subs-submit-btn" data-field-type="submit" data-style-type="border-radius" type="text" name="sgpb-subs-btn-border-radius" id="sgpb-subs-btn-border-radius" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-border-radius')); ?>">
214
  </div>
215
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
216
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Border color', SG_POPUP_TEXT_DOMAIN)?>:</span>
217
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
218
+ <input id="sgpb-subs-btn-border-color" class="sgpb-color-picker js-subs-color-picker" data-field-type="submit" data-subs-rel="js-subs-submit-btn" data-style-type="border-color" type="text" name="sgpb-subs-btn-border-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-border-color')); ?>" >
219
  </div>
220
  </div>
221
  <div class="subFormItem sgpb-margin-bottom-20">
222
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Title', SG_POPUP_TEXT_DOMAIN)?>:</span>
223
+ <input type="text" name="sgpb-subs-btn-title" id="subs-btn-title" class="formItem__input formItem__input_sgpb-popup-overlay js-subs-btn-title" data-field-type="submit" data-subs-rel="js-subs-submit-btn" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-title')); ?>">
224
  </div>
225
  <div class="subFormItem sgpb-margin-bottom-20">
226
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Title (in progress)', SG_POPUP_TEXT_DOMAIN)?>:</span>
227
+ <input type="text" name="sgpb-subs-btn-progress-title" id="btn-progress-title" class="formItem__input formItem__input_sgpb-popup-overlay" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-progress-title')); ?>">
228
  </div>
229
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
230
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Background color', SG_POPUP_TEXT_DOMAIN)?>:</span>
231
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
232
+ <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_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-bg-color')); ?>" >
233
  </div>
234
  </div>
235
  <div class="subFormItem sgpb-margin-bottom-20 sgpb-display-flex sgpb-align-item-center">
236
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Text color', SG_POPUP_TEXT_DOMAIN)?>:</span>
237
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
238
+ <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_attr($popupTypeObj->getOptionValue('sgpb-subs-btn-text-color')); ?>" >
239
  </div>
240
  </div>
241
  </div>
242
  </div>
243
  <div class="formItem">
244
+ <span class="formItem__title"><?php esc_html_e('Error message', SG_POPUP_TEXT_DOMAIN); ?></span>
245
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" name="sgpb-subs-error-message" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-error-message')); ?>">
246
  </div>
247
  <div class="formItem">
248
+ <span class="formItem__title"><?php esc_html_e('Invalid email message', SG_POPUP_TEXT_DOMAIN); ?></span>
249
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" name="sgpb-subs-invalid-message" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-invalid-message')); ?>">
250
  </div>
251
  <div class="formItem">
252
+ <span class="formItem__title"><?php esc_html_e('Show form on the Top', SG_POPUP_TEXT_DOMAIN)?>:</span>
253
  <div class="sgpb-onOffSwitch">
254
  <input type="checkbox" id="sgpb-subs-show-form-to-top" class="sgpb-onOffSwitch-checkbox" name="sgpb-subs-show-form-to-top" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-show-form-to-top')); ?>>
255
  <label class="sgpb-onOffSwitch__label" for="sgpb-subs-show-form-to-top">
259
  </div>
260
  </div>
261
  <div class="formItem">
262
+ <span class="formItem__title"><?php esc_html_e('Hide for already subscribed users', SG_POPUP_TEXT_DOMAIN)?>:</span>
263
  <div class="sgpb-onOffSwitch">
264
  <input type="checkbox" id="sgpb-subs-hide-subs-users" class="sgpb-onOffSwitch-checkbox" name="sgpb-subs-hide-subs-users" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-hide-subs-users')); ?>>
265
  <label class="sgpb-onOffSwitch__label" for="sgpb-subs-hide-subs-users">
269
  </div>
270
  </div>
271
  <div class="formItem">
272
+ <span class="formItem__title"><?php esc_html_e('After successful subscription', SG_POPUP_TEXT_DOMAIN)?>:</span>
273
  </div>
274
  <div class="formItem sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20">
275
  <?php
276
  $multipleChoiceButton = new MultipleChoiceButton($defaultData['subscriptionSuccessBehavior'], $popupTypeObj->getOptionValue('sgpb-subs-success-behavior'));
277
+ echo wp_kses($multipleChoiceButton, $allowed_html);;
278
  ?>
279
  </div>
280
 
281
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-show-success-message">
282
  <div class="subFormItem">
283
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Success message', SG_POPUP_TEXT_DOMAIN)?>:</span>
284
  <input name="sgpb-subs-success-message" type="text" id="sgpb-subs-success-message" class="grayFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-success-message')); ?>">
285
  </div>
286
  </div>
287
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-redirect-to-URL">
288
  <div class="subFormItem">
289
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Redirect URL', SG_POPUP_TEXT_DOMAIN)?>:</span>
290
  <input type="url" name="sgpb-subs-success-redirect-URL" id="sgpb-subs-success-redirect-URL" placeholder="https://www.example.com" class="grayFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-success-redirect-URL')); ?>">
291
  </div>
292
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
293
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:</span>
294
  <div class="sgpb-onOffSwitch">
295
+ <input type="checkbox" name="sgpb-subs-success-redirect-new-tab" id="subs-success-redirect-new-tab" class="sgpb-onOffSwitch-checkbox" placeholder="https://www.example.com" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-subs-success-redirect-new-tab')); ?>>
296
  <label class="sgpb-onOffSwitch__label" for="subs-success-redirect-new-tab">
297
  <span class="sgpb-onOffSwitch-inner"></span>
298
  <span class="sgpb-onOffSwitch-switch"></span>
302
  </div>
303
  <div class="sg-hide sgpb-bg-black__opacity-02 sgpb-width-100 sgpb-padding-20 sgpb-margin-bottom-20" id="subs-open-popup">
304
  <div class="subFormItem">
305
+ <span class="subFormItem__title sgpb-margin-right-10"><?php esc_html_e('Select popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
306
+ <?php echo wp_kses(AdminHelper::createSelectBox($subscriptionSubPopups, $successPopup, array('name' => 'sgpb-subs-success-popup', 'class'=>'js-sg-select2 select__select')), $allowed_html); ?>
307
  </div>
308
  </div>
309
  </div>
310
  <div class="sgpb-width-30">
311
  <div class="sgpb-position-sticky sgpb-overflow-auto">
312
  <div class="livePreview livePreview_centered sgpb-margin-auto sgpb-align-item-center sgpb-btn sgpb-btn-gray-light sgpb-btn--rounded sgpb-display-flex sgpb-justify-content-center">
313
+ <img class="sgpb-margin-right-10" src="<?php echo esc_attr(SG_POPUP_PUBLIC_URL.'icons/Black/eye.svg'); ?>" alt="Eye icon">
314
+ <span class="livePreview__text"><?php esc_html_e('Live Preview', SG_POPUP_TEXT_DOMAIN)?></span>
315
  </div>
316
  <div class="sgpb-margin-top-10 sgpb-subs-form-<?php echo esc_attr($popupId); ?> sgpb-subscription-admin-wrapper<?php echo esc_attr($forceRtlClass); ?>">
317
+ <?php echo wp_kses(Functions::renderForm($formData), $allowed_html); ?>
318
  </div>
319
  <?php
320
  $styleData = array(
321
  'placeholderColor' => $placeholderColor
322
  );
323
+ echo wp_kses($popupTypeObj->getFormCustomStyles($styleData), $allowed_html)
324
  ?>
325
  <div style="max-width: 300px;margin: 0 auto;">
326
  <span class="sgpb-align-center"><?php _e('Get the <a href="'.SG_POPUP_SUBSCRIPTION_PLUS_URL.'">Subscription Plus</a> extension to add or customize the form fields.', SG_POPUP_TEXT_DOMAIN);?></span>
public/views/optionsView.php CHANGED
@@ -2,12 +2,14 @@
2
  use sgpb\AdminHelper;
3
  use sgpb\MultipleChoiceButton;
4
  use sgpb\PopupBuilderActivePackage;
 
 
5
  $removedOptions = $popupTypeObj->getRemoveOptions();
6
  $defaultData = ConfigDataHelper::defaultData();
7
  $defaultAnimation = esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation-effect'));
8
  if (!empty($_GET['sgpb_type'])) {
9
  if (defined('SGPB_POPUP_TYPE_RECENT_SALES')) {
10
- if ($_GET['sgpb_type'] == defined('SGPB_POPUP_TYPE_RECENT_SALES') && !$popupTypeObj->getOptionValue('sgpb-open-animation-effect')) {
11
  $defaultAnimation = 'sgpb-fadeIn';
12
  }
13
  }
@@ -24,7 +26,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
24
  <div class="sgpb sgpb-wrapper popupOptions">
25
  <?php if(empty($removedOptions['sgpb-content-click'])): ?>
26
  <div class="formItem">
27
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Action on popup content click', SG_POPUP_TEXT_DOMAIN)?>:</span>
28
  <div class="sgpb-onOffSwitch">
29
  <input type="checkbox" id="sgpb-content-click" name="sgpb-content-click" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-content-click')); ?>>
30
  <label class="sgpb-onOffSwitch__label" for="sgpb-content-click">
@@ -36,15 +38,15 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
36
  <div class="sg-full-width sgpb-bg-black__opacity-02 sgpb-padding-x-20 formItem">
37
  <?php
38
  $multipleChoiceButton = new MultipleChoiceButton($defaultData['contentClickOptions'], $popupTypeObj->getOptionValue('sgpb-content-click-behavior'));
39
- echo $multipleChoiceButton;
40
  ?>
41
  <div class="sgpb-bg-black__opacity-02 sg-hide sg-full-width sgpb-padding-20" id="content-click-redirect">
42
  <div class="subFormItem">
43
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('URL', SG_POPUP_TEXT_DOMAIN)?>:</span>
44
- <input type="url" name="sgpb-click-redirect-to-url" id="redirect-to-url" class="grayFormItem__input" placeholder="http://" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-click-redirect-to-url')); ?>">
45
  </div>
46
  <div class="formItem">
47
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:</span>
48
  <div class="sgpb-onOffSwitch">
49
  <input id="redirect" class="sgpb-onOffSwitch-checkbox" type="checkbox" name="sgpb-redirect-to-new-tab" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-redirect-to-new-tab'));?>>
50
  <label class="sgpb-onOffSwitch__label" for="redirect">
@@ -57,11 +59,11 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
57
 
58
  <div class="sgpb-bg-black__opacity-02 sg-hide sg-full-width sgpb-padding-20" id="content-copy-to-clipboard">
59
  <div class="subFormItem formItem">
60
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Text', SG_POPUP_TEXT_DOMAIN)?>:</span>
61
  <input type="text" name="sgpb-copy-to-clipboard-text" id="sgpb-copy-to-clipboard-text" class="subFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-text')); ?>">
62
  </div>
63
  <div class="subFormItem formItem">
64
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
65
  <div class="sgpb-onOffSwitch">
66
  <input class="sgpb-onOffSwitch-checkbox" type="checkbox" name="sgpb-copy-to-clipboard-close-popup" id="sgpb-copy-to-clipboard-close-popup" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-close-popup')); ?>>
67
  <label class="sgpb-onOffSwitch__label" for="sgpb-copy-to-clipboard-close-popup">
@@ -71,7 +73,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
71
  </div>
72
  </div>
73
  <div class="subFormItem formItem">
74
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Show alert', SG_POPUP_TEXT_DOMAIN)?>:</span>
75
  <div class="sgpb-onOffSwitch">
76
  <input type="checkbox" id="sgpb-copy-to-clipboard-alert" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-copy-to-clipboard-alert" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-alert')); ?>>
77
  <label class="sgpb-onOffSwitch__label" for="sgpb-copy-to-clipboard-alert">
@@ -82,8 +84,8 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
82
  </div>
83
  <div class="sg-full-width">
84
  <div class="subFormItem formItem">
85
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Message', SG_POPUP_TEXT_DOMAIN)?>:</span>
86
- <input type="text" id="sgpb-copy-to-clipboard-message" class="subFormItem__input" name="sgpb-copy-to-clipboard-message" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-message')); ?>">
87
  </div>
88
  </div>
89
  </div>
@@ -91,7 +93,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
91
  <?php endif; ?>
92
  <?php if (empty($removedOptions['sgpb-show-popup-same-user'])): ?>
93
  <div class="formItem">
94
- <span class="formItem__title"><?php _e('Popup showing limitation', SG_POPUP_TEXT_DOMAIN)?>:</span>
95
  <div class="sgpb-onOffSwitch">
96
  <input type="checkbox" id="sgpb-show-popup-same-user" name="sgpb-show-popup-same-user" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user')); ?>>
97
  <label class="sgpb-onOffSwitch__label" for="sgpb-show-popup-same-user">
@@ -102,34 +104,34 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
102
  <div class="question-mark">B</div>
103
  <div class="sgpb-info-wrapper">
104
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
105
- <?php _e('Estimate the popup showing frequency to the same user.', SG_POPUP_TEXT_DOMAIN);?>
106
  </span>
107
  </div>
108
  </div>
109
  <div class="sg-full-width sgpb-bg-black__opacity-02 sgpb-padding-x-20 formItem">
110
  <div class="subForm noPadding">
111
  <div class="subFormItem formItem">
112
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Popup showing count', SG_POPUP_TEXT_DOMAIN)?>:</span>
113
- <input type="number" min="1" disabled required id="sgpb-show-popup-same-user-count" class="subFormItem__input" name="sgpb-show-popup-same-user-count" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-count')); ?>" placeholder="e.g.: 1">
114
  <div class="question-mark">B</div>
115
  <div class="sgpb-info-wrapper">
116
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
117
- <?php _e('Select how many times the popup will be shown for the same user.', SG_POPUP_TEXT_DOMAIN);?>
118
  </span>
119
  </div>
120
  </div>
121
  <div class="subFormItem formItem">
122
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Popup showing expiry', SG_POPUP_TEXT_DOMAIN)?>:</span>
123
- <input type="number" min="0" disabled required id="sgpb-show-popup-same-user-expiry" class="subFormItem__input" name="sgpb-show-popup-same-user-expiry" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-expiry')); ?>" placeholder="e.g.: 1">
124
  <div class="question-mark">B</div>
125
  <div class="sgpb-info-wrapper">
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>
131
  <div class="subFormItem formItem">
132
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Apply option on each page', SG_POPUP_TEXT_DOMAIN)?>:</span>
133
  <div class="checkbox-wrapper">
134
  <input type="checkbox" disabled id="sgpb-show-popup-same-user-page-level" name="sgpb-show-popup-same-user-page-level" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-page-level')); ?>>
135
  <label class="checkboxLabel" for="sgpb-show-popup-same-user-page-level"></label>
@@ -137,7 +139,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
137
  <div class="question-mark">B</div>
138
  <div class="sgpb-info-wrapper">
139
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
140
- <?php _e('If this option is checked the popup showing limitation will be saved for the current page. Otherwise, the limitation will refer site wide, and the popup will be shown for specific times on each page selected.The previously specified count of days will be reset every time you check/uncheck this option.', SG_POPUP_TEXT_DOMAIN);?>
141
  </span>
142
  </div>
143
  </div>
@@ -146,7 +148,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
146
  <?php endif; ?>
147
  <div class="formItem">
148
  <span class="formItem__title">
149
- <?php _e('Popup opening sound', SG_POPUP_TEXT_DOMAIN); ?>:
150
  </span>
151
  <div class="sgpb-onOffSwitch">
152
  <input type="checkbox" id="open-sound" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-open-sound" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-sound')); ?>>
@@ -158,14 +160,14 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
158
  <div class="question-mark">B</div>
159
  <div class="sgpb-info-wrapper">
160
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
161
- <?php _e('If this option is enabled the popup will appear with a sound. The sound option is not available on mobile devices, as there are restrictions on sound auto-play options for mobile devices.', SG_POPUP_TEXT_DOMAIN)?>
162
  </span>
163
  </div>
164
  </div>
165
  <div class="subForm formItem sgpb-padding-x-20 sgpb-width-100">
166
  <div class="musicForm">
167
  <div class="musicFormItem sgpb-display-flex">
168
- <input type="text" id="js-sound-open-url" readonly class="musicFormItem__input sgpb-margin-right-20 sgpb-width-50" name="sgpb-sound-url" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-sound-url')); ?>">
169
  <div class="sgpb-icons icons_blue sgpb-js-preview-sound">J</div>
170
  </div>
171
  <div class="musicFormItem sgpb-width-50 sgpb-margin-top-10 sgpb-display-flex sgpb-justify-content-center musicFormItem_last">
@@ -175,7 +177,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
175
  </div>
176
  </div>
177
  <div class="formItem">
178
- <span class="formItem__title"><?php _e('Popup opening animation', SG_POPUP_TEXT_DOMAIN); ?>:</span>
179
  <div class="sgpb-onOffSwitch">
180
  <input type="checkbox" id="open-animation" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-open-animation" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation')); ?>>
181
  <label class="sgpb-onOffSwitch__label" for="open-animation">
@@ -187,26 +189,26 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
187
  <div class="subForm sgpb-padding-x-20 sgpb-width-100 sgpb-bg-black__opacity-02">
188
  <div class="subForm formItem sgpb-align-item-baseline sgpb-flex-direction-column sgpb-select2-input-styles-animation-effect">
189
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-position-relative sgpb-margin-bottom-20">
190
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Type', SG_POPUP_TEXT_DOMAIN); ?>:</span>
191
- <?php echo AdminHelper::createSelectBox($defaultData['openAnimationEfects'], $defaultAnimation, array('name' => 'sgpb-open-animation-effect', 'class'=>'js-sg-select2 sgpb-open-animation-effects select__select')); ?>
192
  <div class="sgpb-icons icons_blue sgpb-preview-animation sgpb-margin-x-20">A</div>
193
  <div id="js-open-animation-effect" class="sgpb-js-open-animation-effect"></div>
194
  </div>
195
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
196
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Speed', SG_POPUP_TEXT_DOMAIN); ?>:</span>
197
  <input type="number"
198
  id="sgpb-open-animation-speed" name="sgpb-open-animation-speed" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation-speed'))?>"
199
  data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-open-animation-speed'))?>"
200
  class="subFormItem__input subFormItem__input_leftRounded" />
201
  <div class="sgpb-margin-left-10 subFormItem__text__rightRounded">
202
- <?php _e('Second(s)', SG_POPUP_TEXT_DOMAIN); ?>
203
  </div>
204
  </div>
205
  </div>
206
  </div>
207
 
208
  <div class="formItem">
209
- <span class="formItem__title"><?php _e('Popup closing animation', SG_POPUP_TEXT_DOMAIN); ?>:</span>
210
  <div class="sgpb-onOffSwitch">
211
  <input type="checkbox" id="close-animation" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-close-animation" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-animation')); ?>>
212
  <label class="sgpb-onOffSwitch__label" for="close-animation">
@@ -218,25 +220,25 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
218
  <div class="subForm sgpb-padding-x-20 sgpb-width-100 sgpb-bg-black__opacity-02">
219
  <div class="subForm formItem sgpb-align-item-baseline sgpb-flex-direction-column sgpb-select2-input-styles-animation-effect">
220
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-position-relative sgpb-margin-bottom-20">
221
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Type', SG_POPUP_TEXT_DOMAIN); ?>:</span>
222
- <?php echo AdminHelper::createSelectBox($defaultData['closeAnimationEfects'], esc_attr($popupTypeObj->getOptionValue('sgpb-close-animation-effect')), array('name' => 'sgpb-close-animation-effect', 'class'=>'js-sg-select2 sgpb-close-animation-effects select__select')); ?>
223
  <div class="sgpb-icons icons_blue sgpb-preview-animation sgpb-margin-x-20 sgpb-preview-close-animation">A</div>
224
  <div id="js-close-animation-effect" class="sgpb-js-close-animation-effect"></div>
225
  </div>
226
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
227
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Speed', SG_POPUP_TEXT_DOMAIN); ?>:</span>
228
  <input type="number"
229
  min="0" step="0.1" data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-close-animation-speed'))?>"
230
  id="sgpb-close-animation-speed" name="sgpb-close-animation-speed" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-animation-speed'))?>"
231
  class="subFormItem__input subFormItem__input_leftRounded" />
232
  <div class="sgpb-margin-left-10 subFormItem__text__rightRounded">
233
- <?php _e('Second(s)', SG_POPUP_TEXT_DOMAIN); ?>
234
  </div>
235
  </div>
236
  </div>
237
  </div>
238
  <div class="formItem">
239
- <span class="formItem__title"><?php _e('Popup location', SG_POPUP_TEXT_DOMAIN); ?>:</span>
240
  <div class="sgpb-onOffSwitch">
241
  <input type="checkbox" id="popup-fixed" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-popup-fixed" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-fixed')); ?>>
242
  <label class="sgpb-onOffSwitch__label" for="popup-fixed">
@@ -263,7 +265,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
263
  </div>
264
  <?php if (empty($removedOptions['sgpb-disable-page-scrolling'])): ?>
265
  <div class="formItem">
266
- <span class="formItem__title"><?php _e('Disable page scrolling', SG_POPUP_TEXT_DOMAIN); ?>:</span>
267
  <div class="sgpb-onOffSwitch">
268
  <input type="checkbox" id="disable-page-scrolling" class="sgpb-onOffSwitch-checkbox" name="sgpb-disable-page-scrolling" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-page-scrolling')); ?>>
269
  <label class="sgpb-onOffSwitch__label" for="disable-page-scrolling">
@@ -274,14 +276,14 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
274
  <div class="question-mark">B</div>
275
  <div class="sgpb-info-wrapper">
276
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
277
- <?php _e('If this option is checked, the page won\'t scroll until the popup is open.', SG_POPUP_TEXT_DOMAIN)?>
278
  </span>
279
  </div>
280
  </div>
281
  <?php endif; ?>
282
  <?php if (empty($removedOptions['sgpb-enable-content-scrolling'])): ?>
283
  <div class="formItem">
284
- <span class="formItem__title"><?php _e('Enable content scrolling', SG_POPUP_TEXT_DOMAIN)?>:</span>
285
  <div class="sgpb-onOffSwitch">
286
  <input type="checkbox" id="content-scrolling" class="sgpb-onOffSwitch-checkbox" name="sgpb-enable-content-scrolling" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-content-scrolling')); ?>>
287
  <label class="sgpb-onOffSwitch__label" for="content-scrolling">
@@ -292,7 +294,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
292
  <div class="question-mark">B</div>
293
  <div class="sgpb-info-wrapper">
294
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
295
- <?php _e('If the content is larger than the specified dimensions, then the content will be scrollable.', SG_POPUP_TEXT_DOMAIN)?>
296
  </span>
297
  </div>
298
  </div>
@@ -300,7 +302,7 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
300
 
301
  <?php if (empty($removedOptions['sgpb-reopen-after-form-submission'])): ?>
302
  <div class="formItem">
303
- <span class="formItem__title"><?php _e('Reopen after form submission', SG_POPUP_TEXT_DOMAIN); ?>:</span>
304
  <div class="sgpb-onOffSwitch">
305
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="reopen-after-form-submission" name="sgpb-reopen-after-form-submission" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-reopen-after-form-submission')); ?>>
306
  <label class="sgpb-onOffSwitch__label" for="reopen-after-form-submission">
@@ -311,31 +313,31 @@ if (!empty($removedOptions['content-copy-to-clipboard'])) {
311
  <div class="question-mark">B</div>
312
  <div class="sgpb-info-wrapper">
313
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
314
- <?php _e('If this option is enabled, the popup will reopen after the form submission.', SG_POPUP_TEXT_DOMAIN)?>
315
  </span>
316
  </div>
317
  </div>
318
  <?php endif; ?>
319
  <?php if (empty($removedOptions['sgpb-popup-order'])): ?>
320
  <div class="formItem formItem_itemsCentered">
321
- <span class="formItem__title"><?php _e('Popup order', SG_POPUP_TEXT_DOMAIN)?>:</span>
322
- <input type="number" min="0" name="sgpb-popup-order" id="sgpb-popup-order" class="formItem__input" value="<?php echo esc_html((int)$popupTypeObj->getOptionValue('sgpb-popup-order')); ?>">
323
  <div class="question-mark">B</div>
324
  <div class="sgpb-info-wrapper">
325
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
326
- <?php _e('Select the priority number for your popup to appear on the page, along with other popups. The popup with a lower order number will be behind the others with a higher order number.', SG_POPUP_TEXT_DOMAIN); ?>
327
  </span>
328
  </div>
329
  </div>
330
  <?php endif; ?>
331
  <?php if (empty($removedOptions['sgpb-popup-delay'])): ?>
332
  <div class="formItem formItem_itemsCentered">
333
- <span class="formItem__title"><?php _e('Custom event delay', SG_POPUP_TEXT_DOMAIN)?>:</span>
334
- <input type="number" min="0" name="sgpb-popup-delay" id="sgpb-popup-delay" class="formItem__input" value="<?php echo (int)$popupTypeObj->getOptionValue('sgpb-popup-delay'); ?>">
335
  <div class="question-mark">B</div>
336
  <div class="sgpb-info-wrapper">
337
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
338
- <?php _e('You can add an opening delay for the popup, in seconds. This will refer to custom events, like:
339
  Shortcodes, custom CSS classes, HTML attributes, or JS called custom events.', SG_POPUP_TEXT_DOMAIN)?>
340
  </span>
341
  </div>
2
  use sgpb\AdminHelper;
3
  use sgpb\MultipleChoiceButton;
4
  use sgpb\PopupBuilderActivePackage;
5
+
6
+ $allowed_html = AdminHelper::allowed_html_tags();
7
  $removedOptions = $popupTypeObj->getRemoveOptions();
8
  $defaultData = ConfigDataHelper::defaultData();
9
  $defaultAnimation = esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation-effect'));
10
  if (!empty($_GET['sgpb_type'])) {
11
  if (defined('SGPB_POPUP_TYPE_RECENT_SALES')) {
12
+ if (sanitize_text_field($_GET['sgpb_type']) == defined('SGPB_POPUP_TYPE_RECENT_SALES') && !$popupTypeObj->getOptionValue('sgpb-open-animation-effect')) {
13
  $defaultAnimation = 'sgpb-fadeIn';
14
  }
15
  }
26
  <div class="sgpb sgpb-wrapper popupOptions">
27
  <?php if(empty($removedOptions['sgpb-content-click'])): ?>
28
  <div class="formItem">
29
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Action on popup content click', SG_POPUP_TEXT_DOMAIN)?>:</span>
30
  <div class="sgpb-onOffSwitch">
31
  <input type="checkbox" id="sgpb-content-click" name="sgpb-content-click" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-content-click')); ?>>
32
  <label class="sgpb-onOffSwitch__label" for="sgpb-content-click">
38
  <div class="sg-full-width sgpb-bg-black__opacity-02 sgpb-padding-x-20 formItem">
39
  <?php
40
  $multipleChoiceButton = new MultipleChoiceButton($defaultData['contentClickOptions'], $popupTypeObj->getOptionValue('sgpb-content-click-behavior'));
41
+ echo wp_kses($multipleChoiceButton, $allowed_html);;
42
  ?>
43
  <div class="sgpb-bg-black__opacity-02 sg-hide sg-full-width sgpb-padding-20" id="content-click-redirect">
44
  <div class="subFormItem">
45
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('URL', SG_POPUP_TEXT_DOMAIN)?>:</span>
46
+ <input type="url" name="sgpb-click-redirect-to-url" id="redirect-to-url" class="grayFormItem__input" placeholder="http://" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-click-redirect-to-url')); ?>">
47
  </div>
48
  <div class="formItem">
49
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Redirect to new tab', SG_POPUP_TEXT_DOMAIN)?>:</span>
50
  <div class="sgpb-onOffSwitch">
51
  <input id="redirect" class="sgpb-onOffSwitch-checkbox" type="checkbox" name="sgpb-redirect-to-new-tab" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-redirect-to-new-tab'));?>>
52
  <label class="sgpb-onOffSwitch__label" for="redirect">
59
 
60
  <div class="sgpb-bg-black__opacity-02 sg-hide sg-full-width sgpb-padding-20" id="content-copy-to-clipboard">
61
  <div class="subFormItem formItem">
62
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Text', SG_POPUP_TEXT_DOMAIN)?>:</span>
63
  <input type="text" name="sgpb-copy-to-clipboard-text" id="sgpb-copy-to-clipboard-text" class="subFormItem__input" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-text')); ?>">
64
  </div>
65
  <div class="subFormItem formItem">
66
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Close popup', SG_POPUP_TEXT_DOMAIN)?>:</span>
67
  <div class="sgpb-onOffSwitch">
68
  <input class="sgpb-onOffSwitch-checkbox" type="checkbox" name="sgpb-copy-to-clipboard-close-popup" id="sgpb-copy-to-clipboard-close-popup" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-close-popup')); ?>>
69
  <label class="sgpb-onOffSwitch__label" for="sgpb-copy-to-clipboard-close-popup">
73
  </div>
74
  </div>
75
  <div class="subFormItem formItem">
76
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Show alert', SG_POPUP_TEXT_DOMAIN)?>:</span>
77
  <div class="sgpb-onOffSwitch">
78
  <input type="checkbox" id="sgpb-copy-to-clipboard-alert" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-copy-to-clipboard-alert" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-alert')); ?>>
79
  <label class="sgpb-onOffSwitch__label" for="sgpb-copy-to-clipboard-alert">
84
  </div>
85
  <div class="sg-full-width">
86
  <div class="subFormItem formItem">
87
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Message', SG_POPUP_TEXT_DOMAIN)?>:</span>
88
+ <input type="text" id="sgpb-copy-to-clipboard-message" class="subFormItem__input" name="sgpb-copy-to-clipboard-message" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-copy-to-clipboard-message')); ?>">
89
  </div>
90
  </div>
91
  </div>
93
  <?php endif; ?>
94
  <?php if (empty($removedOptions['sgpb-show-popup-same-user'])): ?>
95
  <div class="formItem">
96
+ <span class="formItem__title"><?php esc_html_e('Popup showing limitation', SG_POPUP_TEXT_DOMAIN)?>:</span>
97
  <div class="sgpb-onOffSwitch">
98
  <input type="checkbox" id="sgpb-show-popup-same-user" name="sgpb-show-popup-same-user" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user')); ?>>
99
  <label class="sgpb-onOffSwitch__label" for="sgpb-show-popup-same-user">
104
  <div class="question-mark">B</div>
105
  <div class="sgpb-info-wrapper">
106
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
107
+ <?php esc_html_e('Estimate the popup showing frequency to the same user.', SG_POPUP_TEXT_DOMAIN);?>
108
  </span>
109
  </div>
110
  </div>
111
  <div class="sg-full-width sgpb-bg-black__opacity-02 sgpb-padding-x-20 formItem">
112
  <div class="subForm noPadding">
113
  <div class="subFormItem formItem">
114
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Popup showing count', SG_POPUP_TEXT_DOMAIN)?>:</span>
115
+ <input type="number" min="1" disabled required id="sgpb-show-popup-same-user-count" class="subFormItem__input" name="sgpb-show-popup-same-user-count" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-count')); ?>" placeholder="e.g.: 1">
116
  <div class="question-mark">B</div>
117
  <div class="sgpb-info-wrapper">
118
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
119
+ <?php esc_html_e('Select how many times the popup will be shown for the same user.', SG_POPUP_TEXT_DOMAIN);?>
120
  </span>
121
  </div>
122
  </div>
123
  <div class="subFormItem formItem">
124
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Popup showing expiry', SG_POPUP_TEXT_DOMAIN)?>:</span>
125
+ <input type="number" min="0" disabled required id="sgpb-show-popup-same-user-expiry" class="subFormItem__input" name="sgpb-show-popup-same-user-expiry" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-expiry')); ?>" placeholder="e.g.: 1">
126
  <div class="question-mark">B</div>
127
  <div class="sgpb-info-wrapper">
128
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
129
+ <?php esc_html_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);?>
130
  </span>
131
  </div>
132
  </div>
133
  <div class="subFormItem formItem">
134
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Apply option on each page', SG_POPUP_TEXT_DOMAIN)?>:</span>
135
  <div class="checkbox-wrapper">
136
  <input type="checkbox" disabled id="sgpb-show-popup-same-user-page-level" name="sgpb-show-popup-same-user-page-level" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-popup-same-user-page-level')); ?>>
137
  <label class="checkboxLabel" for="sgpb-show-popup-same-user-page-level"></label>
139
  <div class="question-mark">B</div>
140
  <div class="sgpb-info-wrapper">
141
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
142
+ <?php esc_html_e('If this option is checked the popup showing limitation will be saved for the current page. Otherwise, the limitation will refer site wide, and the popup will be shown for specific times on each page selected.The previously specified count of days will be reset every time you check/uncheck this option.', SG_POPUP_TEXT_DOMAIN);?>
143
  </span>
144
  </div>
145
  </div>
148
  <?php endif; ?>
149
  <div class="formItem">
150
  <span class="formItem__title">
151
+ <?php esc_html_e('Popup opening sound', SG_POPUP_TEXT_DOMAIN); ?>:
152
  </span>
153
  <div class="sgpb-onOffSwitch">
154
  <input type="checkbox" id="open-sound" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-open-sound" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-sound')); ?>>
160
  <div class="question-mark">B</div>
161
  <div class="sgpb-info-wrapper">
162
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
163
+ <?php esc_html_e('If this option is enabled the popup will appear with a sound. The sound option is not available on mobile devices, as there are restrictions on sound auto-play options for mobile devices.', SG_POPUP_TEXT_DOMAIN)?>
164
  </span>
165
  </div>
166
  </div>
167
  <div class="subForm formItem sgpb-padding-x-20 sgpb-width-100">
168
  <div class="musicForm">
169
  <div class="musicFormItem sgpb-display-flex">
170
+ <input type="text" id="js-sound-open-url" readonly class="musicFormItem__input sgpb-margin-right-20 sgpb-width-50" name="sgpb-sound-url" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-sound-url')); ?>">
171
  <div class="sgpb-icons icons_blue sgpb-js-preview-sound">J</div>
172
  </div>
173
  <div class="musicFormItem sgpb-width-50 sgpb-margin-top-10 sgpb-display-flex sgpb-justify-content-center musicFormItem_last">
177
  </div>
178
  </div>
179
  <div class="formItem">
180
+ <span class="formItem__title"><?php esc_html_e('Popup opening animation', SG_POPUP_TEXT_DOMAIN); ?>:</span>
181
  <div class="sgpb-onOffSwitch">
182
  <input type="checkbox" id="open-animation" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-open-animation" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation')); ?>>
183
  <label class="sgpb-onOffSwitch__label" for="open-animation">
189
  <div class="subForm sgpb-padding-x-20 sgpb-width-100 sgpb-bg-black__opacity-02">
190
  <div class="subForm formItem sgpb-align-item-baseline sgpb-flex-direction-column sgpb-select2-input-styles-animation-effect">
191
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-position-relative sgpb-margin-bottom-20">
192
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Type', SG_POPUP_TEXT_DOMAIN); ?>:</span>
193
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['openAnimationEfects'], $defaultAnimation, array('name' => 'sgpb-open-animation-effect', 'class'=>'js-sg-select2 sgpb-open-animation-effects select__select')), AdminHelper::allowed_html_tags()); ?>
194
  <div class="sgpb-icons icons_blue sgpb-preview-animation sgpb-margin-x-20">A</div>
195
  <div id="js-open-animation-effect" class="sgpb-js-open-animation-effect"></div>
196
  </div>
197
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
198
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Speed', SG_POPUP_TEXT_DOMAIN); ?>:</span>
199
  <input type="number"
200
  id="sgpb-open-animation-speed" name="sgpb-open-animation-speed" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-open-animation-speed'))?>"
201
  data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-open-animation-speed'))?>"
202
  class="subFormItem__input subFormItem__input_leftRounded" />
203
  <div class="sgpb-margin-left-10 subFormItem__text__rightRounded">
204
+ <?php esc_html_e('Second(s)', SG_POPUP_TEXT_DOMAIN); ?>
205
  </div>
206
  </div>
207
  </div>
208
  </div>
209
 
210
  <div class="formItem">
211
+ <span class="formItem__title"><?php esc_html_e('Popup closing animation', SG_POPUP_TEXT_DOMAIN); ?>:</span>
212
  <div class="sgpb-onOffSwitch">
213
  <input type="checkbox" id="close-animation" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-close-animation" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-animation')); ?>>
214
  <label class="sgpb-onOffSwitch__label" for="close-animation">
220
  <div class="subForm sgpb-padding-x-20 sgpb-width-100 sgpb-bg-black__opacity-02">
221
  <div class="subForm formItem sgpb-align-item-baseline sgpb-flex-direction-column sgpb-select2-input-styles-animation-effect">
222
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-position-relative sgpb-margin-bottom-20">
223
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Type', SG_POPUP_TEXT_DOMAIN); ?>:</span>
224
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['closeAnimationEfects'], $popupTypeObj->getOptionValue('sgpb-close-animation-effect'), array('name' => 'sgpb-close-animation-effect', 'class'=>'js-sg-select2 sgpb-close-animation-effects select__select')), $allowed_html); ?>
225
  <div class="sgpb-icons icons_blue sgpb-preview-animation sgpb-margin-x-20 sgpb-preview-close-animation">A</div>
226
  <div id="js-close-animation-effect" class="sgpb-js-close-animation-effect"></div>
227
  </div>
228
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
229
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Speed', SG_POPUP_TEXT_DOMAIN); ?>:</span>
230
  <input type="number"
231
  min="0" step="0.1" data-default="<?php echo esc_attr($popupTypeObj->getOptionDefaultValue('sgpb-close-animation-speed'))?>"
232
  id="sgpb-close-animation-speed" name="sgpb-close-animation-speed" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-close-animation-speed'))?>"
233
  class="subFormItem__input subFormItem__input_leftRounded" />
234
  <div class="sgpb-margin-left-10 subFormItem__text__rightRounded">
235
+ <?php esc_html_e('Second(s)', SG_POPUP_TEXT_DOMAIN); ?>
236
  </div>
237
  </div>
238
  </div>
239
  </div>
240
  <div class="formItem">
241
+ <span class="formItem__title"><?php esc_html_e('Popup location', SG_POPUP_TEXT_DOMAIN); ?>:</span>
242
  <div class="sgpb-onOffSwitch">
243
  <input type="checkbox" id="popup-fixed" class="js-checkbox-accordion sgpb-onOffSwitch-checkbox" name="sgpb-popup-fixed" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-fixed')); ?>>
244
  <label class="sgpb-onOffSwitch__label" for="popup-fixed">
265
  </div>
266
  <?php if (empty($removedOptions['sgpb-disable-page-scrolling'])): ?>
267
  <div class="formItem">
268
+ <span class="formItem__title"><?php esc_html_e('Disable page scrolling', SG_POPUP_TEXT_DOMAIN); ?>:</span>
269
  <div class="sgpb-onOffSwitch">
270
  <input type="checkbox" id="disable-page-scrolling" class="sgpb-onOffSwitch-checkbox" name="sgpb-disable-page-scrolling" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-page-scrolling')); ?>>
271
  <label class="sgpb-onOffSwitch__label" for="disable-page-scrolling">
276
  <div class="question-mark">B</div>
277
  <div class="sgpb-info-wrapper">
278
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
279
+ <?php esc_html_e('If this option is checked, the page won\'t scroll until the popup is open.', SG_POPUP_TEXT_DOMAIN)?>
280
  </span>
281
  </div>
282
  </div>
283
  <?php endif; ?>
284
  <?php if (empty($removedOptions['sgpb-enable-content-scrolling'])): ?>
285
  <div class="formItem">
286
+ <span class="formItem__title"><?php esc_html_e('Enable content scrolling', SG_POPUP_TEXT_DOMAIN)?>:</span>
287
  <div class="sgpb-onOffSwitch">
288
  <input type="checkbox" id="content-scrolling" class="sgpb-onOffSwitch-checkbox" name="sgpb-enable-content-scrolling" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-content-scrolling')); ?>>
289
  <label class="sgpb-onOffSwitch__label" for="content-scrolling">
294
  <div class="question-mark">B</div>
295
  <div class="sgpb-info-wrapper">
296
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
297
+ <?php esc_html_e('If the content is larger than the specified dimensions, then the content will be scrollable.', SG_POPUP_TEXT_DOMAIN)?>
298
  </span>
299
  </div>
300
  </div>
302
 
303
  <?php if (empty($removedOptions['sgpb-reopen-after-form-submission'])): ?>
304
  <div class="formItem">
305
+ <span class="formItem__title"><?php esc_html_e('Reopen after form submission', SG_POPUP_TEXT_DOMAIN); ?>:</span>
306
  <div class="sgpb-onOffSwitch">
307
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="reopen-after-form-submission" name="sgpb-reopen-after-form-submission" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-reopen-after-form-submission')); ?>>
308
  <label class="sgpb-onOffSwitch__label" for="reopen-after-form-submission">
313
  <div class="question-mark">B</div>
314
  <div class="sgpb-info-wrapper">
315
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
316
+ <?php esc_html_e('If this option is enabled, the popup will reopen after the form submission.', SG_POPUP_TEXT_DOMAIN)?>
317
  </span>
318
  </div>
319
  </div>
320
  <?php endif; ?>
321
  <?php if (empty($removedOptions['sgpb-popup-order'])): ?>
322
  <div class="formItem formItem_itemsCentered">
323
+ <span class="formItem__title"><?php esc_html_e('Popup order', SG_POPUP_TEXT_DOMAIN)?>:</span>
324
+ <input type="number" min="0" name="sgpb-popup-order" id="sgpb-popup-order" class="formItem__input" value="<?php echo esc_attr((int)$popupTypeObj->getOptionValue('sgpb-popup-order')); ?>">
325
  <div class="question-mark">B</div>
326
  <div class="sgpb-info-wrapper">
327
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
328
+ <?php esc_html_e('Select the priority number for your popup to appear on the page, along with other popups. The popup with a lower order number will be behind the others with a higher order number.', SG_POPUP_TEXT_DOMAIN); ?>
329
  </span>
330
  </div>
331
  </div>
332
  <?php endif; ?>
333
  <?php if (empty($removedOptions['sgpb-popup-delay'])): ?>
334
  <div class="formItem formItem_itemsCentered">
335
+ <span class="formItem__title"><?php esc_html_e('Custom event delay', SG_POPUP_TEXT_DOMAIN)?>:</span>
336
+ <input type="number" min="0" name="sgpb-popup-delay" id="sgpb-popup-delay" class="formItem__input" value="<?php echo (int)esc_attr($popupTypeObj->getOptionValue('sgpb-popup-delay')); ?>">
337
  <div class="question-mark">B</div>
338
  <div class="sgpb-info-wrapper">
339
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
340
+ <?php esc_html_e('You can add an opening delay for the popup, in seconds. This will refer to custom events, like:
341
  Shortcodes, custom CSS classes, HTML attributes, or JS called custom events.', SG_POPUP_TEXT_DOMAIN)?>
342
  </span>
343
  </div>
public/views/otherConditionsView.php CHANGED
@@ -9,11 +9,11 @@ if ($popupTypeObj->getOptionValue('sgpb-schedule-status')) {
9
  }
10
  $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupOtherConditionsSection');
11
  ?>
12
- <div class="sgpb-wrapper sgpb-position-relative" onclick="window.open('<?php echo SG_POPUP_SCHEDULING_URL;?>', '_blank')">
13
  <div class="formItem sgpb-padding-20 sgpb-option-disable">
14
  <div>
15
  <div class="formItem">
16
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Schedule', SG_POPUP_TEXT_DOMAIN); ?>:</span>
17
  <div class="sgpb-onOffSwitch">
18
  <input type="checkbox" id="schedule-status" class="sgpb-onOffSwitch-checkbox" disabled name="sgpb-schedule-status" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-schedule-status')); ?>>
19
  <label class="sgpb-onOffSwitch__label" for="schedule-status">
@@ -24,7 +24,7 @@ $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupOtherCondi
24
  <div class="question-mark">B</div>
25
  </div>
26
  <div class="formItem">
27
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Show popup in date range', SG_POPUP_TEXT_DOMAIN); ?>:</span>
28
  <div class="sgpb-onOffSwitch">
29
  <input type="checkbox" name="sgpb-popup-timer-status" id="sgpb-popup-timer-status" disabled class="sgpb-onOffSwitch-checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-timer-status'));?>>
30
  <label class="sgpb-onOffSwitch__label" for="sgpb-popup-timer-status">
@@ -37,9 +37,9 @@ $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupOtherCondi
37
  <?php if (!$conditionsCanBeUsed): ?>
38
  <div class="sgpb-unlock-options">
39
  <div class="sgpb-unlock-options__icon">
40
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg';?>" alt="Time icon" width="45" height="45" />
41
  </div>
42
- <span class="sgpb-unlock-options__title"><?php _e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
43
  </div>
44
  <?php endif; ?>
45
  </div>
9
  }
10
  $conditionsCanBeUsed = PopupBuilderActivePackage::canUseSection('popupOtherConditionsSection');
11
  ?>
12
+ <div class="sgpb-wrapper sgpb-position-relative" onclick="window.open('<?php echo esc_url_raw(SG_POPUP_SCHEDULING_URL);?>', '_blank')">
13
  <div class="formItem sgpb-padding-20 sgpb-option-disable">
14
  <div>
15
  <div class="formItem">
16
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Schedule', SG_POPUP_TEXT_DOMAIN); ?>:</span>
17
  <div class="sgpb-onOffSwitch">
18
  <input type="checkbox" id="schedule-status" class="sgpb-onOffSwitch-checkbox" disabled name="sgpb-schedule-status" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-schedule-status')); ?>>
19
  <label class="sgpb-onOffSwitch__label" for="schedule-status">
24
  <div class="question-mark">B</div>
25
  </div>
26
  <div class="formItem">
27
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Show popup in date range', SG_POPUP_TEXT_DOMAIN); ?>:</span>
28
  <div class="sgpb-onOffSwitch">
29
  <input type="checkbox" name="sgpb-popup-timer-status" id="sgpb-popup-timer-status" disabled class="sgpb-onOffSwitch-checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-timer-status'));?>>
30
  <label class="sgpb-onOffSwitch__label" for="sgpb-popup-timer-status">
37
  <?php if (!$conditionsCanBeUsed): ?>
38
  <div class="sgpb-unlock-options">
39
  <div class="sgpb-unlock-options__icon">
40
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg');?>" alt="Time icon" width="45" height="45" />
41
  </div>
42
+ <span class="sgpb-unlock-options__title"><?php esc_html_e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
43
  </div>
44
  <?php endif; ?>
45
  </div>
public/views/popupDesignView.php CHANGED
@@ -16,7 +16,7 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
16
  <?php if (empty($removedOptions['sgpb-force-rtl'])) :?>
17
  <div class="formItem formItem_itemsCentered ">
18
  <label for="sgpb-force-rtl" class="sgpb-design-label formItem__title">
19
- <?php _e('Force RTL', SG_POPUP_TEXT_DOMAIN)?>:
20
  </label>
21
  <div class="sgpb-onOffSwitch">
22
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-force-rtl" name="sgpb-force-rtl" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-force-rtl')); ?>>
@@ -29,36 +29,36 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
29
  <?php endif; ?>
30
  <?php if (empty($removedOptions['sgpb-content-padding'])) :?>
31
  <div class="formItem formItem_itemsCentered">
32
- <span class="formItem__title"><?php _e('Padding', SG_POPUP_TEXT_DOMAIN)?>:</span>
33
- <input type="number" min="0" class="formItem__input" id="content-padding" name="sgpb-content-padding" value="<?php echo esc_html((int)$popupTypeObj->getOptionValue('sgpb-content-padding')); ?>">
34
  <div class="formItem__inputValueType">px</div>
35
  <div class="question-mark">B</div>
36
  <div class="sgpb-info-wrapper">
37
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
38
- <?php _e('Add some space, in pixels, around your popup content.', SG_POPUP_TEXT_DOMAIN);?>
39
  </span>
40
  </div>
41
  </div>
42
  <?php endif; ?>
43
  <?php if (empty($removedOptions['sgpb-popup-z-index'])) : ?>
44
  <div class="formItem formItem_itemsCentered">
45
- <span class="formItem__title"><?php _e('Popup z-index', SG_POPUP_TEXT_DOMAIN); ?>:</span>
46
- <input type="number" min="1" name="sgpb-popup-z-index" id="sgpb-popup-z-index" class="formItem__input formItem__input_sgpb-pixels" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-popup-z-index')); ?>">
47
  <div class="question-mark sgpb-info-icon">B</div>
48
  <div class="sgpb-info-wrapper">
49
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
50
- <?php _e('Increase or dicrease the value to set the priority of displaying the popup content in comparison of other elements on the page. The highest value of z-index is 2147483647.', SG_POPUP_TEXT_DOMAIN);?>
51
  </span>
52
  </div>
53
  </div>
54
  <?php endif; ?>
55
 
56
  <div class="formItem formItem_itemsCentered">
57
- <span class="formItem__title"><?php _e('Themes', SG_POPUP_TEXT_DOMAIN)?>:</span>
58
  <?php AdminHelper::createRadioButtons($defaultData['theme'], "sgpb-popup-themes", esc_html($popupTheme), true, 'bg_img'); ?>
59
  </div>
60
  <div class="formItem sgpb-disable-border-wrapper<?php echo esc_attr($hidePopupBorderOption) ;?>">
61
- <span class="formItem__title"><?php _e('Disable popup border', SG_POPUP_TEXT_DOMAIN)?>:</span>
62
  <div class="sgpb-onOffSwitch">
63
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-disable-border" name="sgpb-disable-border" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-border', true)); ?>>
64
  <label class="sgpb-onOffSwitch__label" for="sgpb-disable-border">
@@ -70,8 +70,8 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
70
  <?php if (empty($removedOptions['sgpb-enable-popup-overlay'])) :?>
71
  <?php if (!$enablePopupOverlay): ?>
72
  <div class="formItem formItem_lessMargin sgpb-padding-20 sgpb-option-disable"
73
- onclick="window.open('<?php echo SG_POPUP_ADVANCED_CLOSING_URL;?>', '_blank')">
74
- <span class="formItem__title "><?php _e('Enable popup overlay', SG_POPUP_TEXT_DOMAIN)?>:</span>
75
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
76
  <input type="checkbox" id="sgpb-enable-popup-overlay" name="sgpb-enable-popup-overlay" disabled>
77
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-popup-overlay">
@@ -82,21 +82,21 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
82
  <div class="question-mark">B</div>
83
  <div class="sgpb-info-wrapper">
84
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
85
- <?php _e('If this option is checked, the popup will appear with an overlay.', SG_POPUP_TEXT_DOMAIN);?>
86
  </span>
87
  </div>
88
  <div class="sgpb-unlock-options">
89
  <div class="sgpb-unlock-options__icon">
90
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg';?>" alt="Time icon" />
91
  </div>
92
- <span class="sgpb-unlock-options__title"><?php _e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
93
  </div>
94
  </div>
95
  <?php else: ?>
96
  <div class="formItem formItem_lessMargin">
97
- <span class="formItem__title "><?php _e('Enable popup overlay', SG_POPUP_TEXT_DOMAIN)?>:</span>
98
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
99
- <input type="checkbox" id="sgpb-enable-popup-overlay" name="sgpb-enable-popup-overlay" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-popup-overlay')); ?> <?php echo (!empty($removedOptions['sgpb-enable-popup-overlay'])) ? ' disabled' : '' ?>>
100
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-popup-overlay">
101
  <span class="sgpb-onOffSwitch-inner"></span>
102
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -105,7 +105,7 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
105
  <div class="question-mark">B</div>
106
  <div class="sgpb-info-wrapper">
107
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
108
- <?php _e('If this option is checked, the popup will appear with an overlay.', SG_POPUP_TEXT_DOMAIN);?>
109
  </span>
110
  </div>
111
  </div>
@@ -113,31 +113,31 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
113
  <div class="formItem sgpb-padding-20 sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-border-radius-5px">
114
  <div class="subForm">
115
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
116
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Overlay custom css class', SG_POPUP_TEXT_DOMAIN)?>:</span>
117
  <input type="text" class="subFormItem__input formItem__input_sgpb-popup-overlay" value="sgpb-popup-overlay">
118
  <div class="question-mark">B</div>
119
  <div class="sgpb-info-wrapper">
120
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
121
- <?php _e('Add a custom class to the overlay for additional customization.', SG_POPUP_TEXT_DOMAIN);?>
122
  </span>
123
  </div>
124
  </div>
125
  <div class="subFormItem sgpb-margin-y-20 sgpb-display-flex sgpb-align-item-center">
126
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Change color', SG_POPUP_TEXT_DOMAIN)?>:</span>
127
  <div class="sgpb-color-picker-wrapper sgpb-position-relative">
128
- <input class="sgpb-color-picker sgpb-overlay-color" type="text" name="sgpb-overlay-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-overlay-color')); ?>" >
129
  </div>
130
  </div>
131
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
132
  <span class="subFormItem__title sgpb-margin-right-20">
133
- <?php _e('Opacity', SG_POPUP_TEXT_DOMAIN)?>:
134
  </span>
135
  <div class="sgpb-slider-wrapper sgpb-range-wrap">
136
  <div class="slider-wrapper sgpb-display-inline-flex">
137
  <?php $overlayOpacity = $popupTypeObj->getOptionValue('sgpb-overlay-opacity'); ?>
138
  <input type="range" class="sgpb-range-input js-popup-overlay-opacity sgpb-margin-right-10"
139
  name="sgpb-overlay-opacity"
140
- id="js-popup-overlay-opacity" min="0.0" step="0.1" max="1" value="<?php echo esc_html($overlayOpacity)?>">
141
  <span class="js-popup-overlay-opacity-value"><?php echo esc_html($overlayOpacity)?></span>
142
  </div>
143
  </div>
@@ -146,21 +146,21 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
146
  </div>
147
  <?php endif; ?>
148
  <div class="formItem formItem_itemsCentered">
149
- <span class="formItem__title"><?php _e('Content custom css class', SG_POPUP_TEXT_DOMAIN); ?>:</span>
150
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" id="content-custom-class" name="sgpb-content-custom-class" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-content-custom-class'))?>">
151
  <div class="question-mark">B</div>
152
  <div class="sgpb-info-wrapper">
153
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
154
- <?php _e('Add a custom class to the content for additional customization', SG_POPUP_TEXT_DOMAIN);?>.
155
  </span>
156
  </div>
157
  </div>
158
  <?php if (empty($removedOptions['sgpb-show-background'])) :?>
159
  <div class="formItem formItem_itemsCentered">
160
- <span class="formItem__title"><?php _e('Background options', SG_POPUP_TEXT_DOMAIN)?>:</span>
161
  </div>
162
  <div class="formItem formItem_lessMargin">
163
- <span class="formItem__title"><?php _e('Show background', SG_POPUP_TEXT_DOMAIN)?>:</span>
164
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
165
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" id="sgpb-show-background" name="sgpb-show-background" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-background')); ?>>
166
  <label class="sgpb-onOffSwitch__label" for="sgpb-show-background">
@@ -173,26 +173,26 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
173
  <div class="formItem sg-full-width sgpb-padding-20 sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-border-radius-5px">
174
  <div class="subForm">
175
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
176
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Color', SG_POPUP_TEXT_DOMAIN); ?>:</span>
177
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
178
- <input class="sgpb-color-picker" type="text" name="sgpb-background-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-background-color')); ?>" >
179
  </div>
180
  </div>
181
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
182
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Opacity', SG_POPUP_TEXT_DOMAIN)?>:</span>
183
  <div class="sgpb-slider-wrapper sgpb-range-wrap">
184
  <div class="slider-wrapper sgpb-display-inline-flex">
185
  <?php $contentOpacity = $popupTypeObj->getOptionValue('sgpb-content-opacity'); ?>
186
  <input type="range" name="sgpb-content-opacity" class="sgpb-range-input js-popup-content-opacity sgpb-margin-right-10"
187
- id="js-popup-content-opacity" min="0.0" step="0.1" max="1" value="<?php echo esc_html($contentOpacity)?>">
188
  <span class="js-popup-content-opacity-value"><?php echo esc_html($contentOpacity)?></span>
189
  </div>
190
  </div>
191
  </div>
192
  <?php if (empty($removedOptions['sgpb-background-image'])) : ?>
193
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
194
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Image', SG_POPUP_TEXT_DOMAIN);?>:</span>
195
- <div class="sgpb-background-image-block-1 sgpb-display-flex subFormBackground sgpb-padding-10 subFormItemImages<?php echo (!$popupTypeObj->getOptionValue('sgpb-background-image')) ? ' sgpb-display-none' : '';?>">
196
  <div>
197
  <div class="sgpb-button-image-uploader-wrapper">
198
  <input class="sgpb-display-none" id="js-background-upload-image" type="text" size="36" name="sgpb-background-image" value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-background-image'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-background-image')) : '' ; ?>" autocomplete="off">
@@ -201,19 +201,19 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
201
  <img class="sgpb-show-background-image-container" src="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-background-image'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-background-image')) : '' ; ?>" width="200" height="150">
202
  <div class="sgpb-margin-left-10 subFormItemIcons">
203
  <div class="icons__item">
204
- <img class="js-background-upload-image-button" src="<?php echo SG_POPUP_PUBLIC_URL.'icons/cloud.svg'; ;?>" alt="<?php _e('Cloud icon', SG_POPUP_TEXT_DOMAIN);?>">
205
  </div>
206
  <div class="icons__item icons_pink">
207
- <img id="js-background-upload-image-remove-button" src="<?php echo SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg' ;?>" alt="<?php _e('Recycle Bin', SG_POPUP_TEXT_DOMAIN);?>">
208
  </div>
209
  </div>
210
  </div>
211
- <div class="sgpb-background-image-block-2 subFormItemImages <?php echo ($popupTypeObj->getOptionValue('sgpb-background-image')) ? ' sgpb-display-none' : '';?>">
212
  <div class="subFormBackground sgpb-display-flex sgpb-align-item-center sgpb-padding-x-20">
213
  <div class="icons__item">
214
- <img class="js-background-upload-image-button" src="<?php echo SG_POPUP_PUBLIC_URL.'icons/cloud.svg' ;?>" alt="<?php _e('Change image', SG_POPUP_TEXT_DOMAIN);?>">
215
  </div>
216
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'images/NoImage.png' ;?>" alt="No Image">
217
  </div>
218
  </div>
219
  </div>
@@ -221,12 +221,12 @@ if ($popupTheme == 'sgpb-theme-2' || $popupTheme == 'sgpb-theme-3') {
221
  <?php if (empty($removedOptions['sgpb-background-image-mode'])) : ?>
222
 
223
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
224
- <span class="subFormItem__title sgpb-margin-right-20"><?php _e('Mode', SG_POPUP_TEXT_DOMAIN)?>:</span>
225
- <?php echo AdminHelper::createSelectBox($defaultData['backroundImageModes'], $popupTypeObj->getOptionValue('sgpb-background-image-mode'), array('name' => 'sgpb-background-image-mode', 'class'=>'select__select js-sg-select2')); ?>
226
  <div class="question-mark">B</div>
227
  <div class="sgpb-info-wrapper">
228
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
229
- <?php _e('Choose how the background image will be displayed with your content', SG_POPUP_TEXT_DOMAIN);?>.
230
  </span>
231
  </div>
232
  </div>
16
  <?php if (empty($removedOptions['sgpb-force-rtl'])) :?>
17
  <div class="formItem formItem_itemsCentered ">
18
  <label for="sgpb-force-rtl" class="sgpb-design-label formItem__title">
19
+ <?php esc_html_e('Force RTL', SG_POPUP_TEXT_DOMAIN)?>:
20
  </label>
21
  <div class="sgpb-onOffSwitch">
22
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-force-rtl" name="sgpb-force-rtl" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-force-rtl')); ?>>
29
  <?php endif; ?>
30
  <?php if (empty($removedOptions['sgpb-content-padding'])) :?>
31
  <div class="formItem formItem_itemsCentered">
32
+ <span class="formItem__title"><?php esc_html_e('Padding', SG_POPUP_TEXT_DOMAIN)?>:</span>
33
+ <input type="number" min="0" class="formItem__input" id="content-padding" name="sgpb-content-padding" value="<?php echo esc_attr((int)$popupTypeObj->getOptionValue('sgpb-content-padding')); ?>">
34
  <div class="formItem__inputValueType">px</div>
35
  <div class="question-mark">B</div>
36
  <div class="sgpb-info-wrapper">
37
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
38
+ <?php esc_html_e('Add some space, in pixels, around your popup content.', SG_POPUP_TEXT_DOMAIN);?>
39
  </span>
40
  </div>
41
  </div>
42
  <?php endif; ?>
43
  <?php if (empty($removedOptions['sgpb-popup-z-index'])) : ?>
44
  <div class="formItem formItem_itemsCentered">
45
+ <span class="formItem__title"><?php esc_html_e('Popup z-index', SG_POPUP_TEXT_DOMAIN); ?>:</span>
46
+ <input type="number" min="1" name="sgpb-popup-z-index" id="sgpb-popup-z-index" class="formItem__input formItem__input_sgpb-pixels" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-z-index')); ?>">
47
  <div class="question-mark sgpb-info-icon">B</div>
48
  <div class="sgpb-info-wrapper">
49
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
50
+ <?php esc_html_e('Increase or dicrease the value to set the priority of displaying the popup content in comparison of other elements on the page. The highest value of z-index is 2147483647.', SG_POPUP_TEXT_DOMAIN);?>
51
  </span>
52
  </div>
53
  </div>
54
  <?php endif; ?>
55
 
56
  <div class="formItem formItem_itemsCentered">
57
+ <span class="formItem__title"><?php esc_html_e('Themes', SG_POPUP_TEXT_DOMAIN)?>:</span>
58
  <?php AdminHelper::createRadioButtons($defaultData['theme'], "sgpb-popup-themes", esc_html($popupTheme), true, 'bg_img'); ?>
59
  </div>
60
  <div class="formItem sgpb-disable-border-wrapper<?php echo esc_attr($hidePopupBorderOption) ;?>">
61
+ <span class="formItem__title"><?php esc_html_e('Disable popup border', SG_POPUP_TEXT_DOMAIN)?>:</span>
62
  <div class="sgpb-onOffSwitch">
63
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox" id="sgpb-disable-border" name="sgpb-disable-border" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-disable-border', true)); ?>>
64
  <label class="sgpb-onOffSwitch__label" for="sgpb-disable-border">
70
  <?php if (empty($removedOptions['sgpb-enable-popup-overlay'])) :?>
71
  <?php if (!$enablePopupOverlay): ?>
72
  <div class="formItem formItem_lessMargin sgpb-padding-20 sgpb-option-disable"
73
+ onclick="window.open('<?php echo esc_url(SG_POPUP_ADVANCED_CLOSING_URL);?>', '_blank')">
74
+ <span class="formItem__title "><?php esc_html_e('Enable popup overlay', SG_POPUP_TEXT_DOMAIN)?>:</span>
75
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
76
  <input type="checkbox" id="sgpb-enable-popup-overlay" name="sgpb-enable-popup-overlay" disabled>
77
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-popup-overlay">
82
  <div class="question-mark">B</div>
83
  <div class="sgpb-info-wrapper">
84
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
85
+ <?php esc_html_e('If this option is checked, the popup will appear with an overlay.', SG_POPUP_TEXT_DOMAIN);?>
86
  </span>
87
  </div>
88
  <div class="sgpb-unlock-options">
89
  <div class="sgpb-unlock-options__icon">
90
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/time-is-money.svg');?>" alt="Time icon" />
91
  </div>
92
+ <span class="sgpb-unlock-options__title"><?php esc_html_e('Unlock Option', SG_POPUP_TEXT_DOMAIN); ?></span>
93
  </div>
94
  </div>
95
  <?php else: ?>
96
  <div class="formItem formItem_lessMargin">
97
+ <span class="formItem__title "><?php esc_html_e('Enable popup overlay', SG_POPUP_TEXT_DOMAIN)?>:</span>
98
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
99
+ <input type="checkbox" id="sgpb-enable-popup-overlay" name="sgpb-enable-popup-overlay" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-enable-popup-overlay')); ?> <?php echo esc_attr((!empty($removedOptions['sgpb-enable-popup-overlay'])) ? ' disabled' : '') ?>>
100
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-popup-overlay">
101
  <span class="sgpb-onOffSwitch-inner"></span>
102
  <span class="sgpb-onOffSwitch-switch"></span>
105
  <div class="question-mark">B</div>
106
  <div class="sgpb-info-wrapper">
107
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
108
+ <?php esc_html_e('If this option is checked, the popup will appear with an overlay.', SG_POPUP_TEXT_DOMAIN);?>
109
  </span>
110
  </div>
111
  </div>
113
  <div class="formItem sgpb-padding-20 sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-border-radius-5px">
114
  <div class="subForm">
115
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
116
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Overlay custom css class', SG_POPUP_TEXT_DOMAIN)?>:</span>
117
  <input type="text" class="subFormItem__input formItem__input_sgpb-popup-overlay" value="sgpb-popup-overlay">
118
  <div class="question-mark">B</div>
119
  <div class="sgpb-info-wrapper">
120
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
121
+ <?php esc_html_e('Add a custom class to the overlay for additional customization.', SG_POPUP_TEXT_DOMAIN);?>
122
  </span>
123
  </div>
124
  </div>
125
  <div class="subFormItem sgpb-margin-y-20 sgpb-display-flex sgpb-align-item-center">
126
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Change color', SG_POPUP_TEXT_DOMAIN)?>:</span>
127
  <div class="sgpb-color-picker-wrapper sgpb-position-relative">
128
+ <input class="sgpb-color-picker sgpb-overlay-color" type="text" name="sgpb-overlay-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-overlay-color')); ?>" >
129
  </div>
130
  </div>
131
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
132
  <span class="subFormItem__title sgpb-margin-right-20">
133
+ <?php esc_html_e('Opacity', SG_POPUP_TEXT_DOMAIN)?>:
134
  </span>
135
  <div class="sgpb-slider-wrapper sgpb-range-wrap">
136
  <div class="slider-wrapper sgpb-display-inline-flex">
137
  <?php $overlayOpacity = $popupTypeObj->getOptionValue('sgpb-overlay-opacity'); ?>
138
  <input type="range" class="sgpb-range-input js-popup-overlay-opacity sgpb-margin-right-10"
139
  name="sgpb-overlay-opacity"
140
+ id="js-popup-overlay-opacity" min="0.0" step="0.1" max="1" value="<?php echo esc_attr($overlayOpacity)?>">
141
  <span class="js-popup-overlay-opacity-value"><?php echo esc_html($overlayOpacity)?></span>
142
  </div>
143
  </div>
146
  </div>
147
  <?php endif; ?>
148
  <div class="formItem formItem_itemsCentered">
149
+ <span class="formItem__title"><?php esc_html_e('Content custom css class', SG_POPUP_TEXT_DOMAIN); ?>:</span>
150
  <input type="text" class="formItem__input formItem__input_sgpb-popup-overlay" id="content-custom-class" name="sgpb-content-custom-class" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-content-custom-class'))?>">
151
  <div class="question-mark">B</div>
152
  <div class="sgpb-info-wrapper">
153
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
154
+ <?php esc_html_e('Add a custom class to the content for additional customization', SG_POPUP_TEXT_DOMAIN);?>.
155
  </span>
156
  </div>
157
  </div>
158
  <?php if (empty($removedOptions['sgpb-show-background'])) :?>
159
  <div class="formItem formItem_itemsCentered">
160
+ <span class="formItem__title"><?php esc_html_e('Background options', SG_POPUP_TEXT_DOMAIN)?>:</span>
161
  </div>
162
  <div class="formItem formItem_lessMargin">
163
+ <span class="formItem__title"><?php esc_html_e('Show background', SG_POPUP_TEXT_DOMAIN)?>:</span>
164
  <div class="sgpb-onOffSwitch sgpb-onOffSwitch_smallLeftMargin">
165
  <input type="checkbox" class="sgpb-onOffSwitch-checkbox js-checkbox-accordion" id="sgpb-show-background" name="sgpb-show-background" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-show-background')); ?>>
166
  <label class="sgpb-onOffSwitch__label" for="sgpb-show-background">
173
  <div class="formItem sg-full-width sgpb-padding-20 sgpb-width-100 sgpb-bg-black__opacity-02 sgpb-border-radius-5px">
174
  <div class="subForm">
175
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
176
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Color', SG_POPUP_TEXT_DOMAIN); ?>:</span>
177
  <div class="sgpb-color-picker-wrapper unhideColorPicker">
178
+ <input class="sgpb-color-picker" type="text" name="sgpb-background-color" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-background-color')); ?>" >
179
  </div>
180
  </div>
181
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
182
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Opacity', SG_POPUP_TEXT_DOMAIN)?>:</span>
183
  <div class="sgpb-slider-wrapper sgpb-range-wrap">
184
  <div class="slider-wrapper sgpb-display-inline-flex">
185
  <?php $contentOpacity = $popupTypeObj->getOptionValue('sgpb-content-opacity'); ?>
186
  <input type="range" name="sgpb-content-opacity" class="sgpb-range-input js-popup-content-opacity sgpb-margin-right-10"
187
+ id="js-popup-content-opacity" min="0.0" step="0.1" max="1" value="<?php echo esc_attr($contentOpacity)?>">
188
  <span class="js-popup-content-opacity-value"><?php echo esc_html($contentOpacity)?></span>
189
  </div>
190
  </div>
191
  </div>
192
  <?php if (empty($removedOptions['sgpb-background-image'])) : ?>
193
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center sgpb-margin-y-20">
194
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Image', SG_POPUP_TEXT_DOMAIN);?>:</span>
195
+ <div class="sgpb-background-image-block-1 sgpb-display-flex subFormBackground sgpb-padding-10 subFormItemImages<?php echo esc_attr((!$popupTypeObj->getOptionValue('sgpb-background-image')) ? ' sgpb-display-none' : '');?>">
196
  <div>
197
  <div class="sgpb-button-image-uploader-wrapper">
198
  <input class="sgpb-display-none" id="js-background-upload-image" type="text" size="36" name="sgpb-background-image" value="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-background-image'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-background-image')) : '' ; ?>" autocomplete="off">
201
  <img class="sgpb-show-background-image-container" src="<?php echo (esc_attr($popupTypeObj->getOptionValue('sgpb-background-image'))) ? esc_attr($popupTypeObj->getOptionValue('sgpb-background-image')) : '' ; ?>" width="200" height="150">
202
  <div class="sgpb-margin-left-10 subFormItemIcons">
203
  <div class="icons__item">
204
+ <img class="js-background-upload-image-button" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/cloud.svg'); ;?>" alt="<?php esc_html_e('Cloud icon', SG_POPUP_TEXT_DOMAIN);?>">
205
  </div>
206
  <div class="icons__item icons_pink">
207
+ <img id="js-background-upload-image-remove-button" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/recycle-bin.svg') ;?>" alt="<?php esc_html_e('Recycle Bin', SG_POPUP_TEXT_DOMAIN);?>">
208
  </div>
209
  </div>
210
  </div>
211
+ <div class="sgpb-background-image-block-2 subFormItemImages <?php echo esc_attr(($popupTypeObj->getOptionValue('sgpb-background-image')) ? ' sgpb-display-none' : '');?>">
212
  <div class="subFormBackground sgpb-display-flex sgpb-align-item-center sgpb-padding-x-20">
213
  <div class="icons__item">
214
+ <img class="js-background-upload-image-button" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/cloud.svg') ;?>" alt="<?php esc_html_e('Change image', SG_POPUP_TEXT_DOMAIN);?>">
215
  </div>
216
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'images/NoImage.png') ;?>" alt="No Image">
217
  </div>
218
  </div>
219
  </div>
221
  <?php if (empty($removedOptions['sgpb-background-image-mode'])) : ?>
222
 
223
  <div class="subFormItem sgpb-display-flex sgpb-align-item-center">
224
+ <span class="subFormItem__title sgpb-margin-right-20"><?php esc_html_e('Mode', SG_POPUP_TEXT_DOMAIN)?>:</span>
225
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['backroundImageModes'], $popupTypeObj->getOptionValue('sgpb-background-image-mode'), array('name' => 'sgpb-background-image-mode', 'class'=>'select__select js-sg-select2')), AdminHelper::allowed_html_tags()); ?>
226
  <div class="question-mark">B</div>
227
  <div class="sgpb-info-wrapper">
228
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
229
+ <?php esc_html_e('Choose how the background image will be displayed with your content', SG_POPUP_TEXT_DOMAIN);?>.
230
  </span>
231
  </div>
232
  </div>
public/views/popupOpeningCounter.php CHANGED
@@ -6,7 +6,7 @@
6
  <div class="sgpb-wrapper sgpb-popup-opening-analytics-container">
7
  <div class="subForm sgpb-padding-20 sgpb-bg-black__opacity-02">
8
  <div class="formItem">
9
- <span class="formItem__title sgpb-margin-right-20"><?php _e('Disable popup counting', SG_POPUP_TEXT_DOMAIN)?>:</span>
10
  <div class="sgpb-onOffSwitch">
11
  <input id="sgpb-popup-counting-disabled" class="sgpb-onOffSwitch-checkbox" name="sgpb-popup-counting-disabled" type="checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-counting-disabled'));?>>
12
  <label class="sgpb-onOffSwitch__label" for="sgpb-popup-counting-disabled">
@@ -16,11 +16,11 @@
16
  </div>
17
  </div>
18
  <div class="formItem">
19
- <span class="subFormItem__title"><?php _e('Views', SG_POPUP_TEXT_DOMAIN); ?>: </span>
20
  <span class="subFormItem__title sgpb-popup-opening-analytics-option-value-span"> <?php echo esc_html($count); ?></span>
21
  </div>
22
  <div class="formItem">
23
- <input onclick="SGPBBackend.resetCount(<?php echo esc_html($popupId); ?>, false)" type="button" class="button sgpb-reset-count-btn" value="<?php _e('Reset', SG_POPUP_TEXT_DOMAIN); ?>" <?php echo ($popupId && $count != 0) ? '' : ' disabled' ; ?>>
24
  </div>
25
  </div>
26
  </div>
6
  <div class="sgpb-wrapper sgpb-popup-opening-analytics-container">
7
  <div class="subForm sgpb-padding-20 sgpb-bg-black__opacity-02">
8
  <div class="formItem">
9
+ <span class="formItem__title sgpb-margin-right-20"><?php esc_html_e('Disable popup counting', SG_POPUP_TEXT_DOMAIN)?>:</span>
10
  <div class="sgpb-onOffSwitch">
11
  <input id="sgpb-popup-counting-disabled" class="sgpb-onOffSwitch-checkbox" name="sgpb-popup-counting-disabled" type="checkbox" <?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-popup-counting-disabled'));?>>
12
  <label class="sgpb-onOffSwitch__label" for="sgpb-popup-counting-disabled">
16
  </div>
17
  </div>
18
  <div class="formItem">
19
+ <span class="subFormItem__title"><?php esc_html_e('Views', SG_POPUP_TEXT_DOMAIN); ?>: </span>
20
  <span class="subFormItem__title sgpb-popup-opening-analytics-option-value-span"> <?php echo esc_html($count); ?></span>
21
  </div>
22
  <div class="formItem">
23
+ <input onclick="SGPBBackend.resetCount(<?php echo esc_html($popupId); ?>, false)" type="button" class="button sgpb-reset-count-btn" value="<?php esc_html_e('Reset', SG_POPUP_TEXT_DOMAIN); ?>" <?php echo esc_attr(($popupId && $count != 0) ? '' : ' disabled') ; ?>>
24
  </div>
25
  </div>
26
  </div>
public/views/popupTypes.php CHANGED
@@ -4,18 +4,19 @@ use sgpb\PopupType;
4
  $popupTypes = sgpb\SGPopup::getPopupTypes();
5
  global $SGPB_POPUP_TYPES;
6
  $labels = $SGPB_POPUP_TYPES['typeLabels'];
 
7
  ?>
8
  <div class="sgpb sgpb-main-page sgpb-padding-x-20">
9
  <div class='sgpb-heading sgpb-margin-y-50 sgpb-display-flex sgpb-justify-content-between'>
10
- <h1 class="sgpb-header-h1 "><?php _e('Add New Popup', SG_POPUP_TEXT_DOMAIN); ?></h1>
11
- <button class="sgpb-btn sgpb-btn--rounded sgpb-btn-more_extensions sgpb-display-flex sgpb-justify-content-between sgpb-align-item-center" onclick="window.open('<?php echo SG_POPUP_ALL_EXTENSIONS_URL ;?>', '_blank')">
12
  <span class="sgpb-cubes sgpb-margin-right-10">
13
  <span class="sgpb-cubes-mini"></span>
14
  <span class="sgpb-cubes-mini"></span>
15
  <span class="sgpb-cubes-mini"></span>
16
  <span class="sgpb-cubes-mini sgpb-cubes-mini_little"></span>
17
  </span>
18
- <span class="sgpb-button__span"><?php _e('Get More Extensions', SG_POPUP_TEXT_DOMAIN) ?></span>
19
  </button>
20
  </div>
21
  <div class="sgpb-addPopup sgpb-margin-y-50 sgpb-display-flex">
@@ -27,25 +28,25 @@ $labels = $SGPB_POPUP_TYPES['typeLabels'];
27
  continue;
28
  }
29
  ?>
30
- <div class="sgpb-box sgpb-box-active sgpb-margin-bottom-30 sgpb-position-relative" data-redirect-url="<?php echo AdminHelper::buildCreatePopupUrl($popupType); ?>">
31
  <?php if (defined('SGPB_SUBSCRIPTION_PLUS_CLASSES_PATH') && $type == 'subscription'): ?>
32
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/white/subscriptionPlus.svg' ;?>" class="sgpb-box-img">
33
  <?php else: ?>
34
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/white/'.esc_html($type).'.svg' ;?>" class="sgpb-box-img">
35
  <?php endif; ?>
36
  <p class="sgpb-box-text"><?php echo esc_html($labels[$type]); ?></p>
37
  <span class="sgpb-box-plus" >L</span>
38
  </div>
39
  <?php endforeach; ?>
40
- <div class="sgpb-box sgpb-margin-bottom-30 sgpb-box-default" data-redirect-url="<?php echo SG_POPUP_ALL_EXTENSIONS_URL; ?>">
41
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/Black/moreIdeas.svg' ;?>" class="sgpb-box-img">
42
- <p class="sgpb-box-text"><?php _e('More Ideas?', SG_POPUP_TEXT_DOMAIN); ?></p>
43
  </div>
44
  </div>
45
  <?php
46
  $extensions = AdminHelper::getAllExtensions();
47
  if (!empty($extensions['noActive'])) : ?>
48
- <h1 class="sgpb-header-h1 sgpb-margin-y-50"><?php _e('Pro Extensions', SG_POPUP_TEXT_DOMAIN); ?></h1>
49
  <div class="sgpb sgpb-pro-extensions sgpb-margin-y-50 sgpb-display-flex">
50
  <?php foreach ($extensions['noActive'] as $extension) : ?>
51
  <?php if (isset($extension['availability']) && $extension['availability'] == 'free'): ?>
@@ -58,9 +59,9 @@ if (!empty($extensions['noActive'])) : ?>
58
  }
59
  $type = $extension['key'];
60
  ?>
61
- <div class="sgpb-box sgpb-box-default sgpb-margin-bottom-30" data-redirect-url="<?php echo esc_attr($URL); ?>">
62
- <img src="<?php echo SG_POPUP_PUBLIC_URL.'icons/Black/'.$type.'.svg' ;?>" class="sgpb-box-img">
63
- <p class="sgpb-box-text"><?php echo ucfirst($extension['label']); ?></p>
64
  </div>
65
  <?php endforeach; ?>
66
  </div>
4
  $popupTypes = sgpb\SGPopup::getPopupTypes();
5
  global $SGPB_POPUP_TYPES;
6
  $labels = $SGPB_POPUP_TYPES['typeLabels'];
7
+
8
  ?>
9
  <div class="sgpb sgpb-main-page sgpb-padding-x-20">
10
  <div class='sgpb-heading sgpb-margin-y-50 sgpb-display-flex sgpb-justify-content-between'>
11
+ <h1 class="sgpb-header-h1 "><?php esc_html_e('Add New Popup', SG_POPUP_TEXT_DOMAIN); ?></h1>
12
+ <button class="sgpb-btn sgpb-btn--rounded sgpb-btn-more_extensions sgpb-display-flex sgpb-justify-content-between sgpb-align-item-center" onclick="window.open('<?php echo esc_url_raw(SG_POPUP_ALL_EXTENSIONS_URL) ;?>', '_blank')">
13
  <span class="sgpb-cubes sgpb-margin-right-10">
14
  <span class="sgpb-cubes-mini"></span>
15
  <span class="sgpb-cubes-mini"></span>
16
  <span class="sgpb-cubes-mini"></span>
17
  <span class="sgpb-cubes-mini sgpb-cubes-mini_little"></span>
18
  </span>
19
+ <span class="sgpb-button__span"><?php esc_html_e('Get More Extensions', SG_POPUP_TEXT_DOMAIN) ?></span>
20
  </button>
21
  </div>
22
  <div class="sgpb-addPopup sgpb-margin-y-50 sgpb-display-flex">
28
  continue;
29
  }
30
  ?>
31
+ <div class="sgpb-box sgpb-box-active sgpb-margin-bottom-30 sgpb-position-relative" data-redirect-url="<?php echo esc_url_raw(AdminHelper::buildCreatePopupUrl($popupType)); ?>">
32
  <?php if (defined('SGPB_SUBSCRIPTION_PLUS_CLASSES_PATH') && $type == 'subscription'): ?>
33
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/white/subscriptionPlus.svg') ;?>" class="sgpb-box-img">
34
  <?php else: ?>
35
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/white/'.$type.'.svg') ;?>" class="sgpb-box-img">
36
  <?php endif; ?>
37
  <p class="sgpb-box-text"><?php echo esc_html($labels[$type]); ?></p>
38
  <span class="sgpb-box-plus" >L</span>
39
  </div>
40
  <?php endforeach; ?>
41
+ <div class="sgpb-box sgpb-margin-bottom-30 sgpb-box-default" data-redirect-url="<?php echo esc_url_raw(SG_POPUP_ALL_EXTENSIONS_URL); ?>">
42
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/Black/moreIdeas.svg') ;?>" class="sgpb-box-img">
43
+ <p class="sgpb-box-text"><?php esc_html_e('More Ideas?', SG_POPUP_TEXT_DOMAIN); ?></p>
44
  </div>
45
  </div>
46
  <?php
47
  $extensions = AdminHelper::getAllExtensions();
48
  if (!empty($extensions['noActive'])) : ?>
49
+ <h1 class="sgpb-header-h1 sgpb-margin-y-50"><?php esc_html_e('Pro Extensions', SG_POPUP_TEXT_DOMAIN); ?></h1>
50
  <div class="sgpb sgpb-pro-extensions sgpb-margin-y-50 sgpb-display-flex">
51
  <?php foreach ($extensions['noActive'] as $extension) : ?>
52
  <?php if (isset($extension['availability']) && $extension['availability'] == 'free'): ?>
59
  }
60
  $type = $extension['key'];
61
  ?>
62
+ <div class="sgpb-box sgpb-box-default sgpb-margin-bottom-30" data-redirect-url="<?php echo esc_url_raw($URL); ?>">
63
+ <img src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/Black/'.$type.'.svg') ;?>" class="sgpb-box-img">
64
+ <p class="sgpb-box-text"><?php echo ucfirst(esc_html($extension['label'])); ?></p>
65
  </div>
66
  <?php endforeach; ?>
67
  </div>
public/views/settings.php CHANGED
@@ -19,10 +19,10 @@ $userSavedRoles = get_option('sgpb-user-roles');
19
  <div class="sgpb sgpb-wrapper">
20
  <div class="sgpb-generalSettings sgpb-display-flex sgpb-padding-30">
21
  <div class="sgpb-width-50 sgpb-padding-20">
22
- <p class="sgpb-header-h1 sgpb-margin-top-20 sgpb-margin-bottom-50"><?php _e('General Settings', SG_POPUP_TEXT_DOMAIN); ?></p>
23
- <form method="POST" action="<?php echo admin_url().'admin-post.php?action=sgpbSaveSettings'?>">
24
  <div class="formItem">
25
- <p class="subFormItem__title sgpb-flex-220"><?php _e('Enable DEBUG MODE', SG_POPUP_TEXT_DOMAIN)?>:</p>
26
  <div class="sgpb-onOffSwitch">
27
  <input type="checkbox" name="sgpb-enable-debug-mode" class="sgpb-onOffSwitch-checkbox" id="sgpb-enable-debug-mode" <?php echo esc_attr($enableDebugMode); ?>>
28
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-debug-mode">
@@ -32,7 +32,7 @@ $userSavedRoles = get_option('sgpb-user-roles');
32
  </div>
33
  </div>
34
  <div class="formItem">
35
- <span class="subFormItem__title sgpb-flex-220"><?php _e('Delete popup data', SG_POPUP_TEXT_DOMAIN)?>:</span>
36
  <div class="sgpb-onOffSwitch">
37
  <input type="checkbox" name="sgpb-dont-delete-data" class="sgpb-onOffSwitch-checkbox" id="sgpb-dont-delete-data" <?php echo esc_attr($deleteData); ?>>
38
  <label class="sgpb-onOffSwitch__label" for="sgpb-dont-delete-data">
@@ -43,15 +43,15 @@ $userSavedRoles = get_option('sgpb-user-roles');
43
  <div class="question-mark">B</div>
44
  <div class="sgpb-info-wrapper">
45
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
46
- <?php _e('All the popup data will be deleted after removing the plugin if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
47
  </span>
48
  </div>
49
  </div>
50
 
51
  <div class="formItem">
52
- <span class="subFormItem__title sgpb-flex-220"><?php _e('Disable popup analytics', SG_POPUP_TEXT_DOMAIN)?>:</span>
53
  <div class="sgpb-onOffSwitch">
54
- <input type="checkbox" name="sgpb-disable-analytics-general" class="sgpb-onOffSwitch-checkbox" id="sgpb-disable-analytics-general"<?php echo (get_option('sgpb-disable-analytics-general')) ? ' checked' : ''; ?>>
55
  <label class="sgpb-onOffSwitch__label" for="sgpb-disable-analytics-general">
56
  <span class="sgpb-onOffSwitch-inner"></span>
57
  <span class="sgpb-onOffSwitch-switch"></span>
@@ -59,27 +59,27 @@ $userSavedRoles = get_option('sgpb-user-roles');
59
  </div>
60
  </div>
61
  <div class="formItem">
62
- <div class="subFormItem__title sgpb-flex-220"><?php _e('User role to access the plugin', SG_POPUP_TEXT_DOMAIN)?></div>
63
- <?php echo AdminHelper::createSelectBox($defaultData['userRoles'], $userSavedRoles, array('name'=>'sgpb-user-roles[]', 'class' => 'js-sg-select2 js-select-ajax ', 'multiple'=> 'multiple', 'size'=> count($defaultData['userRoles'])));?>
64
  <div class="question-mark">B</div>
65
  <div class="sgpb-info-wrapper">
66
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
67
- <?php _e('In spite of user roles the administrator always has access to the plugin.', SG_POPUP_TEXT_DOMAIN)?>
68
  </span>
69
  </div>
70
  </div>
71
- <input type="submit" class="saveCHangeButton sgpb-btn sgpb-btn-blue" value="<?php _e('Save Changes', SG_POPUP_TEXT_DOMAIN)?>" >
72
  </form>
73
  </div>
74
  <div class="sgpb-width-50 sgpb-padding-20 sgpb-shadow-black sgpb-border-radius-5px">
75
- <p class="sgpb-header-h1 sgpb-margin-top-20 sgpb-margin-bottom-50"><?php _e('Debug tools', SG_POPUP_TEXT_DOMAIN)?>:</p>
76
  <div class="formItem">
77
- <span class="formItem__title"><?php _e('System information', SG_POPUP_TEXT_DOMAIN)?>:</span>
78
  </div>
79
  <div class="formItem">
80
  <textarea onclick="this.select();" rows="20" class="formItem__textarea" readonly><?php echo esc_textarea($systemInfo) ;?></textarea>
81
  </div>
82
- <input type="button" class="sgpb-download-system-info saveCHangeButton sgpb-btn sgpb-btn-blue" value="<?php _e('Download', SG_POPUP_TEXT_DOMAIN)?>">
83
  </div>
84
  </div>
85
  </div>
19
  <div class="sgpb sgpb-wrapper">
20
  <div class="sgpb-generalSettings sgpb-display-flex sgpb-padding-30">
21
  <div class="sgpb-width-50 sgpb-padding-20">
22
+ <p class="sgpb-header-h1 sgpb-margin-top-20 sgpb-margin-bottom-50"><?php esc_html_e('General Settings', SG_POPUP_TEXT_DOMAIN); ?></p>
23
+ <form method="POST" action="<?php echo esc_url_raw(admin_url().'admin-post.php?action=sgpbSaveSettings')?>">
24
  <div class="formItem">
25
+ <p class="subFormItem__title sgpb-flex-220"><?php esc_html_e('Enable DEBUG MODE', SG_POPUP_TEXT_DOMAIN)?>:</p>
26
  <div class="sgpb-onOffSwitch">
27
  <input type="checkbox" name="sgpb-enable-debug-mode" class="sgpb-onOffSwitch-checkbox" id="sgpb-enable-debug-mode" <?php echo esc_attr($enableDebugMode); ?>>
28
  <label class="sgpb-onOffSwitch__label" for="sgpb-enable-debug-mode">
32
  </div>
33
  </div>
34
  <div class="formItem">
35
+ <span class="subFormItem__title sgpb-flex-220"><?php esc_html_e('Delete popup data', SG_POPUP_TEXT_DOMAIN)?>:</span>
36
  <div class="sgpb-onOffSwitch">
37
  <input type="checkbox" name="sgpb-dont-delete-data" class="sgpb-onOffSwitch-checkbox" id="sgpb-dont-delete-data" <?php echo esc_attr($deleteData); ?>>
38
  <label class="sgpb-onOffSwitch__label" for="sgpb-dont-delete-data">
43
  <div class="question-mark">B</div>
44
  <div class="sgpb-info-wrapper">
45
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
46
+ <?php esc_html_e('All the popup data will be deleted after removing the plugin if this option is checked.', SG_POPUP_TEXT_DOMAIN)?>
47
  </span>
48
  </div>
49
  </div>
50
 
51
  <div class="formItem">
52
+ <span class="subFormItem__title sgpb-flex-220"><?php esc_html_e('Disable popup analytics', SG_POPUP_TEXT_DOMAIN)?>:</span>
53
  <div class="sgpb-onOffSwitch">
54
+ <input type="checkbox" name="sgpb-disable-analytics-general" class="sgpb-onOffSwitch-checkbox" id="sgpb-disable-analytics-general"<?php echo esc_attr((get_option('sgpb-disable-analytics-general')) ? ' checked' : ''); ?>>
55
  <label class="sgpb-onOffSwitch__label" for="sgpb-disable-analytics-general">
56
  <span class="sgpb-onOffSwitch-inner"></span>
57
  <span class="sgpb-onOffSwitch-switch"></span>
59
  </div>
60
  </div>
61
  <div class="formItem">
62
+ <div class="subFormItem__title sgpb-flex-220"><?php esc_html_e('User role to access the plugin', SG_POPUP_TEXT_DOMAIN)?></div>
63
+ <?php echo wp_kses(AdminHelper::createSelectBox($defaultData['userRoles'], $userSavedRoles, array('name'=>'sgpb-user-roles[]', 'class' => 'js-sg-select2 js-select-ajax ', 'multiple'=> 'multiple', 'size'=> count($defaultData['userRoles']))), AdminHelper::allowed_html_tags());?>
64
  <div class="question-mark">B</div>
65
  <div class="sgpb-info-wrapper">
66
  <span class="infoSelectRepeat samefontStyle sgpb-info-text" style="display: none;">
67
+ <?php esc_html_e('In spite of user roles the administrator always has access to the plugin.', SG_POPUP_TEXT_DOMAIN)?>
68
  </span>
69
  </div>
70
  </div>
71
+ <input type="submit" class="saveCHangeButton sgpb-btn sgpb-btn-blue" value="<?php esc_html_e('Save Changes', SG_POPUP_TEXT_DOMAIN)?>" >
72
  </form>
73
  </div>
74
  <div class="sgpb-width-50 sgpb-padding-20 sgpb-shadow-black sgpb-border-radius-5px">
75
+ <p class="sgpb-header-h1 sgpb-margin-top-20 sgpb-margin-bottom-50"><?php esc_html_e('Debug tools', SG_POPUP_TEXT_DOMAIN)?>:</p>
76
  <div class="formItem">
77
+ <span class="formItem__title"><?php esc_html_e('System information', SG_POPUP_TEXT_DOMAIN)?>:</span>
78
  </div>
79
  <div class="formItem">
80
  <textarea onclick="this.select();" rows="20" class="formItem__textarea" readonly><?php echo esc_textarea($systemInfo) ;?></textarea>
81
  </div>
82
+ <input type="button" class="sgpb-download-system-info saveCHangeButton sgpb-btn sgpb-btn-blue" value="<?php esc_html_e('Download', SG_POPUP_TEXT_DOMAIN)?>">
83
  </div>
84
  </div>
85
  </div>
public/views/subscribers.php CHANGED
@@ -41,23 +41,23 @@ if ($isEmpty) {
41
  ?>
42
  <div class="sgpb sgpb-wrapper ">
43
  <div class="sgpb-subscription sgpb-padding-20">
44
- <h2 class="sgpb-header-h1 sgpb-margin-top-10 sgpb-margin-bottom-40"><?php _e('Subscribers', SG_POPUP_TEXT_DOMAIN)?></h2>
45
  <div class="sgpb-margin-bottom-20 sgpb-display-flex sgpb-justify-content-between">
46
 
47
  <div>
48
  <a href="javascript:void(0)"
49
  data-target="addSubscriber"
50
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-modal-btn">
51
- <?php _e('Add new', SG_POPUP_TEXT_DOMAIN); ?>
52
  </a>
53
  <a href="javascript:void(0)"
54
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-export-subscriber">
55
- <?php _e('Export', SG_POPUP_TEXT_DOMAIN); ?>
56
  </a>
57
  <a href="javascript:void(0)"
58
  data-target="importSubscriber"
59
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-modal-btn">
60
- <?php _e('Import', SG_POPUP_TEXT_DOMAIN); ?>
61
  </a>
62
  </div>
63
 
@@ -71,68 +71,68 @@ if ($isEmpty) {
71
  </div>
72
  <?php
73
  $table = new Subscribers();
74
- echo $table;
75
  ?>
76
  </div>
77
  </div>
78
 
79
  <div id="addSubscriber" class="sgpb-display-none">
80
- <span id="addSubscriberHeader"><?php _e('Add New Subscribers', SG_POPUP_TEXT_DOMAIN); ?></span>
81
  <div id="addSubscriberBody">
82
  <div class="formItem sgpb-subscriber-adding-error sg-hide-element">
83
  <div class="alert alert-danger fade in alert-dismissable">
84
- <?php _e('Error occurred: could not add subscriber.', SG_POPUP_TEXT_DOMAIN)?>
85
  </div>
86
  </div>
87
  <div class="sgpb-add-subscriber-header-spinner-column">
88
- <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" alt="gif" class="sgpb-subscribers-add-spinner js-sg-spinner js-sgpb-add-spinner sg-hide-element js-sg-import-gif" width="20px">
89
  </div>
90
 
91
  <div class="formItem">
92
- <?php echo $subscribersSelectbox; ?>
93
  </div>
94
- <div class="sg-hide-element sgpb-subscription-error formItem"><?php _e('Subscription is not selected', SG_POPUP_TEXT_DOMAIN)?>.</div>
95
  <div class="formItem">
96
- <input type="email" autocomplete="off" name="subs-email" class="sgpb-add-subscribers-email sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php _e('Email', SG_POPUP_TEXT_DOMAIN)?>">
97
  </div>
98
- <div class="sg-hide-element sgpb-email-error formItem"><?php _e('Invalid email address', SG_POPUP_TEXT_DOMAIN)?>.</div>
99
  <div class="formItem">
100
- <input type="text" autocomplete="off" name="subs-firstName" class="sgpb-add-subscribers-first-name sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php _e('First name', SG_POPUP_TEXT_DOMAIN)?>">
101
  </div>
102
  <div class="formItem">
103
- <input type="text" autocomplete="off" name="subs-firstName" class="sgpb-add-subscribers-last-name sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php _e('Last name', SG_POPUP_TEXT_DOMAIN)?>">
104
  </div>
105
  </div>
106
  <div id="addSubscriberFooter">
107
- <input type="button" value="<?php _e('Add to list', SG_POPUP_TEXT_DOMAIN)?>"
108
- class="sgpb-btn sgpb-btn-blue sgpb-add-to-list-js" data-ajaxNonce="<?php echo SG_AJAX_NONCE;?>">
109
  </div>
110
  </div>
111
  <div id="importSubscriber" class="sgpb-display-none">
112
- <span id="importSubscriberHeader"><?php _e('Import Subscribers', SG_POPUP_TEXT_DOMAIN); ?></span>
113
  <div id="importSubscriberBody">
114
  <div class="formItem">
115
  <div class="formItem__title sgpb-margin-bottom-10">
116
- <?php _e('Select subscription(s):', SG_POPUP_TEXT_DOMAIN); ?>
117
  </div>
118
- <?php echo $importSubscribersSelectbox; ?>
119
  </div>
120
  <div class="formItem">
121
  <div class="formItem__title">
122
- <?php _e('Import Subscribers from file:', SG_POPUP_TEXT_DOMAIN); ?>
123
  </div>
124
  </div>
125
  <div class="formItem">
126
  <input class="formItem__input formItem__input_sgpb-popup-overlay" id="js-import-subscriber-file-url" type="text" size="36" name="js-import-subscriber-file-url" value="">
127
  <div class="easy-icons-wrapper">
128
  <div class="icons__item">
129
- <img id="js-import-subscriber-button" class="sgpb-cursor-pointer" src="<?php echo SG_POPUP_PUBLIC_URL.'icons/cloud.svg'; ?>" alt="<?php _e('Select file', SG_POPUP_TEXT_DOMAIN)?>">
130
  </div>
131
  </div>
132
  </div>
133
  </div>
134
  <div id="importSubscriberFooter">
135
- <input type="button" value="<?php _e('Import', SG_POPUP_TEXT_DOMAIN); ?>"
136
  class="sgpb-btn sgpb-btn-blue sgpb-import-subscriber-to-list" data-ajaxnonce="popupBuilderAjaxNonce" <?php echo esc_attr($disable); ?>>
137
  </div>
138
  </div>
41
  ?>
42
  <div class="sgpb sgpb-wrapper ">
43
  <div class="sgpb-subscription sgpb-padding-20">
44
+ <h2 class="sgpb-header-h1 sgpb-margin-top-10 sgpb-margin-bottom-40"><?php esc_html_e('Subscribers', SG_POPUP_TEXT_DOMAIN)?></h2>
45
  <div class="sgpb-margin-bottom-20 sgpb-display-flex sgpb-justify-content-between">
46
 
47
  <div>
48
  <a href="javascript:void(0)"
49
  data-target="addSubscriber"
50
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-modal-btn">
51
+ <?php esc_html_e('Add new', SG_POPUP_TEXT_DOMAIN); ?>
52
  </a>
53
  <a href="javascript:void(0)"
54
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-export-subscriber">
55
+ <?php esc_html_e('Export', SG_POPUP_TEXT_DOMAIN); ?>
56
  </a>
57
  <a href="javascript:void(0)"
58
  data-target="importSubscriber"
59
  class="sgpb-display-inline-block sgpb-btn sgpb-btn-blue--outline sgpb-btn--rounded sgpb-padding-x-30 sgpb-modal-btn">
60
+ <?php esc_html_e('Import', SG_POPUP_TEXT_DOMAIN); ?>
61
  </a>
62
  </div>
63
 
71
  </div>
72
  <?php
73
  $table = new Subscribers();
74
+ echo wp_kses($table, AdminHelper::allowed_html_tags());
75
  ?>
76
  </div>
77
  </div>
78
 
79
  <div id="addSubscriber" class="sgpb-display-none">
80
+ <span id="addSubscriberHeader"><?php esc_html_e('Add New Subscribers', SG_POPUP_TEXT_DOMAIN); ?></span>
81
  <div id="addSubscriberBody">
82
  <div class="formItem sgpb-subscriber-adding-error sg-hide-element">
83
  <div class="alert alert-danger fade in alert-dismissable">
84
+ <?php esc_html_e('Error occurred: could not add subscriber.', SG_POPUP_TEXT_DOMAIN)?>
85
  </div>
86
  </div>
87
  <div class="sgpb-add-subscriber-header-spinner-column">
88
+ <img src="<?php echo esc_url_raw(SG_POPUP_IMG_URL.'ajaxSpinner.gif'); ?>" alt="gif" class="sgpb-subscribers-add-spinner js-sg-spinner js-sgpb-add-spinner sg-hide-element js-sg-import-gif" width="20px">
89
  </div>
90
 
91
  <div class="formItem">
92
+ <?php echo wp_kses($subscribersSelectbox, AdminHelper::allowed_html_tags()); ?>
93
  </div>
94
+ <div class="sg-hide-element sgpb-subscription-error formItem"><?php esc_html_e('Subscription is not selected', SG_POPUP_TEXT_DOMAIN)?>.</div>
95
  <div class="formItem">
96
+ <input type="email" autocomplete="off" name="subs-email" class="sgpb-add-subscribers-email sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php esc_html_e('Email', SG_POPUP_TEXT_DOMAIN)?>">
97
  </div>
98
+ <div class="sg-hide-element sgpb-email-error formItem"><?php esc_html_e('Invalid email address', SG_POPUP_TEXT_DOMAIN)?>.</div>
99
  <div class="formItem">
100
+ <input type="text" autocomplete="off" name="subs-firstName" class="sgpb-add-subscribers-first-name sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php esc_html_e('First name', SG_POPUP_TEXT_DOMAIN)?>">
101
  </div>
102
  <div class="formItem">
103
+ <input type="text" autocomplete="off" name="subs-firstName" class="sgpb-add-subscribers-last-name sgpb-add-subscriber-input sgpb-formItem-input" placeholder="<?php esc_html_e('Last name', SG_POPUP_TEXT_DOMAIN)?>">
104
  </div>
105
  </div>
106
  <div id="addSubscriberFooter">
107
+ <input type="button" value="<?php esc_html_e('Add to list', SG_POPUP_TEXT_DOMAIN)?>"
108
+ class="sgpb-btn sgpb-btn-blue sgpb-add-to-list-js" data-ajaxNonce="<?php echo esc_attr(SG_AJAX_NONCE);?>">
109
  </div>
110
  </div>
111
  <div id="importSubscriber" class="sgpb-display-none">
112
+ <span id="importSubscriberHeader"><?php esc_html_e('Import Subscribers', SG_POPUP_TEXT_DOMAIN); ?></span>
113
  <div id="importSubscriberBody">
114
  <div class="formItem">
115
  <div class="formItem__title sgpb-margin-bottom-10">
116
+ <?php esc_html_e('Select subscription(s):', SG_POPUP_TEXT_DOMAIN); ?>
117
  </div>
118
+ <?php echo wp_kses($importSubscribersSelectbox, AdminHelper::allowed_html_tags()); ?>
119
  </div>
120
  <div class="formItem">
121
  <div class="formItem__title">
122
+ <?php esc_html_e('Import Subscribers from file:', SG_POPUP_TEXT_DOMAIN); ?>
123
  </div>
124
  </div>
125
  <div class="formItem">
126
  <input class="formItem__input formItem__input_sgpb-popup-overlay" id="js-import-subscriber-file-url" type="text" size="36" name="js-import-subscriber-file-url" value="">
127
  <div class="easy-icons-wrapper">
128
  <div class="icons__item">
129
+ <img id="js-import-subscriber-button" class="sgpb-cursor-pointer" src="<?php echo esc_url_raw(SG_POPUP_PUBLIC_URL.'icons/cloud.svg'); ?>" alt="<?php esc_html_e('Select file', SG_POPUP_TEXT_DOMAIN)?>">
130
  </div>
131
  </div>
132
  </div>
133
  </div>
134
  <div id="importSubscriberFooter">
135
+ <input type="button" value="<?php esc_html_e('Import', SG_POPUP_TEXT_DOMAIN); ?>"
136
  class="sgpb-btn sgpb-btn-blue sgpb-import-subscriber-to-list" data-ajaxnonce="popupBuilderAjaxNonce" <?php echo esc_attr($disable); ?>>
137
  </div>
138
  </div>
public/views/targetView.php CHANGED
@@ -4,15 +4,17 @@ namespace sgpb;
4
  $targetData = $popupTypeObj->getOptionValue('sgpb-target');
5
  $popupTargetData = ConditionBuilder::createTargetConditionBuilder($targetData);
6
  $type = (!empty($_GET['sgpb_type'])) ? sanitize_text_field($_GET['sgpb_type']) : $popupTypeObj->getOptionValue('sgpb-type');
 
 
7
  ?>
8
 
9
  <div class="popup-conditions-wrapper popup-conditions-target" data-condition-type="target">
10
  <?php
11
  $creator = new ConditionCreator($popupTargetData);
12
- echo $creator->render();
13
  ?>
14
  </div>
15
 
16
- <input type="hidden" name="sgpb-type" value="<?php echo esc_html($type); ?>">
17
  <input id="sgpb-is-preview" type="hidden" name="sgpb-is-preview" value="0" autocomplete="off">
18
  <input id="sgpb-is-active" type="hidden" name="sgpb-is-active" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-is-active')); ?>" autocomplete="off">
4
  $targetData = $popupTypeObj->getOptionValue('sgpb-target');
5
  $popupTargetData = ConditionBuilder::createTargetConditionBuilder($targetData);
6
  $type = (!empty($_GET['sgpb_type'])) ? sanitize_text_field($_GET['sgpb_type']) : $popupTypeObj->getOptionValue('sgpb-type');
7
+ $allowed_html = AdminHelper::allowed_html_tags();
8
+
9
  ?>
10
 
11
  <div class="popup-conditions-wrapper popup-conditions-target" data-condition-type="target">
12
  <?php
13
  $creator = new ConditionCreator($popupTargetData);
14
+ echo wp_kses($creator->render(), $allowed_html);
15
  ?>
16
  </div>
17
 
18
+ <input type="hidden" name="sgpb-type" value="<?php echo esc_attr($type); ?>">
19
  <input id="sgpb-is-preview" type="hidden" name="sgpb-is-preview" value="0" autocomplete="off">
20
  <input id="sgpb-is-active" type="hidden" name="sgpb-is-active" value="<?php echo esc_attr($popupTypeObj->getOptionValue('sgpb-is-active')); ?>" autocomplete="off">
readme.txt CHANGED
@@ -8,7 +8,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
8
  Requires at least: 4.2
9
  Tested up to: 5.9
10
  Requires PHP: 5.3.3
11
- Stable tag: 4.1.0
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
@@ -145,6 +145,12 @@ Go to the Popup Builder settings and set your desired options.
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
 
148
  = Version 4.1.0 =
149
  * Code improvements.
150
  * Minor fixes.
@@ -498,4 +504,4 @@ Leave us a good review :)
498
 
499
  == Upgrade Notice ==
500
 
501
- Current Version of Popup Builder is 4.1.0
8
  Requires at least: 4.2
9
  Tested up to: 5.9
10
  Requires PHP: 5.3.3
11
+ Stable tag: 4.1.1
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
145
 
146
  == Changelog ==
147
 
148
+ = Version 4.1.1 =
149
+ * Improvement of code related to making our plugin more secure
150
+ * Bug fixed related to validation of some fields
151
+ * Bug fixed related to conflict with some website functionalities in admin like search
152
+ * Bug fixed related to popups that are set in private mode
153
+
154
  = Version 4.1.0 =
155
  * Code improvements.
156
  * Minor fixes.
504
 
505
  == Upgrade Notice ==
506
 
507
+ Current Version of Popup Builder is 4.1.1