From 64748fe6ff14fa7bd323716ecef2a1ca9cd491f9 Mon Sep 17 00:00:00 2001 From: feibisi Date: Tue, 29 Jul 2025 17:58:24 +0800 Subject: [PATCH] Add new service modules and enhance initialization Added new service classes: Maintenance, Acceleration, Adblock, Avatar, Database, Fonts, Performance, and related templates and assets. Updated Service/Base.php to conditionally instantiate service classes only if they exist. Improved Service/Memory.php and Service/Monitor.php with better settings handling and update logic. Enhanced Service/Setting.php to simplify framework title usage. These changes modularize features and improve plugin extensibility and reliability. --- Service/123-Maintenance.php | 169 ++++ Service/Acceleration.php | 256 +++++ Service/Adblock.php | 46 + Service/Avatar.php | 98 ++ Service/Base.php | 48 +- Service/Comments.php | 0 Service/Database.php | 92 ++ Service/Fonts.php | 131 +++ Service/Mail.php | 0 Service/Maintenance.php | 136 +++ Service/Media.php | 0 Service/Memory.php | 31 +- Service/Monitor.php | 343 +++---- Service/Performance.php | 2 + Service/Setting.php | 1101 +++++++++++++++++---- Service/Super.php | 484 ++++----- assets/css/setting.css | 29 +- assets/images/wpcy-logo.png | Bin 0 -> 32163 bytes assets/js/script.js | 33 + changelog.txt | 0 composer.json | 0 composer.lock | 0 copyright.txt | 64 +- framework/classes/admin-options.class.php | 27 +- templates/about-section.php | 48 + templates/maintenance-default.php | 20 + templates/website-section.php | 21 + templates/welcome-section.php | 56 ++ wp-china-yes.php | 27 +- 29 files changed, 2617 insertions(+), 645 deletions(-) create mode 100755 Service/123-Maintenance.php create mode 100755 Service/Acceleration.php create mode 100755 Service/Adblock.php create mode 100755 Service/Avatar.php create mode 100755 Service/Comments.php create mode 100755 Service/Database.php create mode 100755 Service/Fonts.php create mode 100755 Service/Mail.php create mode 100755 Service/Maintenance.php create mode 100755 Service/Media.php create mode 100755 Service/Performance.php create mode 100755 assets/images/wpcy-logo.png create mode 100755 assets/js/script.js mode change 100644 => 100755 changelog.txt mode change 100644 => 100755 composer.json mode change 100644 => 100755 composer.lock mode change 100644 => 100755 copyright.txt create mode 100755 templates/about-section.php create mode 100755 templates/maintenance-default.php create mode 100755 templates/website-section.php create mode 100755 templates/welcome-section.php diff --git a/Service/123-Maintenance.php b/Service/123-Maintenance.php new file mode 100755 index 0000000..77e3be5 --- /dev/null +++ b/Service/123-Maintenance.php @@ -0,0 +1,169 @@ +settings = get_settings(); + + // 仅在调试模式下输出调试信息 + if (defined('WP_DEBUG') && WP_DEBUG) { + error_log('Maintenance Settings Raw: ' . print_r($this->settings, true)); + error_log('Maintenance Mode Value: ' . var_export($this->settings['maintenance_mode'], true)); + } + + // 如果维护模式启用,挂载相关钩子 + if ($this->settings['maintenance_mode']) { + add_action('template_redirect', [$this, 'check_maintenance_mode'], 1); + add_action('admin_bar_menu', [$this, 'add_admin_bar_notice'], 100); + add_action('init', [$this, 'check_ajax_maintenance'], 1); + } + } + + public function check_ajax_maintenance() { + if (wp_doing_ajax() && !current_user_can('manage_options')) { + wp_die('维护模式已启用'); + } + } + + public function check_maintenance_mode() { + // 如果是命令行环境,直接返回 + if (php_sapi_name() === 'cli') { + return; + } + + // 如果是管理员,直接返回 + if (current_user_can('manage_options')) { + return; + } + + // 检查是否是允许的页面 + global $pagenow; + if (in_array($pagenow, $this->allowed_pages)) { + return; + } + + // 检查是否是后台请求 + if (is_admin()) { + return; + } + + // 检查是否是 REST API 请求 + if (defined('REST_REQUEST') && REST_REQUEST) { + return; + } + + // 检查是否是 AJAX 请求 + if (wp_doing_ajax()) { + return; + } + + // 显示维护页面 + $this->show_maintenance_page(); + } + + private function show_maintenance_page() { + $maintenance_settings = $this->settings['maintenance_settings'] ?? []; + + $title = $maintenance_settings['maintenance_title'] ?? '网站维护中'; + $heading = $maintenance_settings['maintenance_heading'] ?? '网站维护中'; + $message = $maintenance_settings['maintenance_message'] ?? '网站正在进行例行维护,请稍后访问。感谢您的理解与支持!'; + + // 添加基本的样式 + $style = ' + + '; + + $output = $style . sprintf( + '
+

%s

+

%s

+
%s
+
', + esc_html($heading), + esc_html($title), + wp_kses_post($message) + ); + + // 设置维护模式响应头 + if (!headers_sent()) { + header('HTTP/1.1 503 Service Temporarily Unavailable'); + header('Status: 503 Service Temporarily Unavailable'); + header('Retry-After: 3600'); + header('Content-Type: text/html; charset=utf-8'); + } + + // 确保输出被清空 + if (ob_get_level()) { + ob_end_clean(); + } + + wp_die($output, $title, [ + 'response' => 503, + 'back_link' => false + ]); + } + + public function add_admin_bar_notice($wp_admin_bar) { + if (!current_user_can('manage_options')) { + return; + } + + // 添加调试信息 + if (defined('WP_DEBUG') && WP_DEBUG) { + error_log('Admin bar notice added for maintenance mode.'); + } + + $wp_admin_bar->add_node([ + 'id' => 'maintenance-mode-notice', + 'title' => '维护模式已启用', + 'href' => admin_url('admin.php?page=wp-china-yes#tab=脉云维护') + ]); + } +} \ No newline at end of file diff --git a/Service/Acceleration.php b/Service/Acceleration.php new file mode 100755 index 0000000..f2c481b --- /dev/null +++ b/Service/Acceleration.php @@ -0,0 +1,256 @@ +settings = get_settings(); + $this->init(); + } + + /** + * 初始化 admincdn 功能 + */ + private function init() { + if (!empty($this->settings['admincdn'])) { + add_action('wp_head', function () { + echo "\n"; + }, 1); + } + + $this->load_admincdn(); + } + + /** + * 加载 admincdn 功能 + */ + private function load_admincdn() { + // 确保 $this->settings 中包含必要的键 + $this->settings['admincdn_files'] = $this->settings['admincdn_files'] ?? []; + $this->settings['admincdn_public'] = $this->settings['admincdn_public'] ?? []; + $this->settings['admincdn_dev'] = $this->settings['admincdn_dev'] ?? []; + + // WordPress 核心静态文件链接替换 + if (is_admin() && !(defined('DOING_AJAX') && DOING_AJAX)) { + if ( + in_array('admin', (array) $this->settings['admincdn']) && + !stristr($GLOBALS['wp_version'], 'alpha') && + !stristr($GLOBALS['wp_version'], 'beta') && + !stristr($GLOBALS['wp_version'], 'RC') + ) { + // 禁用合并加载,以便于使用公共资源节点 + global $concatenate_scripts; + $concatenate_scripts = false; + + $this->page_str_replace('init', 'preg_replace', [ + '~' . home_url('/') . '(wp-admin|wp-includes)/(css|js)/~', + sprintf('https://wpstatic.admincdn.com/%s/$1/$2/', $GLOBALS['wp_version']) + ]); + } + } + + // 前台静态加速 + if (in_array('frontend', (array) $this->settings['admincdn_files'])) { + $this->page_str_replace('template_redirect', 'preg_replace', [ + '#(?<=[(\"\'])(?:' . quotemeta(home_url()) . ')?/(?:((?:wp-content|wp-includes)[^\"\')]+\.(css|js)[^\"\')]+))(?=[\"\')])#', + 'https://public.admincdn.com/$0' + ]); + } + + // Google 字体替换 + if (in_array('googlefonts', (array) $this->settings['admincdn_public'])) { + $this->page_str_replace('init', 'str_replace', [ + 'fonts.googleapis.com', + 'googlefonts.admincdn.com' + ]); + } + + // Google 前端公共库替换 + if (in_array('googleajax', (array) $this->settings['admincdn_public'])) { + $this->page_str_replace('init', 'str_replace', [ + 'ajax.googleapis.com', + 'googleajax.admincdn.com' + ]); + } + + // CDNJS 前端公共库替换 + if (in_array('cdnjs', (array) $this->settings['admincdn_public'])) { + $this->page_str_replace('init', 'str_replace', [ + 'cdnjs.cloudflare.com/ajax/libs', + 'cdnjs.admincdn.com' + ]); + } + + // jsDelivr 前端公共库替换 + if (in_array('jsdelivr', (array) $this->settings['admincdn_public'])) { + $this->page_str_replace('init', 'str_replace', [ + 'cdn.jsdelivr.net', + 'jsd.admincdn.com' + ]); + } + + // BootstrapCDN 前端公共库替换 + if (in_array('bootstrapcdn', (array) $this->settings['admincdn_public'])) { + $this->page_str_replace('init', 'str_replace', [ + 'maxcdn.bootstrapcdn.com', + 'jsd.admincdn.com' + ]); + } + + // Emoji 资源加速 - 使用 Twitter Emoji + if (in_array('emoji', (array) $this->settings['admincdn_files'])) { + $this->replace_emoji(); + } + + // WordPress.org 预览资源加速 + if (in_array('sworg', (array) $this->settings['admincdn_files'])) { + $this->replace_sworg(); + } + + // React 前端库加速 + if (in_array('react', (array) $this->settings['admincdn_dev'])) { + $this->page_str_replace('init', 'str_replace', [ + 'unpkg.com/react', + 'jsd.admincdn.com/npm/react' + ]); + } + + // jQuery 前端库加速 + if (in_array('jquery', (array) $this->settings['admincdn_dev'])) { + $this->page_str_replace('init', 'str_replace', [ + 'code.jquery.com', + 'jsd.admincdn.com/npm/jquery' + ]); + } + + // Vue.js 前端库加速 + if (in_array('vuejs', (array) $this->settings['admincdn_dev'])) { + $this->page_str_replace('init', 'str_replace', [ + 'unpkg.com/vue', + 'jsd.admincdn.com/npm/vue' + ]); + } + + // DataTables 前端库加速 + if (in_array('datatables', (array) $this->settings['admincdn_dev'])) { + $this->page_str_replace('init', 'str_replace', [ + 'cdn.datatables.net', + 'jsd.admincdn.com/npm/datatables.net' + ]); + } + + // Tailwind CSS 加速 + if (in_array('tailwindcss', (array) $this->settings['admincdn_dev'])) { + $this->page_str_replace('init', 'str_replace', [ + 'unpkg.com/tailwindcss', + 'jsd.admincdn.com/npm/tailwindcss' + ]); + } + } + + /** + * 替换 Emoji 资源 + */ + private function replace_emoji() { + // 禁用 WordPress 默认的 emoji 处理 + remove_action('wp_head', 'print_emoji_detection_script', 7); + remove_action('admin_print_scripts', 'print_emoji_detection_script'); + remove_action('wp_print_styles', 'print_emoji_styles'); + remove_action('admin_print_styles', 'print_emoji_styles'); + remove_filter('the_content_feed', 'wp_staticize_emoji'); + remove_filter('comment_text_rss', 'wp_staticize_emoji'); + remove_filter('wp_mail', 'wp_staticize_emoji_for_email'); + + // 替换 emoji 图片路径 + $this->page_str_replace('init', 'str_replace', [ + 's.w.org/images/core/emoji', + 'jsd.admincdn.com/npm/@twemoji/api/dist' + ]); + + // 替换 wpemojiSettings 配置 + add_action('wp_head', function () { + ?> + + page_str_replace('init', 'str_replace', [ + 'ts.w.org', + 'ts.wenpai.net' + ]); + + // 替换主题预览图片 URL + add_filter('theme_screenshot_url', function ($url) { + if (strpos($url, 'ts.w.org') !== false) { + $url = str_replace('ts.w.org', 'ts.wenpai.net', $url); + } + return $url; + }); + + // 过滤主题 API 响应 + add_filter('themes_api_result', function ($res, $action, $args) { + if (is_object($res) && !empty($res->screenshots)) { + foreach ($res->screenshots as &$screenshot) { + if (isset($screenshot->src)) { + $screenshot->src = str_replace('ts.w.org', 'ts.wenpai.net', $screenshot->src); + } + } + } + return $res; + }, 10, 3); + + // 替换页面内容 + add_action('admin_init', function () { + ob_start(function ($content) { + return str_replace('ts.w.org', 'ts.wenpai.net', $content); + }); + }); + + // 确保前台内容替换 + add_action('template_redirect', function () { + ob_start(function ($content) { + return str_replace('ts.w.org', 'ts.wenpai.net', $content); + }); + }); + } + + /** + * 页面字符串替换 + * + * @param string $hook 钩子名称 + * @param string $replace_func 替换函数 + * @param array $param 替换参数 + */ + private function page_str_replace($hook, $replace_func, $param) { + if (php_sapi_name() == 'cli') { + return; + } + add_action($hook, function () use ($replace_func, $param) { + ob_start(function ($buffer) use ($replace_func, $param) { + $param[] = $buffer; + return call_user_func_array($replace_func, $param); + }); + }, PHP_INT_MAX); + } +} \ No newline at end of file diff --git a/Service/Adblock.php b/Service/Adblock.php new file mode 100755 index 0000000..38fb60e --- /dev/null +++ b/Service/Adblock.php @@ -0,0 +1,46 @@ +settings = get_settings(); + $this->init(); + } + + /** + * 初始化广告拦截功能 + */ + private function init() { + if (!empty($this->settings['adblock']) && $this->settings['adblock'] == 'on') { + add_action('admin_head', [$this, 'load_adblock']); + } + } + + /** + * 加载广告拦截 + */ + public function load_adblock() { + // 处理广告拦截规则 + foreach ((array) $this->settings['adblock_rule'] as $rule) { + if (empty($rule['enable']) || empty($rule['selector'])) { + continue; + } + echo sprintf('', + htmlspecialchars_decode($rule['selector']) + ); + } + } +} \ No newline at end of file diff --git a/Service/Avatar.php b/Service/Avatar.php new file mode 100755 index 0000000..f6c08a7 --- /dev/null +++ b/Service/Avatar.php @@ -0,0 +1,98 @@ +settings = get_settings(); + $this->init(); + } + + /** + * 初始化初认头像功能 + */ + private function init() { + if (!empty($this->settings['cravatar'])) { + add_filter('user_profile_picture_description', [$this, 'set_user_profile_picture_for_cravatar'], 1); + add_filter('avatar_defaults', [$this, 'set_defaults_for_cravatar'], 1); + add_filter('um_user_avatar_url_filter', [$this, 'get_cravatar_url'], 1); + add_filter('bp_gravatar_url', [$this, 'get_cravatar_url'], 1); + add_filter('get_avatar_url', [$this, 'get_cravatar_url'], 1); + } + } + + /** + * 获取 Cravatar URL + */ + public function get_cravatar_url($url) { + switch ($this->settings['cravatar']) { + case 'cn': + return $this->replace_avatar_url($url, 'cn.cravatar.com'); + case 'global': + return $this->replace_avatar_url($url, 'en.cravatar.com'); + case 'weavatar': + return $this->replace_avatar_url($url, 'weavatar.com'); + default: + return $url; + } + } + + /** + * 替换头像 URL + */ + public function replace_avatar_url($url, $domain) { + $sources = array( + 'www.gravatar.com', + '0.gravatar.com', + '1.gravatar.com', + '2.gravatar.com', + 's.gravatar.com', + 'secure.gravatar.com', + 'cn.gravatar.com', + 'en.gravatar.com', + 'gravatar.com', + 'sdn.geekzu.org', + 'gravatar.duoshuo.com', + 'gravatar.loli.net', + 'dn-qiniu-avatar.qbox.me' + ); + + return str_replace($sources, $domain, $url); + } + + /** + * 设置 WordPress 讨论设置中的默认 LOGO 名称 + */ + public function set_defaults_for_cravatar($avatar_defaults) { + if ($this->settings['cravatar'] == 'weavatar') { + $avatar_defaults['gravatar_default'] = 'WeAvatar'; + } else { + $avatar_defaults['gravatar_default'] = '初认头像'; + } + + return $avatar_defaults; + } + + /** + * 设置个人资料卡中的头像上传地址 + */ + public function set_user_profile_picture_for_cravatar() { + if ($this->settings['cravatar'] == 'weavatar') { + return '您可以在 WeAvatar 修改您的资料图片'; + } else { + return '您可以在初认头像修改您的资料图片'; + } + } +} \ No newline at end of file diff --git a/Service/Base.php b/Service/Base.php index 4da50cc..2d73d43 100755 --- a/Service/Base.php +++ b/Service/Base.php @@ -11,18 +11,38 @@ defined( 'ABSPATH' ) || exit; */ class Base { - public function __construct() { - // 加速服务 - new Super(); - // 监控服务 - new Monitor(); - // 内存服务 - new Memory(); - // 更新服务 - new Update(); - if ( is_admin() ) { - // 设置服务 - new Setting(); - } - } + public function __construct() { + // 确保所有类文件都存在后再实例化 + if (class_exists(__NAMESPACE__ . '\Super')) { + new Super(); + } + + if (class_exists(__NAMESPACE__ . '\Monitor')) { + new Monitor(); + } + + if (class_exists(__NAMESPACE__ . '\Memory')) { + new Memory(); + } + + if (class_exists(__NAMESPACE__ . '\Update')) { + new Update(); + } + + if (class_exists(__NAMESPACE__ . '\Database')) { + new Database(); + } + + if (class_exists(__NAMESPACE__ . '\Acceleration')) { + new Acceleration(); + } + + if (class_exists(__NAMESPACE__ . '\Maintenance')) { + new Maintenance(); + } + + if ( is_admin() && class_exists(__NAMESPACE__ . '\Setting')) { + new Setting(); + } + } } diff --git a/Service/Comments.php b/Service/Comments.php new file mode 100755 index 0000000..e69de29 diff --git a/Service/Database.php b/Service/Database.php new file mode 100755 index 0000000..f527338 --- /dev/null +++ b/Service/Database.php @@ -0,0 +1,92 @@ +settings = get_settings(); + + // 如果启用了数据库工具,则允许访问数据库修复工具 + if ( ! empty( $this->settings['enable_db_tools'] ) && $this->settings['enable_db_tools'] ) { + define( 'WP_ALLOW_REPAIR', true ); + } + + // 处理调试常量 + $this->handle_debug_constants(); + + // 安全相关常量 + $this->handle_security_constants(); + } + + /** + * 处理调试模式相关常量 + */ + private function handle_debug_constants() { + if ( ! empty( $this->settings['enable_debug'] ) && $this->settings['enable_debug'] ) { + // 只有在常量未定义时才定义 + if ( ! defined( 'WP_DEBUG' ) ) { + define( 'WP_DEBUG', true ); + } + if ( ! empty( $this->settings['debug_options']['wp_debug_log'] ) && ! defined( 'WP_DEBUG_LOG' ) ) { + define( 'WP_DEBUG_LOG', true ); + } + if ( ! empty( $this->settings['debug_options']['wp_debug_display'] ) && ! defined( 'WP_DEBUG_DISPLAY' ) ) { + define( 'WP_DEBUG_DISPLAY', true ); + } + if ( ! empty( $this->settings['debug_options']['script_debug'] ) && ! defined( 'SCRIPT_DEBUG' ) ) { + define( 'SCRIPT_DEBUG', true ); + } + if ( ! empty( $this->settings['debug_options']['save_queries'] ) && ! defined( 'SAVEQUERIES' ) ) { + define( 'SAVEQUERIES', true ); + } + } else { + // 禁用调试模式时的默认值 + if ( ! defined( 'WP_DEBUG' ) ) { + define( 'WP_DEBUG', false ); + } + if ( ! defined( 'WP_DEBUG_LOG' ) ) { + define( 'WP_DEBUG_LOG', false ); + } + if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { + define( 'WP_DEBUG_DISPLAY', false ); + } + if ( ! defined( 'SCRIPT_DEBUG' ) ) { + define( 'SCRIPT_DEBUG', false ); + } + if ( ! defined( 'SAVEQUERIES' ) ) { + define( 'SAVEQUERIES', false ); + } + } + } + + /** + * 处理安全相关常量 + */ + private function handle_security_constants() { + if ( ! empty( $this->settings['disallow_file_edit'] ) && ! defined( 'DISALLOW_FILE_EDIT' ) ) { + define( 'DISALLOW_FILE_EDIT', $this->settings['disallow_file_edit'] ); + } + if ( ! empty( $this->settings['disallow_file_mods'] ) && ! defined( 'DISALLOW_FILE_MODS' ) ) { + define( 'DISALLOW_FILE_MODS', $this->settings['disallow_file_mods'] ); + } + if ( ! empty( $this->settings['force_ssl_admin'] ) && ! defined( 'FORCE_SSL_ADMIN' ) ) { + define( 'FORCE_SSL_ADMIN', $this->settings['force_ssl_admin'] ); + } + if ( ! empty( $this->settings['force_ssl_login'] ) && ! defined( 'FORCE_SSL_LOGIN' ) ) { + define( 'FORCE_SSL_LOGIN', $this->settings['force_ssl_login'] ); + } + } +} diff --git a/Service/Fonts.php b/Service/Fonts.php new file mode 100755 index 0000000..4c310d2 --- /dev/null +++ b/Service/Fonts.php @@ -0,0 +1,131 @@ +settings = get_settings(); + $this->init(); + } + + /** + * 初始化文风字体功能 + */ + private function init() { + if (!empty($this->settings['windfonts']) && $this->settings['windfonts'] != 'off') { + $this->load_typography(); + } + + if (!empty($this->settings['windfonts']) && $this->settings['windfonts'] == 'optimize') { + add_action('init', function () { + wp_enqueue_style('windfonts-optimize', CHINA_YES_PLUGIN_URL . 'assets/css/fonts.css', [], CHINA_YES_VERSION); + }); + } + + if (!empty($this->settings['windfonts']) && $this->settings['windfonts'] == 'on') { + add_action('wp_head', [$this, 'load_windfonts']); + add_action('admin_head', [$this, 'load_windfonts']); + } + + if (!empty($this->settings['windfonts']) && $this->settings['windfonts'] == 'frontend') { + add_action('wp_head', [$this, 'load_windfonts']); + } + } + + /** + * 加载文风字体 + */ + public function load_windfonts() { + echo << + +HTML; + + $loaded = []; + foreach ((array) $this->settings['windfonts_list'] as $font) { + if (empty($font['enable'])) { + continue; + } + if (empty($font['family'])) { + continue; + } + if (in_array($font['css'], $loaded)) { + continue; + } + echo sprintf(<< + +HTML + , + $font['css'], + htmlspecialchars_decode($font['selector']), + $font['style'], + $font['weight'], + $font['family'] + ); + $loaded[] = $font['css']; + } + } + + /** + * 加载排印优化 + */ + public function load_typography() { + // 支持中文排版段首缩进 2em + if (in_array('indent', (array) $this->settings['windfonts_typography'])) { + add_action('wp_head', function () { + echo ''; + }); + } + + // 支持中文排版两端对齐 + if (in_array('align', (array) $this->settings['windfonts_typography'])) { + add_action('wp_head', function () { + if (is_single()) { // 仅在文章页面生效 + echo ''; + } + }); + } + } +} \ No newline at end of file diff --git a/Service/Mail.php b/Service/Mail.php new file mode 100755 index 0000000..e69de29 diff --git a/Service/Maintenance.php b/Service/Maintenance.php new file mode 100755 index 0000000..996cacf --- /dev/null +++ b/Service/Maintenance.php @@ -0,0 +1,136 @@ +settings = get_settings(); + + // 维护模式检查 + if (!empty($this->settings['maintenance_mode'])) { + add_action('template_redirect', [$this, 'check_maintenance_mode']); + add_action('admin_bar_menu', [$this, 'add_admin_bar_notice'], 100); + } + + // 仪表盘统计信息 + if (!empty($this->settings['disk']) && $this->settings['disk']) { + add_action('dashboard_glance_items', [$this, 'add_dashboard_stats']); + add_action('admin_head', [$this, 'add_admin_css']); + } + + // 添加登录记录钩子 + add_action('wp_login', [$this, 'record_last_login'], 10, 2); + } + + // 添加 CSS 样式 + public function add_admin_css() { + $screen = get_current_screen(); + if ($screen->id === 'dashboard') { + echo ''; + } + } + + public function add_dashboard_stats($items) { + if (!is_array($items)) { + $items = array(); + } + + // 获取显示选项设置 + $display_options = $this->settings['disk_display'] ?? []; + + // 媒体文件统计 + if (in_array('media_num', $display_options)) { + $media_count = wp_count_posts('attachment')->inherit; + $items['media'] = sprintf( + ' %s', + admin_url('upload.php'), + sprintf(_n('%d 个媒体', '%d 个媒体', $media_count), $media_count) + ); + } + + // 管理员统计 + if (in_array('admin_num', $display_options)) { + $admin_count = count(get_users(['role' => 'administrator', 'fields' => 'ID'])); + $items['admins'] = sprintf( + ' %s', + admin_url('users.php?role=administrator'), + sprintf(_n('%d 个管理员', '%d 个管理员', $admin_count), $admin_count) + ); + } + + // 用户总数统计 + if (in_array('user_num', $display_options)) { + $total_users = count(get_users(['fields' => 'ID'])); + $items['users'] = sprintf( + ' %s', + admin_url('users.php'), + sprintf(_n('%d 个用户', '%d 个用户', $total_users), $total_users) + ); + } + + // 磁盘使用统计 + $disk_info = $this->get_disk_usage_info(); + if (in_array('disk_usage', $display_options)) { + $items['disk_usage'] = sprintf( + ' 磁盘用量:%s / %s', + size_format($disk_info['used']), + size_format($disk_info['total']) + ); + } + + if (in_array('disk_limit', $display_options)) { + $items['disk_free'] = sprintf( + ' 剩余空间:%s (%s%%)', + size_format($disk_info['free']), + round(($disk_info['free'] / $disk_info['total']) * 100, 2) + ); + } + + // 上次登录时间 + if (in_array('lastlogin', $display_options)) { + $current_user_id = get_current_user_id(); + $last_login = get_user_meta($current_user_id, 'last_login', true); + $items['lastlogin'] = sprintf( + ' 上次登录:%s', + $last_login ? date('Y.m.d H:i:s', $last_login) : '从未登录' + ); + } + + return $items; + } + + private function get_disk_usage_info() { + $disk_info = get_transient('disk_usage_info'); + if (false === $disk_info) { + $upload_dir = wp_upload_dir(); + $disk_total = disk_total_space($upload_dir['basedir']); + $disk_free = disk_free_space($upload_dir['basedir']); + $disk_used = $disk_total - $disk_free; + + $disk_info = [ + 'used' => $disk_used, + 'total' => $disk_total, + 'free' => $disk_free, + ]; + set_transient('disk_usage_info', $disk_info, HOUR_IN_SECONDS); + } + return $disk_info; + } + + public function record_last_login($user_login, $user) { + update_user_meta($user->ID, 'last_login', time()); + } +} \ No newline at end of file diff --git a/Service/Media.php b/Service/Media.php new file mode 100755 index 0000000..e69de29 diff --git a/Service/Memory.php b/Service/Memory.php index 23a1115..881d379 100755 --- a/Service/Memory.php +++ b/Service/Memory.php @@ -45,10 +45,6 @@ class Memory { // 转换为更直观的名称 switch (strtolower($os)) { case 'linux': - if (file_exists('/etc/os-release')) { - $content = parse_ini_file('/etc/os-release'); - return $content['PRETTY_NAME'] ?? 'Linux'; - } return 'Linux'; case 'darwin': return 'macOS'; @@ -152,8 +148,18 @@ class Memory { */ public function add_footer($content) { $settings = get_settings(); - // 确保 memory_display 是数组,如果不是则使用空数组 - $display_options = is_array($settings['memory_display'] ?? []) ? $settings['memory_display'] : []; + + // 设置默认显示选项 + $default_options = [ + 'memory_usage', + 'wp_limit', + 'server_ip', + ]; + + // 如果设置为空或不是数组,使用默认选项 + $display_options = isset($settings['memory_display']) && is_array($settings['memory_display']) + ? $settings['memory_display'] + : $default_options; // 如果 memory 设置未启用,直接返回原始内容 if (empty($settings['memory'])) { @@ -165,6 +171,7 @@ public function add_footer($content) { $this->os_info = $this->get_os_info(); $footer_parts = []; + // 内存使用量 if (in_array('memory_usage', $display_options)) { @@ -251,4 +258,16 @@ public function add_footer($content) { ); } } + + + /** + * 更新设置 + */ + private function update_settings() { + if ( is_multisite() ) { + update_site_option( 'wp_china_yes', $this->settings ); + } else { + update_option( 'wp_china_yes', $this->settings, true ); + } + } } diff --git a/Service/Monitor.php b/Service/Monitor.php index c6d3b44..4f234cc 100755 --- a/Service/Monitor.php +++ b/Service/Monitor.php @@ -1,171 +1,172 @@ -settings = get_settings(); - wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_store' ); // TODO 下个版本移除 - wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_cravatar' ); // TODO 下个版本移除 - wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_admincdn' ); // TODO 下个版本移除 - if ( $this->settings['monitor'] ) { - // 站点网络下只在主站运行 - if ( is_main_site() ) { - add_action( 'init', [ $this, 'init' ] ); - add_action( 'wp_china_yes_monitor', [ - $this, - 'run_monitor' - ] ); - } - } else { - wp_clear_scheduled_hook( 'wp_china_yes_monitor' ); - } - } - - /** - * 初始化 - */ - public function init() { - if ( ! wp_next_scheduled( 'wp_china_yes_monitor' ) ) { - wp_schedule_event( time(), 'hourly', 'wp_china_yes_monitor' ); - } - } - - /** - * 运行监控 - */ - public function run_monitor() { - if ( $this->settings['store'] != 'off' ) { - $this->maybe_check_store(); - } - if ( $this->settings['cravatar'] != 'off' ) { - $this->maybe_check_cravatar(); - } - if ( ! empty( $this->settings['admincdn'] ) ) { - $this->maybe_check_admincdn(); - } - } - - /** - * 检查应用市场可用性 - */ - public function maybe_check_store() { - $test_url = 'https://api.wenpai.net/china-yes/version-check'; - if ( $this->settings['store'] == 'proxy' ) { - $test_url = 'https://api.wpmirror.com/core/version-check/1.7/'; - } - $response = wp_remote_get( $test_url ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - if ( $this->settings['store'] == 'wenpai' ) { - $this->settings['store'] = 'proxy'; - } elseif ( $this->settings['store'] == 'proxy' ) { - $this->settings['store'] = 'off'; - } - $this->update_settings(); - } - } - - /** - * 检查初认头像可用性 - */ - public function maybe_check_cravatar() { - $test_url = 'https://cn.cravatar.com/avatar/'; - switch ( $this->settings['cravatar'] ) { - case 'global': - $test_url = 'https://en.cravatar.com/avatar/'; - break; - case 'weavatar': - $test_url = 'https://weavatar.com/avatar/'; - break; - } - $response = wp_remote_get( $test_url ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - if ( $this->settings['cravatar'] == 'cn' ) { - $this->settings['cravatar'] = 'global'; - } elseif ( $this->settings['cravatar'] == 'global' ) { - $this->settings['cravatar'] = 'weavatar'; - } elseif ( $this->settings['cravatar'] == 'weavatar' ) { - $this->settings['cravatar'] = 'cn'; - } - $this->update_settings(); - } - } - - /** - * 检查萌芽加速可用性 - */ - public function maybe_check_admincdn() { - // 后台加速 - if ( in_array( 'admin', $this->settings['admincdn'] ) ) { - $response = wp_remote_get( 'https://wpstatic.admincdn.com/6.7/wp-includes/js/wp-sanitize.min.js' ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'admin' ] ) ); - $this->update_settings(); - } - } - // 前台加速 - if ( in_array( 'frontend', $this->settings['admincdn'] ) ) { - $url = network_site_url( '/wp-includes/js/wp-sanitize.min.js' ); - $response = wp_remote_get( 'https://public.admincdn.com/' . $url ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'frontend' ] ) ); - $this->update_settings(); - } - } - // Google 字体 - if ( in_array( 'googlefonts', $this->settings['admincdn'] ) ) { - $response = wp_remote_get( 'https://googlefonts.admincdn.com/css?family=Roboto:400,700' ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'googlefonts' ] ) ); - $this->update_settings(); - } - } - // Google 前端公共库 - if ( in_array( 'googleajax', $this->settings['admincdn'] ) ) { - $response = wp_remote_get( 'https://googleajax.admincdn.com/ajax/libs/jquery/3.7.1/jquery.slim.min.js' ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'googleajax' ] ) ); - $this->update_settings(); - } - } - // CDNJS 前端公共库 - if ( in_array( 'cdnjs', $this->settings['admincdn'] ) ) { - $response = wp_remote_get( 'https://cdnjs.admincdn.com/jquery/3.7.1/jquery.slim.min.js' ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'cdnjs' ] ) ); - $this->update_settings(); - } - } - // jsDelivr 公共库 - if ( in_array( 'jsdelivr', $this->settings['admincdn'] ) ) { - $response = wp_remote_get( 'https://jsd.admincdn.com/npm/jquery@3.7.1/dist/jquery.slim.min.js' ); - if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { - $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'jsdelivr' ] ) ); - $this->update_settings(); - } - } - } - - /** - * 更新设置 - */ - private function update_settings() { - if ( is_multisite() ) { - update_site_option( 'wp_china_yes', $this->settings ); - } else { - update_option( 'wp_china_yes', $this->settings, true ); - } - } -} +settings = get_settings(); + wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_store' ); // TODO 下个版本移除 + wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_cravatar' ); // TODO 下个版本移除 + wp_clear_scheduled_hook( 'wp_china_yes_maybe_check_admincdn' ); // TODO 下个版本移除 + if ( $this->settings['monitor'] ) { + // 站点网络下只在主站运行 + if ( is_main_site() ) { + add_action( 'init', [ $this, 'init' ] ); + add_action( 'wp_china_yes_monitor', [ + $this, + 'run_monitor' + ] ); + } + } else { + wp_clear_scheduled_hook( 'wp_china_yes_monitor' ); + } +} + + /** + * 初始化 + */ + public function init() { + if ( ! wp_next_scheduled( 'wp_china_yes_monitor' ) ) { + wp_schedule_event( time(), 'hourly', 'wp_china_yes_monitor' ); + } + } + + /** + * 运行监控 + */ + public function run_monitor() { + if ( $this->settings['store'] != 'off' ) { + $this->maybe_check_store(); + } + if ( $this->settings['cravatar'] != 'off' ) { + $this->maybe_check_cravatar(); + } + if ( ! empty( $this->settings['admincdn'] ) ) { + $this->maybe_check_admincdn(); + } + } + + /** + * 检查应用市场可用性 + */ + public function maybe_check_store() { + $test_url = 'https://api.wenpai.net/china-yes/version-check'; + if ( $this->settings['store'] == 'proxy' ) { + $test_url = 'https://api.wpmirror.com/core/version-check/1.7/'; + } + $response = wp_remote_get( $test_url ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + if ( $this->settings['store'] == 'wenpai' ) { + $this->settings['store'] = 'proxy'; + } elseif ( $this->settings['store'] == 'proxy' ) { + $this->settings['store'] = 'off'; + } + $this->update_settings(); + } + } + + /** + * 检查初认头像可用性 + */ + public function maybe_check_cravatar() { + $test_url = 'https://cn.cravatar.com/avatar/'; + switch ( $this->settings['cravatar'] ) { + case 'global': + $test_url = 'https://en.cravatar.com/avatar/'; + break; + case 'weavatar': + $test_url = 'https://weavatar.com/avatar/'; + break; + } + $response = wp_remote_get( $test_url ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + if ( $this->settings['cravatar'] == 'cn' ) { + $this->settings['cravatar'] = 'global'; + } elseif ( $this->settings['cravatar'] == 'global' ) { + $this->settings['cravatar'] = 'weavatar'; + } elseif ( $this->settings['cravatar'] == 'weavatar' ) { + $this->settings['cravatar'] = 'cn'; + } + $this->update_settings(); + } + } + + /** + * 检查萌芽加速可用性 + */ + public function maybe_check_admincdn() { + // 后台加速 + if ( in_array( 'admin', $this->settings['admincdn'] ) ) { + $response = wp_remote_get( 'https://wpstatic.admincdn.com/6.7/wp-includes/js/wp-sanitize.min.js' ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'admin' ] ) ); + $this->update_settings(); + } + } + // 前台加速 + if ( in_array( 'frontend', $this->settings['admincdn'] ) ) { + $url = network_site_url( '/wp-includes/js/wp-sanitize.min.js' ); + $response = wp_remote_get( 'https://public.admincdn.com/' . $url ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'frontend' ] ) ); + $this->update_settings(); + } + } + // Google 字体 + if ( in_array( 'googlefonts', $this->settings['admincdn'] ) ) { + $response = wp_remote_get( 'https://googlefonts.admincdn.com/css?family=Roboto:400,700' ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'googlefonts' ] ) ); + $this->update_settings(); + } + } + // Google 前端公共库 + if ( in_array( 'googleajax', $this->settings['admincdn'] ) ) { + $response = wp_remote_get( 'https://googleajax.admincdn.com/ajax/libs/jquery/3.7.1/jquery.slim.min.js' ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'googleajax' ] ) ); + $this->update_settings(); + } + } + // CDNJS 前端公共库 + if ( in_array( 'cdnjs', $this->settings['admincdn'] ) ) { + $response = wp_remote_get( 'https://cdnjs.admincdn.com/jquery/3.7.1/jquery.slim.min.js' ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'cdnjs' ] ) ); + $this->update_settings(); + } + } + // jsDelivr 公共库 + if ( in_array( 'jsdelivr', $this->settings['admincdn'] ) ) { + $response = wp_remote_get( 'https://jsd.admincdn.com/npm/jquery@3.7.1/dist/jquery.slim.min.js' ); + if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { + $this->settings['admincdn'] = array_values( array_diff( $this->settings['admincdn'], [ 'jsdelivr' ] ) ); + $this->update_settings(); + } + } + } + + + /** + * 更新设置 + */ + private function update_settings() { + if ( is_multisite() ) { + update_site_option( 'wp_china_yes', $this->settings ); + } else { + update_option( 'wp_china_yes', $this->settings, true ); + } + } +} diff --git a/Service/Performance.php b/Service/Performance.php new file mode 100755 index 0000000..a4abe2d --- /dev/null +++ b/Service/Performance.php @@ -0,0 +1,2 @@ +prefix, [ - 'framework_title' => sprintf( '%s v%s', $this->settings['custom_name'], CHINA_YES_VERSION ), + 'framework_title' => $this->settings['custom_name'], 'menu_hidden' => $this->settings['hide'], 'menu_title' => $this->settings['custom_name'], 'menu_slug' => 'wp-china-yes', @@ -59,24 +59,31 @@ private function get_settings_page_url() { 'async_webfont' => true, 'database' => is_multisite() ? 'network' : '', ] ); - + + // 获取启用的 sections + $enabled_sections = $this->settings['enabled_sections'] ?? ['welcome', 'store', 'admincdn', 'cravatar', 'other', 'about']; + + if (in_array('welcome', $enabled_sections)) { + $settings_page_url = $this->get_settings_page_url(); + ob_start(); + include CHINA_YES_PLUGIN_PATH . 'templates/welcome-section.php'; + $welcome_content = ob_get_clean(); + WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '欢迎使用', 'icon' => 'icon icon-home-1', 'fields' => [ [ 'type' => 'content', - 'content' => - <<

原生体验

文派叶子🍃(WP-China-Yes)是一款不可多得的 WordPress 系统底层优化和生态基础设施软件。

网站加速

优化加速插件多如牛毛,为何文派叶子如此与众不同?

进一步了解 ↗

翻译推送

高质量翻译中文本地化翻译由文派开源官方提供,欢迎参与改进。

本地化改进 ↗

广告屏蔽

呈现清爽整洁的网站后台,清除侵入式后台广告、无用信息。

获取广告规则 ↗

加入我们

关注文派茶馆 WPTEA.com 公众号以及订阅我们的时事通讯即可接收独家内容、提示和更新。

-HTML, + 'content' =>$welcome_content, ] ], ] ); - + } + if (in_array('store', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ - 'title' => '加速设置', - 'icon' => 'icon icon-flash-1', + 'title' => '应用市场', + 'icon' => 'icon icon-shop', 'fields' => [ [ 'id' => 'store', @@ -94,41 +101,108 @@ HTML, 'wp-china-yes' ), ], [ - 'id' => 'admincdn', - 'type' => 'checkbox', - 'title' => __( '萌芽加速', 'wp-china-yes' ), - 'inline' => true, - 'options' => [ - 'googlefonts' => 'Google 字体', - 'googleajax' => 'Google 前端库', - 'cdnjs' => 'CDNJS 前端库', - 'jsdelivr' => 'jsDelivr 前端库', - 'bootstrapcdn' => 'Bootstrap 前端库' - ], - 'default' => [ - 'admin' => 'admin', - ], - 'subtitle' => '是否启用萌芽加速', - 'desc' => __( '萌芽加速(adminCDN)将 WordPress 插件依赖的静态文件切换为公共资源,解决卡顿、加载慢等问题。您可按需启用加速项目,更多细节控制和功能,请查看推荐设置。', - 'wp-china-yes' ), + 'id' => 'bridge', + 'type' => 'switcher', + 'default' => true, + 'title' => '云桥更新', + 'subtitle' => '是否启用更新加速', + 'desc' => __( '文派云桥(wpbridge)托管更新和应用分发渠道,可解决因 WordPress 社区分裂导致的混乱、旧应用无法更新,频繁 API 请求拖慢网速等问题。', + 'wp-china-yes' ), ], [ - 'id' => 'admincdn', - 'type' => 'checkbox', - 'title' => __( '文件加速', 'wp-china-yes' ), - 'inline' => true, - 'options' => [ - 'admin' => '后台加速', - 'frontend' => '前台加速', - ], - 'default' => [ - 'admin' => 'admin', - ], - 'subtitle' => '是否启用文件加速', - 'desc' => __( '专为 WordPress 系统内置依赖的静态资源进行加速,加快网站访问速度,如遇异常请停用对应选项。', - 'wp-china-yes' ), + 'id' => 'arkpress', + 'type' => 'switcher', + 'default' => false, + 'title' => '联合存储库', + 'subtitle' => '自动监控加速节点可用性', + 'desc' => __( 'ArkPress.org 支持自动监控各加速节点可用性,当节点不可用时自动切换至可用节点或关闭加速,以保证您的网站正常访问', + 'wp-china-yes' ), ], - + ], + ] ); + } + + if (in_array('admincdn', $enabled_sections)) { + WP_CHINA_YES::createSection($this->prefix, [ + 'title' => '萌芽加速', + 'icon' => 'icon icon-flash-1', + 'fields' => [ + [ + 'id' => 'admincdn_public', + 'type' => 'checkbox', + 'title' => __('萌芽加速', 'wp-china-yes'), + 'inline' => true, + 'options' => [ + 'googlefonts' => 'Google 字体', + 'googleajax' => 'Google 前端库', + 'cdnjs' => 'CDNJS 前端库', + 'jsdelivr' => 'jsDelivr 前端库', + 'bootstrapcdn' => 'Bootstrap 前端库', + ], + 'default' => [ + 'googlefonts' => 'googlefonts', + 'googleajax' => '', + 'cdnjs' => '', + 'jsdelivr' => '', + 'bootstrapcdn' => '', + ], + 'subtitle' => '是否启用萌芽加速', + 'desc' => __('萌芽加速(adminCDN)将 WordPress 插件依赖的静态文件切换为公共资源,解决卡顿、加载慢等问题。您可按需启用加速项目,更多细节控制和功能,请查看推荐设置。', + 'wp-china-yes'), + ], + [ + 'id' => 'admincdn_files', + 'type' => 'checkbox', + 'title' => __('文件加速', 'wp-china-yes'), + 'inline' => true, + 'options' => [ + 'admin' => '后台加速', + 'frontend' => '前台加速', + 'emoji' => 'Emoji加速', + 'sworg' => '预览加速', + ], + 'default' => [ + 'admin' => 'admin', + 'frontend' => '', + 'emoji' => 'emoji', + 'sworg' => '', + ], + 'subtitle' => '是否启用文件加速', + 'desc' => __('专为 WordPress 系统内置依赖的静态资源进行加速,加快网站访问速度,如遇异常请停用对应选项。预览加速可在不切换应用市场时加速插件目录预览截图。', + 'wp-china-yes'), + ], + [ + 'id' => 'admincdn_dev', + 'type' => 'checkbox', + 'title' => __('开发加速', 'wp-china-yes'), + 'inline' => true, + 'options' => [ + 'react' => 'React 前端库', + 'jquery' => 'jQuery 前端库', + 'vuejs' => 'Vue.js 前端库', + 'datatables' => 'DataTables 前端库', + 'tailwindcss' => 'Tailwind CSS' + ], + 'default' => [ + 'react' => '', + 'jquery' => 'jquery', + 'vuejs' => '', + 'datatables' => '', + 'tailwindcss' => '', + ], + 'subtitle' => '是否启用文件加速', + 'desc' => __('部分高级 WordPress 插件主题会包含最新前端资源,可在此勾选对应的 adminCDN 子库专项加速。', + 'wp-china-yes'), + ], + ], + ]); +} + + if (in_array('cravatar', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '初认头像', + 'icon' => 'icon icon-profile-circle', + 'fields' => [ [ 'id' => 'cravatar', 'type' => 'radio', @@ -147,7 +221,9 @@ HTML, ], ], ] ); - + } + + if (in_array('windfonts', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '文风字体', 'icon' => 'icon icon-text', @@ -168,28 +244,6 @@ HTML, 'desc' => __( '文风字体(Windfonts)为您的网站增添无限活力。专为中文网页设计,旨在提升用户阅读体验和视觉享受。新手使用请先查看字体使用说明。', 'wp-china-yes' ), ], - [ - 'id' => 'windfonts_typography', - 'type' => 'checkbox', - 'title' => __( '排印优化', 'wp-china-yes' ), - 'inline' => true, - 'options' => [ - 'corner' => '直角括号', - 'space' => '文本空格', - 'punctuation' => '标点显示', - 'indent' => '段首缩进', - 'align' => '两端对齐', - ], - 'default' => '', - 'subtitle' => '是否启用排印优化', - 'desc' => __( '文风字体排印优化可提升中文网页的视觉美感,适用于正式内容的网站。', - 'wp-china-yes' ), - 'dependency' => [ - 'windfonts', - 'any', - 'on,frontend,optimize', - ], - ], [ 'id' => 'windfonts_list', 'type' => 'group', @@ -271,81 +325,407 @@ HTML, ], ], [ - 'type' => 'content', - 'content' => '默认字体适配规则跟随插件更新,插件更新后可删除字体重新添加以获取最新适配规则', + 'id' => 'windfonts_typography', + 'type' => 'checkbox', + 'title' => __( '排印优化', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'corner' => '直角括号', + 'space' => '文本空格', + 'punctuation' => '标点显示', + 'indent' => '段首缩进', + 'align' => '两端对齐', + ], + 'default' => '', + 'subtitle' => '是否启用排印优化', + 'desc' => __( '文风字体排印优化可提升中文网页的视觉美感,适用于正式内容的网站。', + 'wp-china-yes' ), + ], + [ + 'id' => 'windfonts_typography', + 'type' => 'checkbox', + 'title' => __( '英文美化', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'align' => '排版优化', + 'corner' => '去双空格', + 'space' => '避免孤行', + 'punctuation' => '避免寡行', + 'indent' => '中英标点', + ], + 'default' => '', + 'subtitle' => '是否启用英文美化', + 'desc' => __( 'Windfonts 英文优化可提升英文网页的视觉美感,适用于多语内容网站。', + 'wp-china-yes' ), ], ], ] ); + } + if (in_array('motucloud', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ - 'title' => '广告屏蔽', - 'icon' => 'icon icon-eye-slash', + 'title' => '墨图云集', + 'icon' => 'icon icon-gallery', 'fields' => [ [ - 'id' => 'adblock', + 'id' => 'motucloud', 'type' => 'radio', - 'title' => __( '广告屏蔽', 'wp-china-yes' ), + 'title' => __( '墨图云集', 'wp-china-yes' ), 'inline' => true, 'options' => [ - 'on' => '启用', - 'off' => '不启用', + 'cn' => '默认线路', + 'global' => '国际线路', + 'weavatar' => '备用源(WeAvatar.com)', + 'off' => '不启用' ], - 'default' => 'off', - 'subtitle' => '是否启用后台广告屏蔽', - 'desc' => __( '文派叶子🍃(WPCY)独家特色功能,让您拥有清爽整洁的 WordPress 后台,清除各类常用插件侵入式后台广告、通知及无用信息,拿回后台控制权。', + 'default' => 'cn', + 'subtitle' => '是否启用墨图云集', + 'desc' => __( '墨图云集(MotuCloud)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', 'wp-china-yes' ), ], - [ - 'id' => 'adblock_rule', - 'type' => 'group', - 'title' => '规则列表', - 'subtitle' => '使用的广告屏蔽规则列表', - 'desc' => __( '支持添加多条广告屏蔽规则', - 'wp-china-yes' ), - - 'button_title' => '添加规则', - 'accordion_title_number' => true, - 'dependency' => [ - 'adblock', - 'any', - 'on', - ], - 'fields' => [ - [ - 'id' => 'name', - 'type' => 'text', - 'title' => __( '规则名称', 'wp-china-yes' ), - 'subtitle' => '自定义规则名称', - 'desc' => __( '自定义规则名称,方便识别', - 'wp-china-yes' ), - 'default' => '默认规则', - ], - [ - 'id' => 'selector', - 'type' => 'textarea', - 'title' => __( '应用元素', 'wp-china-yes' ), - 'subtitle' => '规则应用元素', - 'desc' => __( '设置规则应用的广告元素(CSS 选择器)', - 'wp-china-yes' ), - 'default' => '.wpseo_content_wrapper #sidebar-container, .yoast_premium_upsell, #wpseo-local-seo-upsell, .yoast-settings-section-upsell, #rank_math_review_plugin_notice, #bwp-get-social, .bwp-button-paypal, #bwp-sidebar-right, .tjcc-custom-css #postbox-container-1, .settings_page_wpcustomtaxfilterinadmin #postbox-container-1, #duplicate-post-notice #newsletter-subscribe-form, div[id^="dnh-wrm"], .notice-info.dst-notice, #googleanalytics_terms_notice, .fw-brz-dismiss, div.elementor-message[data-notice_id="elementor_dev_promote"], .notice-success.wpcf7r-notice, .dc-text__block.disable__comment__alert, #ws_sidebar_pro_ad, .pa-new-feature-notice, #redux-connect-message, .frash-notice-email, .frash-notice-rate, #smush-box-pro-features, #wp-smush-bulk-smush-upsell-row, #easy-updates-manager-dashnotice, #metaslider-optin-notice, #extendifysdk_announcement, .ml-discount-ad, .mo-admin-notice, .post-smtp-donation, div[data-dismissible="notice-owa-sale-forever"], .neve-notice-upsell, #pagelayer_promo, #simple-custom-post-order-epsilon-review-notice, .sfsi_new_prmium_follw, div.fs-slug-the-events-calendar[data-id="connect_account"], .tribe-notice-event-tickets-install, div.notice[data-notice="webp-converter-for-media"], .webpLoader__popup.webpPopup, .put-dismiss-notice, .wp-mail-smtp-review-notice, #wp-mail-smtp-pro-banner, body div.promotion.fs-notice, .analytify-review-thumbnail, .analytify-review-notice, .jitm-banner.is-upgrade-premium, div[data-name*="wbcr_factory_notice_adverts"], .sui-subscription-notice, #sui-cross-sell-footer, .sui-cross-sell-modules, .forminator-rating-notice, .sui-dashboard-upsell-upsell, .anwp-post-grid__rate, .cff-settings-cta, .cff-header-upgrade-notice, .cff_notice.cff_review_notice_step_1, .cff_get_pro_highlight, .aal-install-elementor, #ws_sidebar_pro_ad, .bold-timeline-lite-feedback-notice-wrapper, #elementskit-lite-go-pro-noti2ce, #elementskit-lite-_plugin_rating_msg_used_in_day, .yarpp-review-notice, #prli_review_notice, #webdados_invoicexpress_nag, #vc_license-activation-notice, .villatheme-dashboard.updated, #njt-FileBird-review, .notice[data-dismissible="pro_release_notice"], #thwvsf_review_request_notice, .wpdeveloper-review-notice, div[data-notice_type="tinvwl-user-review"], div[data-notice_type="tinvwl-user-premium"], #sg-backup-review-wrapper, .notice-wpmet-jhanda-getgenie-cross-promo, .notice-getgenie-go-pro-noti2ce, .notice-wpmet-jhanda-Summer2023, .thwcfd-review-wrapper, .woo-permalink-manager-banner, div.notice.bundle-notice, div.notice[data-dismissible="notice-owa-upgrade-forever"], .wpsm-acc-r-review-notice, .wpsm_ac_h_i, .edac-review-notice, .notice-iworks-rate, #monterinsights-admin-menu-tooltip, .monsterinsights-floating-bar, #monterinsights-admin-menu-tooltip, .exactmetrics-floating-bar, #metform-unsupported-metform-pro-version, .lwptocRate, .wpsm-tabs-b-review-notice, .quadlayers_woocommerce-direct-checkout_notice_delay, .iworks-rate-notice, #metform-_plugin_rating_msg_used_in_day, [id^="wpmet-jhanda-"], #wpmet-stories, #ti-optml-notice-helper, .menu-icon-dashboard-notice, .catch-bells-admin-notice, .wpdt-bundles-notice, .td-admin-web-services, .cf-plugin-popup, .wpzinc-review-media-library-organizer, .oxi-image-notice', - 'sanitize' => false, - ], - [ - 'id' => 'enable', - 'type' => 'switcher', - 'title' => __( '启用规则', 'wp-china-yes' ), - 'subtitle' => '是否启用该规则', - 'default' => true, - ], - ], - ], - [ - 'type' => 'content', - 'content' => '默认规则跟随插件更新,插件更新后可删除规则重新添加以获取更多最新屏蔽规则,出现异常,请尝试先停用规则排查原因。', - ], ], ] ); + } + if (in_array('fewmail', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '飞秒邮箱', + 'icon' => 'icon icon-sms-tracking', + 'fields' => [ + [ + 'id' => 'fewmail', + 'type' => 'radio', + 'title' => __( '飞秒邮箱', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'weavatar' => '备用源(WeAvatar.com)', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用飞秒邮箱', + 'desc' => __( '飞秒邮箱(FewMail)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + if (in_array('wordyeah', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '无言会语', + 'icon' => 'icon icon-message-text', + 'fields' => [ + [ + 'id' => 'wordyeah', + 'type' => 'radio', + 'title' => __( '无言会语', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '审核评论', + 'global' => '强化评论', + 'ban' => '禁用评论', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用无言会语', + 'desc' => __( '无言会语(WordYeah)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + if (in_array('blocks', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '笔笙区块', + 'icon' => 'icon icon-document-1', + 'fields' => [ + [ + 'id' => 'bisheng', + 'type' => 'radio', + 'title' => __( '笔笙区块', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '审核评论', + 'global' => '强化评论', + 'ban' => '禁用评论', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用笔笙区块', + 'desc' => __( '笔笙区块(Bisheng)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + if (in_array('deerlogin', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '灯鹿用户', + 'icon' => 'icon icon-user-tick', + 'fields' => [ + [ + 'id' => 'deerlogin', + 'type' => 'radio', + 'title' => __( '灯鹿用户', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用灯鹿用户', + 'desc' => __( '灯鹿用户(DeerLogin)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + + if (in_array('waimao', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '跨飞外贸', + 'icon' => 'icon icon-chart-success', + 'fields' => [ + [ + 'id' => 'waimao', + 'type' => 'radio', + 'title' => __( '灯鹿用户', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用灯鹿用户', + 'desc' => __( '灯鹿用户(DeerLogin)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + + if (in_array('woocn', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => 'Woo电商', + 'icon' => 'icon icon-shopping-cart', + 'fields' => [ + [ + 'id' => 'woocn', + 'type' => 'radio', + 'title' => __( 'Woo电商', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用灯鹿用户', + 'desc' => __( '灯鹿用户(DeerLogin)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + + if (in_array('lelms', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '乐尔达思', + 'icon' => 'icon icon-teacher', + 'fields' => [ + [ + 'id' => 'lelms', + 'type' => 'radio', + 'title' => __( '乐尔达思', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用乐尔达思', + 'desc' => __( '乐尔达思(LeLMS)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + + + if (in_array('wapuu', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '瓦普文创', + 'icon' => 'icon icon-ticket-discount', + 'fields' => [ + [ + 'id' => 'wapuu', + 'type' => 'radio', + 'title' => __( '瓦普文创', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用瓦普文创', + 'desc' => __( '瓦普文创(Wapuu)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } + + +if (in_array('adblock', $enabled_sections)) { +WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '广告拦截', + 'icon' => 'icon icon-eye-slash', + 'fields' => [ + [ + 'id' => 'adblock', + 'type' => 'radio', + 'title' => __( '广告拦截', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'on' => '启用', + 'off' => '不启用', + ], + 'default' => 'off', + 'subtitle' => '是否启用后台广告拦截', + 'desc' => __( '文派叶子🍃(WPCY.COM)独家特色功能,让您拥有清爽整洁的 WordPress 后台,清除各类常用插件侵入式后台广告、通知及无用信息,拿回后台控制权。', + 'wp-china-yes' ), + ], + [ + 'id' => 'adblock_rule', + 'type' => 'group', + 'title' => '规则列表', + 'subtitle' => '使用的广告拦截规则列表', + 'desc' => __( '默认规则跟随插件更新,插件更新后可删除规则重新添加以获取更多最新拦截规则,出现异常,请尝试先停用规则排查原因。', + 'wp-china-yes' ), + 'button_title' => '添加规则', + 'accordion_title_number' => true, + 'dependency' => [ + 'adblock', + 'any', + 'on', + ], + 'fields' => [ + [ + 'id' => 'name', + 'type' => 'text', + 'title' => __( '规则名称', 'wp-china-yes' ), + 'subtitle' => '自定义规则名称', + 'desc' => __( '自定义规则名称,方便识别', + 'wp-china-yes' ), + 'default' => '默认规则', + ], + [ + 'id' => 'selector', + 'type' => 'textarea', + 'title' => __( '应用元素', 'wp-china-yes' ), + 'subtitle' => '规则应用元素', + 'desc' => __( '设置规则应用的广告元素(CSS 选择器)', + 'wp-china-yes' ), + 'default' => '.wpseo_content_wrapper', + 'sanitize' => false, + ], + [ + 'id' => 'enable', + 'type' => 'switcher', + 'title' => __( '启用规则', 'wp-china-yes' ), + 'subtitle' => '是否启用该规则', + 'default' => true, + ], + ], + ], + ], +] ); + } + + +if (in_array('notice', $enabled_sections)) { +WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '通知管理', + 'icon' => 'icon icon-notification-bing', + 'fields' => [ + [ + 'id' => 'notice_block', + 'type' => 'radio', + 'title' => __('通知管理', 'wp-china-yes'), + 'inline' => true, + 'options' => [ + 'on' => '启用', + 'off' => '不启用', + ], + 'default' => 'off', + 'subtitle' => '是否启用后台通知管理', + 'desc' => __('管理和控制 WordPress 后台各类通知的显示。', 'wp-china-yes'), + ], + [ + 'id' => 'disable_all_notices', + 'type' => 'switcher', + 'title' => __('禁用所有通知', 'wp-china-yes'), + 'subtitle' => '一键禁用所有后台通知', + 'default' => false, + 'dependency' => ['notice_block', '==', 'on'], + ], + [ + 'id' => 'notice_control', + 'type' => 'checkbox', + 'title' => __('选择性禁用', 'wp-china-yes'), + 'inline' => true, + 'subtitle' => '选择需要禁用的通知类型', + 'desc' => __('可以按住 Ctrl/Command 键进行多选', 'wp-china-yes'), + 'chosen' => true, + 'multiple' => true, + 'options' => [ + 'core' => '核心更新通知', + 'error' => '错误通知', + 'warning' => '警告通知', + 'info' => '信息通知', + 'success' => '成功通知', + ], + 'dependency' => ['notice_block|disable_all_notices', '==|==', 'on|false'], + 'default' => [], + ], + [ + 'id' => 'notice_method', + 'type' => 'radio', + 'title' => __('禁用方式', 'wp-china-yes'), + 'inline' => true, + 'options' => [ + 'hook' => '移除钩子(推荐)', + 'css' => 'CSS隐藏', + 'both' => '双重保险', + ], + 'default' => 'hook', + 'dependency' => ['notice_block|disable_all_notices', '==|==', 'on|false'], + ], + ], +] ); + } + + + + if (in_array('plane', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '飞行模式', 'icon' => 'icon icon-airplane', @@ -371,7 +751,6 @@ HTML, 'subtitle' => '飞行模式使用的 URL 屏蔽规则列表', 'desc' => __( '支持添加多条 URL 屏蔽规则', 'wp-china-yes' ), - 'button_title' => '添加规则', 'accordion_title_number' => true, 'dependency' => [ @@ -411,8 +790,9 @@ HTML, ] ], ] ); + } - +if (in_array('monitor', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '脉云维护', 'icon' => 'icon icon-story', @@ -431,7 +811,7 @@ WP_CHINA_YES::createSection( $this->prefix, [ 'type' => 'switcher', 'default' => true, 'title' => '系统监控', - 'subtitle' => '自动监控站点系统运行状态', + 'subtitle' => '自动监控系统运行状态', 'desc' => __( '支持在管理后台页脚中显示系统运行状态,包括内存使用、CPU负载、MySQL版本、调试状态等信息', 'wp-china-yes' ), ], @@ -442,73 +822,399 @@ WP_CHINA_YES::createSection( $this->prefix, [ 'inline' => true, 'options' => [ 'memory_usage' => '内存使用量', - 'wp_limit' => 'WP内存限制', - 'server_ip' => '服务器IP', - 'hostname' => '主机名', + 'wp_limit' => '内存限制', + 'server_ip' => '服务器 IP', + 'hostname' => '主机名称', 'os_info' => '操作系统', - 'php_info' => 'PHP信息', + 'mysql_version'=> 'MySQL版本', 'cpu_usage' => 'CPU使用率', 'debug_status' => '调试状态', - 'mysql_version'=> 'MySQL版本' + 'php_info' => 'PHP 版本' ], 'default' => [ 'memory_usage', 'wp_limit', 'server_ip', - 'os_info', 'php_info', - 'cpu_usage', - 'debug_status', - 'mysql_version' ], 'subtitle' => '选择页脚要显示的信息', 'desc' => __( '为网站维护人员提供参考依据,无需登录服务器即可查看相关信息参数','wp-china-yes' ), 'dependency' => ['memory', '==', 'true'], ], [ - 'type' => 'content', - 'content' => '启用隐藏设置前请务必的保存或收藏当前设置页面 URL,否则您将无法再次进入插件设置页面', + 'id' => 'disk', + 'type' => 'switcher', + 'default' => true, + 'title' => '站点监控', + 'subtitle' => '自动监控站点运行状态', + 'desc' => __( '支持在管理后台页脚中显示系统运行状态,包括内存使用、CPU负载、MySQL版本、调试状态等信息', + 'wp-china-yes' ), + ], + [ + 'id' => 'disk_display', + 'type' => 'checkbox', + 'title' => __( '显示参数', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'disk_usage' => '磁盘用量', + 'disk_limit' => '剩余空间', + 'media_num' => '媒体数量', + 'admin_num' => '管理数量', + 'user_num' => '用户数量', + 'lastlogin' => '上次登录', + ], + 'default' => [ + 'disk_usage', + 'disk_limit', + 'media_num', + 'admin_num', + ], + 'subtitle' => '选择概览要显示的信息', + 'desc' => __( '为网站管理人员提供参考依据,进入后台仪表盘即可查看相关信息参数','wp-china-yes' ), + 'dependency' => ['disk', '==', 'true'], + ], +[ + 'id' => 'maintenance_mode', + 'type' => 'switcher', + 'default' => false, + 'title' => '启用维护模式', + 'subtitle' => '启用或禁用网站维护模式', + 'desc' => __( '启用后,网站将显示维护页面,只有管理员可以访问。', 'wp-china-yes' ), +], +[ + 'id' => 'maintenance_settings', + 'type' => 'fieldset', + 'title' => '维护模式设置', + 'fields' => [ + [ + 'id' => 'maintenance_title', + 'type' => 'text', + 'title' => '页面标题', + 'default' => '网站维护中', + ], + [ + 'id' => 'maintenance_heading', + 'type' => 'text', + 'title' => '主标题', + 'default' => '网站维护中', + ], + [ + 'id' => 'maintenance_message', + 'type' => 'textarea', + 'title' => '维护说明', + 'default' => '网站正在进行例行维护,请稍后访问。感谢您的理解与支持!', + ], + ], + 'dependency' => ['maintenance_mode', '==', 'true'], +] + + ], +] ); + } + + if (in_array('security', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '雨滴安全', + 'icon' => 'icon icon-shield', + 'fields' => [ + [ + 'id' => 'yoodefender', + 'type' => 'radio', + 'title' => __( '雨滴安全', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用雨滴安全', + 'desc' => __( '雨滴安全(YooDefender)安全设置可以帮助增强 WordPress 的安全性,请根据实际需求启用相关选项。更多选项请安装 WPBan 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + [ + 'id' => 'disallow_file_edit', + 'type' => 'switcher', + 'title' => __( '禁用文件编辑', 'wp-china-yes' ), + 'subtitle' => '禁用 WordPress 后台的主题和插件编辑器', + 'default' => true, + 'desc' => __( '启用后,用户无法通过 WordPress 后台编辑主题和插件文件。', 'wp-china-yes' ), + ], + [ + 'id' => 'disallow_file_mods', + 'type' => 'switcher', + 'title' => __( '禁用文件修改', 'wp-china-yes' ), + 'subtitle' => '禁止用户安装、更新或删除主题和插件', + 'default' => false, + 'desc' => __( '启用后,用户无法通过 WordPress 后台安装、更新或删除主题和插件。', 'wp-china-yes' ), ], ], ] ); - + } + if (in_array('performance', $enabled_sections)) { WP_CHINA_YES::createSection( $this->prefix, [ - 'title' => '品牌白标', - 'icon' => 'icon icon-password-check', - 'fields' => [ + 'title' => '性能优化', + 'icon' => 'icon icon-speedometer', + 'fields' => [ + [ + 'id' => 'performance', + 'type' => 'switcher', + 'title' => __( '性能优化', 'wp-china-yes' ), + 'subtitle' => '是否启用性能优化', + 'default' => true, + 'desc' => __( '性能优化设置可以帮助提升 WordPress 的运行效率,请根据服务器配置合理调整。', 'wp-china-yes' ), + ], + + [ + 'id' => 'wp_memory_limit', + 'type' => 'text', + 'title' => __( '内存限制', 'wp-china-yes' ), + 'subtitle' => '设置 WordPress 内存限制', + 'default' => '40M', + 'desc' => __( '设置 WordPress 的内存限制,例如 64M、128M、256M 等。', 'wp-china-yes' ), + 'dependency' => ['performance', '==', 'true'], + + ], + [ + 'id' => 'wp_max_memory_limit', + 'type' => 'text', + 'title' => __( '后台内存限制', 'wp-china-yes' ), + 'subtitle' => '设置 WordPress 后台内存限制', + 'default' => '256M', + 'desc' => __( '设置 WordPress 后台的内存限制,例如 128M、256M、512M 等。', 'wp-china-yes' ), + 'dependency' => ['performance', '==', 'true'], + + ], + [ + 'id' => 'wp_post_revisions', + 'type' => 'number', + 'title' => __( '文章修订版本', 'wp-china-yes' ), + 'subtitle' => '控制文章修订版本的数量', + 'default' => -1, // -1 表示启用所有修订版本 + 'desc' => __( '设置为 0 禁用修订版本,或设置为一个固定值(如 5)限制修订版本数量。', 'wp-china-yes' ), + 'dependency' => ['performance', '==', 'true'], + + ], + [ + 'id' => 'autosave_interval', + 'type' => 'number', + 'title' => __( '自动保存间隔', 'wp-china-yes' ), + 'subtitle' => '设置文章自动保存的时间间隔(秒)', + 'default' => 60, + 'desc' => __( '设置文章自动保存的时间间隔,默认是 60 秒。', 'wp-china-yes' ), + 'dependency' => ['performance', '==', 'true'], + + ], + ], + +] ); + } + + if (in_array('brand', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '品牌白标', + 'icon' => 'icon icon-password-check', + 'fields' => [ + [ + 'id' => 'custom_name', + 'type' => 'text', + 'title' => '品牌白标', + 'subtitle' => '自定义插件显示品牌名', + 'desc' => __( '专为 WordPress 建站服务商和代理机构提供的自定义品牌 OEM 功能,输入您的品牌词启用后生效', 'wp-china-yes' ), + 'default' => "文派叶子", + ], + [ + 'id' => 'header_logo', + 'type' => 'media', + 'title' => '品牌 Logo', + 'subtitle' => '自定义插件显示品牌 Logo', + 'library' => 'image', + 'desc' => '上传或选择媒体库的图片作为品牌 Logo', + 'default' => ['url' => plugins_url('wp-china-yes/assets/images/wpcy-logo.png')], // 设置默认 Logo + ], [ - 'id' => 'custom_name', - 'type' => 'text', - 'title' => '品牌白标', - 'subtitle' => '自定义插件显示品牌名', - 'desc' => __( '专为 WordPress 建站服务商和代理机构提供的自定义品牌 OEM 功能,输入您的品牌词启用后生效', + 'id' => 'hide_option', + 'type' => 'switcher', + 'default' => false, + 'title' => '隐藏设置', + 'subtitle' => '隐藏插件设置信息', + 'desc' => __( '如果您不希望让客户知道本站启用了文派叶子🍃(WPCY.COM)插件及服务,可开启此选项。', 'wp-china-yes' ), - 'default' => "WP-China-Yes", ], - [ - 'type' => 'content', - 'content' => '启用隐藏设置前请务必的保存或收藏当前设置页面 URL,否则您将无法再次进入插件设置页面', - ], - ], - ] ); - + [ + 'id' => 'hide_elements', + 'type' => 'checkbox', + 'title' => '隐藏元素', + 'subtitle' => '选择需要隐藏的元素', + 'desc' => __( '注意:启用[隐藏菜单]前请务必保存或收藏当前设置页面 URL,否则将无法再次进入插件页面', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'hide_logo' => '隐藏 Logo', + 'hide_title' => '隐藏插件名', + 'hide_version' => '隐藏版本号', + 'hide_copyright' => '隐藏版权', + 'hide_menu' => '隐藏菜单', + ], + 'default' => [], // 默认不隐藏任何元素 + 'dependency' => ['hide_option', '==', 'true'], // 只有在 hide 为 true 时显示 + ], + [ + 'id' => 'enable_custom_rss', + 'type' => 'switcher', + 'title' => '品牌新闻', + 'subtitle' => '是否启用定制新闻源', + 'desc' => '启用后,您可以自定义[文派茶馆]新闻源,输入自己的 RSS 源之后即可显示信息流。', + 'default' => false + ], + [ + 'id' => 'custom_rss_url', + 'type' => 'text', + 'title' => '自定义 RSS 源', + 'subtitle' => '添加自定义 RSS 新闻源', + 'desc' => '请输入有效的 RSS Feed URL,长期无更新时会恢复显示默认新闻源。', + 'dependency' => ['enable_custom_rss', '==', true] + ], + [ + 'id' => 'custom_rss_refresh', + 'type' => 'select', + 'title' => 'RSS 刷新频率', + 'options' => [ + '1800' => '30分钟', + '3600' => '1小时', + '7200' => '2小时', + '14400' => '4小时', + '28800' => '8小时' + ], + 'default' => '3600', + 'dependency' => ['enable_custom_rss', '==', true] + ], + [ + 'id' => 'rss_display_options', + 'type' => 'checkbox', + 'inline' => true, + 'title' => 'RSS 显示选项', + 'subtitle' => '选择需要显示的内容', + 'options' => [ + 'show_date' => '显示日期', + 'show_summary' => '显示摘要', + 'show_footer' => '显示页脚', + ], + 'default' => ['show_date', 'show_summary', 'show_footer'], // 默认全部勾选 + 'dependency' => ['enable_custom_rss', '==', true] + ], + + ], +]); + } + WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '其他设置', 'icon' => 'icon icon-setting', 'fields' => [ - [ - 'id' => 'hide', - 'type' => 'switcher', - 'default' => false, - 'title' => '隐藏设置', - 'subtitle' => '隐藏插件设置入口', - 'desc' => __( '如果您不希望让客户知道本站启用了文派叶子🍃(WP-China-Yes)插件及服务,可开启此选项', - 'wp-china-yes' ), - ], - ], + [ + 'id' => 'enable_debug', + 'type' => 'switcher', + 'title' => __( '调试模式', 'wp-china-yes' ), + 'subtitle' => '启用或禁用调试模式', + 'default' => false, + 'desc' => __( '启用后,WordPress 将显示 PHP 错误、警告和通知。临时使用完毕后,请保持禁用此选项。', 'wp-china-yes' ), + ], + [ + 'id' => 'debug_options', + 'type' => 'checkbox', + 'title' => __( '调试选项', 'wp-china-yes' ), + 'subtitle' => '选择要启用的调试功能', + 'dependency' => [ 'enable_debug', '==', 'true' ], + 'options' => [ + 'wp_debug_log' => 'WP_DEBUG_LOG 记录日志', + 'wp_debug_display' => 'WP_DEBUG_DISPLAY 页面显示调试信息', + 'script_debug' => 'SCRIPT_DEBUG 加载未压缩的前端资源', + 'save_queries' => 'SAVEQUERIES 记录数据库查询 ', + ], + 'default' => [ + 'wp_debug_log' => true, + ], + 'desc' => __( '注意:调试模式仅适用于开发和测试环境,不建议在生产环境中长时间启用。选择要启用的调试功能,适用于开发和测试环境。', 'wp-china-yes' ), + ], + [ + 'id' => 'enable_db_tools', + 'type' => 'switcher', + 'title' => __( '数据库工具', 'wp-china-yes' ), + 'subtitle' => '启用或禁用数据库工具', + 'default' => false, + 'desc' => __( '启用后,您可以在下方访问数据库修复工具。定期使用完毕后,请保持禁用此选项。', 'wp-china-yes' ), + ], + [ + 'id' => 'db_tools_link', + 'type' => 'content', + 'title' => __( '数据库修复工具', 'wp-china-yes' ), + 'subtitle' => '打开数据库修复工具', + 'dependency' => [ 'enable_db_tools', '==', 'true' ], + 'content' => '' . esc_html__( '打开数据库修复工具', 'wp-china-yes' ) . '', + ], +[ + 'id' => 'enable_sections', + 'type' => 'switcher', + 'title' => '高级定制', + 'subtitle' => '启用或禁用功能选项卡', + 'default' => true, + 'desc' => __( '启用后,您可以在下方选用文派叶子功能,特别提醒:禁用对应功能后再次启用需重新设置。', 'wp-china-yes' ), +], +[ + 'id' => 'enabled_sections', + 'type' => 'checkbox', + 'title' => '功能选项卡', + 'subtitle' => '选择要显示的功能选项卡', + 'inline' => true, + 'options' => [ + 'store' => '应用市场', + 'admincdn' => '萌芽加速', + 'cravatar' => '初认头像', + 'windfonts' => '文风字体', + 'motucloud' => '墨图云集', + 'fewmail' => '飞秒邮箱', + 'wordyeah' => '无言会语', + 'blocks' => '笔笙区块', + 'deerlogin' => '灯鹿用户', + 'waimao' => '跨飞外贸', + 'woocn' => 'Woo电商', + 'lelms' => '乐尔达思', + 'wapuu' => '瓦普文创', + 'adblock' => '广告拦截', + 'notice' => '通知管理', + 'plane' => '飞行模式', + 'monitor' => '脉云维护', + 'forums' => '赛博论坛', + 'monitor' => '脉云维护', + 'forms' => '重力表单', + 'panel' => '天控面板', + 'security' => '雨滴安全', + 'domain' => '蛋叮域名', + 'performance' => '性能优化', + 'brand' => '品牌白标', + 'sms' => '竹莺短信', + 'chat' => '点洽客服', + 'translate' => '文脉翻译', + 'ecosystem' => '生态系统', + 'deer' => '建站套件', + 'docs' => '帮助文档', + 'about' => '关于插件', + 'welcome' => '欢迎使用' + ], + 'default' => ['welcome', 'store', 'admincdn', 'cravatar', 'other', 'about'], + 'desc' => '选择要在设置页面显示的功能选项卡,未选择的选项卡将被隐藏', + 'dependency' => ['enable_sections', '==', 'true'], +] + + ], ] ); + if (in_array('deer', $enabled_sections)) { + $settings_page_url = $this->get_settings_page_url(); + ob_start(); + include CHINA_YES_PLUGIN_PATH . 'templates/website-section.php'; + $website_content = ob_get_clean(); WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '建站套件', @@ -516,49 +1222,58 @@ WP_CHINA_YES::createSection( $this->prefix, [ 'fields' => [ [ 'type' => 'content', - 'content' => - <<

开源建站

文派寻鹿🦌(WP Deer)建站套件是由文派科技官方提供的企业建站产品集合,代码均为 100% GPL 开源,无任何加密隐藏。

SEO 优化技巧

WPXYZ.com ↗

网站政策合规

WPICP.com ↗

软件开发工具

WPSDK.com ↗
-HTML, + 'content' =>$website_content, ] ], ] ); + } + + + if (in_array('docs', $enabled_sections)) { + WP_CHINA_YES::createSection( $this->prefix, [ + 'title' => '帮助文档', + 'icon' => 'icon icon-lifebuoy', + 'fields' => [ + [ + 'id' => 'docs', + 'type' => 'radio', + 'title' => __( '帮助文档', 'wp-china-yes' ), + 'inline' => true, + 'options' => [ + 'cn' => '默认线路', + 'global' => '国际线路', + 'off' => '不启用' + ], + 'default' => 'cn', + 'subtitle' => '是否启用灯鹿用户', + 'desc' => __( '灯鹿用户(DeerLogin)Gravatar 在中国的完美替代方案,您可以在 Cravatar.com 上传头像,更多选项请安装 WPAavatar 插件。可自选加速线路。', + 'wp-china-yes' ), + ], + ], + ] ); + } - + if (in_array('about', $enabled_sections)) { + $settings_page_url = $this->get_settings_page_url(); + ob_start(); + include CHINA_YES_PLUGIN_PATH . 'templates/about-section.php'; + $about_content = ob_get_clean(); + WP_CHINA_YES::createSection( $this->prefix, [ 'title' => '关于插件', 'icon' => 'icon icon-info-circle', 'fields' => [ [ 'type' => 'content', - 'content' => - <<
-

项目简介

文派(WordPress)中国本土化项目始于 2019 年,由 文派叶子🍃(WPCY) 插件开启,其前身为 WP-China-Yes。 - -

2023 年 5 月,文派科技完成对该项目的收购,并对其进行了全面的品牌重塑。

-

赞助支持

特别感谢以下企业品牌对文派项目提供的资金资源支持。早期伙伴未来有机会共享文派生态资源,期待社会各界参与。

开发 & 贡献者

100% 开源代码,诚邀您一起参与文派 (WordPress) 软件国产化进程,打造属于自己的开源自助建站程序。

-HTML, + 'content' =>$about_content, ] ], ] ); } - + } + /** * 加载后台资源 */ @@ -582,6 +1297,8 @@ HTML, return $plugins; } ); + + // 插件页设置 add_filter( 'plugin_action_links', function ( $links, $file ) { if ( 'wp-china-yes/wp-china-yes.php' !== $file ) { @@ -595,4 +1312,4 @@ HTML, return $links; }, 10, 2 ); } -} +} \ No newline at end of file diff --git a/Service/Super.php b/Service/Super.php index 7f664ca..8298bef 100755 --- a/Service/Super.php +++ b/Service/Super.php @@ -31,148 +31,152 @@ class Super { /** * 添加「文派茶馆」小组件 */ - if ( is_admin() ) { - add_action( 'wp_dashboard_setup', function () { - global $wp_meta_boxes; +if ( is_admin() ) { + add_action( 'wp_dashboard_setup', function () { + global $wp_meta_boxes; - unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); - wp_add_dashboard_widget( 'wenpai_tea', '文派茶馆', function () { - echo << -
+ unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); + wp_add_dashboard_widget( 'wenpai_tea', '文派茶馆', function () { + $default_rss_url = 'https://wptea.com/feed/'; + $custom_rss_url = $this->settings['custom_rss_url'] ?? ''; + $refresh_interval = $this->settings['custom_rss_refresh'] ?? 3600; + + $rss_display_options = $this->settings['rss_display_options'] ?? ['show_date', 'show_summary', 'show_footer']; + if (!is_array($rss_display_options)) { + $rss_display_options = explode(',', $rss_display_options); + } + + // 获取默认的 RSS 源内容 + $default_rss = fetch_feed($default_rss_url); + $default_items = []; + if (!is_wp_error($default_rss)) { + $default_items = $default_rss->get_items(0, 5); + } + + $custom_items = []; + $custom_rss = null; + $custom_rss_latest_date = 0; + + if (!empty($custom_rss_url)) { + $transient_key = 'wenpai_tea_custom_rss_' . md5($custom_rss_url); + $cached_custom_items = get_transient($transient_key); + + if (false === $cached_custom_items) { + $custom_rss = fetch_feed($custom_rss_url); + if (!is_wp_error($custom_rss)) { + $custom_items = $custom_rss->get_items(0, 2); + if (!empty($custom_items)) { + $custom_rss_latest_date = $custom_items[0]->get_date('U'); + } + + set_transient($transient_key, $custom_items, $refresh_interval); + } + } else { + $custom_items = $cached_custom_items; + if (!empty($custom_items)) { + $custom_rss_latest_date = $custom_items[0]->get_date('U'); + } + } + } + + $three_days_ago = time() - (3 * 24 * 60 * 60); + if ($custom_rss_latest_date > $three_days_ago) { + $items = array_merge(array_slice($default_items, 0, 3), $custom_items); + } else { + $items = array_slice($default_items, 0, 5); + } + + if (is_wp_error($custom_rss)) { + $items = array_slice($default_items, 0, 5); + } + + echo << +
HTML; - wp_widget_rss_output( 'https://wptea.com/feed/', [ - 'items' => 5, - 'show_summary' => 1, - ] ); - echo << -
- - + foreach ($items as $item) { + echo '
'; + echo '' . esc_html($item->get_title()) . ''; + if (in_array('show_date', $rss_display_options)) { + echo '' . esc_html($item->get_date('Y.m.d')) . ''; + } + if (in_array('show_summary', $rss_display_options)) { + echo '
' . esc_html(wp_trim_words($item->get_description(), 45, '...')) . '
'; + } + echo '
'; + } + + echo << +
HTML; - } ); - } ); - add_action( 'wp_network_dashboard_setup', function () { - global $wp_meta_boxes; - - unset( $wp_meta_boxes['dashboard-network']['side']['core']['dashboard_primary'] ); - wp_add_dashboard_widget( 'wenpai_tea', '文派茶馆', function () { - echo << -
+ if (in_array('show_footer', $rss_display_options)) { + echo << + 文派开源 + | + 支持论坛 + | + 翻译平台 + | + 订阅推送 +

HTML; - wp_widget_rss_output( 'https://wptea.com/feed/', [ - 'items' => 5, - 'show_summary' => 1, - ] ); - echo << -
- - + } + echo << + #wenpai_tea .rss-widget { + padding: 0 12px; + } + #wenpai_tea .rss-widget:last-child { + border-bottom: none; + padding-bottom: 8px; + } + #wenpai_tea .rss-item { + margin-bottom: 10px; + padding-bottom: 10px; + border-bottom: 1px solid #eee; + } + #wenpai_tea .rss-item:last-child { + border-bottom: none; + margin-bottom: 0; + padding-bottom: 0; + } + #wenpai_tea .rss-item a { + text-decoration: none; + display: block; + margin-bottom: 5px; + } + #wenpai_tea .rss-date { + color: #666; + font-size: 12px; + display: block; + margin-bottom: 8px; + } + #wenpai_tea .rss-summary { + color: #444; + font-size: 13px; + line-height: 1.5; + } + #wenpai_tea .community-events-footer { + margin-top: 15px; + padding-top: 15px; + padding-bottom: 5px; + border-top: 1px solid #eee; + text-align: center; + } + #wenpai_tea .community-events-footer a { + text-decoration: none; + margin: 0 5px; + } + #wenpai_tea .community-events-footer a:hover { + text-decoration: underline; + } + HTML; - } ); - } ); - } - - /** - * WordPress 核心静态文件链接替换 - */ - if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { - if ( - in_array( 'admin', (array) $this->settings['admincdn'] ) && - ! stristr( $GLOBALS['wp_version'], 'alpha' ) && - ! stristr( $GLOBALS['wp_version'], 'beta' ) && - ! stristr( $GLOBALS['wp_version'], 'RC' ) - ) { - // 禁用合并加载,以便于使用公共资源节点 - global $concatenate_scripts; - $concatenate_scripts = false; - - $this->page_str_replace( 'init', 'preg_replace', [ - '~' . home_url( '/' ) . '(wp-admin|wp-includes)/(css|js)/~', - sprintf( 'https://wpstatic.admincdn.com/%s/$1/$2/', $GLOBALS['wp_version'] ) - ] ); - } - } - - /** - * adminCDN - */ - if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { - $this->load_admincdn(); - } + }); + }); +} /** * 初认头像 @@ -214,6 +218,14 @@ HTML; add_action( 'admin_head', [ $this, 'load_adblock' ] ); } } +/** + * 通知管理 + */ +if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { + if ( ! empty( $this->settings['notice_block'] ) && $this->settings['notice_block'] == 'on' ) { + add_action( 'admin_head', [ $this, 'load_notice_management' ] ); + } +} /** * 飞行模式 @@ -223,70 +235,7 @@ HTML; } } - /** - * 加载 adminCDN - */ - public function load_admincdn() { - /** - * 前台静态加速 - */ - if ( in_array( 'frontend', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'template_redirect', 'preg_replace', [ - '#(?<=[(\"\'])(?:' . quotemeta( home_url() ) . ')?/(?:((?:wp-content|wp-includes)[^\"\')]+\.(css|js)[^\"\')]+))(?=[\"\')])#', - 'https://public.admincdn.com/$0' - ] ); - } - /** - * Google 字体替换 - */ - if ( in_array( 'googlefonts', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'init', 'str_replace', [ - 'fonts.googleapis.com', - 'googlefonts.admincdn.com' - ] ); - } - - /** - * Google 前端公共库替换 - */ - if ( in_array( 'googleajax', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'init', 'str_replace', [ - 'ajax.googleapis.com', - 'googleajax.admincdn.com' - ] ); - } - - /** - * CDNJS 前端公共库替换 - */ - if ( in_array( 'cdnjs', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'init', 'str_replace', [ - 'cdnjs.cloudflare.com/ajax/libs', - 'cdnjs.admincdn.com' - ] ); - } - - /** - * jsDelivr 前端公共库替换 - */ - if ( in_array( 'jsdelivr', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'init', 'str_replace', [ - 'cdn.jsdelivr.net', - 'jsd.admincdn.com' - ] ); - } - - /** - * BootstrapCDN 前端公共库替换 - */ - if ( in_array( 'bootstrapcdn', (array) $this->settings['admincdn'] ) ) { - $this->page_str_replace( 'init', 'str_replace', [ - 'maxcdn.bootstrapcdn.com', - 'jsd.admincdn.com' - ] ); - } - } /** @@ -470,6 +419,7 @@ HTML // 支持中文排版两端对齐 if ( in_array( 'align', (array) $this->settings['windfonts_typography'] ) ) { add_action( 'wp_head', function () { + if ( is_single() ) { // 仅在文章页面生效 echo ''; + } } ); } } - /** - * 加载广告拦截 - */ - public function load_adblock() { - foreach ( (array) $this->settings['adblock_rule'] as $rule ) { - if ( empty( $rule['enable'] ) ) { - continue; - } - if ( empty( $rule['selector'] ) ) { - continue; - } - echo sprintf( << - %s { - display: none!important; - } - -HTML - , - htmlspecialchars_decode( $rule['selector'] ) - ); - } - } +/** + * 加载广告拦截 + */ +public function load_adblock() { + if (empty($this->settings['adblock']) || $this->settings['adblock'] !== 'on') { + return; + } + + // 处理广告拦截规则 + foreach ( (array) $this->settings['adblock_rule'] as $rule ) { + if ( empty( $rule['enable'] ) || empty( $rule['selector'] ) ) { + continue; + } + echo sprintf( '', + htmlspecialchars_decode( $rule['selector'] ) + ); + } +} + + +/** + * 加载通知管理 + */ +public function load_notice_management() { + // 首先检查是否启用通知管理功能 + if (empty($this->settings['notice_block']) || $this->settings['notice_block'] !== 'on') { + return; + } + + // 检查是否启用全局禁用 + if (!empty($this->settings['disable_all_notices'])) { + $this->disable_all_notices(); + echo ''; + return; + } + + // 处理选择性禁用 + $selected_notices = $this->settings['notice_control'] ?? []; + $notice_method = $this->settings['notice_method'] ?? 'hook'; + + if (!empty($selected_notices)) { + // 处理钩子移除 + if (in_array($notice_method, ['hook', 'both'])) { + $this->disable_selected_notices($selected_notices); + } + + // 处理 CSS 隐藏 + if (in_array($notice_method, ['css', 'both'])) { + $this->apply_notice_css($selected_notices); + } + } +} + +/** + * 应用通知 CSS 隐藏 + */ +private function apply_notice_css($selected_notices) { + $selectors = []; + foreach ($selected_notices as $type) { + switch ($type) { + case 'error': + $selectors[] = '.notice-error,.error'; + break; + case 'warning': + $selectors[] = '.notice-warning'; + break; + case 'success': + $selectors[] = '.notice-success,.updated'; + break; + case 'info': + $selectors[] = '.notice-info'; + break; + case 'core': + $selectors[] = '.update-nag'; + break; + } + } + + if (!empty($selectors)) { + echo ''; + } +} + +/** + * 移除所有管理通知 + */ +private function disable_all_notices() { + remove_all_actions('admin_notices'); + remove_all_actions('all_admin_notices'); + remove_all_actions('user_admin_notices'); + remove_all_actions('network_admin_notices'); +} + +/** + * 禁用选定的通知类型 + */ +private function disable_selected_notices($types) { + if (in_array('core', $types)) { + remove_action('admin_notices', 'update_nag', 3); + remove_action('admin_notices', 'maintenance_nag', 10); + add_filter('pre_site_transient_update_core', '__return_null'); + add_filter('pre_site_transient_update_plugins', '__return_null'); + add_filter('pre_site_transient_update_themes', '__return_null'); + } + +} + + /** * 加载飞行模式 diff --git a/assets/css/setting.css b/assets/css/setting.css index f69d956..f64de46 100755 --- a/assets/css/setting.css +++ b/assets/css/setting.css @@ -82,7 +82,7 @@ margin-right: 0px; } -.wp_china_yes-field.wp_china_yes-field-radio, .wp_china_yes-field-checkbox, .wp_china_yes-field-group, .wp_china_yes-field-switcher, .wp_china_yes-field-text { +.wp_china_yes-field { padding: 8%; background-color: #ffffff; margin: 5% 0; @@ -90,10 +90,32 @@ box-shadow: 0 0 0 1px #ccd0d4, 0 1px 1px 1px rgba(0, 0, 0, .04); } +.wp_china_yes-field.wp_china_yes-field-content { + padding: 0; + background-color: rgba(255, 255, 255, 0); + margin: 0; + border-radius: 0; + box-shadow: unset; +} .wp_china_yes-field-checkbox .wp_china_yes--inline-list li, .wp_china_yes-field-radio .wp_china_yes--inline-list li { margin-right: 20px; } +.wp_china_yes-copyright p { + font-size: 12px; + color: #999; +} +.wp_china_yes-copyright { + float: left; + margin-top: 25px; + margin-bottom: 35px; + text-align: center; + width: 100%; + font-size: 12px; + zoom: 90%; + +} + .wp_china_yes-section { margin: 50px auto; max-width: 1000px; @@ -108,9 +130,8 @@ .wp_china_yes-field+.wp_china_yes-field { border-top: 0px solid #eee; } - -.wp_china_yes-field.wp_china_yes-field-content { - padding: 0px; +.wp_china_yes-field-fieldset .wp_china_yes-fieldset-content { + border: 0px solid #ccd0d4; } .wp_china_yes-section-title { diff --git a/assets/images/wpcy-logo.png b/assets/images/wpcy-logo.png new file mode 100755 index 0000000000000000000000000000000000000000..2f8f1323302f61d28b99dfd6ca012bb7bbaeabfe GIT binary patch literal 32163 zcmaI7Wmp_R(=I&AV!_=V5-hm8dvJm~Ebc7sZowf)fJK7@0wF+xd$0r#8l2$nz8`tc z`<(CmIM>-fGt=Ewb$4}DPjyXgoQ9eLCK?$U005Xuin3Y&0D8U!0jS8&7h{hKo97ED zR8AkN?P>${vG9NZQr51P5E>KkDzS7&yMe`DBv zo!y?P0YFs3*UiGp5dx*LgxK1=pezAlm+FI#&LU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Ct#OyrZANth140n$l$M)=GE0uCC~()$%i(tW~1?a43z zgroiXxL>y*j2;gNI8Z#IF8}?L^#YS+0CJq^*YEiCKEJBr^9%^sFHm{!uOYKKMke!x zCffkySPP*kUgcL$_b%^=pw|%l%sB*8)f-q1Uf&1dc(#^gY$7 z4}Xuk@dLWypVrf!{=Q|pz3J&@0NxCd8h}~q8BjH$;8#NLKiqc#hZxilM=IKly$nF@ eaCr0oC%^#Ztvv=C<7Qm|0000请先填写 RSS 源地址'); + return; + } + + button.prop("disabled", true); + result.html("测试中..."); + + $.post(ajaxurl, { + action: "test_rss_feed", + _ajax_nonce: '', + feed_url: feedUrl + }) + .done(function(response) { + result.html(response.success ? + '' + response.data + '' : + '' + response.data + '' + ); + }) + .fail(function() { + result.html('测试失败'); + }) + .always(function() { + button.prop("disabled", false); + }); + }); + }); diff --git a/changelog.txt b/changelog.txt old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/composer.lock b/composer.lock old mode 100644 new mode 100755 diff --git a/copyright.txt b/copyright.txt old mode 100644 new mode 100755 index 558b6d2..df51603 --- a/copyright.txt +++ b/copyright.txt @@ -1,28 +1,36 @@ ------------------------------------------------------------------------------------------ -**Copyright © 2025 WenPai.cn (Guangzhou) Technology Co., Ltd.** ------------------------------------------------------------------------------------------ - -**Compliance Terms** -Everyone is free to use Wenpai open-source software. However, in China, when using Wenpai software, you must adhere to the GPL open-source license, respect the intellectual property rights of others, and prioritize compliance with Chinese laws in case of any conflicts. - -**Fork Declaration** -To ensure the long-term availability of various Wenpai (WordPress) infrastructure components, individuals with the necessary capabilities are welcome to establish their own service sources or fork Wenpai Leaf 🍃 (WPCY) to create their own versions. - -**The Only Requirement:** -While strictly adhering to the GPL license, you must respect all lawful rights of Wenpai Technology, including (but not limited to) copyrights, trademarks, patents, intellectual property, goodwill, and more. - ------------------------------------------------------------------------------------------ -**版权所有 © 2025 年 文派(广州)科技有限公司** ------------------------------------------------------------------------------------------ - -**合规条款** -任何人都可以自由使用文派开源软件,但在中国,当您使用文派软件时,您应在遵守 GPL 开源协议的同时,尊重他人的知识产权,同时有违背中国法律的情况时皆以中国法律为准。 - -**分叉声明** -为保障各项文派 (WordPress) 基础设施的长久可用性,欢迎有能力的人自建各类服务源以及分叉文派叶子🍃(WPCY)来制作您自己的版本; - -**唯一要求:** -在严格遵守 GPL 协议的前提下,尊重文派科技的各项合法权益,包括 (不限于) 版权、商标、专利、知识产权、商誉等… - - - +----------------------------------------------------------------------------------------- +**Copyright © 2025 WenPai.cn (Guangzhou) Technology Co., Ltd.** +----------------------------------------------------------------------------------------- + +**Compliance Terms** +Everyone is free to use WenPai open-source software.However, in China, when using WenPai software, +you must adhere to the GPL open-source license, respect the intellectual property rights of others, +and prioritize compliance with Chinese laws in case of any conflicts. + +**Fork Declaration** +To ensure the long-term availability of various Wenpai (WordPress) infrastructure components, +individuals with the necessary capabilities are welcome to establish their own service sources +or fork WenPai Leaf 🍃 WP-China-Yes (WPCY) to create their own versions. + +**The Only Requirement:** +While strictly adhering to the GPL license, you must respect all lawful rights of WenPai Technology, +including (but not limited to) copyrights, trademarks, patents, intellectual property, goodwill, and more. + +----------------------------------------------------------------------------------------- +**版权所有 © 2025 年 文派(广州)科技有限公司** +----------------------------------------------------------------------------------------- + +**合规条款** +任何人都可以自由使用文派开源软件,但在中国,当您使用文派软件时,您应在遵守 GPL 开源协议的同时, +尊重他人的知识产权,同时有违背中国法律的情况时皆以中国法律为准。 + +**分叉声明** +为保障各项文派 (WordPress) 基础设施的长久可用性, +欢迎有能力的人自建各类服务源以及分叉文派叶子🍃(WPCY)来制作您自己的版本; + +**唯一要求:** +在严格遵守 GPL 协议的前提下,尊重文派科技的各项合法权益, +包括 (不限于) 版权、商标、专利、知识产权、商誉等… + + + diff --git a/framework/classes/admin-options.class.php b/framework/classes/admin-options.class.php index 3a9cb9d..152624f 100755 --- a/framework/classes/admin-options.class.php +++ b/framework/classes/admin-options.class.php @@ -497,9 +497,19 @@ if ( ! class_exists( 'WP_CHINA_YES_Options' ) ) { echo '
'; echo '
'; - echo '
'; - echo '

'. $this->args['framework_title'] .'

'; - echo '
'; +echo '
'; +$hide_elements = !empty($this->options['hide_elements']) ? $this->options['hide_elements'] : []; +if (!in_array('hide_logo', $hide_elements)) { + $logo_url = !empty($this->options['header_logo']['url']) ? $this->options['header_logo']['url'] : plugins_url('wp-china-yes/assets/images/wpcy-logo.png'); + echo ''; +} +if (!in_array('hide_title', $hide_elements)) { + echo '

'. $this->args['framework_title'] .'

'; +} +if (!in_array('hide_version', $hide_elements)) { + echo '   v' . CHINA_YES_VERSION . ''; +} +echo '
'; echo '
'; @@ -572,6 +582,12 @@ if ( ! class_exists( 'WP_CHINA_YES_Options' ) ) { echo ''; + echo ''; + + echo '
'; } @@ -625,8 +641,13 @@ if ( ! class_exists( 'WP_CHINA_YES_Options' ) ) { echo '
'; + echo ''; + echo '
'; + echo '
'; echo ( $has_nav && $nav_type === 'normal' ) ? '
' : ''; diff --git a/templates/about-section.php b/templates/about-section.php new file mode 100755 index 0000000..ffbf1ed --- /dev/null +++ b/templates/about-section.php @@ -0,0 +1,48 @@ + +
+ +
+
+

开发 & 贡献者

+

100% 开源代码,诚邀您一起参与文派 (WordPress) 软件国产化进程,打造属于自己的开源自助建站程序。

+ + +
+
+
+
diff --git a/templates/maintenance-default.php b/templates/maintenance-default.php new file mode 100755 index 0000000..9f314bf --- /dev/null +++ b/templates/maintenance-default.php @@ -0,0 +1,20 @@ +// templates/maintenance-default.php + +> + + + + <?php echo esc_html($title); ?> + + + +
+

+
+ +
+
+ + diff --git a/templates/website-section.php b/templates/website-section.php new file mode 100755 index 0000000..9b31c7f --- /dev/null +++ b/templates/website-section.php @@ -0,0 +1,21 @@ + +
+
+
+

开源建站

+

文派寻鹿🦌(WP Deer)建站套件是由文派科技官方提供的企业建站产品集合,代码均为 100% GPL 开源,无任何加密隐藏。

+ +
+
+
+
+

SEO 优化技巧

WPXYZ.com ↗
+
+

网站政策合规

WPICP.com ↗
+
+

软件开发工具

WPSDK.com ↗
+
+
+
diff --git a/templates/welcome-section.php b/templates/welcome-section.php new file mode 100755 index 0000000..b3f8783 --- /dev/null +++ b/templates/welcome-section.php @@ -0,0 +1,56 @@ + +
+
+
+

原生体验

+

文派叶子🍃(WP-China-Yes)是一款不可多得的 WordPress 系统底层优化和生态基础设施软件。

+ +
+
+

特色功能

+ +

* 100% 兼容 WP 程序及分支发行版本,更多优秀插件待您体验。

+
+
+
+
+

网站加速

+

优化加速插件多如牛毛,为何文派叶子如此与众不同?

进一步了解 ↗
+
+

翻译推送

+

高质量翻译中文本地化翻译由文派开源官方提供,欢迎参与改进。

本地化改进 ↗
+
+

广告屏蔽

+

呈现清爽整洁的网站后台,清除侵入式后台广告、无用信息。

获取广告规则 ↗
+
+
+
+

加入我们

+

关注文派茶馆 WPTEA.com 公众号以及订阅我们的时事通讯即可接收独家内容、提示和更新。

+
+ +
+
+
diff --git a/wp-china-yes.php b/wp-china-yes.php index 9f05e67..d45f19b 100755 --- a/wp-china-yes.php +++ b/wp-china-yes.php @@ -1,10 +1,10 @@