<?php

/**
 * About setup
 *
 * @package news box
 */

if (!function_exists('newsbox_plus_about_setup')) :

	/**
	 * About setup.
	 *
	 * @since 1.0.0
	 */
	function newsbox_plus_about_setup()
	{
		$theme = wp_get_theme();
		$config = array(
			// Menu name under Appearance.
			'menu_name'               => esc_html__('NewsBox Plus Info', 'newsbox-plus'),
			// Page title.
			'page_name'               => esc_html__('NewsBox Plus Info', 'newsbox-plus'),
			/* translators: Main welcome title */
			'welcome_title'         => sprintf(esc_html__('Welcome to %s! - Version ', 'newsbox-plus'), $theme['Name']),
			// Main welcome content
			// Welcome content.
			'welcome_content' => sprintf(esc_html__('%1$s is now installed and ready to use. We want to make sure you have the best experience using the theme and that is why we gathered here all the necessary information for you. Thanks for using our theme!', 'newsbox-plus'), $theme['Name']),

			// Tabs.
			'tabs' => array(
				'getting_started' => esc_html__('Getting Started', 'newsbox-plus'),
				'recommended_actions' => esc_html__('Recommended Actions', 'newsbox-plus'),
				'useful_plugins'  => esc_html__('Useful Plugins', 'newsbox-plus'),
				'free_pro'  => esc_html__('Free Vs Pro', 'newsbox-plus'),
			),

			// Quick links.
			'quick_links' => array(
				'theme_url' => array(
					'text' => esc_html__('Theme Details', 'newsbox-plus'),
					'url'  => 'https://wpthemespace.com/product/newsbox-plus/',
				),
				'demo_url' => array(
					'text' => esc_html__('View Demo', 'newsbox-plus'),
					'url'  => 'https://newsbox.wpteamx.com/nbox-preview',
				),
				'update_url' => array(
					'text'   => esc_html__('UPGRADE PRO', 'newsbox-plus'),
					'url'    => 'https://wpthemespace.com/product/news-box-pro/?add-to-cart=3694',
					'button' => 'danger',
				),
			),

			// Getting started.
			'getting_started' => array(
				'one' => array(
					'title'       => esc_html__('Theme Documentation', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-format-aside',
					'description' => esc_html__('Please check our full documentation for detailed information on how to setup and customize the theme.', 'newsbox-plus'),
					'button_text' => esc_html__('Documentation coming soon', 'newsbox-plus'),
					'button_url'  => '#',
					'button_type' => 'primary',
					'is_new_tab'  => true,
				),
				'two' => array(
					'title'       => esc_html__('Theme Options', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-admin-customizer',
					'description' => esc_html__('Theme uses Customizer API for theme options. Using the Customizer you can easily customize different aspects of the theme.', 'newsbox-plus'),
					'button_text' => esc_html__('Customize', 'newsbox-plus'),
					'button_url'  => wp_customize_url(),
					'button_type' => 'primary',
				),
				'three' => array(
					'title'       => esc_html__('Demo Content', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-layout',
					'description' => sprintf(esc_html__('Demo content is pro feature. To import sample demo content, %1$s plugin should be installed and activated. After plugin is activated, visit Import Demo Data menu under Appearance.', 'newsbox-plus'), esc_html__('One Click Demo Import', 'newsbox-plus')),
					'button_text'   => esc_html__('UPGRADE PRO', 'newsbox-plus'),
					'button_url'    => 'https://wpthemespace.com/product/news-box-pro/?add-to-cart=3694',
					'button_type' => 'primary',
				),
				'four' => array(
					'title'       => esc_html__('Set Widgets', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-tagcloud',
					'description' => esc_html__('Set widgets in your sidebar, Offcanvas as well as footer.', 'newsbox-plus'),
					'button_text' => esc_html__('Add Widgets', 'newsbox-plus'),
					'button_url'  => admin_url() . '/widgets.php',
					'button_type' => 'link',
					'is_new_tab'  => true,
				),
				'five' => array(
					'title'       => esc_html__('Theme Preview', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-welcome-view-site',
					'description' => esc_html__('You can check out the theme demos for reference to find out what you can achieve using the theme and how it can be customized. Theme demo only work in pro theme', 'newsbox-plus'),
					'button_text' => esc_html__('View Demo', 'newsbox-plus'),
					'button_url'  => 'https://newsbox.wpteamx.com/nbox-preview',
					'button_type' => 'link',
					'is_new_tab'  => true,
				),
				'six' => array(
					'title'       => esc_html__('Contact Support', 'newsbox-plus'),
					'icon'        => 'dashicons dashicons-sos',
					'description' => esc_html__('Got theme support question or found bug or got some feedbacks? Best place to ask your query is the dedicated Support forum for the theme.', 'newsbox-plus'),
					'button_text' => esc_html__('Contact Support', 'newsbox-plus'),
					'button_url'  => 'https://wpthemespace.com/support/',
					'button_type' => 'link',
					'is_new_tab'  => true,
				),
			),

			'useful_plugins'        => array(
				'description' => esc_html__('Theme supports some helpful WordPress plugins to enhance your site. But, please enable only those plugins which you need in your site. For example, enable WooCommerce only if you are using e-commerce.', 'newsbox-plus'),
				'already_activated_message' => esc_html__('Already activated', 'newsbox-plus'),
				'version_label' => esc_html__('Version: ', 'newsbox-plus'),
				'install_label' => esc_html__('Install and Activate', 'newsbox-plus'),
				'activate_label' => esc_html__('Activate', 'newsbox-plus'),
				'deactivate_label' => esc_html__('Deactivate', 'newsbox-plus'),
				'content'                   => array(
					array(
						'slug' => 'magical-posts-display',
						'icon' => 'svg',
					),
					array(
						'slug' => 'gallery-box',
						'icon' => 'svg',
					),
					array(
						'slug' => 'click-to-top',
						'icon' => 'svg',
					),
					array(
						'slug' => 'magical-addons-for-elementor',
						'icon' => 'svg',
					),
					array(
						'slug' => 'easy-share-solution',
						'icon' => 'svg',
					),
					array(
						'slug' => 'magical-products-display',
						'icon' => 'svg',
					),
					array(
						'slug' => 'magical-blocks',
						'icon' => 'svg',
					),
					array(
						'slug' => 'wp-edit-password-protected',
						'icon' => 'svg',
					),
				),
			),
			// Required actions array.
			'recommended_actions'        => array(
				'install_label' => esc_html__('Install and Activate', 'newsbox-plus'),
				'activate_label' => esc_html__('Activate', 'newsbox-plus'),
				'deactivate_label' => esc_html__('Deactivate', 'newsbox-plus'),
				'content'            => array(
					'gallery-box' => array(
						'title'       => __('Magical Posts Display', 'newsbox-plus'),
						'description' => __('These recommended plugin is the best image and video gallery plugin. You may show your image, video and portfolio by this gallery plugin.', 'newsbox-plus'),
						'plugin_slug' => 'magical-posts-display',
						'id' => 'magical-posts-display'
					),
					'go-pro' => array(
						'title'       => '<a target="_blank" class="activate-now button button-danger" href="https://wpthemespace.com/product/news-box-pro/?add-to-cart=3694">' . __('UPGRADE TO PRO', 'newsbox-plus') . '</a>',
						'description' => __('Buy One time and get lifetime update, Advnced feature, SEO advantage, high quality performance and support. So why late?', 'newsbox-plus'),
						//'plugin_slug' => 'x-instafeed',
						'id' => 'go-pro'
					),
				),
			),
			// Free vs pro array.
			'free_pro'                => array(
				'free_theme_name'     => __('newsbox-plus', 'newsbox-plus'),
				'pro_theme_name'      => __('NewsBox Pro', 'newsbox-plus'),
				'pro_theme_link'      => 'https://wpthemespace.com/product/news-box-pro/',
				/* translators: View link */
				'get_pro_theme_label' => sprintf(__('Get %s', 'newsbox-plus'), 'NewsBox Pro'),
				'features'            => array(
					array(
						'title'       => esc_html__('Daring Design for Devoted Readers', 'newsbox-plus'),
						'description' => esc_html__('news box\'s design helps you stand out from the crowd and create an experience that your readers will love and talk about. With a flexible home page you have the chance to easily showcase appealing content with ease.', 'newsbox-plus'),
						'is_in_lite'  => 'true',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Mobile-Ready For All Devices', 'newsbox-plus'),
						'description' => esc_html__('NewsBox Plus makes room for your readers to enjoy your articles on the go, no matter the device their using. We shaped everything to look amazing to your audience.', 'newsbox-plus'),
						'is_in_lite'  => 'true',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Home slider', 'newsbox-plus'),
						'description' => esc_html__('NewsBox Plus gives you extra slider feature. You can create awesome home slider in this theme.', 'newsbox-plus'),
						'is_in_lite'  => 'true',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Widgetized Sidebars To Keep Attention', 'newsbox-plus'),
						'description' => esc_html__('NewsBox Plus comes with a widget-based flexible system which allows you to add your favorite widgets over the Sidebar as well as on offcanvas too.', 'newsbox-plus'),
						'is_in_lite'  => 'true',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Multiple Header Layout', 'newsbox-plus'),
						'description' => esc_html__('NewsBox Plus gives you extra ways to showcase your header with miltiple layout option you can change it on the basis of your requirement', 'newsbox-plus'),
						'is_in_lite'  => 'true',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Banner Slider Options', 'newsbox-plus'),
						'description' => esc_html__('news box\'s PRO version comes with more Slider options to display and filter posts. For instance, you can have far more control on setting the source of the posts or how they are displayed, everything to push the content to the right people and promote it by the blink of an eye.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Flexible Home Page Design', 'newsbox-plus'),
						'description' => esc_html__('news box\'s PRO version has more controll available to enable you to place widgets on Footer or Below the Post at the end of your articles.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Masonry grid layout', 'newsbox-plus'),
						'description' => esc_html__('NewsBox Plus PRO verison has masonry grid layout so you can show your blog with awesome masonry grid layout with all devices supporte.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Advance Customizer Options', 'newsbox-plus'),
						'description' => esc_html__('Advance control for each element gives you different way of customization and maintained you site as you like and makes you feel different.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Advance Pagination', 'newsbox-plus'),
						'description' => esc_html__('Multiple Option of pagination via customizer can be obtained on your site like Infinite scroll, Ajax Button On Click, Number as well as classical option are available.', 'newsbox-plus'),
						'is_in_lite'  => 'ture',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Flexible Color Scheme', 'newsbox-plus'),
						'description' => esc_html__('Match your unique style in an easy and smart way by using an intuitive interface that you can fine-tune it until it fully represents you and matches your particular blogging needs.', 'newsbox-plus'),
						'is_in_lite'  => 'ture',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Advance custom widget', 'newsbox-plus'),
						'description' => esc_html__('You can show your news, blog content beautifully by advanced custom widget. It\'s an awesome feature in the news box theme', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('Premium Support and Assistance', 'newsbox-plus'),
						'description' => esc_html__('We offer ongoing customer support to help you get things done in due time. This way, you save energy and time, and focus on what brings you happiness. We know our products inside-out and we can lend a hand to help you save resources of all kinds.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
					array(
						'title'       => esc_html__('No Credit Footer Link', 'newsbox-plus'),
						'description' => esc_html__('You can easily remove the Theme: NewsBox Plus by NewsBox Plus copyright from the footer area and make the theme yours from start to finish.', 'newsbox-plus'),
						'is_in_lite'  => 'false',
						'is_in_pro'   => 'true',
					),
				),
			),

		);

		newsbox_plus_About::init($config);
	}

endif;

add_action('after_setup_theme', 'newsbox_plus_about_setup');

//Admin notice 

function newsbox_plus_notice__error()
{
	$hide_date = get_option('newsbox_plus_textinfo');
	if (!empty($hide_date)) {
		$clickhide = round((time() - strtotime($hide_date)) / 24 / 60 / 60);
		if ($clickhide < 25) {
			return;
		}
	}

	?>
	<div class="newsbox-plus-pro-notice">
		<div class="newsbox-plus-notice-content">
			<div class="newsbox-plus-notice-icon">
				<span class="newsbox-plus-rocket">🚀</span>
			</div>
			<div class="newsbox-plus-notice-text">
				<h3 class="newsbox-plus-notice-title">
					<?php esc_html_e('Turn More Readers Into Devoted Fans with News Box Pro!', 'newsbox-plus'); ?>
					<span class="newsbox-plus-pro-badge"><?php esc_html_e('PRO', 'newsbox-plus'); ?></span>
					<span class="newsbox-plus-lifetime-badge"><?php esc_html_e('✔ Pay Once · Lifetime Access', 'newsbox-plus'); ?></span>
				</h3>
				<p class="newsbox-plus-notice-desc">
					<?php esc_html_e('Get premium news layouts, advanced post sliders, exclusive news widgets, and SEO-ready tools — everything you need to grow your audience and publish smarter on autopilot.', 'newsbox-plus'); ?>
				</p>
			</div>
			<div class="newsbox-plus-notice-actions">
				<a href="<?php echo esc_url('https://wpthemespace.com/product/news-box-pro/?add-to-cart=3694'); ?>" target="_blank" class="newsbox-plus-btn-primary">
					<?php esc_html_e('🚀 Unlock Pro Now', 'newsbox-plus'); ?>
				</a>
				<a href="<?php echo esc_url('https://wpthemespace.com/product/news-box-pro/'); ?>" target="_blank" class="newsbox-plus-btn-secondary">
					<?php esc_html_e('View Pro Features', 'newsbox-plus'); ?>
				</a>
				<button class="newsbox-plus-btn-dismiss eyehide"><?php esc_html_e('Maybe Later', 'newsbox-plus') ?></button>
			</div>
		</div>
	</div>
<?php
}
add_action('admin_notices', 'newsbox_plus_notice__error');

function newsbox_plus_notice_option()
{
	if (isset($_GET['hnotice']) && $_GET['hnotice'] == 1) {
		update_option('newsbox_plus_textinfo', current_time('mysql'));
	}
}
add_action('init', 'newsbox_plus_notice_option');
