diff --git a/.kiro/steering/mermaid-removal-summary.md b/.kiro/steering/mermaid-removal-summary.md deleted file mode 100644 index ca4b121..0000000 --- a/.kiro/steering/mermaid-removal-summary.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -inclusion: manual ---- - -# Mermaid 功能移除总结 - -## 移除原因 - -WP-Markdown 编辑器在保存 Markdown 文件时,会将 Mermaid 代码块保存为一整行(没有真正的换行符),导致 Mermaid 解析器无法正确解析,持续报错:`Parse error on line 1: Expecting 'NEWLINE', 'SPACE', 'GRAPH'`。 - -尝试了多种解决方案(JavaScript 解码、PHP 预处理、智能格式化等)均失败。 - -## 已移除内容 - -1. **settings.php** - 移除 Mermaid 设置项和选项保存逻辑(约 15 行) -2. **functions.php** - 移除两个 Mermaid 处理函数(约 70 行) -3. **footer.php** - 移除 Mermaid 加载和渲染代码(约 220 行) -4. **style.css** - 移除 Mermaid 图表样式(约 25 行) -5. **本地镜像** - 删除 `assets/vendor/external/mermaid/` 目录 - -总计移除约 330 行代码和 2 个本地镜像文件。 - -## 需求文档 - -已创建 `mermaid-support-requirements.md` 文档,包含: -- 问题详细分析 -- 已尝试的解决方案 -- 推荐的替代方案(使用支持 Mermaid 的插件) -- 技术实现参考 -- 测试用例 - -## 推荐方案 - -使用支持 Mermaid 的 WordPress 插件: -- **WP Githuber MD** - 功能强大的 Markdown 编辑器 -- **Markdown Block** - Gutenberg 原生 Markdown 块 -- **Code Syntax Block** - 支持 Mermaid 的代码块插件 - -## Git 提交 - -``` -commit 54cbb40 -feat: 移除 Mermaid 支持并创建需求文档 - -- 从 settings.php 移除 Mermaid 设置项和选项保存逻辑 -- 从 functions.php 移除 Mermaid 代码块预处理函数 -- 从 footer.php 移除 Mermaid 加载和渲染代码 -- 从 style.css 移除 Mermaid 图表样式 -- 删除本地镜像文件 assets/vendor/external/mermaid/ -- 创建 mermaid-support-requirements.md 需求文档 -``` diff --git a/.kiro/steering/phase-3-complete.md b/.kiro/steering/phase-3-complete.md deleted file mode 100644 index 025ec5c..0000000 --- a/.kiro/steering/phase-3-complete.md +++ /dev/null @@ -1,306 +0,0 @@ -# AI 设置重构 - 第三阶段完成总结 - -## 📅 完成时间 -2026-01-26 - -## ✅ 第三阶段:UI 重构和移除向后兼容(已完成) - -### 步骤 2:在 settings.php 中插入新的 AI 功能部分 ✅ - -**完成内容**: -- ✅ 在第 1984 行之前插入新的 AI 功能 h1 标题 -- ✅ 添加 API 管理 (h2) 部分 - - 已配置的 API 列表展示 - - API 配置表单(添加/编辑) - - 测试、编辑、删除按钮 -- ✅ 添加文章摘要 (h2) 部分 - - 启用 AI 摘要开关 - - 默认使用 API 选择 - - 摘要提示词设置 - - 排除文章 ID 设置 - - 清除缓存按钮 -- ✅ 添加评论审核 (h2) 部分 - - 启用 AI 识别开关 - - 默认使用 API 选择 - - 实时检测模式 - - 关键字管理 - - Prompt 模式选择 - - 自定义 Prompt - - 自动处理阈值 - -**代码统计**: -- 新增 HTML 代码:约 300 行 -- 新增 JavaScript 代码:约 250 行 -- 总计新增:约 550 行 - -### 步骤 3:移除旧的 AI 设置代码 ✅ - -**已移除内容**: -- ✅ 旧的文章功能中的 AI 摘要设置(包含 10 个提供商的多 API 配置界面) -- ✅ 旧的 AI 服务商选择下拉框 -- ✅ 旧的按提供商分组的 API 配置界面 - -**删除代码统计**: -- 删除旧代码:约 600 行 - -### 步骤 4:更新选项保存逻辑 ✅ - -**完成内容**: -- ✅ 移除 `argon_update_option('argon_ai_summary_provider')` -- ✅ 移除所有提供商的 API 配置保存逻辑(10 个提供商的循环) -- ✅ 添加 `argon_update_option('argon_ai_summary_active_api')` -- ✅ 添加 `argon_update_option('argon_ai_spam_active_api')` -- ✅ 更新 `argon_ai_summary_exclude_ids` 为 `argon_ai_summary_exclude_posts` -- ✅ 简化评论审核相关选项保存 -- ✅ 移除不再使用的旧选项保存逻辑 - -**代码统计**: -- 删除旧保存逻辑:30 行 -- 新增保存逻辑:7 行 -- 净减少:23 行 - -## 📊 总体统计 - -### 代码变更 -- **settings.php**: - - 原始行数:7812 行 - - 最终行数:7514 行 - - 净减少:298 行 - - 新增代码:550 行 - - 删除代码:848 行 - -### Git 提交记录 -1. **3f188b7** - feat: 完成 AI 设置页面 UI 重构 - - 添加新的 AI 功能部分(API 管理、文章摘要、评论审核) - - 添加完整的 JavaScript 交互代码 - - 删除旧的 AI 设置代码 - -2. **04f20d4** - feat: 更新 AI 设置选项保存逻辑 - - 移除旧的 API 配置保存逻辑 - - 添加新的场景化 API 保存逻辑 - -## 🎯 新 UI 功能特性 - -### 1. API 管理界面 -- **统一列表展示**:所有提供商的 API 在一个列表中显示 -- **场景标签**:显示每个 API 用于哪些场景(文章摘要/评论审核) -- **操作按钮**:测试、编辑、删除 -- **添加/编辑表单**: - - 配置名称 - - API 密钥(可显示/隐藏) - - 提供商选择 - - API 端点(可选) - - 模型选择(支持刷新模型列表) - -### 2. 文章摘要设置 -- 启用/禁用开关 -- 从所有 API 中选择默认使用的 API -- 摘要提示词自定义 -- 排除文章 ID 设置 -- 清除缓存功能 - -### 3. 评论审核设置 -- 启用/禁用开关 -- 从所有 API 中选择默认使用的 API -- 实时检测模式(禁用/智能抽查/检测所有) -- 关键字黑名单管理 -- Prompt 模式选择(极简/标准/增强/自定义) -- 自定义 Prompt 编辑器 -- 自动处理阈值设置 - -### 4. JavaScript 交互功能 -- ✅ 添加 API(表单验证、AJAX 提交) -- ✅ 编辑 API(加载数据、更新) -- ✅ 删除 API(确认对话框、AJAX 删除) -- ✅ 测试 API(连通性测试、结果提示) -- ✅ 刷新模型列表(动态获取、选择应用) -- ✅ 显示/隐藏密码 -- ✅ 清除 AI 摘要缓存 -- ✅ Prompt 模式切换(显示/隐藏自定义 Prompt) - -## 🔧 技术实现 - -### 数据流 -``` -用户操作 → JavaScript → AJAX → functions.php → WordPress Options - ↓ - argon_ai_apis - argon_ai_summary_active_api - argon_ai_spam_active_api -``` - -### AJAX 端点 -- `argon_ajax_add_unified_api` - 添加 API -- `argon_ajax_update_unified_api` - 更新 API -- `argon_ajax_delete_unified_api` - 删除 API -- `argon_ajax_get_unified_api` - 获取单个 API -- `argon_ajax_test_unified_api` - 测试 API -- `argon_ajax_get_ai_models` - 获取模型列表 -- `argon_ajax_clear_ai_summaries` - 清除摘要缓存 - -### 数据结构 -```php -// 统一存储所有 API -argon_ai_apis = [ - { - 'id' => 'api_1737878400_1234', - 'name' => '主 OpenAI API', - 'provider' => 'openai', - 'api_key' => 'sk-xxx', - 'api_endpoint' => '', - 'model' => 'gpt-4o-mini', - 'created_at' => 1737878400 - } -] - -// 场景化配置 -argon_ai_summary_active_api = 'api_1737878400_1234' // 文章摘要 -argon_ai_spam_active_api = 'api_1737878400_5678' // 评论审核 -``` - -## ✨ 用户体验改进 - -### 优势 -1. **统一管理**:所有 API 在一个列表中,一目了然 -2. **灵活配置**:不同场景可以使用不同的 API -3. **易于添加**:添加 API 时直接输入密钥和选择提供商 -4. **更好的 UX**:不需要在多个提供商之间切换 -5. **实时反馈**:测试 API、刷新模型等操作都有即时反馈 -6. **场景可视化**:清楚地看到每个 API 用于哪些场景 - -### 界面特点 -- 现代化设计:使用卡片式布局,视觉层次清晰 -- 响应式交互:所有操作都有加载状态和结果提示 -- 友好的错误处理:表单验证、错误提示 -- 便捷的操作:一键测试、刷新模型、清除缓存 - -## ✅ 步骤 5:移除 functions.php 中的向后兼容代码(已完成) - -**已移除的内容**: -1. ✅ 旧的多 API 管理函数(约 200 行): - - `argon_get_provider_apis()` - - `argon_add_provider_api()` - - `argon_update_provider_api()` - - `argon_delete_provider_api()` - - `argon_set_active_api()` - -2. ✅ 数据迁移函数(约 45 行): - - `argon_migrate_ai_apis()` - - `add_action('after_setup_theme', 'argon_migrate_ai_apis')` - -3. ✅ 简化 `argon_get_ai_provider_config()` 函数 - - 移除回退到旧系统的逻辑 - - 只保留从新系统获取配置的代码 - -4. ✅ 简化 `argon_get_active_api_config()` 函数 - - 移除向后兼容的回退逻辑 - - 返回空配置而不是尝试旧系统 - -**代码统计**: -- 删除代码:约 245 行 -- functions.php 文件更加简洁 - -### 步骤 6:清理测试文件 ✅ - -**已删除的文件**: -- ✅ `test-system-status.php` -- ✅ `test-unified-api-system.php` -- ✅ `tmp/ai-settings-new-structure.php` -- ✅ `tmp/new-ai-settings-section.php` -- ✅ `tmp/new-ai-settings-js.php` -- ✅ `tmp/additional-ajax-functions.php` -- ✅ `tmp/complete-ai-section.php` -- ✅ `tmp/new-ai-section-complete.php` -- ✅ `tmp/refactor-settings-ui.py` -- ✅ `tmp/remove_spam_detection_subsection.py` - -**保留的文件**: -- `.kiro/steering/*.md` - 所有文档作为历史记录保留 -- `tmp/refactor-settings.py` - 可能还有用 -- `tmp/analyze-settings.py` - 可能还有用 - -## 🎉 阶段性成果 - -第三阶段的 UI 重构已经基本完成!新的 AI 功能界面已经上线,用户现在可以: - -1. ✅ 在统一的界面中管理所有 AI 提供商的 API -2. ✅ 为不同场景(文章摘要、评论审核)选择不同的 API -3. ✅ 测试 API 连通性 -4. ✅ 刷新并选择可用模型 -5. ✅ 自定义 Prompt 和其他高级设置 - -## 🎉 第三阶段完成总结 - -第三阶段的所有工作已经完成!包括: - -1. ✅ **UI 重构**:新的 AI 功能界面已上线 -2. ✅ **选项保存**:所有设置项正确保存 -3. ✅ **移除旧代码**:删除了约 600 行旧的 AI 设置代码 -4. ✅ **移除向后兼容**:删除了约 245 行向后兼容代码 -5. ✅ **清理临时文件**:删除了所有测试脚本和临时文件 - -## 📝 下一步建议 - -1. **功能测试**: - - ✅ 在 WordPress 后台测试所有功能 - - ✅ 验证 API 添加、编辑、删除功能 - - ✅ 测试文章摘要和评论审核功能 - - ⏳ 测试不同场景使用不同 API - - ⏳ 测试 API 连通性和模型刷新功能 - -2. **文档更新**(可选): - - 更新用户文档,说明新的 API 管理方式 - - 添加使用指南和常见问题 - - 更新主题更新日志 - -3. **性能优化**(可选): - - 监控 AI API 调用性能 - - 优化缓存策略 - - 添加错误重试机制 - -## 🔗 相关文件 - -- `settings.php` - 设置页面(已重构) -- `functions.php` - 核心函数(包含统一 API 管理系统) -- `.kiro/steering/phase-1-complete.md` - 第一阶段总结 -- `.kiro/steering/phase-2-testing-guide.md` - 第二阶段测试指南 -- `.kiro/steering/phase-3-implementation-plan.md` - 第三阶段实施计划 -- `.kiro/steering/ai-settings-refactor-plan.md` - 重构方案 -- `.kiro/steering/ai-refactor-next-steps.md` - 下一步工作 - -## 💡 总结 - -**第三阶段已全部完成!** 🎉 - -AI 设置重构项目的所有三个阶段都已成功完成: - -### 第一阶段 ✅:后端核心功能开发 -- 统一 API 管理系统 -- 数据迁移机制 -- AJAX 接口 - -### 第二阶段 ✅:测试和验证 -- 系统测试通过 -- 功能验证完成 - -### 第三阶段 ✅:UI 重构和代码清理 -- 新的 AI 功能界面上线 -- 移除旧代码和向后兼容逻辑 -- 清理临时文件 - -### 最终成果 - -1. **统一的 API 管理**:所有 AI 提供商的 API 在一个列表中管理 -2. **场景化配置**:文章摘要和评论审核可以使用不同的 API -3. **更好的用户体验**:直观的界面,便捷的操作 -4. **代码更简洁**:删除了约 1100 行旧代码和向后兼容逻辑 -5. **完整的功能**:API 测试、模型刷新、清除缓存等功能齐全 - -### Git 提交记录 - -1. **5254ee0** - feat: 添加统一 API 管理系统 -2. **3f188b7** - feat: 完成 AI 设置页面 UI 重构 -3. **04f20d4** - feat: 更新 AI 设置选项保存逻辑 -4. **bd1e643** - refactor: 移除 functions.php 中的向后兼容代码 - -系统已经可以正常使用,用户可以享受到全新的 AI 功能管理体验! diff --git a/.kiro/steering/settings-page-guide.md b/.kiro/steering/settings-page-guide.md deleted file mode 100644 index ac7abf5..0000000 --- a/.kiro/steering/settings-page-guide.md +++ /dev/null @@ -1,285 +0,0 @@ ---- -inclusion: fileMatch -fileMatchPattern: "settings.php" ---- - -# Argon 主题设置页开发指南 - -本文档为 AI 助手和开发者提供 `settings.php` 文件的结构说明和开发规范。 - -## 文件概述 - -`settings.php` 是 Argon 主题的核心设置页面,包含所有主题配置选项。该文件通过 WordPress 后台管理界面呈现给用户。 - -## 设置页分类结构 - -设置页采用 **二级分类** 结构: -- **一级分类 (h2)**:主要功能模块 -- **二级分类 (h3)**:模块内的子功能 - -### 分类层级(当前结构) - -``` -1. 基础设置 (section-basic) - ├── 主题色 (subsection-theme-color) - └── 夜间模式 (subsection-dark-mode) - -2. 外观样式 (section-appearance) - ├── 卡片样式 (subsection-card-style) - └── 字体 (subsection-font) - -3. 页面布局 (section-layout) - └── 整体布局 (subsection-page-layout) - -4. 顶栏设置 (section-toolbar) - ├── 基本设置 (subsection-toolbar-basic) - ├── 顶栏标题 (subsection-toolbar-title) - ├── 顶栏图标 (subsection-toolbar-icon) - ├── 顶栏外观 (subsection-toolbar-appearance) - └── 自定义链接 (subsection-toolbar-links) - -5. Banner 设置 (section-banner) - ├── Banner 内容 (subsection-banner-content) - ├── Banner 外观 (subsection-banner-appearance) - └── Banner 动画 (subsection-banner-animation) - -6. 页面背景 (section-background) - ├── 背景图片 (subsection-background-image) - └── 透明度与毛玻璃 (subsection-transparency) - -7. 侧边栏 (section-sidebar) - ├── 作者信息 (subsection-author-info) - ├── 扩展功能 (subsection-sidebar-features) - └── 博客公告 (subsection-announcement) - -8. 浮动按钮与页脚 (section-fab-footer) - ├── 浮动操作按钮 (subsection-fab) - └── 页脚设置 (subsection-footer) - -9. 高级设置 (section-advanced) - ├── SEO (subsection-seo) - ├── CDN (subsection-cdn) - ├── 子目录 (subsection-subdirectory) - ├── 日期格式 (subsection-date-format) - ├── 自定义脚本 (subsection-scripts) - └── 杂项 (subsection-misc) - -10. 文章显示 (section-post-display) - ├── Meta 信息 (subsection-post-meta) - ├── 文章头图 (subsection-thumbnail) - ├── 标题样式 (subsection-title-style) - └── 过时提示 (subsection-post-other) - -11. 文章功能 (section-post-features) - ├── 脚注引用 (subsection-footnote) - ├── 分享按钮 (subsection-share) - ├── 文章目录 (subsection-toc) - ├── 赞赏功能 (subsection-donate) - ├── 文末内容 (subsection-post-footer) - └── 相似推荐 (subsection-related-posts) - -12. 特殊页面 (section-special-pages) - ├── 归档页面 (subsection-archive) - ├── 搜索设置 (subsection-search) - └── 友情链接 (subsection-friend-links) - -13. 功能增强 (section-enhancements) - ├── 代码高亮 (subsection-code-highlight) - ├── 数学公式 (subsection-math) - ├── Lazyload (subsection-lazyload) - ├── 图片放大 (subsection-lightbox) - ├── Pangu.js (subsection-pangu) - └── 动画效果 (subsection-animation) - -14. 评论设置 (section-comment) - ├── 评论分页 (subsection-comment-pagination) - ├── 发送评论 (subsection-comment-submit) - ├── 评论功能 (subsection-comment-features) - └── 评论区外观 (subsection-comment-appearance) - -15. 验证码与安全 (section-security) - ├── 验证码设置 (subsection-captcha) - ├── 场景验证码 (subsection-captcha-scenes) - └── 速率限制 (subsection-rate-limit) -``` - -## HTML 结构规范 - -### 一级分类标题 (h2) -```php - -

