Skip to content

Background queue, decorative detection, spending controls, content alt fill, output language - #2

Merged
howarddc merged 1 commit into
mainfrom
feature/content-alt-and-language
Sep 27, 2026
Merged

howarddc merged 1 commit into
mainfrom
feature/content-alt-and-language

Conversation

@howarddc

Copy link
Copy Markdown
Owner

Summary

  • Alt text in existing posts: empty alt attributes in post content are filled from the Media Library at render time (wp_content_img_tag, WP 6.0+). Posts aren't modified; author-written alt is never replaced. Setting: Existing posts (default on).
  • Output language: alt text and titles are written in the site language, the image's Polylang/WPML language, or a language chosen in Settings. New everyalt_output_locale filter.
  • Background queue: uploads and bulk jobs are queued (post meta, no custom table) and worked by WP-Cron and by any open EveryAlt page, so it works where WP-Cron is blocked. Atomic lock, retries at 1/5/30 min, pauses (without burning retries) on missing key or spending limit. "Generate for all N images" on bulk tabs. New uploads setting keeps the old synchronous mode available.
  • Decorative images: the model may answer DECORATIVE for clearly decorative images; alt stays empty on purpose (WCAG), image is flagged, excluded from bulk, shown in Review with Describe anyway.
  • Spending controls: per-month/per-model estimated spend on Logs; optional monthly limit pauses generation with an admin notice.
  • build.sh parses shields-escaped pre-release versions (e.g. 1.1.0-beta.1).

Testing

End-to-end in WordPress Playground (real WP, SQLite) with a stubbed AI provider:

  • Upload → 6 jobs queued → processed by the open admin page with WP-Cron unavailable
  • Divider image flagged decorative; photos described; titles generated
  • Language setting German → German output
  • $0.01 limit blocks the next request, pauses the queue, shows notice; removing it resumes automatically
  • Post render: empty alt filled, author alt kept, decorative stays empty, stored content unchanged
  • "Generate for all" via the UI

Not yet tested: real provider responses; WP-Cron on a normal host.

Test plan

  • Install the test ZIP on a real site and upload images with auto-generate on
  • Run "Generate for all" on a larger library, close the tab, confirm it finishes
  • Check spending on Logs against the provider dashboard

🤖 Generated with Claude Code

…t alt fill, and output language

- Fill empty alt attributes in post content from the Media Library at
  render time (wp_content_img_tag, WP 6.0+); posts are not modified and
  author-written alt text is never replaced.
- Generate alt text and titles in the site language, the attachment's
  Polylang/WPML language, or a language chosen in Settings
  (everyalt_output_locale filter).
- Background queue (post meta jobs, no custom table) worked by WP-Cron and
  by any open EveryAlt page, under an atomic lock. Retries with backoff;
  pauses without consuming retries when the key is missing or the spending
  limit is reached. Uploads queue by default ("immediate" still available).
  Bulk tabs gain "Generate for all".
- Decorative image detection: the model may answer DECORATIVE for clearly
  decorative images; alt is left empty on purpose, flagged, excluded from
  bulk, and shown in Review with "Describe anyway".
- Spending controls: per-month and per-model estimated spend on Logs,
  optional monthly limit that pauses generation with an admin notice.
- build.sh: parse shields-escaped pre-release versions from the README badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@howarddc
howarddc merged commit 842dc25 into main Sep 27, 2026
4 checks passed
@howarddc
howarddc deleted the feature/content-alt-and-language branch September 27, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant