=== AI Featured Image Generator ===
Contributors: amr267, freemius
Donate link: https://buymeacoffee.com/unclegold
Tags: image generator, featured image, auto featured image, openai, gemini
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.8.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

One-click AI featured images using OpenAI, Stability AI, or Grok. Pro adds Gemini, upscaling, background removal & unlimited bulk.

== Description ==

**AI Featured Image Generator** lets you create AI-powered featured images right from the WordPress editor. Hit "Generate Featured Image" on any post, and the plugin uses your chosen AI provider — OpenAI, Stability AI, or Grok/xAI (all free), or Google Gemini (Pro) — to generate a unique image based on your post title, chosen style, and an optional custom prompt. You can also choose whether to allow text on the generated image or keep it text-free.

Every generated image automatically gets alt text set in the WordPress media library — improving SEO and accessibility without any extra work. You can configure the alt text source (post title, prompt, or a custom template with placeholders like `{title}`, `{style}`, and `{site_name}`), or turn it off entirely from the General settings tab.

Free users get a Bulk Generate tab to create featured images for up to 5 posts per batch (50 images lifetime). Pro users unlock unlimited bulk generation, advanced filters, Gemini support, image upscaling, background removal, and an AI Image Generator block for adding inline images directly inside the Gutenberg editor. Everything is managed from one settings hub.
= Video Walkthrough =

https://youtu.be/kqdq8qwrdXY

= Free Features =

* **4 AI Providers**: Choose from OpenAI, Stability AI, and Grok/xAI — all available on the free plan. Google Gemini is Pro only
* **OpenAI Integration**: Generate images using OpenAI's image generation API
* **Multiple AI Models (OpenAI)**: Choose from GPT Image 2 (newest, default), ChatGPT Image Latest (auto-updated), GPT Image 1.5, GPT Image 1 (Standard), and GPT Image 1 Mini (budget-friendly). GPT Image 2 excels at text rendering, visual reasoning, and complex multi-object scenes
* **Stability AI Integration**: Generate images using Stability AI's Stable Image Core model — great for photorealistic and artistic images
* **16 Stability Style Presets**: Native API-level style presets including Photographic, Cinematic, Anime, Digital Art, Comic Book, Fantasy Art, 3D Model, Analog Film, Enhance, Isometric, Line Art, Low Poly, Neon Punk, Origami, Pixel Art, and Tile Texture
* **Grok / xAI Integration**: Generate images using Grok Imagine Image — the fastest and most affordable option at just $0.02 per image
* **Custom Prompts**: Fine-tune results with your own prompt input
* **Generate Prompt from Content**: One click generates an AI-optimized image prompt from your post title and body — no manual writing needed. Works with OpenAI and Grok (free) and Google Gemini (Pro). The generated prompt is saved to the post and pre-filled in the Custom Prompt field so you can review or edit it before generating the image
* **13 Style Presets**: Common (None, Realistic, Artistic, Cartoon, Minimalist) and Creative (Sketch, Watercolor, 3D Render, Pixel Art, Cyberpunk, Fantasy, Anime, Technicolor)
* **7 Image Sizes (OpenAI, GPT Image 2)**: Square 1024x1024, Portrait 1024x1536, Landscape 1536x1024, Widescreen 1792x1024 (16:9), Vertical 1024x1792 (9:16), Ultra-wide 1920x640 (3:1), and Tall Banner 640x1920 (1:3). Older OpenAI models support the first three sizes.
* **3 Aspect Ratios (Stability AI, free)**: 1:1, 16:9, and 9:16
* **3 Aspect Ratios (Grok, free)**: 1:1, 16:9, and 9:16
* **Output Formats (OpenAI)**: WebP (default), PNG, or JPEG
* **Output Format (Stability AI)**: PNG (default)
* **Output Format (Grok)**: PNG (default)
* **Output Compression (OpenAI)**: File-size slider from 1–100 for WebP/JPEG output (PNG is lossless)
* **Generation Quality (OpenAI)**: Low, Medium, or High — trade speed/cost against output detail
* **Transparent Backgrounds (OpenAI, GPT Image 2)**: Generate PNGs with no background for logos, product shots, and compositing
* **Moderation Control (OpenAI, GPT Image 2)**: Choose between auto (standard filtering) and low (for approved accounts that need relaxed moderation)
* **Text Rendering (OpenAI, GPT Image 2)**: Generates clear, correctly spelled text inside images across multiple languages — ideal for banners, quotes, and labelled diagrams
* **Visual Reasoning (OpenAI, GPT Image 2)**: Processes prompts logically before generating, improving accuracy for complex or multi-step scene descriptions
* **Multi-object Scenes (OpenAI, GPT Image 2)**: Handles detailed environments with multiple subjects without objects overlapping or merging incorrectly
* **High Resolution (OpenAI, GPT Image 2)**: Supports up to 4K output and 7 flexible aspect ratios including widescreen (16:9), vertical (9:16), ultra-wide (3:1), and tall banner (1:3)
* **Mask-based Editing (OpenAI, GPT Image 2)**: GPT Image 2 supports precise, mask-based image editing for targeted changes — enabling you to modify specific areas while leaving the rest intact
* **Text Control**: Allow or disallow text, captions, or words in generated images
* **Auto Alt Text**: Automatically sets alt text on all AI-generated images for better SEO and accessibility. Choose from post title, generation prompt, or a custom template with `{title}`, `{prompt}`, `{style}`, and `{site_name}` placeholders. Option to preserve manually edited alt text when regenerating images
* **SEO-Friendly Filenames**: Images use your post title for better organization and SEO
* **Bulk Generate (Limited)**: Up to 5 posts per batch, 50 images lifetime, filtered by post status. Includes option to auto-generate a prompt from each post's content before image creation
* **Generate from Post List**: A new "AI Featured Image" column on the Posts/Pages admin list shows the current featured-image thumbnail and a one-click `Generate Image` / `Regenerate Image` link — create or replace featured images for any post without opening it in the editor. The prompt is auto-built from the post title and content, and all your global provider, style, size, and format settings are respected. Does not count against the free bulk-generation limit.
* **Multisite Support**: Fully compatible with WordPress multisite

