PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/myvideomania.com/wp-content/themes/hestia/inc/compatibility/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //home/trave494/myvideomania.com/wp-content/themes/hestia/inc/compatibility/class-hestia-pwa.php

<?php
/**
 * PWA Compatibility Class
 *
 * @package Hestia
 */

/**
 * Class PWA
 */
class Hestia_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( 'hestia_do_offline', array( $this, 'offline_default_template' ) );
		add_action( 'hestia_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&#8217;re offline.', 'hestia' ); ?></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.', 'hestia' ); ?></h1>
			<?php wp_service_worker_error_message_placeholder(); ?>
			<?php wp_service_worker_error_details_template(); ?>
		</main>
		<?php
	}
}