From 77ae2fccde3d4b7de3a7c726a441f0d6003ef8be Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 5 May 2018 17:18:16 +0530 Subject: [PATCH 01/58] Version bump to 1.8 again --- readme.txt | 3 +++ superpwa.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 6b0a50e..a9c2bcd 100644 --- a/readme.txt +++ b/readme.txt @@ -146,6 +146,9 @@ PWA's require browsers with support for service workers and for iOS devices, sup == Changelog == += 1.8 = +* Date: + = 1.7.1 = * Date: 05.May.2018 * Bug Fix: Fix fatal error in PHP versions prior to PHP 5.5. "Cant use function return value in write context". diff --git a/superpwa.php b/superpwa.php index af33306..4df06a4 100644 --- a/superpwa.php +++ b/superpwa.php @@ -6,7 +6,7 @@ * Author: SuperPWA * Author URI: https://superpwa.com * Contributors: Arun Basil Lal, Jose Varghese - * Version: 1.7.1 + * Version: 1.8 * Text Domain: super-progressive-web-apps * Domain Path: /languages * License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html @@ -43,7 +43,7 @@ * @since 1.6 Depreciated constants for multisite compatibility: SUPERPWA_MANIFEST_FILENAME, SUPERPWA_MANIFEST_ABS, SUPERPWA_MANIFEST_SRC * @since 1.6 Depreciated constants for multisite compatibility: SUPERPWA_SW_FILENAME, SUPERPWA_SW_ABS, SUPERPWA_SW_SRC */ -if ( ! defined( 'SUPERPWA_VERSION' ) ) define( 'SUPERPWA_VERSION' , '1.7.1' ); // SuperPWA current version +if ( ! defined( 'SUPERPWA_VERSION' ) ) define( 'SUPERPWA_VERSION' , '1.8' ); // SuperPWA current version if ( ! defined( 'SUPERPWA_PATH_ABS' ) ) define( 'SUPERPWA_PATH_ABS' , plugin_dir_path( __FILE__ ) ); // Absolute path to the plugin directory. eg - /var/www/html/wp-content/plugins/super-progressive-web-apps/ if ( ! defined( 'SUPERPWA_PATH_SRC' ) ) define( 'SUPERPWA_PATH_SRC' , plugin_dir_url( __FILE__ ) ); // Link to the plugin folder. eg - http://example.com/wp/wp-content/plugins/super-progressive-web-apps/ From 4d452cba193e70353add81da64d00ea213fad93e Mon Sep 17 00:00:00 2001 From: Jose Varghese <34977009+josevarghese@users.noreply.github.com> Date: Sun, 6 May 2018 00:40:13 +0530 Subject: [PATCH 02/58] added UTM's for links pointed to SuperPWA website --- README.MD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.MD b/README.MD index d7c72c7..3be9194 100644 --- a/README.MD +++ b/README.MD @@ -21,7 +21,7 @@ SuperPWA helps to convert your WordPress website into Progressive Web Apps easily.

- Visit Website » + Visit Website »

Report bug @@ -57,14 +57,14 @@ ## Welcome to the Super PWA GitHub repository -⚡️ Demo : superpwa.com +⚡️ Demo : superpwa.com ## What is Progressive Web Apps Progressive Web Apps (PWA) is a new technology that creates a middle ground between a website and a mobile app. They are installed on the phone like a normal app (web app) and can be accessed from the home screen. Users can come back to your website by launching the app from their home screen and interact with your website through an app-like interface. Your return visitors will experience almost-instant loading times and enjoy the great performance benefits of your PWA! -Super Progressive Web Apps makes it easy for you to convert your WordPress website into a Progressive Web App easily! +Super Progressive Web Apps makes it easy for you to convert your WordPress website into a Progressive Web App easily! ## 🏗 Installation Once SuperPWA ⚡️ is installed, users browsing your website from a supported mobile device will see a "Add To Home Screen" notice (from the bottom of the screen) and will be able to 'install your website' on the home screen of their device. Every page visited is stored locally on their device and will be available to read even when they are offline! @@ -96,7 +96,7 @@ Here are the current features of Super Progressive Web Apps: * New in version 1.4: You can now set the theme_color property in the manifest. * New in version 1.5: OneSignal integration for Push notifications. * New in version 1.6: WordPress Multisite Network compatibility. -* New in version 1.7: Add-Ons for SuperPWA is here! Ships with [UTM Tracking Add-On](https://superpwa.com/addons/utm-tracking/?utm_source=github&utm_medium=readme) to track visits coming from your PWA. +* New in version 1.7: Add-Ons for SuperPWA is here! Ships with [UTM Tracking Add-On](https://superpwa.com/addons/utm-tracking/?utm_source=github&utm_medium=readme-version) to track visits coming from your PWA. #### 🔮 Upcoming features: * Offline Indicator Notice. From fb04ea2ce1c9ac256cb1ec59178b690c72a333e9 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Mon, 7 May 2018 00:33:52 +0530 Subject: [PATCH 03/58] Minor update to inline documentation --- admin/admin-setup.php | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/admin-setup.php b/admin/admin-setup.php index 7d08625..86df73d 100644 --- a/admin/admin-setup.php +++ b/admin/admin-setup.php @@ -7,6 +7,7 @@ * @function superpwa_register_settings Register Settings * @function superpwa_validater_and_sanitizer() Validate And Sanitize User Input Before Its Saved To Database * @function superpwa_get_settings() Get settings from database + * @function superpwa_enqueue_css_js() Enqueue CSS and JS * @function superpwa_after_save_settings_todo() Todo list after saving admin options * @function superpwa_footer_text() Admin footer text * @function superpwa_footer_version() Admin footer version From ba3bd98e343d0da1d79c30ac878a7abc45a265c5 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Mon, 7 May 2018 01:26:27 +0530 Subject: [PATCH 04/58] Added UTM tracking parameters to plugin_row_meta --- admin/basic-setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index b551222..34343a7 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -239,7 +239,7 @@ function superpwa_plugin_row_meta( $links, $file ) { if ( strpos( $file, 'superpwa.php' ) !== false ) { $new_links = array( - 'demo' => '' . __( 'Demo', 'super-progressive-web-apps' ) . '', + 'demo' => '' . __( 'Demo', 'super-progressive-web-apps' ) . '', ); $links = array_merge( $links, $new_links ); } From bf5aec58644d0a2d2324e7b87d7d6c7365d87a1c Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Fri, 11 May 2018 10:38:01 +0530 Subject: [PATCH 05/58] Removed CSS ID for setting input description --- addons/utm-tracking.php | 2 +- admin/admin-ui-render-settings.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/utm-tracking.php b/addons/utm-tracking.php index 8dc066a..45e658a 100644 --- a/addons/utm-tracking.php +++ b/addons/utm-tracking.php @@ -260,7 +260,7 @@ function superpwa_utm_tracking_source_cb() { -

+

superpwa', 'super-progressive-web-apps' ); ?>

diff --git a/admin/admin-ui-render-settings.php b/admin/admin-ui-render-settings.php index e36d865..7d52779 100644 --- a/admin/admin-ui-render-settings.php +++ b/admin/admin-ui-render-settings.php @@ -56,7 +56,7 @@ function superpwa_app_short_name_cb() { -

+

12 characters or less.', 'super-progressive-web-apps'); ?>

@@ -79,7 +79,7 @@ function superpwa_description_cb() { -

+

@@ -104,7 +104,7 @@ function superpwa_app_icon_cb() { Choose Icon -

+

PNG image exactly 192x192 in size.', 'super-progressive-web-apps'); ?>

@@ -127,7 +127,7 @@ function superpwa_splash_icon_cb() { Choose Icon -

+

PNG image exactly 512x512 in size.', 'super-progressive-web-apps'); ?>

@@ -147,7 +147,7 @@ function superpwa_background_color_cb() { -

+

@@ -167,7 +167,7 @@ function superpwa_theme_color_cb() { -

+

Background Color.', 'super-progressive-web-apps'); ?>

@@ -197,7 +197,7 @@ function superpwa_start_url_cb() { )); ?> -

+

%s', 'super-progressive-web-apps' ), superpwa_get_start_url() ); ?>

@@ -211,7 +211,7 @@ function superpwa_start_url_cb() { -

+

@@ -244,7 +244,7 @@ function superpwa_offline_page_cb() { )); ?> -

+

%s', 'super-progressive-web-apps' ), get_permalink($settings['offline_page']) ? get_permalink( $settings['offline_page'] ) : get_bloginfo( 'wpurl' ) ); ?>

@@ -276,7 +276,7 @@ function superpwa_orientation_cb() { -

+

Follow Device Orientation your app will rotate as the device is rotated.', 'super-progressive-web-apps' ); ?>

From 8dc8f39bf31f5e7d2ceb0fac3de5b6288a1337bb Mon Sep 17 00:00:00 2001 From: Jose Varghese <34977009+josevarghese@users.noreply.github.com> Date: Sat, 12 May 2018 11:00:41 +0530 Subject: [PATCH 06/58] Opera supporting PWA --- README.MD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.MD b/README.MD index 3be9194..7800367 100644 --- a/README.MD +++ b/README.MD @@ -102,10 +102,10 @@ Here are the current features of Super Progressive Web Apps: * Offline Indicator Notice. ### Device and Browser Support For PWA - | Chrome Chrome | Firefox Firefox | Safari Safari | Edge Edge | Edge Edge (Mobile) | Opera Mini | Samsung Internet | Brave | + | Chrome Chrome | Firefox Firefox | Safari Safari | Edge Edge | Edge Edge (Mobile) | Opera | Samsung Internet | Brave | | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | -| Yes | Yes | Partially | Beta | Yes | No | Yes | Yes | -| 57+ | 57+ | 11.3+ | 17 ships | 1.0.0.1921 | - | 6.2+ | 1.0.44+ +| Yes | Yes | Partially | Beta | Yes | Yes | Yes | Yes | +| 57+ | 57+ | 11.3+ | 17 ships | 1.0.0.1921 | 33+ | 6.2+ | 1.0.44+ Progressive web apps need browsers that support manifests and service workers. Currently Google Chrome (version 57+), Chrome for Android (62), Mozilla Firefox (57), Firefox for Android (58) are the major browsers that support PWA. From 618cd1816445eb9f63f3cd1fe4f092c28df3c42a Mon Sep 17 00:00:00 2001 From: Jose Varghese <34977009+josevarghese@users.noreply.github.com> Date: Sun, 13 May 2018 11:07:58 +0530 Subject: [PATCH 07/58] Updating Supported Browsers with more fields --- README.MD | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.MD b/README.MD index 7800367..e0c18e9 100644 --- a/README.MD +++ b/README.MD @@ -102,10 +102,30 @@ Here are the current features of Super Progressive Web Apps: * Offline Indicator Notice. ### Device and Browser Support For PWA - | Chrome Chrome | Firefox Firefox | Safari Safari | Edge Edge | Edge Edge (Mobile) | Opera | Samsung Internet | Brave | -| :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | -| Yes | Yes | Partially | Beta | Yes | Yes | Yes | Yes | -| 57+ | 57+ | 11.3+ | 17 ships | 1.0.0.1921 | 33+ | 6.2+ | 1.0.44+ + | | Chrome Chrome | Firefox Firefox | Edge Edge | Opera Opera | Safari Safari |Samsung Samsung | UC Browser UC Browser | Brave Brave | +| :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | :---------: | +| Add to Home Screen | Yes | Supported | Beta or Partial Support | Supported | Beta or Partial Support | Supported | Supported | Supported | +| Service Workers | Yes | Supported | Supported | Supported | Supported | Supported | Supported | Supported | +| Web Push & Notifications| Yes | Supported | Supported | Supported | Beta or Partial Support | Supported | Supported | Supported | +| Payment Request API | Yes | In Development | Supported | In Development | Supported | Supported | - | - | +| Meta Theme Color | Yes | - | - | - | - | Yes | - | Yes | + +
+ +

+ Supported Supported +  +  +  +  + Beta or Partial Support Beta or Partial Support +  +  +  +  + In Development In Development +

+ Progressive web apps need browsers that support manifests and service workers. Currently Google Chrome (version 57+), Chrome for Android (62), Mozilla Firefox (57), Firefox for Android (58) are the major browsers that support PWA. From 51bce7352541ecd8e38381902b46648bdebb6a61 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sun, 13 May 2018 17:27:57 +0530 Subject: [PATCH 08/58] Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. --- admin/basic-setup.php | 6 +++--- readme.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 34343a7..1684541 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -67,7 +67,7 @@ function superpwa_admin_notice_activation() { $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready with the default settings. ' : ''; - echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →', 'super-progressive-web-apps' ), admin_url( 'options-general.php?page=superpwa' ) ) . '

'; + echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; // Delete transient delete_transient( 'superpwa_admin_notice_activation' ); @@ -88,7 +88,7 @@ function superpwa_network_admin_notice_activation() { $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready on the main website with the default settings. ' : ''; - echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →
Note: manifest and service worker for the individual websites will be generated on the first visit to the respective WordPress admin.', 'super-progressive-web-apps' ), admin_url( 'options-general.php?page=superpwa' ) ) . '

'; + echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →
Note: manifest and service worker for the individual websites will be generated on the first visit to the respective WordPress admin.', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; // Delete transient delete_transient( 'superpwa_network_admin_notice_activation' ); @@ -223,7 +223,7 @@ function superpwa_settings_link( $links ) { return array_merge( array( - 'settings' => '' . __( 'Settings', 'super-progressive-web-apps' ) . '' + 'settings' => '' . __( 'Settings', 'super-progressive-web-apps' ) . '' ), $links ); diff --git a/readme.txt b/readme.txt index a9c2bcd..c34cec8 100644 --- a/readme.txt +++ b/readme.txt @@ -148,6 +148,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: +* Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = * Date: 05.May.2018 From 162f57f3da7fdfb5c03ca8a71bf2bd89b9472ea6 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sun, 13 May 2018 22:27:47 +0530 Subject: [PATCH 09/58] Increased transient lengths of the activation notices to 60 seconds If activation took more than 5 seconds for some reason, the notice was never displayed and the transient was never deleted. SuperPWA does not leave anything behind, even expired transients. are deleted. --- admin/basic-setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 1684541..cf82483 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -43,13 +43,13 @@ function superpwa_activate_plugin( $network_active ) { if ( ! $network_active ) { // Set transient for single site activation notice - set_transient( 'superpwa_admin_notice_activation', true, 5 ); + set_transient( 'superpwa_admin_notice_activation', true, 60 ); return; } // If we are here, then plugin is network activated on a multisite. Set transient for activation notice on network admin. - set_transient( 'superpwa_network_admin_notice_activation', true, 5 ); + set_transient( 'superpwa_network_admin_notice_activation', true, 60 ); } register_activation_hook( SUPERPWA_PATH_ABS . 'superpwa.php', 'superpwa_activate_plugin' ); From e9506b1cfb0770212bd84d524741d4c877fba055 Mon Sep 17 00:00:00 2001 From: Jose Varghese <34977009+josevarghese@users.noreply.github.com> Date: Mon, 14 May 2018 00:55:15 +0530 Subject: [PATCH 10/58] README.MD updated with Star the repo gif utm for logo also added --- README.MD | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index e0c18e9..82587e5 100644 --- a/README.MD +++ b/README.MD @@ -11,8 +11,8 @@

- - + + Super Progressive Web Apps

Super Progressive Web Apps

@@ -66,6 +66,13 @@ Users can come back to your website by launching the app from their home screen Super Progressive Web Apps makes it easy for you to convert your WordPress website into a Progressive Web App easily! +## Support the project ⭐ +If you feel super excited and want to support us in a small way, please consider starring and/or sharing the repo! This helps us getting known and grow the community. + +Chrome + +Also you can support us via [following on social media's and share about us](#share-via-social-medias-and-spread-superpwa). + ## 🏗 Installation Once SuperPWA ⚡️ is installed, users browsing your website from a supported mobile device will see a "Add To Home Screen" notice (from the bottom of the screen) and will be able to 'install your website' on the home screen of their device. Every page visited is stored locally on their device and will be available to read even when they are offline! From 8be63eadbcb9d8c439b48b15614843d67e8559be Mon Sep 17 00:00:00 2001 From: Jose Varghese <34977009+josevarghese@users.noreply.github.com> Date: Mon, 14 May 2018 01:05:28 +0530 Subject: [PATCH 11/58] emoji position changed --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 82587e5..1005bf8 100644 --- a/README.MD +++ b/README.MD @@ -66,7 +66,7 @@ Users can come back to your website by launching the app from their home screen Super Progressive Web Apps makes it easy for you to convert your WordPress website into a Progressive Web App easily! -## Support the project ⭐ +## ⭐ Support the project If you feel super excited and want to support us in a small way, please consider starring and/or sharing the repo! This helps us getting known and grow the community. Chrome From 14cf40b1f8f8bef4cf4382b937ba8e41aad4900b Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 00:30:40 +0530 Subject: [PATCH 12/58] Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. --- public/js/register-sw.js | 1 + readme.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/public/js/register-sw.js b/public/js/register-sw.js index dd7fa27..1939e7c 100644 --- a/public/js/register-sw.js +++ b/public/js/register-sw.js @@ -3,5 +3,6 @@ if ('serviceWorker' in navigator) { navigator.serviceWorker.register(superpwa_sw.url) .then(function(registration) { console.log('SuperPWA service worker ready'); registration.update(); }) .catch(function(error) { console.log('Registration failed with ' + error); }); + window.addEventListener('beforeinstallprompt', (e) => { e.prompt(); }); }); } \ No newline at end of file diff --git a/readme.txt b/readme.txt index c34cec8..b75d71b 100644 --- a/readme.txt +++ b/readme.txt @@ -148,6 +148,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: +* Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = From 53febf433910f1daee0c9372461e37baa002bf96 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 00:43:02 +0530 Subject: [PATCH 13/58] New filter: Filter neverCacheUrls with superpwa_sw_never_cache_urls --- public/sw.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sw.php b/public/sw.php index e4f5dfb..84732d3 100644 --- a/public/sw.php +++ b/public/sw.php @@ -105,7 +105,7 @@ function superpwa_sw_template() { const offlinePage = ''; const fallbackImage = ''; const filesToCache = [startPage, offlinePage, fallbackImage]; -const neverCacheUrls = [/\/wp-admin/,/\/wp-login/,/preview=true/]; +const neverCacheUrls = []; // Install self.addEventListener('install', function(e) { From 31a04aa2dca6f5f7a21fe8a42f6a9871b31c1103 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 00:52:52 +0530 Subject: [PATCH 14/58] Minor code standard improvement --- public/sw.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sw.php b/public/sw.php index 84732d3..d104f3c 100644 --- a/public/sw.php +++ b/public/sw.php @@ -105,7 +105,7 @@ function superpwa_sw_template() { const offlinePage = ''; const fallbackImage = ''; const filesToCache = [startPage, offlinePage, fallbackImage]; -const neverCacheUrls = []; +const neverCacheUrls = []; // Install self.addEventListener('install', function(e) { From e73d3940c11760ec031576ff68544c8f4575bf7a Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 01:03:38 +0530 Subject: [PATCH 15/58] UTM Tracking add-on: UI documentation improvement Helps take care of these questions hopefully - https://wordpress.org/support/topic/how-to-check-traffic-of-the-utm-source/#post-10268748 --- addons/utm-tracking.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/utm-tracking.php b/addons/utm-tracking.php index 45e658a..d1debba 100644 --- a/addons/utm-tracking.php +++ b/addons/utm-tracking.php @@ -231,7 +231,7 @@ function superpwa_utm_tracking_section_cb() { // Get add-on info $addon_utm_tracking = superpwa_get_addons( 'utm_tracking' ); - printf( '

' . __( 'Add UTM campaign parameters to the Start Page URL in your manifest. This will help you identify visitors coming specifically from your app. Read more about UTM Tracking.', 'super-progressive-web-apps' ) . '

', superpwa_manifest( 'src' ), $addon_utm_tracking['link'] . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings' ); + printf( '

' . __( 'This add-on automatically adds UTM campaign parameters to the Start Page URL in your manifest. This will help you identify visitors coming specifically from your app. Read more about UTM Tracking.', 'super-progressive-web-apps' ) . '

', superpwa_manifest( 'src' ), $addon_utm_tracking['link'] . '?utm_source=superpwa-plugin&utm_medium=utm-tracking-settings' ); } /** @@ -261,7 +261,7 @@ function superpwa_utm_tracking_source_cb() {

- superpwa', 'super-progressive-web-apps' ); ?> + superpwa. The remaining fields are optional.', 'super-progressive-web-apps' ); ?>

Date: Tue, 15 May 2018 01:10:21 +0530 Subject: [PATCH 16/58] admin-setup.php renamed to admin-ui-setup.php I was always getting confused with basic-setup.php and admin-setup.php basic-setup.php - Everything for plugin basic operations like activation, plugins page action links etc. admin-ui-setup.php - Everything related to the plugins settings page goes here including admin footer text and version. --- admin/{admin-setup.php => admin-ui-setup.php} | 0 loader.php | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename admin/{admin-setup.php => admin-ui-setup.php} (100%) diff --git a/admin/admin-setup.php b/admin/admin-ui-setup.php similarity index 100% rename from admin/admin-setup.php rename to admin/admin-ui-setup.php diff --git a/loader.php b/loader.php index c2d3ee1..ff3e8c7 100644 --- a/loader.php +++ b/loader.php @@ -10,7 +10,7 @@ // Load admin require_once( SUPERPWA_PATH_ABS . 'admin/basic-setup.php' ); -require_once( SUPERPWA_PATH_ABS . 'admin/admin-setup.php' ); +require_once( SUPERPWA_PATH_ABS . 'admin/admin-ui-setup.php' ); require_once( SUPERPWA_PATH_ABS . 'admin/admin-ui-render-settings.php' ); require_once( SUPERPWA_PATH_ABS . 'admin/admin-ui-render-addons.php' ); From e4467e7937109c49bb640329fa473081fb4ecc2e Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 21:42:09 +0530 Subject: [PATCH 17/58] Code standards improvement Remy Perona standards ;) --- functions/filesystem.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/functions/filesystem.php b/functions/filesystem.php index d544765..cbd5d3b 100644 --- a/functions/filesystem.php +++ b/functions/filesystem.php @@ -3,6 +3,7 @@ * Filesystem Operations * * @since 1.0 + * * @function superpwa_wp_filesystem_init() Initialize the WP filesystem * @function superpwa_put_contents() Write to a file using WP_Filesystem() functions * @function superpwa_get_contents() Read contents of a file using WP_Filesystem() functions @@ -33,13 +34,15 @@ function superpwa_wp_filesystem_init() { * @param $file Filename with path * @param $content Contents to be written to the file. Default null * @return True on success, false if file isn't passed or if writing failed. + * * @since 1.0 */ function superpwa_put_contents( $file, $content = null ) { // Return false if no filename is provided - if ( empty( $file ) ) + if ( empty( $file ) ) { return false; + } // Initialize the WP filesystem superpwa_wp_filesystem_init(); @@ -56,23 +59,26 @@ function superpwa_put_contents( $file, $content = null ) { * Read contents of a file using WP_Filesystem() functions * * @param $file Filename with path. - * @paral $array Set true to return read data as an array. False by default. - * @return string|bool The function returns the read data or false on failure. + * @param $array Set true to return read data as an array. False by default. + * @return (string|bool) The function returns the read data or false on failure. + * * @since 1.0 */ function superpwa_get_contents( $file, $array = false ) { // Return false if no filename is provided - if ( empty( $file ) ) + if ( empty( $file ) ) { return false; + } // Initialize the WP filesystem superpwa_wp_filesystem_init(); global $wp_filesystem; // Reads entire file into a string - if ( $array == false ) + if ( $array == false ) { return $wp_filesystem->get_contents( $file ); + } // Reads entire file into an array return $wp_filesystem->get_contents_array( $file ); @@ -83,13 +89,15 @@ function superpwa_get_contents( $file, $array = false ) { * * @param $file Filename with path * @return bool True on success, false otherwise + * * @since 1.0 */ function superpwa_delete( $file ) { // Return false if no filename is provided - if ( empty( $file ) ) + if ( empty( $file ) ) { return false; + } // Initialize the WP filesystem superpwa_wp_filesystem_init(); From 4d6882ea7923d5fe55188e59e0de8b4774afdd64 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 22:45:43 +0530 Subject: [PATCH 18/58] Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. --- admin/admin-ui-render-addons.php | 115 +++++++++++++++++++++++-------- readme.txt | 1 + 2 files changed, 87 insertions(+), 29 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 43c49b6..b9b02c1 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -10,7 +10,8 @@ * @function superpwa_addons_button_text() Button text based on add-on status * @function superpwa_addons_button_link() Action URL based on add-on status * @function superpwa_addons_activator() Do bundled add-on activation and deactivation - * @function superpwa_addons_handle_activation() Handle add-on activation and deactivation + * @function superpwa_addons_handle_activation() Handle add-on activation + * @function superpwa_addons_handle_deactivation() Handle add-on deactivation */ // Exit if accessed directly @@ -23,10 +24,11 @@ * array( * 'addon-slug' => array( * 'name' => 'Add-On Name', - * 'type' => 'bundled | addon', * 'description' => 'Add-On description', + * 'type' => 'bundled | addon', * 'icon' => 'icon-for-addon-128x128.png', * 'link' => 'https://superpwa.com/addons/details-page-of-addon', + * 'admin_link' => admin_url( 'admin.php?page=superpwa-addon-admin-page' ), * 'superpwa_min_version' => '1.7' // min version of SuperPWA required to use the add-on. * ) * ); @@ -43,10 +45,11 @@ function superpwa_get_addons( $slug = false ) { $addons = array( 'utm_tracking' => array( 'name' => __( 'UTM Tracking', 'super-progressive-web-apps' ), - 'type' => 'bundled', 'description' => __( 'Track visits from your app by adding UTM tracking parameters to the Start Page URL.', 'super-progressive-web-apps' ), + 'type' => 'bundled', 'icon' => 'superpwa-128x128.png', 'link' => 'https://superpwa.com/addons/utm-tracking/', + 'admin_link' => admin_url( 'admin.php?page=superpwa-utm-tracking' ), 'superpwa_min_version' => '1.7', ), ); @@ -337,7 +340,7 @@ function superpwa_addons_button_link( $slug ) { } // Activation link for bundled add-ons. - return wp_nonce_url( admin_url( 'admin.php?page=superpwa-addons&addon=' . $slug ), 'activate', 'superpwa_addon_activate_nonce' ); + return wp_nonce_url( admin_url( 'admin-post.php?action=superpwa_activate_addon&addon=' . $slug ), 'activate', 'superpwa_addon_activate_nonce' ); break; @@ -350,7 +353,7 @@ function superpwa_addons_button_link( $slug ) { } // Deactivation link for bundled add-ons. - return wp_nonce_url( admin_url( 'admin.php?page=superpwa-addons&addon=' . $slug ), 'deactivate', 'superpwa_addon_deactivate_nonce' ); + return wp_nonce_url( admin_url( 'admin-post.php?action=superpwa_deactivate_addon&addon=' . $slug ), 'deactivate', 'superpwa_addon_deactivate_nonce' ); break; @@ -421,46 +424,100 @@ function superpwa_addons_activator( $slug, $status ) { } /** - * Handle add-on activation and deactivation + * Handle add-on activation * - * Verifies that the activation / deactivation request is valid and calls superpwa_addons_activator() + * Verifies that the activation request is valid and calls superpwa_addons_activator() * then redirects the page back to the add-ons page. * - * Hooked onto load-superpwa_page_superpwa-addons action hook and is called every time the add-ons page is loaded + * Hooked onto admin_post_superpwa_activate_addon action hook * * @param void * @return void * * @since 1.7 + * @since 1.8 Handles only activation. Used to handle both activation and deactivation. + * @since 1.8 Hooked onto admin_post_superpwa_activate_addon. Was hooked to load-superpwa_page_superpwa-addons before. */ function superpwa_addons_handle_activation() { + // Get the add-on status + $addon_status = superpwa_addons_status( $_GET['addon'] ); + // Authentication - if ( ! isset( $_GET['addon'] ) || ! current_user_can( 'manage_options' ) ) { - return; + if ( + ! current_user_can( 'manage_options' ) || + ! isset( $_GET['addon'] ) || + ! ( isset( $_GET['superpwa_addon_activate_nonce'] ) && wp_verify_nonce( $_GET['superpwa_addon_activate_nonce'], 'activate' ) ) || + ! ( $addon_status == 'inactive' ) + ) { + + // Return to referer if authentication fails. + wp_redirect( admin_url( 'admin.php?page=superpwa-addons' ) ); + exit; } + + // Get active add-ons + $active_addons = get_option( 'superpwa_active_addons', array() ); + + // Add the add-on to the list of active add-ons + $active_addons[] = $_GET['addon']; + + // Write settings back to database + update_option( 'superpwa_active_addons', $active_addons ); + + // Redirect back to add-ons sub-menu + wp_redirect( admin_url( 'admin.php?page=superpwa-addons&activated=1&addon=' . $_GET['addon'] ) ); + exit; +} +add_action( 'admin_post_superpwa_activate_addon', 'superpwa_addons_handle_activation' ); - // Handing add-on activation - if ( isset( $_GET['superpwa_addon_activate_nonce'] ) && isset( $_GET['addon'] ) && wp_verify_nonce( $_GET['superpwa_addon_activate_nonce'], 'activate' ) ) { +/** + * Handle add-on deactivation + * + * Verifies that the deactivation request is valid and calls superpwa_addons_activator() + * then redirects the page back to the add-ons page. + * + * Hooked onto admin_post_superpwa_activate_addon action hook. + * + * @param void + * @return void + * + * @since 1.8 + */ +function superpwa_addons_handle_deactivation() { + + // Get the add-on status + $addon_status = superpwa_addons_status( $_GET['addon'] ); + + // Authentication + if ( + ! current_user_can( 'manage_options' ) || + ! isset( $_GET['addon'] ) || + ! ( isset( $_GET['superpwa_addon_deactivate_nonce'] ) && wp_verify_nonce( $_GET['superpwa_addon_deactivate_nonce'], 'deactivate' ) ) || + ! ( $addon_status == 'active' ) + ) { - // Handling activation - if ( superpwa_addons_activator( $_GET['addon'], true ) === true ) { - - // Redirect to add-ons sub-menu - wp_redirect( admin_url( 'admin.php?page=superpwa-addons&activated=1&addon=' . $_GET['addon'] ) ); - exit; - } + // Return to referer if authentication fails. + wp_redirect( admin_url( 'admin.php?page=superpwa-addons' ) ); + exit; } - // Handing add-on de-activation - if ( isset( $_GET['superpwa_addon_deactivate_nonce'] ) && isset( $_GET['addon'] ) && wp_verify_nonce( $_GET['superpwa_addon_deactivate_nonce'], 'deactivate' ) ) { + // Get active add-ons + $active_addons = get_option( 'superpwa_active_addons', array() ); + + // Delete the add-on from the active_addons array in SuperPWA settings. + $active_addons = array_flip( $active_addons ); + unset( $active_addons[ $_GET['addon'] ] ); + $active_addons = array_flip( $active_addons ); - // Handling deactivation - if ( superpwa_addons_activator( $_GET['addon'], false ) === true ) { - - wp_redirect( admin_url( 'admin.php?page=superpwa-addons&deactivated=1&addon=' . $_GET['addon'] ) ); - exit; - } - } + // Write settings back to database + update_option( 'superpwa_active_addons', $active_addons ); + + // Add-on deactivation action. Functions defined in the add-on file are still availalbe at this point. + do_action( 'superpwa_addon_deactivated_' . $_GET['addon'] ); + + // Redirect back to add-ons sub-menu + wp_redirect( admin_url( 'admin.php?page=superpwa-addons&deactivated=1&addon=' . $_GET['addon'] ) ); + exit; } -add_action( 'load-superpwa_page_superpwa-addons', 'superpwa_addons_handle_activation' ); \ No newline at end of file +add_action( 'admin_post_superpwa_deactivate_addon', 'superpwa_addons_handle_deactivation' ); \ No newline at end of file diff --git a/readme.txt b/readme.txt index b75d71b..de5f91b 100644 --- a/readme.txt +++ b/readme.txt @@ -149,6 +149,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. +* Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = From 9c7251564ab7b6bdf0f6d488d4f01b78e92542bc Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 22:48:01 +0530 Subject: [PATCH 19/58] Removed superpwa_addons_activator() Also inline documentation improvements. --- admin/admin-ui-render-addons.php | 75 ++------------------------------ 1 file changed, 3 insertions(+), 72 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index b9b02c1..21cc090 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -9,7 +9,6 @@ * @function superpwa_addons_status() Find add-on status * @function superpwa_addons_button_text() Button text based on add-on status * @function superpwa_addons_button_link() Action URL based on add-on status - * @function superpwa_addons_activator() Do bundled add-on activation and deactivation * @function superpwa_addons_handle_activation() Handle add-on activation * @function superpwa_addons_handle_deactivation() Handle add-on deactivation */ @@ -365,74 +364,11 @@ function superpwa_addons_button_link( $slug ) { } } -/** - * Do add-on activation and deactivation - * - * Adds/removes the Add-On slug from the $settings['active_addons'] in SuperPWA settings. - * - * @param $slug (string) this is the $key used in the $addons array in superpwa_get_addons(). - * @param $status (boolean) True to activate, False to deactivate. - * - * @return (boolean) True on success, false otherwise. - * Success = intended action, i.e. if deactivation is the intend, then success means successful deactivation. - * - * @since 1.7 - */ -function superpwa_addons_activator( $slug, $status ) { - - // Get the add-on status - $addon_status = superpwa_addons_status( $slug ); - - // Check if its a valid add-on - if ( ! $addon_status ) { - return false; - } - - // Get active add-ons - $active_addons = get_option( 'superpwa_active_addons', array() ); - - // Activate add-on - if ( ( $status === true ) && ( $addon_status == 'inactive' ) ) { - - // Add the add-on to the list of active add-ons - $active_addons[] = $slug; - - // Write settings back to database - update_option( 'superpwa_active_addons', $active_addons ); - - return true; - } - - // De-activate add-on - if ( ( $status === false ) && ( $addon_status == 'active' ) ) { - - // Delete the add-on from the active_addons array in SuperPWA settings. - $active_addons = array_flip( $active_addons ); - unset( $active_addons[$slug] ); - $active_addons = array_flip( $active_addons ); - - // Write settings back to database - update_option( 'superpwa_active_addons', $active_addons ); - - // Add-on deactivation action. Functions defined in the add-on file are still availalbe at this point. - do_action( 'superpwa_addon_deactivated_' . $slug ); - - return true; - } - - return false; -} - /** * Handle add-on activation * - * Verifies that the activation request is valid and calls superpwa_addons_activator() - * then redirects the page back to the add-ons page. - * + * Verifies that the activation request is valid and then redirects the page back to the add-ons page. * Hooked onto admin_post_superpwa_activate_addon action hook - * - * @param void - * @return void * * @since 1.7 * @since 1.8 Handles only activation. Used to handle both activation and deactivation. @@ -474,13 +410,8 @@ function superpwa_addons_handle_activation() { /** * Handle add-on deactivation * - * Verifies that the deactivation request is valid and calls superpwa_addons_activator() - * then redirects the page back to the add-ons page. - * - * Hooked onto admin_post_superpwa_activate_addon action hook. - * - * @param void - * @return void + * Verifies that the deactivation request is valid and then redirects the page back to the add-ons page. + * Hooked onto admin_post_superpwa_deactivate_addon action hook. * * @since 1.8 */ From 3e0d244e8b2bee9faf31438a9cf453627ec82215 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 22:55:51 +0530 Subject: [PATCH 20/58] superpwa_get_addons now returns false of $slug isn't found. --- admin/admin-ui-render-addons.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 21cc090..01ba3ad 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -34,7 +34,7 @@ * * @param (string) addon-slug to retrieve the details about a specific add-on. False by default and then returns all add-ons. * - * @return (array) an associative array containing all the info about SuperPWA add-ons. + * @return (array|boolean) an associative array containing all the info about the requested add-on. False if add-on not found. * * @since 1.7 */ @@ -53,11 +53,15 @@ function superpwa_get_addons( $slug = false ) { ), ); - if ( ( $slug === false ) || ( ! isset( $addons[$slug] ) ) ) { + if ( $slug === false ) { return $addons; } - return $addons[$slug]; + if ( ! isset( $addons[ $slug ] ) ) { + return false; + } + + return $addons[ $slug ]; } /** From ec06b618c4cdf5f1b31d67f71e8ebb871c998564 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 23:03:46 +0530 Subject: [PATCH 21/58] Code improvement. Making the button text and button link functions more efficient. --- admin/admin-ui-render-addons.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 01ba3ad..f548d60 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -37,6 +37,7 @@ * @return (array|boolean) an associative array containing all the info about the requested add-on. False if add-on not found. * * @since 1.7 + * @since 1.8 Returns false of $slug isn't found. */ function superpwa_get_addons( $slug = false ) { @@ -57,11 +58,11 @@ function superpwa_get_addons( $slug = false ) { return $addons; } - if ( ! isset( $addons[ $slug ] ) ) { + if ( ! isset( $addons[$slug] ) ) { return false; } - return $addons[ $slug ]; + return $addons[$slug]; } /** @@ -230,18 +231,18 @@ function superpwa_addons_interface_render() { */ function superpwa_addons_status( $slug ) { - // Get add-ons array - $addons = superpwa_get_addons(); + // Get add-on details + $addon = superpwa_get_addons( $slug ); // A security check to make sure that the add-on under consideration exist. - if ( ! isset( $addons[$slug] ) ) { + if ( $addon === false ) { return false; } // Get active add-ons $active_addons = get_option( 'superpwa_active_addons', array() ); - switch( $addons[$slug]['type'] ) { + switch( $addon['type'] ) { // Bundled add-ons ships with SuperPWA and need not be installed separately. case 'bundled': @@ -329,8 +330,8 @@ function superpwa_addons_button_link( $slug ) { // Get the add-on status $addon_status = superpwa_addons_status( $slug ); - // Get add-ons array - $addons = superpwa_get_addons(); + // Get add-on details + $addon = superpwa_get_addons( $slug ); switch( $addon_status ) { @@ -338,7 +339,7 @@ function superpwa_addons_button_link( $slug ) { case 'inactive': // Plugin activation link for add-on plugins that are installed separately. - if ( $addons[$slug]['type'] == 'addon' ) { + if ( $addon['type'] == 'addon' ) { wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $slug ), 'activate-plugin_' . $slug ); } @@ -351,7 +352,7 @@ function superpwa_addons_button_link( $slug ) { case 'active': // Plugin deactivation link for add-on plugins that are installed separately. - if ( $addons[$slug]['type'] == 'addon' ) { + if ( $addon['type'] == 'addon' ) { wp_nonce_url( admin_url( 'plugins.php?action=deactivate&plugin=' . $slug ), 'deactivate-plugin_' . $slug ); } @@ -363,7 +364,7 @@ function superpwa_addons_button_link( $slug ) { // If add-on is not installed and for edge cases where $addon_status is false, we use the add-on link. case 'uninstalled': default: - return $addons[$slug]['link']; + return $addon['link']; break; } } From cb2b771aa11c779cffe94c2c912f7dbd8ea8c189 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 15 May 2018 23:44:56 +0530 Subject: [PATCH 22/58] Added link to add-on settings page in the activation notice. --- admin/admin-ui-render-addons.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index f548d60..1710508 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -77,24 +77,27 @@ function superpwa_addons_interface_render() { return; } - // Add-on activation notice + // Add-on activation todo if ( isset( $_GET['activated'] ) && isset( $_GET['addon'] ) ) { // Add-on activation action. Functions defined in the add-on file are loaded by now. do_action( 'superpwa_addon_activated_' . $_GET['addon'] ); - - // Add settings saved message with the class of "updated" - add_settings_error( 'superpwa_settings_group', 'superpwa_addon_activated_message', __( 'Add-On activated.', 'super-progressive-web-apps' ), 'updated' ); - // Show Settings Saved Message - settings_errors( 'superpwa_settings_group' ); + // Get add-on info + $addon = superpwa_get_addons( $_GET['addon'] ); + + if ( $addon !== false ) { + + // Add-on activation notice + echo '

' . sprintf( __( 'Add-On Activated: %s. Customize settings →', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'] ) . '

'; + } } // Add-on de-activation notice if ( isset( $_GET['deactivated'] ) ) { // Add settings saved message with the class of "updated" - add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On deactivated.', 'super-progressive-web-apps' ), 'updated' ); + add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On Deactivated.', 'super-progressive-web-apps' ), 'updated' ); // Show Settings Saved Message settings_errors( 'superpwa_settings_group' ); From a3ea300755bb1db67f1037677638fa1852cad4f6 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Wed, 16 May 2018 00:00:19 +0530 Subject: [PATCH 23/58] Add-ons UI: Added link to settings page for active add-ons in Add-On card. --- admin/admin-ui-render-addons.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 1710508..ca4d56a 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -89,7 +89,7 @@ function superpwa_addons_interface_render() { if ( $addon !== false ) { // Add-on activation notice - echo '

