# KSF 1.11 release acceptance

The regression suites run in DDEV with a disposable MySQL 8.0.35 database and
substitute the helper response. A separate opt-in live pass now exercises the
user-selected existing DDEV site and its configured, working image tool, including
real browser requests, file delivery, CSS regeneration, page caching and restoration.
See the live execution record below and [Live/readme.md](Live/readme.md).

| Requested pass | Automated evidence | Remaining acceptance |
| --- | --- | --- |
| Elementor pages and CSS files | `ImageOptimizerBuildersTest` plus live desktop/mobile browser checks: image widgets, background URLs, actual CSS regeneration and exact restored data/output; existing CSS remains until regeneration. | Elementor Pro widgets and other client-specific templates are outside the installed free-plugin sample. |
| GreenShift global styles/classes | Installed global CSS renderer and live pages verify custom CSS, global classes, nested responsive selectors, classes mirror and `_gspb_post_css` through optimize/restore. | Other client-specific blocks and presets. |
| Images used at smaller sizes | `ImageOptimizerReleaseTest` verifies 80×60/160×120 derivatives and srcset; live pages verify actual medium/smaller file delivery, MIME, dimensions, alt/caption/description, relationships and exact restoration at two viewport sizes. | The sampled sizes/crops passed; this does not enumerate every custom size used by other sites. |
| A real client site copy | The user selected the existing DDEV site for the live pass. It uses copies of 36 existing library assets and two representative pages with the installed builders, theme and normal site settings. | A full client's production theme/templates and complete page inventory are outside this representative local sample. |
| Caching/CDN plugins | WP Super Cache 3.1.4 installed temporarily: both pages return an actual cache HIT header; its CDN feature rewrites images to a local HTTPS alias, with all images returning HTTP 200 and `image/webp`. Manual purge/regeneration and restoration verified. Regression tests also cover object caches and configured CDN uploads URLs. | External CDN edge invalidation and other caching plugins are not covered by this local alias pass. |
| A large library run | Existing 105-image PHP, 205-row SQL and 1000-row JS regressions plus 120 live attachments from 36 existing assets, through the real browser/REST/helper pipeline: 111 optimized, 9 safely skipped; real tab interruption, connection-error stop, retry and continuation all verified. | This measured local run is not a capacity guarantee for arbitrarily large libraries or other hosting environments. |
| Uninstall | Existing journal-status/failure tests plus the real `uninstall.php` entry point after publication: originals, WebPs, links and journal survive, reinstall can restore. | Multisite network uninstall is not exercised by the single-site suite. |
| PHPUnit + JS suites on MySQL 8 | `bash tests/run.sh` verifies MySQL 8.0 and runs both PHPUnit configurations, Node batch tests and Jest editor tests in DDEV. JS uses DOM/fetch adapters or jsdom and does not itself query MySQL. | None after a successful runner exit. |

## Reproducible command

From the plugin directory with DDEV running:

```bash
docker compose -f tests/compose.yaml -f tests/compose.ddev.yaml up -d --wait mysql80
ddev exec -d /var/www/html/wp-content/plugins/kind-site-framework bash tests/run.sh
```

Do not run PHPUnit suites concurrently against `ksf_tests`. The builder suite
loads installed plugins rather than mock builder implementations. It fails if
they are missing. External builder services are disabled during these tests.

## Staging completion procedure

1. Identify the client clone and record WordPress, PHP, MySQL, builder, theme,
   caching plugin and CDN versions. Take a database/files snapshot and retain originals.
2. Pick JPEG/PNG images reused in Elementor backgrounds/widgets, GreenShift global
   classes/styles, normal content and smaller-size/srcset references. Record attachment
   IDs, URLs, dimensions, bytes, alt text, captions, descriptions and page screenshots
   at desktop/mobile widths.
3. Prime the actual page/object/CDN caches. Optimize the selection using the real
   helper. Regenerate Elementor CSS and clear all configured caches manually.
   Inspect page HTML, linked CSS and browser network responses: expected WebP URLs
   return HTTP 200 and `image/webp`, displayed dimensions/crops and media details
   remain correct. Record before/after file bytes and visual review results.
4. Restore the selection with replacement files retained while cached content/CSS
   may still reference them. Regenerate CSS and purge caches again; verify original
   URLs, files and metadata. Exercise optional deletion on an isolated sample after
   accounting for cache behavior. Arbitrary foreign CDN hosts are not automatically
   mapped unless they are the configured uploads base URL.
5. Run a documented large selection through the real helper. Record library size,
   duration, failures/skips and savings. Interrupt the browser, inject a helper
   outage, continue/retry/recover as applicable, and verify no image is broken.
6. On the disposable clone, uninstall with active replacements and verify served
   images/files remain usable. Reinstall and restore. Check that an empty replacement
   journal can be removed on uninstall. Keep evidence and release sign-off with the task.

## Execution record

2026-10-16: the documented DDEV command completed with exit code 0.

Environment: WordPress 7.0.1, PHP 8.3.25, MySQL 8.0.35, Node 22.19.0,
PHPUnit 9.6.38, Elementor 4.1.5, GreenShift 13.1.2.

| Suite | Result |
| --- | --- |
| Main PHPUnit | 357 tests, 6,742 assertions; passed (87.191 s) |
| Installed builder integrations | 2 tests, 52 assertions; passed (1.062 s) |
| Node batch bundle | 18 tests; passed, none skipped |
| Jest Reviewed editor | 17 tests; passed |

The initial 352-test PHP suite also passed on the existing DDEV MariaDB 10.11
service before changes. The final release run above uses MySQL 8.0.35.
Expected failure-injection SQL diagnostics appear in the log; they are asserted
rollback scenarios. The final run has no failed tests or PHP deprecation notices.
The local console log is `/tmp/ksf-release-final-20261016.log` (not committed).

The pre-existing Reviewed Jest tests expected a thumbnail-based interface absent
from the current component. They now exercise the current linked-name/date output,
explicit/default reviewer selection, automatic blog reviews, failures and request
cancellation. No production component or optimizer code was changed.

## Live execution record — current DDEV and configured image tool

2026-10-16, user-approved target: `https://wp-dev.ddev.site`.
Environment: the existing WordPress 7.0.1 installation, PHP 8.3.25, MariaDB 10.11,
Elementor 4.1.5, GreenShift 13.1.2 and Twenty Twenty-Five. The configured helper is
`http://kind-image-tool-nginx-1`; its existing authentication key is used internally
and is not written to the test reports. Browser checks use real Chromium at
1100×820 and 390×820.

- Created 120 copied attachments from 36 existing JPEG/PNG/WebP assets, including
  photos, screenshots, logos, 72–200 px images and WebPs larger than 1 MB. Generated
  normal WordPress sizes. The first six are reused by image widgets, an Elementor
  background, GreenShift custom CSS, global classes/responsive selectors and a
  featured image on two representative pages.
- Six-image pilot: all six optimized through the actual admin interface and helper.
  Browser checks verified HTTP 200, `image/webp`, loaded natural dimensions,
  unchanged displayed dimensions and alt text, and correct computed backgrounds.
  Desktop/mobile before-and-after screenshots were inspected; no obvious layout
  or visual problems were observed in this sample.
- Library pass: **111 optimized, 9 skipped, 0 final failures, 0 pending journals**.
  All nine skips were `size_increased`; originals and metadata were preserved.
  Main-file bytes decreased **19,134,829 → 9,899,326**, saving **9,235,503 bytes
  (48.27%)**. These figures exclude generated size files. The library browser phase
  took approximately 215 seconds, including interruption, the injected outage and
  retry; this is a local observation, not a throughput guarantee.
- Closed a processing browser tab after two confirmed responses: an already
  accepted PHP request completed, leaving three completed images and no stuck
  pending journal. Reopened the remaining selection.
- Temporarily directed the configured helper URL to a closed local port. Three real
  connection errors stopped the queue. Restored the helper URL, retried those rows
  and continued the remaining selection successfully. The completed batch pages
  reported no JavaScript errors.
- Temporarily installed **WP Super Cache 3.1.4** in simple/PHP mode. Both anonymous
  pages returned `X-WP-Super-Cache: Served supercache file from PHP`. Its CDN
  rewriting served all 6 Elementor and 7 GreenShift/featured image elements from
  `https://127.0.0.1:44622` with HTTP 200 and `image/webp`. This tests real plugin
  rewriting and HTTP delivery through a local alias, rather than external CDN edges.
- Restored all **111 active replacements** through the actual browser interface.
  All 120 attachments then had their original metadata and file bytes, and the
  replacement journal was empty. Following manual CSS regeneration/cache purge,
  original image URLs, computed backgrounds, displayed dimensions and alt text
  matched both desktop/mobile baselines. Elementor JSON, page content and GreenShift
  post CSS also restored exactly. All four restored PNG screenshots are byte-for-byte
  identical to their pre-optimization counterparts.
- A supplemental isolated real-helper round trip verified that **6 retained WebP
  URLs** (full file and sizes) still returned HTTP 200, `image/webp` and the exact
  on-disk bytes after restoration, before removing that sample.
- Removed test attachments/pages/user and restored temporary GreenShift settings.
  Cleanup verified **459 original post rows and 149 original library files unchanged**.
- Removed the temporary cache plugin and restored wp-config.php/cache drop-ins from
  their saved copies. Restored the pre-test database snapshot to remove incidental
  plugin options/transients. Final checks: **51 original attachments, 0 journal rows,
  0 temporary users, WP_CACHE disabled, temporary cache plugin absent, site HTTP 200**.
  The configured helper remains reachable; its unauthenticated root rejects requests
  with HTTP 401 as expected.

| Pilot source attachment | Original bytes | WebP bytes | Saving |
| --- | ---: | ---: | ---: |
| 780, hero JPEG | 298,712 | 106,352 | 64.40% |
| 792, photo JPEG | 524,283 | 388,938 | 25.82% |
| 809, PNG poster | 100,784 | 24,486 | 75.70% |
| 782, PNG logo | 9,944 | 4,582 | 53.92% |
| 781, large WebP | 1,343,194 | 1,058,652 | 21.18% |
| 913, 88×88 PNG icon | 4,484 | 594 | 86.75% |

Local screenshots and JSON measurements are in
`/tmp/ksf-live-artifacts-20261016/`. The original database snapshot is
`ksf-live-before-20261016`. Private state/configuration copies were kept in the
container's `/tmp/ksf-live-release-20261016/` during the run; snapshot restoration
recreated the web container and removed that temporary directory. The console logs
use `/tmp/ksf-live-*.log` on the host; the final successful retained-file check is
`/tmp/ksf-live-retention-check.log`.
