Skip to content

Add AI model selection (GPT-5.4 nano, Gemini 3.1 Flash-Lite, DeepInfra) + review fixes - #1

Merged
howarddc merged 2 commits into
mainfrom
feature/model-switching
Sep 27, 2026
Merged

howarddc merged 2 commits into
mainfrom
feature/model-switching

Conversation

@howarddc

Copy link
Copy Markdown
Owner

Summary

Two commits:

1. Fixes from codebase review

  • Bundle plugin-update-checker into build.sh ZIPs (auto-updates were missing from built releases); build fails on version mismatch
  • Keep settings/API key on deactivate; delete all data on uninstall
  • "Auto-generate on upload" now defaults to on for fresh installs
  • Editors/Authors can use the block-editor and media buttons on images they can edit; errors are shown instead of swallowed
  • Auto-generation runs once per upload (after all sub-sizes exist)
  • 4MB limit applies to the resized image actually sent
  • Paginated, faster Bulk/Review tabs
  • Removed unused logs table, legacy HTTP-auth settings (plaintext password), and /get_tokens endpoint
  • Translatable JS strings, CSV formula-injection guard, warning when the stored key can't be decrypted
  • GitHub Actions lint/build workflow

2. AI model selection

  • Choose GPT-5.4 nano (OpenAI), Gemini 3.1 Flash-Lite (Google), or DeepSeek V4.1 Flash / GLM-5.3-Flash (DeepInfra)
  • gpt-5-nano (being retired) replaced by gpt-5.4-nano; existing installs switch automatically
  • Encrypted key per provider, validated before saving; one DeepInfra key covers both its models
  • Settings shows regular published pricing, key setup steps, and privacy notes (DeepInfra US/Canada hosting + zero retention, Gemini free-tier data use) with policy links
  • Model recorded in Logs and CSV export
  • everyalt_openai_model filter replaced by everyalt_model

Test plan

  • Generate alt text with a real key for each provider (OpenAI, Gemini, DeepInfra ×2)
  • Upload an image with auto-generate on; confirm one generation in Logs
  • Use the block-editor button as an Editor
  • Deactivate/reactivate keeps key; uninstall removes all options
  • ./build.sh ZIP contains vendor/plugin-update-checker

🤖 Generated with Claude Code

howarddc and others added 2 commits September 27, 2026 08:36
- Bundle plugin-update-checker (pinned v5.7) into build.sh ZIPs; vendor/
  is gitignored so auto-updates were missing from built releases. Build
  now fails if the header, constant, and README badge versions differ.
- Keep settings and API key on deactivate; delete all plugin data on
  uninstall (multisite-aware).
- Make "Auto-generate on upload" default to checked on fresh installs
  (the flag was only consumed by an endpoint nothing called).
- REST generate/save endpoints check edit_post on the attachment so
  Editors/Authors can use the block-editor and media buttons; surface
  errors in the block editor instead of swallowing them.
- Run auto-generation once per upload via wp_generate_attachment_metadata
  instead of on every updated_post_meta for each sub-size.
- Apply the 4MB limit to the resized image actually sent to OpenAI.
- Paginate Bulk/Review tabs; query alt via meta_query and scan titles
  with one lightweight SQL query instead of loading every attachment.
- Remove the unused every_alt_logs table writes, legacy fulltext and
  HTTP-auth settings (plaintext password), and /get_tokens endpoint;
  add a version-gated upgrade routine that deletes the old options.
- Make JS UI strings translatable, guard CSV export against formula
  injection, and warn when the stored key can no longer be decrypted.
- Add GitHub Actions lint/build workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New Every_Alt_Providers registry for OpenAI, Google Gemini, and
  DeepInfra (DeepSeek V4.1 Flash, GLM-5.3-Flash). All use OpenAI-
  compatible chat completions with a base64 image, so one request
  path serves every model.
- Replace retiring gpt-5-nano with gpt-5.4-nano; existing installs
  default to it on upgrade.
- Store an encrypted API key per provider; validate each new key
  against the provider's models endpoint before saving anything.
- Settings: model picker with published regular pricing, per-provider
  key instructions and links, Gemini free-tier data note, and DeepInfra
  privacy note (US/Canada hosting, zero data retention) with policy links.
- Per-provider request details: token parameter name, OpenAI-only
  image detail hint, DeepInfra 16k output cap, minimal reasoning.
- Record the model in the generation log and CSV export.
- Replace everyalt_openai_model filter with everyalt_model; price
  filters now receive the model slug.
- README: models & keys section, pricing, privacy, changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@howarddc
howarddc merged commit a78307e into main Sep 27, 2026
4 checks passed
@howarddc
howarddc deleted the feature/model-switching branch September 27, 2026 14:58
@howarddc howarddc mentioned this pull request Sep 27, 2026
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