<?php

/**
* Get started notice
*/

add_action( 'wp_ajax_web_hosting_lite_dismissed_notice_handler', 'web_hosting_lite_ajax_notice_handler' );

function web_hosting_lite_ajax_notice_handler() {
    if ( isset( $_POST['type'] ) ) {
        $type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
        update_option( 'dismissed-' . $type, TRUE );
    }
}

function web_hosting_lite_deprecated_hook_admin_notice() {
        // Check if it's been dismissed...
        if ( ! get_option('dismissed-get_started', FALSE ) ) {
        $current_screen = get_current_screen();
			if ($current_screen->id !== 'appearance_page_web-hosting-lite-guide-page') {
         $web_hosting_lite_comments_theme = wp_get_theme(); ?>
            <div class="web-hosting-lite-notice-wrapper updated notice notice-get-started-class is-dismissible" data-notice="get_started">
			<div class="web-hosting-lite-notice">
				<div class="web-hosting-lite-notice-content">
					<div class="web-hosting-lite-notice-heading">
						<h2><?php esc_html_e('Thanks for installing ','web-hosting-lite'); ?><?php echo esc_html( $web_hosting_lite_comments_theme ); ?> <?php esc_html_e('Theme','web-hosting-lite'); ?></h2>
					<p><?php 
                    /* translators: %s: theme name */
                    printf(esc_html__("%s is now installed and ready to use. We've provide some links to get you started.", 'web-hosting-lite'), $web_hosting_lite_comments_theme ); ?></p>
					</div>
					<div class="diplay-flex-btn">
						<a class="button button-primary" href="<?php echo esc_url(admin_url('themes.php?page=web-hosting-lite-guide-page')); ?>"><?php echo esc_html__('GET STARTED','web-hosting-lite'); ?></a>
						<a class="button button-primary" href="<?php echo esc_url( WEB_HOSTING_LITE_BUY_NOW ); ?>"><?php echo esc_html__('GO TO PREMIUM','web-hosting-lite'); ?></a>
                        <a class="button button-primary import" href="<?php echo esc_url( admin_url( 'themes.php?page=webhostinglite-wizard' ) ); ?>">
                            <?php echo esc_html__('ONE CLICK DEMO IMPORTER', 'web-hosting-lite'); ?>
                        </a>
					</div>
				</div>
				<div class="web-hosting-lite-notice-img">
					<img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/notification.png'); ?>" alt="<?php esc_attr_e('logo', 'web-hosting-lite'); ?>">
				</div>
			</div>
		</div>
        <?php }
	}
}

add_action( 'admin_notices', 'web_hosting_lite_deprecated_hook_admin_notice' );

add_action( 'admin_menu', 'web_hosting_lite_getting_started' );
function web_hosting_lite_getting_started() {
	add_theme_page( esc_html__('Get Started', 'web-hosting-lite'), esc_html__('Get Started', 'web-hosting-lite'), 'edit_theme_options', 'web-hosting-lite-guide-page', 'web_hosting_lite_test_guide');
}

function web_hosting_lite_admin_enqueue_scripts() {
	wp_enqueue_style( 'web-hosting-lite-admin-style', esc_url( get_template_directory_uri() ).'/css/main.css' );
	wp_enqueue_script( 'web-hosting-lite-admin-script', get_template_directory_uri() . '/js/web-hosting-lite-admin-script.js', array( 'jquery' ), '', true );
    wp_localize_script( 'web-hosting-lite-admin-script', 'web_hosting_lite_ajax_object',
        array( 'ajax_url' => admin_url( 'admin-ajax.php' ) )
    );
}
add_action( 'admin_enqueue_scripts', 'web_hosting_lite_admin_enqueue_scripts' );

if ( ! defined( 'WEB_HOSTING_LITE_DOCS_FREE' ) ) {
define('WEB_HOSTING_LITE_DOCS_FREE',__('https://demo.misbahwp.com/docs/web-hosting-free-docs/','web-hosting-lite'));
}
if ( ! defined( 'WEB_HOSTING_LITE_DOCS_PRO' ) ) {
define('WEB_HOSTING_LITE_DOCS_PRO',__('https://demo.misbahwp.com/docs/web-hosting-pro-docs','web-hosting-lite'));
}
if ( ! defined( 'WEB_HOSTING_LITE_BUY_NOW' ) ) {
define('WEB_HOSTING_LITE_BUY_NOW',__('https://www.misbahwp.com/products/hosting-company-wordpress-theme','web-hosting-lite'));
}
if ( ! defined( 'WEB_HOSTING_LITE_SUPPORT_FREE' ) ) {
define('WEB_HOSTING_LITE_SUPPORT_FREE',__('https://wordpress.org/support/theme/web-hosting-lite','web-hosting-lite'));
}
if ( ! defined( 'WEB_HOSTING_LITE_REVIEW_FREE' ) ) {
define('WEB_HOSTING_LITE_REVIEW_FREE',__('https://wordpress.org/support/theme/web-hosting-lite/reviews/#new-post','web-hosting-lite'));
}
if ( ! defined( 'WEB_HOSTING_LITE_DEMO_PRO' ) ) {
define('WEB_HOSTING_LITE_DEMO_PRO',__('https://demo.misbahwp.com/web-hosting/','web-hosting-lite'));
}
if( ! defined( 'WEB_HOSTING_LITE_THEME_BUNDLE' ) ) {
define('WEB_HOSTING_LITE_THEME_BUNDLE',__('https://www.misbahwp.com/products/wordpress-bundle','web-hosting-lite'));
}

