=== PostSprout ===
Contributors: postsprout
Tags: ai, blogging, seo, content, automation
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

PostSprout researches and writes blog posts tailored to your shop and products. Guide the topics, voice and products as much as you want.

== Description ==

PostSprout researches every post for your shop. It uses your products and brand settings, picks topics that fit what you sell, researches each topic, and links the post to the products it mentions.

You can guide it as much as you want. Add your own topics in Ideas, set your brand voice and tone, name competitors to follow, choose the products for a post, and review each draft before it goes live.

PostSprout connects your WordPress site to PostSprout, an external AI blog automation service. A PostSprout account is required; you can create one when you connect. The service researches and generates blog content; this plugin securely receives that content and creates real WordPress posts, categories, tags, featured-image media, SEO metadata, schedules, and structured data on your site.

Your first post is free. After activation, open PostSprout in the admin menu, read what PostSprout does with an example post, and click Write my free first post. Once the site is connected, PostSprout writes one free post for your blog and sends it to WordPress as a draft, so nothing goes live until you publish it. A new post every day needs a paid PostSprout plan.

The plugin provides a one-click connection flow and never requests or stores your WordPress password. You can also create a local test draft, inspect connection health, review the last ten posts created through PostSprout, and disconnect at any time. Every plugin feature is free; the paid part is the PostSprout service.

Service links:

* [PostSprout](https://postsprout.app/)
* [Terms of Use](https://postsprout.app/terms)
* [Privacy Policy](https://postsprout.app/privacy)

= External service and data disclosure =

This plugin works with PostSprout (`https://postsprout.app`), an external service. It contacts PostSprout only when an administrator clicks Write my free first post (this connects the site) or Disconnect. The PostSprout page in WordPress uses data stored on your own site and fetches nothing from PostSprout.

What is shared, and when:

* **When you connect:** your site address, a one-time pairing code, the address of the PostSprout page in WordPress, and a request for the free first post. After you confirm the site and blog, PostSprout receives a random access key for your site and the user ID of the administrator who connected. The key never appears in the browser address bar. Your WordPress password is never asked for or stored.
* **When you disconnect:** the connection ID, the time, and a signature that proves the request comes from your site.
* **While connected:** PostSprout sends your site the posts it writes: title, content, excerpt, slug, publish status and date, categories and tags, author, SEO data, structured data (JSON-LD), and a featured image link with alt text. PostSprout can also ask your site for its plugin and WordPress versions, connection state, categories and tags, and the result of the last publish.
* **Featured images:** WordPress downloads each featured image into your Media Library from Supabase Storage (`https://lunlcdqhmcbtguifetlg.supabase.co/storage/v1/object/public/product-images/`), where PostSprout keeps its images. Supabase sees only your server's IP address and the image path. See the [Supabase Terms of Service](https://supabase.com/terms) and [Supabase Privacy Policy](https://supabase.com/privacy).

PostSprout uses this data only to run the service, under its [Terms of Use](https://postsprout.app/terms) and [Privacy Policy](https://postsprout.app/privacy). The plugin adds no tracking, advertising, external scripts or external styles.

== Installation ==

1. Upload the `postsprout` folder to `/wp-content/plugins/`, or install it through the WordPress plugin directory.
2. Activate PostSprout.
3. Open PostSprout in the admin menu (or click Settings under PostSprout on the Plugins screen) and click Write my free first post.
4. Sign up or sign in to PostSprout. A new account sets up its blog first, with your site address already filled in.
5. Review the named WordPress site and PostSprout blog, and confirm the connection. You will return to the PostSprout page in WordPress, which shows that your free post is being written. When it arrives, the page links to the draft.

== Frequently Asked Questions ==

= Do I need a PostSprout account? =

Yes. PostSprout is an external service, and an account is required to generate and send content. You can create one when you click Write my free first post.

= Is the first post really free? =

Yes. Each PostSprout blog gets one free post, sent to your site as a draft. If the blog has already had its free post, the site connects without writing another one.

= What does it cost? =

The plugin is free and GPL-licensed, and your first post is free. A new post every day needs a paid PostSprout plan; current plans and pricing are at https://postsprout.app/pricing.

= Can I review posts before they publish? =

Yes. PostSprout can send posts as drafts so you can review and edit them in WordPress before publishing.

= Can PostSprout test a headline on a live post? =

Yes, when Search Console is connected and you approve the suggestion or choose
automatic headline changes in PostSprout. Authenticated title-only updates work
on any published post that your PostSprout account knows about, including posts
without a PostSprout creation marker. They do not change the body, address,
publication date, or status. WordPress manages its own modified timestamp.
Undo restores the saved title, subject to WordPress's save filters. Titles must
be valid UTF-8, non-empty, and at most 1000 characters; control characters are
removed. Existing explicit Yoast and Rank Math SEO titles are sanitized as plain
text when updated or restored; empty template fields are not overwritten.

= How do I disconnect? =

Open PostSprout in the admin menu and click Disconnect. This immediately removes the local authentication token and notifies PostSprout.

= Does it work with Shopify? =

No. Shopify uses a separate PostSprout connection path; this plugin is only for WordPress.

== Changelog ==

= 1.0.4 =

* Verify a nonce before the PostSprout page reads the free post result from the address it returns to after connecting; the flag is ignored without it.
* The old Settings > PostSprout address now redirects to the PostSprout page without forwarding any part of the address.

= 1.0.3 =

* Add a PostSprout admin menu page that shows what PostSprout does with an example post, and a Write my free first post button that connects the site and asks for the free first post as a draft. Old Settings > PostSprout links still open it.
* Show the free post's progress, the latest PostSprout post, and plan information from local data only.
* Add a Settings link on the Plugins screen and a one-time, dismissible activation notice.
* Keep the one-time pairing code valid for 30 minutes, so a new account can sign up and set up its blog before connecting.

* Restrict publishing metadata to the six supported Yoast and Rank Math fields and validate requested authors, falling back to the connecting administrator.
* Validate headline text while preserving legacy Undo and surrounding whitespace; sanitize explicit SEO titles.
* Bound authentication failure storage, handle missing authorization headers, and scope the redirect host allowance to connection.
* Disclose Supabase image downloads and headline eligibility; remove authentication transients on uninstall.

= 1.0.2 =

* Allow explicit Undo to restore legacy titles and accept surrounding title whitespace.

= 1.0.1 =

* Add authenticated title-only reads and updates for headline tests, with live-post checks and no body, address, date, or status writes.

= 1.0.0 =

* Initial release with pairing, local publishing, media sideloading, structured data, health status, and disconnect support.
