=== GadgetAutoBlogger ===
Contributors: gadgetmall
Tags: blog, content, ai, openai, automation
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate WordPress blog drafts from keywords with your OpenAI account. Optional images and administrator-controlled publication.

== Description ==

GadgetAutoBlogger generates articles and SEO metadata from a keyword queue. Configure daily limits, language, audience, category and draft or publish mode. Manual generation respects the same publication choice and daily limit. Draft mode is the default; review AI output for accuracy before publishing.

Requires an OpenAI API account with available credit. Entering a key and keywords enables scheduled requests. Image generation is disabled by default. No analytics, telemetry or public log files are written. Retired search-engine sitemap ping settings are retained but make no network requests.

This is the GadgetMall continuation of Saltra AI Auto Blogger. Original Saltra authorship is acknowledged; existing post metadata and settings migrate without renaming previously generated content.

== External services and privacy ==

OpenAI (https://api.openai.com): article and SEO generation send your configured keywords, audience, language, generated article text and model instructions. Optional image generation sends an image prompt. The connection-test button sends a short test prompt. Usage is charged by OpenAI. An optional separate Admin API key requests organization costs for the last 30 days when an administrator opens settings. Never enter an Admin key unless you want that feature.

Terms: https://openai.com/policies/terms-of-use/
Privacy: https://openai.com/policies/privacy-policy/

Keys are stored in non-autoloaded WordPress options and shown masked to administrators. They are not encrypted at rest; protect the database, backups and administrator access. Keys can be cleared explicitly. AI content and generated images become ordinary WordPress posts/media subject to your site's access and retention policy. Uninstall removes plugin settings, keys and cron events across the network, while preserving authored posts/media. Legacy database options are retained during migration for compatibility; clearing a key clears its legacy copies too.

== Installation ==

1. Back up the database. Deactivate the old Saltra AI Auto Blogger plugin; do not uninstall it before migration.
2. Upload the gadgetautoblogger directory and activate GadgetAutoBlogger.
3. Open Settings > GadgetAutoBlogger. Existing Saltra settings and used-keyword history migrate automatically. The old options remain available for rollback.
4. Configure keywords, your OpenAI key and daily limit; keep Draft mode for initial tests.
5. Use Run Now or allow WordPress cron to run. A functioning WP-Cron/server cron is required.

Do not run the legacy and new plugin together. GadgetAutoBlogger pauses its boot if the old class is loaded. Pending legacy manual jobs and the next daily event migrate to the new hook names. Generated keywords are not repeated even if the used-keyword list is reset; existing generated posts are also checked.

Network activation is not supported: activate individually on each site so its settings and schedules are initialized independently.

== Frequently Asked Questions ==

= Will Run Now publish immediately? =
Only when you explicitly selected Publish. Otherwise generated posts remain drafts. Both manual and scheduled generation share the configured per-day limit.

= Is the API key bundled? =
No. Supply your own OpenAI key. No real API calls are necessary for the isolated regression tests.

= What happens when generation fails? =
A generic administrator-only error is stored. HTTP/model failures do not create an article. An interrupted worker releases its lock on normal errors; an abandoned process lock expires after six hours. Existing keyword metadata prevents duplicate posts after interrupted post-processing. Review an incomplete draft manually before publishing it.

== Changelog ==

= 1.5.0 =
* Rename the maintained plugin to GadgetAutoBlogger with preserved Saltra settings and post metadata.
* Respect draft mode for manual jobs and enforce daily generation limits.
* Serialize workers with an atomic option lock and deduplicate keyword/post creation.
* Remove public debug logs and sanitize provider errors, HTTP redirects, generated HTML and image payloads.
* Correct uninstall cleanup, migration and plugin metadata.

== Upgrade Notice ==

= 1.5.0 =
Deactivate the legacy plugin before activation. Back up the database and verify migrated settings in Draft mode.
