Skip to content

Commit

Permalink
Merge pull request #371 from SuperPWA/2.2.11
Browse files Browse the repository at this point in the history
2.2.11
  • Loading branch information
akshaywali committed Dec 29, 2022
2 parents 06254c5 + 0264481 commit b717e27
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
8 changes: 5 additions & 3 deletions addons/apple-touch-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
function superpwa_ati_add_apple_touch_icons( $tags ) {

// Get the icons added via SuperPWA > Settings
$icons = superpwa_get_pwa_icons();
//$icons = superpwa_get_pwa_icons();
// Get settings
$settings = superpwa_get_settings();

Expand All @@ -43,8 +43,10 @@ function superpwa_ati_add_apple_touch_icons( $tags ) {
$tags .= '<meta name="apple-mobile-web-app-capable" content="yes">' . PHP_EOL;
$tags .= '<meta name="apple-mobile-web-app-status-bar-style" content="'.esc_attr($status_bar_style).'">' . PHP_EOL;

foreach( $icons as $icon ) {
$tags .= '<link rel="apple-touch-icon" sizes="' . $icon['sizes'] . '" href="' . $icon['src'] . '">' . PHP_EOL;
if(isset($settings['icon']) && !empty($settings['icon']))
{
$tags .= '<link rel="apple-touch-icon" href="' .$settings['icon'] . '">' . PHP_EOL;
$tags .= '<link rel="apple-touch-icon" sizes="192x192" href="' .$settings['icon'] . '">' . PHP_EOL;
}
//Ios splash screen
$iosScreenSetting = get_option( 'superpwa_apple_icons_uploaded' );
Expand Down
2 changes: 1 addition & 1 deletion admin/admin-ui-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function superpwa_validater_and_sanitizer( $settings ) {
// Sanitize application icon
$settings['icon'] = sanitize_text_field( $settings['icon'] ) == '' ? superpwa_httpsify( SUPERPWA_PATH_SRC . 'public/images/logo.png' ) : sanitize_text_field( superpwa_httpsify( $settings['icon'] ) );

$settings['screenshots'] = sanitize_text_field( $settings['screenshots'] ) == '' ? superpwa_httpsify( SUPERPWA_PATH_SRC . 'public/images/screenshot-472x1024.png' ) : sanitize_text_field( superpwa_httpsify( $settings['screenshots'] ) );
$settings['screenshots'] = sanitize_text_field( $settings['screenshots'] );

// Sanitize splash screen icon
$settings['splash_icon'] = sanitize_text_field( superpwa_httpsify( $settings['splash_icon'] ) );
Expand Down
2 changes: 1 addition & 1 deletion functions/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function superpwa_get_start_url( $rel = false ) {
$settings = superpwa_get_settings();

// Start Page
$start_url = get_permalink( $settings['start_url'] ) ? get_permalink( $settings['start_url'] ) : superpwa_get_bloginfo( 'sw' );
$start_url = (isset($settings['start_url']) && get_permalink( $settings['start_url'] )) ? get_permalink( $settings['start_url'] ) : superpwa_get_bloginfo( 'sw' );

// Force HTTPS
$start_url = superpwa_httpsify( $start_url );
Expand Down
7 changes: 4 additions & 3 deletions public/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ function superpwa_manifest_template() {
}

$manifest['icons'] = superpwa_get_pwa_icons();
if(superpwa_get_pwa_screenshots())
$screenshots=superpwa_get_pwa_screenshots();
if($screenshots)
{
$manifest['screenshots'] = superpwa_get_pwa_screenshots();
$manifest['screenshots'] = $screenshots;
}
$manifest['background_color'] = $settings['background_color'];
$manifest['theme_color'] = $settings['theme_color'];
Expand Down Expand Up @@ -367,7 +368,7 @@ function superpwa_get_pwa_screenshots() {
foreach($tmp_arr as $item){
$screenshot_array[] = array(
'src' => $item,
'sizes' => '472x1024', // must be 472x1024.
// 'sizes' => '472x1024', // must be 472x1024.
'type' => 'image/png', // must be image/png

);
Expand Down
8 changes: 4 additions & 4 deletions public/sw.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,23 +453,23 @@ function superpwa_get_offline_page() {
// Get Settings
$settings = superpwa_get_settings();

return get_permalink( $settings['offline_page'] ) ? superpwa_httpsify( get_permalink( $settings['offline_page'] ) ) : superpwa_httpsify( superpwa_get_bloginfo( 'sw' ) );
return (isset($settings['offline_page'] ) && get_permalink( $settings['offline_page'] )) ? superpwa_httpsify( get_permalink( $settings['offline_page'] ) ) : superpwa_httpsify( superpwa_get_bloginfo( 'sw' ) );
}

/**
* Change superpwa_sw_filename When WP Fastest Cache is active.
* @since 2.1.6
*/
function superpwa_wp_fastest_cache_sw_filename( $sw_filename ) {
return 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js&action=wpfastestcache';
return 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js?timestamp='.time();
}

/**
* Change superpwa_sw_filename When WP Fastest Cache is active.
* Change superpwa_sw_filename When Bypass cache option is active.
* @since 2.1.6
*/
function superpwa_wp_bypass_sw_url_cache_filename( $sw_filename ) {
return 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js&action=bypasscache';
return 'superpwa-sw' . superpwa_multisite_filename_postfix() . '.js?timestamp='.time();
}

function superpwa_third_party_plugins_sw_filename(){
Expand Down
8 changes: 8 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ Feel free to get in touch if you have any questions.

== Changelog ==

= 2.2.11 =
* Date: [29.December.2022](https://superpwa.com/superpwa-2-2-11-release-note/?utm_source=wordpress.org&utm_medium=changelog)
* BugFixed : Error and warning in application section #358
* BugFixed : APP screenshots option default link #370
* BugFixed : A warning appears under the start page and offline page options after resting the settings. #313
* BugFixed : Script does not have a MIME type. #280
* BugFixed : Splash Screen Icon is taking app icon image IOS #290 #302

= 2.2.10 =
* Date: [09.December.2022](https://superpwa.com/superpwa-2-2-10-release-note/?utm_source=wordpress.org&utm_medium=changelog)
* BugFixed : An error with SuperPWA is displayed while testing in the Page speed dev tool. #362
Expand Down
4 changes: 2 additions & 2 deletions superpwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Author: SuperPWA
* Author URI: https://profiles.wordpress.org/superpwa/
* Contributors: SuperPWA
* Version: 2.2.10
* Version: 2.2.11
* Text Domain: super-progressive-web-apps
* Domain Path: /languages
* License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand Down Expand Up @@ -43,7 +43,7 @@
* @since 1.0
*/
if ( ! defined( 'SUPERPWA_VERSION' ) ) {
define( 'SUPERPWA_VERSION' , '2.2.10' );
define( 'SUPERPWA_VERSION' , '2.2.11' );
}

/**
Expand Down

0 comments on commit b717e27

Please sign in to comment.