<?php
/**
 * Frontend Head Output Coordinator
 *
 * @package SEOvaultSEO
 */

namespace SEOvaultSEO\Frontend;

use SEOvaultSEO\Compatibility\Detector;

/**
 * Coordinates all frontend SEO output in wp_head
 */
class Head {

	/**
	 * Initialize frontend output
	 */
	public static function init() {
		// Only initialize if SEOvault should output SEO
		if ( ! Detector::should_output_seo() ) {
			return;
		}

		// Hook into wp_head for SEO output
		add_action( 'wp_head', array( __CLASS__, 'output_seo_tags' ), 1 );
	}

	/**
	 * Output all SEO tags in wp_head
	 */
	public static function output_seo_tags() {
		if ( ! Detector::should_output_seo() ) {
			return;
		}

		// Output meta description
		Description::output();

		// Output canonical URL
		Canonical::output();

		// Output robots meta
		Robots::output();

		// Output Open Graph tags
		OpenGraph::output();

		// Output Twitter card tags
		Twitter::output();
	}
}
