<?php
/**
* Get started notice
*/
add_action( 'wp_ajax_movie_review_blog_dismissed_notice_handler', 'movie_review_blog_ajax_notice_handler' );

function movie_review_blog_ajax_notice_handler() {
    check_ajax_referer( 'movie_review_blog_welcome_nonce', 'nonce' );

    if ( isset( $_POST['type'] ) ) {
        $movie_review_blog_type = sanitize_text_field( wp_unslash( $_POST['type'] ) );
        update_option( 'dismissed-' . $movie_review_blog_type, true );
    }
    wp_send_json_success();
}

function movie_review_blog_deprecated_hook_admin_notice() {
    if ( get_option( 'dismissed-get_started', false ) ) {
        return;
    }
    $movie_review_blog_current_screen = get_current_screen();
    if (
        $movie_review_blog_current_screen &&
        $movie_review_blog_current_screen->id !== 'appearance_page_movie-review-blog-guide-page' &&
        $movie_review_blog_current_screen->id !== 'appearance_page_moviereviewblog-wizard'
    ) {
        $movie_review_blog_comments_theme = wp_get_theme();
        ?>
        <div class="movie-review-blog-notice-wrapper notice notice-success notice-get-started-class is-dismissible" data-notice="get_started">
            <div class="movie-review-blog-notice">
                <div class="movie-review-blog-notice-content">
                    <div class="movie-review-blog-notice-heading">
                        <h2>
                            <?php esc_html_e( 'Thanks For Installing ', 'movie-review-blog' ); ?>
                            <?php echo esc_html( $movie_review_blog_comments_theme ); ?>
                            <?php esc_html_e( ' Theme', 'movie-review-blog' ); ?>
                        </h2>
                        <p>
                        <?php
                        printf(
                            esc_html__( '%s is now installed and ready to use. We\'ve provided some links to get you started.', 'movie-review-blog' ),
                            esc_html( $movie_review_blog_comments_theme )
                        );
                        ?>
                        </p>
                    </div>
                    <div class="diplay-flex-btn">
                        <a class="button button-primary"
                           href="<?php echo esc_url( admin_url( 'themes.php?page=movie-review-blog-guide-page' ) ); ?>">
                           <?php esc_html_e( 'GET STARTED', 'movie-review-blog' ); ?>
                        </a>
                        <a class="button button-primary"
                           target="_blank"
                           href="<?php echo esc_url( MOVIE_REVIEW_BLOG_BUY_NOW ); ?>">
                           <?php esc_html_e( 'GO TO PREMIUM', 'movie-review-blog' ); ?>
                        </a>
                        <a class="button button-primary import"
                           href="<?php echo esc_url( admin_url( 'themes.php?page=moviereviewblog-wizard' ) ); ?>">
                           <?php esc_html_e( 'ONE CLICK DEMO IMPORTER', 'movie-review-blog' ); ?>
                        </a>
                    </div>
                </div>
                <div class="movie-review-blog-notice-img">
                    <a href="<?php echo esc_url( MOVIE_REVIEW_BLOG_THEME_BUNDLE ); ?>" target="_blank">
                        <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/notification.png' ); ?>" alt="<?php esc_attr_e( 'logo', 'movie-review-blog' ); ?>">
                    </a>
                </div>
            </div>
        </div>
        <?php
    }
}
add_action( 'admin_notices', 'movie_review_blog_deprecated_hook_admin_notice' );

add_action( 'admin_menu', 'movie_review_blog_getting_started' );
function movie_review_blog_getting_started() {
    add_theme_page(
        esc_html__( 'Get Started', 'movie-review-blog' ),
        esc_html__( 'Get Started', 'movie-review-blog' ),
        'edit_theme_options',
        'movie-review-blog-guide-page',
        'movie_review_blog_test_guide'
    );
}

// After switching theme, reset dismissed notice option
add_action('after_switch_theme', 'movie_review_blog_after_switch_theme');
function movie_review_blog_after_switch_theme() {
    update_option('dismissed-get_started', FALSE);
}

add_action( 'admin_enqueue_scripts', 'movie_review_blog_admin_enqueue_scripts' );
function movie_review_blog_admin_enqueue_scripts( $hook ) {
	wp_enqueue_style(
		'movie-review-blog-admin-style',
		get_template_directory_uri() . '/css/main.css',
		array(),
		wp_get_theme()->get( 'Version' )
	);
	wp_enqueue_script(
		'movie-review-blog-admin-script',
		get_template_directory_uri() . '/js/movie-review-blog-admin-script.js',
		array( 'jquery' ),
		wp_get_theme()->get( 'Version' ),
		true
	);
	wp_localize_script(
		'movie-review-blog-admin-script',
		'movie_review_blog_ajax_object',
		array(
			'ajax_url'      => admin_url( 'admin-ajax.php' ),
			'dismiss_nonce' => wp_create_nonce( 'movie_review_blog_welcome_nonce' ),
			'redirect_url'  => admin_url( 'themes.php?page=movie-review-blog-guide-page' ),
		)
	);
}

if ( ! defined( 'MOVIE_REVIEW_BLOG_DOCS_FREE' ) ) {
define('MOVIE_REVIEW_BLOG_DOCS_FREE',__('https://demo.misbahwp.com/docs/movie-review-blog-free-docs/','movie-review-blog'));
}
 if ( ! defined( 'MOVIE_REVIEW_BLOG_DOCS_PRO' ) ) {
define('MOVIE_REVIEW_BLOG_DOCS_PRO',__('https://demo.misbahwp.com/docs/movie-review-blog-pro-docs/','movie-review-blog'));
}
if ( ! defined( 'MOVIE_REVIEW_BLOG_BUY_NOW' ) ) {
define('MOVIE_REVIEW_BLOG_BUY_NOW',__('https://www.misbahwp.com/products/movie-review-wordpress-theme','movie-review-blog'));
}
if ( ! defined( 'MOVIE_REVIEW_BLOG_SUPPORT_FREE' ) ) {
define('MOVIE_REVIEW_BLOG_SUPPORT_FREE',__('https://wordpress.org/support/theme/movie-review-blog/','movie-review-blog'));
}
if ( ! defined( 'MOVIE_REVIEW_BLOG_REVIEW_FREE' ) ) {
define('MOVIE_REVIEW_BLOG_REVIEW_FREE',__('https://wordpress.org/support/theme/movie-review-blog/reviews/#new-post','movie-review-blog'));
}
if ( ! defined( 'MOVIE_REVIEW_BLOG_DEMO_PRO' ) ) {
define('MOVIE_REVIEW_BLOG_DEMO_PRO',__('https://demo.misbahwp.com/movie-review-blog/','movie-review-blog'));
}
if( ! defined( 'MOVIE_REVIEW_BLOG_THEME_BUNDLE' ) ) {
define('MOVIE_REVIEW_BLOG_THEME_BUNDLE',__('https://www.misbahwp.com/products/wordpress-bundle','movie-review-blog'));
}

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

		<div id="righty">
			<div class="volleyball-postboxx">
				<h3 class="hndle"><?php esc_html_e( 'Upgrade to Premium', 'movie-review-blog' ); ?></h3>
				<div class="volleyball-insidee">
					<p><?php esc_html_e('Discover upgraded pro features with premium version click to upgrade.','movie-review-blog'); ?></p>
					<div id="admin_pro_links">
						<a class="blue-button-2" href="<?php echo esc_url( MOVIE_REVIEW_BLOG_BUY_NOW ); ?>" target="_blank"><?php esc_html_e( 'Go Pro', 'movie-review-blog' ); ?></a>
						<a class="blue-button-1" href="<?php echo esc_url( MOVIE_REVIEW_BLOG_DEMO_PRO ); ?>" target="_blank"><?php esc_html_e( 'Live Demo', 'movie-review-blog' ) ?></a>
						<a class="blue-button-2" href="<?php echo esc_url( MOVIE_REVIEW_BLOG_DOCS_PRO ); ?>" target="_blank"><?php esc_html_e( 'Pro Docs', 'movie-review-blog' ) ?></a>
					</div>
				</div>

				<h3 class="hndle bundle"><?php esc_html_e( 'Get All Themes', 'movie-review-blog' ); ?></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', 'movie-review-blog'); ?>">
					<p class="offer"><?php esc_html_e('Get 100+ Perfect WordPress Theme In A Single Package at just $89.','movie-review-blog'); ?></p>
					<p class="coupon"><?php esc_html_e('Get Our Theme Pack of 100+ WordPress Themes At 30% Off','movie-review-blog'); ?><span class="coupon-code"><?php esc_html_e('"Bundleup15"','movie-review-blog'); ?></span></p>
				<div id="admin_pro_linkss">
					<a class="blue-button-1" href="<?php echo esc_url( MOVIE_REVIEW_BLOG_THEME_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy All Themes - $89', 'movie-review-blog' ) ?></a>
				</div>
				<div class="d-table">
			    <ul class="d-column">
			      <li class="feature"><?php esc_html_e('Features','movie-review-blog'); ?></li>
			      <li class="free"><?php esc_html_e('Pro','movie-review-blog'); ?></li>
			      <li class="plus"><?php esc_html_e('Free','movie-review-blog'); ?></li>
			    </ul>
			    <ul class="d-row">
			      <li class="points"><?php esc_html_e('24hrs Priority Support','movie-review-blog'); ?></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('LearnPress Campatiblity','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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','movie-review-blog'); ?></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 ','movie-review-blog'); ?></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 } ?>