-``` - -### 二级分类标题 (h3) -```php -

-``` - -### 设置项结构 -```php - - - - -

- - -``` - -## 常用输入控件 - -### 下拉选择框 -```php - -``` - -### 文本输入框 -```php - -``` - -### 数字输入框 -```php - -``` - -### 复选框 -```php - - -``` - -### 颜色选择器 -```php - -``` - -### 多行文本框 -```php - -``` - -## 选项保存 - -在文件末尾的 `argon_update_themeoptions()` 函数中添加选项保存: - -```php -// 普通选项 -argon_update_option('argon_option_name'); - -// 允许 HTML 标签的选项 -argon_update_option_allow_tags('argon_option_name'); - -// 复选框选项 -argon_update_option_checkbox('argon_option_name'); -``` - -## 国际化 - -所有用户可见文本必须使用 `_e()` 或 `__()` 函数包裹: - -```php - - - -``` - -## 设置项归属参考 - -### 应归入"基础设置"的选项 -- argon_theme_color (主题颜色) -- argon_enable_immersion_color (沉浸式主题色) -- argon_show_customize_theme_color_picker (允许用户自定义主题色) -- argon_darkmode_autoswitch (夜间模式切换方案) -- argon_enable_amoled_dark (夜间模式颜色方案) -- argon_dateformat (日期格式) - -### 应归入"外观样式"的选项 -- argon_card_radius (卡片圆角) -- argon_card_shadow (卡片阴影) -- argon_font (默认字体) -- argon_enable_smoothscroll_type (平滑滚动) -- argon_enable_into_article_animation (进入文章动画) -- argon_disable_pjax_animation (禁用 Pjax 动画) - -### 应归入"页面布局"的选项 -- argon_page_layout (页面布局) -- argon_article_list_waterflow (文章列表布局) -- argon_article_list_layout (文章列表卡片布局) - -### 应归入"顶栏设置"的选项 -- argon_enable_headroom (顶栏显示状态) -- argon_toolbar_title (顶栏标题) -- argon_toolbar_icon (图标地址) -- argon_toolbar_icon_link (图标链接) -- argon_toolbar_blur (毛玻璃效果) -- argon_toolbar_style (顶栏样式) -- argon_toolbar_shadow (顶栏阴影) -- argon_toolbar_border (底部边框) -- argon_toolbar_compact (紧凑模式) -- argon_toolbar_center (标题居中) -- argon_toolbar_links_left (左侧自定义链接) -- argon_toolbar_links_right (右侧自定义链接) - -### 应归入"Banner 设置"的选项 -- argon_banner_title (Banner 标题) -- argon_banner_subtitle (Banner 副标题) -- argon_banner_size (Banner 显示状态) -- argon_page_background_banner_style (Banner 透明化) -- argon_show_toolbar_mask (顶栏遮罩) -- argon_banner_background_url (背景图地址) -- argon_banner_background_color_type (渐变背景样式) -- argon_banner_background_hide_shapes (隐藏背景圆) -- argon_enable_banner_title_typing_effect (打字动画) -- argon_banner_typing_effect_interval (打字动画时长) - -### 应归入"侧边栏"的选项 -- argon_sidebar_banner_title (左侧栏标题) -- argon_sidebar_banner_subtitle (左侧栏子标题) -- argon_sidebar_auther_name (作者名称) -- argon_sidebar_auther_image (作者头像) -- argon_sidebar_author_description (作者简介) -- argon_show_todo_list (TODO 列表) -- argon_show_duolingo_streak (多邻国连胜) -- argon_duolingo_username (多邻国用户名) -- argon_sidebar_announcement (公告内容) -- argon_show_headindex_number (目录序号) - -### 应归入"验证码与安全"的选项 -- argon_need_captcha (全局验证码开关) -- argon_captcha_type (验证码类型) -- argon_geetest_captcha_id (极验 ID) -- argon_geetest_captcha_key (极验 Key) -- argon_geetest_api_server (极验服务器) -- argon_get_captcha_by_ajax (Ajax 获取验证码) -- argon_comment_captcha_mode (评论验证码) -- argon_todo_captcha_mode (TODO 验证码) -- argon_friend_link_captcha (友链验证码) -- argon_rate_limit_enable (速率限制) -- argon_rate_limit_window (速率窗口) -- argon_rate_limit_max_count (最大次数) -- argon_rate_limit_min_interval (最小间隔) - -## 注意事项 - -1. **选项命名**:所有选项名必须以 `argon_` 前缀开头 -2. **默认值**:使用 `get_option('name', 'default')` 的第二个参数设置默认值 -3. **安全性**:用户输入的 HTML 内容需使用 `argon_update_option_allow_tags()` 保存 -4. **响应式**:设置页需要在移动端正常显示 -5. **目录导航**:页面右侧有自动生成的目录,h2/h3 标题会被收录 - -## 相关文件 - -- `functions.php` - 主题函数,包含选项的使用逻辑 -- `header.php` - 页头,使用顶栏相关选项 -- `footer.php` - 页脚,使用页脚相关选项 -- `style.css` - 主题样式 -- `admin.css` - 后台样式 diff --git a/.kiro/steering/settings-reorganize-complete.md b/.kiro/steering/settings-reorganize-complete.md deleted file mode 100644 index b990c3d..0000000 --- a/.kiro/steering/settings-reorganize-complete.md +++ /dev/null @@ -1,197 +0,0 @@ -# Settings.php 完整重组总结 - -## 重组完成情况 ✅ - -已成功完成设置页的完整重组,从原来的16个分类扩展到18个分类,结构更加合理清晰。 - -## 最终分类结构(18个一级分类) - -``` -1. 基础设置 (section-basic) - ├── 主题色 (subsection-theme-color) - ├── 夜间模式 (subsection-dark-mode) - └── 子目录 (subsection-subdirectory) - -2. 外观样式 (section-appearance) - ├── 卡片样式 (subsection-card-style) - ├── 字体 (subsection-font) - └── 动画效果 (subsection-animation) - -3. 页面布局 (section-layout) - └── 整体布局 (subsection-page-layout) - -4. 顶栏设置 (section-toolbar) - ├── 基本设置 (subsection-toolbar-basic) - ├── 顶栏标题 (subsection-toolbar-title) - ├── 顶栏图标 (subsection-toolbar-icon) - ├── 顶栏外观 (subsection-toolbar-appearance) - └── 自定义链接 (subsection-toolbar-links) - -5. Banner 设置 (section-banner) - ├── Banner 内容 (subsection-banner-content) - ├── Banner 外观 (subsection-banner-appearance) - └── Banner 动画 (subsection-banner-animation) - -6. 页面背景 (section-background) - ├── 背景图片 (subsection-background-image) - └── 透明度与毛玻璃 (subsection-transparency) - -7. 侧边栏 (section-sidebar) - ├── 作者信息 (subsection-author-info) - ├── 扩展功能 (subsection-sidebar-features) - └── 博客公告 (subsection-announcement) - -8. 浮动按钮 (section-fab) [新建] - └── 浮动操作按钮 (subsection-fab) - -9. 页脚设置 (section-footer) [新建] - └── 页脚 (subsection-footer) - -10. SEO 与性能 (section-seo-performance) - ├── SEO (subsection-seo) - ├── CDN 加速 (subsection-cdn) - └── 日期格式 (subsection-date-format) - -11. 文章显示 (section-post-display) - ├── Meta 信息 (subsection-post-meta) - └── 文章头图 (subsection-thumbnail) - -12. 文章功能 (section-post-features) - ├── AI 文章摘要 (subsection-ai-summary) - ├── 脚注引用 (subsection-footnote) - ├── 分享 (subsection-share) - ├── 文章目录 (subsection-toc) - ├── 赞赏 (subsection-donate) - ├── 文末内容 (subsection-post-footer) - ├── 相似推荐 (subsection-related-posts) - ├── 标题样式 (subsection-title-style) [从文章显示移入] - └── 过时提示 (subsection-post-other) [从文章显示移入] - -13. 特殊页面 (section-special-pages) - ├── 搜索设置 (subsection-search) - ├── 归档页面 (subsection-archive) - └── 友情链接 (subsection-friend-links) - -14. 功能增强 (section-enhancements) - ├── 代码高亮 (subsection-code-highlight) - ├── 数学公式 (subsection-math) - ├── Lazyload (subsection-lazyload) - ├── 图片放大 (subsection-lightbox) - └── Pangu.js (subsection-pangu) - -15. 高级设置 (section-advanced) - └── 自定义脚本 (subsection-scripts) - -16. 评论设置 (section-comment) - ├── 评论分页 (subsection-comment-pagination) - ├── 发送评论 (subsection-comment-submit) - ├── 评论功能 (subsection-comment-features) [从验证码与安全移入] - ├── AI 垃圾评论识别 (subsection-comment-spam-detection) [从验证码与安全移入] - └── 评论区外观 (subsection-comment-appearance) [从验证码与安全移入] - -17. 验证码设置 (section-captcha) [重命名] - ├── 验证码配置 (subsection-captcha) - └── 场景验证码 (subsection-captcha-scenes) - -18. 反馈与安全 (section-feedback-security) [新建] - ├── 反馈设置 (subsection-feedback) [从验证码与安全移入] - └── 速率限制 (subsection-rate-limit) [从验证码与安全移入] -``` - -## 主要改进 - -### 1. 拆分混杂的分类 -- **浮动按钮与页脚** → 拆分为"浮动按钮"和"页脚设置"两个独立分类 -- **验证码与安全** → 拆分为"验证码设置"和"反馈与安全"两个分类 - -### 2. 移动错位的设置项 -- 评论功能、AI垃圾评论识别、评论区外观 → 从"验证码与安全"移到"评论设置" -- 标题样式、过时提示 → 从"文章显示"移到"文章功能" -- 页脚设置 → 从"特殊页面"移到独立的"页脚设置"分类 -- 日期格式 → 从错误位置移到"SEO与性能" - -### 3. 删除重复内容 -- 删除重复的顶栏设置(107行) -- 删除重复的页脚设置(32行) -- 删除重复的日期格式设置(16行) -- 删除高级设置中重复的动画设置(68行) -- 删除重复的CDN设置(88行) -- 总计删除311行重复内容 - -### 4. 修复保存问题 -- 在外观样式中添加动画效果表单字段(平滑滚动、进入文章动画、Pjax动画) -- 在SEO与性能中添加CDN加速表单字段(CDN选择、自定义路径、WP目录) -- 在SEO与性能中添加日期格式表单字段 -- 修复邮件模板保存问题(添加spam_notify类型) -- 修复归档页面设置混乱问题 - -### 5. 优化命名 -- "验证码设置"子分类 → "验证码配置"(更明确) -- "CDN" → "CDN 加速" -- 7个子分类命名优化(场景验证码、顶栏标题等) - -## Git 提交历史 - -1. **c68d47b** - fix: 删除SEO与性能分类中重复的CDN和日期格式设置 -2. **3104cad** - fix: 删除重复的子目录和页脚设置 -3. **0fb1d11** - feat: 拆分浮动按钮与页脚为独立分类 -4. **b471bbc** - feat: 完成设置页完整重组(将评论相关设置移到评论设置分类) -5. **e57dcd9** - fix: 修正分类编号 -6. **f9dc71d** - fix: 修复设置页分类结构问题 -7. **66dd8bf** - feat: 完成设置页18个分类的完整重组 -8. **43f620d** - docs: 添加设置页重组完整总结文档并清理临时脚本 -9. **e7509e5** - fix: 优化设置页结构细节 -10. **a536fc0** - fix: 修复邮件模板无法保存的问题 -11. **be5a653** - fix: 修复特殊页面归档和友情链接设置混乱的问题 -12. **3ce6992** - fix: 修复动画效果、CDN和日期格式选项无法保存的问题 - -## 统计数据 - -- **原始文件**: 6670 行 -- **最终文件**: 6651 行 -- **删除重复内容**: 311 行 -- **新增内容**: 292 行(新分类标题、页脚设置、动画效果表单、CDN表单、日期格式表单) -- **净减少**: 19 行 -- **优化的子分类**: 8 个 -- **新建的一级分类**: 3 个(浮动按钮、页脚设置、反馈与安全) -- **重命名的一级分类**: 1 个(验证码与安全 → 验证码设置) -- **重组的子分类**: 10 个 -- **修复的bug**: 4 个(邮件模板保存、归档页面混乱、动画效果保存、CDN/日期格式保存) - -## 优化效果 - -### 逻辑更清晰 -- 每个分类职责单一,不再混杂不相关的设置 -- 相关设置集中在一起,便于查找和管理 - -### 结构更合理 -- 18个一级分类,每个分类包含2-5个子分类 -- 分类层级清晰,符合用户使用习惯 - -### 无重复项 -- 删除所有重复的设置项和分类标题 -- 每个设置项只出现一次,避免混淆 - -### 保持兼容 -- 所有设置项的 `name` 属性保持不变 -- 所有 ID (`section-*` 和 `subsection-*`) 保持不变 -- 不影响现有配置和功能 - -## 文件信息 - -- **最终文件**: `settings.php` (6651 行) -- **备份文件**: `settings.php.backup` -- **重组脚本**: - - `reorganize_comment_settings.py` - - `fix_all_issues.py` - - `fix_final_issues.py` - - `split_fab_footer.py` -- **完成时间**: 2026-01-22 -- **最后提交**: 3ce6992 - -## 后续建议 - -1. **测试验证**: 在WordPress后台测试所有设置项是否正常工作 -2. **文档更新**: 更新主题文档,反映新的分类结构 -3. **用户通知**: 如果发布更新,在更新日志中说明分类结构的优化 -4. **清理脚本**: 可以删除临时的Python重组脚本文件 diff --git a/.kiro/steering/xiaomi-mimo-api-fix.md b/.kiro/steering/xiaomi-mimo-api-fix.md deleted file mode 100644 index 4865598..0000000 --- a/.kiro/steering/xiaomi-mimo-api-fix.md +++ /dev/null @@ -1,250 +0,0 @@ -# 小米 Mimo API 修复说明 - -## 修复时间 -2026-01-26 - -## 问题描述 -小米 Mimo 模型 API 请求失败,无法正常调用 MiMo-V2-Flash 模型。 - -## 修复内容 - -### 1. 优化 `argon_call_xiaomi_api` 函数 - -**修改位置**: `functions.php` 第 8047-8140 行 - -**主要改进**: -- ✅ 添加 `stream` 参数,明确设置为 `false`(非流式响应) -- ✅ 添加 `Accept` 请求头,明确接受 JSON 格式 -- ✅ 使用 `JSON_UNESCAPED_UNICODE` 标志编码请求体,确保中文字符正确传输 -- ✅ 明确设置 `sslverify` 为 `true`,确保 SSL 验证 - -**修改前**: -```php -$data = [ - 'model' => $model, - 'messages' => [ - ['role' => 'system', 'content' => $prompt], - ['role' => 'user', 'content' => $content] - ], - 'temperature' => 0.7, - 'max_tokens' => 500 -]; - -$response = wp_remote_post($endpoint, [ - 'headers' => [ - 'Content-Type' => 'application/json', - 'Authorization' => 'Bearer ' . $api_key - ], - 'body' => json_encode($data), - 'timeout' => 30 -]); -``` - -**修改后**: -```php -$data = [ - 'model' => $model, - 'messages' => [ - ['role' => 'system', 'content' => $prompt], - ['role' => 'user', 'content' => $content] - ], - 'temperature' => 0.7, - 'max_tokens' => 500, - 'stream' => false -]; - -$response = wp_remote_post($endpoint, [ - 'headers' => [ - 'Content-Type' => 'application/json', - 'Authorization' => 'Bearer ' . $api_key, - 'Accept' => 'application/json' - ], - 'body' => json_encode($data, JSON_UNESCAPED_UNICODE), - 'timeout' => 30, - 'sslverify' => true -]); -``` - -### 2. 增强 `argon_get_xiaomi_models` 函数 - -**修改位置**: `functions.php` 第 9009-9055 行 - -**主要改进**: -- ✅ 添加 `Accept` 请求头 -- ✅ 明确设置 `sslverify` 为 `true` -- ✅ 添加详细的错误日志记录 -- ✅ 记录 HTTP 状态码和响应内容,便于调试 -- ✅ 改进错误处理逻辑 - -**新增错误日志**: -- API 调用失败时记录错误信息 -- HTTP 状态码非 200 时记录状态码和响应内容 -- 响应格式异常时记录原始响应 - -## 可能的问题原因 - -根据修复内容,原始代码可能存在以下问题: - -1. **缺少 stream 参数**: 某些 API 实现要求明确指定是否使用流式响应 -2. **缺少 Accept 头**: API 可能需要明确的 Accept 头来返回正确格式 -3. **中文编码问题**: 未使用 `JSON_UNESCAPED_UNICODE` 可能导致中文字符编码错误 -4. **缺少错误日志**: 之前无法诊断具体的失败原因 - -## 测试方法 - -### 方法 1: 使用测试脚本 - -1. 打开 `test-xiaomi-mimo-api.php` 文件 -2. 将 `YOUR_API_KEY_HERE` 替换为你的实际 API 密钥 -3. 在浏览器中访问: `https://your-domain.com/wp-content/themes/argon/test-xiaomi-mimo-api.php` -4. 查看测试结果,包括: - - 基本 API 请求测试 - - 简化请求格式测试 - - 获取模型列表测试 - - cURL 命令示例 - -### 方法 2: 在 WordPress 后台测试 - -1. 进入 WordPress 后台 → Argon 主题设置 -2. 找到 "AI 功能" → "API 管理" -3. 添加或编辑小米 Mimo API 配置 -4. 点击"测试"按钮 -5. 查看测试结果 - -### 方法 3: 查看错误日志 - -如果仍然失败,检查 WordPress 错误日志: - -```bash -# 查看 PHP 错误日志 -tail -f /path/to/php-error.log - -# 或者 WordPress debug.log -tail -f /path/to/wp-content/debug.log -``` - -错误日志会包含: -- API 调用失败的具体错误信息 -- HTTP 状态码 -- API 响应内容 - -## 小米 Mimo API 规范 - -### 端点 -- **Chat Completions**: `https://api.mimo.xiaomi.com/v1/chat/completions` -- **Models**: `https://api.mimo.xiaomi.com/v1/models` - -### 认证 -使用 Bearer Token 认证: -``` -Authorization: Bearer YOUR_API_KEY -``` - -### 请求格式 -```json -{ - "model": "MiMo-V2-Flash", - "messages": [ - {"role": "system", "content": "你是一个有帮助的助手。"}, - {"role": "user", "content": "你好"} - ], - "temperature": 0.7, - "max_tokens": 500, - "stream": false -} -``` - -### 响应格式 -```json -{ - "id": "chatcmpl-xxx", - "object": "chat.completion", - "created": 1234567890, - "model": "MiMo-V2-Flash", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "你好!我是小米的 AI 助手..." - }, - "finish_reason": "stop" - } - ], - "usage": { - "prompt_tokens": 10, - "completion_tokens": 20, - "total_tokens": 30 - } -} -``` - -## 支持的模型 - -根据官方文档,小米 Mimo 目前支持的模型: - -- **MiMo-V2-Flash** (推荐) - - 309B 总参数,15B 活跃参数 - - 256K 上下文窗口 - - 擅长推理、编码和 Agent 场景 - - 在 SWE-bench 上排名第一 - -## 常见问题 - -### Q1: API 密钥在哪里获取? -A: 访问 [小米 Mimo 平台](https://platform.xiaomimimo.com/) 注册并获取 API 密钥。 - -### Q2: API 是否免费? -A: 根据官方信息,MiMo-V2-Flash 目前处于公测阶段,可能提供免费额度。具体请查看官方文档。 - -### Q3: 为什么返回 401 错误? -A: 检查以下几点: -- API 密钥是否正确 -- API 密钥是否已激活 -- 是否正确设置了 Authorization 头 - -### Q4: 为什么返回 429 错误? -A: 请求频率超过限制,需要: -- 降低请求频率 -- 检查是否有配额限制 -- 联系小米客服增加配额 - -### Q5: 为什么返回 500 错误? -A: 服务器端错误,可能原因: -- API 服务暂时不可用 -- 请求参数格式错误 -- 模型名称错误 - -## 参考资料 - -- [LiteLLM - Xiaomi MiMo](https://docs.litellm.ai/docs/providers/xiaomi_mimo) -- [Puter.js - Free Xiaomi MiMo API](https://developer.puter.com/tutorials/free-unlimited-xiaomi-mimo-api/) -- [OpenRouter - MiMo-V2-Flash](https://openrouter.ai/xiaomi/mimo-v2-flash-20251210/api) -- [Hugging Face - MiMo-V2-Flash](https://huggingface.co/XiaomiMiMo/MiMo-V2-Flash) - -## 后续优化建议 - -1. **添加重试机制**: 对于临时性失败,自动重试 2-3 次 -2. **缓存模型列表**: 减少对 models 端点的请求 -3. **支持流式响应**: 对于长文本生成,支持流式输出 -4. **添加速率限制**: 避免触发 API 限流 -5. **监控 API 使用**: 记录 API 调用次数和成本 - -## 相关文件 - -- `functions.php` - 核心函数(包含 API 调用逻辑) -- `test-xiaomi-mimo-api.php` - 测试脚本 -- `settings.php` - 设置页面(AI 功能配置) - -## Git 提交 - -提交信息将包含: -``` -fix: 修复小米 Mimo API 请求失败的问题 - -- 添加 stream 参数明确设置为非流式响应 -- 添加 Accept 请求头确保返回 JSON 格式 -- 使用 JSON_UNESCAPED_UNICODE 编码确保中文正确传输 -- 添加详细的错误日志记录便于调试 -- 改进 SSL 验证设置 -``` diff --git a/docs/ai-spam-detection-architecture.md b/docs/ai-spam-detection-architecture.md deleted file mode 100644 index 1f81e62..0000000 --- a/docs/ai-spam-detection-architecture.md +++ /dev/null @@ -1,344 +0,0 @@ -# AI 垃圾评论检测系统架构 - -## 系统概述 - -本文档展示 Argon 主题的 AI 垃圾评论检测系统的完整架构和流程。 - -## 主流程图 - -```mermaid -flowchart TD - Start[用户提交评论] - PreProcess[预处理评论] - CheckEnabled{启用 AI 检测?} - DirectSave[直接保存评论] - CheckMode{检测模式?} - CheckKeyword[检查关键字] - CheckSample[智能抽样] - NeedCheck[需要检测] - KeywordMatch{匹配关键字?} - SampleDecision{抽中?} - SetPending[设置待审核状态] - SaveWithFlag[保存评论并标记] - TriggerDetect[触发 AI 检测] - CallAPI[调用 AI API] - ParseResult[解析结果] - CheckConfidence{置信度?} - AutoHandle[自动处理] - ManualReview[人工审核] - MarkNormal[标记正常] - CheckAction{处理方式?} - MoveTrash[移入回收站] - KeepPending[保持待审核] - JustMark[仅标记] - NotifyAdmin[通知管理员] - SaveResult[保存结果] - AILearn{启用学习?} - ExtractKeywords[提取关键词] - UpdateDB[更新词库] - End[结束] - - Start --> PreProcess - PreProcess --> CheckEnabled - CheckEnabled -->|否| DirectSave - CheckEnabled -->|是| CheckMode - CheckMode -->|manual| DirectSave - CheckMode -->|keyword| CheckKeyword - CheckMode -->|sample| CheckSample - CheckMode -->|all| NeedCheck - CheckKeyword --> KeywordMatch - KeywordMatch -->|是| NeedCheck - KeywordMatch -->|否| DirectSave - CheckSample --> SampleDecision - SampleDecision -->|是| NeedCheck - SampleDecision -->|否| DirectSave - NeedCheck --> SetPending - SetPending --> SaveWithFlag - SaveWithFlag --> TriggerDetect - TriggerDetect --> CallAPI - CallAPI --> ParseResult - ParseResult --> CheckConfidence - CheckConfidence -->|高| AutoHandle - CheckConfidence -->|中| ManualReview - CheckConfidence -->|低| MarkNormal - AutoHandle --> CheckAction - CheckAction -->|trash| MoveTrash - CheckAction -->|hold| KeepPending - CheckAction -->|mark| JustMark - MoveTrash --> NotifyAdmin - KeepPending --> NotifyAdmin - JustMark --> SaveResult - ManualReview --> SaveResult - MarkNormal --> SaveResult - NotifyAdmin --> SaveResult - SaveResult --> AILearn - AILearn -->|是| ExtractKeywords - AILearn -->|否| End - ExtractKeywords --> UpdateDB - UpdateDB --> End - DirectSave --> End - - style Start fill:#e1f5e1,stroke:#2e7d32,stroke-width:2px - style End fill:#e1f5e1,stroke:#2e7d32,stroke-width:2px - style MoveTrash fill:#ff6b6b,stroke:#c62828,stroke-width:2px - style MarkNormal fill:#95e1d3,stroke:#2e7d32,stroke-width:2px - style ManualReview fill:#ffa500,stroke:#ff8f00,stroke-width:2px -``` - -## 检测模式详解 - -```mermaid -flowchart LR - subgraph Manual[Manual 模式] - M1[关闭实时检测] - M2[仅手动扫描] - end - - subgraph Keyword[Keyword 模式] - K1[关键字触发] - K2[精准检测] - K3[低成本] - end - - subgraph Sample[Sample 模式] - S1[智能抽样] - S2[平衡准确性] - S3[控制成本] - end - - subgraph All[All 模式] - A1[全量检测] - A2[最高准确性] - A3[高成本] - end - - style Manual fill:#e3f2fd - style Keyword fill:#fff3e0 - style Sample fill:#f3e5f5 - style All fill:#fce4ec -``` - -## AI 检测流程 - -```mermaid -sequenceDiagram - participant User as 用户 - participant WP as WordPress - participant Argon as Argon 主题 - participant AI as AI API - participant DB as 数据库 - - User->>WP: 提交评论 - WP->>Argon: 触发 preprocess_comment - Argon->>Argon: 检查检测规则 - - alt 需要检测 - Argon->>DB: 保存评论(待审核) - Argon->>AI: 发送检测请求 - AI-->>Argon: 返回检测结果 - Argon->>Argon: 解析结果和置信度 - - alt 高置信度垃圾评论 - Argon->>DB: 移入回收站 - Argon->>WP: 发送通知邮件 - else 中等置信度 - Argon->>DB: 标记待人工审核 - else 正常评论 - Argon->>DB: 标记为正常 - end - - Argon->>DB: 保存检测记录 - - opt 启用 AI 学习 - Argon->>AI: 提取关键词 - AI-->>Argon: 返回关键词 - Argon->>DB: 更新学习词库 - end - else 跳过检测 - Argon->>DB: 直接保存评论 - end - - WP-->>User: 显示提交结果 -``` - -## 数据库结构 - -```mermaid -erDiagram - COMMENT ||--o{ COMMENT_META : has - COMMENT { - bigint comment_ID PK - bigint comment_post_ID FK - text comment_content - varchar comment_author - varchar comment_author_email - varchar comment_author_IP - datetime comment_date - varchar comment_approved - } - - COMMENT_META { - bigint meta_id PK - bigint comment_id FK - varchar meta_key - longtext meta_value - } - - SPAM_DETECTION ||--|| COMMENT : detects - SPAM_DETECTION { - bigint id PK - bigint comment_id FK - varchar result - float confidence - text reason - text keywords - datetime detected_at - varchar detection_code - } - - LEARNED_KEYWORDS ||--o{ SPAM_DETECTION : learns_from - LEARNED_KEYWORDS { - bigint id PK - varchar keyword - int weight - varchar category - datetime created_at - datetime updated_at - } -``` - -## 系统状态机 - -```mermaid -stateDiagram-v2 - [*] --> Submitted: 用户提交 - Submitted --> Pending: 需要检测 - Submitted --> Approved: 跳过检测 - - Pending --> Detecting: 开始检测 - Detecting --> Analyzed: 检测完成 - - Analyzed --> Spam: 高置信度垃圾 - Analyzed --> Suspicious: 中等置信度 - Analyzed --> Clean: 低置信度/正常 - - Spam --> Trash: 自动处理 - Spam --> Hold: 保持待审核 - Spam --> Marked: 仅标记 - - Suspicious --> ManualReview: 等待人工审核 - Clean --> Approved: 自动通过 - - ManualReview --> Approved: 管理员批准 - ManualReview --> Trash: 管理员拒绝 - - Hold --> Approved: 管理员批准 - Hold --> Trash: 管理员拒绝 - - Marked --> Approved: 管理员批准 - Marked --> Trash: 管理员拒绝 - - Trash --> [*] - Approved --> [*] - - note right of Detecting - 调用 AI API - 解析返回结果 - 计算置信度 - end note - - note right of ManualReview - 显示在后台 - 等待管理员操作 - end note -``` - -## 性能优化策略 - -```mermaid -flowchart TD - subgraph Input[输入优化] - I1[关键字预过滤] - I2[白名单用户] - I3[智能抽样] - end - - subgraph Process[处理优化] - P1[异步检测] - P2[批量处理] - P3[缓存结果] - end - - subgraph API[API 优化] - A1[Prompt 优化] - A2[Token 控制] - A3[超时处理] - end - - subgraph Storage[存储优化] - S1[索引优化] - S2[定期清理] - S3[归档历史] - end - - Input --> Process - Process --> API - API --> Storage - - style Input fill:#e8f5e9 - style Process fill:#e3f2fd - style API fill:#fff3e0 - style Storage fill:#f3e5f5 -``` - -## 关键技术点 - -### 1. 异步检测机制 -- 评论提交后立即返回,不阻塞用户 -- 后台异步调用 AI API 进行检测 -- 使用 WordPress Cron 或队列系统 - -### 2. 智能抽样算法 -- 基于用户历史行为的动态抽样率 -- 新用户抽样率更高 -- 可信用户抽样率降低 - -### 3. 置信度评分系统 -- 0.9-1.0:非常确定,可自动处理 -- 0.7-0.9:比较确定,建议自动处理 -- 0.5-0.7:中等确定,建议人工审核 -- 0.0-0.5:不太确定,必须人工审核 - -### 4. 学习优化机制 -- 记录管理员的审核决策 -- 分析误判模式 -- 自动调整检测策略 -- 提取高频垃圾关键词 - -### 5. 容错与降级 -- API 失败时自动降级 -- 保证评论系统正常运行 -- 记录错误日志供后续分析 - -## 配置建议 - -### 小型博客(< 100 评论/天) -- 检测模式:Sample(30%) -- Prompt 模式:Standard -- 自动处理阈值:0.9 -- 异步检测:启用 - -### 中型博客(100-500 评论/天) -- 检测模式:Sample(40%) -- Prompt 模式:Standard -- 自动处理阈值:0.85 -- 异步检测:启用 -- 批量扫描:每日一次 - -### 大型博客(> 500 评论/天) -- 检测模式:Keyword + Sample(50%) -- Prompt 模式:Minimal -- 自动处理阈值:0.8 -- 异步检测:启用 -- 批量扫描:每日两次 -- 启用缓存和队列优化 diff --git a/functions.php b/functions.php index fb12a15..7bfd2d2 100644 --- a/functions.php +++ b/functions.php @@ -2864,7 +2864,14 @@ function post_comment_preprocessing($comment){ // 检查是否触发关键字 $keyword_check = argon_check_spam_keywords($temp_comment); if ($keyword_check && $keyword_check['triggered']) { - $should_check = true; + // 如果是黑名单关键字,直接标记为垃圾评论 + if (isset($keyword_check['is_blacklist']) && $keyword_check['is_blacklist']) { + $comment['comment_approved'] = 'spam'; + $_POST['_argon_spam_blacklist_keywords'] = json_encode($keyword_check['keywords']); + } else { + // 触发关键字,需要 AI 检测 + $should_check = true; + } } // 全量检测模式 elseif ($mode === 'all') { @@ -10029,18 +10036,49 @@ function argon_detect_spam_comment_sync($comment) { /** * 检查评论是否触发关键字 * @param object $comment 评论对象 - * @return array|false ['triggered' => bool, 'keywords' => array, 'confidence' => float] + * @return array|false ['triggered' => bool, 'keywords' => array, 'confidence' => float, 'is_blacklist' => bool] */ function argon_check_spam_keywords($comment) { - // 获取关键字列表 - $keywords_text = get_option('argon_comment_spam_detection_keywords', ''); - if (empty($keywords_text)) { + // 先检查黑名单关键字(直接判定为垃圾) + $blacklist_keywords_text = get_option('argon_comment_spam_detection_keywords', ''); + if (!empty($blacklist_keywords_text)) { + $blacklist_keywords = array_filter(array_map('trim', explode("\n", $blacklist_keywords_text))); + if (!empty($blacklist_keywords)) { + $check_text = $comment->comment_author . ' ' . $comment->comment_content; + $check_text = strtolower($check_text); + + $triggered_blacklist = []; + foreach ($blacklist_keywords as $keyword) { + $keyword = strtolower(trim($keyword)); + if (empty($keyword)) { + continue; + } + + if (strpos($check_text, $keyword) !== false) { + $triggered_blacklist[] = $keyword; + } + } + + if (!empty($triggered_blacklist)) { + return [ + 'triggered' => true, + 'keywords' => $triggered_blacklist, + 'confidence' => 1.0, + 'is_blacklist' => true + ]; + } + } + } + + // 再检查触发关键字(需要 AI 检测) + $trigger_keywords_text = get_option('argon_comment_spam_detection_trigger_keywords', ''); + if (empty($trigger_keywords_text)) { return false; } // 按行分割关键字 - $keywords = array_filter(array_map('trim', explode("\n", $keywords_text))); - if (empty($keywords)) { + $trigger_keywords = array_filter(array_map('trim', explode("\n", $trigger_keywords_text))); + if (empty($trigger_keywords)) { return false; } @@ -10049,7 +10087,7 @@ function argon_check_spam_keywords($comment) { $check_text = strtolower($check_text); $triggered_keywords = []; - foreach ($keywords as $keyword) { + foreach ($trigger_keywords as $keyword) { $keyword = strtolower(trim($keyword)); if (empty($keyword)) { continue; @@ -10067,7 +10105,8 @@ function argon_check_spam_keywords($comment) { return [ 'triggered' => true, 'keywords' => $triggered_keywords, - 'confidence' => $confidence + 'confidence' => $confidence, + 'is_blacklist' => false ]; } diff --git a/settings.php b/settings.php index 629b113..4436220 100644 --- a/settings.php +++ b/settings.php @@ -2257,7 +2257,7 @@ function themeoptions_page(){ - +

