Files
hesu-JT/docs/plans-audit-fix-acceptance.md
2026-08-27 11:54:26 +08:00

91 lines
5.7 KiB
Markdown
Raw Permalink 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.
# 交付前最终验收记录 — 批次 C+F(图片压缩 / 全量验收 / 重建交付包)
日期:2026-08-19 | 环境:`.test-env` SQLite 测试站(http://127.0.0.1:8090,PHP 内置服务器)| 结论:**全部通过,可交付**
---
## Part C — 图片压缩 + 清库重播
### C1 压缩统计(GD 原地重编码,`.test-env/compress.php`,不入库)
| 指标 | 数值 |
|---|---|
| 扫描(jpg+png) | 127 |
| 处理成功 | 47(jpg 46 + png 1) |
| 跳过 <100KB / logo.png / 小 png | 65 / 1 / 14 |
| 失败 / 压缩后反而变大回退 | 0 / 0 |
| 处理文件合计 | 20.83 MB → 4.18 MB(20.1%) |
| **主题 image/ 目录总大小** | **27.30 MB → 11.43 MB(-58%)** |
参数:jpg >1920w 等比缩 + `imagejpeg q78`;png >1600w 等比缩 + `imagepng 6`;全部临时文件写入后原子替换,校验输出有效性。
达标抽检:`home/banner.jpg` 908KB → 94.5KB(预期 <250KB ✓);`news/*` 230–692KB → 34–125KB。
**偏差项**:`home/global-map.png` 1.43MB → 1.28MB(仅 -8.8%,未达 <400KB 预期)。该图 73% 全透明 + 27% 半透明(GP 页叠加层地图,必须保 alpha 的 PNG);调色板量化实测 PSNR 10.4dB 且 alpha 被破坏(GD 的 palette PNG 仅二元透明),弃用。GD 约束下已是最优,遗留项见文末。
### C2 清库重播
| 步骤 | 结果 |
|---|---|
| 强删全部附件 | 96 个 |
| 清 uploads 年度目录(保留 hesu-backups/wpcf7_uploads) | ✓ |
| `delete_option(hesu_seeded)` + 重播 | ✓ |
| news 数 | 4 ✓ |
| **uploads 体积** | **124 MB → 17 MB**(新压缩图侧载) |
| hesu-backups 保留 | ✓(最新 json:pages 9 / news 4 / menus 2) |
---
## F1 — 审计修复项逐条验证(10/10 通过)
| # | 项 | 结果 | 实测 |
|---|---|---|---|
| 1 | H1 结构 | ✓ | news 详情 / about-us / news 列表页均 H1=1 |
| 2 | OG / JSON-LD | ✓ | 首页 og: 8 种(≥6)+ twitter:card=1;news 详情 ld+json 含 `"@type":"Article"`;RSS feed og=0 |
| 3 | lazy / preload | ✓ | building-materials:lazy=11、hero fetchpriority="high"×1、srcset=2;首页 preload banner=1 |
| 4 | CF7 收缩 | ✓ | 首页 contact-form-7 引用=0;/contact/ 表单正常(wpcf7×13) |
| 5 | emoji | ✓ | 首页 wp-emoji=0 |
| 6 | 业务 JS | ✓ | 首页仅 main.js + building-materials.js |
| 7 | news-grid alt | ✓ | 4 卡 alt=News1–4 非空;唯一空 alt 为装饰性 nw-hero__bg(合规) |
| 8 | 文案 | ✓ | settings-page.php 含"删除并重建";readme 无"15 篇" |
| 9 | 备份 | ✓ | hesu-backups 最新 json pages=9(news=4, menus=2) |
| 10 | screenshot.png | ✓ | 主题根存在(1200×900) |
## F2 — 全站回归(11 路由 + 交互抽查,全部通过)
路由 200:`/`、`/about-us/`、`/contact/`、`/development-history/`、`/global-presence/`、`/global-logistics/`、`/after-sales/`、`/auto-export/`、`/building-materials/`、`/news/`、`/news/<slug>/` —— 11/11 ✓
结构抽查:bp-cap×4 + bp-cap__label×4 ✓|au-gps__card×4 ✓|ct-map__info×2 ✓|nd- 结构(nd-article/body/figure/title/meta/nav)✓|Completed Delivery×1 ✓
Playwright 交互(5/5):
| 交互 | 结果 |
|---|---|
| 首页 stats 滚动计数 | ✓ 服务端输出 `15000`,渲染为 `15,000`(toLocaleString 证明 count-up 执行),4/4 触发 |
| 首页 network 拖拽 | ✓ 真实鼠标拖拽 translateX(-1134px)→(-1481px),按卡片步长吸附,克隆 12 卡 |
| GP 翻屏 | ✓ 滚轮 y 0→900→1800(5 屏),侧导航高亮 Middle East→Africa 联动 |
| CF7 空提交红校验 | ✓ 表单 invalid、6 字段红 tip(rgb(229,72,77))+ 红色汇总提示 |
| 移动端抽屉(390×844) | ✓ 开:main-nav open + backdrop + body 锁滚 + aria-expanded=true;backdrop 点击关:全部复位 |
控制台:首页 / global-presence / contact 均 0 error、0 请求失败。
## F3 — 重建 zip + 干净安装
| 项 | 结果 |
|---|---|
| zip 重建(tar -a,排除 .git) | **27 MB → 13.1 MB(13,084,014 字节,-52%)** |
| 干净安装(删 SQLite + uploads/2026 → core install + siteurl 修正 → CF7 → permalink → zip 装入激活) | ✓ |
| 安装后验证 | 首页 200 / Four Core Businessesk=1 / news=4 / ct-map__info-title=1 / og=9 / lazy=6 ✓ |
| 侧载健康 | 96 附件、0 重复 src、uploads 17MB(≈压缩前 124MB 的 14%) |
| junction 恢复 | ✓(PowerShell New-Item Junction),恢复后首页 200 |
安装过程共跑 3 轮:#1、#3 完全干净;#2 出现图片双份侧载(96→163 附件,66 个重复 src),根因为 seed 守卫"入口检查 hesu_seeded / 末尾置位"无跨进程锁——当时一个遗留的空闲浏览器标签在 seed 的 ~40 秒窗口内并发请求触发了第二次播种。单请求激活路径(生产场景:管理员一次点击激活)不受影响,两轮干净验证一致。已列遗留加固项。
---
## 遗留项(不阻塞交付)
1. **seed 并发加固**(建议下轮):`hesu_run_seed()` 入口守卫与 `update_option('hesu_seeded')` 之间无锁,激活播种窗口(~40s)内的并发请求会双份侧载图片。建议:入口先原子置位(如 `add_option` 幂等失败即退出)或加 transient 锁。生产单管理员激活流程不受影响。
2. **global-map.png**:GD 约束下仅 -8.8%(1.28MB,1600w truecolor+alpha)。如需 <400KB,需 pngquant 式带 alpha 量化(外部工具)或转 WebP(需改引用与兼容策略),超出本轮 GD 原地压缩边界。
3. **screenshot.png**(1.09MB,主题根):不在 image/ 压缩范围内;WP 会自动缩放展示,可下轮顺手压。
4. 主题 image/ 内若干与静态站根目录同名但静态侧已删除的文件按约定**全部保留**,待下一轮静态→主题同步时统一处理。