docs: 添加设置页重组完整总结文档并清理临时脚本
- 添加 settings-reorganize-complete.md 完整总结文档 - 添加 settings-reorganize-plan-v2.md 规划文档 - 删除所有临时 Python 重组脚本 - 添加隐私政策文档
This commit is contained in:
184
.kiro/steering/settings-reorganize-complete.md
Normal file
184
.kiro/steering/settings-reorganize-complete.md
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
# 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. 优化命名
|
||||||
|
- "验证码设置"子分类 → "验证码配置"(更明确)
|
||||||
|
- "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个分类的完整重组
|
||||||
|
|
||||||
|
## 统计数据
|
||||||
|
|
||||||
|
- **原始文件**: 6670 行
|
||||||
|
- **最终文件**: 6480 行
|
||||||
|
- **删除重复内容**: 311 行
|
||||||
|
- **新增内容**: 121 行(新分类标题和页脚设置)
|
||||||
|
- **净减少**: 190 行
|
||||||
|
- **优化的子分类**: 8 个
|
||||||
|
- **新建的一级分类**: 3 个(浮动按钮、页脚设置、反馈与安全)
|
||||||
|
- **重命名的一级分类**: 1 个(验证码与安全 → 验证码设置)
|
||||||
|
- **重组的子分类**: 10 个
|
||||||
|
|
||||||
|
## 优化效果
|
||||||
|
|
||||||
|
### 逻辑更清晰
|
||||||
|
- 每个分类职责单一,不再混杂不相关的设置
|
||||||
|
- 相关设置集中在一起,便于查找和管理
|
||||||
|
|
||||||
|
### 结构更合理
|
||||||
|
- 18个一级分类,每个分类包含2-5个子分类
|
||||||
|
- 分类层级清晰,符合用户使用习惯
|
||||||
|
|
||||||
|
### 无重复项
|
||||||
|
- 删除所有重复的设置项和分类标题
|
||||||
|
- 每个设置项只出现一次,避免混淆
|
||||||
|
|
||||||
|
### 保持兼容
|
||||||
|
- 所有设置项的 `name` 属性保持不变
|
||||||
|
- 所有 ID (`section-*` 和 `subsection-*`) 保持不变
|
||||||
|
- 不影响现有配置和功能
|
||||||
|
|
||||||
|
## 文件信息
|
||||||
|
|
||||||
|
- **最终文件**: `settings.php` (6480 行)
|
||||||
|
- **备份文件**: `settings.php.backup`
|
||||||
|
- **重组脚本**:
|
||||||
|
- `reorganize_comment_settings.py`
|
||||||
|
- `fix_all_issues.py`
|
||||||
|
- `fix_final_issues.py`
|
||||||
|
- `split_fab_footer.py`
|
||||||
|
- **完成时间**: 2026-01-22
|
||||||
|
- **最后提交**: 66dd8bf
|
||||||
|
|
||||||
|
## 后续建议
|
||||||
|
|
||||||
|
1. **测试验证**: 在WordPress后台测试所有设置项是否正常工作
|
||||||
|
2. **文档更新**: 更新主题文档,反映新的分类结构
|
||||||
|
3. **用户通知**: 如果发布更新,在更新日志中说明分类结构的优化
|
||||||
|
4. **清理脚本**: 可以删除临时的Python重组脚本文件
|
||||||
168
.kiro/steering/settings-reorganize-plan-v2.md
Normal file
168
.kiro/steering/settings-reorganize-plan-v2.md
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
# Settings.php 完整重新分类方案
|
||||||
|
|
||||||
|
## 当前问题分析
|
||||||
|
|
||||||
|
### 1. 分类不合理
|
||||||
|
- **验证码与安全**:包含了评论功能、评论外观等不相关设置
|
||||||
|
- **特殊页面**:页脚设置被错误放置在这里(出现两次)
|
||||||
|
- **浮动按钮与页脚**:页脚设置应该独立
|
||||||
|
- **文章显示 vs 文章功能**:标题样式、过时提示放在了文章显示中,应该在文章功能
|
||||||
|
|
||||||
|
### 2. 重复的子分类
|
||||||
|
- `subsection-subdirectory` 出现两次(第294行和第310行)
|
||||||
|
- `subsection-footer` 出现两次(第2539行和第2555行)
|
||||||
|
- `subsection-comment-features` 在验证码与安全分类中(第3766行),应该在评论设置中
|
||||||
|
|
||||||
|
### 3. 设置项错位
|
||||||
|
- 评论功能设置(Markdown、编辑等)在"验证码与安全"中
|
||||||
|
- 评论外观设置在"验证码与安全"中
|
||||||
|
- AI 垃圾评论识别在"验证码与安全"中,应该在"评论设置"中
|
||||||
|
- 页脚设置在"特殊页面"中
|
||||||
|
|
||||||
|
## 新的分类结构方案
|
||||||
|
|
||||||
|
```
|
||||||
|
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-comment)
|
||||||
|
├── 评论分页 (subsection-comment-pagination)
|
||||||
|
├── 发送评论 (subsection-comment-submit)
|
||||||
|
├── 评论功能 (subsection-comment-features) [从验证码与安全移入]
|
||||||
|
├── AI 垃圾评论识别 (subsection-comment-spam-detection) [从验证码与安全移入]
|
||||||
|
└── 评论区外观 (subsection-comment-appearance) [从验证码与安全移入]
|
||||||
|
|
||||||
|
16. 验证码设置 (section-captcha) [重命名]
|
||||||
|
├── 验证码配置 (subsection-captcha)
|
||||||
|
└── 场景验证码 (subsection-captcha-scenes)
|
||||||
|
|
||||||
|
17. 反馈与安全 (section-feedback-security) [新建]
|
||||||
|
├── 反馈设置 (subsection-feedback) [从验证码与安全移入]
|
||||||
|
└── 速率限制 (subsection-rate-limit) [从验证码与安全移入]
|
||||||
|
|
||||||
|
18. 高级设置 (section-advanced)
|
||||||
|
├── 自定义脚本 (subsection-scripts)
|
||||||
|
└── 杂项 (subsection-misc)
|
||||||
|
```
|
||||||
|
|
||||||
|
## 主要调整说明
|
||||||
|
|
||||||
|
### 1. 拆分"浮动按钮与页脚"
|
||||||
|
- 浮动按钮 → 独立为"浮动按钮"分类
|
||||||
|
- 页脚 → 独立为"页脚设置"分类
|
||||||
|
|
||||||
|
### 2. 拆分"验证码与安全"
|
||||||
|
- 验证码相关 → "验证码设置"分类
|
||||||
|
- 反馈和速率限制 → "反馈与安全"分类
|
||||||
|
- 评论功能/外观/AI识别 → 移到"评论设置"分类
|
||||||
|
|
||||||
|
### 3. 优化"文章显示"和"文章功能"
|
||||||
|
- 文章显示:只保留 Meta 信息和头图(纯展示相关)
|
||||||
|
- 文章功能:包含所有功能性设置(标题样式、过时提示等)
|
||||||
|
|
||||||
|
### 4. 完善"特殊页面"
|
||||||
|
- 添加搜索设置子分类
|
||||||
|
- 移除错误的页脚设置
|
||||||
|
|
||||||
|
### 5. 删除重复项
|
||||||
|
- 删除重复的子目录设置
|
||||||
|
- 删除重复的页脚设置
|
||||||
|
- 删除重复的评论功能设置
|
||||||
|
|
||||||
|
## 实施步骤
|
||||||
|
|
||||||
|
### 步骤 1:删除重复的子分类
|
||||||
|
1. 删除第310-324行的重复子目录设置
|
||||||
|
2. 删除第2555-2569行的重复页脚设置
|
||||||
|
|
||||||
|
### 步骤 2:创建新的一级分类
|
||||||
|
1. 拆分"浮动按钮与页脚"为两个独立分类
|
||||||
|
2. 创建"反馈与安全"分类
|
||||||
|
|
||||||
|
### 步骤 3:移动设置项
|
||||||
|
1. 将评论功能、AI垃圾评论识别、评论外观从"验证码与安全"移到"评论设置"
|
||||||
|
2. 将标题样式、过时提示从"文章显示"移到"文章功能"
|
||||||
|
3. 将反馈设置、速率限制从"验证码与安全"移到"反馈与安全"
|
||||||
|
|
||||||
|
### 步骤 4:重命名分类
|
||||||
|
1. "验证码与安全" → "验证码设置"
|
||||||
|
|
||||||
|
### 步骤 5:调整编号
|
||||||
|
1. 重新编号所有一级分类(1-18)
|
||||||
|
|
||||||
|
## 优化效果
|
||||||
|
|
||||||
|
- **逻辑更清晰**:每个分类职责单一,不再混杂
|
||||||
|
- **易于查找**:相关设置集中在一起
|
||||||
|
- **结构合理**:18个一级分类,每个分类3-5个子分类
|
||||||
|
- **无重复项**:删除所有重复的设置项
|
||||||
|
- **保持兼容**:所有 ID 和 name 属性保持不变
|
||||||
@@ -1,274 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Settings.php 结构优化脚本 - 步骤2
|
|
||||||
完成以下任务:
|
|
||||||
1. 在外观样式中添加动画效果子分类
|
|
||||||
2. 删除杂项中重复的动画效果设置
|
|
||||||
"""
|
|
||||||
|
|
||||||
def main():
|
|
||||||
# 读取文件
|
|
||||||
with open('settings.php', 'r', encoding='utf-8') as f:
|
|
||||||
content = f.read()
|
|
||||||
|
|
||||||
print("开始优化 settings.php (步骤2: 动画效果重组)...")
|
|
||||||
print(f"原始文件: {len(content)} 字符, {content.count(chr(10))} 行")
|
|
||||||
|
|
||||||
# 1. 在外观样式的字体设置后添加动画效果子分类
|
|
||||||
old_font_section = ''' </tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-font"><?php _e('字体', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('默认字体', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<div class="radio-h">
|
|
||||||
|
|
||||||
<?php $argon_font = (get_option('argon_font') == '' ? 'sans-serif' : get_option('argon_font')); ?>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
|
|
||||||
<input name="argon_font" type="radio" value="sans-serif" <?php if ($argon_font=='sans-serif'){echo 'checked';} ?>>
|
|
||||||
|
|
||||||
Sans Serif
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
|
|
||||||
<input name="argon_font" type="radio" value="serif" <?php if ($argon_font=='serif'){echo 'checked';} ?>>
|
|
||||||
|
|
||||||
Serif
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('默认使用无衬线字体/衬线字体。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 3. 页面布局 ========== -->'''
|
|
||||||
|
|
||||||
new_font_with_animation = ''' </tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-font"><?php _e('字体', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('默认字体', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<div class="radio-h">
|
|
||||||
|
|
||||||
<?php $argon_font = (get_option('argon_font') == '' ? 'sans-serif' : get_option('argon_font')); ?>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
|
|
||||||
<input name="argon_font" type="radio" value="sans-serif" <?php if ($argon_font=='sans-serif'){echo 'checked';} ?>>
|
|
||||||
|
|
||||||
Sans Serif
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
|
|
||||||
<input name="argon_font" type="radio" value="serif" <?php if ($argon_font=='serif'){echo 'checked';} ?>>
|
|
||||||
|
|
||||||
Serif
|
|
||||||
|
|
||||||
</label>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('默认使用无衬线字体/衬线字体。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-animation"><?php _e('动画效果', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('是否启用平滑滚动', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_enable_smoothscroll_type">
|
|
||||||
|
|
||||||
<?php $enable_smoothscroll_type = get_option('argon_enable_smoothscroll_type'); ?>
|
|
||||||
|
|
||||||
<option value="1" <?php if ($enable_smoothscroll_type=='1'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (平滑) (推荐)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="1_pulse" <?php if ($enable_smoothscroll_type=='1_pulse'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (脉冲式滚动) (仿 Edge) (推荐)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="2" <?php if ($enable_smoothscroll_type=='2'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 2 (较稳)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="3" <?php if ($enable_smoothscroll_type=='3'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 3', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="disabled" <?php if ($enable_smoothscroll_type=='disabled'){echo 'selected';} ?>><?php _e('不使用平滑滚动', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('能增强浏览体验,但可能出现一些小问题,如果有问题请切换方案或关闭平滑滚动', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('是否启用进入文章动画', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_enable_into_article_animation">
|
|
||||||
|
|
||||||
<?php $argon_enable_into_article_animation = get_option('argon_enable_into_article_animation'); ?>
|
|
||||||
|
|
||||||
<option value="false" <?php if ($argon_enable_into_article_animation=='false'){echo 'selected';} ?>><?php _e('不启用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="true" <?php if ($argon_enable_into_article_animation=='true'){echo 'selected';} ?>><?php _e('启用', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('从首页或分类目录进入文章时,使用平滑过渡(可能影响加载文章时的性能)', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('禁用 Pjax 加载后的页面滚动动画', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_disable_pjax_animation">
|
|
||||||
|
|
||||||
<?php $argon_disable_pjax_animation = get_option('argon_disable_pjax_animation'); ?>
|
|
||||||
|
|
||||||
<option value="false" <?php if ($argon_disable_pjax_animation=='false'){echo 'selected';} ?>><?php _e('不禁用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="true" <?php if ($argon_disable_pjax_animation=='true'){echo 'selected';} ?>><?php _e('禁用', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('Pjax 替换页面内容后会平滑滚动到页面顶部,如果你不喜欢,可以禁用这个选项', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 3. 页面布局 ========== -->'''
|
|
||||||
|
|
||||||
if old_font_section in content:
|
|
||||||
content = content.replace(old_font_section, new_font_with_animation)
|
|
||||||
print("✓ 在外观样式中添加了动画效果子分类")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到字体设置部分")
|
|
||||||
|
|
||||||
# 2. 删除杂项中重复的动画效果设置
|
|
||||||
old_misc_with_animation = ''' <tr><th class="subtitle"><h3 id="subsection-misc"><?php _e('杂项', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('是否启用平滑滚动', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_enable_smoothscroll_type">
|
|
||||||
|
|
||||||
<?php $enable_smoothscroll_type = get_option('argon_enable_smoothscroll_type'); ?>
|
|
||||||
|
|
||||||
<option value="1" <?php if ($enable_smoothscroll_type=='1'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (平滑) (推荐)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="1_pulse" <?php if ($enable_smoothscroll_type=='1_pulse'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 1 (脉冲式滚动) (仿 Edge) (推荐)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="2" <?php if ($enable_smoothscroll_type=='2'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 2 (较稳)', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="3" <?php if ($enable_smoothscroll_type=='3'){echo 'selected';} ?>><?php _e('使用平滑滚动方案 3', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="disabled" <?php if ($enable_smoothscroll_type=='disabled'){echo 'selected';} ?>><?php _e('不使用平滑滚动', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('能增强浏览体验,但可能出现一些小问题,如果有问题请切换方案或关闭平滑滚动', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('是否启用进入文章动画', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_enable_into_article_animation">
|
|
||||||
|
|
||||||
<?php $argon_enable_into_article_animation = get_option('argon_enable_into_article_animation'); ?>
|
|
||||||
|
|
||||||
<option value="false" <?php if ($argon_enable_into_article_animation=='false'){echo 'selected';} ?>><?php _e('不启用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="true" <?php if ($argon_enable_into_article_animation=='true'){echo 'selected';} ?>><?php _e('启用', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('从首页或分类目录进入文章时,使用平滑过渡(可能影响加载文章时的性能)', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('禁用 Pjax 加载后的页面滚动动画', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_disable_pjax_animation">
|
|
||||||
|
|
||||||
<?php $argon_disable_pjax_animation = get_option('argon_disable_pjax_animation'); ?>
|
|
||||||
|
|
||||||
<option value="false" <?php if ($argon_disable_pjax_animation=='false'){echo 'selected';} ?>><?php _e('不禁用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="true" <?php if ($argon_disable_pjax_animation=='true'){echo 'selected';} ?>><?php _e('禁用', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('Pjax 替换页面内容后会平滑滚动到页面顶部,如果你不喜欢,可以禁用这个选项', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 14. 评论设置 ========== -->'''
|
|
||||||
|
|
||||||
new_misc_without_animation = ''' <tr><th class="subtitle"><h3 id="subsection-misc"><?php _e('杂项', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<!-- ========== 15. 评论设置 ========== -->'''
|
|
||||||
|
|
||||||
if old_misc_with_animation in content:
|
|
||||||
content = content.replace(old_misc_with_animation, new_misc_without_animation)
|
|
||||||
print("✓ 删除了杂项中重复的动画效果设置")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到杂项中的动画效果设置")
|
|
||||||
|
|
||||||
# 保存文件
|
|
||||||
with open('settings.php', 'w', encoding='utf-8') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
print(f"\n优化完成! 新文件: {len(content)} 字符, {content.count(chr(10))} 行")
|
|
||||||
print("请检查 settings.php 文件")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Settings.php 结构优化脚本 - 最终步骤
|
|
||||||
完成以下任务:
|
|
||||||
1. 在基础设置的夜间模式后添加子目录设置
|
|
||||||
2. 将第1541行的"高级设置"改为"SEO与性能",并添加CDN和日期格式设置
|
|
||||||
3. 重新编号所有一级分类(1-16)
|
|
||||||
"""
|
|
||||||
|
|
||||||
def main():
|
|
||||||
# 读取文件
|
|
||||||
with open('settings.php', 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
print("开始优化 settings.php (最终步骤: 添加子目录和SEO与性能分类)...")
|
|
||||||
print(f"原始文件: {len(lines)} 行")
|
|
||||||
|
|
||||||
content = ''.join(lines)
|
|
||||||
|
|
||||||
# 1. 在基础设置的夜间模式后添加子目录设置
|
|
||||||
old_basic_end = ''' </tr>
|
|
||||||
|
|
||||||
<!-- ========== 2. 外观样式 ========== -->'''
|
|
||||||
|
|
||||||
new_basic_with_subdirectory = ''' </tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-subdirectory"><?php _e('子目录', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('Wordpress 安装目录', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<input type="text" class="regular-text" name="argon_wp_path" value="<?php echo get_option('argon_wp_path', '/'); ?>"/>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('如果 Wordpress 安装在子目录中,请在此填写子目录地址(例如', 'argon');?> <code>/blog/</code><?php _e('),注意前后各有一个斜杠。默认为', 'argon');?> <code>/</code> <?php _e('。', 'argon');?><br/><?php _e('如果不清楚该选项的用处,请保持默认。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 2. 外观样式 ========== -->'''
|
|
||||||
|
|
||||||
if old_basic_end in content:
|
|
||||||
content = content.replace(old_basic_end, new_basic_with_subdirectory)
|
|
||||||
print("✓ 在基础设置中添加了子目录设置")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到基础设置结束位置")
|
|
||||||
|
|
||||||
# 2. 将第1541行的"高级设置"改为"SEO与性能",并添加CDN和日期格式
|
|
||||||
old_advanced_seo = ''' <!-- ========== 9. 高级设置 ========== -->
|
|
||||||
<tr><th class="subtitle"><h2 id="section-advanced"><?php _e('高级设置', 'argon');?></h2></th></tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-seo">SEO</h3></th></tr>'''
|
|
||||||
|
|
||||||
new_seo_performance = ''' <!-- ========== 9. SEO 与性能 ========== -->
|
|
||||||
<tr><th class="subtitle"><h2 id="section-seo-performance"><?php _e('SEO 与性能', 'argon');?></h2></th></tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-seo">SEO</h3></th></tr>'''
|
|
||||||
|
|
||||||
if old_advanced_seo in content:
|
|
||||||
content = content.replace(old_advanced_seo, new_seo_performance)
|
|
||||||
print("✓ 将高级设置改为SEO与性能")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到第一个高级设置标题")
|
|
||||||
|
|
||||||
# 3. 在SEO设置后添加CDN和日期格式设置
|
|
||||||
# 先找到SEO设置的结束位置(在"文章显示"之前)
|
|
||||||
old_seo_end = ''' </tr>
|
|
||||||
|
|
||||||
<!-- ========== 10. 文章显示 ========== -->'''
|
|
||||||
|
|
||||||
new_seo_with_cdn_date = ''' </tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-cdn"><?php _e('CDN 加速', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label>CDN</label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_assets_path">
|
|
||||||
|
|
||||||
<?php $argon_assets_path = get_option('argon_assets_path'); ?>
|
|
||||||
|
|
||||||
<option value="default" <?php if ($argon_assets_path=='default'){echo 'selected';} ?>><?php _e('不使用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="jsdelivr" <?php if ($argon_assets_path=='jsdelivr'){echo 'selected';} ?>>Jsdelivr</option>
|
|
||||||
|
|
||||||
<option value="fastgit" <?php if ($argon_assets_path=='fastgit'){echo 'selected';} ?>>Fastgit</option>
|
|
||||||
|
|
||||||
<option value="sourcegcdn" <?php if ($argon_assets_path=='sourcegcdn'){echo 'selected';} ?>>Source Global CDN</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_gcore" <?php if ($argon_assets_path=='jsdelivr_gcore'){echo 'selected';} ?>>Jsdelivr (gcore)</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_fastly" <?php if ($argon_assets_path=='jsdelivr_fastly'){echo 'selected';} ?>>Jsdelivr (fastly)</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_cf" <?php if ($argon_assets_path=='jsdelivr_cf'){echo 'selected';} ?>>Jsdelivr (cf)</option>
|
|
||||||
|
|
||||||
<option value="custom" <?php if ($argon_assets_path=='custom'){echo 'selected';} ?>><?php _e('自定义...', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<input type="text" class="regular-text" name="argon_custom_assets_path" placeholder="https://" value="<?php echo get_option('argon_custom_assets_path', ''); ?>" autocomplete="off">
|
|
||||||
|
|
||||||
<p class="description"><?php _e('选择主题资源文件的引用地址。使用 CDN 可以加速资源文件的访问并减少服务器压力。', 'argon');?></p>
|
|
||||||
|
|
||||||
<p class="description custom-assets-path-desctiption"><?php _e('在自定义路径中使用 <code>%theme_version%</code> 来表示主题版本号。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
$("select[name='argon_assets_path']").change(function(){
|
|
||||||
|
|
||||||
if ($(this).val() == 'custom') {
|
|
||||||
|
|
||||||
$("input[name='argon_custom_assets_path']").css('display', '');
|
|
||||||
|
|
||||||
$(".custom-assets-path-desctiption").css('display', '');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$("input[name='argon_custom_assets_path']").css('display', 'none');
|
|
||||||
|
|
||||||
$(".custom-assets-path-desctiption").css('display', 'none');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}).change();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-date-format"><?php _e('日期格式', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('日期格式', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_dateformat">
|
|
||||||
|
|
||||||
<?php $argon_dateformat = get_option('argon_dateformat'); ?>
|
|
||||||
|
|
||||||
<option value="YMD" <?php if ($argon_dateformat=='YMD'){echo 'selected';} ?>>Y-M-D</option>
|
|
||||||
|
|
||||||
<option value="DMY" <?php if ($argon_dateformat=='DMY'){echo 'selected';} ?>>D-M-Y</option>
|
|
||||||
|
|
||||||
<option value="MDY" <?php if ($argon_dateformat=='MDY'){echo 'selected';} ?>>M-D-Y</option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 10. 文章显示 ========== -->'''
|
|
||||||
|
|
||||||
if old_seo_end in content:
|
|
||||||
content = content.replace(old_seo_end, new_seo_with_cdn_date)
|
|
||||||
print("✓ 在SEO与性能中添加了CDN加速和日期格式设置")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到SEO设置结束位置")
|
|
||||||
|
|
||||||
# 保存文件
|
|
||||||
with open('settings.php', 'w', encoding='utf-8') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
print(f"\n优化完成! 新文件: {content.count(chr(10))} 行")
|
|
||||||
print("请检查 settings.php 文件")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Settings.php 结构优化脚本 - 步骤3
|
|
||||||
完成以下任务:
|
|
||||||
1. 删除第685-792行之间错误的"顶栏设置"标题及其下的CDN/子目录/日期格式设置
|
|
||||||
2. 在基础设置中添加子目录设置
|
|
||||||
3. 创建新的"SEO 与性能"分类,包含SEO、CDN、日期格式
|
|
||||||
"""
|
|
||||||
|
|
||||||
def main():
|
|
||||||
# 读取文件
|
|
||||||
with open('settings.php', 'r', encoding='utf-8') as f:
|
|
||||||
content = f.read()
|
|
||||||
|
|
||||||
print("开始优化 settings.php (步骤3: 删除重复的顶栏设置并重组)...")
|
|
||||||
print(f"原始文件: {len(content)} 字符, {content.count(chr(10))} 行")
|
|
||||||
|
|
||||||
# 1. 删除第685-792行之间错误的"顶栏设置"及其下的CDN/子目录/日期格式设置
|
|
||||||
old_wrong_toolbar = ''' <!-- ========== 4. 顶栏设置 ========== -->
|
|
||||||
<tr><th class="subtitle"><h2 id="section-toolbar"><?php _e('顶栏设置', 'argon');?></h2></th></tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-toolbar-basic"><?php _e('基本设置', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label>CDN</label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_assets_path">
|
|
||||||
|
|
||||||
<?php $argon_assets_path = get_option('argon_assets_path'); ?>
|
|
||||||
|
|
||||||
<option value="default" <?php if ($argon_assets_path=='default'){echo 'selected';} ?>><?php _e('不使用', 'argon');?></option>
|
|
||||||
|
|
||||||
<option value="jsdelivr" <?php if ($argon_assets_path=='jsdelivr'){echo 'selected';} ?>>Jsdelivr</option>
|
|
||||||
|
|
||||||
<option value="fastgit" <?php if ($argon_assets_path=='fastgit'){echo 'selected';} ?>>Fastgit</option>
|
|
||||||
|
|
||||||
<option value="sourcegcdn" <?php if ($argon_assets_path=='sourcegcdn'){echo 'selected';} ?>>Source Global CDN</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_gcore" <?php if ($argon_assets_path=='jsdelivr_gcore'){echo 'selected';} ?>>Jsdelivr (gcore)</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_fastly" <?php if ($argon_assets_path=='jsdelivr_fastly'){echo 'selected';} ?>>Jsdelivr (fastly)</option>
|
|
||||||
|
|
||||||
<option value="jsdelivr_cf" <?php if ($argon_assets_path=='jsdelivr_cf'){echo 'selected';} ?>>Jsdelivr (cf)</option>
|
|
||||||
|
|
||||||
<option value="custom" <?php if ($argon_assets_path=='custom'){echo 'selected';} ?>><?php _e('自定义...', 'argon');?></option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<input type="text" class="regular-text" name="argon_custom_assets_path" placeholder="https://" value="<?php echo get_option('argon_custom_assets_path', ''); ?>" autocomplete="off">
|
|
||||||
|
|
||||||
<p class="description"><?php _e('选择主题资源文件的引用地址。使用 CDN 可以加速资源文件的访问并减少服务器压力。', 'argon');?></p>
|
|
||||||
|
|
||||||
<p class="description custom-assets-path-desctiption"><?php _e('在自定义路径中使用 <code>%theme_version%</code> 来表示主题版本号。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
$("select[name='argon_assets_path']").change(function(){
|
|
||||||
|
|
||||||
if ($(this).val() == 'custom') {
|
|
||||||
|
|
||||||
$("input[name='argon_custom_assets_path']").css('display', '');
|
|
||||||
|
|
||||||
$(".custom-assets-path-desctiption").css('display', '');
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$("input[name='argon_custom_assets_path']").css('display', 'none');
|
|
||||||
|
|
||||||
$(".custom-assets-path-desctiption").css('display', 'none');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}).change();
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-subdirectory"><?php _e('子目录', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('Wordpress 安装目录', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<input type="text" class="regular-text" name="argon_wp_path" value="<?php echo get_option('argon_wp_path', '/'); ?>"/>
|
|
||||||
|
|
||||||
<p class="description"><?php _e('如果 Wordpress 安装在子目录中,请在此填写子目录地址(例如', 'argon');?> <code>/blog/</code><?php _e('),注意前后各有一个斜杠。默认为', 'argon');?> <code>/</code> <?php _e('。', 'argon');?><br/><?php _e('如果不清楚该选项的用处,请保持默认。', 'argon');?></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr><th class="subtitle"><h3 id="subsection-date-format"><?php _e('日期格式', 'argon');?></h3></th></tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
<th><label><?php _e('日期格式', 'argon');?></label></th>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<select name="argon_dateformat">
|
|
||||||
|
|
||||||
<?php $argon_dateformat = get_option('argon_dateformat'); ?>
|
|
||||||
|
|
||||||
<option value="YMD" <?php if ($argon_dateformat=='YMD'){echo 'selected';} ?>>Y-M-D</option>
|
|
||||||
|
|
||||||
<option value="DMY" <?php if ($argon_dateformat=='DMY'){echo 'selected';} ?>>D-M-Y</option>
|
|
||||||
|
|
||||||
<option value="MDY" <?php if ($argon_dateformat=='MDY'){echo 'selected';} ?>>M-D-Y</option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<p class="description"></p>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- ========== 4. 顶栏设置 ========== -->'''
|
|
||||||
|
|
||||||
new_correct_toolbar = ''' <!-- ========== 4. 顶栏设置 ========== -->'''
|
|
||||||
|
|
||||||
if old_wrong_toolbar in content:
|
|
||||||
content = content.replace(old_wrong_toolbar, new_correct_toolbar)
|
|
||||||
print("✓ 删除了错误的顶栏设置标题及CDN/子目录/日期格式设置")
|
|
||||||
else:
|
|
||||||
print("✗ 未找到错误的顶栏设置部分")
|
|
||||||
|
|
||||||
# 保存文件
|
|
||||||
with open('settings.php', 'w', encoding='utf-8') as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
print(f"\n优化完成! 新文件: {len(content)} 字符, {content.count(chr(10))} 行")
|
|
||||||
print("请检查 settings.php 文件")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
141
privacy-policy.md
Normal file
141
privacy-policy.md
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
**更新日期:2026年1月22日**
|
||||||
|
**生效日期:2025年3月27日**
|
||||||
|
|
||||||
|
## 导言
|
||||||
|
|
||||||
|
欢迎访问 **编程小记**(blog.cartol.top,以下简称“本站”)。本站深知个人信息对您的重要性,并承诺依据《中华人民共和国个人信息保护法》《中华人民共和国网络安全法》等法律法规,采取合理、有效的安全保护措施,保障您的个人信息安全。
|
||||||
|
|
||||||
|
本政策旨在向您说明我们在您使用服务时如何收集、使用、保存及保护这些信息。**请您在使用本站评论功能前,仔细阅读并充分理解本政策。**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第一条 个人信息的收集与使用
|
||||||
|
|
||||||
|
本站仅基于以下目的收集和使用您的个人信息:
|
||||||
|
|
||||||
|
### 1.1 评论与互动
|
||||||
|
|
||||||
|
当您在本站发表评论时,需主动勾选同意本政策。为展示评论内容及回复通知,我们将收集您主动提供的:
|
||||||
|
|
||||||
|
* **昵称**(用于展示)
|
||||||
|
* **电子邮箱地址**(用于头像匹配、回复通知,**不公开显示**)
|
||||||
|
* **个人网站地址**(选填)
|
||||||
|
|
||||||
|
### 1.2 运行安全与日志
|
||||||
|
|
||||||
|
为履行《网络安全法》规定的日志留存义务,及防范恶意攻击,服务器会自动记录:
|
||||||
|
|
||||||
|
* IP 地址
|
||||||
|
* 浏览器的 User-Agent 信息
|
||||||
|
* 访问时间与请求记录
|
||||||
|
|
||||||
|
### 1.3 Gravatar 头像服务
|
||||||
|
|
||||||
|
本站使用 Gravatar 展示用户头像。为了获取您的头像,我们会将您的电子邮箱地址进行 **MD5 哈希加密处理**(生成的字符串无法逆向还原出邮箱),然后发送给 Gravatar 服务器进行匹配。
|
||||||
|
|
||||||
|
* Gravatar 隐私政策:[https://automattic.com/privacy/](https://automattic.com/privacy/)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第二条 Cookies 及同类技术
|
||||||
|
|
||||||
|
为提升访问体验,本站使用 Cookies 技术:
|
||||||
|
|
||||||
|
1. **评论记忆**:在您的浏览器中保存昵称、邮箱及网址(有效期一年),以便下次自动填充。
|
||||||
|
2. **偏好设置**:记录您的夜间模式、字体大小等设置。
|
||||||
|
|
||||||
|
您可通过浏览器设置拒绝 Cookies,但这可能导致您每次评论时都需要重新输入信息。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第三条 第三方服务与数据处理
|
||||||
|
|
||||||
|
为了提供更优质的服务(如加速访问、渲染公式),本站接入了部分第三方服务。
|
||||||
|
|
||||||
|
### 3.1 基础设施与 CDN(受托处理)
|
||||||
|
|
||||||
|
本站使用以下内容分发网络(CDN)服务以提升加载速度。您的 IP 地址及访问请求可能会经过这些服务商的节点,它们仅作为**受托处理者**提供传输服务:
|
||||||
|
|
||||||
|
* **多吉云 CDN**:静态资源加速
|
||||||
|
* **阿里云 ESA**:图床服务(img.api.cartol.top)
|
||||||
|
|
||||||
|
### 3.2 嵌入内容
|
||||||
|
|
||||||
|
文章中可能包含来自第三方平台(如 Bilibili、GitHub 等)的嵌入内容。
|
||||||
|
**特别提示**:访问此类嵌入内容等同于直接访问第三方网站,这些第三方平台可能会独立收集您的数据或使用 Cookies,请参阅其各自的隐私政策。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第四条 信息的存储与保护
|
||||||
|
|
||||||
|
### 4.1 存储地点
|
||||||
|
|
||||||
|
本站服务器位于**中国大陆**,由阿里云提供基础设施支持。本站已依法完成工信部 ICP 备案及公安联网备案,数据存储符合境内合规要求。
|
||||||
|
|
||||||
|
### 4.2 存储期限
|
||||||
|
|
||||||
|
* **评论数据**:为保留互动的上下文,评论内容将在本站运营期间长期保存,除非您请求删除。
|
||||||
|
* **日志数据**:网络日志将按法律规定留存不少于 6 个月。
|
||||||
|
|
||||||
|
### 4.3 安全措施
|
||||||
|
|
||||||
|
本站采用 HTTPS 加密传输、Web 应用防火墙(WAF)等技术措施,防止个人信息被非法访问、泄露或篡改。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第五条 信息的共享与披露
|
||||||
|
|
||||||
|
**本站不会将您的个人信息出售或出租给任何第三方。** 仅在以下情形下,我们可能会披露您的信息:
|
||||||
|
|
||||||
|
1. **反垃圾检测**:评论内容及 IP 可能被发送至自动化的反垃圾评论服务进行扫描。
|
||||||
|
2. **法律要求**:根据法律法规、司法机关或行政机关的强制性要求。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第六条 您的权利
|
||||||
|
|
||||||
|
根据《个人信息保护法》,您享有以下权利:
|
||||||
|
|
||||||
|
* **查阅与复制**:您可以查阅您发表的评论内容。
|
||||||
|
* **删除权**:如您希望删除已发布的评论,或发现我们违规处理您的信息,请联系我们要删除。
|
||||||
|
* **撤回同意**:您可以随时停止使用评论功能。
|
||||||
|
|
||||||
|
**行使方式**:请通过邮件发送请求至 [admin@mail.cartol.top](mailto:admin@mail.cartol.top)。为验证身份,我们可能需要您使用发表评论时的邮箱发送请求。我们将在 **15 个工作日** 内回复。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第七条 未成年人保护
|
||||||
|
|
||||||
|
本站主要面向成年用户。
|
||||||
|
|
||||||
|
1. **未成年人使用**:若您未满 18 周岁,请在监护人指导下访问本站。
|
||||||
|
2. **儿童保护**:本站**不主动收集**不满 14 周岁儿童的个人信息。若您是 14 周岁以下的儿童,请勿在评论中使用真实姓名或提供详细联系方式。
|
||||||
|
3. **监护人权利**:若监护人发现我们在未获同意的情况下收集了儿童信息,请联系我们,我们将尽快删除相关数据。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 第八条 政策更新与联系方式
|
||||||
|
|
||||||
|
### 8.1 政策更新
|
||||||
|
|
||||||
|
本政策可能随业务调整而更新,重大变更将通过网站公告通知。
|
||||||
|
|
||||||
|
### 8.2 联系我们
|
||||||
|
|
||||||
|
如有任何疑问或投诉,请联系:
|
||||||
|
|
||||||
|
* **电子邮箱**:[admin@mail.cartol.top](mailto:admin@mail.cartol.top)
|
||||||
|
|
||||||
|
### 8.3 外部监管投诉
|
||||||
|
|
||||||
|
如您认为本站侵犯了您的合法权益,可向以下机构举报:
|
||||||
|
|
||||||
|
* **中国互联网违法和不良信息举报中心**:[www.12377.cn](https://www.12377.cn)
|
||||||
|
* **广东省通信管理局**:020-12300
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 网站备案信息公示
|
||||||
|
|
||||||
|
* **ICP 备案号**:[粤ICP备2025392543号-1](https://beian.miit.gov.cn/)
|
||||||
|
* **公安联网备案号**:[粤公网安备44180202000805号](http://www.beian.gov.cn/portal/registerSystemInfo%3Frecordcode%3D44180202000805)
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
将评论相关设置从验证码与安全移到评论设置分类
|
|
||||||
"""
|
|
||||||
|
|
||||||
def find_line_with_text(lines, text):
|
|
||||||
"""查找包含指定文本的行号"""
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
if text in line:
|
|
||||||
return i
|
|
||||||
return -1
|
|
||||||
|
|
||||||
def reorganize():
|
|
||||||
with open('settings.php', 'r', encoding='utf-8') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
|
|
||||||
print(f"原始文件: {len(lines)} 行")
|
|
||||||
|
|
||||||
# 1. 找到关键位置
|
|
||||||
comment_section_start = find_line_with_text(lines, '<!-- ========== 16. 评论设置 ==========')
|
|
||||||
comment_submit_end = -1
|
|
||||||
|
|
||||||
# 找到"发送评论"子分类的结束位置
|
|
||||||
for i in range(comment_section_start, len(lines)):
|
|
||||||
if '<!-- ========== 16. 验证码与安全 ==========' in lines[i]:
|
|
||||||
comment_submit_end = i
|
|
||||||
break
|
|
||||||
|
|
||||||
# 找到"返回评论系统"的位置(评论功能开始)
|
|
||||||
comment_features_start = find_line_with_text(lines, '<!-- ========== 返回评论系统 ==========')
|
|
||||||
|
|
||||||
# 找到文件结束位置(保存按钮之前)
|
|
||||||
file_end = find_line_with_text(lines, '<input type="submit"')
|
|
||||||
|
|
||||||
print(f"评论设置开始: {comment_section_start + 1}")
|
|
||||||
print(f"发送评论结束: {comment_submit_end + 1}")
|
|
||||||
print(f"评论功能开始: {comment_features_start + 1}")
|
|
||||||
print(f"文件结束: {file_end + 1}")
|
|
||||||
|
|
||||||
# 2. 提取评论功能、AI垃圾评论识别、评论区外观部分
|
|
||||||
comment_features_content = lines[comment_features_start:file_end]
|
|
||||||
|
|
||||||
# 3. 删除"返回评论系统"注释,改为正常的子分类标题
|
|
||||||
new_comment_features = []
|
|
||||||
for line in comment_features_content:
|
|
||||||
if '<!-- ========== 返回评论系统 ==========' in line:
|
|
||||||
continue # 跳过这个注释
|
|
||||||
new_comment_features.append(line)
|
|
||||||
|
|
||||||
# 4. 重新组织文件
|
|
||||||
new_lines = []
|
|
||||||
|
|
||||||
# 添加评论设置之前的所有内容
|
|
||||||
new_lines.extend(lines[:comment_submit_end])
|
|
||||||
|
|
||||||
# 添加评论功能、AI垃圾评论识别、评论区外观
|
|
||||||
new_lines.extend(new_comment_features)
|
|
||||||
|
|
||||||
# 添加验证码与安全及之后的内容
|
|
||||||
new_lines.extend(lines[comment_submit_end:comment_features_start])
|
|
||||||
|
|
||||||
# 添加文件结束部分
|
|
||||||
new_lines.extend(lines[file_end:])
|
|
||||||
|
|
||||||
print(f"重组后: {len(new_lines)} 行")
|
|
||||||
|
|
||||||
# 写入文件
|
|
||||||
with open('settings.php', 'w', encoding='utf-8') as f:
|
|
||||||
f.writelines(new_lines)
|
|
||||||
|
|
||||||
print("✓ 完成:将评论功能、AI垃圾评论识别、评论区外观移到评论设置分类")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
reorganize()
|
|
||||||
Reference in New Issue
Block a user