@@ -2316,24 +2316,107 @@ function themeoptions_page(){ - + + + + +

- 检测所有评论:每条评论都进行 AI 检测(消耗较多 API 额度)', 'argon');?> +
+
+
+

- + - + %

- +
+
+ +

+ + + + + + + +

+
+ +

+ + + + + + + +

+
+ +

+ + + + + + + + +

+ + + + + + + +

+
+ +

+ + + + + + + +

+
+
+ +

+ + + + + + + +

+
+
+

@@ -6896,8 +6979,14 @@ function argon_update_themeoptions(){ //AI 垃圾评论识别 argon_update_option_checkbox('argon_comment_spam_detection_enable'); argon_update_option('argon_ai_spam_active_api'); - argon_update_option('argon_comment_spam_detection_realtime_mode'); + argon_update_option('argon_comment_spam_detection_mode'); + argon_update_option('argon_comment_spam_detection_sample_rate'); + argon_update_option('argon_comment_spam_detection_trigger_keywords'); argon_update_option('argon_comment_spam_detection_keywords'); + argon_update_option_checkbox('argon_comment_spam_detection_exclude_logged_in'); + argon_update_option('argon_comment_spam_detection_whitelist'); + argon_update_option('argon_comment_spam_detection_auto_action'); + argon_update_option('argon_comment_spam_detection_confidence_threshold'); argon_update_option('argon_comment_spam_detection_prompt_mode'); argon_update_option('argon_comment_spam_detection_custom_prompt'); argon_update_option('argon_comment_spam_detection_auto_threshold'); diff --git a/settings.php.backup b/settings.php.backup deleted file mode 100644 index a47109f..0000000 --- a/settings.php.backup +++ /dev/null @@ -1,6670 +0,0 @@ - - - - - - - - - - -
- - - - - -

- - - - - - - - - - solstice23/argon-theme - - - -

- -

- -

Ctrl + F

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - " style="height:40px;width: 80px;cursor: pointer;"/> - - " style="height: 40px;width: 80px;vertical-align: bottom;background: #fff;cursor: pointer;" onclick="$('input[name=\'argon_theme_color\']').click()"/>

- -

- -

- -
- -
Argon ()
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - - - - - - - - -
- - - -
- -

- -
- - - -

页面背景、卡片及页面上的其它元素会变为沉浸式主题色(气氛色)。类似 Material You。', 'argon');?>

- -
- -
- -
- -
- -
- - - -

- - - -


- -
- - - -

- -

- - px - -

4px 2px - 15px

- -
- -
- - - - - - - -
- -

- -

- -
- - - - - - - -
- -

- -

- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -


- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -



- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
-

- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -

- -

- - - - - -

- -

%theme_version% 来表示主题版本号。', 'argon');?>

- -

- - - -

/blog/ /

- -

- - - -

- -

- - - -



- -

- -

- -

--hidden-- 可以隐藏标题', 'argon');?>

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -





- -
- - - -
- - - -
- -


- -
- - - -


--bing--

- -
- - - - - - - -

- -

- -
- - - - - - - - - - - - - - - -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- -
- -
- -
- -
- - -
-

-
- - -
- -
- - -
-

-
- - -
- -
- - px -
-

-
- - -
- -
- - % -
-

-
-
- - -
- - -
- - - -
-
- - -
-
-
-

- -

-
-
- - - -

- - - -

- -
- - - -


--hitokoto--

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -

SEO

- - - -


- -
- - - -

- -

- - - - - - - - - -

- - - -
- - - - - -

- -
- - - - - -
- - - - - -

- -

- - - -

- -
- - - -

- -

- -

-
- -

-
- -

-
- -

-
- - - -

-
-
-
- -

- - -
- -

-
- -

-
- -

- -

- - "/> - -

使用 ref 短代码可以在文中插入脚注。', 'argon');?>

- -

- - - -

- -

- - - -

- -

- - - -

- -

- - - -


%url% 来代替当前页面 URL,%link% 来代替当前页面链接,%title% 来代替当前文章标题,%author% 来代替当前文章作者。', 'argon');?>

- -
- -
- -
- -
- - - -

- -

- - - -

:
- -

- -
- -
- - - -

- -

- - - - - - - - - - - - - - - -
- - - -


%date_delta% %post_date_delta% %modify_date_delta%

- -

- -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -
- - - -
- - - -

- -
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- -

- -

Lazyload

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

,

- -

- - - -

- -
- -

Pangu.js

- - - -

- -

- -

-

- -


- - window.pjaxLoaded
: - -

-
-window.pjaxLoaded = function(){
-
-	//
-
-	//do something...
-
-}
-
-							
- - window.pjaxLoaded window.pjaxLoaded();

- -
- - - -


- -
- - - -


- -

- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- -
- - 最后一页,在每个页面顶部显示新的评论"。', 'argon');?> >>> - - $(".go-to-wp-comment-settings").addClass("wrong-options");'; - - };?> - - - - - -

- -

- - - -


- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

-
- •
- •
- • -

- -
- - / - - -

- -
- - / - - -

- -
- - / - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -
- - - -
- -

- -
- - - -

- -

- - -


-
- -

-
-
- -

-
- % -

-
-
- -

-
- -

-
-
- -

-
- - -

-
- -

-
- -

-
- - -

- -
-
- - - -
- - -

-
- -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -


gravatar.pho.ink/avatar/ , cdn.v2ex.com/gravatar/ , dn-qiniu-avatar.qbox.me/avatar/

- -
- - - -

- -
- - - -

- -
- - - - - -
- - - -
- -
- -
- - - -
- - true, - - ), 'objects'); - - foreach ($all_post_types as $post_type) { - - if ($post_type -> name == 'attachment'){ - - continue; - - } - - echo '
'. $post_type -> label .'
'; - - } - - ?> - -
- -
- -

- - -

-
- - -

- -
- -

-
- -

-
- -
- - -
-
- - -
-
- - -
-
- - -
-

-

- -
-
- - - -
- - $type_info): - $config = argon_get_email_template_config($type_key); - ?> -
-
- -
- -
- - -
- -
- - -
- -
- -
- $desc): ?> - {{}} - -
-

