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 Description : Add class to html tag in head
* Author Name : Mouad Achemli
* Function Source : https://www.mwordpress.net
* Note : this function is important do not remove from here
*
*/
function mwp_add_gutenberg_body_class( $body_classes ) {
if ( is_singular() && false !== strpos( get_queried_object()->post_content, '<!-- wp:' ) ) {
$body_classes[] = 'ed-gutenberg';
} else {
$body_classes[] = 'ed-tinymce';
}
return $body_classes;
}
add_filter( 'body_class', 'mwp_add_gutenberg_body_class' );
/*
* Function Description : Favicon url & Viewport & Custom meta
* Author Name : Mouad Achemli
* Function Source : https://www.mwordpress.net
* Note : this function is important do not remove from here
*
*/
function mwp_default_meta_tags() {
if (mwp_option('seo-enable') == 1) {
// remove default theme meta
} else {
echo '<meta name="X-UA-Compatible" content="IE=edge,chrome=1"/>', " \n";
echo '<meta name="Content-Type" content="text/html; charset=utf-8"/>', " \n";
echo '<link href="//gmpg.org/xfn/11" rel="profile">', " \n";
echo '<meta name="viewport" content="width=device-width, initial-scale=1">', " \n";
}
$favicon = mwp_option('favicon');
if (!empty($favicon)) {
echo '<link type="image/x-icon" href="'.esc_url($favicon).'" rel="shortcut icon">', " \n";
} else {
echo '<link type="image/x-icon" href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="shortcut icon">', " \n";
}
if (mwp_option('meta-head') <> "") {
echo "\n",'<!-- Custom MetaTag -->',"\n";
echo stripslashes(stripslashes(mwp_option('meta-head'))), " \n";
echo '<!-- / Custom MetaTag -->',"\n";
}
if (mwp_option('seo-enable') == 1) {
$seo_fb_app = mwp_option('facebook-app-id');
$seo_fb_admins = mwp_option('facebook-user-id');
if (!empty($seo_fb_app)) {
echo '<meta name="fb:admins" content="'.sanitize_text_field($seo_fb_app).'">', " \n";
}
if (!empty($seo_fb_admins)) {
echo '<meta name="fb:app_id" content="'.sanitize_text_field($seo_fb_admins).'">', " \n";
}
}
}
add_action('wp_head', 'mwp_default_meta_tags', 3);
/*
* Clean wordpress head from links
*
*/
function mwp_header_clean() {
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action('wp_head', 'noindex', 1 );
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action('wp_footer', 'xyz_smap_credit'); // Social Media Auto Publish
}
add_action( 'init', 'mwp_header_clean' );
/*
* Function Description : DNS Preconnect
* Author Name : Mouad Achemli
* Function Source : https://www.mwordpress.net
* Note : this function is important do not remove from here
*
*/
/*
* Function Description : DNS Preconnect
* Author Name : Mouad Achemli
* Function Source : https://www.mwordpress.net
* Note : this function is important do not remove from here
*
*/
function mwp_dns_preconnect_controll() {
$hosts = array();
$hosts_1 = array (
MWP_CDN_DOMAIN,
'https://fonts.gstatic.com',
'https://fonts.googleapis.com',
);
if ( class_exists( 'Jetpack' ) ) {
$hosts_2 = array(
'https://s1.wp.com',
'https://i0.wp.com',
'https://i1.wp.com',
'https://i2.wp.com',
'https://i3.wp.com',
'https://pixel.wp.com',
'https://stats.wp.com',
'https://s0.wp.com',
'https://s1.wp.com',
);
} else {
$hosts_2 = array();
}
$hosts_3 = array(
'https://google-analytics.com',
'https://www.google-analytics.com',
'https://ajax.googleapis.com',
'https://googleads.g.doubleclick.net',
'https://static.doubleclick.net',
'https://www.googleadservices.com',
);
$hosts[] = $hosts_1;
$hosts[] = $hosts_2;
$hosts[] = $hosts_3;
$data = array_filter($hosts);
$data = array_reduce($data, 'array_merge', array());
if ($data) {
echo '<!-- DNS Preconnect -->',"\n";
foreach ($data as $host) {
echo "<link rel='preconnect dns-prefetch' href='".$host."' crossorigin>";
}
echo "\n".'<!-- / DNS Preconnect -->',"\n";
}
}
add_action('wp_head', 'mwp_dns_preconnect_controll', 4);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists