<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $webdados_fb;

?>
<div class="menu_containt_div" id="tabs-6">
	<p><?php _e( 'Settings for 3rd party integration with other plugins.', 'wd-fb-og' ); ?></p>
	<!-- Yoast SEO and All in One SEO Pack? -->
	<?php
	if ( $webdados_fb->is_yoast_seo_active() && $webdados_fb->is_aioseop_active() ) {
		?>
		<p>
			<i class="dashicons-before dashicons-warning"></i>
			<b><?php _e( 'Attention', 'wd-fb-og' ); ?>:</b>
			<br/>
			<?php _e( 'You currently have both Yoast SEO and All in One SEO Pack plugins active. This is no recommended.', 'wd-fb-og' ); ?>
		</p>
		<?php
	}
	?>
	<!-- Yoast SEO -->
	<div class="postbox">
		<h3 class="hndle">
			<?php
			if ( $webdados_fb->is_yoast_seo_active() && class_exists('WPSEO_Utils') ) {
				$wpseo_utils = new WPSEO_Utils();
				if( method_exists($wpseo_utils, 'get_icon_svg') ) {
					?>
					<img src="<?php echo 'data:image/svg+xml;base64,' . base64_encode( str_replace('fill:#82878c', 'fill:#23282d', $wpseo_utils->get_icon_svg(false) ) ) ; ?>"/>
					<?php
				} else {
					?><i class="dashicons-before dashicons-editor-code"></i><?php
				}
			} else {
				?><i class="dashicons-before dashicons-editor-code"></i><?php
			}
			?>
			<a href="https://wordpress.org/plugins/wordpress-seo/" target="_blank">Yoast SEO</a>
		</h3>
		<div class="inside">
			<?php
			if ( $webdados_fb->is_yoast_seo_active() ) {
				?>
				<table class="form-table">
					<tbody>
						
						<tr>
							<th><?php _e( 'Use Title, URL and Description', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_show_wpseoyoast]" id="fb_show_wpseoyoast" value="1" <?php echo (intval($options['fb_show_wpseoyoast'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
								- <?php _e( 'Use Title, Canonical URL and Description generated by Yoast SEO', 'wd-fb-og' ); ?>
							</td>
						</tr>
						
						<tr>
							<td colspan="2">
								<i class="dashicons-before dashicons-warning"></i>
								<b><?php _e( 'Attention', 'wd-fb-og' ); ?>:</b>
								<br/>
								<small>
									<?php printf( __( 'Because you are using Yoast SEO, and to avoid duplicate social tags, you should disable their social settings at <a href="%s" target="_blank">Yoast SEO &gt; Social</a>. If you cannot access that page, you must first activate the "Advanced settings pages" at <a href="%s" target="_blank">Yoast SEO &gt; Dashboard &gt; Features</a>.', 'wd-fb-og' ), 'admin.php?page=wpseo_social', 'admin.php?page=wpseo_dashboard#top#features' ); ?>
								</small>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
							</td>
						</tr>
	
					</tbody>
				</table>
				<?php
			} else {
				?>
				<p><?php printf ( __( 'You don\'t have %s installed or activated.', 'wd-fb-og' ), 'Yoast SEO' ); ?></p>
				<?php
			}
			?>
		</div>
	</div>
	<!-- All in One SEO Pack -->
	<input type="hidden" name="wonderm00n_open_graph_settings[fb_show_aioseop]" id="fb_show_aioseop" value="0"/>
	<!--<div class="postbox">
		<h3 class="hndle">
			<i class="dashicons-before dashicons-shield-alt"></i>
			<a href="https://wordpress.org/plugins/all-in-one-seo-pack/" target="_blank">All in One SEO Pack</a>
		</h3>
		<div class="inside">
			<?php
			if ( $webdados_fb->is_aioseop_active() ) {
				?>
				<table class="form-table">
					<tbody>
						
						<tr>
							<th><?php _e( 'Use Title and Description', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_show_aioseop]" id="fb_show_aioseop" value="1" <?php echo (intval($options['fb_show_aioseop'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
								- <?php _e( 'Use Title and Description generated by All in One SEO Pack', 'wd-fb-og' ); ?>
							</td>
						</tr>
						
						<tr>
							<td colspan="2">
								<i class="dashicons-before dashicons-warning"></i>
								<b><?php _e( 'Attention', 'wd-fb-og' ); ?>:</b>
								<br/>
								<small>
									<?php printf( __( 'Because you are using All in One SEO Pack, and to avoid duplicate social tags, you should disable their social settings at <a href="%s" target="_blank">MISSING LINK</a>.', 'wd-fb-og' ), '#' ); ?>
								</small>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
							</td>
						</tr>
	
					</tbody>
				</table>
				<?php
			} else {
				?>
				<p><?php printf ( __( 'You don\'t have %s installed or activated.', 'wd-fb-og' ), 'All in One SEO Pack' ); ?></p>
				<?php
			}
			?>
		</div>
	</div>-->
	<!-- WooCommerce -->
	<div class="postbox">
		<h3 class="hndle">
			<i class="dashicons-before dashicons-cart"></i>
			<a href="https://wordpress.org/plugins/woocommerce/" target="_blank">WooCommerce</a>
		</h3>
		<div class="inside">
			<?php
			if ( $webdados_fb->is_woocommerce_active() ) {
				?>
				<p><?php _e('On the product page we will automatically set <i>og:type</i> to "product" and <i>product:price</i> to the price including tax.', 'wd-fb-og'); ?></p>
				<table class="form-table">
					<tbody>
						
						<tr>
							<th><?php _e( 'Use Product Gallery as Images', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_wc_useproductgallery]" id="fb_wc_useproductgallery" value="1" <?php echo (intval($options['fb_wc_useproductgallery'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
								- <?php _e('Sets each Product Gallery image as an additional <i>og:image</i> tag so that, when a product is shared on Facebook, the user is given the choice what image to display', 'wd-fb-og'); ?>
								<br/>
								- <?php printf( __( 'You can change this value using the <i>%1$s</i> filter', 'wd-fb-og' ), 'fb_og_image_additional' ); ?>
							</td>
						</tr>
					
						<tr class="fb_image_overlay_options">
							<th><?php _e( 'Overlay PNG logo', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_wc_usepg_png_overlay]" id="fb_wc_usepg_png_overlay" value="1" <?php echo (intval($options['fb_wc_usepg_png_overlay'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr class="fb_image_overlay_options">
							<td colspan="2" class="info">
								- <?php _e( 'Also overlay the PNG logo on the Product Gallery images', 'wd-fb-og' ); ?>
							</td>
						</tr>
						
						<tr>
							<th><?php _e( 'Use Category thumbnail as Image', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_wc_usecategthumb]" id="fb_wc_usecategthumb" value="1" <?php echo (intval($options['fb_wc_usecategthumb'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
								- <?php _e('Recommended if you set large thumbnails for Product Categories and want to use them as Open Graph Images on category listing pages', 'wd-fb-og'); ?>
							</td>
						</tr>
	
					</tbody>
				</table>
				<?php
			} else {
				?>
				<p><?php printf ( __( 'You don\'t have %s installed or activated.', 'wd-fb-og' ), 'WooCommerce' ); ?></p>
				<?php
			}
			?>
		</div>
	</div>
	<!-- SubHeading -->
	<div class="postbox">
		<h3 class="hndle">
			<i class="dashicons-before dashicons-editor-textcolor"></i>
			<a href="https://wordpress.org/plugins/subheading/" target="_blank">SubHeading</a>
		</h3>
		<div class="inside">
			<?php
			if ( $webdados_fb->is_subheading_plugin_active() ) {
				?>
				<table class="form-table">
					<tbody>
						
						<tr>
							<th><?php _e( 'Add SubHeading to Post/Page Title', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_show_subheading]" id="fb_show_subheading" value="1" <?php echo (intval($options['fb_show_subheading'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
							</td>
						</tr>
						
						<tr class="fb_subheading_options">
							<th><?php _e( 'SubHeading position', 'wd-fb-og' ); ?>:</th>
							<td>
								<select name="wonderm00n_open_graph_settings[fb_subheading_position]" id="fb_subheading_position">
									<option value=""<?php if (trim($options['fb_subheading_position'])=='after') echo ' selected="selected"'; ?>><?php _e('After', 'wd-fb-og');?></option>
									<option value="before"<?php if (trim($options['fb_subheading_position'])=='before') echo ' selected="selected"'; ?>><?php _e('Before', 'wd-fb-og');?></option>
								</select>
							</td>
						</tr>
						<tr class="fb_subheading_options">
							<td colspan="2" class="info">
							</td>
						</tr>
							
					</tbody>
				</table>
				<?php
			} else {
				?>
				<p><?php printf ( __( 'You don\'t have %s installed or activated.', 'wd-fb-og' ), 'SubHeading' ); ?></p>
				<?php
			}
			?>
		</div>
	</div>
	<!-- Business Directory -->
	<div class="postbox">
		<h3 class="hndle">
			<i class="dashicons-before dashicons-id"></i>
			<a href="https://wordpress.org/plugins/business-directory-plugin/" target="_blank">Business Directory Plugin</a>
		</h3>
		<div class="inside">
			<?php
			if ( $webdados_fb->is_business_directory_active() ) {
				?>
				<table class="form-table">
					<tbody>
						
						<tr>
							<th><?php _e( 'Use listing details', 'wd-fb-og' ); ?>:</th>
							<td>
								<input type="checkbox" name="wonderm00n_open_graph_settings[fb_show_businessdirectoryplugin]" id="fb_show_businessdirectoryplugin" value="1" <?php echo (intval($options['fb_show_businessdirectoryplugin'])==1 ? ' checked="checked"' : ''); ?>/>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="info">
								- <?php _e( 'Use Business Directory Plugin listing details (Title, URL, Description and Image) to populate tags', 'wd-fb-og' ); ?>
								<br/>
								- <?php _e( 'Setting "Include URL", "Set Canonical URL", "Include Description" and "Include Image" options is HIGHLY recommended', 'wd-fb-og' ); ?>
							</td>
						</tr>
							
					</tbody>
				</table>
				<?php
			} else {
				?>
				<p><?php printf ( __( 'You don\'t have %s installed or activated.', 'wd-fb-og' ), 'Business Directory Plugin' ); ?></p>
				<?php
			}
			?>
		</div>
	</div>
</div>