diff --git a/3rd-party/onesignal.php b/3rd-party/onesignal.php index 87843d7..de84a45 100644 --- a/3rd-party/onesignal.php +++ b/3rd-party/onesignal.php @@ -2,58 +2,147 @@ /** * 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 + * @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 */ // Exit if accessed directly if ( ! defined('ABSPATH') ) exit; -/** - * 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' ); - - // 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; +// 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' ); + + // 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' ); } /** - * 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_add_gcm_sender_id( $manifest ) { + + $manifest['gcm_sender_id'] = '482941778795'; + + 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'; +} + +/** + * 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_get_gcm_sender_id() { +function superpwa_onesignal_sw( $sw ) { - // If OneSignal is installed and active - if ( class_exists( 'OneSignal' ) ) { - - // This is the gcm_sender_id of OneSignal, same for all installs. - return '482941778795'; - } + $onesignal = '' . PHP_EOL . PHP_EOL; - return false; -} \ No newline at end of file + return $onesignal . $sw; +} + +/** + * 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 + */ +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(); + + // 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' ); + + // Import OneSignal service worker in SuperPWA + add_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); + + // Regenerate SuperPWA service worker + superpwa_generate_sw(); +} +add_action( 'activate_onesignal-free-web-push-notifications/onesignal.php', 'superpwa_onesignal_activation', 11 ); + +/** + * OneSignal deactivation todo + * + * Regenerates SuperPWA manifest. + * Delete current service worker. + * Regenerate SuperPWA service worker. + * + * @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(); + + // 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' ); + + // Remove OneSignal service worker in SuperPWA + remove_filter( 'superpwa_sw_template', 'superpwa_onesignal_sw' ); + + // 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 diff --git a/README.MD b/README.MD index d7c72c7..899221f 100644 --- a/README.MD +++ b/README.MD @@ -11,8 +11,8 @@

- - + + Super Progressive Web Apps

Super Progressive Web Apps

@@ -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,21 @@ ## 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! + +## ⭐ 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! @@ -96,16 +103,38 @@ 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. +* 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. ### Device and Browser Support For PWA - | Chrome Chrome | Firefox Firefox | Safari Safari | Edge Edge | Edge Edge (Mobile) | Opera Mini | 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+ + | | 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. diff --git a/addons/apple-touch-icons.php b/addons/apple-touch-icons.php new file mode 100644 index 0000000..2fae81b --- /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_tags + * + * @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_tags', 'superpwa_ati_add_apple_touch_icons' ); \ No newline at end of file diff --git a/addons/utm-tracking.php b/addons/utm-tracking.php index 8dc066a..f4b6ebf 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' ); } /** @@ -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 ) . ''; } /** @@ -260,8 +260,8 @@ function superpwa_utm_tracking_source_cb() { -

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

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

- + @@ -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() {
- +
diff --git a/admin/admin-ui-render-addons.php b/admin/admin-ui-render-addons.php index 43c49b6..6892f9b 100644 --- a/admin/admin-ui-render-addons.php +++ b/admin/admin-ui-render-addons.php @@ -9,8 +9,8 @@ * @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 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,19 +23,23 @@ * 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' ), + * '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. * ) * ); * * @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 + * @since 1.8 Returns false of $slug isn't found. */ function superpwa_get_addons( $slug = false ) { @@ -43,18 +47,36 @@ 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' ), + 'admin_link_text' => __( 'Customize Settings →', 'super-progressive-web-apps' ), + 'admin_link_target' => 'admin', 'superpwa_min_version' => '1.7', ), + 'apple_touch_icons' => array( + 'name' => __( 'Apple Touch Icons', '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/', + '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', + ), ); - if ( ( $slug === false ) || ( ! isset( $addons[$slug] ) ) ) { + if ( $slug === false ) { return $addons; } + if ( ! isset( $addons[$slug] ) ) { + return false; + } + return $addons[$slug]; } @@ -70,24 +92,35 @@ 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'] ); + + // 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. %s', 'super-progressive-web-apps' ), $addon['name'], $addon['admin_link'], $link_target, $addon['admin_link_text'] ) . '

