Super Progressive Web Apps - Version 2.1.14

Version Description

  • Date: 30.June.2021 Enhancement: Need to Improve Admin UI #196
Download this release

Release Info

Developer superpwa
Plugin Icon 128x128 Super Progressive Web Apps
Version 2.1.14
Comparing to
See all releases

Code changes from version 2.1.13 to 2.1.14

addons/apple-touch-icons.php CHANGED
@@ -277,14 +277,16 @@ function superpwa_apple_icons_interface_render() {
277
  }
278
  // Get add-on info
279
  $addon_utm_tracking = superpwa_get_addons( 'apple_touch_icons' );
280
-
 
281
  ?>
282
-
283
  <div class="wrap">
284
  <!--Duplicate h1 To show saved settings message above h1 tag -->
285
  <h1 style="display: none" ><?php _e( 'Apple touch icons & Splash Screen', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
286
  <h1><?php _e( 'Apple touch icons & Splash Screen', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
287
-
 
 
288
  <form action="options.php" method="post" enctype="multipart/form-data">
289
  <?php
290
  // Output nonce, action, and option_page fields for a settings page.
@@ -299,6 +301,7 @@ function superpwa_apple_icons_interface_render() {
299
  ?>
300
  </form>
301
  </div>
 
302
  <?php
303
  }
304
 
277
  }
278
  // Get add-on info
279
  $addon_utm_tracking = superpwa_get_addons( 'apple_touch_icons' );
280
+
281
+ superpwa_setting_tabs_styles();
282
  ?>
 
283
  <div class="wrap">
284
  <!--Duplicate h1 To show saved settings message above h1 tag -->
285
  <h1 style="display: none" ><?php _e( 'Apple touch icons & Splash Screen', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
286
  <h1><?php _e( 'Apple touch icons & Splash Screen', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
287
+
288
+ <?php superpwa_setting_tabs_html(); ?>
289
+
290
  <form action="options.php" method="post" enctype="multipart/form-data">
291
  <?php
292
  // Output nonce, action, and option_page fields for a settings page.
301
  ?>
302
  </form>
303
  </div>
304
+ <?php superpwa_newsletter_form(); ?>
305
  <?php
306
  }
307
 
addons/caching-strategies.php CHANGED
@@ -234,12 +234,15 @@ function superpwa_caching_strategies_interface_render() {
234
  }
235
  // Get add-on info
236
  $addon_utm_tracking = superpwa_get_addons( 'caching_strategies' );
237
-
 
238
  ?>
239
 
240
  <div class="wrap">
241
- <h1><?php _e( 'Caching Strategies', 'super-progressive-web-apps' ); ?> <small><sub>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</sub></small></h1>
242
 
 
 
243
  <form action="options.php" method="post" class="form-table" enctype="multipart/form-data">
244
  <?php
245
  // Output nonce, action, and option_page fields for a settings page.
@@ -253,5 +256,6 @@ function superpwa_caching_strategies_interface_render() {
253
  ?>
254
  </form>
255
  </div>
 
256
  <?php
257
  }
234
  }
235
  // Get add-on info
236
  $addon_utm_tracking = superpwa_get_addons( 'caching_strategies' );
237
+
238
+ superpwa_setting_tabs_styles();
239
  ?>
240
 
241
  <div class="wrap">
242
+ <h1><?php _e( 'Caching Strategies', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
243
 
244
+ <?php superpwa_setting_tabs_html(); ?>
245
+
246
  <form action="options.php" method="post" class="form-table" enctype="multipart/form-data">
247
  <?php
248
  // Output nonce, action, and option_page fields for a settings page.
256
  ?>
257
  </form>
258
  </div>
259
+ <?php superpwa_newsletter_form(); ?>
260
  <?php
261
  }
addons/utm-tracking.php CHANGED
@@ -364,12 +364,15 @@ function superpwa_utm_tracking_interface_render() {
364
  }
365
  // Get add-on info
366
  $addon_utm_tracking = superpwa_get_addons( 'utm_tracking' );
367
-
 
368
  ?>
369
 
370
  <div class="wrap">
371
- <h1><?php _e( 'UTM Tracking', 'super-progressive-web-apps' ); ?> <small><sub>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</sub></small></h1>
372
-
 
 
373
  <form action="options.php" method="post" enctype="multipart/form-data">
374
  <?php
375
  // Output nonce, action, and option_page fields for a settings page.
@@ -383,5 +386,6 @@ function superpwa_utm_tracking_interface_render() {
383
  ?>
384
  </form>
385
  </div>
 
386
  <?php
387
  }
364
  }
