Version Description
- Date: 10. February.2018
- New Feature: Added support for high-quality splash screen. You can now set the 512x512 icon for the splash screen of your Progressive Web App.
- Enhancement: Super Progressive Web Apps now accounts for content updates and will update the cache as you update the website.
- Enhancement: Improved in-browser service worker update handling.
- Enhancement: Added automatic upgrade of manifest and service worker on plugin upgrade.
- Bug fix: Only GET requests are served from the cache now. Fixes this.
Download this release
Release Info
Developer | arunbasillal |
Plugin | Super Progressive Web Apps |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- admin/admin-setup.php +16 -3
- admin/admin-ui-render.php +24 -2
- admin/basic-setup.php +32 -0
- admin/js/main.js +16 -1
- public/images/logo-512x512.png +0 -0
- public/js/register-sw.js +2 -1
- public/manifest.php +33 -7
- public/sw.php +23 -0
- readme.txt +22 -6
- superpwa.php +3 -10
admin/admin-setup.php
CHANGED
@@ -68,7 +68,16 @@ function superpwa_register_settings() {
|
|
68 |
add_settings_field(
|
69 |
'superpwa_icons', // ID
|
70 |
__('Application Icon', 'super-progressive-web-apps'), // Title
|
71 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
'superpwa_basic_settings_section', // Page slug
|
73 |
'superpwa_basic_settings_section' // Settings Section ID
|
74 |
);
|
@@ -154,7 +163,10 @@ function superpwa_validater_and_sanitizer( $settings ) {
|
|
154 |
$settings['background_color'] = preg_match( '/#([a-f0-9]{3}){1,2}\b/i', $settings['background_color'] ) ? sanitize_text_field( $settings['background_color'] ) : '#D5E0EB';
|
155 |
|
156 |
// Sanitize application icon
|
157 |
-
$settings['icon'] = sanitize_text_field($settings['icon']) == '' ? SUPERPWA_PATH_SRC . 'public/images/logo.png' : sanitize_text_field($settings['icon']);
|
|
|
|
|
|
|
158 |
|
159 |
return $settings;
|
160 |
}
|
@@ -171,6 +183,7 @@ function superpwa_get_settings() {
|
|
171 |
'app_name' => get_bloginfo('name'),
|
172 |
'app_short_name' => get_bloginfo('name'),
|
173 |
'icon' => SUPERPWA_PATH_SRC . 'public/images/logo.png',
|
|
|
174 |
'background_color' => '#D5E0EB',
|
175 |
'start_url' => 0,
|
176 |
'start_url_amp' => 0,
|
@@ -202,6 +215,6 @@ function superpwa_enqueue_css_js( $hook ) {
|
|
202 |
wp_enqueue_media();
|
203 |
|
204 |
// Main JS
|
205 |
-
wp_enqueue_script( 'superpwa-main-js', SUPERPWA_PATH_SRC . 'admin/js/main.js', array( 'wp-color-picker' ),
|
206 |
}
|
207 |
add_action( 'admin_enqueue_scripts', 'superpwa_enqueue_css_js' );
|
68 |
add_settings_field(
|
69 |
'superpwa_icons', // ID
|
70 |
__('Application Icon', 'super-progressive-web-apps'), // Title
|
71 |
+
'superpwa_app_icon_cb', // Callback function
|
72 |
+
'superpwa_basic_settings_section', // Page slug
|
73 |
+
'superpwa_basic_settings_section' // Settings Section ID
|
74 |
+
);
|
75 |
+
|
76 |
+
// Splash Screen Icon
|
77 |
+
add_settings_field(
|
78 |
+
'superpwa_splash_icon', // ID
|
79 |
+
__('Splash Screen Icon', 'super-progressive-web-apps'), // Title
|
80 |
+
'superpwa_splash_icon_cb', // Callback function
|
81 |
'superpwa_basic_settings_section', // Page slug
|
82 |
'superpwa_basic_settings_section' // Settings Section ID
|
83 |
);
|
163 |
$settings['background_color'] = preg_match( '/#([a-f0-9]{3}){1,2}\b/i', $settings['background_color'] ) ? sanitize_text_field( $settings['background_color'] ) : '#D5E0EB';
|
164 |
|
165 |
// Sanitize application icon
|
166 |
+
$settings['icon'] = sanitize_text_field( $settings['icon'] ) == '' ? SUPERPWA_PATH_SRC . 'public/images/logo.png' : sanitize_text_field( $settings['icon'] );
|
167 |
+
|
168 |
+
// Sanitize splash screen icon
|
169 |
+
$settings['splash_icon'] = sanitize_text_field( $settings['splash_icon'] );
|
170 |
|
171 |
return $settings;
|
172 |
}
|
183 |
'app_name' => get_bloginfo('name'),
|
184 |
'app_short_name' => get_bloginfo('name'),
|
185 |
'icon' => SUPERPWA_PATH_SRC . 'public/images/logo.png',
|
186 |
+
'splash_icon' => SUPERPWA_PATH_SRC . 'public/images/logo-512x512.png',
|
187 |
'background_color' => '#D5E0EB',
|
188 |
'start_url' => 0,
|
189 |
'start_url_amp' => 0,
|
215 |
wp_enqueue_media();
|
216 |
|
217 |
// Main JS
|
218 |
+
wp_enqueue_script( 'superpwa-main-js', SUPERPWA_PATH_SRC . 'admin/js/main.js', array( 'wp-color-picker' ), SUPERPWA_VERSION, true );
|
219 |
}
|
220 |
add_action( 'admin_enqueue_scripts', 'superpwa_enqueue_css_js' );
|
admin/admin-ui-render.php
CHANGED
@@ -6,7 +6,8 @@
|
|
6 |
* @function superpwa_app_name_cb() Application Name
|
7 |
* @function superpwa_app_short_name_cb() Application Short Name
|
8 |
* @function superpwa_background_color_cb() Splash Screen Background Color
|
9 |
-
* @function
|
|
|
10 |
* @function superpwa_start_url_cb() Start URL Dropdown
|
11 |
* @function superpwa_offline_page_cb() Offline Page Dropdown
|
12 |
* @function superpwa_manifest_status_cb() Manifest Status
|
@@ -63,7 +64,7 @@ function superpwa_app_short_name_cb() {
|
|
63 |
*
|
64 |
* @since 1.0
|
65 |
*/
|
66 |
-
function
|
67 |
|
68 |
// Get Settings
|
69 |
$settings = superpwa_get_settings(); ?>
|
@@ -79,6 +80,27 @@ function superpwa_icons_cb() {
|
|
79 |
<?php
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
/**
|
83 |
* Splash Screen Background Color
|
84 |
*
|
6 |
* @function superpwa_app_name_cb() Application Name
|
7 |
* @function superpwa_app_short_name_cb() Application Short Name
|
8 |
* @function superpwa_background_color_cb() Splash Screen Background Color
|
9 |
+
* @function superpwa_app_icon_cb() Application Icon
|
10 |
+
* @function superpwa_app_icon_cb() Splash Screen Icon
|
11 |
* @function superpwa_start_url_cb() Start URL Dropdown
|
12 |
* @function superpwa_offline_page_cb() Offline Page Dropdown
|
13 |
* @function superpwa_manifest_status_cb() Manifest Status
|
64 |
*
|
65 |
* @since 1.0
|
66 |
*/
|
67 |
+
function superpwa_app_icon_cb() {
|
68 |
|
69 |
// Get Settings
|
70 |
$settings = superpwa_get_settings(); ?>
|
80 |
<?php
|
81 |
}
|
82 |
|
83 |
+
/**
|
84 |
+
* Splash Screen Icon
|
85 |
+
*
|
86 |
+
* @since 1.3
|
87 |
+
*/
|
88 |
+
function superpwa_splash_icon_cb() {
|
89 |
+
|
90 |
+
// Get Settings
|
91 |
+
$settings = superpwa_get_settings(); ?>
|
92 |
+
|
93 |
+
<!-- Splash Screen Icon -->
|
94 |
+
<input type="text" name="superpwa_settings[splash_icon]" id="superpwa_settings[splash_icon]" class="superpwa-splash-icon regular-text" size="50" value="<?php echo isset( $settings['splash_icon'] ) ? esc_attr( $settings['splash_icon']) : ''; ?>">
|
95 |
+
<button type="button" class="button superpwa-splash-icon-upload" data-editor="content">
|
96 |
+
<span class="dashicons dashicons-format-image" style="margin-top: 4px;"></span> Choose Icon
|
97 |
+
</button>
|
98 |
+
|
99 |
+
<p class="description" id="tagline-description"><?php _e('This icon will be displayed on the splash screen of your app on supported devices. Must be a <code>PNG</code> image exactly <code>512x512</code> in size.', 'super-progressive-web-apps'); ?></p>
|
100 |
+
|
101 |
+
<?php
|
102 |
+
}
|
103 |
+
|
104 |
/**
|
105 |
* Splash Screen Background Color
|
106 |
*
|
admin/basic-setup.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
* @since 1.0
|
6 |
* @function superpwa_activate_plugin() Plugin activatation todo list
|
7 |
* @function superpwa_admin_notice_activation() Admin notice on plugin activation
|
|
|
8 |
* @function superpwa_deactivate_plugin Plugin deactivation todo list
|
9 |
* @function superpwa_load_plugin_textdomain() Load plugin text domain
|
10 |
* @function superpwa_settings_link() Print direct link to plugin settings in plugins list in admin
|
@@ -60,6 +61,37 @@ function superpwa_admin_notice_activation() {
|
|
60 |
delete_transient( 'superpwa_admin_notice_activation' );
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
/**
|
64 |
* Plugin deactivation todo list
|
65 |
*
|
5 |
* @since 1.0
|
6 |
* @function superpwa_activate_plugin() Plugin activatation todo list
|
7 |
* @function superpwa_admin_notice_activation() Admin notice on plugin activation
|
8 |
+
* @function superpwa_upgrader() Plugin upgrade todo list
|
9 |
* @function superpwa_deactivate_plugin Plugin deactivation todo list
|
10 |
* @function superpwa_load_plugin_textdomain() Load plugin text domain
|
11 |
* @function superpwa_settings_link() Print direct link to plugin settings in plugins list in admin
|
61 |
delete_transient( 'superpwa_admin_notice_activation' );
|
62 |
}
|
63 |
|
64 |
+
/**
|
65 |
+
* Plugin upgrade todo list
|
66 |
+
*
|
67 |
+
* @since 1.4
|
68 |
+
*/
|
69 |
+
function superpwa_upgrader() {
|
70 |
+
|
71 |
+
$current_ver = get_option('superpwa_version');
|
72 |
+
|
73 |
+
// Return if we have already done this todo
|
74 |
+
if ( $current_ver == SUPERPWA_VERSION )
|
75 |
+
return;
|
76 |
+
|
77 |
+
// Return if this is the first time the plugin is installed.
|
78 |
+
if ( $current_ver === false ) {
|
79 |
+
|
80 |
+
add_option( 'superpwa_version', SUPERPWA_VERSION );
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
// Re-generate manifest
|
85 |
+
superpwa_generate_manifest();
|
86 |
+
|
87 |
+
// Re-generate service worker
|
88 |
+
superpwa_generate_sw();
|
89 |
+
|
90 |
+
// Add current version to database
|
91 |
+
update_option( 'superpwa_version', SUPERPWA_VERSION );
|
92 |
+
}
|
93 |
+
add_action( 'admin_init', 'superpwa_upgrader' );
|
94 |
+
|
95 |
/**
|
96 |
* Plugin deactivation todo list
|
97 |
*
|
admin/js/main.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
jQuery(document).ready(function($){
|
2 |
$('.superpwa-colorpicker').wpColorPicker(); // Color picker
|
3 |
-
$('.superpwa-icon-upload').click(function(e) { //
|
4 |
e.preventDefault();
|
5 |
var superpwa_meda_uploader = wp.media({
|
6 |
title: 'Application Icon',
|
@@ -15,4 +15,19 @@ jQuery(document).ready(function($){
|
|
15 |
})
|
16 |
.open();
|
17 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
});
|
1 |
jQuery(document).ready(function($){
|
2 |
$('.superpwa-colorpicker').wpColorPicker(); // Color picker
|
3 |
+
$('.superpwa-icon-upload').click(function(e) { // Application Icon upload
|
4 |
e.preventDefault();
|
5 |
var superpwa_meda_uploader = wp.media({
|
6 |
title: 'Application Icon',
|
15 |
})
|
16 |
.open();
|
17 |
});
|
18 |
+
$('.superpwa-splash-icon-upload').click(function(e) { // Splash Screen Icon upload
|
19 |
+
e.preventDefault();
|
20 |
+
var superpwa_meda_uploader = wp.media({
|
21 |
+
title: 'Splash Screen Icon',
|
22 |
+
button: {
|
23 |
+
text: 'Select Icon'
|
24 |
+
},
|
25 |
+
multiple: false // Set this to true to allow multiple files to be selected
|
26 |
+
})
|
27 |
+
.on('select', function() {
|
28 |
+
var attachment = superpwa_meda_uploader.state().get('selection').first().toJSON();
|
29 |
+
$('.superpwa-splash-icon').val(attachment.url);
|
30 |
+
})
|
31 |
+
.open();
|
32 |
+
});
|
33 |
});
|
public/images/logo-512x512.png
ADDED
Binary file
|
public/js/register-sw.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
if ('serviceWorker' in navigator) {
|
2 |
window.addEventListener('load', function() {
|
3 |
navigator.serviceWorker.register(superpwa_sw.url)
|
4 |
-
.then(function() { console.log('SuperPWA service worker ready'); })
|
|
|
5 |
});
|
6 |
}
|
1 |
if ('serviceWorker' in navigator) {
|
2 |
window.addEventListener('load', function() {
|
3 |
navigator.serviceWorker.register(superpwa_sw.url)
|
4 |
+
.then(function(registration) { console.log('SuperPWA service worker ready'); registration.update(); })
|
5 |
+
.catch(function(error) { console.log('Registration failed with ' + error); });
|
6 |
});
|
7 |
}
|
public/manifest.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
* @function superpwa_add_manifest_to_header() Add manifest to header (wp_head)
|
8 |
* @function superpwa_register_service_worker() Register service worker in the footer (wp_footer)
|
9 |
* @function superpwa_delete_manifest() Delete manifest
|
|
|
10 |
*/
|
11 |
|
12 |
// Exit if accessed directly
|
@@ -26,13 +27,7 @@ function superpwa_generate_manifest() {
|
|
26 |
$manifest = array(
|
27 |
'name' => $settings['app_name'],
|
28 |
'short_name' => $settings['app_short_name'],
|
29 |
-
'icons' =>
|
30 |
-
array(
|
31 |
-
'src' => $settings['icon'],
|
32 |
-
'sizes' => '192x192', // must be 192x192. Todo: use getimagesize($settings['icon'])[0].'x'.getimagesize($settings['icon'])[1] in the future
|
33 |
-
'type' => 'image/png', // must be image/png. Todo: use getimagesize($settings['icon'])['mime']
|
34 |
-
),
|
35 |
-
),
|
36 |
'background_color' => $settings['background_color'],
|
37 |
'theme_color' => $settings['background_color'],
|
38 |
'display' => 'standalone',
|
@@ -73,4 +68,35 @@ add_action( 'wp_head', 'superpwa_add_manifest_to_header' );
|
|
73 |
function superpwa_delete_manifest() {
|
74 |
|
75 |
return superpwa_delete( SUPERPWA_MANIFEST_ABS );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
}
|
7 |
* @function superpwa_add_manifest_to_header() Add manifest to header (wp_head)
|
8 |
* @function superpwa_register_service_worker() Register service worker in the footer (wp_footer)
|
9 |
* @function superpwa_delete_manifest() Delete manifest
|
10 |
+
* @function superpwa_get_pwa_icons() Get PWA Icons
|
11 |
*/
|
12 |
|
13 |
// Exit if accessed directly
|
27 |
$manifest = array(
|
28 |
'name' => $settings['app_name'],
|
29 |
'short_name' => $settings['app_short_name'],
|
30 |
+
'icons' => superpwa_get_pwa_icons(),
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
'background_color' => $settings['background_color'],
|
32 |
'theme_color' => $settings['background_color'],
|
33 |
'display' => 'standalone',
|
68 |
function superpwa_delete_manifest() {
|
69 |
|
70 |
return superpwa_delete( SUPERPWA_MANIFEST_ABS );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Get PWA Icons
|
75 |
+
*
|
76 |
+
* @return array An array of icons to be used as the application icons and splash screen icons
|
77 |
+
* @since 1.3
|
78 |
+
*/
|
79 |
+
function superpwa_get_pwa_icons() {
|
80 |
+
|
81 |
+
// Get settings
|
82 |
+
$settings = superpwa_get_settings();
|
83 |
+
|
84 |
+
// Application icon
|
85 |
+
$icons_array[] = array(
|
86 |
+
'src' => $settings['icon'],
|
87 |
+
'sizes' => '192x192', // must be 192x192. Todo: use getimagesize($settings['icon'])[0].'x'.getimagesize($settings['icon'])[1] in the future
|
88 |
+
'type' => 'image/png', // must be image/png. Todo: use getimagesize($settings['icon'])['mime']
|
89 |
+
);
|
90 |
+
|
91 |
+
// Splash screen icon - Added since 1.3
|
92 |
+
if ( @$settings['splash_icon'] != null ) {
|
93 |
+
|
94 |
+
$icons_array[] = array(
|
95 |
+
'src' => $settings['splash_icon'],
|
96 |
+
'sizes' => '512x512', // must be 192x192.
|
97 |
+
'type' => 'image/png', // must be image/png
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
return $icons_array;
|
102 |
}
|
public/sw.php
CHANGED
@@ -101,6 +101,29 @@ self.addEventListener('fetch', function(e) {
|
|
101 |
// Return if request url protocal isn't http or https
|
102 |
if ( ! e.request.url.match(/^(http|https):\/\//i) )
|
103 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
e.respondWith(
|
106 |
caches.match(e.request).then(function(response) {
|
101 |
// Return if request url protocal isn't http or https
|
102 |
if ( ! e.request.url.match(/^(http|https):\/\//i) )
|
103 |
return;
|
104 |
+
|
105 |
+
// For POST requests, do not use the cache. Serve offline page if offline.
|
106 |
+
if ( e.request.method !== 'GET' ) {
|
107 |
+
e.respondWith(
|
108 |
+
fetch(e.request).catch( function() {
|
109 |
+
return caches.match(offlinePage);
|
110 |
+
})
|
111 |
+
);
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
// Revving strategy
|
116 |
+
if ( e.request.mode === 'navigate' && navigator.onLine ) {
|
117 |
+
e.respondWith(
|
118 |
+
fetch(e.request).then(function(response) {
|
119 |
+
return caches.open(cacheName).then(function(cache) {
|
120 |
+
cache.put(e.request, response.clone());
|
121 |
+
return response;
|
122 |
+
});
|
123 |
+
})
|
124 |
+
);
|
125 |
+
return;
|
126 |
+
}
|
127 |
|
128 |
e.respondWith(
|
129 |
caches.match(e.request).then(function(response) {
|
readme.txt
CHANGED
@@ -32,12 +32,13 @@ Here are the current features of Super Progressive Web Apps:
|
|
32 |
* New in version 1.2: Now you can edit the Application Name and Application Short name.
|
33 |
* New in version 1.2: Set the start page of your PWA.
|
34 |
* New in version 1.2: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
|
|
|
|
|
|
35 |
|
36 |
-
**
|
37 |
|
38 |
-
*
|
39 |
-
* Better handling of service worker updates.
|
40 |
-
* Better UI.
|
41 |
|
42 |
### Progressive Web App Minimum Requirements
|
43 |
|
@@ -124,6 +125,14 @@ If you have any questions, please ask it on the [support forum](https://wordpres
|
|
124 |
|
125 |
== Changelog ==
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
= 1.2 =
|
128 |
* Date: 06.February.2018
|
129 |
* New Feature: Support for theme-color.
|
@@ -132,7 +141,7 @@ If you have any questions, please ask it on the [support forum](https://wordpres
|
|
132 |
* New Feature: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
133 |
* UI Improvement: Better organization of plugin settings. More intuitive with inline help.
|
134 |
* UI Improvement: Added admin notice with a link to settings page on plugin activation.
|
135 |
-
* UI Improvement: Added checks for manifest,
|
136 |
* Bug fix: Fix a parse error that showed up only on PHP 5.3.
|
137 |
|
138 |
= 1.1.1 =
|
@@ -151,6 +160,13 @@ If you have any questions, please ask it on the [support forum](https://wordpres
|
|
151 |
|
152 |
== Upgrade Notice ==
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= 1.2 =
|
155 |
* Date: 06.February.2018
|
156 |
* New Feature: Support for theme-color.
|
@@ -159,7 +175,7 @@ If you have any questions, please ask it on the [support forum](https://wordpres
|
|
159 |
* New Feature: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
160 |
* UI Improvement: Better organization of plugin settings. More intuitive with inline help.
|
161 |
* UI Improvement: Added admin notice with a link to settings page on plugin activation.
|
162 |
-
* UI Improvement: Added checks for manifest,
|
163 |
* Bug fix: Fix a parse error that showed up only on PHP 5.3.
|
164 |
|
165 |
= 1.1.1 =
|
32 |
* New in version 1.2: Now you can edit the Application Name and Application Short name.
|
33 |
* New in version 1.2: Set the start page of your PWA.
|
34 |
* New in version 1.2: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
35 |
+
* New in version 1.3: Added support for high-quality splash screen. You can now set the 512x512 icon for the splash screen of your Progressive Web App.
|
36 |
+
* New in version 1.3: Super Progressive Web Apps now accounts for content updates and will update the cache as you update the website.
|
37 |
+
* New in version 1.3: Improved in-browser service worker update handling.
|
38 |
|
39 |
+
**Upcoming features:**
|
40 |
|
41 |
+
* Push notifications.
|
|
|
|
|
42 |
|
43 |
### Progressive Web App Minimum Requirements
|
44 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 1.3 =
|
129 |
+
* Date: 10. February.2018
|
130 |
+
* New Feature: Added support for high-quality splash screen. You can now set the 512x512 icon for the splash screen of your Progressive Web App.
|
131 |
+
* Enhancement: Super Progressive Web Apps now accounts for content updates and will update the cache as you update the website.
|
132 |
+
* Enhancement: Improved in-browser service worker update handling.
|
133 |
+
* Enhancement: Added automatic upgrade of manifest and service worker on plugin upgrade.
|
134 |
+
* Bug fix: Only GET requests are served from the cache now. Fixes [this](https://wordpress.org/support/topic/errors-in-firefox-and-chrome/).
|
135 |
+
|
136 |
= 1.2 =
|
137 |
* Date: 06.February.2018
|
138 |
* New Feature: Support for theme-color.
|
141 |
* New Feature: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
142 |
* UI Improvement: Better organization of plugin settings. More intuitive with inline help.
|
143 |
* UI Improvement: Added admin notice with a link to settings page on plugin activation.
|
144 |
+
* UI Improvement: Added checks for manifest, service worker and HTTPS and display the status neatly in the UI.
|
145 |
* Bug fix: Fix a parse error that showed up only on PHP 5.3.
|
146 |
|
147 |
= 1.1.1 =
|
160 |
|
161 |
== Upgrade Notice ==
|
162 |
|
163 |
+
= 1.3 =
|
164 |
+
* Date: 10. February.2018
|
165 |
+
* New Feature: Added support for high-quality splash screen. You can now set the 512x512 icon for the splash screen of your Progressive Web App.
|
166 |
+
* Enhancement: Super Progressive Web Apps now accounts for content updates and will update the cache as you update the website.
|
167 |
+
* Enhancement: Improved in-browser service worker update handling.
|
168 |
+
* Enhancement: Added automatic upgrade of manifest and service worker on plugin upgrade.
|
169 |
+
|
170 |
= 1.2 =
|
171 |
* Date: 06.February.2018
|
172 |
* New Feature: Support for theme-color.
|
175 |
* New Feature: Set AMP version of the start page. Supported plugins: AMP for WordPress, AMP for WP, Better AMP, AMP Supremacy, WP AMP.
|
176 |
* UI Improvement: Better organization of plugin settings. More intuitive with inline help.
|
177 |
* UI Improvement: Added admin notice with a link to settings page on plugin activation.
|
178 |
+
* UI Improvement: Added checks for manifest, service worker and HTTPS and display the status neatly in the UI.
|
179 |
* Bug fix: Fix a parse error that showed up only on PHP 5.3.
|
180 |
|
181 |
= 1.1.1 =
|
superpwa.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Convert your WordPress website into a Progressive Web App
|
6 |
* Author: SuperPWA
|
7 |
* Contributors: Arun Basil Lal, Jose Varghese
|
8 |
-
* Version: 1.
|
9 |
* Text Domain: super-progressive-web-apps
|
10 |
* Domain Path: /languages
|
11 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
@@ -35,6 +35,7 @@
|
|
35 |
* ~ Release TODO ~
|
36 |
*
|
37 |
* Update SUPERPWA_VERSION
|
|
|
38 |
*/
|
39 |
|
40 |
// Exit if accessed directly
|
@@ -47,7 +48,7 @@ if ( ! defined('ABSPATH') ) exit;
|
|
47 |
*/
|
48 |
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/superpwa/
|
49 |
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/superpwa/
|
50 |
-
if ( ! defined('SUPERPWA_VERSION') ) define('SUPERPWA_VERSION', '1.
|
51 |
if ( ! defined('SUPERPWA_MANIFEST_FILENAME') ) define('SUPERPWA_MANIFEST_FILENAME', 'superpwa-manifest.json'); // Name of Manifest file
|
52 |
if ( ! defined('SUPERPWA_MANIFEST_ABS') ) define('SUPERPWA_MANIFEST_ABS', trailingslashit( ABSPATH ) . SUPERPWA_MANIFEST_FILENAME); // Absolute path to manifest
|
53 |
if ( ! defined('SUPERPWA_MANIFEST_SRC') ) define('SUPERPWA_MANIFEST_SRC', trailingslashit( get_bloginfo('wpurl') ) . SUPERPWA_MANIFEST_FILENAME); // Link to manifest
|
@@ -55,14 +56,6 @@ if ( ! defined('SUPERPWA_SW_FILENAME') ) define('SUPERPWA_SW_FILENAME', 'super
|
|
55 |
if ( ! defined('SUPERPWA_SW_ABS') ) define('SUPERPWA_SW_ABS', trailingslashit( ABSPATH ) . SUPERPWA_SW_FILENAME); // Absolute path to service worker. SW must be in the root folder
|
56 |
if ( ! defined('SUPERPWA_SW_SRC') ) define('SUPERPWA_SW_SRC', trailingslashit( get_bloginfo('wpurl') ) . SUPERPWA_SW_FILENAME); // Link to service worker
|
57 |
|
58 |
-
/**
|
59 |
-
* Add plugin version to database
|
60 |
-
*
|
61 |
-
* @since 1.0
|
62 |
-
* @refer https://codex.wordpress.org/Creating_Tables_with_Plugins#Adding_an_Upgrade_Function
|
63 |
-
*/
|
64 |
-
update_option('superpwa_version', SUPERPWA_VERSION); // Change this to add_option if a release needs to check installed version.
|
65 |
-
|
66 |
// Load everything
|
67 |
require_once( SUPERPWA_PATH_ABS . 'admin/loader.php');
|
68 |
|
5 |
* Description: Convert your WordPress website into a Progressive Web App
|
6 |
* Author: SuperPWA
|
7 |
* Contributors: Arun Basil Lal, Jose Varghese
|
8 |
+
* Version: 1.3
|
9 |
* Text Domain: super-progressive-web-apps
|
10 |
* Domain Path: /languages
|
11 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
35 |
* ~ Release TODO ~
|
36 |
*
|
37 |
* Update SUPERPWA_VERSION
|
38 |
+
* Spellcheck readme.txt
|
39 |
*/
|
40 |
|
41 |
// Exit if accessed directly
|
48 |
*/
|
49 |
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/superpwa/
|
50 |
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/superpwa/
|
51 |
+
if ( ! defined('SUPERPWA_VERSION') ) define('SUPERPWA_VERSION', '1.3'); // Plugin version
|
52 |
if ( ! defined('SUPERPWA_MANIFEST_FILENAME') ) define('SUPERPWA_MANIFEST_FILENAME', 'superpwa-manifest.json'); // Name of Manifest file
|
53 |
if ( ! defined('SUPERPWA_MANIFEST_ABS') ) define('SUPERPWA_MANIFEST_ABS', trailingslashit( ABSPATH ) . SUPERPWA_MANIFEST_FILENAME); // Absolute path to manifest
|
54 |
if ( ! defined('SUPERPWA_MANIFEST_SRC') ) define('SUPERPWA_MANIFEST_SRC', trailingslashit( get_bloginfo('wpurl') ) . SUPERPWA_MANIFEST_FILENAME); // Link to manifest
|
56 |
if ( ! defined('SUPERPWA_SW_ABS') ) define('SUPERPWA_SW_ABS', trailingslashit( ABSPATH ) . SUPERPWA_SW_FILENAME); // Absolute path to service worker. SW must be in the root folder
|
57 |
if ( ! defined('SUPERPWA_SW_SRC') ) define('SUPERPWA_SW_SRC', trailingslashit( get_bloginfo('wpurl') ) . SUPERPWA_SW_FILENAME); // Link to service worker
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
// Load everything
|
60 |
require_once( SUPERPWA_PATH_ABS . 'admin/loader.php');
|
61 |
|