perf: change the default config

pull/475/head
Seaton Jiang 2022-01-26 00:24:43 +08:00
parent 7b8ceffeba
commit 1a2ae85ef4
No known key found for this signature in database
GPG Key ID: B79682F6FE8D30E3
1 changed files with 3 additions and 26 deletions

View File

@ -4,7 +4,7 @@
* 主题选项
* @author Seaton Jiang <seatonjiang@vtrois.com>
* @license GPL-3.0 License
* @version 2021.09.10
* @version 2022.01.26
*/
defined('ABSPATH') || exit;
@ -25,29 +25,6 @@ if (!function_exists('kratos_option')) {
}
}
function getdomain($url)
{
$rs = parse_url($url);
if (!isset($rs['host'])) {
return null;
}
$main_url = $rs['host'];
if (!strcmp(long2ip(sprintf('%u', ip2long($main_url))), $main_url)) {
return $main_url;
} else {
$arr = explode('.', $main_url);
$count = count($arr);
$endArr = array('com', 'net', 'org');
if (in_array($arr[$count - 2], $endArr)) {
$domain = $arr[$count - 3] . '.' . $arr[$count - 2] . '.' . $arr[$count - 1];
} else {
$domain = $arr[$count - 2] . '.' . $arr[$count - 1];
}
return $domain;
}
}
function getrobots()
{
$site_url = parse_url(site_url());
@ -216,7 +193,7 @@ CSF::createSection($prefix, array(
),
'default' => array(
'g_renameother' => false,
'g_renameother_prdfix' => getdomain(home_url()),
'g_renameother_prdfix' => 'kratos',
'g_renameother_mime' => 'tar|zip|gz|gzip|rar|7z',
),
),
@ -1014,7 +991,7 @@ CSF::createSection($prefix, array(
'id' => 's_copyright',
'type' => 'textarea',
'title' => __('版权信息', 'kratos'),
'default' => 'COPYRIGHT © ' . date('Y') . ' ' . getdomain(home_url()) . '. ALL RIGHTS RESERVED.',
'default' => 'COPYRIGHT © ' . date('Y') . ' ' . get_bloginfo('name') . '. ALL RIGHTS RESERVED.',
),
),
));