function web_hosting_lite_test_guide() { ?>
	<?php $web_hosting_lite_theme = wp_get_theme(); ?>

	<div class="wrap" id="main-page">
		<div id="lefty">
			<div id="admin_links">
				<a href="<?php echo esc_url( WEB_HOSTING_LITE_DOCS_FREE ); ?>" target="_blank" class="blue-button-1"><?php esc_html_e( 'Documentation', 'web-hosting-lite' ) ?></a>
				<a href="<?php echo esc_url( admin_url('customize.php') ); ?>" id="customizer" target="_blank"><?php esc_html_e( 'Customize', 'web-hosting-lite' ); ?> </a>
				<a class="blue-button-1" href="<?php echo esc_url( WEB_HOSTING_LITE_SUPPORT_FREE ); ?>" target="_blank" class="btn3"><?php esc_html_e( 'Support', 'web-hosting-lite' ) ?></a>
				<a class="blue-button-2" href="<?php echo esc_url( WEB_HOSTING_LITE_REVIEW_FREE ); ?>" target="_blank" class="btn4"><?php esc_html_e( 'Review', 'web-hosting-lite' ) ?></a>
			</div>
			<div id="description">
				<h3><?php esc_html_e('Welcome! Thank you for choosing ','web-hosting-lite'); ?><?php echo esc_html( $web_hosting_lite_theme ); ?>  <span><?php esc_html_e('Version: ', 'web-hosting-lite'); ?><?php echo esc_html($web_hosting_lite_theme['Version']);?></span></h3>
				<div class="demo-import-box">
					<h4><?php echo esc_html__('Import homepage demo in just one click.','web-hosting-lite'); ?></h4>
					<p><?php echo esc_html__('Get started with the wordpress theme installation','web-hosting-lite'); ?></p>
					<a class="button button-primary import" href="themes.php?page=webhostinglite-wizard"><?php echo esc_html__('ONE CLICK DEMO IMPORTER','web-hosting-lite'); ?></a>
				</div>
				<img class="img_responsive" style="width:100%;" src="<?php echo esc_url( get_template_directory_uri() ); ?>/screenshot.png">
				<div id="description-insidee">
					<?php
						$web_hosting_lite_theme = wp_get_theme();
						echo wp_kses_post( apply_filters( 'misbah_theme_description', esc_html( $web_hosting_lite_theme->get( 'Description' ) ) ) );
					?>
				</div>
			</div>
		</div>

		<div id="righty">
			<div class="postboxx donate">
				<h3 class="hndle"><?php esc_html_e( 'Upgrade to Premium', 'web-hosting-lite' ); ?></h3>
				<div class="insidee">
					<p><?php esc_html_e('Discover upgraded pro features with premium version click to upgrade.','web-hosting-lite'); ?></p>
					<div id="admin_pro_links">
						<a class="blue-button-2" href="<?php echo esc_url( WEB_HOSTING_LITE_BUY_NOW ); ?>" target="_blank"><?php esc_html_e( 'Go Pro', 'web-hosting-lite' ); ?></a>
						<a class="blue-button-1" href="<?php echo esc_url( WEB_HOSTING_LITE_DEMO_PRO ); ?>" target="_blank"><?php esc_html_e( 'Live Demo', 'web-hosting-lite' ) ?></a>
						<a class="blue-button-2" href="<?php echo esc_url( WEB_HOSTING_LITE_DOCS_PRO ); ?>" target="_blank"><?php esc_html_e( 'Pro Docs', 'web-hosting-lite' ) ?></a>
					</div>
				</div>

				<h3 class="hndle bundle"><?php esc_html_e( 'Get All Themes', 'web-hosting-lite' ); ?></h3>
				<div class="insidee theme-bundle">
					<img width="100%" src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/bundle-image.png' ); ?>" alt="<?php esc_attr_e('logo', 'web-hosting-lite'); ?>">
					<p class="offer"><?php esc_html_e('Get 100+ Perfect WordPress Theme In A Single Package at just $89."','web-hosting-lite'); ?></p>
					<p class="coupon"><?php esc_html_e('Get Our Theme Pack of 100+ WordPress Themes At 15% Off','web-hosting-lite'); ?><span class="coupon-code"><?php esc_html_e('"Bundleup15"','web-hosting-lite'); ?></span></p>
				<div id="admin_pro_linkss">
					<a class="blue-button-1" href="<?php echo esc_url( WEB_HOSTING_LITE_THEME_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy All Themes - $89', 'web-hosting-lite' ) ?></a>
				</div>
				<div class="d-table">
			    <ul class="d-column">
			      <li class="feature"><?php esc_html_e('Features','web-hosting-lite'); ?></li>
			      <li class="free"><?php esc_html_e('Pro','web-hosting-lite'); ?></li>
			      <li class="plus"><?php esc_html_e('Free','web-hosting-lite'); ?></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('24hrs Priority Support','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-yes"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Kirki Framework','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-yes"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Advance Posttype','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('One Click Demo Import','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-yes"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Section Reordering','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Enable / Disable Option','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-yes"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Multiple Sections','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Advance Color Pallete','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Advance Widgets','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-yes"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Page Templates','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Advance Typography','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('Section Background Image / Color ','web-hosting-lite'); ?></li>
			      <li class="right"><span class="dashicons dashicons-yes"></span></li>
			      <li class="wrong"><span class="dashicons dashicons-no"></span></li>
			    </ul>
	  		</div>
			</div>
		</div>
	</div>

<?php } ?>
