=== Magic Featured Image Generator (AI Generated) ===
Contributors: yorksupport
Tags: featured image, ai, ai image, image generation, auto featured image
Stable tag: 1.2.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: auto-featured-image-generator-wai
Domain Path: /languages

Generate a post featured image from the title and excerpt using Cloudflare Workers AI, directly from the editor sidebar.

== Description ==

Auto-generate a click‑worthy featured image right from the post editor sidebar, this plugin allows WordPress users to automatically generate AI-generate featured images for their posts based on the title and excerpt. Utilizing flux-1-schnell AI models, such as Flux via Workers AI (Cloudflare), This plugin connects to Cloudflare Workers AI to create an image. The plugin also includes settings for custom API keys and offers flexibility for image generation.

= Key Features =

- Generate featured images using Cloudflare Workers AI
- One-click “Generate Featured Image” button in the post sidebar
- Generate a preview image (without saving to media library yet)
- Inspect a larger preview
- Set the generated image as the Featured Image in one click
- Adjust default width, height, and format
- Restrict the panel to specific post types

== External Services ==

This plugin communicates with the Cloudflare Workers AI API (`https://api.cloudflare.com/client/v4/accounts/%account_id%/ai/run/%model_path%`) to generate image previews and final featured images. Using the service requires a Cloudflare Account ID and API token that you configure in the plugin settings.

= What is sent and when =
- When you click “Generate Featured Image,” we send your Cloudflare Account ID, API token, model slug, desired width/height, image format, and a prompt composed from the current post title and excerpt/summary. These values are required by Cloudflare Workers AI to render an image.
- When you click “Set as Featured Image,” the plugin uploads the returned base64 image to your Media Library. No data is sent automatically on post save.

= Service provider and policies =
Cloudflare, Inc. provides the Workers AI API. By entering your credentials you agree to their policies:  
- [Terms of Service](https://www.cloudflare.com/website-terms/)
- [Privacy Policy](https://www.cloudflare.com/privacypolicy/)

=== Requirements ===

- Cloudflare Account with Workers AI enabled
- API Token (User token) with AI:Create permission
- Your Account ID and selected model slug (e.g. @cf/black-forest-labs/flux-1-schnell)

== Installation ==

1. Install and activate the plugin.
2. Go to Settings → Magic Featured Image Generator (AI Generated).
3. Enter your Cloudflare Account ID and API Token, choose a model, image size, and default format.
4. Optionally choose which post types should show the generator panel.
5. In the post editor, open the “Magic Featured Image Generator (AI Generated)” panel and click “Generate Featured Image”.
6. If you like the result, click “Set as Featured Image”.

== Frequently Asked Questions ==

= Is this plugin free? =
Yes! You can use the plugin for free with your own Cloudflare Workers AI account.

= Do I need a Cloudflare Account? =
Yes, you must have an Cloudflare account, If you do not have an account, you must generate one.

= How to get Account ID =
Here is step to get your Cloudflare [Account ID](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/).

= How to create User API Token =
Here is step to create [User API Token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) or simply visit this [Link](https://dash.cloudflare.com/profile/api-tokens)


= Which AI model does it use? =
By default, it uses the `@cf/black-forest-labs/flux-1-schnell` model, but you can change it in the plugin settings. Here is some other [Models](https://developers.cloudflare.com/workers-ai/models/?tasks=Text-to-Image)

= Does this overwrite my existing Featured Image? =
No, not unless you click “Set as Featured Image.” You can preview first and decide.

= Is anything generated automatically on save? =
No. All generation is manual from the editor panel.

= Where do the images get stored? =
Only after you click “Set as Featured Image” do we upload to the Media Library.

== Screenshots ==

1. Editor sidebar panel with generation controls and preview.
2. Modal preview of the generated image.
3. Plugin settings page

== Changelog ==

= 1.2.0 =
* Tested successfully with WordPress 7.0

= 1.1.0 =
* Tested successfully with WordPress 6.9

= 1.0.0 =
* Initial release: manual generation, preview modal, set as featured image, settings for Cloudflare model/size/format and enabled post types.

== Upgrade Notice ==

= 1.0.0 =
Initial release.


