<?php


ob_start();

$title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
$descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );

$seo_img_id = get_option('niteoCS_seo_img_id');
$seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
$seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_background_img_for_seo();
?>
<!-- SEO -->
<title><?php echo esc_html( $title ); ?></title>
<meta name="description" content="<?php echo esc_html( $descr ); ?>"/>

<!-- og meta for facebook, googleplus -->
<meta property="og:title" content="<?php echo esc_html( $title ); ?>"/>
<meta property="og:description" content="<?php echo esc_html( $descr ); ?>"/>
<meta property="og:url" content="<?php echo get_home_url()?>"/>
<meta property="og:type" content="website" />
<meta property="og:image" content="<?php echo esc_url( $seo_img_url );?>"/>

<!-- twitter meta -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo esc_html( $title ); ?>"/>
<meta name="twitter:description" content="<?php echo esc_html( $descr ); ?>"/>
<meta name="twitter:url" content="<?php echo get_home_url();?>"/>
<meta name="twitter:image" content="<?php echo esc_url( $seo_img_url );?>"/>

<?php 
// display favicon
$favicon_id = get_option('niteoCS_favicon_id');

if ( $favicon_id && $favicon_id != '' ) {
    $favicon_url = wp_get_attachment_image_src( $favicon_id, 'thumbnail' );
    if ( isset($favicon_url[0]) ) { 
        echo '<link id="favicon" rel="shortcut icon" href="' . $favicon_url[0] . '" type="image/x-icon"/>';
    } 
} else {
   wp_site_icon();
}

if ( get_option( 'blog_public', '1' ) == '0' ) {
    echo '<meta name="robots" content="noindex,nofollow" />' . PHP_EOL; 
} 

$html = ob_get_clean();
