=== Alt Text BYOK ===
Contributors: deusacc
Tags: alt text, accessibility, ai, media library, seo
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically generate ALT text for your Media Library images with a vision AI model — bring your own API key (BYOK), no plugin subscription.

== Description ==

Images without ALT text are both an accessibility problem (screen readers) and an SEO problem. This plugin scans your Media Library, finds images with no ALT text and generates a description automatically, calling any vision-capable AI endpoint compatible with the OpenAI API (OpenAI itself, or any compatible provider — including providers with free tiers). One-click presets fill in the endpoint and a vision model for OpenAI, Anthropic (Claude), Google Gemini, Groq, OpenRouter, Mistral and Ollama (local, no API cost).

Features:

* A dedicated Media > Alt Text BYOK page listing every image without ALT text.
* Generate one image at a time, or all of them in sequence with one click.
* No cost for the plugin itself: you use your own API key and only pay (if at all) the provider you choose.
* Configurable ALT text language, or automatic: on multilingual sites it follows the WPML or Polylang language of the page the image belongs to.
* Option to regenerate images that already have ALT text.

BYOK (Bring Your Own Key): the plugin ships no API key of its own and does not act as a paid intermediary — a specific requirement of the WordPress.org policy on plugins that use external services, and at the same time the reason it costs less than subscription-based competitors.

= Free vs Full version =

This version is complete and has no usage limits: generate ALT text for as many images as you like, forever. [The full version](https://shop.lumnika.com/alt-text-byok.html) is a one-time payment (no subscription; the license key inside your download keeps it updated automatically) for sites that want more automation:

* ALT text generated automatically for every new image as soon as it is uploaded.
* Images sent inline (base64) instead of by URL, so it works on local, staging and password-protected sites the AI provider cannot reach.
* A WP-CLI command, `wp alt-text generate`, to process large libraries from the command line.
* WooCommerce: product images get the product name as context, for more precise ALT text.
* Page and SEO context: the title of the page the image is attached to, its Yoast SEO or Rank Math focus keyword and a meaningful file name go into the prompt.
* Background backlog: every existing image without ALT text is processed in hourly batches by WP-Cron, no browser tab to keep open; rate limits pause the queue and it resumes on its own.
* Optional title and caption: the generated text also fills an empty caption, and the title when it is still the file name.
* ALT text in existing posts: WordPress copies the ALT into a post only when the image is inserted, so pages published earlier keep an empty alt. The full version shows the Media Library ALT in those pages, and `wp alt-text sync-content` writes it into the posts (a revision keeps the previous version).

== External services ==

This plugin sends image data to the AI endpoint that you configure yourself in the settings (API base URL, API key and model). No request is sent anywhere until you enter your own credentials, and no data passes through any server belonging to the plugin author. Which provider receives the data, and under which terms and privacy policy, is entirely your choice — by default the plugin points at the OpenAI chat completions API (https://openai.com/policies/terms-of-use, https://openai.com/policies/privacy-policy).

== Installation ==

1. Upload the `alt-text-byok` folder to `/wp-content/plugins/`.
2. Activate the plugin from the WordPress Plugins menu.
3. Go to Settings > Alt Text BYOK and enter your API key (and, if you are not using OpenAI, your provider's URL and the model name).
4. Go to Media > Alt Text BYOK to generate the missing ALT texts.

== Frequently Asked Questions ==

= Do I need an OpenAI key specifically? =
No. Any endpoint compatible with the OpenAI "chat completions" API that supports images will work: just change "API base URL" and "Model" in the settings.

= Does the plugin send my images to a server of its own? =
No. Requests go directly from your site to the API provider you configured yourself.

= What happens to images that already have ALT text? =
They are skipped by default. You can include them by ticking "Overwrite existing ALT" in the settings.

= Is there a limit on the number of images? =
No. The only cost is what your AI provider charges you, if anything (several providers have free tiers).

= Which providers have a free tier with image (vision) support? =
At the time of writing: Google Gemini (free tier from Google AI Studio, OpenAI-compatible URL `https://generativelanguage.googleapis.com/v1beta/openai/`), Groq (free tier with Llama vision models, `https://api.groq.com/openai/v1/`), OpenRouter (models marked ":free", `https://openrouter.ai/api/v1/`) and Mistral (free experiment plan, `https://api.mistral.ai/v1/`). Ollama runs a vision model such as Gemma 3 or Qwen2.5-VL on your own machine at no cost (`http://localhost:11434/v1/`). Free tiers have rate limits: the plugin waits and retries on its own. Providers change their free offers, so check their pricing page.

= What is removed when I delete the plugin? =
Its settings, queue state and scheduled events. The ALT texts already written to your images stay, because they are your content.

= My site is local or password-protected and the provider can't load the images. =
By default the plugin sends the image URL. The full version can send the image data itself, which works wherever your site can reach the provider.

== Screenshots ==

1. Media > Alt Text BYOK lists every image in your Media Library that has no ALT text.
2. One click generates ALT text for all of them with your own AI provider (here Groq, a free tier); rate limits are waited out automatically.
3. Settings: pick a provider preset (OpenAI, Anthropic, Gemini, Groq, OpenRouter, Mistral, Ollama or any OpenAI-compatible endpoint), paste your own API key; ALT language follows your site (WPML/Polylang aware).

== Changelog ==

= 1.2.0 =
* Removed the monthly limit: this version is now unlimited.
* Internal: a single generation path shared by the bulk page and extensions.

= 1.1.1 =
* Bulk generation now waits and retries when the AI provider answers with a rate limit (common on free tiers) instead of failing the remaining images.
* Remaining admin messages translated to English.

= 1.1.0 =
* Added the free/full-version tier: 30 generations/month on the free version, unlimited in the full version (one-time purchase, no subscription).
* Fixed plugin header (Plugin URI, Author) and readme Contributors placeholder ahead of the WordPress.org submission.

= 1.0.0 =
* First release: BYOK ALT generation, bulk page, settings.
