| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/HostingSpaces/admin/aifortoday.co.uk/wwwroot/wp-content/themes/solace/inc/compatibility/ |
Upload File : |
<?php
/**
* PWA Plugin compatibility.
*
* @package Solace\Compatibility
*/
namespace Solace\Compatibility;
/**
* Class PWA
*/
class PWA {
/**
* Init function.
*
* @return bool
*/
public function init() {
if ( ! $this->should_load() ) {
return false;
}
$this->load_hooks();
return true;
}
/**
* Decide if class should run.
*/
private function should_load() {
return defined( 'PWA_VERSION' ) && function_exists( 'wp_service_worker_error_details_template' ) && function_exists( 'pwa_get_header' ) && function_exists( 'wp_service_worker_error_message_placeholder' ) && function_exists( 'pwa_get_footer' );
}
/**
* Load hooks.
*/
private function load_hooks() {
add_action( 'solace_do_offline', array( $this, 'offline_default_template' ) );
add_action( 'solace_do_server_error', array( $this, 'server_error_default_template' ) );
}
/**
* Load offline default template.
*/
public function offline_default_template() {
?>
<main>
<h1><?php esc_html_e( 'Oops! It looks like you’re offline.', 'solace' ); ?></h1>
<?php wp_service_worker_error_message_placeholder(); ?>
</main>
<?php
}
/**
* Load server error template.
*/
public function server_error_default_template() {
?>
<main>
<h1><?php esc_html_e( 'Oops! Something went wrong.', 'solace' ); ?></h1>
<?php wp_service_worker_error_message_placeholder(); ?>
<?php wp_service_worker_error_details_template(); ?>
</main>
<?php
}
}