=== Content Studio Connector ===
Contributors: contentstudio
Tags: content, ai writing, seo, auto publish, blog
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects your site to Content Studio so the studio team's articles are published here automatically, with featured images and SEO fields.

== Description ==

Content Studio's team writes, illustrates and improves articles for your business. This plugin is the bridge: install it, connect in one click, and every finished article appears on your site on its own.

* **One-click connect.** Sign in to Content Studio, choose the project for this site, approve. No passwords are shared: the plugin receives its own revocable token (OAuth 2 with PKCE).
* **Publishing your way.** Publish right away, keep articles as drafts for review, or schedule them a set number of hours later or at a fixed time of day. Choose the author and the category.
* **Pictures in your own media library.** Featured images and the pictures inside each article are copied into WordPress, so nothing is hot-linked.
* **SEO fields.** The meta description, focus keyword and, for rewritten pages, the SEO title are written into Yoast SEO or Rank Math when one is active.
* **Improvements to existing pages, safely.** When you approve a change to a page in the studio, it is applied only if the page is still exactly the version the change was written for, and pictures and embeds already on the page are kept.
* **The team knows your site.** Published posts and pages, approved comments (name and text only), categories and tags are shared so the team can link to them and answer what readers ask.
* **Reliable.** A signed webhook publishes immediately; a check every five minutes is the safety net.
* **Status at a glance.** A status page, an event log and Site Health checks.

= Security =

* The token and webhook secret are stored encrypted with your site's own salts.
* The only public endpoint is the webhook, and every call must carry a valid HMAC-SHA256 signature with a timestamp within five minutes.
* The token is only ever sent to the studio's own address; redirects are never followed.
* All article HTML is filtered with `wp_kses_post` before it is saved.
* Emails and IP addresses of commenters never leave your site.
* Disconnecting or deleting the plugin revokes the token on the studio.

== Installation ==

1. Download the plugin from your Content Studio project settings (Site connection and API) or from the API guide.
2. In WordPress go to Plugins → Add New → Upload Plugin, choose the zip file, install and activate.
3. Go to Settings → Content Studio and press "Connect in one click".
4. Approve the connection in Content Studio. You come straight back, connected.

To use a token instead, make one with full access in the studio and paste it under "Connect with an API token instead".

If WordPress cron is disabled on your server (`DISABLE_WP_CRON`), make sure a server cron calls `wp-cron.php` every few minutes.

== Frequently Asked Questions ==

= Do I need to write any code? =

No. Everything is set from Settings → Content Studio.

= Can I review articles before they go live? =

Yes. Choose "Keep as a draft for me to review" under Publishing. The studio counts an article as published when you publish it.

= What happens if I disconnect? =

The token is revoked on the studio and nothing more arrives. Articles already published stay exactly as they are.

= My site is not WordPress. =

Content Studio has a public API for any platform. See the API guide in the studio.

== Changelog ==

= 1.2.0 =
* A site whose host cannot reach the studio's public address falls back to its direct address.

= 1.1.0 =
* New articles are handled the moment the webhook arrives, even on a site with no visitors at that time.
* The first change of the publish mode away from the defaults now reaches the studio too.
* A full sync replaces the studio's list of pages, so posts deleted while disconnected no longer linger there.
* A token from another site's project, or for a project already connected elsewhere, is refused with a clear message.
* The reason a connection or test failed is shown right in the notice.
* The event log names each job, and why a connection ended, in plain words.
* The studio's articles are marked in the posts list.

= 1.0.0 =
* First release: one-click connect, publish modes, media library copies, Yoast SEO and Rank Math fields, safe page updates, site sync, signed webhooks, status page and Site Health checks.