-
- -
- - -
-
- -
- - - - - -
- -

-
- -

-
- -

-
- -

-
- -

-
-

- -

- - - -

- -
- - - -


- -

分类
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'category' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo "
Tag
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'post_tag' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo ""; - - ?> - - - -

- -
- - - -

- -
- -

- -
- - 个人资料页面将 "管理界面配色方案" 设为 "Argon" 即可开启。', 'argon'), admin_url('profile.php'));?> - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - - - -

- - - - - - - -

- - - - - - - - - -
- - - - - -
- - - -
- - 0) { - $remaining = max(0, 3600 - (time() - $enabled_time)); - } - ?> - -
- -
- - - - - - - - ' . floor($remaining / 60) . ':' . str_pad($remaining % 60, 2, '0', STR_PAD_LEFT) . ''); ?> - - - - - - - - - -
- - - -
- -

- -
- - - -

- - - -
- - - - - -

- - - - - - - -
- - () - -
- - $error): ?> - -
- -
100 ? '...' : ''; ?>
- -
- - - -
- - - -
- - - -
- - - -
- - - - - -
- - - -

- -
- -

- - - - - - - -

- -
- -
- -
- - - -
- -
- -
- -
- - - - - - argon_normalize_social_url('twitter', isset($_POST['argon_email_social_twitter']) ? sanitize_text_field($_POST['argon_email_social_twitter']) : ''), - 'github' => argon_normalize_social_url('github', isset($_POST['argon_email_social_github']) ? sanitize_text_field($_POST['argon_email_social_github']) : ''), - 'weibo' => argon_normalize_social_url('weibo', isset($_POST['argon_email_social_weibo']) ? sanitize_text_field($_POST['argon_email_social_weibo']) : ''), - 'bilibili' => argon_normalize_social_url('bilibili', isset($_POST['argon_email_social_bilibili']) ? sanitize_text_field($_POST['argon_email_social_bilibili']) : '') - ); - update_option('argon_email_social_links', $social_links); - - // 保存邮件模板配置 - $email_types = array('comment_notify', 'reply_notify', 'user_register', 'password_reset', 'todo_urge', 'general'); - foreach ($email_types as $type) { - // 保存启用状态 - argon_update_option_checkbox('argon_email_template_' . $type . '_enabled'); - // 保存主题 - argon_update_option('argon_email_template_' . $type . '_subject'); - // 保存内容(允许 HTML) - argon_update_option_allow_tags('argon_email_template_' . $type . '_content'); - } - - argon_update_option('argon_hide_footer_author'); - - argon_update_option('argon_card_radius'); - - argon_update_option('argon_comment_avatar_vcenter'); - - argon_update_option('argon_pjax_disabled'); - - argon_update_option('argon_comment_allow_markdown'); - - argon_update_option('argon_comment_allow_editing'); - - argon_update_option('argon_comment_allow_privatemode'); - - argon_update_option('argon_comment_allow_mailnotice'); - - argon_update_option_checkbox('argon_comment_mailnotice_checkbox_checked'); - - argon_update_option('argon_comment_pagination_type'); - - argon_update_option('argon_who_can_visit_comment_edit_history'); - - argon_update_option('argon_home_show_shuoshuo'); - - argon_update_option('argon_enable_search_filters'); - - argon_update_option('argon_search_filters_type'); - - argon_update_option('argon_darkmode_autoswitch'); - - argon_update_option('argon_enable_amoled_dark'); - - argon_update_option('argon_outdated_info_time_type'); - - argon_update_option('argon_outdated_info_days'); - - argon_update_option('argon_outdated_info_tip_type'); - - argon_update_option('argon_outdated_info_tip_content'); - - argon_update_option_checkbox('argon_show_toolbar_mask'); - - argon_update_option('argon_enable_banner_title_typing_effect'); - - argon_update_option('argon_banner_typing_effect_interval'); - - argon_update_option('argon_page_layout'); - - argon_update_option('argon_article_list_layout'); - - argon_update_option('argon_article_list_layout_mobile'); - - argon_update_option('argon_enable_pangu'); - - argon_update_option('argon_assets_path'); - - argon_update_option('argon_custom_assets_path'); - - argon_update_option('argon_comment_ua'); - - argon_update_option('argon_wp_path'); - - argon_update_option('argon_dateformat'); - - argon_update_option('argon_font'); - - argon_update_option('argon_card_shadow'); - - argon_update_option('argon_enable_code_highlight'); - - argon_update_option('argon_code_highlight_hide_linenumber'); - - argon_update_option('argon_code_highlight_transparent_linenumber'); - - argon_update_option('argon_code_highlight_break_line'); - - argon_update_option('argon_code_theme'); - - argon_update_option('argon_comment_enable_qq_avatar'); - - argon_update_option('argon_enable_login_css'); - - argon_update_option('argon_hide_categories'); - - argon_update_option('argon_article_meta'); - - argon_update_option('argon_fold_long_comments'); - - argon_update_option('argon_fold_long_shuoshuo'); - - argon_update_option('argon_first_image_as_thumbnail_by_default'); - - argon_update_option('argon_enable_headroom'); - - argon_update_option('argon_comment_emotion_keyboard'); - - argon_update_option_allow_tags('argon_additional_content_after_post'); - - argon_update_option('argon_related_post'); - - argon_update_option('argon_related_post_sort_orderby'); - - argon_update_option('argon_related_post_sort_order'); - - argon_update_option('argon_related_post_limit'); - - argon_update_option('argon_article_header_style'); - - argon_update_option('argon_text_gravatar'); - - argon_update_option('argon_disable_googlefont'); - - argon_update_option('argon_disable_codeblock_style'); - - argon_update_option('argon_reference_list_title'); - - argon_update_option('argon_trim_words_count'); - - argon_update_option('argon_enable_comment_upvote'); - - argon_update_option('argon_article_list_waterflow'); - - argon_update_option('argon_banner_size'); - - argon_update_option('argon_toolbar_blur'); - - argon_update_option('argon_toolbar_style'); - - argon_update_option('argon_toolbar_shadow'); - - argon_update_option('argon_toolbar_border'); - - argon_update_option('argon_toolbar_compact'); - - argon_update_option('argon_toolbar_center'); - - argon_update_option('argon_toolbar_links_left'); - - argon_update_option('argon_toolbar_links_right'); - - argon_update_option('argon_archives_timeline_show_month'); - - argon_update_option('argon_archives_timeline_url'); - - argon_update_option('argon_enable_immersion_color'); - - argon_update_option('argon_enable_comment_pinning'); - - argon_update_option('argon_show_comment_parent_info'); - - - - //LazyLoad 相关 - - argon_update_option('argon_enable_lazyload'); - - argon_update_option('argon_lazyload_effect'); - - argon_update_option('argon_lazyload_threshold'); - - argon_update_option('argon_lazyload_loading_style'); - - - - //图片缩放预览相关 - - argon_update_option('argon_enable_fancybox'); - - argon_update_option('argon_enable_zoomify'); - - argon_update_option('argon_zoomify_duration'); - - argon_update_option('argon_zoomify_easing'); - - argon_update_option('argon_zoomify_scale'); - - - - //数学公式相关配置项 - - argon_update_option('argon_math_render'); - - argon_update_option('argon_mathjax_cdn_url'); - - argon_update_option('argon_mathjax_v2_cdn_url'); - - argon_update_option('argon_katex_cdn_url'); - - argon_update_option_checkbox('argon_mathjax3_use_local'); - - argon_update_option_checkbox('argon_mathjax2_use_local'); - - argon_update_option_checkbox('argon_katex_use_local'); - - - - //页头页尾脚本 - - argon_update_option_allow_tags('argon_custom_html_head'); - - argon_update_option_allow_tags('argon_custom_html_foot'); - - - - //公告 - - argon_update_option_allow_tags('argon_sidebar_announcement'); - - //AI 摘要 - argon_update_option_checkbox('argon_ai_summary_enable'); - argon_update_option('argon_ai_summary_provider'); - argon_update_option('argon_ai_summary_api_key'); - argon_update_option('argon_ai_summary_api_endpoint'); - argon_update_option('argon_ai_summary_model'); - argon_update_option('argon_ai_summary_prompt'); - argon_update_option('argon_ai_summary_exclude_ids'); - - //AI 垃圾评论识别 - argon_update_option_checkbox('argon_comment_spam_detection_enable'); - argon_update_option('argon_comment_spam_detection_prompt'); - argon_update_option('argon_comment_spam_detection_mode'); - argon_update_option('argon_comment_spam_detection_sample_rate'); - argon_update_option('argon_comment_spam_detection_auto_action'); - argon_update_option('argon_comment_spam_detection_whitelist'); - argon_update_option_checkbox('argon_comment_spam_detection_exclude_logged_in'); - - } - -} - -argon_update_themeoptions(); - -?> diff --git a/settings.php.backup_before_ai_refactor b/settings.php.backup_before_ai_refactor deleted file mode 100644 index bbd613b..0000000 --- a/settings.php.backup_before_ai_refactor +++ /dev/null @@ -1,7812 +0,0 @@ - - - - - - - - - - -
- - - - - -

- - - - - - - - - - solstice23/argon-theme - - - -

- -

- -

Ctrl + F

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 'OpenAI (ChatGPT)', - 'anthropic' => 'Anthropic (Claude)', - 'deepseek' => 'DeepSeek', - 'xiaomi' => __('小米 Mimo', 'argon'), - 'qianwen' => __('通义千问', 'argon'), - 'wenxin' => __('文心一言', 'argon'), - 'doubao' => __('豆包 (火山引擎)', 'argon'), - 'kimi' => 'Kimi (Moonshot)', - 'zhipu' => __('智谱 AI (GLM)', 'argon'), - 'siliconflow' => __('硅基流动 (SiliconFlow)', 'argon') - ]; - - // 显示所有提供商的 API 配置 - foreach ($providers as $provider_key => $provider_name) { - // 获取该提供商的所有 API 配置 - $apis = argon_get_provider_apis($provider_key); - $active_api_id = get_option("argon_ai_{$provider_key}_active_api", ''); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - " style="height:40px;width: 80px;cursor: pointer;"/> - - " style="height: 40px;width: 80px;vertical-align: bottom;background: #fff;cursor: pointer;" onclick="$('input[name=\'argon_theme_color\']').click()"/>

- -

- -

- -
- -
Argon ()
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - - - - - - - - -
- - - -
- -

- -
- - - -

页面背景、卡片及页面上的其它元素会变为沉浸式主题色(气氛色)。类似 Material You。', 'argon');?>

- -
- -
- -
- -
- -
- - - -

- - - -


- -
- - - -

- -

- - px - -

4px 2px - 15px

- -
- -
- - - - - - - -
- -

- -

- -
- - - - - - - -
- -

- -

- - - -

- -
- - - -

- -
- - - -

- -

- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -


- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -



- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
-

- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -

- -

- - - -



- -

- -

- -

--hidden-- 可以隐藏标题', 'argon');?>

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -





- -
- - - -
- - - -
- -


- -
- - - -


--bing--

- -
- - - - - - - -

- -

- -
- - - - - - - - - - - - - - - -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- -
- -
- -
- -
- - -
-

-
- - -
- -
- - -
-

-
- - -
- -
- - px -
-

-
- - -
- -
- - % -
-

-
-
- - -
- - -
- - - -
-
- - -
-
-
-

- -

-
-
- - - -

- - - -

- -
- - - -


--hitokoto--

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

SEO

- - - -


- -
- - - -

- -

- - - - - -

- -

%theme_version% 来表示主题版本号。', 'argon');?>

- -
- - - -

/blog/ /

- -

- - - -

- -

- - - - - - - - - -

- - - -
- - - - - -

- -
- - - - - -
- - - - - -

- -

- - - -

- -
- - - -

- -

- -

-
- -

-
-
- -
-
- $api): ?> -
- -
- -
-
- -

- - - - - - - - - -
-
-

- - -

- - -
- -

-
- -

-
- -

- -
- - - -

-

- - "/> - -

使用 ref 短代码可以在文中插入脚注。', 'argon');?>

- -

- - - -

- -

- - - -

- -

- - - -

- -

- - - -


%url% 来代替当前页面 URL,%link% 来代替当前页面链接,%title% 来代替当前文章标题,%author% 来代替当前文章作者。', 'argon');?>

- -
- -
- -
- -
- - - -

- -

- - - -

:
- -

- -
- -
- - - -

- -

- - - - - - - - - - - - - - - -
- - - -


%date_delta% %post_date_delta% %modify_date_delta%

- -

- -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -
- - - -
- - - -

- -
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- -

- -

Lazyload

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

,

- -

- - - -

- -
- -

Pangu.js

- - - -

- -

- - -

-
- -

-
- -

-

- -

-

- - -

-
- - -

-
- - -
-

- -

- -
- -
    - -
  • ✓ WP Githuber MD
  • - - -
  • ✓ Markdown Block
  • - - -
  • ✓ Code Syntax Block
  • - - -
  • - -
-
- - -

- - -

- - -

- - -

-
- -

- -

-

-
-
- - -
- -
- - -
- -
- - -
- -
- -
-

- -

-
-
- - -
- -

- -

- - -

- -


- - window.pjaxLoaded
: - -

-
-window.pjaxLoaded = function(){
-
-	//
-
-	//do something...
-
-}
-
-							
- - window.pjaxLoaded window.pjaxLoaded();

- -
- - - -


- -
- - - -


- -

- - - -

- -
- -
- - 最后一页,在每个页面顶部显示新的评论"。', 'argon');?> >>> - - $(".go-to-wp-comment-settings").addClass("wrong-options");'; - - };?> - - - - - -

- -

- - - -


- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

-
- •
- •
- • -

- -
- - / - - -

- -
- - / - - -

- -
- - / - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -
- - - -
- -

- -
- - - -

- -

- - -

-
- -

-
-
- - -

-
-
-
- -

-
- -
- - % -

-
-
-
- -

-
-
-
- - -

-
-
-
- 70% 且出现 >= 3 次的关键词自动加入下方列表', 'argon');?> -

-
- - - -

-
-
-
- 加微信, 联系QQ, 点击链接, 免费领取, 刷单, 兼职 -

- - '; - echo '

' . __('AI 学习到的关键字', 'argon') . '

'; - echo '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - // 按置信度排序 - uasort($learned_keywords, function($a, $b) { - return $b['confidence'] <=> $a['confidence']; - }); - - $current_keywords_array = array_filter(array_map('trim', explode("\n", get_option('argon_comment_spam_detection_keywords', '')))); - - foreach ($learned_keywords as $keyword => $stats) { - $confidence = round($stats['confidence'] * 100); - $color = $confidence >= 70 ? '#48bb78' : ($confidence >= 50 ? '#ed8936' : '#a0aec0'); - $is_added = in_array($keyword, $current_keywords_array); - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
' . __('关键字', 'argon') . '' . __('垃圾', 'argon') . '' . __('正常', 'argon') . '' . __('置信度', 'argon') . '' . __('状态', 'argon') . '
' . esc_html($keyword) . '' . $stats['spam_count'] . '' . $stats['normal_count'] . '' . $confidence . '%'; - if ($is_added) { - echo '✓ ' . __('已添加', 'argon') . ''; - } elseif ($confidence >= 70 && $stats['spam_count'] >= 3) { - echo '⚠ ' . __('待添加', 'argon') . ''; - } else { - echo '○ ' . __('观察中', 'argon') . ''; - } - echo '
'; - echo '

'; - echo __('• 绿色:置信度 ≥ 70%,已自动添加到关键字列表', 'argon') . '
'; - echo __('• 橙色:置信度 50-70%,观察中', 'argon') . '
'; - echo __('• 灰色:置信度 < 50%,数据不足', 'argon'); - echo '

'; - echo ''; - } - ?> -
- -

-
-
- -

-
- - -

-
- -

-
- -

-
- -

- :
- :
- :
- : -

- -
- - - -

-
- - -
- -

-
-
- -

-
- -

- :
- :
- -

-
-
- - - -
-

- ():
- ():
- ( 500/天', 'argon');?>): -

- -
-
- - - -
- - -

-
- -

- -
- get_statistics(); - $error_handler = new Argon_Spam_API_Error_Handler(); - $api_status = $error_handler->get_status(); - ?> -
-

-

- : - - % - - ( ) -

-

- : - - % - - ( ) -

-
- - -
-

-
-
- : -

- -
- - -

-
- -

- - -
- get_errors(10); - if (empty($errors)): ?> -

- -
- -
-

- - - - -

-

- -

-
- -
- - - -

- -

- - -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -


gravatar.pho.ink/avatar/ , cdn.v2ex.com/gravatar/ , dn-qiniu-avatar.qbox.me/avatar/

- -
- - - -

- -
- - - -

- -
- - - - - -
- - - -
- -
- -
- - - -
- - true, - - ), 'objects'); - - foreach ($all_post_types as $post_type) { - - if ($post_type -> name == 'attachment'){ - - continue; - - } - - echo '
'. $post_type -> label .'
'; - - } - - ?> - -
- -
- -

- - -

-
- - -

- -
- -

-
- -

-
- -
- - -
-
- - -
-
- - -
-
- - -
-

-

- -
-
- - - -
- - $type_info): - $config = argon_get_email_template_config($type_key); - ?> -
-
- -
- -
- - -

-
- -
- - -

-
- -
- -
- $desc): ?> - - {{}} - - - - -
-

-
- -
- -
-
:
-
:
-
-
-
- -
- - -
-
- -
- - - - - -
- -

-
- -

-
- -

-
- -

-
- -

-
-

- -

- - - -

- -
- - - -


- -

分类
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'category' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo "
Tag
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'post_tag' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo ""; - - ?> - - - -

- -
- - - -

- -
- -

- -
- - 个人资料页面将 "管理界面配色方案" 设为 "Argon" 即可开启。', 'argon'), admin_url('profile.php'));?> - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - - - -

- - - - - - - -

- - - - - - - - - -
- - - - - -
- - - -
- - 0) { - $remaining = max(0, 3600 - (time() - $enabled_time)); - } - ?> - -
- -
- - - - - - - - ' . floor($remaining / 60) . ':' . str_pad($remaining % 60, 2, '0', STR_PAD_LEFT) . ''); ?> - - - - - - - - - -
- - - -
- -

- -
- - - -

- - - -
- - - - - -

- - - - - - - -
- - () - -
- - $error): ?> - -
- -
100 ? '...' : ''; ?>
- -
- - - -
- - - -
- - - -
- - - -
- - - - - -
- - - -

- -
- -

- - - - - - - -

- -
- -
- -
- - - -
- -
- -
- -
- - - - - - argon_normalize_social_url('twitter', isset($_POST['argon_email_social_twitter']) ? sanitize_text_field($_POST['argon_email_social_twitter']) : ''), - 'github' => argon_normalize_social_url('github', isset($_POST['argon_email_social_github']) ? sanitize_text_field($_POST['argon_email_social_github']) : ''), - 'weibo' => argon_normalize_social_url('weibo', isset($_POST['argon_email_social_weibo']) ? sanitize_text_field($_POST['argon_email_social_weibo']) : ''), - 'bilibili' => argon_normalize_social_url('bilibili', isset($_POST['argon_email_social_bilibili']) ? sanitize_text_field($_POST['argon_email_social_bilibili']) : '') - ); - update_option('argon_email_social_links', $social_links); - - // 保存邮件模板配置 - $email_types = array('comment_notify', 'spam_notify', 'reply_notify', 'todo_urge'); - foreach ($email_types as $type) { - // 保存启用状态 - argon_update_option_checkbox('argon_email_template_' . $type . '_enabled'); - // 保存主题 - argon_update_option('argon_email_template_' . $type . '_subject'); - // 保存内容(允许 HTML) - argon_update_option_allow_tags('argon_email_template_' . $type . '_content'); - } - - argon_update_option('argon_hide_footer_author'); - - argon_update_option('argon_card_radius'); - - argon_update_option('argon_comment_avatar_vcenter'); - - argon_update_option('argon_pjax_disabled'); - - argon_update_option('argon_comment_allow_markdown'); - - argon_update_option('argon_comment_allow_editing'); - - argon_update_option('argon_comment_allow_privatemode'); - - argon_update_option('argon_comment_allow_mailnotice'); - - argon_update_option_checkbox('argon_comment_mailnotice_checkbox_checked'); - - argon_update_option('argon_comment_pagination_type'); - - argon_update_option('argon_who_can_visit_comment_edit_history'); - - argon_update_option('argon_home_show_shuoshuo'); - - argon_update_option('argon_enable_search_filters'); - - argon_update_option('argon_search_filters_type'); - - argon_update_option('argon_darkmode_autoswitch'); - - argon_update_option('argon_enable_amoled_dark'); - - argon_update_option('argon_outdated_info_time_type'); - - argon_update_option('argon_outdated_info_days'); - - argon_update_option('argon_outdated_info_tip_type'); - - argon_update_option('argon_outdated_info_tip_content'); - - argon_update_option_checkbox('argon_show_toolbar_mask'); - - argon_update_option('argon_enable_banner_title_typing_effect'); - - argon_update_option('argon_banner_typing_effect_interval'); - - argon_update_option('argon_page_layout'); - - argon_update_option('argon_article_list_layout'); - - argon_update_option('argon_article_list_layout_mobile'); - - argon_update_option('argon_enable_pangu'); - - // Mermaid 图表配置 - argon_update_option_checkbox('argon_enable_mermaid'); - argon_update_option('argon_mermaid_cdn_source'); - argon_update_option('argon_mermaid_cdn_custom_url'); - argon_update_option('argon_mermaid_theme'); - argon_update_option_checkbox('argon_mermaid_use_local'); - argon_update_option_checkbox('argon_mermaid_debug_mode'); - - argon_update_option('argon_assets_path'); - - argon_update_option('argon_custom_assets_path'); - - argon_update_option('argon_comment_ua'); - - argon_update_option('argon_wp_path'); - - argon_update_option('argon_dateformat'); - - argon_update_option('argon_font'); - - argon_update_option('argon_card_shadow'); - - argon_update_option('argon_enable_code_highlight'); - - argon_update_option('argon_code_highlight_hide_linenumber'); - - argon_update_option('argon_code_highlight_transparent_linenumber'); - - argon_update_option('argon_code_highlight_break_line'); - - argon_update_option('argon_code_theme'); - - argon_update_option('argon_comment_enable_qq_avatar'); - - argon_update_option('argon_enable_login_css'); - - argon_update_option('argon_hide_categories'); - - argon_update_option('argon_article_meta'); - - argon_update_option('argon_fold_long_comments'); - - argon_update_option('argon_fold_long_shuoshuo'); - - argon_update_option('argon_first_image_as_thumbnail_by_default'); - - argon_update_option('argon_enable_headroom'); - - argon_update_option('argon_comment_emotion_keyboard'); - - argon_update_option_allow_tags('argon_additional_content_after_post'); - - argon_update_option('argon_related_post'); - - argon_update_option('argon_related_post_sort_orderby'); - - argon_update_option('argon_related_post_sort_order'); - - argon_update_option('argon_related_post_limit'); - - argon_update_option('argon_article_header_style'); - - argon_update_option('argon_text_gravatar'); - - argon_update_option('argon_disable_googlefont'); - - argon_update_option('argon_disable_codeblock_style'); - - argon_update_option('argon_reference_list_title'); - - argon_update_option('argon_trim_words_count'); - - argon_update_option('argon_enable_comment_upvote'); - - argon_update_option('argon_article_list_waterflow'); - - argon_update_option('argon_banner_size'); - - argon_update_option('argon_toolbar_blur'); - - argon_update_option('argon_toolbar_style'); - - argon_update_option('argon_toolbar_shadow'); - - argon_update_option('argon_toolbar_border'); - - argon_update_option('argon_toolbar_compact'); - - argon_update_option('argon_toolbar_center'); - - argon_update_option('argon_toolbar_links_left'); - - argon_update_option('argon_toolbar_links_right'); - - argon_update_option('argon_archives_timeline_show_month'); - - argon_update_option('argon_archives_timeline_url'); - - argon_update_option('argon_enable_immersion_color'); - - argon_update_option('argon_enable_comment_pinning'); - - argon_update_option('argon_show_comment_parent_info'); - - - - //LazyLoad 相关 - - argon_update_option('argon_enable_lazyload'); - - argon_update_option('argon_lazyload_effect'); - - argon_update_option('argon_lazyload_threshold'); - - argon_update_option('argon_lazyload_loading_style'); - - //图片缩放预览相关 - - argon_update_option('argon_enable_fancybox'); - - argon_update_option('argon_enable_zoomify'); - - argon_update_option('argon_zoomify_duration'); - - argon_update_option('argon_zoomify_easing'); - - argon_update_option('argon_zoomify_scale'); - - - - //数学公式相关配置项 - - argon_update_option('argon_math_render'); - - argon_update_option('argon_mathjax_cdn_url'); - - argon_update_option('argon_mathjax_v2_cdn_url'); - - argon_update_option('argon_katex_cdn_url'); - - argon_update_option_checkbox('argon_mathjax3_use_local'); - - argon_update_option_checkbox('argon_mathjax2_use_local'); - - argon_update_option_checkbox('argon_katex_use_local'); - - - - //页头页尾脚本 - - argon_update_option_allow_tags('argon_custom_html_head'); - - argon_update_option_allow_tags('argon_custom_html_foot'); - - - - //公告 - - argon_update_option_allow_tags('argon_sidebar_announcement'); - - //AI 摘要 - argon_update_option_checkbox('argon_ai_summary_enable'); - argon_update_option('argon_ai_summary_provider'); - argon_update_option('argon_ai_summary_prompt'); - argon_update_option('argon_ai_summary_exclude_ids'); - - // 保存所有提供商的多 API 配置 - $providers = ['openai', 'anthropic', 'deepseek', 'xiaomi', 'qianwen', 'wenxin', 'doubao', 'kimi', 'zhipu', 'siliconflow']; - foreach ($providers as $provider) { - // 保存 API 配置数组 - if (isset($_POST["argon_ai_{$provider}_apis"])) { - $apis_json = stripslashes($_POST["argon_ai_{$provider}_apis"]); - $apis = json_decode($apis_json, true); - if (is_array($apis)) { - update_option("argon_ai_{$provider}_apis", $apis); - } - } - - // 保存当前激活的 API ID - if (isset($_POST["argon_ai_{$provider}_active_api"])) { - update_option("argon_ai_{$provider}_active_api", sanitize_text_field($_POST["argon_ai_{$provider}_active_api"])); - } - } - - //AI 垃圾评论识别 - argon_update_option_checkbox('argon_comment_spam_detection_enable'); - argon_update_option('argon_comment_spam_detection_prompt_mode'); - argon_update_option('argon_comment_spam_detection_confidence_threshold'); - argon_update_option('argon_comment_spam_detection_privacy_level'); - argon_update_option('argon_comment_spam_detection_prompt'); - argon_update_option('argon_comment_spam_detection_mode'); - argon_update_option('argon_comment_spam_detection_sample_rate'); - argon_update_option('argon_comment_spam_detection_auto_action'); - argon_update_option('argon_comment_spam_detection_whitelist'); - argon_update_option_checkbox('argon_comment_spam_detection_exclude_logged_in'); - argon_update_option('argon_comment_spam_detection_keywords'); - argon_update_option_checkbox('argon_comment_spam_detection_ai_learn'); - - } - -} - -argon_update_themeoptions(); - -?> diff --git a/settings.php.backup_before_ui_refactor b/settings.php.backup_before_ui_refactor deleted file mode 100644 index bbd613b..0000000 --- a/settings.php.backup_before_ui_refactor +++ /dev/null @@ -1,7812 +0,0 @@ - - - - - - - - - - -
- - - - - -

- - - - - - - - - - solstice23/argon-theme - - - -

- -

- -

Ctrl + F

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 'OpenAI (ChatGPT)', - 'anthropic' => 'Anthropic (Claude)', - 'deepseek' => 'DeepSeek', - 'xiaomi' => __('小米 Mimo', 'argon'), - 'qianwen' => __('通义千问', 'argon'), - 'wenxin' => __('文心一言', 'argon'), - 'doubao' => __('豆包 (火山引擎)', 'argon'), - 'kimi' => 'Kimi (Moonshot)', - 'zhipu' => __('智谱 AI (GLM)', 'argon'), - 'siliconflow' => __('硅基流动 (SiliconFlow)', 'argon') - ]; - - // 显示所有提供商的 API 配置 - foreach ($providers as $provider_key => $provider_name) { - // 获取该提供商的所有 API 配置 - $apis = argon_get_provider_apis($provider_key); - $active_api_id = get_option("argon_ai_{$provider_key}_active_api", ''); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - " style="height:40px;width: 80px;cursor: pointer;"/> - - " style="height: 40px;width: 80px;vertical-align: bottom;background: #fff;cursor: pointer;" onclick="$('input[name=\'argon_theme_color\']').click()"/>

- -

- -

- -
- -
Argon ()
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- - - - - - - - - -
- - - -
- -

- -
- - - -

页面背景、卡片及页面上的其它元素会变为沉浸式主题色(气氛色)。类似 Material You。', 'argon');?>

- -
- -
- -
- -
- -
- - - -

- - - -


- -
- - - -

- -

- - px - -

4px 2px - 15px

- -
- -
- - - - - - - -
- -

- -

- -
- - - - - - - -
- -

- -

- - - -

- -
- - - -

- -
- - - -

- -

- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -


- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -



- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
-

- -
- -
- - - -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -
- -
- - - -
- - - -
- -

- -

- - - -



- -

- -

- -

--hidden-- 可以隐藏标题', 'argon');?>

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -





- -
- - - -
- - - -
- -


- -
- - - -


--bing--

- -
- - - - - - - -

- -

- -
- - - - - - - - - - - - - - - -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- -
- -
- -
- -
- - -
-

-
- - -
- -
- - -
-

-
- - -
- -
- - px -
-

-
- - -
- -
- - % -
-

-
-
- - -
- - -
- - - -
-
- - -
-
-
-

- -

-
-
- - - -

- - - -

- -
- - - -


--hitokoto--

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

SEO

- - - -


- -
- - - -

- -

- - - - - -

- -

%theme_version% 来表示主题版本号。', 'argon');?>

- -
- - - -

/blog/ /

- -

- - - -

- -

- - - - - - - - - -

- - - -
- - - - - -

- -
- - - - - -
- - - - - -

- -

- - - -

- -
- - - -

- -

- -

-
- -

-
-
- -
-
- $api): ?> -
- -
- -
-
- -

- - - - - - - - - -
-
-

- - -

- - -
- -

-
- -

-
- -

- -
- - - -

-

- - "/> - -

使用 ref 短代码可以在文中插入脚注。', 'argon');?>

- -

- - - -

- -

- - - -

- -

- - - -

- -

- - - -


%url% 来代替当前页面 URL,%link% 来代替当前页面链接,%title% 来代替当前文章标题,%author% 来代替当前文章作者。', 'argon');?>

- -
- -
- -
- -
- - - -

- -

- - - -

:
- -

- -
- -
- - - -

- -

- - - - - - - - - - - - - - - -
- - - -


%date_delta% %post_date_delta% %modify_date_delta%

- -

- -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -
- - - -
- - - -

- -
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- -

- -

Lazyload

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

,

- -

- - - -

- -
- -

Pangu.js

- - - -

- -

- - -

-
- -

-
- -

-

- -

-

- - -

-
- - -

-
- - -
-

- -

- -
- -
    - -
  • ✓ WP Githuber MD
  • - - -
  • ✓ Markdown Block
  • - - -
  • ✓ Code Syntax Block
  • - - -
  • - -
-
- - -

- - -

- - -

- - -

-
- -

- -

-

-
-
- - -
- -
- - -
- -
- - -
- -
- -
-

- -

-
-
- - -
- -

- -

- - -

- -


- - window.pjaxLoaded
: - -

-
-window.pjaxLoaded = function(){
-
-	//
-
-	//do something...
-
-}
-
-							
- - window.pjaxLoaded window.pjaxLoaded();

- -
- - - -


- -
- - - -


- -

- - - -

- -
- -
- - 最后一页,在每个页面顶部显示新的评论"。', 'argon');?> >>> - - $(".go-to-wp-comment-settings").addClass("wrong-options");'; - - };?> - - - - - -

- -

- - - -


- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -

- - - -

-
- •
- •
- • -

- -
- - / - - -

- -
- - / - - -

- -
- - / - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -
- - - -
- -

- -
- - - -

- -

- - -

-
- -

-
-
- - -

-
-
-
- -

-
- -
- - % -

-
-
-
- -

-
-
-
- - -

-
-
-
- 70% 且出现 >= 3 次的关键词自动加入下方列表', 'argon');?> -

-
- - - -

-
-
-
- 加微信, 联系QQ, 点击链接, 免费领取, 刷单, 兼职 -

- - '; - echo '

' . __('AI 学习到的关键字', 'argon') . '

'; - echo '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - - // 按置信度排序 - uasort($learned_keywords, function($a, $b) { - return $b['confidence'] <=> $a['confidence']; - }); - - $current_keywords_array = array_filter(array_map('trim', explode("\n", get_option('argon_comment_spam_detection_keywords', '')))); - - foreach ($learned_keywords as $keyword => $stats) { - $confidence = round($stats['confidence'] * 100); - $color = $confidence >= 70 ? '#48bb78' : ($confidence >= 50 ? '#ed8936' : '#a0aec0'); - $is_added = in_array($keyword, $current_keywords_array); - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
' . __('关键字', 'argon') . '' . __('垃圾', 'argon') . '' . __('正常', 'argon') . '' . __('置信度', 'argon') . '' . __('状态', 'argon') . '
' . esc_html($keyword) . '' . $stats['spam_count'] . '' . $stats['normal_count'] . '' . $confidence . '%'; - if ($is_added) { - echo '✓ ' . __('已添加', 'argon') . ''; - } elseif ($confidence >= 70 && $stats['spam_count'] >= 3) { - echo '⚠ ' . __('待添加', 'argon') . ''; - } else { - echo '○ ' . __('观察中', 'argon') . ''; - } - echo '
'; - echo '

'; - echo __('• 绿色:置信度 ≥ 70%,已自动添加到关键字列表', 'argon') . '
'; - echo __('• 橙色:置信度 50-70%,观察中', 'argon') . '
'; - echo __('• 灰色:置信度 < 50%,数据不足', 'argon'); - echo '

'; - echo ''; - } - ?> -
- -

-
-
- -

-
- - -

-
- -

-
- -

-
- -

- :
- :
- :
- : -

- -
- - - -

-
- - -
- -

-
-
- -

-
- -

- :
- :
- -

-
-
- - - -
-

- ():
- ():
- ( 500/天', 'argon');?>): -

- -
-
- - - -
- - -

-
- -

- -
- get_statistics(); - $error_handler = new Argon_Spam_API_Error_Handler(); - $api_status = $error_handler->get_status(); - ?> -
-

-

- : - - % - - ( ) -

-

- : - - % - - ( ) -

-
- - -
-

-
-
- : -

- -
- - -

-
- -

- - -
- get_errors(10); - if (empty($errors)): ?> -

- -
- -
-

- - - - -

-

- -

-
- -
- - - -

- -

- - -

- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -


gravatar.pho.ink/avatar/ , cdn.v2ex.com/gravatar/ , dn-qiniu-avatar.qbox.me/avatar/

- -
- - - -

- -
- - - -

- -
- - - - - -
- - - -
- -
- -
- - - -
- - true, - - ), 'objects'); - - foreach ($all_post_types as $post_type) { - - if ($post_type -> name == 'attachment'){ - - continue; - - } - - echo '
'. $post_type -> label .'
'; - - } - - ?> - -
- -
- -

- - -

-
- - -

- -
- -

-
- -

-
- -
- - -
-
- - -
-
- - -
-
- - -
-

-

- -
-
- - - -
- - $type_info): - $config = argon_get_email_template_config($type_key); - ?> -
-
- -
- -
- - -

-
- -
- - -

-
- -
- -
- $desc): ?> - - {{}} - - - - -
-

-
- -
- -
-
:
-
:
-
-
-
- -
- - -
-
- -
- - - - - -
- -

-
- -

-
- -

-
- -

-
- -

-
-

- -

- - - -

- -
- - - -


- -

分类
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'category' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo "
Tag
"; - - $categories = get_categories(array( - - 'hide_empty' => 0, - - 'hierarchical' => 0, - - 'taxonomy' => 'post_tag' - - )); - - foreach($categories as $category) { - - echo "".$category -> name ." -> ". $category -> term_id .""; - - } - - echo ""; - - ?> - - - -

- -
- - - -

- -
- -

- -
- - 个人资料页面将 "管理界面配色方案" 设为 "Argon" 即可开启。', 'argon'), admin_url('profile.php'));?> - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - -

- -
- - - - - -

- - - - - - - -

- - - - - - - - - -
- - - - - -
- - - -
- - 0) { - $remaining = max(0, 3600 - (time() - $enabled_time)); - } - ?> - -
- -
- - - - - - - - ' . floor($remaining / 60) . ':' . str_pad($remaining % 60, 2, '0', STR_PAD_LEFT) . ''); ?> - - - - - - - - - -
- - - -
- -

- -
- - - -

- - - -
- - - - - -

- - - - - - - -
- - () - -
- - $error): ?> - -
- -
100 ? '...' : ''; ?>
- -
- - - -
- - - -
- - - -
- - - -
- - - - - -
- - - -

- -
- -

- - - - - - - -

- -
- -
- -
- - - -
- -
- -
- -
- - - - - - argon_normalize_social_url('twitter', isset($_POST['argon_email_social_twitter']) ? sanitize_text_field($_POST['argon_email_social_twitter']) : ''), - 'github' => argon_normalize_social_url('github', isset($_POST['argon_email_social_github']) ? sanitize_text_field($_POST['argon_email_social_github']) : ''), - 'weibo' => argon_normalize_social_url('weibo', isset($_POST['argon_email_social_weibo']) ? sanitize_text_field($_POST['argon_email_social_weibo']) : ''), - 'bilibili' => argon_normalize_social_url('bilibili', isset($_POST['argon_email_social_bilibili']) ? sanitize_text_field($_POST['argon_email_social_bilibili']) : '') - ); - update_option('argon_email_social_links', $social_links); - - // 保存邮件模板配置 - $email_types = array('comment_notify', 'spam_notify', 'reply_notify', 'todo_urge'); - foreach ($email_types as $type) { - // 保存启用状态 - argon_update_option_checkbox('argon_email_template_' . $type . '_enabled'); - // 保存主题 - argon_update_option('argon_email_template_' . $type . '_subject'); - // 保存内容(允许 HTML) - argon_update_option_allow_tags('argon_email_template_' . $type . '_content'); - } - - argon_update_option('argon_hide_footer_author'); - - argon_update_option('argon_card_radius'); - - argon_update_option('argon_comment_avatar_vcenter'); - - argon_update_option('argon_pjax_disabled'); - - argon_update_option('argon_comment_allow_markdown'); - - argon_update_option('argon_comment_allow_editing'); - - argon_update_option('argon_comment_allow_privatemode'); - - argon_update_option('argon_comment_allow_mailnotice'); - - argon_update_option_checkbox('argon_comment_mailnotice_checkbox_checked'); - - argon_update_option('argon_comment_pagination_type'); - - argon_update_option('argon_who_can_visit_comment_edit_history'); - - argon_update_option('argon_home_show_shuoshuo'); - - argon_update_option('argon_enable_search_filters'); - - argon_update_option('argon_search_filters_type'); - - argon_update_option('argon_darkmode_autoswitch'); - - argon_update_option('argon_enable_amoled_dark'); - - argon_update_option('argon_outdated_info_time_type'); - - argon_update_option('argon_outdated_info_days'); - - argon_update_option('argon_outdated_info_tip_type'); - - argon_update_option('argon_outdated_info_tip_content'); - - argon_update_option_checkbox('argon_show_toolbar_mask'); - - argon_update_option('argon_enable_banner_title_typing_effect'); - - argon_update_option('argon_banner_typing_effect_interval'); - - argon_update_option('argon_page_layout'); - - argon_update_option('argon_article_list_layout'); - - argon_update_option('argon_article_list_layout_mobile'); - - argon_update_option('argon_enable_pangu'); - - // Mermaid 图表配置 - argon_update_option_checkbox('argon_enable_mermaid'); - argon_update_option('argon_mermaid_cdn_source'); - argon_update_option('argon_mermaid_cdn_custom_url'); - argon_update_option('argon_mermaid_theme'); - argon_update_option_checkbox('argon_mermaid_use_local'); - argon_update_option_checkbox('argon_mermaid_debug_mode'); - - argon_update_option('argon_assets_path'); - - argon_update_option('argon_custom_assets_path'); - - argon_update_option('argon_comment_ua'); - - argon_update_option('argon_wp_path'); - - argon_update_option('argon_dateformat'); - - argon_update_option('argon_font'); - - argon_update_option('argon_card_shadow'); - - argon_update_option('argon_enable_code_highlight'); - - argon_update_option('argon_code_highlight_hide_linenumber'); - - argon_update_option('argon_code_highlight_transparent_linenumber'); - - argon_update_option('argon_code_highlight_break_line'); - - argon_update_option('argon_code_theme'); - - argon_update_option('argon_comment_enable_qq_avatar'); - - argon_update_option('argon_enable_login_css'); - - argon_update_option('argon_hide_categories'); - - argon_update_option('argon_article_meta'); - - argon_update_option('argon_fold_long_comments'); - - argon_update_option('argon_fold_long_shuoshuo'); - - argon_update_option('argon_first_image_as_thumbnail_by_default'); - - argon_update_option('argon_enable_headroom'); - - argon_update_option('argon_comment_emotion_keyboard'); - - argon_update_option_allow_tags('argon_additional_content_after_post'); - - argon_update_option('argon_related_post'); - - argon_update_option('argon_related_post_sort_orderby'); - - argon_update_option('argon_related_post_sort_order'); - - argon_update_option('argon_related_post_limit'); - - argon_update_option('argon_article_header_style'); - - argon_update_option('argon_text_gravatar'); - - argon_update_option('argon_disable_googlefont'); - - argon_update_option('argon_disable_codeblock_style'); - - argon_update_option('argon_reference_list_title'); - - argon_update_option('argon_trim_words_count'); - - argon_update_option('argon_enable_comment_upvote'); - - argon_update_option('argon_article_list_waterflow'); - - argon_update_option('argon_banner_size'); - - argon_update_option('argon_toolbar_blur'); - - argon_update_option('argon_toolbar_style'); - - argon_update_option('argon_toolbar_shadow'); - - argon_update_option('argon_toolbar_border'); - - argon_update_option('argon_toolbar_compact'); - - argon_update_option('argon_toolbar_center'); - - argon_update_option('argon_toolbar_links_left'); - - argon_update_option('argon_toolbar_links_right'); - - argon_update_option('argon_archives_timeline_show_month'); - - argon_update_option('argon_archives_timeline_url'); - - argon_update_option('argon_enable_immersion_color'); - - argon_update_option('argon_enable_comment_pinning'); - - argon_update_option('argon_show_comment_parent_info'); - - - - //LazyLoad 相关 - - argon_update_option('argon_enable_lazyload'); - - argon_update_option('argon_lazyload_effect'); - - argon_update_option('argon_lazyload_threshold'); - - argon_update_option('argon_lazyload_loading_style'); - - //图片缩放预览相关 - - argon_update_option('argon_enable_fancybox'); - - argon_update_option('argon_enable_zoomify'); - - argon_update_option('argon_zoomify_duration'); - - argon_update_option('argon_zoomify_easing'); - - argon_update_option('argon_zoomify_scale'); - - - - //数学公式相关配置项 - - argon_update_option('argon_math_render'); - - argon_update_option('argon_mathjax_cdn_url'); - - argon_update_option('argon_mathjax_v2_cdn_url'); - - argon_update_option('argon_katex_cdn_url'); - - argon_update_option_checkbox('argon_mathjax3_use_local'); - - argon_update_option_checkbox('argon_mathjax2_use_local'); - - argon_update_option_checkbox('argon_katex_use_local'); - - - - //页头页尾脚本 - - argon_update_option_allow_tags('argon_custom_html_head'); - - argon_update_option_allow_tags('argon_custom_html_foot'); - - - - //公告 - - argon_update_option_allow_tags('argon_sidebar_announcement'); - - //AI 摘要 - argon_update_option_checkbox('argon_ai_summary_enable'); - argon_update_option('argon_ai_summary_provider'); - argon_update_option('argon_ai_summary_prompt'); - argon_update_option('argon_ai_summary_exclude_ids'); - - // 保存所有提供商的多 API 配置 - $providers = ['openai', 'anthropic', 'deepseek', 'xiaomi', 'qianwen', 'wenxin', 'doubao', 'kimi', 'zhipu', 'siliconflow']; - foreach ($providers as $provider) { - // 保存 API 配置数组 - if (isset($_POST["argon_ai_{$provider}_apis"])) { - $apis_json = stripslashes($_POST["argon_ai_{$provider}_apis"]); - $apis = json_decode($apis_json, true); - if (is_array($apis)) { - update_option("argon_ai_{$provider}_apis", $apis); - } - } - - // 保存当前激活的 API ID - if (isset($_POST["argon_ai_{$provider}_active_api"])) { - update_option("argon_ai_{$provider}_active_api", sanitize_text_field($_POST["argon_ai_{$provider}_active_api"])); - } - } - - //AI 垃圾评论识别 - argon_update_option_checkbox('argon_comment_spam_detection_enable'); - argon_update_option('argon_comment_spam_detection_prompt_mode'); - argon_update_option('argon_comment_spam_detection_confidence_threshold'); - argon_update_option('argon_comment_spam_detection_privacy_level'); - argon_update_option('argon_comment_spam_detection_prompt'); - argon_update_option('argon_comment_spam_detection_mode'); - argon_update_option('argon_comment_spam_detection_sample_rate'); - argon_update_option('argon_comment_spam_detection_auto_action'); - argon_update_option('argon_comment_spam_detection_whitelist'); - argon_update_option_checkbox('argon_comment_spam_detection_exclude_logged_in'); - argon_update_option('argon_comment_spam_detection_keywords'); - argon_update_option_checkbox('argon_comment_spam_detection_ai_learn'); - - } - -} - -argon_update_themeoptions(); - -?> diff --git a/tmp/settings_225a925.php b/tmp/settings_225a925.php new file mode 100644 index 0000000..0985b3b Binary files /dev/null and b/tmp/settings_225a925.php differ