=== EzAlt AI – Automated Image SEO & Accessibility ===
Contributors: lidor132
Tags: seo, images, alt text, accessibility, ai
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically generate SEO-friendly and accessibility-focused alt text for WordPress images using AI.

== Description ==

**EzAlt AI** (by [Lidor Asulin](https://profiles.wordpress.org/lidor132/)) helps improve website SEO and accessibility by automatically generating descriptive alt text for images using AI.

All plugin features are included and fully functional. AI generation uses an external service with a free starter credit; optional credit packs add service quota — they do not unlock hidden plugin code.

**What makes EzAlt AI different:**

* Context-aware alt text — sends parent post title, content type, and taxonomy terms for sharper descriptions (e.g. WooCommerce products)
* Per-image generation from the Media Library attachment screen
* Purchase-intent routing so bought credits reach the correct WordPress site
* Idempotent API requests — retries never double-charge credits
* Background bulk processing via WordPress cron (no Action Scheduler required)

**Features:**

* Bulk optimize images missing alt text in your Media Library
* Generate alt text for a single image from the attachment edit screen
* Optional automatic alt text generation on image upload
* Real-time bulk progress bar
* Does not overwrite existing alt text
* Credits deducted only after successful generation

== External Services ==

This plugin relies on external services to generate alt text. By activating or using this plugin, you agree to the terms and privacy policies listed below.

= EzAlt Proxy API =

The plugin sends requests to the EzAlt proxy API hosted at **https://ezalt.ez-site.com**.

**Used for:** AI alt text generation, credit balance sync, and purchase-intent registration.

**Data sent and when:**

* **On alt text generation** (bulk, auto-upload, or Media Library button): base64-encoded image content (HTTPS), image filename, MIME type, site URL, Freemius install ID (when available), unique request ID, site language, and optional parent-post context (title, categories).
* **On credit sync** (admin dashboard load and periodic polling): site URL and Freemius install ID.
* **On “Buy Credits” click only** (before Freemius checkout opens): site URL, Freemius user ID, Freemius install ID (when available), and selected plan ID. No payment or card data is sent by the plugin.

**Service URL:** https://ezalt.ez-site.com/ezalt-api/

**Privacy Policy:** https://ezalt.ez-site.com/privacy-policy

**Terms of Service:** https://ezalt.ez-site.com/terms

= OpenRouter API (AI Image Analysis) =

Image data received by the EzAlt proxy is forwarded to OpenRouter, which routes requests to vision AI models (e.g. gpt-4o-mini) to produce descriptive alt text.

**Data sent:** Image content and generation parameters forwarded by the EzAlt proxy during alt text requests only.

**Service URL:** https://openrouter.ai

**Privacy Policy:** https://openrouter.ai/privacy

**Terms of Service:** https://openrouter.ai/terms

= Freemius (Checkout for Optional Credit Packs) =

Freemius handles checkout for optional one-time credit packs. Freemius is not required to use the plugin’s free starter credit or built-in features.

**Data sent:** Standard Freemius licensing/checkout data when you interact with credit purchase flows.

**Service URL:** https://freemius.com

**Privacy Policy:** https://freemius.com/privacy/

**Terms of Service:** https://freemius.com/terms/

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/ezalt-ai/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Open **Media → EzAlt AI**
4. Use your free starter credit or run bulk generation

== Frequently Asked Questions ==

= Is any feature locked behind a paid plan? =

No. Bulk generation, auto-upload, and Media Library generation are built in and work with the free starter credit. Optional credit packs add quota for the external AI service only (WordPress.org Guideline 6 serviceware).

= Does it generate alt text automatically on upload? =

Yes. Enable “Automatic generation on upload” under **Media → EzAlt AI**. Works with available credits — not gated by a license check.

= Does it overwrite existing alt text? =

No. Images that already have alt text are skipped.

= How do purchased credits reach my site? =

Click a Buy Credits button on **Media → EzAlt AI** before completing Freemius checkout. This registers a purchase intent so credits are applied to the correct site.

= Can I generate alt text for one image? =

Yes. Open an image in the Media Library and use the **Generate alt text** button in the EzAlt AI field.

= Does bulk generation require Action Scheduler or WooCommerce? =

No. EzAlt AI uses WordPress built-in cron.

= Are images sent to an external server? =

Yes. See the External Services section for full disclosure.

== Screenshots ==

1. EzAlt AI dashboard under Media menu
2. Credits remaining and missing alt count
3. Bulk generation progress bar
4. Per-image generate button in Media Library

== Changelog ==

= 1.2.8 =
* Fix Freemius bootstrap: load start.php directly; require require.php in vendor-prefixed
* Guard Freemius calls when SDK is unavailable

= 1.2.7 =
* Fix fatal error on activation: include missing Freemius require.php in vendor-prefixed/

= 1.2.6 =
* Fix credit purchase when Freemius opt-in was skipped (checkout uses site URL)
* Document thank-you redirect URL for Freemius (ezalt.ez-site.com)

= 1.2.5 =
* Fix credit purchase when Freemius opt-in was skipped — checkout uses site URL

= 1.2.4 =
* Deferred Freemius and plugin bootstrap to plugins_loaded to prevent activation output warnings

= 1.2.3 =
* Freemius SDK managed via Composer and loaded from prefixed vendor-prefixed/ path
* Webhook handler: Freemius HMAC verification, idempotency, server-authoritative credit sync
* Privacy/Terms URLs verified at https://ezalt.ez-site.com

= 1.2.2 =
* Moved admin page under Media menu (WordPress admin hierarchy best practice)
* Removed inline CSS; all styles enqueued via admin.css
* Added Media Library per-image generation
* Clarified Guideline 6 serviceware model: all features included, credits are external service quota
* Expanded External Services documentation in readme
* Auto-upload enabled by default for new installs (uses free starter credit)

= 1.2.1 =
* Rebranded to EzAlt AI
* Fixed credit delivery after Freemius checkout
* Improved admin error messages and automatic credit sync

= 1.2.0 =
* Purchase intent + webhook credit sync
* REST endpoint for server-push cache invalidation
* HMAC webhook verification

= 1.1.1 =
* Fixed credit balance sync after bulk processing

= 1.1.0 =
* Improved queue handling and API validation

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.2.8 =
Fixes fatal error on activation (Freemius require.php bootstrap).

= 1.2.7 =
Fixes Freemius SDK fatal error on plugin activation.

= 1.2.6 =
Fixes credit purchase flow and version alignment for WordPress.org review.

= 1.2.3 =
WordPress.org review fixes: text domain, Freemius dependency isolation, secure webhooks.

= 1.2.2 =
WordPress.org review compliance: Media submenu, full external services docs, Media Library integration.

= 1.2.1 =
Fixes credit delivery after Freemius purchases.