365
  // Get add-on info
366
  $addon_utm_tracking = superpwa_get_addons( 'utm_tracking' );
367
+
368
+ superpwa_setting_tabs_styles();
369
  ?>
370
 
371
  <div class="wrap">
372
+ <h1><?php _e( 'UTM Tracking', 'super-progressive-web-apps' ); ?> <small>(<a href="<?php echo esc_url($addon_utm_tracking['link']) . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings'?>"><?php echo esc_html__( 'Docs', 'super-progressive-web-apps' ); ?></a>)</small></h1>
373
+
374
+ <?php superpwa_setting_tabs_html(); ?>
375
+
376
  <form action="options.php" method="post" enctype="multipart/form-data">
377
  <?php
378
  // Output nonce, action, and option_page fields for a settings page.
386
  ?>
387
  </form>
388
  </div>
389
+ <?php superpwa_newsletter_form(); ?>
390
  <?php
391
  }
admin/admin-ui-render-addons.php CHANGED
@@ -189,10 +189,10 @@ function superpwa_addons_interface_render() {
189
  $addons = superpwa_get_addons();
190
 
191
  ?>
192
-
193
  <div class="wrap">
194
- <h1><?php _e( 'Add-ons for', 'super-progressive-web-apps' ); ?> SuperPWA <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
195
-
196
  <p><?php _e( 'Add-Ons extend the functionality of SuperPWA.', 'super-progressive-web-apps' ); ?></p>
197
  <style>.compatibility-compatible i:before{font-size: 16px; POSITION: RELATIVE;top: 3px;width: 15px;}</style>
198
  <!-- Add-Ons UI -->
@@ -275,48 +275,7 @@ function superpwa_addons_interface_render() {
275
  </div>*/ ?>
276
 
277
  </div>
278
-
279
- <?php if ( $superpwa_newsletter === true ) { ?>
280
-
281
- <div class="plugin-card plugin-card-superpwa-newsletter" style="background: #fdfc35 url('<?php echo SUPERPWA_PATH_SRC . 'admin/img/email.png'; ?>') no-repeat right top;">
282
-
283
- <div class="plugin-card-top" style="min-height: 135px;">
284
-
285
- <div class="name column-name" style="margin: 0px 10px;">
286
- <h3><?php _e( 'SuperPWA Newsletter', 'super-progressive-web-apps' ); ?></h3>
287
- </div>
288
-
289
- <div class="desc column-description" style="margin: 0px 10px;">
290
- <p><?php _e( 'Learn more about Progressive Web Apps and get latest updates about SuperPWA', 'super-progressive-web-apps' ); ?></p>
291
- </div>
292
-
293
- <div class="superpwa-newsletter-form" style="margin: 18px 10px 0px;">
294
-
295
- <form method="post" action="https://superpwa.com/newsletter/" target="_blank" id="superpwa_newsletter">
296
- <fieldset>
297
-
298
- <input name="newsletter-email" value="<?php $user = wp_get_current_user(); echo esc_attr( $user->user_email ); ?>" placeholder="<?php _e( 'Enter your email', 'super-progressive-web-apps' ); ?>" style="width: 60%; margin-left: 0px;" type="email">
299
- <input name="source" value="superpwa-plugin" type="hidden">
300
- <input type="submit" class="button" value="<?php _e( 'Subscribe', 'super-progressive-web-apps' ); ?>" style="background: linear-gradient(to right, #fdfc35, #ffe258) !important; box-shadow: unset;">
301
-
302
- <small style="display:block; margin-top:8px;"><?php _e( 'we\'ll share our <code>root</code> password before we share your email with anyone else.', 'super-progressive-web-apps' ); ?></small>
303
-
304
- </fieldset>
305
- </form>
306
-
307
- </div>
308
-
309
- </div>
310
-
311
- </div>
312
-
313
- <?php
314
-
315
- // Set newsletter marker to false
316
- $superpwa_newsletter = false;
317
- }
318
- } ?>
319
-
320
  </div>
321
  </div>
322
 
@@ -617,4 +576,17 @@ function superpwa_newsletter_submit(){
617
  die;
618
  }
619
  add_action( 'wp_ajax_superpwa_newsletter_submit', 'superpwa_newsletter_submit' );
620
- add_action( 'wp_ajax_nopriv_superpwa_newsletter_submit', 'superpwa_newsletter_submit' );
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  $addons = superpwa_get_addons();
190
 
191
  ?>
192
+ <style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.spwa-tab a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.spwa-tab a:hover {color: #0a4b78;}.spwa-tab a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.spwa-tab a:focus {box-shadow: none;outline: none;}.spwa-tabcontent {display: none;padding: 6px 12px;border-top: none; animation: fadeEffect 1s; } @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }</style>
193
  <div class="wrap">
194
+ <h1>Super Progressive Web Apps <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
195
+ <?php superpwa_setting_tabs_html(); ?>
196
  <p><?php _e( 'Add-Ons extend the functionality of SuperPWA.', 'super-progressive-web-apps' ); ?></p>
197
  <style>.compatibility-compatible i:before{font-size: 16px; POSITION: RELATIVE;top: 3px;width: 15px;}</style>
198
  <!-- Add-Ons UI -->
275
  </div>*/ ?>
276
 
277
  </div>
278
+ <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  </div>
280
  </div>
281
 
576
  die;
577
  }
578
  add_action( 'wp_ajax_superpwa_newsletter_submit', 'superpwa_newsletter_submit' );
579
+ add_action( 'wp_ajax_nopriv_superpwa_newsletter_submit', 'superpwa_newsletter_submit' );
580
+
581
+ function superpwa_newsletter_hide_form(){
582
+
583
+ $hide_newsletter = get_option('superpwa_hide_newsletter');
584
+ if($hide_newsletter == false){
585
+ add_option( 'superpwa_hide_newsletter', 'no' );
586
+ }
587
+ update_option( 'superpwa_hide_newsletter', 'yes' );
588
+ echo json_encode(array('status'=>200, 'message'=>'Submitted '));
589
+ die;
590
+ }
591
+ add_action( 'wp_ajax_superpwa_newsletter_hide_form', 'superpwa_newsletter_hide_form' );
592
+ add_action( 'wp_ajax_nopriv_superpwa_newsletter_hide_form', 'superpwa_newsletter_hide_form' );
admin/admin-ui-render-settings.php CHANGED
@@ -516,7 +516,7 @@ function superpwa_admin_interface_render() {
516
  }
517
 
518
  ?>
519
- <style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.spwa-tab a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.spwa-tab a:hover {color: #0a4b78;}.spwa-tab a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.spwa-tabcontent {display: none;padding: 6px 12px;border-top: none; animation: fadeEffect 1s; } @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }</style>
520
 
521
  <div class="wrap">
522
  <h1>Super Progressive Web Apps <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
@@ -525,11 +525,15 @@ function superpwa_admin_interface_render() {
525
  <?php
526
  // Output nonce, action, and option_page fields for a settings page.
527
  settings_fields( 'superpwa_settings_group' );
 
528
  ?>
529
  <div class="spwa-tab">
530
- <a id="spwa-default" class="spwa-tablinks" onclick="openCity(event, 'settings')">Settings</a>
531
- <a class="spwa-tablinks" onclick="openCity(event, 'advance')">Advance</a>
 
 
532
  </div>
 
533
  <div id="settings" class="spwa-tabcontent">
534
  <?php
535
  // Basic Application Settings
@@ -557,8 +561,37 @@ function superpwa_admin_interface_render() {
557
  }
558
  ?>
559
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  </form>
561
  </div>
562
- <script type="text/javascript">function openCity(evt, cityName) {var i, tabcontent, tablinks;tabcontent = document.getElementsByClassName("spwa-tabcontent");for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("spwa-tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; }document.getElementById("spwa-default").click();</script>
 
 
 
 
 
 
 
 
 
 
563
  <?php
564
  }
516
  }
517
 
518
  ?>
519
+ <style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.spwa-tab a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.spwa-tab a:hover {color: #0a4b78;}.spwa-tab a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.spwa-tab a:focus {box-shadow: none;outline: none;}.spwa-tabcontent {display: none;padding: 6px 12px;border-top: none; animation: fadeEffect 1s; }p.support-cont {font-size: 14px;font-weight: 500;color: #646970;}#support{margin-top: 1em;} @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }</style>
520
 
521
  <div class="wrap">
522
  <h1>Super Progressive Web Apps <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
525
  <?php
526
  // Output nonce, action, and option_page fields for a settings page.
527
  settings_fields( 'superpwa_settings_group' );
528
+ $addon_page = admin_url( 'admin.php?page=superpwa-addons');
529
  ?>
530
  <div class="spwa-tab">
531
+ <a id="spwa-default" class="spwa-tablinks" data-href="no" href="#general-settings" onclick="openCity(event, 'settings')">Settings</a>
532
+ <a class="spwa-tablinks" id="spwa-feature" href="<?php echo $addon_page; ?>" data-href="yes">Add-ons (Features)</a>
533
+ <a class="spwa-tablinks" id="spwa-advance" href="#advance-settings" onclick="openCity(event, 'advance')" data-href="no">Advanced</a>
534
+ <a class="spwa-tablinks" id="spwa-support" href="#support-settings" onclick="openCity(event, 'support')" data-href="no">Help & Support</a>
535
  </div>
536
+ <span id="alert-warning" style=" margin-top: 10px; display: none; padding: 10px;background-color: #ff9800;color: white;"> Please Save the settings before moving to other tabs </span>
537
  <div id="settings" class="spwa-tabcontent">
538
  <?php
539
  // Basic Application Settings
561
  }
562
  ?>
563
  </div>
564
+ <div id="support" class="spwa-tabcontent">
565
+
566
+ <?php
567
+ //1)Docs 2)Find new or whats new in superpwa(Blog Post Link)
568
+ //3)Technical issue (supportLink) 4)Report a Bug(Support Link)
569
+
570
+ ?>
571
+ <h1>1) Documentation</h1>
572
+ <p class="support-cont">All the documents regarding SuperPWA Setup, it's settings detail and also about add-ons setup all you can go through this <b><a href="https://superpwa.com/docs/" target="_blank">Docs link</a></b></p>
573
+
574
+ <h1>2) What's New</h1>
575
+ <p class="support-cont">We will be continuously working on new features whereas also fixing the bugs and at the sametime releasing new feature add-ons, So to catch all those things just check this link <b><a href="https://superpwa.com/blog/" target="_blank">What's new in SuperPWA</a></b></p>
576
+
577
+ <h1>3) Technical Issue</h1>
578
+ <p class="support-cont">If you are facing any issues or unable to Setup, you can directly connect us using this link <b><a href="https://superpwa.com/contact/" target="_blank">Contact us</a></b></p>
579
+
580
+ <h1>4) Report a Bug</h1>
581
+ <p class="support-cont">If you found any bug or having issues with any third party plugins you can contact us <b><a href="https://superpwa.com/contact/" target="_blank">Bug Report</a></b></p>
582
+ </div>
583
  </form>
