=== AI Alt Text Generator (Gemini) ===
Contributors: criamente
Tags: alt text, accessibility, image, gemini, ai
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generates alt text for images automatically using Google Gemini AI. Supports manual generation, automatic on upload, and bulk processing.

== Description ==

AI Alt Text Generator uses the Google Gemini API to automatically describe images and fill the Alt Text field in the WordPress Media Library. Improve accessibility and SEO without typing a single description manually.

**Features:**

* Manual generation — button injected below the Alt Text field in the Media Library sidebar
* Auto-fill on upload — generates alt text as soon as an image is uploaded (optional, enable in settings)
* Bulk processing — select multiple images in list view and generate all at once with progress tracking
* Configurable prompt — customize the AI instruction to match your site's context and language
* Smart model detection — automatically selects the best available Gemini model for your account (cached 6h)
* Image optimization — resizes images before sending to reduce API token usage

**How it works:**

1. Install and activate the plugin
2. Go to Settings > Alt Text IA and enter your Google Gemini API key
3. Open any image in the Media Library and click the generate button

Alternatively, enable automatic generation in settings and every new image will receive an AI-generated description upon upload, including inside the Gutenberg block editor.

= External Service =

This plugin connects to the **Google Gemini API** (generativelanguage.googleapis.com) to analyze images and generate alt text descriptions. By using this plugin, image data is transmitted to Google's servers.

* This transmission occurs only when the user actively requests alt text generation, or when automatic generation is enabled in settings.
* No image data or personally identifiable information is collected or stored by the plugin developer.
* Usage is subject to the [Google Gemini API Terms of Service](https://ai.google.dev/terms) and [Google Privacy Policy](https://policies.google.com/privacy).

You must provide your own API key, obtained for free at [Google AI Studio](https://aistudio.google.com/app/apikey).

== Installation ==

1. Upload the `ai-alt-gemini` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the Plugins menu in WordPress
3. Navigate to **Settings > Alt Text IA**
4. Enter your Google Gemini API key (free at https://aistudio.google.com/app/apikey)
5. Optionally enable automatic generation on upload
6. Save settings

== Frequently Asked Questions ==

= Is this plugin free? =

Yes. The plugin is free and open source. You need a Google Gemini API key, which includes a free tier sufficient for most use cases.

= What happens to my images? =

Images are sent to the Google Gemini API for analysis. They are not stored or collected by this plugin or its developer. Please review Google's Privacy Policy for details on how Google processes image data.

= Can I customize the AI prompt? =

Yes. Go to Settings > Alt Text IA and edit the prompt field to change language, tone, length, or add specific context for your site.

= Does it work with the Gutenberg block editor? =

Yes. When automatic generation is enabled, the plugin monitors the block editor for new image uploads and fills the alt text attribute automatically after upload completes.

= Does it support bulk processing? =

Yes. Switch the Media Library to list view, select multiple images using the checkboxes, and choose "Gerar Alt Text com IA" from the bulk actions dropdown.

= Will it overwrite alt text I already wrote? =

Only if you click the generate button manually on a specific image. Automatic and bulk modes respect the "Skip images with existing alt text" toggle, which is enabled by default.

= Which Gemini model does it use? =

The plugin automatically calls the Gemini API to list available models and selects the best one compatible with your API key. The selected model is cached for 6 hours to avoid unnecessary API calls.

== Screenshots ==

1. Button injected below the Alt Text field in the Media Library sidebar
2. Settings page showing API key, prompt configuration, and auto-generation toggles
3. Bulk action progress panel with real-time log

== Changelog ==

= 2.0.0 =
* Added: automatic alt text generation on image upload (Gutenberg + classic uploader)
* Added: bulk action in Media Library list view with real-time progress panel
* Added: smart Gemini model auto-detection (cached 6 hours)
* Added: image resizing before API call to reduce token usage and cost
* Added: "Skip existing alt text" toggle for automatic and bulk modes
* Added: uninstall hook to clean up plugin options from database
* Added: privacy disclosure in settings page
* Improved: AJAX handler robustness and error messaging

= 1.0.0 =
* Initial release
* Manual alt text generation via button in Media Library
* Configurable prompt
* Settings page with API key field

== Upgrade Notice ==

= 2.0.0 =
Major update with automatic upload generation, bulk processing, and Gutenberg support. No breaking changes. Existing API keys and settings are preserved.

== Privacy Policy ==

This plugin transmits image data to the Google Gemini API (generativelanguage.googleapis.com) when alt text generation is triggered. Transmission occurs only upon explicit user action or when automatic generation is enabled in settings.

The plugin developer does not collect, store, or process any user data. All data handling by Google is governed by the Google Privacy Policy: https://policies.google.com/privacy
