Version Description
- Date: 29.May.2021 Enhancement: Need An Option to exclude the URL #183 Enhancement: Improved Tabs UI design #190
Download this release
Release Info
Developer | superpwa |
Plugin | Super Progressive Web Apps |
Version | 2.1.12 |
Comparing to | |
See all releases |
Code changes from version 2.1.11 to 2.1.12
- addons/apple-touch-icons.php +17 -2
- admin/admin-ui-render-settings.php +18 -1
- admin/admin-ui-setup.php +8 -0
- public/sw.php +31 -0
- readme.txt +5 -0
- superpwa.php +2 -2
addons/apple-touch-icons.php
CHANGED
@@ -299,6 +299,12 @@ function superpwa_apple_icons_interface_render() {
|
|
299 |
}
|
300 |
|
301 |
function superpwa_splashscreen_uploader(){
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
if( (!isset($_POST['security_nonce'])) || (isset($_POST['security_nonce']) && !wp_verify_nonce( $_POST['security_nonce'], 'superpwaIosScreenSecurity' )) ) {
|
303 |
echo json_encode(array('status'=>400, 'message'=>'security nonce not matched'));die;
|
304 |
}
|
@@ -310,14 +316,23 @@ function superpwa_splashscreen_uploader(){
|
|
310 |
}
|
311 |
|
312 |
$upload = wp_upload_dir();
|
313 |
-
$path =
|
|
|
314 |
wp_mkdir_p($path);
|
315 |
-
|
|
|
316 |
WP_Filesystem();
|
317 |
$zipFileName = $path."/splashScreen.zip";
|
318 |
$moveFile = move_uploaded_file($_FILES['file']['tmp_name'], $zipFileName);
|
319 |
if($moveFile){
|
320 |
$result = unzip_file($zipFileName, $path);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
unlink($zipFileName);
|
322 |
}else{
|
323 |
echo json_encode(array('status'=>500, 'message'=>'Files are not uploading'));die;
|
299 |
}
|
300 |
|
301 |
function superpwa_splashscreen_uploader(){
|
302 |
+
|
303 |
+
// Authentication
|
304 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
305 |
+
return;
|
306 |
+
}
|
307 |
+
|
308 |
if( (!isset($_POST['security_nonce'])) || (isset($_POST['security_nonce']) && !wp_verify_nonce( $_POST['security_nonce'], 'superpwaIosScreenSecurity' )) ) {
|
309 |
echo json_encode(array('status'=>400, 'message'=>'security nonce not matched'));die;
|
310 |
}
|
316 |
}
|
317 |
|
318 |
$upload = wp_upload_dir();
|
319 |
+
$path = $upload['basedir']."/superpwa-splashIcons/";
|
320 |
+
$subpath = $upload['basedir']."/superpwa-splashIcons/super_splash_screens/";
|
321 |
wp_mkdir_p($path);
|
322 |
+
file_put_contents($path.'/index.html','');
|
323 |
+
file_put_contents($subpath.'/index.html','');
|
324 |
WP_Filesystem();
|
325 |
$zipFileName = $path."/splashScreen.zip";
|
326 |
$moveFile = move_uploaded_file($_FILES['file']['tmp_name'], $zipFileName);
|
327 |
if($moveFile){
|
328 |
$result = unzip_file($zipFileName, $path);
|
329 |
+
$file_ext = list_files($subpath);
|
330 |
+
foreach ($file_ext as $key => $value) {
|
331 |
+
$ext = wp_check_filetype($value);
|
332 |
+
if(!in_array(strtolower($ext['ext']), array('png','html'))){
|
333 |
+
unlink($value);
|
334 |
+
}
|
335 |
+
}
|
336 |
unlink($zipFileName);
|
337 |
}else{
|
338 |
echo json_encode(array('status'=>500, 'message'=>'Files are not uploading'));die;
|
admin/admin-ui-render-settings.php
CHANGED
@@ -474,6 +474,23 @@ function superpwa_analytics_support_cb() {
|
|
474 |
<?php
|
475 |
}
|
476 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
477 |
|
478 |
/**
|
479 |
* Admin interface renderer
|
@@ -499,7 +516,7 @@ function superpwa_admin_interface_render() {
|
|
499 |
}
|
500 |
|
501 |
?>
|
502 |
-
<style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #
|
503 |
|
504 |
<div class="wrap">
|
505 |
<h1>Super Progressive Web Apps <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
|
474 |
<?php
|
475 |
}
|
476 |
|
477 |
+
/**
|
478 |
+
* Exclude Urls from Cache list of service worker
|
479 |
+
*
|
480 |
+
* @since 2.1.2
|
481 |
+
*/
|
482 |
+
|
483 |
+
function superpwa_exclude_url_cache_cb(){
|
484 |
+
// Get Settings
|
485 |
+
$settings = superpwa_get_settings();
|
486 |
+
?>
|
487 |
+
<label><textarea placeholder="https://example.com/contact-us/, https://example.com/checkout/" rows="4" cols="70" id="superpwa_settings[excluded_urls]" name="superpwa_settings[excluded_urls]"><?php echo (isset($settings['excluded_urls']) ? esc_attr($settings['excluded_urls']): ''); ?></textarea></label>
|
488 |
+
<p><?php echo esc_html__('Note: Seperate the URLs using a Comma(,)', 'super-progressive-web-apps'); ?></p>
|
489 |
+
<p><?php echo esc_html__('Place the list of URLs which you do not want to cache by service worker', 'super-progressive-web-apps'); ?></p>
|
490 |
+
|
491 |
+
<?php
|
492 |
+
}
|
493 |
+
|
494 |
|
495 |
/**
|
496 |
* Admin interface renderer
|
516 |
}
|
517 |
|
518 |
?>
|
519 |
+
<style type="text/css">.spwa-tab {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.spwa-tab a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;}.spwa-tab a:hover {color: #0a4b78;}.spwa-tab a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.spwa-tabcontent {display: none;padding: 6px 12px;border-top: none; animation: fadeEffect 1s; } @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }</style>
|
520 |
|
521 |
<div class="wrap">
|
522 |
<h1>Super Progressive Web Apps <sup><?php echo SUPERPWA_VERSION; ?></sup></h1>
|
admin/admin-ui-setup.php
CHANGED
@@ -255,6 +255,14 @@ function superpwa_register_settings() {
|
|
255 |
'superpwa_pwa_advance_section', // Page slug
|
256 |
'superpwa_pwa_advance_section' // Settings Section ID
|
257 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
add_action( 'admin_init', 'superpwa_register_settings' );
|
260 |
|
255 |
'superpwa_pwa_advance_section', // Page slug
|
256 |
'superpwa_pwa_advance_section' // Settings Section ID
|
257 |
);
|
258 |
+
// Exclude Urls from Cache list
|
259 |
+
add_settings_field(
|
260 |
+
'superpwa_exclude_url_cache_shortcut', // ID
|
261 |
+
__('Exclude URLs from Cache list', 'super-progressive-web-apps'), // Title
|
262 |
+
'superpwa_exclude_url_cache_cb', // CB
|
263 |
+
'superpwa_pwa_advance_section', // Page slug
|
264 |
+
'superpwa_pwa_advance_section' // Settings Section ID
|
265 |
+
);
|
266 |
}
|
267 |
add_action( 'admin_init', 'superpwa_register_settings' );
|
268 |
|
public/sw.php
CHANGED
@@ -347,6 +347,37 @@ function superpwa_offline_page_images( $files_to_cache ) {
|
|
347 |
}
|
348 |
add_filter( 'superpwa_sw_files_to_cache', 'superpwa_offline_page_images' );
|
349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
/**
|
351 |
* Get offline page
|
352 |
*
|
347 |
}
|
348 |
add_filter( 'superpwa_sw_files_to_cache', 'superpwa_offline_page_images' );
|
349 |
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Exclude Urls from Cache list of service worker
|
353 |
+
*
|
354 |
+
* @since 2.1.2
|
355 |
+
*/
|
356 |
+
function superpwa_exclude_urls_cache_sw($never_cacheurls){
|
357 |
+
|
358 |
+
// Get Settings
|
359 |
+
$settings = superpwa_get_settings();
|
360 |
+
if(isset($settings['excluded_urls']) && !empty($settings['excluded_urls'])){
|
361 |
+
|
362 |
+
$exclude_from_cache = $settings['excluded_urls'];
|
363 |
+
|
364 |
+
$exclude_from_cache = str_replace('/', '\/', $exclude_from_cache);
|
365 |
+
$exclude_from_cache = '/'.str_replace(',', '/,/', $exclude_from_cache);
|
366 |
+
|
367 |
+
$exclude_from_cache = str_replace('\//', '/', $exclude_from_cache);
|
368 |
+
|
369 |
+
$exclude_from_cache = $exclude_from_cache.'endslash';
|
370 |
+
|
371 |
+
$exclude_from_cache = str_replace('\/endslash', '/', $exclude_from_cache);
|
372 |
+
|
373 |
+
$never_cacheurls .= ','.$exclude_from_cache;
|
374 |
+
}
|
375 |
+
|
376 |
+
return $never_cacheurls;
|
377 |
+
}
|
378 |
+
|
379 |
+
add_filter( 'superpwa_sw_never_cache_urls', 'superpwa_exclude_urls_cache_sw' );
|
380 |
+
|
381 |
/**
|
382 |
* Get offline page
|
383 |
*
|
readme.txt
CHANGED
@@ -186,6 +186,11 @@ Feel free to get in touch if you have any questions.
|
|
186 |
|
187 |
== Changelog ==
|
188 |
|
|
|
|
|
|
|
|
|
|
|
189 |
= 2.1.11 =
|
190 |
* Date: [17.May.2021](https://superpwa.com/superpwa-2-1-11-release-note/?utm_source=wordpress.org&utm_medium=changelog)
|
191 |
BugFixed: Remediation of Splash Screen Settings #178
|
186 |
|
187 |
== Changelog ==
|
188 |
|
189 |
+
= 2.1.12 =
|
190 |
+
* Date: [29.May.2021](https://superpwa.com/superpwa-2-1-12-release-note/?utm_source=wordpress.org&utm_medium=changelog)
|
191 |
+
Enhancement: Need An Option to exclude the URL #183
|
192 |
+
Enhancement: Improved Tabs UI design #190
|
193 |
+
|
194 |
= 2.1.11 =
|
195 |
* Date: [17.May.2021](https://superpwa.com/superpwa-2-1-11-release-note/?utm_source=wordpress.org&utm_medium=changelog)
|
196 |
BugFixed: Remediation of Splash Screen Settings #178
|
superpwa.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
* Author: SuperPWA
|
7 |
* Author URI: https://profiles.wordpress.org/superpwa/
|
8 |
* Contributors: SuperPWA
|
9 |
-
* Version: 2.1.
|
10 |
* Text Domain: super-progressive-web-apps
|
11 |
* Domain Path: /languages
|
12 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
@@ -43,7 +43,7 @@ if ( ! defined('ABSPATH') ) exit;
|
|
43 |
* @since 1.0
|
44 |
*/
|
45 |
if ( ! defined( 'SUPERPWA_VERSION' ) ) {
|
46 |
-
define( 'SUPERPWA_VERSION' , '2.1.
|
47 |
}
|
48 |
|
49 |
/**
|
6 |
* Author: SuperPWA
|
7 |
* Author URI: https://profiles.wordpress.org/superpwa/
|
8 |
* Contributors: SuperPWA
|
9 |
+
* Version: 2.1.12
|
10 |
* Text Domain: super-progressive-web-apps
|
11 |
* Domain Path: /languages
|
12 |
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
43 |
* @since 1.0
|
44 |
*/
|
45 |
if ( ! defined( 'SUPERPWA_VERSION' ) ) {
|
46 |
+
define( 'SUPERPWA_VERSION' , '2.1.12' );
|
47 |
}
|
48 |
|
49 |
/**
|