Skip to content

Commit

Permalink
Merge pull request #565 from SuperPWA/2.2.32
Browse files Browse the repository at this point in the history
2.2.32
  • Loading branch information
akshaywali authored Nov 26, 2024
2 parents 1c06f8c + 556f789 commit 285b4f5
Show file tree
Hide file tree
Showing 14 changed files with 635 additions and 46 deletions.
2 changes: 1 addition & 1 deletion addons/apple-touch-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ function superpwa_apple_icons_interface_render() {

<?php superpwa_setting_tabs_html(); ?>

<form action="options.php" method="post" enctype="multipart/form-data">
<form action="<?php echo esc_url(admin_url("options.php")); ?>" method="post" enctype="multipart/form-data">
<?php
// Output nonce, action, and option_page fields for a settings page.
settings_fields( 'superpwa_apple_icons_settings_group' );
Expand Down
2 changes: 1 addition & 1 deletion addons/caching-strategies.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function superpwa_caching_strategies_interface_render() {

<?php superpwa_setting_tabs_html(); ?>

<form action="options.php" method="post" class="form-table" enctype="multipart/form-data">
<form action="<?php echo esc_url(admin_url("options.php")); ?>" method="post" class="form-table" enctype="multipart/form-data">
<?php
// Output nonce, action, and option_page fields for a settings page.
settings_fields( 'superpwa_caching_strategies_settings_group' );
Expand Down
2 changes: 1 addition & 1 deletion addons/pull-to-refresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function superpwa_pull_to_refresh_interface_render()

<?php superpwa_setting_tabs_html(); ?>

<form action="options.php" method="post" enctype="multipart/form-data">
<form action="<?php echo esc_url(admin_url("options.php")); ?>" method="post" enctype="multipart/form-data">
<?php
// Output nonce, action, and option_page fields for a settings page.
settings_fields('superpwa_pull_to_refresh_settings_group');
Expand Down
2 changes: 1 addition & 1 deletion addons/utm-tracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ function superpwa_utm_tracking_interface_render() {

<?php superpwa_setting_tabs_html(); ?>

<form action="options.php" method="post" enctype="multipart/form-data">
<form action="<?php echo esc_url(admin_url("options.php")); ?>" method="post" enctype="multipart/form-data">
<?php
// Output nonce, action, and option_page fields for a settings page.
settings_fields( 'superpwa_utm_tracking_settings_group' );
Expand Down
16 changes: 14 additions & 2 deletions admin/admin-ui-render-addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
* @since 1.8 Returns false of $slug isn't found.
*/
function superpwa_get_addons( $slug = false ) {

// Add-Ons array
$addons = array(
'pull_to_refresh' => array(
Expand Down Expand Up @@ -262,7 +261,7 @@ function superpwa_get_addons( $slug = false ) {
'superpwa_min_version' => '2.2.26',
'category' => 'subtab-all subtab-usability',
),
'utm_tracking' => array(
'utm_tracking' => array(
'name' => __( 'UTM Tracking', 'super-progressive-web-apps' ),
'description' => __( 'Track visits from your app by adding UTM tracking parameters to the Start Page URL.', 'super-progressive-web-apps' ),
'type' => 'bundled',
Expand All @@ -274,6 +273,19 @@ function superpwa_get_addons( $slug = false ) {
'superpwa_min_version' => '1.7',
'category' => 'subtab-all subtab-analytics',
),
'offline_form_for_superpwa' => array(
'name' => __( 'Offline Form', 'super-progressive-web-apps' ),
'description' => __( 'Store your forms data when you are offline and sync data when you are online with one click.', 'super-progressive-web-apps' ),
'type' => 'addon_pro',
'icon' => 'offline.png',
'link' => 'https://superpwa.com/docs',
'more_link' => 'https://superpwa.com/docs',
'admin_link' => admin_url('admin.php?page=superpwa-offline-form'),
'admin_link_text' => __( 'Customize Settings &rarr;', 'super-progressive-web-apps' ),
'admin_link_target' => 'admin',
'superpwa_min_version' => '2.2.32',
'category' => 'subtab-all subtab-usability',
),

);

Expand Down
4 changes: 2 additions & 2 deletions admin/admin-ui-render-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ function superpwa_sw_status_cb() {
/**
* Check to see if the file exists, If not attempts to generate a new one.
*/
if ( superpwa_file_exists( superpwa_sw( 'src' ) . superpwa_nginx_server_fix() ) || superpwa_generate_sw() ){
if ( superpwa_file_exists( superpwa_sw( 'src' ) . superpwa_nginx_server_fix( superpwa_sw( 'src' ) ) ) || superpwa_generate_sw() ){
?>
<p><span class="dashicons dashicons-yes" style="color: #46b450;"></span><?php echo esc_html__( 'Service worker generated successfully', 'super-progressive-web-apps' ) ?>.&nbsp;
<a href="<?php echo esc_url(superpwa_sw( 'src' )); ?>" target="_blank"><?php echo esc_html__( 'See it here', 'super-progressive-web-apps' ) ?> &rarr;</a></p>
Expand Down Expand Up @@ -1015,7 +1015,7 @@ function superpwa_admin_interface_render() {
} ?>
<h1><?php echo esc_html__('Super Progressive Web Apps', 'super-progressive-web-apps'); ?> <sup><?php echo esc_html(SUPERPWA_VERSION); ?></sup></h1>

<form action="options.php" method="post" enctype="multipart/form-data">
<form action="<?php echo esc_url(admin_url("options.php")); ?>" method="post" enctype="multipart/form-data">
<?php
// Output nonce, action, and option_page fields for a settings page.
settings_fields( 'superpwa_settings_group' );
Expand Down
12 changes: 10 additions & 2 deletions admin/basic-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,17 @@ function superpwa_manifest_query_vars($vars) {
return $vars;
}

function superpwa_nginx_server_fix() {
/*
* Fix for nginx server when sw.js does not return 200 status code
*/
function superpwa_nginx_server_fix( $sw_url ) {
if (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
return '/';
$response = wp_remote_head( $sw_url );
if ( is_wp_error( $response ) ) {
return '';
}
$response_code = wp_remote_retrieve_response_code( $response );
return ( 200 !== $response_code ) ? '/':'';
}
return '';
}
Binary file added admin/img/offline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
= 2.2.32 =
* Date: [26.November.2024](https://superpwa.com/superpwa-2-2-32-release-note/?utm_source=wordpress.org&utm_medium=changelog)
* Feature: Added feature of Offline form. #297
* BugFixed: Exclude Add to home screen banner option is not working. #556
* BugFixed: SuperPWA Non-AMP install page's instruction 1st step is showing a <b> tag and 2nd is not translating #559
* BugFixed: CTA banner not working properly. #562
* Improvement: correct contact link #558
* Improvement: Manifest generation cause 503 on settings page save when superpwa_file_exists returns false #564
* Test: Test with WordPress version 6.7 #561

= 2.2.31 =
* Date: [09.October.2024](https://superpwa.com/superpwa-2-2-31-release-note/?utm_source=wordpress.org&utm_medium=changelog)
* Feature: Added feature to add APKs to the iOS App Store. #516
Expand Down
Loading

0 comments on commit 285b4f5

Please sign in to comment.