<?php
add_action( 'admin_menu', 'mattress_shop_gettingstarted' );
function mattress_shop_gettingstarted() {
	add_theme_page( esc_html__('About Theme', 'mattress-shop'), esc_html__('About Theme', 'mattress-shop'), 'edit_theme_options', 'mattress-shop-guide-page', 'mattress_shop_guide');
}

function mattress_shop_admin_theme_style() {
   wp_enqueue_style('mattress-shop-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('mattress-shop-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');

        // Admin notice code START
		wp_register_script('mattress-shop-notice', esc_url( get_template_directory_uri()) . '/inc/dashboard//js/notice.js', array('jquery'), time(), true);
		wp_enqueue_script('mattress-shop-notice');
		// Admin notice code END
}
add_action('admin_enqueue_scripts', 'mattress_shop_admin_theme_style');         

function mattress_shop_notice(){
    global $pagenow;
    if ( is_admin() && $pagenow === 'themes.php' && (!isset($_GET['page']) || $_GET['page'] !== 'mattress-shop-guide-page')
) {
$mattress_shop_meta = get_option( 'mattress_shop_admin_notice' );
	if (!$mattress_shop_meta) {?>
    <div id="mattress-shop-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info">
			<div class="notice-image">
				<img style="width: 100%;max-width: 320px;line-height: 40px;display: inline-block;vertical-align: top;" src="<?php echo esc_url(get_stylesheet_directory_uri()) .'/screenshot.png'; ?>" />
			</div>
			<div class="notice-content">
				<h2><?php esc_html_e( 'Thanks For Installing Mattress Shop, You Rock!', 'mattress-shop' ) ?> </h2>
				<p><?php esc_html_e( 'Take benefit of a variety of features, functionalities, elements, and an exclusive set of customization options to build your own professional charity website. Please Click on the link below to know the theme setup information.', 'mattress-shop' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=mattress-shop-guide-page' )); ?>"><?php esc_html_e( 'Getting Started', 'mattress-shop' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'mattress-shop') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'mattress-shop') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'mattress-shop') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php
 }
}
}
add_action('admin_notices', 'mattress_shop_notice');

// Admin notice code START
function mattress_shop_dismissed_notice() {
	update_option( 'mattress_shop_admin_notice', true );
}
add_action( 'wp_ajax_mattress_shop_dismissed_notice', 'mattress_shop_dismissed_notice' );

//After Switch theme function
add_action('after_switch_theme', 'mattress_shop_getstart_setup_options');
function mattress_shop_getstart_setup_options () {
    update_option('mattress_shop_admin_notice', false );
}
// Admin notice code END

/**
 * Theme Info Page
 */
function mattress_shop_guide() {
	// Theme info
	$mattress_shop_return = add_query_arg( array()) ;
	$mattress_shop_theme = wp_get_theme( 'mattress-shop' ); ?>

	<div class="wrap getting-started">
		<div class="getting-started__header">
		    <div>
                <h2 class="tgmpa-notice-warning"></h2>
            </div>
		</div>
		<div class="tab-sec">
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="mattress_shop_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'About Theme', 'mattress-shop' ); ?></button>
				<button role="tab" class="tablinks" onclick="mattress_shop_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'mattress-shop' ); ?></button>
				<button role="tab" class="tablinks" onclick="mattress_shop_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'mattress-shop' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( MATTRESS_SHOP_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'mattress-shop' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( MATTRESS_SHOP_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'mattress-shop' ); ?>
				</a>
			</div>
			<div  id="bwp_getstart" class="tabcontent">
				<div class="row">
					<div class="col-md-5 intro">
						<div class="pad-box">
							<h2><?php esc_html_e( 'Welcome to Mattress Shop ', 'mattress-shop' ); ?>
							<span><?php esc_html_e( 'Version: ', 'mattress-shop' ); ?><?php echo esc_html($mattress_shop_theme['Version']);?></span>
							</h2>
							<span class="intro__version"><?php esc_html_e( 'Congratulations! You are about to use the most easy to use and flexible WordPress theme.', 'mattress-shop' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'mattress-shop' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<p class="notice-text"><strong><?php echo esc_html__( 'Click the button below to visit your site.', 'mattress-shop' ); ?></strong></p>
                                <?php echo '<span><a href="' . esc_url(home_url()) . '" class="site-btn" target="_blank">' . esc_html__('VIEW SITE', 'mattress-shop') . '</a></span>'; ?>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'mattress-shop'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','mattress-shop'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','mattress-shop'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','mattress-shop'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','mattress-shop'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','mattress-shop'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','mattress-shop'); ?></a> <?php esc_html_e( 'your website.','mattress-shop'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','mattress-shop'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','mattress-shop'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','mattress-shop'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','mattress-shop'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( MATTRESS_SHOP_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'mattress-shop'); ?></a>
							</ol>
						</div>
					</div>
				</div>
			</div>
			<div  id="bwp_setup" class="tabcontent">
				<h2 class="tg-docs-section intruction-title" id="section-4"><?php esc_html_e( '1) Setup Mattress Shop Theme', 'mattress-shop' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Transform your online business with Mattress Shop, a modern, responsive, and user-friendly theme crafted for mattress retailers, bedding shops, furniture stores, and home décor businesses, covering relevant search terms such as mattress shop, mattress store, bedding shop, sleep products, bedroom furniture, mattress sale, orthopedic mattress, memory foam mattress, latex mattress, hybrid mattress, pillow store, bed frame store, sleep accessories, home interior shop, furniture marketplace, back care mattress, cooling gel mattress, premium mattresses, and online mattress store. Designed with versatility in mind, it also caters perfectly to a housewife looking to start or manage a home-based online mattress or bedding business with ease and efficiency. Whether you sell mattresses, pillows, bed frames, toppers, or sleep essentials, this theme helps you build a professional and conversion-focused store effortlessly. Featuring a clean layout and intuitive navigation, Mattress Shop delivers a smooth shopping experience while supporting an eCommerce plugin like WooCommerce for product listings, inventory control, secure payments, and order management. The flexible design allows you to showcase mattress collections, highlight comfort, durability, and support features, and present pricing clearly. Optimized for search visibility, speed, and mobile performance, it works seamlessly across all devices. With built-in options for product reviews, promotional banners, discount offers, size guides, comparison sections, and customer testimonials, Mattress Shop is ideal for sleep product marketplaces, bedroom décor stores, and furniture businesses looking to grow online sales and strengthen their digital presence.', 'mattress-shop' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','mattress-shop'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','mattress-shop'); ?></a> <?php esc_html_e( 'your website.','mattress-shop'); ?> </l>
								<li><?php esc_html_e( 'Mattress Shop','mattress-shop'); ?> <a target="_blank" href="<?php echo esc_url( MATTRESS_SHOP_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','mattress-shop'); ?></a> </li>
							</ol>
						</div>
					</div>
					<div class="col-md-5">
						<div class="pad-box">
								<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/screenshot.png'); ?>"/>
						</div>
					</div>	
				</div>
			</div>
			<div class="col-md-12 text-block tabcontent"  id="bwp_premium_info">
				<h2 class="dashboard-install-title"><?php esc_html_e( '2) Premium Theme Information.','mattress-shop'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'mattress-shop'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','mattress-shop'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'The Mattress WordPress Theme is designed to give mattress retailers, furniture shops, and home decor businesses a professional online presence with ease. Its modern, responsive layout ensures your store looks visually appealing across all devices, helping you attract andretain customers effortlessly. With clean design elements, smooth navigation, and customizable options, this theme allows you to showcase your products in the best way possible. Whether you sell premium mattresses, orthopedic mattresses, bedding accessories, or related sleep solutions, the theme provides an organized product display that emphasizes comfort and quality. Built with an SEO-friendly structure, fast-loading pages, and a user-friendly design, it allows your business to rank better on search engines and deliver an exceptional shopping experience. The themes elegant design, combined with its practical features, ensures your mattress shop stands out from competitors in the digital marketplace.', 'mattress-shop' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','mattress-shop'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Responsive & Mobile-Friendly Design','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Retina-Ready Display','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Bootstrap Framework','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Fast Load Times','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Extensive Customization Options','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Interactive CTA Buttons','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Dynamic Banner Section','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Testimonial Section','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Team Showcase Section','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Pre-Built Shortcodes','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Clean and Secure Code','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'SEO-Optimized Structure','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Minimal and Elegant Layout','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'One-Click Demo Import','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'WooCommerce Compatibility','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Customizable Typography','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Color Scheme Control','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Cross-Browser Compatibility','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Regular Theme Updates','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Built for Print-on-Demand Businesses','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Lightweight Theme Architecture','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Easy Product Showcase','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Blog Section Included','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Contact Form Integration','mattress-shop'); ?></li>
									<li><?php esc_html_e( 'Compatible with Page Builders','mattress-shop'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php }?>
