=== SEO Agent IO - Auto Publisher ===
Contributors: seoagentio
Tags: seo, content, artificial-intelligence, articles, keyword research
Requires at least: 5.6
Tested up to: 6.9
Stable tag: 4.84
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to SEO Agent - AI-powered keyword research and article publishing.

== Description ==

SEO Agent IO - Auto Publisher connects your WordPress site to SEO Agent (seo-agent.io),
an AI-powered content platform that helps you plan, write, and publish
SEO-optimized articles based on real keyword research for your niche.

An active SEO Agent subscription is required. See seo-agent.io for plans and pricing.

= What this plugin does =

* Receives and publishes articles prepared by SEO Agent - content you have reviewed and
  approved through the SEO Agent dashboard before it reaches your site
* Applies SEO metadata to each published post (Yoast, Rank Math, AIOSEO, SEOPress)
* Fills missing image alt text using AI to improve accessibility and search coverage
* Injects Organization schema markup for structured data
* Syncs published post URLs back to SEO Agent so the service can update its internal links
* Removes duplicate-content query parameters (?nocache=, ?elementor_popup=) from canonical URLs

= External Service Notice =

This plugin connects to seo-agent.io to publish articles and generate alt text.
Your site URL, published post URLs, and image URLs are transmitted to this service.
See: https://seo-agent.io/privacy and https://seo-agent.io/terms

= Requirements =

An active SEO Agent account is required. Sign up at seo-agent.io.

== Installation ==

1. Install and activate the plugin
2. The plugin connects automatically on activation
3. Visit SEO Agent in your WordPress admin to complete setup

== Frequently Asked Questions ==

= Is the plugin free? =
The plugin itself is free to install. Using it requires an active SEO Agent subscription.
Visit seo-agent.io for current plans and pricing.

= Does the plugin work without an account? =
No. You need to register at seo-agent.io and complete the onboarding process first.
Once your site is connected through the SEO Agent dashboard, the plugin will automatically
receive and publish articles prepared for your site.

= What data is sent to seo-agent.io? =
Your site URL, published post URLs, image URLs for alt text generation, and crash reports on fatal errors.
See the External Services section below.

== External Services ==

This plugin communicates with seo-agent.io for all core functionality:

* **What is sent:** Site URL (on first page load after installation, with automatic retry backoff), published post URLs and titles
  (on publish/update/delete), page URLs (site audit), image URLs (for alt text
  generation), plugin version (on each poll), crash reports (on fatal errors).
  If WooCommerce is installed: product titles, URLs, and status changes are synced
  automatically via webhooks to power internal linking.
* **When:** On activation, every 5 minutes via WP-Cron, on post publish/update/delete,
  and on WooCommerce product changes (if WooCommerce is installed).
* **Privacy policy:** https://seo-agent.io/privacy
* **Terms of service:** https://seo-agent.io/terms

== Changelog ==

= 4.84 =
* Image sideload: set alt text from pre-generated value when AI API times out (fallback)
* Async image sideload retry with extended 20-second timeout

= 4.83 =
* Image sideload: set _wp_attachment_image_alt from pre-generated alt as fallback

= 4.82 =
* Strip wpautop paragraph wrapper from JSON-LD schema in post_content via the_content filter

= 4.81 =
* Fix unused variable in inject-schema handler
* Refactor ob_start helper so each caller has explicit ob_end_flush() for static analysis

= 4.80 =
* inject-schema endpoint now stores schema in post meta instead of post_content
* Add comment clarifying base64_decode usage (HTTP Basic Auth header decoding)

= 4.79 =
* Refactor output buffer handling: shared helper eliminates duplicate flush logic
* Shutdown hook priority -1 ensures buffer closes before WordPress core cleanup
* Skip unnecessary ob_get_status() calls on AJAX and cron requests

= 4.78 =
* Explicit shutdown handler to close output buffer opened at template_redirect
* Remove load_plugin_textdomain() - WordPress 4.6+ loads translations automatically
* Fix code comment that triggered WP.org automated scanner

= 4.77 =
* Fix featured image sideload: preserve original alt text set by fill_alt_texts
* Decode HTML entities from media library title on sideload

= 4.76 =
* Fix image alt text: use payload alt_text field, decode HTML entities from post title
* Support caption and description fields in set_featured_image task

= 4.75 =
* Add _yoast_wpseo_canonical to SEO meta keys allowlist for canonical URL override

= 4.74 =
* WP-native auto-update via pre_set_site_transient_update_plugins filter
* Noindex WooCommerce add-to-cart and added-to-cart URL parameters

= 4.73 =
* Add activate_plugin task type to re-activate deactivated plugins after reinstall

= 4.72 =
* Replace sanitize_url() with esc_url_raw() for WordPress 5.6 compatibility
* Fix double-encoded &amp; in admin page free plan label
* Wrap cron schedule display strings in __() for i18n
* Fix uninstall.php multisite: clear cron hooks and transients per-site

= 4.71 =
* Redesigned admin status page with SEO Agent visual identity (all 4 connection states)

= 4.70 =
* WP_Filesystem API for all filesystem writes (WP.org scanner compliance)
* Pre-computed SVG icon constant (no base64_encode at runtime)
* sanitize_key on WooCommerce attribute query params

= 4.69 =
* WP_Filesystem API for llms.txt writes (WP.org compliance)
* is_wp_error guard on org-schema homepage fetch
* Remove sslverify=false from direct-URL fallback (security)

= 4.68 =
* Deactivation clears all cron hooks via wp_clear_scheduled_hook
* Added uninstall.php for full cleanup on plugin deletion

= 4.67 =
* Added WooCommerce HPOS compatibility declaration
* Renamed cron intervals to plugin-prefixed names (seo_agent_twicehourly)
* i18n support and textdomain loading
* Converted all anonymous closures to named functions

= 4.66 =
* Available on WordPress.org
* Added free tier: 3 articles/month, 20 alt texts/month
* Removed self-update mechanism (updates now via WordPress.org)

== Screenshots ==

1. Admin status page - connected, showing articles used this month
2. Admin status page - new install, account setup prompt
3. Article published automatically by SEO Agent in WordPress admin