' . sprintf( __( 'Add-On Activated: %s. Customize settings →', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'] ) . '

'; + echo '

' . sprintf( __( 'Add-On activated: %s. Customize settings →', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'] ) . '

'; } } @@ -97,7 +97,7 @@ function superpwa_addons_interface_render() { if ( isset( $_GET['deactivated'] ) ) { // Add settings saved message with the class of "updated" - add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On Deactivated.', 'super-progressive-web-apps' ), 'updated' ); + add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On deactivated.', 'super-progressive-web-apps' ), 'updated' ); // Show Settings Saved Message settings_errors( 'superpwa_settings_group' ); @@ -159,11 +159,16 @@ function superpwa_addons_interface_render() {
- =' ) ) { ?> - Compatible with your version of SuperPWA', 'super-progressive-web-apps' ); ?> - - Please upgrade to the latest version of SuperPWA', 'super-progressive-web-apps' ); ?> - + Add-On active. Customize settings →', 'super-progressive-web-apps' ), $addon['admin_link'] ); + } + else if ( version_compare( SUPERPWA_VERSION, $addon['superpwa_min_version'], '>=' ) ) { + _e( 'Compatible with your version of SuperPWA', 'super-progressive-web-apps' ); + } + else { + _e( 'Please upgrade to the latest version of SuperPWA', 'super-progressive-web-apps' ); + } ?>
From 9b5dae2b3037b7d67271df419288fb2399caf7bd Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Wed, 16 May 2018 00:45:12 +0530 Subject: [PATCH 24/58] Fixed responsiveness of UTM Tracking UI page --- addons/utm-tracking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/utm-tracking.php b/addons/utm-tracking.php index d1debba..b70d55a 100644 --- a/addons/utm-tracking.php +++ b/addons/utm-tracking.php @@ -241,7 +241,7 @@ function superpwa_utm_tracking_section_cb() { */ function superpwa_utm_tracking_start_url_cb() { - echo '' . superpwa_get_start_url( true ) . ''; + echo '' . superpwa_get_start_url( true ) . ''; } /** From 42195075e4e7a912cc4294483aac85a9fe8614d2 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 02:16:50 +0530 Subject: [PATCH 25/58] Updated link to Support The Project GIF It was previously linked to https://github.com/josevarghese/Progressive-Web-Apps-and-Service-Worker-Supported-Browsers/blob/master/20180513_120136.gif?raw=true --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 1005bf8..13b8833 100644 --- a/README.MD +++ b/README.MD @@ -69,7 +69,7 @@ Users can come back to your website by launching the app from their home screen ## ⭐ Support the project If you feel super excited and want to support us in a small way, please consider starring and/or sharing the repo! This helps us getting known and grow the community. -Chrome +Chrome Also you can support us via [following on social media's and share about us](#share-via-social-medias-and-spread-superpwa). From 884180bdbc350a36740411824b62a155c6fc8df9 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 22:09:23 +0530 Subject: [PATCH 26/58] New Feature: Application Icon and Splash Screen Icon are added as Apple Touch Icons to wp_head. These will be used when your website is added to the Home Screen on iOS. New filter: superpwa_add_apple_touch_icons --- public/manifest.php | 16 +++++++++++++++- readme.txt | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/public/manifest.php b/public/manifest.php index a6361f6..1a2ae53 100644 --- a/public/manifest.php +++ b/public/manifest.php @@ -113,8 +113,22 @@ function superpwa_add_manifest_to_wp_head() { // Get Settings $settings = superpwa_get_settings(); - echo '' . PHP_EOL . '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; echo '' . PHP_EOL; + + // Apple Touch Icons + if ( apply_filters( 'superpwa_add_apple_touch_icons', true ) ) { + + // Get the icons added via SuperPWA > Settings + $icons = superpwa_get_pwa_icons(); + + foreach( $icons as $icon ) { + echo '' . PHP_EOL; + } + } + + echo '' . PHP_EOL . PHP_EOL; } add_action( 'wp_head', 'superpwa_add_manifest_to_wp_head', 0 ); diff --git a/readme.txt b/readme.txt index de5f91b..84434b2 100644 --- a/readme.txt +++ b/readme.txt @@ -148,6 +148,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: +* New Feature: Application Icon and Splash Screen Icon are added as Apple Touch Icons to wp_head. These will be used when your website is added to the Home Screen on iOS. * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. From 5d9871296d7d0cf95514631b46ce4f8247e168e3 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 22:29:27 +0530 Subject: [PATCH 27/58] Generalizing Admin Notice functions for other admin notices as well --- admin/basic-setup.php | 58 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index cf82483..8c030e3 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -5,8 +5,8 @@ * @since 1.0 * * @function superpwa_activate_plugin() Plugin activatation todo list - * @function superpwa_admin_notice_activation() Admin notice on plugin activation - * @function superpwa_network_admin_notice_activation() Admin notice on multisite network activation + * @function superpwa_admin_notices() Admin notices + * @function superpwa_network_admin_notices() Network Admin notices * @function superpwa_upgrader() Plugin upgrade todo list * @function superpwa_deactivate_plugin() Plugin deactivation todo list * @function superpwa_load_plugin_textdomain() Load plugin text domain @@ -54,46 +54,44 @@ function superpwa_activate_plugin( $network_active ) { register_activation_hook( SUPERPWA_PATH_ABS . 'superpwa.php', 'superpwa_activate_plugin' ); /** - * Admin notice on plugin activation + * Admin Notices * - * @since 1.2 + * @since 1.2 Admin notice on plugin activation */ -function superpwa_admin_notice_activation() { +function superpwa_admin_notices() { - // Return if transient is not set - if ( ! get_transient( 'superpwa_admin_notice_activation' ) ) { - return; - } - - $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready with the default settings. ' : ''; - - echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; + // Admin notice on plugin activation + if ( get_transient( 'superpwa_admin_notice_activation' ) ) { - // Delete transient - delete_transient( 'superpwa_admin_notice_activation' ); + $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready with the default settings. ' : ''; + + echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; + + // Delete transient + delete_transient( 'superpwa_admin_notice_activation' ); + } } -add_action( 'admin_notices', 'superpwa_admin_notice_activation' ); +add_action( 'admin_notices', 'superpwa_admin_notices' ); /** - * Admin notice on multisite network activation + * Network Admin notices * - * @since 1.6 + * @since 1.6 Admin notice on multisite network activation */ -function superpwa_network_admin_notice_activation() { +function superpwa_network_admin_notices() { - // Return if transient is not set - if ( ! get_transient( 'superpwa_network_admin_notice_activation' ) ) { - return; - } - - $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready on the main website with the default settings. ' : ''; - - echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →
Note: manifest and service worker for the individual websites will be generated on the first visit to the respective WordPress admin.', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; + // Admin notice on multisite network activation + if ( get_transient( 'superpwa_network_admin_notice_activation' ) ) { - // Delete transient - delete_transient( 'superpwa_network_admin_notice_activation' ); + $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready on the main website with the default settings. ' : ''; + + echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →
Note: manifest and service worker for the individual websites will be generated on the first visit to the respective WordPress admin.', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; + + // Delete transient + delete_transient( 'superpwa_network_admin_notice_activation' ); + } } -add_action( 'network_admin_notices', 'superpwa_network_admin_notice_activation' ); +add_action( 'network_admin_notices', 'superpwa_network_admin_notices' ); /** * Plugin upgrade todo list From 6603b61008baa3feaa3cfc15fa50fc9e1b351c37 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 22:55:25 +0530 Subject: [PATCH 28/58] Added: Admin notice on plugin upgrade success --- admin/basic-setup.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 8c030e3..0dee61a 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -70,6 +70,15 @@ function superpwa_admin_notices() { // Delete transient delete_transient( 'superpwa_admin_notice_activation' ); } + + // Admin notice on plugin upgrade + if ( get_transient( 'superpwa_admin_notice_upgrade_complete' ) ) { + + echo '

' . sprintf( __( 'SuperPWA: Succesfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice' ) . '

'; + + // Delete transient + delete_transient( 'superpwa_admin_notice_upgrade_complete' ); + } } add_action( 'admin_notices', 'superpwa_admin_notices' ); @@ -168,6 +177,9 @@ function superpwa_upgrader() { // For multisites, save the activation status of current blog. superpwa_multisite_activation_status( true ); + + // Set transient for upgrade complete notice + set_transient( 'superpwa_admin_notice_upgrade_complete', true, 60 ); } add_action( 'admin_init', 'superpwa_upgrader' ); From 4f32f5454bac1607ba2b9360675274b9c89b17f5 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 23:05:25 +0530 Subject: [PATCH 29/58] Added: Network admin notice on plugin upgrade success --- admin/basic-setup.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 0dee61a..fc09c52 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -89,7 +89,7 @@ function superpwa_admin_notices() { */ function superpwa_network_admin_notices() { - // Admin notice on multisite network activation + // Network admin notice on multisite network activation if ( get_transient( 'superpwa_network_admin_notice_activation' ) ) { $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready on the main website with the default settings. ' : ''; @@ -99,6 +99,15 @@ function superpwa_network_admin_notices() { // Delete transient delete_transient( 'superpwa_network_admin_notice_activation' ); } + + // Network admin notice on plugin upgrade + if ( get_transient( 'superpwa_admin_notice_upgrade_complete' ) ) { + + echo '

' . sprintf( __( 'SuperPWA: Succesfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice-mu' ) . '

'; + + // Delete transient + delete_transient( 'superpwa_admin_notice_upgrade_complete' ); + } } add_action( 'network_admin_notices', 'superpwa_network_admin_notices' ); From 01015783cc0a9c72541362a39ecd248b5096c96b Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 23:10:20 +0530 Subject: [PATCH 30/58] Added authentication to make sure notices show only for admins --- admin/basic-setup.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index fc09c52..2f52174 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -59,6 +59,11 @@ function superpwa_activate_plugin( $network_active ) { * @since 1.2 Admin notice on plugin activation */ function superpwa_admin_notices() { + + // Notices only for admins + if ( ! current_user_can( 'manage_options' ) ) { + return; + } // Admin notice on plugin activation if ( get_transient( 'superpwa_admin_notice_activation' ) ) { @@ -88,6 +93,11 @@ function superpwa_admin_notices() { * @since 1.6 Admin notice on multisite network activation */ function superpwa_network_admin_notices() { + + // Notices only for admins + if ( ! current_user_can( 'manage_options' ) ) { + return; + } // Network admin notice on multisite network activation if ( get_transient( 'superpwa_network_admin_notice_activation' ) ) { From 1208d70c28dd1062a9e45eb6cc54b22079fa0e48 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 23:16:45 +0530 Subject: [PATCH 31/58] Fixed typo on the word Successfully (face palm) --- admin/basic-setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 2f52174..50462fe 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -79,7 +79,7 @@ function superpwa_admin_notices() { // Admin notice on plugin upgrade if ( get_transient( 'superpwa_admin_notice_upgrade_complete' ) ) { - echo '

' . sprintf( __( 'SuperPWA: Succesfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice' ) . '

'; + echo '

' . sprintf( __( 'SuperPWA: Successfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice' ) . '

'; // Delete transient delete_transient( 'superpwa_admin_notice_upgrade_complete' ); @@ -113,7 +113,7 @@ function superpwa_network_admin_notices() { // Network admin notice on plugin upgrade if ( get_transient( 'superpwa_admin_notice_upgrade_complete' ) ) { - echo '

' . sprintf( __( 'SuperPWA: Succesfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice-mu' ) . '

'; + echo '

' . sprintf( __( 'SuperPWA: Successfully updated to version %s. Thank you! Discover new features and read the story →', 'super-progressive-web-apps' ), SUPERPWA_VERSION, 'https://superpwa.com/category/release-notes/latest/?utm_source=superpwa-plugin&utm_medium=update-success-notice-mu' ) . '

'; // Delete transient delete_transient( 'superpwa_admin_notice_upgrade_complete' ); From 47c5fda1667506beb710b2f31994d2c4297c88b7 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 17 May 2018 23:20:09 +0530 Subject: [PATCH 32/58] Added UTM tracking to Plugin URI and Author URI --- superpwa.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superpwa.php b/superpwa.php index 4df06a4..5d9cb5e 100644 --- a/superpwa.php +++ b/superpwa.php @@ -1,10 +1,10 @@ Date: Sun, 20 May 2018 16:49:50 +0530 Subject: [PATCH 33/58] Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. --- admin/admin-ui-render-settings.php | 17 +++++++++++++---- readme.txt | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/admin/admin-ui-render-settings.php b/admin/admin-ui-render-settings.php index 7d52779..bbdfbf4 100644 --- a/admin/admin-ui-render-settings.php +++ b/admin/admin-ui-render-settings.php @@ -286,11 +286,18 @@ function superpwa_orientation_cb() { /** * Manifest Status * - * @since 1.0 + * @since 1.2 + * @since 1.8 Attempt to generate manifest again if the manifest doesn't exist. */ function superpwa_manifest_status_cb() { - - if ( superpwa_get_contents( superpwa_manifest( 'abs' ) ) ) { + + /** + * Check to see if the manifest exists, If not attempts to generate a new one. + * + * Users who had permissions issue in the beginning will check the status after changing file system permissions. + * At this point we try to generate the manifest and service worker to see if its possible with the new permissions. + */ + if ( superpwa_get_contents( superpwa_manifest( 'abs' ) ) || superpwa_generate_manifest() ) { printf( '

' . __( 'Manifest generated successfully. You can see it here →.', 'super-progressive-web-apps' ) . '

', superpwa_manifest( 'src' ) ); } else { @@ -303,10 +310,12 @@ function superpwa_manifest_status_cb() { * Service Worker Status * * @since 1.2 + * @since 1.8 Attempt to generate service worker again if it doesn't exist. */ function superpwa_sw_status_cb() { - if ( superpwa_get_contents( superpwa_sw( 'abs' ) ) ) { + // See superpwa_manifest_status_cb() for documentation. + if ( superpwa_get_contents( superpwa_sw( 'abs' ) ) || superpwa_generate_sw() ) { printf( '

' . __( 'Service worker generated successfully.', 'super-progressive-web-apps' ) . '

' ); } else { diff --git a/readme.txt b/readme.txt index 84434b2..75476ba 100644 --- a/readme.txt +++ b/readme.txt @@ -151,6 +151,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup * New Feature: Application Icon and Splash Screen Icon are added as Apple Touch Icons to wp_head. These will be used when your website is added to the Home Screen on iOS. * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. +* Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = From f5c6442b60a13c13833c23f21337d79a674080df Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Mon, 21 May 2018 00:54:41 +0530 Subject: [PATCH 34/58] Tested with WordPress 4.9.6. --- readme.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index 75476ba..4572c52 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: arunbasillal, josevarghese, superpwa Donate link: http://millionclues.com/donate/ Tags: pwa, progressive web apps, manifest, web manifest, android app, chrome app, add to homescreen, mobile web Requires at least: 3.6.0 -Tested up to: 4.9.5 +Tested up to: 4.9.6 Requires PHP: 5.3 Stable tag: trunk License: GPLv2 or later @@ -148,11 +148,12 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: +* Tested with WordPress 4.9.6. * New Feature: Application Icon and Splash Screen Icon are added as Apple Touch Icons to wp_head. These will be used when your website is added to the Home Screen on iOS. -* Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. -* Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. +* Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. +* Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. -* Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. +* Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = * Date: 05.May.2018 From ae535a06f91ccba431f1d299174006cdb0926f21 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Mon, 21 May 2018 01:11:20 +0530 Subject: [PATCH 35/58] Added link to fixing permissions error support doc in the manifest and sw generation failed messages https://superpwa.com/doc/fixing-manifest-service-worker-generation-failed-error/ --- admin/admin-ui-render-settings.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/admin-ui-render-settings.php b/admin/admin-ui-render-settings.php index bbdfbf4..08588eb 100644 --- a/admin/admin-ui-render-settings.php +++ b/admin/admin-ui-render-settings.php @@ -299,10 +299,10 @@ function superpwa_manifest_status_cb() { */ if ( superpwa_get_contents( superpwa_manifest( 'abs' ) ) || superpwa_generate_manifest() ) { - printf( '

' . __( 'Manifest generated successfully. You can see it here →.', 'super-progressive-web-apps' ) . '

', superpwa_manifest( 'src' ) ); + printf( '

' . __( 'Manifest generated successfully. You can see it here →', 'super-progressive-web-apps' ) . '

', superpwa_manifest( 'src' ) ); } else { - echo '

' . __('Manifest generation failed. Check if WordPress can write to your root folder (the same folder with wp-config.php).', 'super-progressive-web-apps') . '

'; + printf( '

' . __( 'Manifest generation failed. Check if WordPress can write to your root folder (the same folder with wp-config.php). Read more →', 'super-progressive-web-apps' ) . '

', 'https://superpwa.com/doc/fixing-manifest-service-worker-generation-failed-error/?utm_source=superpwa-plugin&utm_medium=settings-status-no-manifest' ); } } @@ -320,7 +320,7 @@ function superpwa_sw_status_cb() { printf( '

' . __( 'Service worker generated successfully.', 'super-progressive-web-apps' ) . '

' ); } else { - echo '

' . __('Service worker generation failed. Check if WordPress can write to your root folder (the same folder with wp-config.php).', 'super-progressive-web-apps') . '

'; + printf( '

' . __( 'Service worker generation failed. Check if WordPress can write to your root folder (the same folder with wp-config.php). Read more →', 'super-progressive-web-apps' ) . '

', 'https://superpwa.com/doc/fixing-manifest-service-worker-generation-failed-error/?utm_source=superpwa-plugin&utm_medium=settings-status-no-sw' ); } } From 759aa6f2941658699890d05cc54ad4b0fd2d802a Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Fri, 25 May 2018 23:23:20 +0530 Subject: [PATCH 36/58] Not everyone needs Apple Touch Icons. Decided to make this into an add-on Some theme's already provide these icons, so adding them automatically for everyone might not be a good idea. Introduced the filter superpwa_wp_head_tags --- public/manifest.php | 22 ++++++++-------------- readme.txt | 1 - 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/public/manifest.php b/public/manifest.php index 1a2ae53..0842ecd 100644 --- a/public/manifest.php +++ b/public/manifest.php @@ -107,28 +107,22 @@ function superpwa_generate_manifest() { * Add manifest to header (wp_head) * * @since 1.0 + * @since 1.8 Introduced filter superpwa_wp_head_tags */ function superpwa_add_manifest_to_wp_head() { // Get Settings $settings = superpwa_get_settings(); - echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; + $tags = '' . PHP_EOL; + $tags .= '' . PHP_EOL; + $tags .= '' . PHP_EOL; - // Apple Touch Icons - if ( apply_filters( 'superpwa_add_apple_touch_icons', true ) ) { - - // Get the icons added via SuperPWA > Settings - $icons = superpwa_get_pwa_icons(); - - foreach( $icons as $icon ) { - echo '' . PHP_EOL; - } - } + $tags = apply_filters( 'superpwa_wp_head_tags', $tags ); + + $tags .= '' . PHP_EOL . PHP_EOL; - echo '' . PHP_EOL . PHP_EOL; + echo $tags; } add_action( 'wp_head', 'superpwa_add_manifest_to_wp_head', 0 ); diff --git a/readme.txt b/readme.txt index 4572c52..945b805 100644 --- a/readme.txt +++ b/readme.txt @@ -149,7 +149,6 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: * Tested with WordPress 4.9.6. -* New Feature: Application Icon and Splash Screen Icon are added as Apple Touch Icons to wp_head. These will be used when your website is added to the Home Screen on iOS. * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. From 204d03ea8e1d885c9088a5c94eb6ee48690f8e8f Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Fri, 25 May 2018 23:36:05 +0530 Subject: [PATCH 37/58] New Add-On: Apple Touch Icons. Adds the app icons as home screen icons on iOS devices. --- addons/apple-touch-icons.php | 36 ++++++++++++++++++++++++++++++++++++ readme.txt | 1 + 2 files changed, 37 insertions(+) create mode 100644 addons/apple-touch-icons.php diff --git a/addons/apple-touch-icons.php b/addons/apple-touch-icons.php new file mode 100644 index 0000000..58f0dad --- /dev/null +++ b/addons/apple-touch-icons.php @@ -0,0 +1,36 @@ + Settings + * and adds them to wp_head using the superpwa_wp_head_tags filter. + * + * @param (string) $tags HTML element tags passed on by superpwa_wp_head_tag + * + * @return (string) Appends the Apple Touch Icons to the existing tag string + * + * @since 1.8 + */ +function superpwa_ati_add_apple_touch_icons( $tags ) { + + // Get the icons added via SuperPWA > Settings + $icons = superpwa_get_pwa_icons(); + + foreach( $icons as $icon ) { + $tags .= '' . PHP_EOL; + } + + return $tags; +} +add_filter( 'superpwa_wp_head_tag', 'superpwa_ati_add_apple_touch_icons' ); \ No newline at end of file diff --git a/readme.txt b/readme.txt index 945b805..68a6552 100644 --- a/readme.txt +++ b/readme.txt @@ -149,6 +149,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup = 1.8 = * Date: * Tested with WordPress 4.9.6. +* New Add-On: Apple Touch Icons. Adds the app icons as home screen icons on iOS devices. * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. From 5637d2c90c5ec5ac154975eab48faca84d5d4d2c Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Fri, 25 May 2018 23:48:49 +0530 Subject: [PATCH 38/58] Added Apple Touch Icons to the Add-Ons page --- addons/apple-touch-icons.php | 4 ++-- admin/admin-ui-render-addons.php | 9 +++++++++ loader.php | 5 ++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/apple-touch-icons.php b/addons/apple-touch-icons.php index 58f0dad..2fae81b 100644 --- a/addons/apple-touch-icons.php +++ b/addons/apple-touch-icons.php @@ -16,7 +16,7 @@ * Uses the Application Icon and Splash Screen Icon for SuperPWA > Settings * and adds them to wp_head using the superpwa_wp_head_tags filter. * - * @param (string) $tags HTML element tags passed on by superpwa_wp_head_tag + * @param (string) $tags HTML element tags passed on by superpwa_wp_head_tags * * @return (string) Appends the Apple Touch Icons to the existing tag string * @@ -33,4 +33,4 @@ function superpwa_ati_add_apple_touch_icons( $tags ) { return $tags; } -add_filter( 'superpwa_wp_head_tag', 'superpwa_ati_add_apple_touch_icons' ); \ No newline at end of file +add_filter( 'superpwa_wp_head_tags', 'superpwa_ati_add_apple_touch_icons' ); \ No newline at end of file diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index ca4d56a..371c96b 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -52,6 +52,15 @@ function superpwa_get_addons( $slug = false ) { 'admin_link' => admin_url( 'admin.php?page=superpwa-utm-tracking' ), 'superpwa_min_version' => '1.7', ), + 'apple_touch_icons' => array( + 'name' => __( 'Apple Touch Icons', 'super-progressive-web-apps' ), + 'description' => __( 'Adds the app icons as home screen icons on iOS devices.', 'super-progressive-web-apps' ), + 'type' => 'bundled', + 'icon' => 'superpwa-128x128.png', + 'link' => 'https://superpwa.com/addons/apple-touch-icons/', + 'admin_link' => admin_url( 'admin.php?page=superpwa-utm-tracking' ), + 'superpwa_min_version' => '1.8', + ), ); if ( $slug === false ) { diff --git a/loader.php b/loader.php index ff3e8c7..5c5fb40 100644 --- a/loader.php +++ b/loader.php @@ -27,6 +27,5 @@ require_once( SUPERPWA_PATH_ABS . 'public/sw.php' ); // Load bundled add-ons -if ( superpwa_addons_status( 'utm_tracking' ) == 'active' ) { - require_once( SUPERPWA_PATH_ABS . 'addons/utm-tracking.php' ); -} \ No newline at end of file +if ( superpwa_addons_status( 'utm_tracking' ) == 'active' ) require_once( SUPERPWA_PATH_ABS . 'addons/utm-tracking.php' ); +if ( superpwa_addons_status( 'apple_touch_icons' ) == 'active' ) require_once( SUPERPWA_PATH_ABS . 'addons/apple-touch-icons.php' ); \ No newline at end of file From bb95d112d78d434929cc9ad3bcd4807de31132f1 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 26 May 2018 00:29:16 +0530 Subject: [PATCH 39/58] Improved the Add-Ons settings UI to accomodate add-ons without a dedicated settings page. --- admin/admin-ui-render-addons.php | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 371c96b..a26efd0 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -28,6 +28,8 @@ * 'icon' => 'icon-for-addon-128x128.png', * 'link' => 'https://superpwa.com/addons/details-page-of-addon', * 'admin_link' => admin_url( 'admin.php?page=superpwa-addon-admin-page' ), + * 'admin_link_text' => __( 'Customize settings | More Details →', 'super-progressive-web-apps' ), + * 'admin_link_target' => 'admin | external', * 'superpwa_min_version' => '1.7' // min version of SuperPWA required to use the add-on. * ) * ); @@ -50,6 +52,8 @@ function superpwa_get_addons( $slug = false ) { 'icon' => 'superpwa-128x128.png', 'link' => 'https://superpwa.com/addons/utm-tracking/', 'admin_link' => admin_url( 'admin.php?page=superpwa-utm-tracking' ), + 'admin_link_text' => __( 'Customize Settings →', 'super-progressive-web-apps' ), + 'admin_link_target' => 'admin', 'superpwa_min_version' => '1.7', ), 'apple_touch_icons' => array( @@ -58,7 +62,9 @@ function superpwa_get_addons( $slug = false ) { 'type' => 'bundled', 'icon' => 'superpwa-128x128.png', 'link' => 'https://superpwa.com/addons/apple-touch-icons/', - 'admin_link' => admin_url( 'admin.php?page=superpwa-utm-tracking' ), + 'admin_link' => 'https://superpwa.com/addons/apple-touch-icons/', + 'admin_link_text' => __( 'More Details →', 'super-progressive-web-apps' ), + 'admin_link_target' => 'external', 'superpwa_min_version' => '1.8', ), ); @@ -95,10 +101,18 @@ function superpwa_addons_interface_render() { // Get add-on info $addon = superpwa_get_addons( $_GET['addon'] ); + // Add UTM Tracking to admin_link_text if its not an admin page. + if ( $addon['admin_link_target'] === 'external' ) { + $addon['admin_link'] .= '?utm_source=superpwa-plugin&utm_medium=addon-activation-notice'; + } + + // Set link target attribute so that external links open in a new tab. + $link_target = ( $addon['admin_link_target'] === 'external' ) ? 'target="_blank"' : ''; + if ( $addon !== false ) { // Add-on activation notice - echo '

' . sprintf( __( 'Add-On activated: %s. Customize settings →', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'] ) . '

'; + echo '

' . sprintf( __( 'Add-On activated: %s. %s', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'], $link_target, $addon['admin_link_text'] ) . '

'; } } @@ -106,7 +120,7 @@ function superpwa_addons_interface_render() { if ( isset( $_GET['deactivated'] ) ) { // Add settings saved message with the class of "updated" - add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On deactivated.', 'super-progressive-web-apps' ), 'updated' ); + add_settings_error( 'superpwa_settings_group', 'superpwa_addon_deactivated_message', __( 'Add-On deactivated', 'super-progressive-web-apps' ), 'updated' ); // Show Settings Saved Message settings_errors( 'superpwa_settings_group' ); @@ -132,7 +146,17 @@ function superpwa_addons_interface_render() { $superpwa_newsletter = true; // Looping over each add-on - foreach( $addons as $slug => $addon ) { ?> + foreach( $addons as $slug => $addon ) { + + // Add UTM Tracking to admin_link_text if its not an admin page. + if ( $addon['admin_link_target'] === 'external' ) { + $addon['admin_link'] .= '?utm_source=superpwa-plugin&utm_medium=addon-card'; + } + + // Set link target attribute so that external links open in a new tab. + $link_target = ( $addon['admin_link_target'] === 'external' ) ? 'target="_blank"' : ''; + + ?>
@@ -140,7 +164,7 @@ function superpwa_addons_interface_render() {

- + @@ -170,7 +194,7 @@ function superpwa_addons_interface_render() {
Add-On active. Customize settings →', 'super-progressive-web-apps' ), $addon['admin_link'] ); + printf( __( 'Add-On active. %s', 'super-progressive-web-apps' ), $addon['admin_link'], $link_target, $addon['admin_link_text'] ); } else if ( version_compare( SUPERPWA_VERSION, $addon['superpwa_min_version'], '>=' ) ) { _e( 'Compatible with your version of SuperPWA', 'super-progressive-web-apps' ); From 7dcd0f414ad690cca7df9ee4d777cff539054128 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 26 May 2018 00:41:08 +0530 Subject: [PATCH 40/58] New filter: superpwa_manifest --- public/manifest.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/public/manifest.php b/public/manifest.php index 0842ecd..d7a92fc 100644 --- a/public/manifest.php +++ b/public/manifest.php @@ -60,11 +60,12 @@ function superpwa_manifest( $arg = 'src' ) { * * @return (boolean) true on success, false on failure. * - * @since 1.0 - * @since 1.3 Added support for 512x512 icon. - * @since 1.4 Added orientation and scope. - * @since 1.5 Added gcm_sender_id - * @since 1.6 Added description + * @since 1.0 + * @since 1.3 Added support for 512x512 icon. + * @since 1.4 Added orientation and scope. + * @since 1.5 Added gcm_sender_id + * @since 1.6 Added description + * @since 1.8 Removed gcm_sender_id and introduced filter superpwa_manifest. gcm_sender_id is added in /3rd-party/onesignal.php */ function superpwa_generate_manifest() { @@ -75,7 +76,7 @@ function superpwa_generate_manifest() { $manifest['name'] = $settings['app_name']; $manifest['short_name'] = $settings['app_short_name']; - // description + // Description if ( isset( $settings['description'] ) && ! empty( $settings['description'] ) ) { $manifest['description'] = $settings['description']; } @@ -88,14 +89,13 @@ function superpwa_generate_manifest() { $manifest['start_url'] = superpwa_get_start_url( true ); $manifest['scope'] = superpwa_get_scope(); - // gcm_sender_id - if ( superpwa_onesignal_get_gcm_sender_id() !== false ) { - $manifest['gcm_sender_id'] = superpwa_onesignal_get_gcm_sender_id(); - } + // Filter the manifest. + apply_filters( 'superpwa_manifest', $manifest ); - // Delete manifest if it exists + // Delete manifest if it exists. superpwa_delete_manifest(); + // Write the manfiest to disk. if ( ! superpwa_put_contents( superpwa_manifest( 'abs' ), json_encode( $manifest ) ) ) { return false; } From f9870f8d5775e65b8e653167489653422c501470 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 26 May 2018 01:04:56 +0530 Subject: [PATCH 41/58] Applying superpwa_manifest for reals this time. --- public/manifest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/manifest.php b/public/manifest.php index d7a92fc..11d09c0 100644 --- a/public/manifest.php +++ b/public/manifest.php @@ -90,7 +90,7 @@ function superpwa_generate_manifest() { $manifest['scope'] = superpwa_get_scope(); // Filter the manifest. - apply_filters( 'superpwa_manifest', $manifest ); + $manifest = apply_filters( 'superpwa_manifest', $manifest ); // Delete manifest if it exists. superpwa_delete_manifest(); From 52753903a6fafef18208abdf16c1d712ad5694da Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 26 May 2018 01:07:30 +0530 Subject: [PATCH 42/58] Add gcm_sender_id to manifest using the superpwa_manifest filter --- 3rd-party/onesignal.php | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 87843d7..88a9cae 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -2,27 +2,33 @@ /** * OneSignal integration * + * @link https://wordpress.org/plugins/onesignal-free-web-push-notifications/ + * * @since 1.6 + * * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not. - * @function superpwa_onesignal_get_gcm_sender_id() Extract gcm_sender_id from OneSignal settings + * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest */ // Exit if accessed directly if ( ! defined('ABSPATH') ) exit; +// If OneSignal is installed and active +if ( class_exists( 'OneSignal' ) ) { + + // Add gcm_sender_id to SuperPWA manifest + add_filter( 'superpwa_manifest', 'superpwa_onesignal_add_gcm_sender_id' ); +} + /** * Check if OneSignal integration notice should be displayed or not. * * @return Bool True if notice should be displayed. False otherwise. + * * @since 1.5 */ function superpwa_onesignal_manifest_notice_check() { - // No notice needed if OneSignal is not installed or there is no gcm_sender_id - if ( ! superpwa_onesignal_get_gcm_sender_id() ) { - return false; - } - // Get OneSignal settins $onesignal_wp_settings = get_option( 'OneSignalWPSetting' ); @@ -39,21 +45,19 @@ function superpwa_onesignal_manifest_notice_check() { } /** - * Extract gcm_sender_id from OneSignal settings + * Add gcm_sender_id to SuperPWA manifest * - * @link https://wordpress.org/plugins/onesignal-free-web-push-notifications/ + * OneSignal's gcm_sender_id is 482941778795 * - * @return (String|Bool) gcm_sender_id of OneSignal if OneSignal is installed, false otherwise - * @since 1.5 + * @param (array) $manifest Array with the manifest entries passed via the superpwa_manifest filter. + * + * @return (array) Array appended with the gcm_sender_id of OneSignal + * + * @since 1.8 */ -function superpwa_onesignal_get_gcm_sender_id() { +function superpwa_onesignal_add_gcm_sender_id( $manifest ) { - // If OneSignal is installed and active - if ( class_exists( 'OneSignal' ) ) { - - // This is the gcm_sender_id of OneSignal, same for all installs. - return '482941778795'; - } + $manifest['gcm_sender_id'] = '482941778795'; - return false; + return $manifest; } \ No newline at end of file From b00cdfd5517fa7e6fb353b3da3797d5b49b7bf6d Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Sat, 26 May 2018 01:13:44 +0530 Subject: [PATCH 43/58] Handle OneSignal activation and deactivation --- 3rd-party/onesignal.php | 42 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 88a9cae..e5c80c9 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -6,8 +6,10 @@ * * @since 1.6 * - * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not. + * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest + * @function superpwa_onesignal_activation() Add gcm_sender_id to manifest on OneSignal activation + * @function superpwa_onesignal_deactivation() Remove gcm_sender_id from manifest on OneSignal deactivation */ // Exit if accessed directly @@ -21,7 +23,7 @@ } /** - * Check if OneSignal integration notice should be displayed or not. + * Check if OneSignal integration notice should be displayed or not * * @return Bool True if notice should be displayed. False otherwise. * @@ -60,4 +62,38 @@ function superpwa_onesignal_add_gcm_sender_id( $manifest ) { $manifest['gcm_sender_id'] = '482941778795'; return $manifest; -} \ No newline at end of file +} + +/** + * Add gcm_sender_id to manifest on OneSignal activation + * + * Regenerates SuperPWA manifest with the gcm_sender_id added. + * + * @since 1.8 + */ +function superpwa_onesignal_activation() { + + // Filter in gcm_sender_id to SuperPWA manifest + add_filter( 'superpwa_manifest', 'superpwa_onesignal_add_gcm_sender_id' ); + + // Regenerate SuperPWA manifest + superpwa_generate_manifest(); +} +add_action( 'activate_onesignal-free-web-push-notifications/onesignal.php', 'superpwa_onesignal_activation', 11 ); + +/** + * Remove gcm_sender_id from manifest on OneSignal deactivation + * + * Regenerates SuperPWA manifest + * + * @since 1.8 + */ +function superpwa_onesignal_deactivation() { + + // Remove gcm_sender_id from SuperPWA manifest + remove_filter( 'superpwa_manifest', 'superpwa_onesignal_add_gcm_sender_id' ); + + // Regenerate SuperPWA manifest + superpwa_generate_manifest(); +} +add_action( 'deactivate_onesignal-free-web-push-notifications/onesignal.php', 'superpwa_onesignal_deactivation', 11 ); \ No newline at end of file From ff3566a22a300c2abc7af3f3f49ee5d81e8c7821 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 00:47:07 +0530 Subject: [PATCH 44/58] New Filter: superpwa_sw_filename Filter the filename of SuperPWA service worker. --- public/sw.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sw.php b/public/sw.php index d104f3c..d25726f 100644 --- a/public/sw.php +++ b/public/sw.php @@ -31,7 +31,7 @@ */ function superpwa_sw( $arg = 'src' ) { - $sw_filename = 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js'; + $sw_filename = apply_filters( 'superpwa_sw_filename', 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js' ); switch( $arg ) { From 46445f8bfcec17daf3ce754b18f41aba8b4c6fcc Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 00:47:20 +0530 Subject: [PATCH 45/58] Added function superpwa_onesignal_sw_filename() --- 3rd-party/onesignal.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index e5c80c9..53079bd 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -8,6 +8,7 @@ * * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest + * @function superpwa_onesignal_sw_filename() Change Service Worker filename to OneSignalSDKWorker.js.php * @function superpwa_onesignal_activation() Add gcm_sender_id to manifest on OneSignal activation * @function superpwa_onesignal_deactivation() Remove gcm_sender_id from manifest on OneSignal deactivation */ @@ -64,6 +65,25 @@ function superpwa_onesignal_add_gcm_sender_id( $manifest ) { return $manifest; } +/** + * Change Service Worker filename to OneSignalSDKWorker.js.php + * + * OneSignalSDKWorker.js.php is the name of the service worker of OneSignal. + * Since only one service worker is allowed in a given scope, OneSignal unregisters all other service workers and registers theirs. + * Having the same name prevents OneSignal from unregistering our service worker. + * + * @link https://documentation.onesignal.com/docs/web-push-setup-faq + * + * @param (string) $sw_filename Filename of SuperPWA service worker passed via superpwa_sw_filename filter. + * + * @return (string) Service worker filename changed to OneSignalSDKWorker.js.php + * + * @since 1.8 + */ +function superpwa_onesignal_sw_filename( $sw_filename ) { + return 'OneSignalSDKWorker.js.php'; +} + /** * Add gcm_sender_id to manifest on OneSignal activation * From 296692a73d9ea27fdf0537ff57e10b83abb75ba5 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 00:56:41 +0530 Subject: [PATCH 46/58] Updated OneSignal activation and deactivation todo lists --- 3rd-party/onesignal.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 53079bd..ea88bc1 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -9,8 +9,8 @@ * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest * @function superpwa_onesignal_sw_filename() Change Service Worker filename to OneSignalSDKWorker.js.php - * @function superpwa_onesignal_activation() Add gcm_sender_id to manifest on OneSignal activation - * @function superpwa_onesignal_deactivation() Remove gcm_sender_id from manifest on OneSignal deactivation + * @function superpwa_onesignal_activation() OneSignal activation todo + * @function superpwa_onesignal_deactivation() OneSignal deactivation todo */ // Exit if accessed directly @@ -21,6 +21,9 @@ // Add gcm_sender_id to SuperPWA manifest add_filter( 'superpwa_manifest', 'superpwa_onesignal_add_gcm_sender_id' ); + + // Change service worker filename to match OneSignal's service worker + add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); } /** @@ -85,9 +88,10 @@ function superpwa_onesignal_sw_filename( $sw_filename ) { } /** - * Add gcm_sender_id to manifest on OneSignal activation + * OneSignal activation todo * * Regenerates SuperPWA manifest with the gcm_sender_id added. + * Regenerate SuperPWA service worker with the new filename. * * @since 1.8 */ @@ -98,13 +102,20 @@ function superpwa_onesignal_activation() { // Regenerate SuperPWA manifest superpwa_generate_manifest(); + + // Change service worker filename to match OneSignal's service worker + add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + + // Regenerate SuperPWA service worker + superpwa_generate_sw(); } add_action( 'activate_onesignal-free-web-push-notifications/onesignal.php', 'superpwa_onesignal_activation', 11 ); /** - * Remove gcm_sender_id from manifest on OneSignal deactivation + * OneSignal deactivation todo * * Regenerates SuperPWA manifest + * Regenerate SuperPWA service worker. * * @since 1.8 */ @@ -115,5 +126,11 @@ function superpwa_onesignal_deactivation() { // Regenerate SuperPWA manifest superpwa_generate_manifest(); + + // Restore the default service worker of SuperPWA + remove_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + + // Regenerate SuperPWA service worker + superpwa_generate_sw(); } add_action( 'deactivate_onesignal-free-web-push-notifications/onesignal.php', 'superpwa_onesignal_deactivation', 11 ); \ No newline at end of file From fb9f6179f0cbf22720d9291ac85c69ce6fee85e6 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 01:01:09 +0530 Subject: [PATCH 47/58] Delete current service worker during OneSignal activation and deactivation --- 3rd-party/onesignal.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index ea88bc1..18fe3d3 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -91,6 +91,7 @@ function superpwa_onesignal_sw_filename( $sw_filename ) { * OneSignal activation todo * * Regenerates SuperPWA manifest with the gcm_sender_id added. + * Delete current service worker. * Regenerate SuperPWA service worker with the new filename. * * @since 1.8 @@ -103,6 +104,9 @@ function superpwa_onesignal_activation() { // Regenerate SuperPWA manifest superpwa_generate_manifest(); + // Delete service worker if it exists + superpwa_delete_sw(); + // Change service worker filename to match OneSignal's service worker add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); @@ -114,7 +118,8 @@ function superpwa_onesignal_activation() { /** * OneSignal deactivation todo * - * Regenerates SuperPWA manifest + * Regenerates SuperPWA manifest. + * Delete current service worker. * Regenerate SuperPWA service worker. * * @since 1.8 @@ -127,6 +132,9 @@ function superpwa_onesignal_deactivation() { // Regenerate SuperPWA manifest superpwa_generate_manifest(); + // Delete service worker if it exists + superpwa_delete_sw(); + // Restore the default service worker of SuperPWA remove_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); From 8f42a984284682931789e54ef5bf367e2fe924cf Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 09:40:22 +0530 Subject: [PATCH 48/58] Import OneSignal service worker in SuperPWA --- 3rd-party/onesignal.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 18fe3d3..9a3010f 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -9,6 +9,7 @@ * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest * @function superpwa_onesignal_sw_filename() Change Service Worker filename to OneSignalSDKWorker.js.php + * @function superpwa_onesignal_sw() Import OneSignal service worker in SuperPWA * @function superpwa_onesignal_activation() OneSignal activation todo * @function superpwa_onesignal_deactivation() OneSignal deactivation todo */ @@ -24,6 +25,9 @@ // Change service worker filename to match OneSignal's service worker add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + + // Import OneSignal service worker in SuperPWA + add_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); } /** @@ -87,6 +91,25 @@ function superpwa_onesignal_sw_filename( $sw_filename ) { return 'OneSignalSDKWorker.js.php'; } +/** + * Import OneSignal service worker in SuperPWA + * + * @param (string) $sw Service worker template of SuperPWA passed via superpwa_sw_template filter + * + * @return (string) Import OneSignal's service worker into SuperPWA + * + * @since 1.8 + */ +function superpwa_onesignal_sw( $sw ) { + + $onesignal = '' . PHP_EOL . PHP_EOL; + + return $onesignal . $sw; +} + /** * OneSignal activation todo * @@ -110,6 +133,9 @@ function superpwa_onesignal_activation() { // Change service worker filename to match OneSignal's service worker add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + // Import OneSignal service worker in SuperPWA + add_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); + // Regenerate SuperPWA service worker superpwa_generate_sw(); } @@ -138,6 +164,9 @@ function superpwa_onesignal_deactivation() { // Restore the default service worker of SuperPWA remove_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + // Remove OneSignal service worker in SuperPWA + remove_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); + // Regenerate SuperPWA service worker superpwa_generate_sw(); } From d3a444c1a0e96c2b514251523d82d5d7a1779678 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 10:28:08 +0530 Subject: [PATCH 49/58] Handle upgrade from versions lower than 1.8 --- admin/basic-setup.php | 26 ++++++++++++++++++++++++-- loader.php | 2 +- public/sw.php | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 50462fe..829844c 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -138,7 +138,7 @@ function superpwa_upgrader() { } /** - * Return if this is the first time the plugin is installed. + * Todo list for fresh install. * * On a multisite, during network activation, the activation hook (and activation todo) is not fired. * Manifest and service worker is generated the first time the wp-admin is loaded (when admin_init is fired). @@ -164,7 +164,7 @@ function superpwa_upgrader() { } /** - * Add orientation and theme_color to database when upgrading from pre 1.4 versions + * Add orientation and theme_color to database when upgrading from pre 1.4 versions. * * Until 1.4, there was no UI for orientation and theme_color. * In the manifest, orientation was hard coded as 'natural'. @@ -185,6 +185,28 @@ function superpwa_upgrader() { update_option( 'superpwa_settings', $settings ); } + /** + * Delete existing service worker for single sites that use OneSignal. + * + * For OneSignal compatibility, in version 1.8 the service worker filename is renamed. + * If OneSignal is active, by this point, the new filename will be filtered in. + * This upgrade routine restores the defaul service worker filename and deletes the existing service worker. + * Also adds back the filter for new filename. OneSignal compatibility for multisites is not available at this point. + * + * @since 1.8 + */ + if ( version_compare( $current_ver, '1.8', '<' ) && class_exists( 'OneSignal' ) && ! is_multisite() ) { + + // Restore the default service worker filename of SuperPWA. + remove_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + + // Delete service worker if it exists. + superpwa_delete_sw(); + + // Change service worker filename to match OneSignal's service worker. + add_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); + } + // Re-generate manifest superpwa_generate_manifest(); diff --git a/loader.php b/loader.php index 5c5fb40..0f4e539 100644 --- a/loader.php +++ b/loader.php @@ -15,7 +15,7 @@ require_once( SUPERPWA_PATH_ABS . 'admin/admin-ui-render-addons.php' ); // 3rd party compatibility -require_once( SUPERPWA_PATH_ABS . '3rd-party/onesignal.php' ); +if ( ! is_multisite() ) require_once( SUPERPWA_PATH_ABS . '3rd-party/onesignal.php' ); // Load functions require_once( SUPERPWA_PATH_ABS . 'functions/common.php' ); diff --git a/public/sw.php b/public/sw.php index d25726f..99804b1 100644 --- a/public/sw.php +++ b/public/sw.php @@ -28,6 +28,7 @@ * * @since 1.6 * @since 1.7 src to service worker is made relative to accomodate for domain mapped multisites. + * @since 1.8 Added filter superpwa_sw_filename. */ function superpwa_sw( $arg = 'src' ) { From fc7f7d9da9b4788aa1c2d41eeffc101d546d3e9a Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 22:37:37 +0530 Subject: [PATCH 50/58] Removed no longer needed function superpwa_onesignal_manifest_notice_check() --- 3rd-party/onesignal.php | 25 ------------------------- admin/admin-ui-render-settings.php | 12 ------------ admin/basic-setup.php | 4 ++-- readme.txt | 1 + 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 9a3010f..de84a45 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -6,7 +6,6 @@ * * @since 1.6 * - * @function superpwa_onesignal_manifest_notice_check() Check if OneSignal integration notice should be displayed or not * @function superpwa_onesignal_add_gcm_sender_id() Add gcm_sender_id to SuperPWA manifest * @function superpwa_onesignal_sw_filename() Change Service Worker filename to OneSignalSDKWorker.js.php * @function superpwa_onesignal_sw() Import OneSignal service worker in SuperPWA @@ -30,30 +29,6 @@ add_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); } -/** - * Check if OneSignal integration notice should be displayed or not - * - * @return Bool True if notice should be displayed. False otherwise. - * - * @since 1.5 - */ -function superpwa_onesignal_manifest_notice_check() { - - // Get OneSignal settins - $onesignal_wp_settings = get_option( 'OneSignalWPSetting' ); - - // No notice needed if OneSignal custom manifest is enabled and the manifest is the SuperPWA manifest - if ( - ( isset( $onesignal_wp_settings["use_custom_manifest"] ) ) && ( $onesignal_wp_settings["use_custom_manifest"] == 1 ) && - ( isset( $onesignal_wp_settings["custom_manifest_url"] ) ) && ( strcasecmp( trim( $onesignal_wp_settings["custom_manifest_url"] ), superpwa_manifest( 'src' ) ) == 0 ) - ) { - return false; - } - - // Display notice for every other case - return true; -} - /** * Add gcm_sender_id to SuperPWA manifest * diff --git a/admin/admin-ui-render-settings.php b/admin/admin-ui-render-settings.php index 08588eb..16ecf74 100644 --- a/admin/admin-ui-render-settings.php +++ b/admin/admin-ui-render-settings.php @@ -361,18 +361,6 @@ function superpwa_admin_interface_render() { // Show Settings Saved Message settings_errors( 'superpwa_settings_group' ); - } - - // Display the notice to use SuperPWA manifest as OneSignal custom manifest. - if ( superpwa_onesignal_manifest_notice_check() ) { - - echo '

' . - sprintf( - __( 'To integrate with OneSignal: Enable Use my own manifest.json and set %s
as Custom manifest.json URL in OneSignal Configuration > Advanced Settings →', 'super-progressive-web-apps' ), - superpwa_manifest( 'src' ), - admin_url( 'admin.php?page=onesignal-push#configuration' ) - ) . - '

'; } ?> diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 829844c..20d7dcf 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -68,7 +68,7 @@ function superpwa_admin_notices() { // Admin notice on plugin activation if ( get_transient( 'superpwa_admin_notice_activation' ) ) { - $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready with the default settings. ' : ''; + $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) ? 'Your app is ready with the default settings. ' : ''; echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; @@ -102,7 +102,7 @@ function superpwa_network_admin_notices() { // Network admin notice on multisite network activation if ( get_transient( 'superpwa_network_admin_notice_activation' ) ) { - $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) && ( ! superpwa_onesignal_manifest_notice_check() ) ? 'Your app is ready on the main website with the default settings. ' : ''; + $superpwa_is_ready = is_ssl() && superpwa_get_contents( superpwa_manifest( 'abs' ) ) && superpwa_get_contents( superpwa_sw( 'abs' ) ) ? 'Your app is ready on the main website with the default settings. ' : ''; echo '

' . sprintf( __( 'Thank you for installing Super Progressive Web Apps! '. $superpwa_is_ready .'Customize your app →
Note: manifest and service worker for the individual websites will be generated on the first visit to the respective WordPress admin.', 'super-progressive-web-apps' ), admin_url( 'admin.php?page=superpwa' ) ) . '

'; diff --git a/readme.txt b/readme.txt index 68a6552..1a2d3f2 100644 --- a/readme.txt +++ b/readme.txt @@ -153,6 +153,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. +* Bug Fix: Compatibility issues with OneSignal are resolved for single installs. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. = 1.7.1 = From c4e8f11053a8ecc429ca1a21673b67f439b3e772 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Tue, 29 May 2018 23:32:06 +0530 Subject: [PATCH 51/58] Minor update to version comparison logic to handle beta releases --- admin/basic-setup.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/basic-setup.php b/admin/basic-setup.php index 20d7dcf..7cec131 100644 --- a/admin/basic-setup.php +++ b/admin/basic-setup.php @@ -169,8 +169,10 @@ function superpwa_upgrader() { * Until 1.4, there was no UI for orientation and theme_color. * In the manifest, orientation was hard coded as 'natural'. * background_color had UI and this value was used for both background_color and theme_color in the manifest. + * + * @since 1.4 */ - if ( version_compare( $current_ver, '1.4', '<' ) ) { + if ( version_compare( $current_ver, '1.3.1', '<=' ) ) { // Get settings $settings = superpwa_get_settings(); @@ -195,7 +197,7 @@ function superpwa_upgrader() { * * @since 1.8 */ - if ( version_compare( $current_ver, '1.8', '<' ) && class_exists( 'OneSignal' ) && ! is_multisite() ) { + if ( version_compare( $current_ver, '1.7.1', '<=' ) && class_exists( 'OneSignal' ) && ! is_multisite() ) { // Restore the default service worker filename of SuperPWA. remove_filter( 'superpwa_sw_filename', 'superpwa_onesignal_sw_filename' ); From 53d6123a99dfa4eb15a21c1685251490f11769ed Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Wed, 30 May 2018 23:01:52 +0530 Subject: [PATCH 52/58] Rewrote Apple Touch Icons description for better clarity Thanks to Jose --- admin/admin-ui-render-addons.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index a26efd0..6892f9b 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -58,7 +58,7 @@ function superpwa_get_addons( $slug = false ) { ), 'apple_touch_icons' => array( 'name' => __( 'Apple Touch Icons', 'super-progressive-web-apps' ), - 'description' => __( 'Adds the app icons as home screen icons on iOS devices.', 'super-progressive-web-apps' ), + 'description' => __( 'Set the Application Icon and Splash Screen Icon as Apple Touch Icons for compatibility with iOS devices.', 'super-progressive-web-apps' ), 'type' => 'bundled', 'icon' => 'superpwa-128x128.png', 'link' => 'https://superpwa.com/addons/apple-touch-icons/', From a897077a9c3ed369e46422814434c63dde366ed3 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Wed, 30 May 2018 23:02:07 +0530 Subject: [PATCH 53/58] Enhancement: Generated a .pot file with all strings for translation. --- languages/super-progressive-web-apps.pot | 395 +++++++++++++++++++++++ readme.txt | 5 +- 2 files changed, 398 insertions(+), 2 deletions(-) diff --git a/languages/super-progressive-web-apps.pot b/languages/super-progressive-web-apps.pot index e69de29..fe78e35 100644 --- a/languages/super-progressive-web-apps.pot +++ b/languages/super-progressive-web-apps.pot @@ -0,0 +1,395 @@ +# Copyright (C) 2018 Super Progressive Web Apps +# This file is distributed under the same license as the Super Progressive Web Apps package. +msgid "" +msgstr "" +"Project-Id-Version: Super Progressive Web Apps 1.8\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/super-progressive-" +"web-apps\n" +"POT-Creation-Date: 2018-05-30 17:29:08+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" + +#. #-#-#-#-# super-progressive-web-apps.pot (Super Progressive Web Apps 1.8) #-#-#-#-# +#. Plugin Name of the plugin/theme +#: addons/utm-tracking.php:35 admin/admin-ui-setup.php:28 +#: admin/admin-ui-setup.php:31 admin/admin-ui-setup.php:34 +msgid "Super Progressive Web Apps" +msgstr "" + +#: addons/utm-tracking.php:35 admin/admin-ui-render-addons.php:49 +msgid "UTM Tracking" +msgstr "" + +#: addons/utm-tracking.php:146 +msgid "Current Start URL" +msgstr "" + +#: addons/utm-tracking.php:155 +msgid "Campaign Source" +msgstr "" + +#: addons/utm-tracking.php:164 +msgid "Campaign Medium" +msgstr "" + +#: addons/utm-tracking.php:173 +msgid "Campaign Name" +msgstr "" + +#: addons/utm-tracking.php:182 +msgid "Campaign Term" +msgstr "" + +#: addons/utm-tracking.php:191 +msgid "Campaign Content" +msgstr "" + +#: addons/utm-tracking.php:234 +msgid "" +"This add-on automatically adds UTM campaign parameters to the Start " +"Page URL in your manifest. This " +"will help you identify visitors coming specifically from your app. Read more about UTM Tracking." +msgstr "" + +#: addons/utm-tracking.php:264 +msgid "" +"Campaign Source is mandatory and defaults to superpwa. The " +"remaining fields are optional." +msgstr "" + +#: addons/utm-tracking.php:362 admin/admin-ui-render-settings.php:360 +msgid "Settings saved." +msgstr "" + +#: addons/utm-tracking.php:371 +msgid "UTM Tracking for" +msgstr "" + +#: addons/utm-tracking.php:382 admin/admin-ui-render-settings.php:383 +msgid "Save Settings" +msgstr "" + +#: admin/admin-ui-render-addons.php:50 +msgid "" +"Track visits from your app by adding UTM tracking parameters to the Start " +"Page URL." +msgstr "" + +#: admin/admin-ui-render-addons.php:55 +msgid "Customize Settings →" +msgstr "" + +#: admin/admin-ui-render-addons.php:60 +msgid "Apple Touch Icons" +msgstr "" + +#: admin/admin-ui-render-addons.php:61 +msgid "" +"Set the Application Icon and Splash Screen Icon as Apple Touch Icons for " +"compatibility with iOS devices." +msgstr "" + +#: admin/admin-ui-render-addons.php:66 +msgid "More Details →" +msgstr "" + +#: admin/admin-ui-render-addons.php:115 +msgid "Add-On activated: %s. %s" +msgstr "" + +#: admin/admin-ui-render-addons.php:123 +msgid "Add-On deactivated" +msgstr "" + +#: admin/admin-ui-render-addons.php:135 +msgid "Add-Ons for" +msgstr "" + +#: admin/admin-ui-render-addons.php:137 +msgid "Add-Ons extend the functionality of SuperPWA." +msgstr "" + +#: admin/admin-ui-render-addons.php:177 admin/admin-ui-render-addons.php:349 +msgid "Deactivate" +msgstr "" + +#: admin/admin-ui-render-addons.php:182 +msgid "More information about %s" +msgstr "" + +#: admin/admin-ui-render-addons.php:182 +msgid "More Details" +msgstr "" + +#: admin/admin-ui-render-addons.php:197 +msgid "" +"Add-On active. %s" +msgstr "" + +#: admin/admin-ui-render-addons.php:200 +msgid "" +"Compatible with " +"your version of SuperPWA" +msgstr "" + +#: admin/admin-ui-render-addons.php:203 +msgid "" +"Please upgrade " +"to the latest version of SuperPWA" +msgstr "" + +#: admin/admin-ui-render-addons.php:217 +msgid "SuperPWA Newsletter" +msgstr "" + +#: admin/admin-ui-render-addons.php:221 +msgid "" +"Learn more about Progressive Web Apps
and get latest updates about " +"SuperPWA" +msgstr "" + +#: admin/admin-ui-render-addons.php:229 +msgid "Enter your email" +msgstr "" + +#: admin/admin-ui-render-addons.php:231 +msgid "Subscribe" +msgstr "" + +#: admin/admin-ui-render-addons.php:233 +msgid "" +"we'll share our root password before we share your email with " +"anyone else." +msgstr "" + +#: admin/admin-ui-render-addons.php:345 +msgid "Activate" +msgstr "" + +#: admin/admin-ui-render-addons.php:354 +msgid "Install" +msgstr "" + +#: admin/admin-ui-render-settings.php:60 +msgid "" +"Used when there is insufficient space to display the full name of the " +"application. 12 characters or less." +msgstr "" + +#: admin/admin-ui-render-settings.php:83 +msgid "A brief description of what your app is about." +msgstr "" + +#: admin/admin-ui-render-settings.php:108 +msgid "" +"This will be the icon of your app when installed on the phone. Must be a " +"PNG image exactly 192x192 in size." +msgstr "" + +#: admin/admin-ui-render-settings.php:131 +msgid "" +"This icon will be displayed on the splash screen of your app on supported " +"devices. Must be a PNG image exactly 512x512 in " +"size." +msgstr "" + +#: admin/admin-ui-render-settings.php:151 +msgid "Background color of the splash screen." +msgstr "" + +#: admin/admin-ui-render-settings.php:171 +msgid "" +"Theme color is used on supported devices to tint the UI elements of the " +"browser and app switcher. When in doubt, use the same color as " +"Background Color." +msgstr "" + +#: admin/admin-ui-render-settings.php:194 +msgid "— Homepage —" +msgstr "" + +#: admin/admin-ui-render-settings.php:201 +msgid "" +"Specify the page to load when the application is launched from a device. " +"Current start page is %s" +msgstr "" + +#: admin/admin-ui-render-settings.php:209 +msgid "Use AMP version of the start page." +msgstr "" + +#: admin/admin-ui-render-settings.php:215 +msgid "" +"Do not check this if your start page is the homepage, the blog index, or the " +"archives page. AMP for WordPress does not create AMP versions for these " +"pages." +msgstr "" + +#: admin/admin-ui-render-settings.php:241 +msgid "— Default —" +msgstr "" + +#: admin/admin-ui-render-settings.php:248 +msgid "" +"Offline page is displayed when the device is offline and the requested page " +"is not already cached. Current offline page is %s" +msgstr "" + +#: admin/admin-ui-render-settings.php:268 +msgid "Follow Device Orientation" +msgstr "" + +#: admin/admin-ui-render-settings.php:271 +msgid "Portrait" +msgstr "" + +#: admin/admin-ui-render-settings.php:274 +msgid "Landscape" +msgstr "" + +#: admin/admin-ui-render-settings.php:280 +msgid "" +"Set the orientation of your app on devices. When set to Follow Device " +"Orientation your app will rotate as the device is rotated." +msgstr "" + +#: admin/admin-ui-render-settings.php:302 +msgid "" +"Manifest generated successfully. You can see it here →" +msgstr "" + +#: admin/admin-ui-render-settings.php:305 +msgid "" +"Manifest generation failed. Check if WordPress can write to your root folder " +"(the same folder with wp-config.php). Read " +"more →" +msgstr "" + +#: admin/admin-ui-render-settings.php:320 +msgid "Service worker generated successfully." +msgstr "" + +#: admin/admin-ui-render-settings.php:323 +msgid "" +"Service worker generation failed. Check if WordPress can write to your root " +"folder (the same folder with wp-config.php). Read more →" +msgstr "" + +#: admin/admin-ui-render-settings.php:336 +msgid "Your website is served over HTTPS." +msgstr "" + +#: admin/admin-ui-render-settings.php:339 +msgid "" +"Progressive Web Apps require that your website is served over HTTPS. Please " +"contact your host to add a SSL certificate to your domain." +msgstr "" + +#. #-#-#-#-# super-progressive-web-apps.pot (Super Progressive Web Apps 1.8) #-#-#-#-# +#. Author of the plugin/theme +#: admin/admin-ui-setup.php:28 +msgid "SuperPWA" +msgstr "" + +#: admin/admin-ui-setup.php:31 admin/basic-setup.php:279 +msgid "Settings" +msgstr "" + +#: admin/admin-ui-setup.php:34 +msgid "Add-Ons" +msgstr "" + +#: admin/admin-ui-setup.php:63 +msgid "Application Name" +msgstr "" + +#: admin/admin-ui-setup.php:72 +msgid "Application Short Name" +msgstr "" + +#: admin/admin-ui-setup.php:81 +msgid "Description" +msgstr "" + +#: admin/admin-ui-setup.php:90 +msgid "Application Icon" +msgstr "" + +#: admin/admin-ui-setup.php:99 +msgid "Splash Screen Icon" +msgstr "" + +#: admin/admin-ui-setup.php:108 +msgid "Background Color" +msgstr "" + +#: admin/admin-ui-setup.php:117 +msgid "Theme Color" +msgstr "" + +#: admin/admin-ui-setup.php:126 +msgid "Start Page" +msgstr "" + +#: admin/admin-ui-setup.php:135 +msgid "Offline Page" +msgstr "" + +#: admin/admin-ui-setup.php:144 +msgid "Orientation" +msgstr "" + +#: admin/admin-ui-setup.php:153 +msgid "Status" +msgstr "" + +#: admin/admin-ui-setup.php:161 +msgid "Manifest" +msgstr "" + +#: admin/admin-ui-setup.php:170 +msgid "Service Worker" +msgstr "" + +#: admin/admin-ui-setup.php:179 +msgid "HTTPS" +msgstr "" + +#: admin/admin-ui-setup.php:305 +msgid "" +"If you like SuperPWA, please make a " +"donation or leave a ★★" +"★★★ rating to support continued development. Thanks a " +"bunch!" +msgstr "" + +#: admin/basic-setup.php:82 admin/basic-setup.php:116 +msgid "" +"SuperPWA: Successfully updated to version %s. Thank you! Discover new features and read the story →" +"" +msgstr "" + +#: admin/basic-setup.php:295 +msgid "Demo" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "https://superpwa.com/?utm_source=superpwa-plugin&utm_medium=plugin-uri" +msgstr "" + +#. Description of the plugin/theme +msgid "Convert your WordPress website into a Progressive Web App" +msgstr "" + +#. Author URI of the plugin/theme +msgid "https://superpwa.com/?utm_source=superpwa-plugin&utm_medium=author-uri" +msgstr "" diff --git a/readme.txt b/readme.txt index 1a2d3f2..f8d45d9 100644 --- a/readme.txt +++ b/readme.txt @@ -147,12 +147,13 @@ PWA's require browsers with support for service workers and for iOS devices, sup == Changelog == = 1.8 = -* Date: +* Date: 31.May.2018 * Tested with WordPress 4.9.6. -* New Add-On: Apple Touch Icons. Adds the app icons as home screen icons on iOS devices. +* New Add-On: Apple Touch Icons. Set the Application Icon and Splash Screen Icon as Apple Touch Icons for compatibility with iOS devices. * Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. +* Enhancement: Generated a .pot file with all strings for translation. You can also translate SuperPWA to your language by visiting [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/super-progressive-web-apps) * Bug Fix: Compatibility issues with OneSignal are resolved for single installs. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. From 83d3e68862bb1d0429099ea496924bafac296f54 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 31 May 2018 01:14:30 +0530 Subject: [PATCH 54/58] Added placeholders to the optional UTM parameters. --- addons/utm-tracking.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/utm-tracking.php b/addons/utm-tracking.php index b70d55a..f4b6ebf 100644 --- a/addons/utm-tracking.php +++ b/addons/utm-tracking.php @@ -279,7 +279,7 @@ function superpwa_utm_tracking_medium_cb() {
- +
@@ -298,7 +298,7 @@ function superpwa_utm_tracking_name_cb() {
- +
@@ -317,7 +317,7 @@ function superpwa_utm_tracking_term_cb() {
- +
@@ -336,7 +336,7 @@ function superpwa_utm_tracking_content_cb() {
- +
From 4a3b71ef061c648854b98b0b60d090f0943c9034 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 31 May 2018 01:54:26 +0530 Subject: [PATCH 55/58] Updated FAQ in readme.txt --- readme.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index f8d45d9..7ce1630 100644 --- a/readme.txt +++ b/readme.txt @@ -138,7 +138,27 @@ If you have any questions, please ask it on the [support forum](https://wordpres = Will Progressive Web Apps work on iOS devices? = -PWA's require browsers with support for service workers and for iOS devices, support is available in Safari Technology Preview 48, macOS High Sierra 10.13.4 and iOS 11.3 beta seed 2. Since none of these are production releases, the general public will not be able to install your app on their mobile phones and smart devices. We will hopefully see full support by mid 2018. +Starting with Safai and Chrome for iOS 11.3, Apple devices offer partial support for PWA's. However, there is no native Add To Home Screen prompt just yet. You can add your app by tapping "Add to Home Screen" button in the share menu of the browser ( look for the square icon with an up arrow in the foreground ). + +Just like you, we are eagerly awaiting the upcoming releases and we hope to see better compatibility in the coming months. + += How To Customize Splash Screen = + +You can easily change the icon and the background color in SuperPWA > Settings. + +Further customizations are not available right now, not because of any limitation of SuperPWA, but because they are not availalbe in the PWA technology. When more options come up in the future, we will add them to SuperPWA then. + += How To Track Visits Originating From Your Progressive Web App = + +You can track visits from your PWA in your analytics software using the UTM Tracking add-on of SuperPWA. Go to SuperPWA > Add-Ons and activate UTM Tracking. Then in SuperPWA > UTM Tracking, you can set the UTM parameters as needed. Please [refer the documentation](https://superpwa.com/addons/utm-tracking/) for further information. + += GDPR Compliance = + +SuperPWA does not collect or store user data, nor does it set cookies or store tracking data. Content visited by users from your PWA is stored in the user's own device, in the cache of the browser. This is very similar to how modern browsers caches content offline for faster browsing. + +With the UTM Tracking Add-On, you will be able to differentiate the visits originating from your PWA in your analytics software. You may have to include this in your privacy policy. Please note that SuperPWA does track the visits, we just help you add the UTM parameters to the URL of the Start Page of your app so that third party analytics tools can differentiate the visits. + +Feel free to get in touch if you have any questions. == Screenshots == From ca73a7baf0eea6bfbcec3e8814335e5e1eb18498 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 31 May 2018 11:03:40 +0530 Subject: [PATCH 56/58] Added Demo to readme.txt and other updates. --- readme.txt | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/readme.txt b/readme.txt index 7ce1630..a85cd63 100644 --- a/readme.txt +++ b/readme.txt @@ -25,6 +25,14 @@ SuperPWA is easy to configure, it takes less than a minute to set-up your Progre And the best part? If you ever get stuck, we are here to watch your back! [Open a support](https://wordpress.org/support/plugin/super-progressive-web-apps) ticket if you have a question or need a feature. We are super excited to hear your feedback and we want to genuinely help you build the best Progressive Web App for your WordPress website! +#### Quick Demo? + +* Open up [SuperPWA.com](https://superpwa.com/?utm_source=wordpress.org&utm_medium=description-demo) in a supported device. +* Add the website to your home screen either from the Add to Home Screen prompt (Chrome for Android) or from the browser menu. +* Open the app from your home screen and you will see the splash screen. +* Turn off your data and wifi to go offline and open up the app. You will still be able to see the app and browse the pages you have already visited. +* Browse to a page that you haven't visited before. The offline page will be displayed. + #### Thank You PWA Enthusiasts! We are humbled by the feedback from the community. Thanks to everyone who believed in us and tried our plugin. Your feedback has been invaluable and we have learned a lot from your experience. Thank you for your love and support and we hope to return the love by striving to bring you the best ever Progressive Web Apps plugin for WordPress! @@ -40,7 +48,7 @@ Here are the current features of Super Progressive Web Apps: * Aggressive caching of pages using CacheStorage API. * Pages once cached are served even if the user is offline. * Set custom offline page: Select the page you want the user to see when a page that isn't in the cache is accessed and the user is offline. -* New in version 1.2: Support for theme-color. +* New in version 1.2: Support for theme-color meta property. Change the color of browser address bar of Chrome, Firefox OS and Opera to match your website colors. * New in version 1.2: Now you can edit the Application Name and Application Short name. * New in version 1.2: Set the start page of your PWA. * New in version 1.2: Set Accelerated Mobile Pages (AMP) version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP. @@ -52,6 +60,8 @@ Here are the current features of Super Progressive Web Apps: * New in version 1.5: OneSignal integration for Push notifications. * New in version 1.6: WordPress Multisite Network compatibility. * New in version 1.7: Add-Ons for SuperPWA is here! Ships with [UTM Tracking Add-On](https://superpwa.com/addons/utm-tracking/?utm_source=wordpress.org&utm_medium=description) to track visits coming from your PWA. +* New in version 1.8: Compatibility issues with OneSignal are now resolved! +* New in version 1.8: New Add-On: [Apple Touch Icons](https://superpwa.com/addons/apple-touch-icons/?utm_source=wordpress.org&utm_medium=description) that sets your app icons as Apple Touch Icons. **Upcoming features:** @@ -107,7 +117,7 @@ Uh, oh. Your PWA did not work as expected? You do not see the "Add to Home Scree * Make sure your website has a SSL certificate installed. i.e. your website should be https instead of http (as in https://your-domain.com). * Make sure you are using a supported device and a supported browser. Refer to the "Device and Browser Support For PWA" list above. -* Make sure your icon is a PNG and 192px X 192 px in size. +* Make sure your Application Icon and Splash Screen Icon's are of PNG format and 192px X 192px and 512px X 512px in size respectively. * Clear the browser cache and try again. In Chrome for Android, go to Settings > Privacy > "Clear browsing data". * If the application icon does not update after first install, delete the PWA from your phone, clear browser cache and install again. (We are working on making it better.) * Create a [new support ticket](https://wordpress.org/support/plugin/super-progressive-web-apps) and share a link to your website. We will take a look and figure it out for you. @@ -138,7 +148,7 @@ If you have any questions, please ask it on the [support forum](https://wordpres = Will Progressive Web Apps work on iOS devices? = -Starting with Safai and Chrome for iOS 11.3, Apple devices offer partial support for PWA's. However, there is no native Add To Home Screen prompt just yet. You can add your app by tapping "Add to Home Screen" button in the share menu of the browser ( look for the square icon with an up arrow in the foreground ). +Starting with Safari for iOS 11.3, Apple devices offer partial support for PWA's. However, there is no native Add To Home Screen prompt just yet. You can add your app by tapping "Add to Home Screen" button in the share menu of the browser ( look for the square icon with an up arrow in the foreground ). Just like you, we are eagerly awaiting the upcoming releases and we hope to see better compatibility in the coming months. @@ -146,17 +156,17 @@ Just like you, we are eagerly awaiting the upcoming releases and we hope to see You can easily change the icon and the background color in SuperPWA > Settings. -Further customizations are not available right now, not because of any limitation of SuperPWA, but because they are not availalbe in the PWA technology. When more options come up in the future, we will add them to SuperPWA then. +Further customizations are not available right now, not because of any limitation of SuperPWA, but because they are not available in the PWA technology. When more options come up in the future, we will add them to SuperPWA then. = How To Track Visits Originating From Your Progressive Web App = -You can track visits from your PWA in your analytics software using the UTM Tracking add-on of SuperPWA. Go to SuperPWA > Add-Ons and activate UTM Tracking. Then in SuperPWA > UTM Tracking, you can set the UTM parameters as needed. Please [refer the documentation](https://superpwa.com/addons/utm-tracking/) for further information. +You can track visits from your PWA in your analytics software (for e.g. Google Analytics) using the UTM Tracking add-on of SuperPWA. Go to SuperPWA > Add-Ons and activate UTM Tracking. Then in SuperPWA > UTM Tracking, you can set the UTM parameters as needed. Please [refer the documentation](https://superpwa.com/addons/utm-tracking/?utm_source=wordpress.org&utm_medium=description-faq) for further information. = GDPR Compliance = SuperPWA does not collect or store user data, nor does it set cookies or store tracking data. Content visited by users from your PWA is stored in the user's own device, in the cache of the browser. This is very similar to how modern browsers caches content offline for faster browsing. -With the UTM Tracking Add-On, you will be able to differentiate the visits originating from your PWA in your analytics software. You may have to include this in your privacy policy. Please note that SuperPWA does track the visits, we just help you add the UTM parameters to the URL of the Start Page of your app so that third party analytics tools can differentiate the visits. +With the UTM Tracking Add-On, you will be able to differentiate the visits originating from your PWA in your analytics software. You may have to include this in your privacy policy. Please note that SuperPWA does not track the visits, we just help you add the UTM parameters to the URL of the Start Page of your app so that third party analytics tools can differentiate the visits. Feel free to get in touch if you have any questions. @@ -167,13 +177,13 @@ Feel free to get in touch if you have any questions. == Changelog == = 1.8 = -* Date: 31.May.2018 +* Date: [31.May.2018](https://superpwa.com/push-notifications-are-here-again/?utm_source=wordpress.org&utm_medium=changelog) * Tested with WordPress 4.9.6. * New Add-On: Apple Touch Icons. Set the Application Icon and Splash Screen Icon as Apple Touch Icons for compatibility with iOS devices. -* Enhancement: Added support for Add To Home Screen prompt for Chrome 68 and beyond. +* Enhancement: Added support for Add to Home Screen prompt for Chrome 68 and beyond. * Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. * Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. -* Enhancement: Generated a .pot file with all strings for translation. You can also translate SuperPWA to your language by visiting [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/super-progressive-web-apps) +* Enhancement: Generated a .pot file with all strings for translation. You can also translate SuperPWA to your language by visiting [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/super-progressive-web-apps) * Bug Fix: Compatibility issues with OneSignal are resolved for single installs. * Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. @@ -182,7 +192,7 @@ Feel free to get in touch if you have any questions. * Bug Fix: Fix fatal error in PHP versions prior to PHP 5.5. "Cant use function return value in write context". = 1.7 = -* Date: 03.May.2018 +* Date: [03.May.2018](https://superpwa.com/introducing-add-ons-for-superpwa/?utm_source=wordpress.org&utm_medium=changelog) * Minimum required WordPress version is now 3.6.0 (previously 3.5.0). * New Feature: Add-Ons for SuperPWA is here! * New Feature: SuperPWA is now a top-level menu to accommodate for the Add-Ons sub-menu page. @@ -192,7 +202,7 @@ Feel free to get in touch if you have any questions. * Bug Fix: Incorrect manifest and service worker URLs when WordPress is installed in a folder. = 1.6 = -* Date: 23.April.2018 +* Date: [23.April.2018](https://superpwa.com/1-6-released-multisite-network-support/?utm_source=wordpress.org&utm_medium=changelog) * New Feature: WordPress Multisite Network Compatibility. One of the most requested features for SuperPWA is now here! Thanks [@juslintek](https://wordpress.org/support/topic/add-manifest-json-support-for-multisite/#post-9998629) for doing a major share of the heavy lifting. * New Feature: Added description to the manifest. You can now include a brief description of what your app is about. * Enhancement: Moved manifest to the very top of wp_head for better compatibility with some browsers. @@ -209,7 +219,7 @@ Feel free to get in touch if you have any questions. * Enhancement: Added UI notice when using AMP for WordPress to warn user not to use the AMP version of start page if the start page is the homepage, the blog index, or the archives page. = 1.4 = -* Date: 21.February.2018 +* Date: [21.February.2018](https://wordpress.org/support/topic/you-asked-and-we-listened-superpwa-1-4-ships-with-two-user-feature-requests/) * New Feature: Added UI for default orientation of your PWA. Orientation can now be set as "any", "portrait" or "landscape". [Feature request from @doofustoo](https://wordpress.org/support/topic/almost-perfect-335/). * New Feature: Added UI for theme_color property in manifest. [Feature request from @krunalsm](https://wordpress.org/support/topic/diffrent-theme_color-and-background_color/). * Enhancement: Improved compatibility with all major Accelerated Mobile Pages (AMP) plugins. From 9a5e55789b1f7f67ce508c26e08b48d416886fe1 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 31 May 2018 11:04:37 +0530 Subject: [PATCH 57/58] Added New in version 1.8 features --- README.MD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.MD b/README.MD index 13b8833..899221f 100644 --- a/README.MD +++ b/README.MD @@ -104,6 +104,8 @@ Here are the current features of Super Progressive Web Apps: * New in version 1.5: OneSignal integration for Push notifications. * New in version 1.6: WordPress Multisite Network compatibility. * New in version 1.7: Add-Ons for SuperPWA is here! Ships with [UTM Tracking Add-On](https://superpwa.com/addons/utm-tracking/?utm_source=github&utm_medium=readme-version) to track visits coming from your PWA. +* New in version 1.8: Compatibility issues with OneSignal are now resolved! +* New in version 1.8: New Add-On: [Apple Touch Icons](https://superpwa.com/addons/apple-touch-icons/?utm_source=github&utm_medium=readme-version) that sets your app icons as Apple Touch Icons. #### 🔮 Upcoming features: * Offline Indicator Notice. From ad9cb3e3ab6a795f4ae488001986fa045d4cb6a6 Mon Sep 17 00:00:00 2001 From: Arun Basil Lal Date: Thu, 31 May 2018 11:15:09 +0530 Subject: [PATCH 58/58] Added Upgrade Notice for version 1.8 --- readme.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.txt b/readme.txt index a85cd63..3b90311 100644 --- a/readme.txt +++ b/readme.txt @@ -266,6 +266,16 @@ Feel free to get in touch if you have any questions. == Upgrade Notice == += 1.8 = +* Tested with WordPress 4.9.6. +* New Add-On: Apple Touch Icons. Set the Application Icon and Splash Screen Icon as Apple Touch Icons for compatibility with iOS devices. +* Enhancement: Added support for Add to Home Screen prompt for Chrome 68 and beyond. +* Enhancement: Better add-on activation and deactivation by hooking onto admin_post action. +* Enhancement: Attempt to generate manifest and service worker automatically on visiting the SuperPWA settings page after adjusting root folder permissions. +* Enhancement: Generated a .pot file with all strings for translation. You can also translate SuperPWA to your language by visiting translate.wordpress.org/projects/wp-plugins/super-progressive-web-apps +* Bug Fix: Compatibility issues with OneSignal are resolved for single installs. +* Bug Fix: Updated plugin action links and admin notices with the correct admin menu link. + = 1.7.1 = * Bug Fix: Fix fatal error in PHP versions prior to PHP 5.5. "Cant use function return value in write context".