= Pro Features 🚀 =

* **Google Gemini Support**: Access Google's AI image generation with multiple models: Nano Banana (Gemini 2.5 Flash), Nano Banana 2 Preview (Gemini 3.1 Flash, higher resolutions), and Nano Banana Pro (Gemini 3 Pro, premium quality)
* **Image Upscaling (Stability AI)**: Upscale your existing featured image using Stability AI with three modes — Conservative (faithful 4x upscale), Creative (AI-enhanced 4K), and Fast (quick 4x). Accessible directly from the post editor
* **Background Removal (Stability AI)**: One-click background removal on your existing featured image, powered by Stability AI. Saves the result as a new PNG attachment and sets it as the featured image
* **Stability AI Advanced Models**: Stable Image Ultra (best quality), SD 3.5 Large, SD 3.5 Large Turbo (fast), SD 3.5 Medium, SD 3.5 Flash, SD 3 Large, SD 3 Large Turbo, SD 3 Medium, and SDXL 1.0 (legacy)
* **Negative Prompts (Stability AI)**: Describe elements to exclude from generated images — e.g. "blurry, watermark, text, low quality"
* **Stability AI Output Format (Pro)**: Choose PNG, JPEG, or WebP for Stability AI generated images
* **9 Aspect Ratios (Stability AI)**: 1:1, 16:9, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, and 9:21
* **Grok Imagine Image Pro**: Higher quality Grok model at $0.07 per image
* **9 Aspect Ratios (Grok)**: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, and 1:2
* **Grok 2K Resolution**: Generate higher resolution images with Grok for sharper results
* **Bulk Generate (Unlimited)**: Generate for hundreds of posts at once with filters for post type, status, date range, and thumbnail status. Select individual posts or all, with real-time progress tracking. Option to auto-generate a content-based prompt for each post before image creation — prompts are saved to each post for review
* **Gutenberg Block**: Add AI-generated inline images anywhere in your content using the AI Image Generator block
* **Custom Post Types**: Enable image generation for any custom post type, not just posts and pages
* **10 Aspect Ratios (Gemini)**: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
* **Higher Resolutions (Gemini)**: Up to 4K with supported Gemini models
* **Custom Styles**: Create named styles with custom prompt descriptions that appear in all style dropdowns
* **Inline Image Settings**: Dedicated tab for configuring defaults for inline images per provider