'; + } } // 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' ); @@ -113,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"' : ''; + + ?>
@@ -121,7 +164,7 @@ function superpwa_addons_interface_render() {

- + @@ -149,11 +192,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. %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' ); + } + else { + _e( 'Please upgrade to the latest version of SuperPWA', 'super-progressive-web-apps' ); + } ?>
@@ -224,18 +272,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': @@ -323,8 +371,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 ) { @@ -332,12 +380,12 @@ 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 ); } // 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; @@ -345,122 +393,108 @@ 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 ); } // 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; // 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; } } /** - * 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. + * Handle add-on activation * + * 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 + * * @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_activator( $slug, $status ) { +function superpwa_addons_handle_activation() { // Get the add-on status - $addon_status = superpwa_addons_status( $slug ); + $addon_status = superpwa_addons_status( $_GET['addon'] ); - // Check if its a valid add-on - if ( ! $addon_status ) { - return false; + // Authentication + 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() ); - // 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; - } + // Add the add-on to the list of active add-ons + $active_addons[] = $_GET['addon']; - // 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 ); + // Write settings back to database + update_option( 'superpwa_active_addons', $active_addons ); - return true; - } - - return false; + // 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' ); /** - * Handle add-on activation and deactivation - * - * Verifies that the activation / deactivation 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 + * Handle add-on deactivation * - * @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.7 + * @since 1.8 */ -function superpwa_addons_handle_activation() { +function superpwa_addons_handle_deactivation() { + + // Get the add-on status + $addon_status = superpwa_addons_status( $_GET['addon'] ); // Authentication - if ( ! isset( $_GET['addon'] ) || ! current_user_can( 'manage_options' ) ) { - return; - } - - // Handing add-on activation - if ( isset( $_GET['superpwa_addon_activate_nonce'] ) && isset( $_GET['addon'] ) && wp_verify_nonce( $_GET['superpwa_addon_activate_nonce'], 'activate' ) ) { + 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/admin/admin-ui-render-settings.php b/admin/admin-ui-render-settings.php index e36d865..16ecf74 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' ); ?>

@@ -286,16 +286,23 @@ 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' ) ); + 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' ); } } @@ -303,15 +310,17 @@ 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 { - 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' ); } } @@ -352,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/admin-setup.php b/admin/admin-ui-setup.php similarity index 99% rename from admin/admin-setup.php rename to admin/admin-ui-setup.php index 7d08625..86df73d 100644 --- a/admin/admin-setup.php +++ b/admin/admin-ui-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 diff --git a/admin/basic-setup.php b/admin/basic-setup.php index b551222..7cec131 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 @@ -43,57 +43,83 @@ 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' ); /** - * Admin notice on plugin activation + * Admin Notices * - * @since 1.2 + * @since 1.2 Admin notice on plugin activation */ -function superpwa_admin_notice_activation() { - - // Return if transient is not set - if ( ! get_transient( 'superpwa_admin_notice_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' ) ) { - $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' ) ) . '

'; + $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' ) ) . '

'; + + // Delete transient + delete_transient( 'superpwa_admin_notice_activation' ); + } - // Delete transient - delete_transient( 'superpwa_admin_notice_activation' ); + // Admin notice on plugin upgrade + if ( get_transient( 'superpwa_admin_notice_upgrade_complete' ) ) { + + 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' ); + } } -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() { - - // Return if transient is not set - if ( ! get_transient( 'superpwa_network_admin_notice_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' ) ) { - $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' ) ) . '

'; + $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' ) ) . '

'; + + // Delete transient + delete_transient( 'superpwa_network_admin_notice_activation' ); + } - // 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: 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' ); + } } -add_action( 'network_admin_notices', 'superpwa_network_admin_notice_activation' ); +add_action( 'network_admin_notices', 'superpwa_network_admin_notices' ); /** * Plugin upgrade todo list @@ -112,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). @@ -138,13 +164,15 @@ 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'. * 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(); @@ -159,6 +187,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.7.1', '<=' ) && 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(); @@ -170,6 +220,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' ); @@ -223,7 +276,7 @@ function superpwa_settings_link( $links ) { return array_merge( array( - 'settings' => '' . __( 'Settings', 'super-progressive-web-apps' ) . '' + 'settings' => '' . __( 'Settings', 'super-progressive-web-apps' ) . '' ), $links ); @@ -239,7 +292,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 ); } 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(); 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/loader.php b/loader.php index c2d3ee1..0f4e539 100644 --- a/loader.php +++ b/loader.php @@ -10,12 +10,12 @@ // 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' ); // 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' ); @@ -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 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/public/manifest.php b/public/manifest.php index a6361f6..11d09c0 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. + $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; } @@ -107,14 +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 . '' . PHP_EOL; - echo '' . PHP_EOL; + $tags = '' . PHP_EOL; + $tags .= '' . PHP_EOL; + $tags .= '' . PHP_EOL; + + $tags = apply_filters( 'superpwa_wp_head_tags', $tags ); + + $tags .= '' . PHP_EOL . PHP_EOL; + + echo $tags; } add_action( 'wp_head', 'superpwa_add_manifest_to_wp_head', 0 ); diff --git a/public/sw.php b/public/sw.php index e4f5dfb..99804b1 100644 --- a/public/sw.php +++ b/public/sw.php @@ -28,10 +28,11 @@ * * @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' ) { - $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 ) { @@ -105,7 +106,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) { diff --git a/readme.txt b/readme.txt index 6b0a50e..3b90311 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 @@ -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,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 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. + += 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 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 (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 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. == Screenshots == @@ -146,12 +176,23 @@ PWA's require browsers with support for service workers and for iOS devices, sup == Changelog == += 1.8 = +* 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: 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. + = 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". = 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. @@ -161,7 +202,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup * 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. @@ -178,7 +219,7 @@ PWA's require browsers with support for service workers and for iOS devices, sup * 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. @@ -225,6 +266,16 @@ PWA's require browsers with support for service workers and for iOS devices, sup == 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". diff --git a/superpwa.php b/superpwa.php index af33306..5d9cb5e 100644 --- a/superpwa.php +++ b/superpwa.php @@ -1,12 +1,12 @@