The admin UI fires GET /api/image-optimizer/regenerate?collection=<slug>
shortly after every save. When the slug was not one of the plugin's
configured collections, the handler returned 400, producing false error
entries in Vercel/monitoring logs on every save of any non-target
collection.
- Endpoint: GET now returns 200 { configured: false, total:0, ... }
for unconfigured slugs. Missing ?collection= still returns 400.
POST/DELETE keep 400 (side-effectful).
- Client (defense in depth): RegenerationButton captures its mounted
slug and short-circuits fetchStats / pollProgress / loadStats when
the live URL no longer points at that slug. Lingering intervals are
cleared on drift. Treats configured:false as a stop signal.
- Tests: 6 endpoint tests + 6 unit tests for the slug guard helper.