584
  </div>
585
+ <?php superpwa_newsletter_form(); ?>
586
+ <script type="text/javascript">function openCity(evt, cityName) {var i, tabcontent, tablinks;tabcontent = document.getElementsByClassName("spwa-tabcontent");for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("spwa-tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; }
587
+ var url = window.location.href;
588
+ if(url.indexOf('#advance-settings') > -1){
589
+ document.getElementById("spwa-advance").click();
590
+ }else if(url.indexOf('#support-settings') > -1){
591
+ document.getElementById("spwa-support").click();
592
+ }else{
593
+ document.getElementById("spwa-default").click();
594
+ }
595
+ </script>
596
  <?php
597
  }
admin/basic-setup.php CHANGED
@@ -36,6 +36,9 @@ if ( ! defined('ABSPATH') ) exit;
36
  * @since 1.6 Added checks for multisite compatibility.
37
  */
38
  function superpwa_activate_plugin( $network_active ) {
 
 
 
39
 
40
  // Not network active i.e. plugin is activated on a single install (normal WordPress install) or a single site on a multisite network
41
  if ( ! $network_active ) {
@@ -48,6 +51,7 @@ function superpwa_activate_plugin( $network_active ) {
48
 
49
  // If we are here, then plugin is network activated on a multisite. Set transient for activation notice on network admin.
50
  set_transient( 'superpwa_network_admin_notice_activation', true, 60 );
 
51
  }
52
  register_activation_hook( SUPERPWA_PATH_ABS . 'superpwa.php', 'superpwa_activate_plugin' );
53
 
36
  * @since 1.6 Added checks for multisite compatibility.
37
  */
38
  function superpwa_activate_plugin( $network_active ) {
39
+
40
+ // Adding option to show/hide newsletter form
41
+ add_option( 'superpwa_hide_newsletter', 'no' );
42
 
43
  // Not network active i.e. plugin is activated on a single install (normal WordPress install) or a single site on a multisite network
44
  if ( ! $network_active ) {
51
 
52
  // If we are here, then plugin is network activated on a multisite. Set transient for activation notice on network admin.
53
  set_transient( 'superpwa_network_admin_notice_activation', true, 60 );
54
+
55
  }
56
  register_activation_hook( SUPERPWA_PATH_ABS . 'superpwa.php', 'superpwa_activate_plugin' );
57
 
admin/js/main.js CHANGED
@@ -1,5 +1,8 @@
 
1
  jQuery(document).ready(function($){
2
  $('.superpwa-colorpicker').wpColorPicker(); // Color picker
 
 
3
  $('.superpwa-icon-upload').click(function(e) { // Application Icon upload
4
  e.preventDefault();
5
  var superpwa_meda_uploader = wp.media({
@@ -48,6 +51,15 @@ jQuery(document).ready(function($){
48
  );
49
  return true;
50
  });
 
 
 
 
 
 
 
 
 
51
  //Hide superPWA other menus
52
  $('#toplevel_page_superpwa').find('ul').find('li').each(function(v, i){
53
  arr = ['superpwa', 'settings', 'add-ons', 'license', 'upgrade to pro'];
@@ -161,4 +173,49 @@ function superpwaGetZip() {
161
  processData: false
162
  })
163
  });
164
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var changes = false;
2
  jQuery(document).ready(function($){
3
  $('.superpwa-colorpicker').wpColorPicker(); // Color picker
4
+ $('.superpwa-colorpicker').wpColorPicker('option','change',function(event, ui) {
5
+ changes = true;}); // When Color picker changes
6
  $('.superpwa-icon-upload').click(function(e) { // Application Icon upload
7
  e.preventDefault();
8
  var superpwa_meda_uploader = wp.media({
51
  );
52
  return true;
53
  });
54
+ $('.superpwa_newsletter_hide').click(function(e){
55
+ //e.preventDefault();
56
+ jQuery('.superpwa-newsletter-wrapper').css("display", "none");
57
+ var form = jQuery(this);
58
+ jQuery.post(ajaxurl, {action:'superpwa_newsletter_hide_form'},
59
+ function(data) {}
60
+ );
61
+ return true;
62
+ });
63
  //Hide superPWA other menus
64
  $('#toplevel_page_superpwa').find('ul').find('li').each(function(v, i){
65
  arr = ['superpwa', 'settings', 'add-ons', 'license', 'upgrade to pro'];
173
  processData: false
174
  })
175
  });
176
+ }
177
+
178
+ // Settings unsaved alert message
179
+ var tablinks,select_tag,input_tag,button_tag;
180
+ tablinks = document.getElementsByClassName("spwa-tablinks");
181
+ select_tag = document.getElementsByTagName("select");
182
+ input_tag = document.getElementsByTagName("input");
183
+ button_tag = document.getElementsByTagName("button");
184
+
185
+ if(input_tag){
186
+ for(var h=0; h<input_tag.length;h++ ){
187
+ input_tag[h].addEventListener( 'change', function(e) {
188
+ console.log(changes);
189
+ changes = true;
190
+ console.log(changes);
191
+ });
192
+ }
193
+ }
194
+ if(select_tag){
195
+ for(var j=0; j<select_tag.length;j++ ){
196
+ select_tag[j].addEventListener( 'change', function(e) {
197
+ changes = true;
198
+ });
199
+ }
200
+ }
201
+ if(button_tag){
202
+ for(var k=0; k<button_tag.length;k++ ){
203
+ button_tag[k].addEventListener( 'click', function(e) {
204
+ changes = true;
205
+ });
206
+ }
207
+ }
208
+
209
+ if(tablinks){
210
+ for(var l=0; l<tablinks.length;l++ ){
211
+ tablinks[l].addEventListener( 'click', function(e) {
212
+
213
+ if(changes){
214
+ window.onbeforeunload = function(e) {
215
+ return "Sure you want to leave?";
216
+ };
217
+ }
218
+
219
+ });
220
+ }
221
+ }
functions/common.php CHANGED
@@ -240,4 +240,79 @@ function superpwa_get_bloginfo( $file = 'sw' ) {
240
  }
241
 
242
  return get_bloginfo( 'url' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
240
  }
241
 
242
  return get_bloginfo( 'url' );
243
+ }
244
+ /**
245
+ * Returns Superpwa setting tabs html
246
+ */
247
+ function superpwa_setting_tabs_html(){
248
+
249
+ $general_settings = admin_url( 'admin.php?page=superpwa#general-settings');
250
+ $advance_settings = admin_url( 'admin.php?page=superpwa#advance-settings');
251
+ $support_settings = admin_url( 'admin.php?page=superpwa#support-settings');
252
+ $addon_page = admin_url( 'admin.php?page=superpwa-addons');
253
+ ?>
254
+ <div class="spwa-tab">
255
+ <a id="spwa-default" class="spwa-tablinks" href="<?php echo esc_url_raw($general_settings); ?>" data-href="yes">Settings</a>
256
+ <a class="spwa-tablinks active" href="<?php echo esc_url_raw($addon_page); ?>" data-href="yes">Add-ons (Features)</a>
257
+ <a class="spwa-tablinks" href="<?php echo esc_url_raw($advance_settings); ?>" data-href="yes">Advanced</a>
258
+ <a class="spwa-tablinks" href="<?php echo esc_url_raw($support_settings); ?>" data-href="yes">Help & Support</a>
259
+ </div>
260
+ <?php
261
+ }
262
+ /**
263
+ * Returns Superpwa Setting tabs Styles
264
+ */
265
+ function superpwa_setting_tabs_styles(){
266
+ ?>
267
+ <style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;margin-bottom: 20px;}.spwa-tab a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.spwa-tab a:hover {color: #0a4b78;}.spwa-tab a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.spwa-tab a:focus {box-shadow: none;outline: none;}.spwa-tabcontent {display: none;padding: 6px 12px;border-top: none; animation: fadeEffect 1s; } @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }</style>
268
+ <?php
269
+ }
270
+ /**
271
+ * Returns Superpwa Setting Newsletter Forms
272
+ */
273
+ function superpwa_newsletter_form(){
274
+
275
+ $hide_form = get_option('superpwa_hide_newsletter');
276
+
277
+ // Newsletter marker. Set this to false once newsletter subscription is displayed.
278
+ $superpwa_newsletter = true;
279
+
280
+ if ( $superpwa_newsletter === true && $hide_form !== 'yes') { ?>
281
+ <div class="superpwa-newsletter-wrapper">
282
+ <div class="plugin-card plugin-card-superpwa-newsletter" style="background: #fdfc35 url('<?php echo SUPERPWA_PATH_SRC . 'admin/img/email.png'; ?>') no-repeat right top;">
283
+
284
+ <div class="plugin-card-top" style="min-height: 135px;">
285
+ <span class="dashicons dashicons-dismiss superpwa_newsletter_hide" style="float: right;cursor: pointer;"></span>
286
+ <span style="clear:both;"></span>
287
+ <div class="name column-name" style="margin: 0px 10px;">
288
+ <h3><?php _e( 'SuperPWA Newsletter', 'super-progressive-web-apps' ); ?></h3>
289
+ </div>
290
+ <div class="desc column-description" style="margin: 0px 10px;">
291
+ <p><?php _e( 'Learn more about Progressive Web Apps and get latest updates about SuperPWA', 'super-progressive-web-apps' ); ?></p>
292
+ </div>
293
+
294
+ <div class="superpwa-newsletter-form" style="margin: 18px 10px 0px;">
295
+
296
+ <form method="post" action="https://superpwa.com/newsletter/" target="_blank" id="superpwa_newsletter">
297
+ <fieldset>
298
+ <input name="newsletter-email" value="<?php $user = wp_get_current_user(); echo esc_attr( $user->user_email ); ?>" placeholder="<?php _e( 'Enter your email', 'super-progressive-web-apps' ); ?>" style="width: 60%; margin-left: 0px;" type="email">
299
+ <input name="source" value="superpwa-plugin" type="hidden">
300
+ <input type="submit" class="button" value="<?php _e( 'Subscribe', 'super-progressive-web-apps' ); ?>" style="background: linear-gradient(to right, #fdfc35, #ffe258) !important; box-shadow: unset;">
301
+ <span class="superpwa_newsletter_hide" style="box-shadow: unset;cursor: pointer;margin-left: 10px;">
302
+ <?php _e( 'No thanks', 'super-progressive-web-apps' ); ?>
303
+ </span>
304
+ <small style="display:block; margin-top:8px;"><?php _e( 'we\'ll share our <code>root</code> password before we share your email with anyone else.', 'super-progressive-web-apps' ); ?></small>
305
+
306
+ </fieldset>
307
+ </form>
308
+
309
+ </div>
310
+
311
+ </div>
312
+
313
+ </div>
314
+ </div>
315
+ <?php }
316
+ // Set newsletter marker to false
317
+ $superpwa_newsletter = false;
318
  }
readme.txt CHANGED
@@ -186,6 +186,10 @@ Feel free to get in touch if you have any questions.
186
 
187
  == Changelog ==
188
 
 
 
 
 
189
  = 2.1.13 =
190
  * Date: [15.June.2021](https://superpwa.com/superpwa-2-1-13-release-note/?utm_source=wordpress.org&utm_medium=changelog)
191
  BugFixed: iOS Splash Screen Images are not getting saved #191
186
 
187
  == Changelog ==
188
 
189
+ = 2.1.14 =
190
+ * Date: [30.June.2021](https://superpwa.com/superpwa-2-1-14-release-note/?utm_source=wordpress.org&utm_medium=changelog)
191
+ Enhancement: Need to Improve Admin UI #196
192
+
193
  = 2.1.13 =
194
  * Date: [15.June.2021](https://superpwa.com/superpwa-2-1-13-release-note/?utm_source=wordpress.org&utm_medium=changelog)
195
  BugFixed: iOS Splash Screen Images are not getting saved #191
superpwa.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: SuperPWA
7
  * Author URI: https://profiles.wordpress.org/superpwa/
8
  * Contributors: SuperPWA
9
- * Version: 2.1.13
10
  * Text Domain: super-progressive-web-apps
11
  * Domain Path: /languages
12
  * License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@@ -43,7 +43,7 @@ if ( ! defined('ABSPATH') ) exit;
43
  * @since 1.0
44
  */
45
  if ( ! defined( 'SUPERPWA_VERSION' ) ) {
46
- define( 'SUPERPWA_VERSION' , '2.1.13' );
47
  }
48
 
49
  /**
6
  * Author: SuperPWA
7
  * Author URI: https://profiles.wordpress.org/superpwa/
8
  * Contributors: SuperPWA
9
+ * Version: 2.1.14
10
  * Text Domain: super-progressive-web-apps
11
  * Domain Path: /languages
12
  * License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
43
  * @since 1.0
44
  */
45
  if ( ! defined( 'SUPERPWA_VERSION' ) ) {
46
+ define( 'SUPERPWA_VERSION' , '2.1.14' );
47
  }
48
 
49
  /**