Want to unlock Google Gemini AI, image upscaling, background removal, unlimited bulk generation, inline image generation and more? <a href="https://checkout.freemius.com/plugin/22299/plan/37317/licenses/1/">Upgrade to Pro here</a>.

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher
* At least one AI provider API key:
  * OpenAI API key (free plan)
  * Stability AI API key (free plan) — get one at [platform.stability.ai](https://platform.stability.ai/account/keys)
  * Grok/xAI API key (free plan) — get one at [console.x.ai](https://console.x.ai/)
  * Google Gemini API key (Pro plan only)

== External Services ==

This plugin connects to external AI services to generate AI-powered images for your WordPress posts and pages. Free users can choose between OpenAI, Stability AI, and Grok/xAI for featured image generation. Pro users can also use Google Gemini, and can generate both featured images and inline images using the Gutenberg block editor. Stability AI is additionally used by Pro users for image upscaling and background removal.

**OpenAI Service (Free & Pro)**

When using OpenAI as your provider:
- Your post title and content are sent to OpenAI's API when you generate a featured image
- When generating inline images (Pro), your custom prompt is sent to the API
- Any custom prompt you provide is sent to the API
- Your OpenAI API key is used for authentication with each request
- Image generation requests are sent to OpenAI's servers when you click the "Generate Featured Image" button or generate inline images using the Gutenberg block
- When using "Generate Prompt from Content", your post title and body are sent to OpenAI's chat API (gpt-4o-mini) to generate an image prompt

Service Provider: OpenAI
- [Terms of Service](https://openai.com/policies/terms-of-use)
- [Privacy Policy](https://openai.com/policies/privacy-policy)
- [API Documentation](https://platform.openai.com/docs)

**Google Gemini Service (Pro only)**

When using Google Gemini as your provider:
- Your post title and content are sent to Google's Gemini API when you generate a featured image
- When generating inline images, your custom prompt is sent to the API
- Any custom prompt you provide is sent to the API
- Your Google Gemini API key is used for authentication with each request
- Image generation requests are sent to Google's servers when you click the "Generate Featured Image" button or generate inline images using the Gutenberg block
- When using "Generate Prompt from Content" (Pro), your post title and body are sent to Google's Gemini API (Gemini 2.5 Flash) to generate an image prompt

Service Provider: Google AI (Gemini)
- [Terms of Service](https://ai.google.dev/gemini-api/terms)
- [Privacy Policy](https://policies.google.com/privacy)
- [API Documentation](https://ai.google.dev/gemini-api/docs)

**Stability AI Service (Free & Pro)**

When using Stability AI as your provider:
- Your post title and content are sent to Stability AI's API when you generate a featured image
- When generating inline images (Pro), your custom prompt is sent to the API
- Any custom prompt or negative prompt you provide is sent to the API
- Your Stability AI API key is used for authentication with each request
- Image generation, upscaling, and background removal requests are sent to Stability AI's servers

Pro users can also use Stability AI's upscale and background removal tools — these send your existing featured image file to Stability AI's servers for processing.

Service Provider: Stability AI
- [Terms of Service](https://stability.ai/terms-of-service)
- [Privacy Policy](https://stability.ai/privacy-policy)
- [API Documentation](https://platform.stability.ai/docs/api-reference)

**Grok / xAI Service (Free & Pro)**

When using Grok as your provider:
- Your post title and content are sent to xAI's API when you generate a featured image
- When generating inline images (Pro), your custom prompt is sent to the API
- Any custom prompt you provide is sent to the API
- Your xAI API key is used for authentication with each request
- Image generation requests are sent to xAI's servers when you click the "Generate Featured Image" button or generate inline images using the Gutenberg block
- When using "Generate Prompt from Content", your post title and body are sent to xAI's chat API (grok-3-mini) to generate an image prompt

Service Provider: xAI (Grok)
- [Terms of Service](https://x.ai/legal/terms-of-service)
- [Privacy Policy](https://x.ai/legal/privacy-policy)
- [API Documentation](https://docs.x.ai/docs)

**Data Usage:**
- Your post content and prompts are processed by the selected AI provider's models to generate images
- Generated images are stored in your WordPress media library
- No personal data is stored by the providers beyond what's necessary for API processing
- You are responsible for ensuring your content complies with the selected provider's usage policies

== Installation ==

1. Upload the `ai-featured-image-generator` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to AI Image in the admin menu to configure your API key and other settings
4. For Pro users: The AI Image Generator block is available in the Gutenberg block inserter

== Frequently Asked Questions ==

= Do I need an API key? =

Yes, you need an API key for at least one of the supported providers. All free-plan providers have free tiers or pay-as-you-go pricing:

- **OpenAI**: Sign up at [OpenAI's Platform](https://platform.openai.com/api-keys)
- **Stability AI**: Sign up at [platform.stability.ai/account/keys](https://platform.stability.ai/account/keys)
- **Grok / xAI**: Sign up at [console.x.ai](https://console.x.ai/)
- **Google Gemini (Pro only)**: Get an API key at [Google AI Studio](https://aistudio.google.com/app/apikey)

= How much does it cost? =

The plugin itself is free, but you pay for API usage directly with your chosen provider (pay per image):

- **OpenAI**: Pricing varies by model. GPT Image 1 Mini is the most cost-effective; see [OpenAI pricing](https://openai.com/api/pricing/)
- **Stability AI**: Stable Image Core costs credits (roughly ~$0.003/image). Stable Image Ultra and SD 3.5 models vary; see [Stability AI pricing](https://platform.stability.ai/pricing)
- **Grok / xAI**: Grok Imagine Image costs $0.02/image. Grok Imagine Image Pro (Pro plan) costs $0.07/image
- **Google Gemini (Pro only)**: Gemini 2.5 Flash uses 1290 tokens per image; Gemini 3.1 Flash and Gemini 3 Pro vary by resolution (1K/2K/4K)

= Can I switch between providers? =

Yes! All users can switch between OpenAI, Stability AI, and Grok/xAI. Pro users can also switch to Google Gemini. Simply go to AI Featured Image in the admin menu, select your preferred provider, and enter the appropriate API key. The settings page automatically shows only the relevant options for your selected provider.

= Is there a limit to how many images I can generate? =

The limit depends on your API plan and quota with your chosen provider. The plugin generates one image per request.

= What AI models are available? =

**OpenAI (Free & Pro):**
- ChatGPT Image Latest: Always points to the newest ChatGPT image model, so you automatically get improvements
- GPT Image 1.5: Strong quality and accurate text, cheaper and faster than GPT Image 1
- GPT Image 1 (Standard): Premium option for highest quality and finer style control
- GPT Image 1 Mini: Fastest and most cost-effective option

**Stability AI (Free: Core only; Pro: all models):**
- Stable Image Core (free): Best value, fast and high quality
- Stable Image Ultra (Pro): Best overall quality
- SD 3.5 Large (Pro): High detail, large model
- SD 3.5 Large Turbo (Pro): Fast version of SD 3.5 Large
- SD 3.5 Medium (Pro): Balanced quality and speed
- SD 3.5 Flash (Pro): Fastest SD 3.5 model
- SD 3 Large (Pro): Previous generation, large model
- SD 3 Large Turbo (Pro): Fast SD 3 Large
- SD 3 Medium (Pro): Previous generation, medium model
- SDXL 1.0 (Pro, legacy): Legacy model

**Grok / xAI (Free: Standard; Pro: both):**
- Grok Imagine Image (free): Fast and affordable at $0.02/image
- Grok Imagine Image Pro (Pro): Higher quality at $0.07/image

**Google Gemini (Pro only):**
- Gemini 2.5 Flash Image: Fixed resolutions per aspect ratio, 1290 tokens per image, supports all 10 aspect ratios
- Gemini 3.1 Flash Image Preview: Higher resolution support (1K/2K/4K), supports all 10 aspect ratios
- Gemini 3 Pro Image Preview: Best quality, multiple resolution options (1K/2K/4K), supports all 10 aspect ratios

= What styles are available? =

The plugin supports 13 built-in artistic styles (works with all providers):
- None: No specific style applied
- Realistic: Photographic, lifelike images
- Artistic: Painterly, artistic interpretations
- Cartoon: Animated, cartoon-style images
- Sketch: Detailed sketch drawings
- Watercolor: Beautiful watercolor paintings
- 3D Render: High-quality 3D rendered images
- Pixel Art: Retro pixel art style
- Cyberpunk: Vibrant cyberpunk aesthetic
- Fantasy: Magical fantasy art style
- Anime: Detailed anime/manga style
- Minimalist: Clean, minimalist designs
- Technicolor: Vivid, colorful technicolor style

When using Stability AI, the post editor also shows a **Stability Presets** group with 16 native API-level style presets: Photographic, Cinematic, Anime, Digital Art, Comic Book, Fantasy Art, 3D Model, Analog Film, Enhance, Isometric, Line Art, Low Poly, Neon Punk, Origami, Pixel Art, and Tile Texture. These are applied at the API level in addition to any built-in style selected.

Pro users can also create unlimited **Custom Styles** — see "Can I create my own custom styles?" below.

= Can I create my own custom styles? (Pro) =

Yes! Pro users can define custom image styles with a name and a prompt description (e.g. "in a dreamy impressionist style"). Custom styles appear under a "Custom" group in all style dropdowns — in the post editor, the settings page, and the inline image block — and work exactly like built-in styles.

To add a custom style:

1. Go to AI Featured Image → Settings → Featured Images tab
2. Scroll to the "Custom Styles" section
3. Click "Add Style", enter a name and a prompt description, then save
4. Your custom style will immediately appear in all style dropdowns

= What aspect ratios does Gemini support? (Pro) =

Pro users with Google Gemini get access to 10 aspect ratios with model-specific resolutions:

**All Models (1:1, 3:4, 4:3, 9:16, 16:9):**
- Always supported by both Gemini models

**Additional Ratios (2:3, 3:2, 4:5, 5:4, 21:9):**
- Full support varies by model
- Gemini 2.5 Flash: All 10 ratios with fixed resolutions
- Gemini 3.1 Flash: All 10 ratios with 1K/2K/4K resolution options
- Gemini 3 Pro: All 10 ratios with 1K/2K/4K resolution options

= What aspect ratios does Stability AI support? =

Free users get 3 basic ratios: 1:1, 16:9, and 9:16. Pro users unlock all 9 ratios: 1:1, 16:9, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, and 9:21.

= What aspect ratios does Grok support? =

Free users get 3 basic ratios: 1:1, 16:9, and 9:16. Pro users unlock all 9 ratios: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, and 1:2.

= Can I upscale my featured image? (Pro) =

Yes! Pro users with a Stability AI API key can upscale their existing featured image directly from the post editor. After generating (or setting) a featured image, a "Stability AI Tools" panel appears below the generate button with three upscale modes:

- **Conservative**: Faithful 4x upscale — stays close to the original image
- **Creative**: AI-enhanced 4K — adds creative detail for a dramatic quality boost
- **Fast**: Quick 4x upscale — fastest option with solid results

Click "Upscale Image", wait for processing (Conservative and Creative use async processing and may take up to ~3 minutes), and the upscaled image automatically becomes your new featured image.

= Can I remove the background from my featured image? (Pro) =

Yes! Pro users with a Stability AI API key can remove the background from their existing featured image directly from the post editor. The "Stability AI Tools" panel appears below the generate button once a featured image is set.

Click "Remove Background" and Stability AI will isolate the subject and save a new transparent PNG as your featured image. This is useful for product photography, portraits, or any image where you want a clean isolated subject.

= What is a negative prompt and how do I use it? (Stability AI, Pro) =

A negative prompt tells Stability AI what **not** to include in your generated images — for example: "blurry, watermark, text, low quality, distorted". This can significantly improve output quality by steering the model away from common artifacts.

You can set a default negative prompt for featured images in **AI Featured Image → Settings → Featured Images** (Stability AI section). Pro users can also set a default negative prompt for inline images in the Inline Images tab.

Negative prompts are a Stability AI exclusive feature and have no effect when using OpenAI, Gemini, or Grok.

= What output formats are supported? =

**OpenAI (Free & Pro):**
- WebP (Recommended): Best compression and quality balance
- PNG: Lossless format, good for graphics with sharp edges
- JPEG: Widely compatible, good for photographs

**Stability AI:**
- PNG (default, free): Lossless format
- JPEG (Pro): Smaller file sizes
- WebP (Pro): Best compression and quality balance

**Grok / xAI:**
- PNG (fixed): Grok generates images in PNG format only

**Google Gemini (Pro only):**
- PNG (Fixed): Gemini generates images in PNG format only

= How does quality control work? =

**OpenAI (Free & Pro):**
- Set default quality (1-100) in the plugin settings under Featured Images → Output Settings
- Higher quality produces larger file sizes but better image detail
- Default quality is set to 90 for optimal balance

**Stability AI:**
- Quality is inherent to the model chosen (Core, Ultra, SD 3.5 variants). No separate quality slider

**Grok / xAI:**
- Free users get 1K resolution. Pro users can choose 1K or 2K for sharper results

**Google Gemini (Pro only):**
- Gemini 2.5 Flash: Fixed resolution per aspect ratio (quality control not applicable)
- Gemini 3.1 Flash: Choose between 1K, 2K, or 4K resolution options
- Gemini 3 Pro: Choose between 1K, 2K, or 4K resolution options

**Inline Images (all providers):**
- Automatic Quality Optimization adjusts quality and resolution based on the display size of the image in your content. Smaller images use lighter settings for faster loading; larger images use higher quality to stay sharp. No manual quality slider needed for inline images

= Can I generate images inside the Gutenberg editor? (Pro) =

Yes! Pro users can generate inline images directly inside the Gutenberg editor using the AI Image Generator block. Simply add the "AI Image Generator" block from the Media category in the block inserter, enter your prompt, and generate images anywhere in your content. The block supports all the same styles, aspect ratios, and settings as featured images. Configure default settings for inline images in the Inline Images tab on the plugin settings page.

= How does auto alt text work? =

When you generate any AI image (featured, inline, or bulk), the plugin automatically sets the alt text field on the attachment in the WordPress media library. This means your images are immediately accessible to screen readers and better indexed by search engines — no manual work needed.

You can configure auto alt text from **AI Images → Settings → General → Alt Text**:

* **On/Off toggle**: Enable or disable the feature entirely (enabled by default)
* **Post Title** (default): Uses the post title for featured and bulk images, and the prompt for inline images
* **Image Prompt**: Uses the generation prompt as alt text
* **Custom Format**: Build your own template using placeholders — `{title}` (post title), `{prompt}` (generation prompt), `{style}` (style name, e.g. "Realistic"), and `{site_name}` (your site name). Example: `{title} - {style} style - {site_name}`
* **Overwrite on Regeneration**: When disabled (default), manually edited alt text is preserved when you regenerate a featured image. Enable this option if you want fresh auto-generated alt text each time.

= How does "Generate Prompt from Content" work? =

Instead of writing a custom prompt manually, click **"Generate Prompt from Content"** in the post editor to have AI automatically craft an image generation prompt from your post title and body. The generated prompt is saved to the post and pre-filled in the Custom Prompt field — you can review it, edit it, or use it as-is before clicking "Generate Featured Image".

This option is also available in the **Bulk Generate** tab. Enable "Generate prompt from content" before starting a bulk run and the plugin will generate a unique prompt for each post before creating its featured image. All generated prompts are saved to each post for later review.

**Text model used per provider:**

* **OpenAI** (Free & Pro): gpt-4o-mini
* **Grok / xAI** (Free & Pro): grok-3-mini
* **Google Gemini** (Pro): Gemini 2.5 Flash
* **Stability AI**: Not supported — Stability AI does not offer a text generation API. The button will show a notice when Stability AI is your active provider

= Does it work with custom post types? (Pro) =

Yes! Pro users can enable AI image generation for any public custom post type:

1. Go to AI Featured Image in the admin menu
2. Scroll to the "Enabled Post Types" setting
3. Check the boxes for the post types where you want to enable the image generator
4. Save settings

The AI Featured Image Generator panel will now appear in the editor for all selected post types. Free version users are limited to Posts and Pages only.

== Screenshots ==

1. General settings — API configuration, provider selection, and post type availability
2. Post editor meta box — custom prompt, style picker, and Generate Featured Image button
3. Generated image preview — AI-generated featured image set directly from the post editor
4. AI Provider selector — choose between OpenAI and Google Gemini (Pro)
5. AI Model selector — pick from ChatGPT Image Latest, GPT Image 1.5, GPT Image 1, or GPT Image 1 Mini
6. Featured Images settings — default aspect ratio, style, text options, and output format
7. Aspect ratio options — choose Square, Portrait, or Landscape for generated images
8. Style presets — 13 styles organized into Common and Creative groups
9. Output format selector — WebP (recommended), PNG, or JPEG
10. Bulk Generate tab — filter posts and generate featured images in batches
11. Bulk Generate — select posts and start batch generation
12. Bulk Generate progress — real-time progress bar with per-post status
13. Bulk Generate summary — completed results with success, skipped, and failed counts

== Changelog ==
= 1.8.1 =
* **New Feature**: Generate from Post List — a new "AI Featured Image" column on the Posts/Pages admin list shows the current featured-image thumbnail with a one-click `Generate Image` / `Regenerate Image` link. Generate or replace featured images for any post without opening the editor.
* **One-click flow**: Auto-builds the prompt from the post title and content (same flow as Bulk Generate with "Generate prompt from content" enabled). Inline spinner during generation, in-place thumbnail swap on success, no page reload.
* **Confirm before overwrite**: Posts that already have a featured image show a `Regenerate Image` link with a confirmation dialog before replacing the existing thumbnail.
* **Respects global settings**: Uses the active provider and your configured style, size, aspect ratio, output format, and quality — identical output to the post-editor meta box and Bulk Generate.
* **Per-post throttle**: 5-second rate limit per post (shared with the meta-box endpoint) prevents accidental double-clicks.
* **Free-tier friendly**: Single-post generations from the list do not count against the free 50-image bulk-generation limit.
* **Plugin Name**: Renamed from "AI Featured Image" to "AI Featured Image Generator" to better reflect what the plugin does.

= 1.8.0 =
* **New Model (OpenAI)**: GPT Image 2 — newest OpenAI image model, now the default for new installs. Excels at text rendering (clear, correctly spelled text in multiple languages), visual reasoning (logical prompt processing for complex scenes), multi-object environments (no overlapping or merging), up to 4K output with 7 flexible aspect ratios, and mask-based image editing. Existing users keep their saved model selection.
* **New Provider: Stability AI** — generate images using Stability AI's Stable Image Core model (free). Includes 16 native style presets (Photographic, Cinematic, Anime, Digital Art, Comic Book, Fantasy Art, 3D Model, Analog Film, Enhance, Isometric, Line Art, Low Poly, Neon Punk, Origami, Pixel Art, Tile Texture), 3 aspect ratios for free users, and PNG output
* **New Provider: Grok / xAI** — generate images using Grok Imagine Image at just $0.02/image (free). Fastest and most affordable provider with 3 aspect ratios for free users and 1K resolution
* **New Feature (Pro): Image Upscaling** — upscale your existing featured image using Stability AI directly from the post editor. Three modes: Conservative (faithful 4x), Creative (AI-enhanced 4K), and Fast (quick 4x)
* **New Feature (Pro): Background Removal** — one-click background removal on existing featured images via Stability AI. Saves a transparent PNG and sets it as the new featured image
* **New Feature (Pro): Negative Prompts (Stability AI)** — describe elements to exclude from generated images. Available for both featured images and inline images
* **New Models (Pro, Stability AI)**: Stable Image Ultra, SD 3.5 Large, SD 3.5 Large Turbo, SD 3.5 Medium, SD 3.5 Flash, SD 3 Large, SD 3 Large Turbo, SD 3 Medium, SDXL 1.0
* **New Model (Pro, Grok)**: Grok Imagine Image Pro ($0.07/image) for higher quality results
* **New Option (OpenAI)**: 4 additional image sizes for GPT Image 2 — 1792x1024 (16:9), 1024x1792 (9:16), 1920x640 (3:1), and 640x1920 (1:3)
* **New Option (OpenAI)**: Transparent backgrounds — generate PNGs with no background using GPT Image 2
* **New Option (OpenAI)**: Generation Quality tier — choose Low, Medium, or High to trade speed/cost against output detail
* **New Option (OpenAI)**: Moderation control — choose auto (default) or low for GPT Image 2
* **New Option (Pro, Stability AI)**: Output format selector (PNG, JPEG, WebP) for featured and inline images
* **New Option (Pro, Stability AI)**: 9 aspect ratios for featured and inline images (1:1, 16:9, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, 9:21)
* **New Option (Pro, Grok)**: 9 aspect ratios for featured and inline images (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2) and 2K resolution
* **Improvement**: Inline Images tab now shows provider-specific aspect ratio settings for each provider (OpenAI, Gemini, Stability AI, Grok)
* **Improvement**: Automatic Quality Optimization for inline images — quality and resolution adjust automatically based on the display size of the image in your content
* **Improvement**: Provider selector now shows all 4 providers; Stability AI and Grok are available to all users
* **Improvement**: "Test Connection" validates Stability AI keys and displays your current credit balance
* **Improvement**: API key error messages and validation updated across all providers (meta box, bulk generate, REST API)
* **Improvement**: Custom styles now appear in the Gutenberg block style dropdown as well as the post editor
* **Improvement**: Renamed the OpenAI "Image Quality" slider to "Output Compression" to distinguish file-size compression from the new Generation Quality tier. No data migration required
* **Bug fixes and stability improvements**

= 1.5.4 =
* **New Feature**: Auto Alt Text — automatically sets alt text on all AI-generated images (featured, inline, and bulk) for better SEO and accessibility. Configurable from General settings with three source options: post title, generation prompt, or a custom template using `{title}`, `{prompt}`, `{style}`, and `{site_name}` placeholders. Enabled by default.
* **New Option**: Overwrite Alt Text on Regeneration — choose whether to preserve manually edited alt text when regenerating featured images. Disabled by default, so your hand-edited alt text is preserved across regenerations.
* Increased bulk image generation limit for free users from 20 to 50

= 1.5.2 =
* Bug Fix
* Description updates
* Screenshots & Walkthrough Guide updates

= 1.5.0 =
* **New Feature (Pro)**: Custom Styles — Pro users can now create their own named image styles with a custom prompt description. Custom styles appear in all style dropdowns (post editor, settings page, inline block) and work exactly like built-in styles. Manage them from the Featured Images tab in settings.
* **Bulk Generate for Free Users**: The Bulk Generate tab is now available to all users — free users can generate featured images for up to 5 posts per batch (50 images lifetime) using OpenAI
* **Freemium Limits**: Free users see the post status filter and a live batch counter; advanced filters (post type, date range, thumbnail status, overwrite) are visible but locked with a Pro badge
* **Usage Banner**: Free users see a real-time banner showing remaining batches and an upgrade prompt; the Load Posts button is disabled when the limit is reached
* **Pro Upgrade Prompts**: Locked filters and the summary screen include direct upgrade links for a frictionless conversion path
* **Simplified Meta Box**: Removed quality slider and text info notice from the post editor sidebar for a cleaner, focused interface — quality is now managed exclusively in plugin settings
* **Grouped Style Presets**: 13 styles are now organized into "Common" and "Creative" groups for easier selection
* **Overwrite Confirmation**: Generating a new featured image now prompts for confirmation if one already exists, preventing accidental overwrites
* **Improved Prompt Placeholder**: Placeholder text now explains that leaving the prompt empty auto-generates from your post title
* **Cleaner Loading Spinner**: Replaced the multi-color gradient SVG spinner with a clean, brand-consistent CSS spinner
* **Removed Getting Started Page**: Replaced with a streamlined setup notice on the settings page — reduces menu clutter
* **Consolidated Settings Sidebar**: Merged "Need Help?" and "API Dashboards" cards into the Quick Tips card and inline API key descriptions for a tidier layout
* **API Usage Links**: Added "View API Usage" links directly next to API key fields for quick access to your OpenAI or Gemini dashboard
* **UI Overhaul**: Comprehensive admin interface improvements across all plugin pages
* **Bulk Generate Tab**: Moved Bulk Generate from a separate menu page into a dedicated tab on the Settings page — all plugin features now live in one unified hub
* **Regenerate Button**: Added "Regenerate" button directly below the generated image preview in the post editor meta box — no more scrolling back up to re-generate
* **API Key Validation**: Added "Test Connection" button next to each API key input — instantly verify your OpenAI or Gemini key is valid without leaving the settings page
* **Settings Save Feedback**: Added visible green success notice inside the settings card after saving, and the active tab is now preserved after save
* **AJAX Tab Switching**: Settings tabs now switch instantly without page reloads; URL updates for bookmarkability
* **Inline Images Upsell**: Free users on the Inline Images tab now see a focused feature showcase instead of disabled form fields
* **Extracted CSS/JS**: All inline styles and scripts have been moved to dedicated asset files for browser caching and cleaner code
* **New Model (OpenAI)**: Added ChatGPT Image Latest — always points to the newest ChatGPT image model for automatic improvements
* **New Model (Pro, Gemini)**: Added Nano Banana 2 Preview (Gemini 3.1 Flash Image Preview) with 1K/2K/4K resolution support and all 10 aspect ratios
* **Bug Fixes**: Fixed broken settings links on the plugins page and in the meta box; removed dead no-op JavaScript code
* **Smart Save Button**: Save Settings button visibility now correctly adapts based on tab context and user license

= 1.4.10 =
* Verified compatibility with WordPress 6.9.1

= 1.4.9 =
* Updated plugin name & description

= 1.4.6 =
* Added Pro only support for generating images directly inside the Gutenberg editor.
* Added a dedicated **Inline Images** tab in the settings page (Pro).
* Improved the settings page layout for better organization and usability.
* Fixed an issue where PNG output generation could fail.
* Removed the quality slider when **OpenAI PNG** output format is selected due to compatibility limitations.
* Fixed Bugs

= 1.4.5 =
* Fixed Bugs

= 1.4.3 =
* Added Pro only support for generating images directly inside the Gutenberg editor.
* Added a dedicated **Inline Images** tab in the settings page (Pro).
* Improved the settings page layout for better organization and usability.
* Fixed an issue where PNG output generation could fail.
* Removed the quality slider when **OpenAI PNG** output format is selected due to compatibility limitations.

= 1.3.9 =
* **New Feature (Pro)**: Added option to control which post types can enable the featured image generator
* **New Model**: Added gpt-image-1.5 model for enhanced image generation
* **Bug Fix**: Fixed Gemini Flash 2.5 issue
* **Improvement**: Changed image file names to use post/page title for better organization and SEO

= 1.3.2 =
* **New Feature (Pro)**: Added custom post types support - enable AI image generation for any public custom post type
* **Enhancement (Pro)**: New "Enabled Post Types" setting allows Pro users to select which post types show the image generator
* **Security**: Added post type validation in REST API to ensure only enabled post types can generate images
* **Improvement**: Meta box and scripts now dynamically load based on enabled post types

= 1.3.1 =
* **New Model (OpenAI)**: Added gpt-image-1.5 as a new image generation option
* **Bug Fix (Gemini)**: Fixed an issue affecting Gemini 2.5 Flash image generation
* **Improvement**: Generated image file names now follow the post/page title for better media organization and SEO

= 1.3.0 =
* **New UI**: Completely redesigned settings interface with modern card-based layout
* **Top-level Menu**: Plugin now has its own top-level admin menu for easier access
* **New Pages**: Added "Getting Started" guide page with step-by-step instructions
* **Pro Plan**: Integrated Freemius for Pro plan upgrades and licensing
* **Major Feature (Pro)**: Added Google Gemini AI as a second provider option alongside OpenAI
* Added support for 4 AI models:
  * OpenAI (Free): GPT Image 1 and GPT Image 1 Mini
  * Google Gemini (Pro): Gemini 2.5 Flash Image and Gemini 3 Pro Image Preview
* Implemented dynamic settings page that shows only relevant options for selected provider
* Added 10 aspect ratios for Gemini Pro (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9)
* Added model-specific aspect ratio filtering (different ratios for Gemini 2.5 Flash vs 3 Pro)
* Implemented fixed resolutions for Gemini 2.5 Flash (1290 tokens per image)
* Added 1K/2K/4K resolution options for Gemini 3 Pro
* Enhanced meta box to hide quality slider when Gemini is selected
* Reorganized settings fields for better user experience (AI Model moved below AI Provider)
* Added automatic field visibility based on provider and model selection
* Improved JavaScript for dynamic settings updates
* Updated API integration to support both OpenAI and Gemini endpoints
* Added comprehensive aspect ratio documentation with example resolutions
* Enhanced settings with provider-specific descriptions and help text
* Improved error handling for both API providers
* Added Support Forum link in settings sidebar

= 1.2.1 =
* Fixed compatibility issue with Classic Editor plugin
* Improved JavaScript functionality for better editor support
* Enhanced meta box rendering for classic editor compatibility

= 1.2.0 =
* Added output format selection (WebP, PNG, JPEG) with WebP as default
* Added image quality control (1-100) for both global settings and individual posts/pages
* Added AI model selection (GPT Image 1 Standard vs GPT Image 1 Mini)
* Updated image sizes to support current OpenAI API specifications
* Enhanced settings page with new quality and model controls
* Improved metabox with quality slider and real-time value display
* Added comprehensive CSS styling for quality controls
* Updated API integration to use quality and model parameters

= 1.1.0 =
* Improved UI for a smoother experience
* Fixed bug that forced text on image when the option is selected
* Replaced unfriendly error messages with user-friendly messages
* Updated plugin logo from PNG to SVG
* Added a "none" style option and set it as the default

= 1.0.4 =
* Added a loader spinner icon
* Improved UI styling
* Activated the feature on the Pages post type

= 1.0.3 =
* Added loader spinner icon
* Improved UI
* Activated feature on Pages post type

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.8.1 =
New: Generate AI featured images directly from the Posts/Pages admin list! A new "AI Featured Image" column shows the current thumbnail and a one-click Generate Image / Regenerate Image link — no need to open each post. Auto-builds the prompt from title + content, respects all your provider settings, and does not count against the free bulk-generation limit. Plugin renamed to "AI Featured Image Generator".

= 1.8.0 =
Major update! New OpenAI GPT Image 2 model (now default) with text rendering, visual reasoning, 4K output, 7 aspect ratios, transparent backgrounds, generation quality tiers, and moderation control. Two new free providers: Stability AI (16 style presets) and Grok/xAI ($0.02/image). Pro users gain image upscaling, background removal, negative prompts, advanced Stability AI models, Grok Pro, extended aspect ratios, and automatic quality optimization for inline images.

= 1.5.4 =
New: Auto Alt Text — all AI-generated images now automatically get alt text set in the media library for better SEO and accessibility. Configurable from General settings with post title, prompt, or custom template options. New "Overwrite on Regeneration" option preserves manually edited alt text by default.

= 1.5.0 =
Major update! Custom Styles for Pro users, Bulk Generate now available to free users (5 posts/batch, 50 images lifetime), complete admin UI overhaul with unified settings hub, AJAX tab switching, API key validation, new AI models (ChatGPT Image Latest, Gemini 3.1 Flash Image Preview), and numerous UX improvements.

= 1.4.3 =
Pro users can now generate AI images directly inside the Gutenberg editor using the new AI Image Generator block! New dedicated Inline Images settings tab, improved settings layout, and bug fixes for PNG output format.

= 1.3.2 =
Pro users can now enable AI image generation for custom post types! New "Enabled Post Types" setting lets you choose which post types show the image generator. Enhanced security and improved post type handling.

= 1.3.1 =
Adds new OpenAI model gpt-image-1.5, fixes Gemini 2.5 Flash image generation, and now names generated files from the post/page title for better Media Library organization and SEO.

= 1.3.0 =
Major update with redesigned UI and Pro features! New modern card-based settings interface, top-level admin menu, and Getting Started guide. Pro users can now choose between OpenAI and Google Gemini (2.5 Flash & 3 Pro) as their AI provider with 10 aspect ratios and up to 4K resolutions. Fully backward compatible.

= 1.2.1 =
Bug fix release: Fixed compatibility issue with Classic Editor plugin and improved JavaScript functionality for better editor support.

= 1.2.0 =
Major update with new features: output format selection (WebP, PNG, JPEG), image quality control (1-100) for both global and per-post settings, AI model selection (GPT Image 1 vs GPT Image 1 Mini), updated image sizes, enhanced UI with quality sliders, and improved API integration

= 1.1.0 =
Improved UI for a smoother experience, fixed bug that forced text on image when the option is selected, replaced unfriendly error messages with user-friendly messages, updated plugin logo from PNG to SVG, and added a "none" style option and set it as the default

= 1.0.4 =
Added a loader spinner icon, improved UI styling, and activated the feature on the Pages post type

= 1.0.3 =
Added loader spinner icon and improved UI

= 1.0.0 =
Initial release 
