Files
hesu-JT/docs/superpowers/plans/2026-08-15-acceptance-log.md
T
2026-08-27 11:54:26 +08:00

75 lines
6.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HESU WordPress 主题 — 全量验收日志(Task 13)
日期:2026-08-17
环境:WP 7.0.4 + SQLite + CF7 6.1.6(http://127.0.0.1:8090);静态对照站 http://127.0.0.1:8080
方法:Playwright 浏览器实测 + wp-cli + curl;截图/控制台记录在 `.playwright-mcp/`
结论:**20/20 项通过(含 8 项发现即修复)**,无结构性阻塞。修复清单见文末。
## A. 前端对照(A1-A12)
| # | 项目 | 结果 | 证据 |
|---|------|------|------|
| A1 | 首页 | 通过 | stats data-count 20/15,000/72/30 动画生效;bento 4 卡+banner;news 4 卡;reveal 12 处 |
| A1i | 轮播 | 通过 | network 12 卡/8 克隆、真实拖拽 -1774→-2321px;partner 自动轮播 2→0 + 3 圆点可点 |
| A2 | 建材 | 通过 | is-bp 浅色底;5 张 SVG 产品卡;`#products` 锚点 + view-more |
| A3 | 汽车出口 | 通过 | 4 个 bp-cap SVG 能力卡;ae-pulse 2.6s 标注 5 个;hover 静态站同样无 — 记录不改 |
| A4 | 售后改装 | 通过 | 与静态结构一致(同 A3 组件) |
| A5 | 物流 | 通过 | bp-stat 计数 1250/12/99/80(iconKey 修复后图标齐全) |
| A6 | 翻屏 | 通过 | wheel 每屏 889px;nav data-i 1-4 active 跟随;点击直达屏 4(3556px) |
| A7 | 关于 | 通过 | au-1 pin intro 淡出 1→0;au-3 zoom 1→2.2 + reveal 0→1;au-gps 3 卡自动播+圆点 |
| A8 | 时间线 | 通过 | 5 段/3 节点,与静态一致(静态即纵向折叠式) |
| A9 | 联系 | 通过 | 7 个可见 label;空提交 6 字段 invalid 红 #e5484d;OSM iframe 1265x460(src 修复后与静态逐字一致);select chevron + 按钮箭头桥接 |
| A10 | 新闻 | 通过 | tab → /news-cat/delivery-cases/ 高亮+过滤;分页 1/2/3/› → /news/page/2/;single 面包屑 Home/News;最新一篇无 next(正确) |
| A11 | Header/Footer | 通过 | Business mega 8 卡、About mega 4 卡;移动抽屉 14 链接;footer 5 列+社交+年份;contact 页 footer-contact 行(修复后) |
| A12 | 菜单高亮 | 通过 | bm/after-sales → Business 高亮;/news/ 仅 News(双高亮修复后) |
JS 隐藏内容检查:10 路由均服务端渲染完整内容(禁 JS 时不缺内容)。
## B. 后台流程(B13-B17)
| # | 项目 | 结果 | 证据 |
|---|------|------|------|
| B13 | 新闻流程 | 通过 | 新建 post 802 → 首页网格出现 + exhibition-info 归档 → 删除 → 两处消失 |
| B14 | Customizer | 通过 | tiktok 改 → footer href 生效;新闻 hero 改 → aboutus2 图;copyright 改 → footer 文案;全部还原 |
| B15 | CF7 | 通过(含 2 修复) | 停用 → 前端占位提示(修复后);激活 → 表单回归;删除表单 152 → 再激活 → 自动重建 803 "HESU Inquiry" + formId 写回 + 7 label 齐全 |
| B16 | 编辑角色锁定 | 通过(含 1 修复) | 见下详述 |
| B17 | meta description | 通过(补丁) | 9 页 + 新闻归档均有 `<meta name="description">`(wp_head 钩子;页面用 excerpt) |
### B16 详述(编辑角色锁定)
- 建号 acceptor_editor(editor 角色)登录,打开建材页块编辑器:
- **无插入器**:`editor-document-tools__inserter-toggle` display:none(lock.js CSS + allowed_block_types_all 收窄 hesu/* 双保险);强制点击无反应。
- **page-shell/子块选项菜单无 Delete / Move to Trash / Duplicate**:仅 Rename/Hide。
- **发现**:WP 7.0.4 对 editor 开放 Lock/Unlock 模态框,实测可解除实例锁后 Delete(templateLock:'all' 不回护已解锁子块)→ 已修复:`block_editor_settings_all` 强制 `canLockBlocks=false`(非管理员),工具栏变为禁用 "Locked" 指示器,Unlock 入口消失。
- **文字可改**:Business Introduction → +X → 保存 → DB + 前端生效 → 还原 → DB 干净。
- 测毕删号:`wp user delete acceptor_editor --reassign=1`,仅剩 admin。
## C. 质量项(C18-C20)
| # | 项目 | 结果 | 证据 |
|---|------|------|------|
| C18 | php -l | 通过 | 55 个 PHP 文件递归,0 语法错误 |
| C19 | 控制台 | 通过(含 1 修复) | 10 路由 0 error/0 warning(contact 的 OSM iframe LngLat 报错系 `&` 损坏,修复后归零) |
| C20 | 死链/404/字体 | 通过 | 28 个内链 curl 全 200;锚点 #business/#gp-2..5/#products/#inquiry/#top 全存在;7 个 woff2 全 200;垃圾 URL 404 |
## 修复清单(本轮验收产出)
1. **meta description**(B17):`inc/setup.php` 加 `hesu_meta_description()`(wp_head 优先级 5;singular 用 excerpt、fallback 首段 30 词;新闻归档/分类固定文案);`inc/seed.php` 9 页补 excerpt。
2. **首页 Learn More 链接**:post 704 内 `?page_id=712` → `/contact/`(DB 手术)。
3. **物流页 stat 图标缺失**:`hesu/stat` 增加 iconKey 白名单内联 SVG(block.json/render.php/index.js + helpers.js 提供 RawHTML + seed/markup.php 传 iconKey),重生成 708。
4. **联系页 footer-contact 行**:`inc/walker-mega.php` contact 页 intro 列补 Email/Tel(对齐静态 contact.html 178)。
5. **/news/ 双高亮**:walker-mega 祖先高亮跳过与顶级项同 URL 的子项。
6. **CF7 停用裸 shortcode**(spec §12.8 违规):`blocks/contact-form/render.php` 增加 `$cf7_active` 插件在位判断,缺插件时输出可见引导占位;`css/contact.css` 补 select chevron + 提交按钮箭头。
7. **编辑角色锁绕过**:`inc/blocks.php` 加 `block_editor_settings_all → canLockBlocks=false`(非管理员)。
8. **种子写入剥转义(本轮最重)**:`wp_insert_post/wp_update_post` 按已转义数据处理,直接传序列化区块会把 `&` 的 `&` 转义剥成 `u0026`(实锤:联系页 OSM iframe src 损坏 → Leaflet "Invalid LngLat" 控制台报错、静态站同 URL 无错)。修复:`inc/seed.php` 三处写入(页面内容二次填充、新闻插入、formId 写回)统一 `wp_slash()` + 前后 `kses_remove_filters()/kses_init_filters()`;DB 中 712 已修复,坏 revision 804/809 已删。
## 已接受的偏差(静态 vs WP,非缺陷)
- auto-export bp-viewmore 用 div、静态用 section(样式无差);新闻 tab 为 All+4 分类(WP 数据驱动,静态是 3 个 JS 过滤 tab);footer 当前页高亮(静态无);contact 提交在无邮件环境走 failed 状态(静态语义本就如此,sent 绿色态已用 class 切换验证)。
- Footer 的 Privacy/Terms/Sitemap 保持静态站的 `#top` 占位链接(spec §6 曾设想 Customizer 化;与静态站 1:1 一致优先,未实现——如需后续补,加 3 个 URL 设置即可)。
- contact-map 的 iframe URL 可配置(管理员可嵌任意 https 页面);如需收紧可加 OpenStreetMap 域白名单。
## 遗留项
- 无阻塞遗留。备注:编辑角色对文章内容的原始 REST 写入权限属 WordPress 角色模型本身,主题锁定目标(防误操作)已达成。