=== Dumi Article Draft Creator ===
Contributors: wpdumi
Tags: openai, gutenberg, writing, ai, draft
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create Gutenberg article drafts from your topic and outline for manual review.

== Description ==

Dumi Article Draft Creator helps WordPress editors write faster. Enter a topic and optional outline, and AI generates a Gutenberg draft that you review and edit before publishing.

This plugin is an independent project by Duminda Wijerathna (wpdumi.com). It is not affiliated with OpenAI or WordPress.

**Features**

* Create drafts from your own topic and notes
* AI-powered writing with the WordPress AI Client (7.0+) or OpenAI API fallback
* Output as native Gutenberg blocks (headings, paragraphs)
* Template selection (built-in or from existing Gutenberg posts)
* Assign drafts to existing categories
* Configurable draft length
* Media suggestions where templates include image placeholders

**How it works**

1. An editor enters a topic and optional outline
2. The plugin sends that text to the configured AI provider when you click Create Draft
3. A new post is saved (as draft by default) for review in the block editor
4. You edit, add images, and publish manually

**External services**

On WordPress 7.0+, this plugin uses the core WordPress AI Client. Configure your provider under **Settings → Connectors**.

On WordPress 6.x, the plugin can use the [OpenAI API](https://openai.com/policies/terms-of-use/) with an API key you enter in the plugin settings.

Only the topic and outline you enter are sent. No data is sent to the plugin author. This plugin does not fetch external websites or publish content automatically.

For support, contact dumi@wpdumi.com.

== Installation ==

1. Upload the `dumi-article-draft-creator` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. On WordPress 7.0+, go to **Settings → Connectors** and add your AI provider
4. On WordPress 6.x, go to **Dumi Draft Creator → Settings** and add your OpenAI API key
5. Go to **Dumi Draft Creator → Create Draft**, enter a topic, and click **Create Draft**

== Frequently Asked Questions ==

= Do I need an OpenAI account? =

On WordPress 7.0+, configure any supported provider under Settings → Connectors. On WordPress 6.x, you need an OpenAI API key from [platform.openai.com](https://platform.openai.com/).

= Does this plugin fetch content from other websites? =

No. It only uses the topic and outline that you type into the form.

= Are drafts published automatically? =

No. Drafts are saved for manual review in the block editor. The default post status is Draft.

= Can I use my own post as a template? =

Yes. Any existing Gutenberg post can be used as a structure template.

== Screenshots ==

1. Create Draft screen with topic, outline, and template options
2. Settings page with AI configuration notes
3. Generated draft opened in the Gutenberg block editor

== Changelog ==

= 1.0.4 =
* Fall back to plugin OpenAI API key when WordPress Connectors are not configured
* Clearer admin notices and error messages for missing AI providers

= 1.0.3 =
* Invoke WordPress AI Client via call_user_func for Plugin Check compatibility on WP 6.x

= 1.0.2 =
* Guard wp_ai_client_prompt() with function_exists() for WordPress 6.x compatibility

= 1.0.1 =
* Renamed plugin to Dumi Article Draft Creator
* Use WordPress AI Client on 7.0+ with OpenAI HTTP fallback on 6.x
* Removed load_plugin_textdomain() for WordPress.org hosting

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.4 =
Fixes draft creation when WordPress Connectors are not set up.

= 1.0.3 =
Plugin Check compatibility fix for WordPress 6.x.

= 1.0.2 =
Compatibility fix for Plugin Check on WordPress 6.x.

= 1.0.1 =
Renamed plugin and added WordPress 7.0 AI Client support.
