<?php

add_action( 'admin_menu', 'ultimate_blogger_gettingstarted' );
function ultimate_blogger_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'ultimate-blogger'), esc_html__('Theme Demo Import', 'ultimate-blogger'), 'edit_theme_options', 'ultimate-blogger-guide-page', 'ultimate_blogger_guide');   
}

function ultimate_blogger_admin_theme_style() {
   wp_enqueue_style('ultimate-blogger-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('ultimate-blogger-tab', esc_url( get_stylesheet_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');
   wp_enqueue_script('ultimate-blogger-bundle-banner', get_template_directory_uri() . '/inc/dashboard/js/bundle_banner.js', array(), false, true);
    // Admin notice code START
	wp_register_script('ultimate-blogger-notice', esc_url(get_stylesheet_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('ultimate-blogger-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'ultimate_blogger_admin_theme_style');

// Notice after Theme Activation
function ultimate_blogger_notice(){
    // Hide permanently if dismissed
    if ( get_option('ultimate_blogger_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'ultimate-blogger-guide-page' ) {
        return;
    }  {?>
    <div id="ultimate-blogger-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info-row">
			<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 Ultimate Blogger, You Rock!', 'ultimate-blogger' ) ?> </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.', 'ultimate-blogger' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=ultimate-blogger-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'ultimate-blogger' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_BUNDLE ); ?>"><?php esc_html_e('Get Bundle', 'ultimate-blogger') ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'ultimate-blogger') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'ultimate-blogger') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_DOC ); ?>"><?php esc_html_e('Free Doc', 'ultimate-blogger') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}
//Hook (VERY IMPORTANT)
add_action('admin_notices', 'ultimate_blogger_notice');

// Admin notice code START
add_action('wp_ajax_ultimate_blogger_dismiss_notice', 'ultimate_blogger_dismiss_notice');
function ultimate_blogger_dismiss_notice() {
    update_option('ultimate_blogger_admin_notice', 1);
    wp_die();
}

//After Switch theme function
add_action('after_switch_theme', 'ultimate_blogger_getstart_setup_options');
function ultimate_blogger_getstart_setup_options () {
    delete_option('ultimate_blogger_admin_notice');
}
// Admin notice code END

/**
 * Theme Info Page
 */
function ultimate_blogger_guide() {

	// Theme info
	$ultimate_blogger_return = add_query_arg( array()) ;
	$ultimate_blogger_theme = wp_get_theme( 'ultimate-blogger' ); ?>

	<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="bwp-bundle-banner">
				<div class="bwp-bundle-banner__row">
					<div class="bwp-bundle-banner__content">
						<span class="bwp-bundle-banner__badge"><?php esc_html_e( 'Limited Time Deal - 25% Off', 'ultimate-blogger' ); ?></span>
						<h2 class="bwp-bundle-banner__title"><?php esc_html_e( '250+ Premium WordPress Themes in One Bundle', 'ultimate-blogger' ); ?></h2>
						<p class="bwp-bundle-banner__desc">
							<strong><?php esc_html_e( 'SUMMER SALE!', 'ultimate-blogger' ); ?></strong>
							<?php esc_html_e( 'Get 15% off on a Bundle of 250+ Premium WP Themes. Use', 'ultimate-blogger' ); ?>
							<span class="bwp-bundle-banner__coupon-inline">&quot;SUMMER15&quot;</span>
							<?php esc_html_e( 'at Checkout.', 'ultimate-blogger' ); ?>
						</p>
						<div class="bwp-bundle-banner__actions">
							<a class="bwp-bundle-banner__cta" target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_BUNDLE ); ?>"><?php esc_html_e( 'Get Bundle Just at $99', 'ultimate-blogger' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>
							<button type="button" class="bwp-bundle-banner__coupon" id="bwp-copy-coupon" data-coupon="SUMMER15" aria-label="<?php echo esc_attr__( 'Copy coupon code SUMMER15', 'ultimate-blogger' ); ?>">
								<span class="bwp-bundle-banner__coupon-label"><?php esc_html_e( 'Coupon Code', 'ultimate-blogger' ); ?></span>
								<span class="bwp-bundle-banner__coupon-code">SUMMER15</span>
								<span class="bwp-bundle-banner__coupon-copied" id="bwp-copy-coupon-msg"><?php esc_html_e( 'Copied!', 'ultimate-blogger' ); ?></span>
							</button>
						</div>
					</div>
					<div class="bwp-bundle-banner__price">
						<div class="bwp-bundle-banner__price-amount">
							<span class="bwp-bundle-banner__price-old">$9750</span>
							<span class="bwp-bundle-banner__price-new">$99</span>
						</div>
						<span class="bwp-bundle-banner__price-note"><?php esc_html_e( '* Lifetime Updates & All Future Themes Included', 'ultimate-blogger' ); ?></span>
					</div>
					<div class="bwp-bundle-banner__visual" aria-hidden="true">
						<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/bwt-bundle.png'); ?>"/>
					</div>
				</div>
			</div>
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="ultimate_blogger_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'ultimate-blogger' ); ?></button>
				<button role="tab" class="tablinks" onclick="ultimate_blogger_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'ultimate-blogger' ); ?></button>
				<button role="tab" class="tablinks" onclick="ultimate_blogger_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'ultimate-blogger' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( ULTIMATE_BLOGGER_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'ultimate-blogger' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'ultimate-blogger' ); ?>
				</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 Ultimate Blogger ', 'ultimate-blogger' ); ?>
							<span><?php esc_html_e( 'Version: ', 'ultimate-blogger' ); ?><?php echo esc_html($ultimate_blogger_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.', 'ultimate-blogger' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'ultimate-blogger' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<div class="demo-content">
									<?php
										/* Demo Import */
										require get_theme_file_path( '/inc/dashboard/demo-content.php' );
									?>
								</div>

								<div id="demo-import-loader">
									<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/spinner.gif'); ?>" alt="<?php echo esc_attr( 'Loading...', 'ultimate-blogger'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'ultimate-blogger'); ?>" />
							<div class="install-plugins__actions">
								<a class="install-plugins__btn install-plugins__btn--pro" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_PRO ); ?>" target="_blank"><?php esc_html_e( 'Get Pro at $39', 'ultimate-blogger' ); ?></a>
								<a class="install-plugins__btn install-plugins__btn--bundle" href="<?php echo esc_url( ULTIMATE_BLOGGER_BUY_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy Bundle at $99', 'ultimate-blogger' ); ?></a>
							</div>
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','ultimate-blogger'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','ultimate-blogger'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','ultimate-blogger'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','ultimate-blogger'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','ultimate-blogger'); ?></a> <?php esc_html_e( 'your website.','ultimate-blogger'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','ultimate-blogger'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','ultimate-blogger'); ?></a></li>
							</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 Ultimate Blogger Theme', 'ultimate-blogger' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Ultimate Blogger is a beautiful and minimal blog theme designed specifically for bloggers to create stunning blog websites for photography, food, fashion, lifestyle, SEO blogs, magazine platforms, YouTube bloggers, personal journal creators, writers, and modern content publishers focused on writing and sharing engaging stories. It is ideal for blogging platforms, blogging tips, how to blog, blogger SEO, best blogging platforms, blog writing, blogging for beginners, blogging niches, blogging strategy, blogging tutorials, blog writing tips, blogging for profit, professional blog, how to build a blog, blogger themes, blogger templates, blogger SEO tips, blogger monetization, blogger post ideas, blogger niche ideas, blogging for business, blogger setup, blogger customization, blogger widgets, blogger mobile themes, blogger design, blogger layout, blogger social media integration, blogger content ideas, blogger post formats, blogger traffic generation, blogger marketing, blogger affiliate marketing, blogger advertising, blogger monetization strategies, blogger affiliate programs, blogger for beginners, blogger for business owners, blogger for brands, travel blogs, technical blogs, video blogs, news articles, food vloggers, bloggers, columnists, journalists, sportswriters, marketing professionals, and modern magazine-style websites. This powerful blog theme comes packed with plenty of features, user-friendly customization options, quick page speed, mobile-friendly design, cross-browser compatibility, SEO-friendly structure, and a clean journal-inspired layout perfect for long-form writing and storytelling. It includes a grid layout for organizing stories, translation-ready support, custom colors, a large slider with a banner and Call to Action Button (CTA), compatibility with WooCommerce, layouts for products, posts, and pages, secure and clean codes requiring no coding skills, helpful shortcodes, and a Bootstrap-based minimal design. With an interactive demo for easy understanding and smooth compatibility with popular tools such as Yoast SEO, Ultimate Blogger is an ideal blog solution for creating engaging stories, professional magazine platforms, and visually appealing journal websites focused on impactful writing.', 'ultimate-blogger' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','ultimate-blogger'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','ultimate-blogger'); ?></a> <?php esc_html_e( 'your website.','ultimate-blogger'); ?> </li>
								<li><?php esc_html_e( 'Ultimate Blogger','ultimate-blogger'); ?> <a target="_blank" href="<?php echo esc_url( ULTIMATE_BLOGGER_DOC ); ?>"><?php esc_html_e( 'Documentation','ultimate-blogger'); ?></a> </li>
							</ol>
						</div>
				</div>
				<div class="col-md-5">
					<div class="pad-box">
              			<img class="logo" src="<?php echo esc_url(get_theme_file_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.','ultimate-blogger'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'ultimate-blogger'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','ultimate-blogger'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'Your love for blogging can be elegantly expressed to the world with a sophisticated and user friendly website. And that is easily possible now with the help of Ultimate Blog WordPress Theme which is a Blog template for WordPress that helps to make a website of your dream. It is simple and do not require any professional to edit and customize according to you. You can completely do it end to end with wide variety of options and easy customization widgets. Our Ultimate Blog WordPress Theme is one of the Most Popular WordPress Blog Theme that is used by a number of blogging professionals.', 'ultimate-blogger' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','ultimate-blogger'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','ultimate-blogger'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','ultimate-blogger'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>