Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
function mwp_seo_home() {
// Get SEO Data
$viewport = 'width=device-width, initial-scale=1';
$referrer = 'unsafe-url'; // https://moz.com/blog/meta-referrer-tag
$profile = 'http://gmpg.org/xfn/11';
$robots = 'NOODP'; // https://moz.com/blog/why-wont-google-use-my-meta-description
$http_equiv = 'text/html; charset=utf-8';
$http_equiv_compatible = 'IE=edge,chrome=1';
$apple_capable = 'yes';
$twitter_summary = 'summary_large_image';
$twitter_user = mwp_option('twitter-user');
$site_url = home_url();
$get_site_name = mwp_option('seo-home-title');
$get_site_description = mwp_option('seo-home-description');
$get_site_keywords = mwp_option('seo-home-keywords');
$get_site_image = mwp_option('seo-home-image');
/*
* Site Name
*
*/
if (!empty($get_site_name)) {
$site_name = $get_site_name;
} else {
$site_name = get_bloginfo('name');
}
/*
* Site Description
*
*/
if (!empty($get_site_description)) {
$site_description = $get_site_description;
} else {
$site_description = get_bloginfo('description');
}
/*
* Site Image
*
*/
if (!empty($get_site_image)) {
$site_image = $get_site_image;
} else {
$site_image = mwp_thumb_size_default_src();
}
/*!
* Standard Meta
*/
$standar_data = array (
'title' => $site_name,
'X-UA-Compatible' => $http_equiv_compatible,
'Content-Type' => $http_equiv,
'viewport' => $viewport,
'description' => $site_description,
'keywords' => $get_site_keywords,
'robots' => $robots,
'referrer' => $referrer,
'apple-mobile-web-app-capable' => $apple_capable,
'profile' => $profile,
);
// Removing empty array slots
$standar = array_filter( $standar_data );
echo '<!-- Standard Meta -->',"\n";
foreach ($standar as $key => $value) {
switch ($key) {
case 'title':
$output = "<title>".$value."</title>\n";
break;
case 'X-UA-Compatible':
case 'Content-Type':
case 'viewport':
case 'description':
case 'keywords':
case 'robots':
case 'referrer':
case 'apple-mobile-web-app-capable':
$output = "<meta name='".$key."' content='".$value."'/>\n";
break;
case 'profile':
$output = "<link rel='".$key."' href='".$value."'/>\n";
break;
}
_e($output);
}
/*
* Twitter Site Name
*
*/
$twitter_site = '';
if (!empty($twitter_user)) {
$twitter_site = '@'.$twitter_user;
}
/*
* Twitter Cards and Open Graph mix
*
* NO need for twitter:title, twitter:description, twitter:image
* see : https://dev.twitter.com/cards/getting-started#opengraph
* Twitter Cards and Open Graph mix
*
*/
$twitter_card = array (
'twitter:card' => $twitter_summary,
'twitter:site' => $twitter_site,
);
// Removing empty array slots
$twitter = array_filter( $twitter_card );
echo "<!-- Twitter Card data -->\n";
$twitter_output = '';
foreach ($twitter as $property => $content) {
if (!empty($content))
$twitter_output .= "<meta property='".$property."' content='".$content."' />\n";
}
echo $twitter_output;
/*
* Facebook - APP ID & USER ID
*
*/
if (mwp_option('facebook-app-enable') == 1) {
$facebook_appid = mwp_option('facebook-app-id');
$facebook_admins = mwp_option('facebook-user-id');
} else {
$facebook_appid = '';
$facebook_admins = '';
}
/*
* Facebook Open Graph data
*
*/
$opengraph_data = array (
'og:locale' => mwp_locale(),
'og:title' => $site_name,
'og:type' => 'website',
'og:url' => $site_url,
'og:image' => $site_image,
'og:description' => $site_description,
'og:site_name' => $site_name,
'fb:admins' => $facebook_admins,
'fb:app_id' => $facebook_appid
);
$opengraph = array_filter( $opengraph_data );
echo "<!-- Open Graph data -->\n";
foreach ($opengraph as $property => $content) {
if (!empty($content))
$output = "<meta property='".$property."' content='".$content."' />\n";
echo $output;
}
/*!
* Rich Snippets
*
* Logo & Social Profile
* https://developers.google.com/search/docs/data-types/logo
* https://developers.google.com/search/docs/data-types/social-profile
*/
$get_schema_logo = mwp_option('rich-snippet-logo');
$shema_sameAs = array(
mwp_option('youtube-link'),
mwp_option('google-link'),
mwp_option('twitter-link'),
mwp_option('instagram-link'),
mwp_option('pinterest-link'),
mwp_option('facebook-link'),
);
$schema["@context"] = "http://schema.org";
$schema["@type"] = "Organization";
$schema["name"] = $site_name;
$schema["description"] = $site_description;
if (!empty($get_schema_logo)) {
$schema["logo"] = $get_schema_logo;
}
$schema["url"] = $site_url;
$schema["sameAs"] = $shema_sameAs;
echo "<script type='application/ld+json'>". json_encode($schema) ."</script>\n";
/*!
* Rich Snippets
*
* Search Box
* https://developers.google.com/search/docs/data-types/sitelinks-searchbox
*
*/
$schema2["@context"] = "http://schema.org";
$schema2["@type"] = "WebSite";
$schema2["url"] = $site_url;
$schema2["potentialAction"] = array(
'@type' => "SearchAction",
'target' => $site_url . '/?s={search_term_string}',
'query-input' => 'required name=search_term_string'
);
echo "<script type='application/ld+json'>". json_encode($schema2) ."</script>\n";
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists