=== Pilotdeck Connector ===
Contributors: aveosoft
Tags: seo, schema, faq schema, auto publish, content automation
Requires at least: 5.7
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Publish content from Pilotdeck into WordPress with the SEO meta and FAQ schema that the core REST API silently discards.

== Description ==

If you have ever published to WordPress from an external tool and found the SEO fields
empty afterwards — no meta description, no focus keyword, no canonical — this plugin
exists for that exact problem.

Pilotdeck Connector publishes content from [Pilotdeck](https://pilotdeck.co) into this
WordPress site with the meta title, meta description, focus keyword, canonical URL and
FAQ structured data all intact, written into whichever SEO plugin you already use.

**Why a plugin is needed at all**

WordPress core already exposes `/wp/v2/posts`, so creating a post remotely needs no
plugin. What core cannot do is write SEO meta. Yoast, Rank Math, All in One SEO and
SEOPress store their fields as post meta that is not registered with `show_in_rest`,
so core accepts the request, returns `201 Created`, and discards those fields without
an error. For an SEO workflow that is a broken publish, not a partial one.

This plugin closes that single gap. Its surface is deliberately small.

**What it does**

* Creates and updates posts sent from your Pilotdeck account.
* Writes meta title, meta description and focus keyword to whichever supported SEO
  plugin is installed — Yoast SEO, Rank Math, All in One SEO or SEOPress. If none is
  installed, posts still publish normally.
* Writes the canonical URL for Yoast, Rank Math and SEOPress.
* Outputs FAQPage (`schema.org`) structured data in the page head, which SEO plugins
  do not generate because they cannot infer questions and answers from prose.
* Sets the featured image from a remote URL, including images served by CDNs from
  paths with no file extension.
* Assigns categories and tags, creating any that do not already exist.
* Honours a future publish date by scheduling the post rather than publishing it.

**How connecting works**

On activation the plugin generates a random 48-character key and stores it on your
site. Settings → Pilotdeck shows an Integration Key that packs your site address and
that key together, so you paste one value into Pilotdeck instead of two. You can
regenerate the key at any time, which immediately stops any previous copy from working.

Requests arrive over your site's REST API and must present that key. Nothing else can
publish through this plugin.

== External services ==

This plugin is a connector for **Pilotdeck** (https://pilotdeck.co), a paid third-party
content and SEO platform from Aveo Software. The plugin is not useful on its own — it
exists so that a Pilotdeck account can publish into this site.

**How data flows**

The plugin does **not** send your site's content, credentials or visitor data anywhere.
It does not phone home, collect analytics, or contact Pilotdeck on its own. It only
listens.

Pilotdeck connects *inbound* to your site's REST API and sends the content you have
asked it to publish. When it does, the plugin returns:

* the created or updated post ID, its public URL and status;
* your site name, site URL and WordPress version;
* which SEO plugin is installed, and the user ID configured as the post author.

That information is returned only in response to a request that already carries your
Integration Key, and only to whoever made that request.

**One outbound request**

When a publish request includes a featured image URL, your site downloads that image
so it can be added to your media library. The request goes to whatever host that image
is on — normally Pilotdeck's own storage or your image CDN. No other outbound requests
are made.

**Terms and privacy**

* Pilotdeck: https://pilotdeck.co
* Terms of Service: https://pilotdeck.co/terms
* Privacy Policy: https://pilotdeck.co/privacy

By connecting this site to Pilotdeck you are subject to those terms. A Pilotdeck account
is required to use this plugin.

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings → Pilotdeck**.
3. Copy the Integration Key.
4. In Pilotdeck, go to **Integrations → WordPress** and paste the key. There is nothing
   else to fill in — the key already contains this site's address.

Serve your site over HTTPS. The settings screen warns you if it is not, because the key
would otherwise travel in clear text.

== Frequently Asked Questions ==

= Do I need a Pilotdeck account? =

Yes. The plugin is a connector; it does nothing without a Pilotdeck account sending
content to it.

= I installed this without a Pilotdeck account. What happens? =

Nothing. The plugin generates a key, adds one settings screen, and waits. It does not
alter your posts, your theme, your database beyond two options, or your site's front end
until a connected Pilotdeck account publishes something. You can deactivate and delete it
and the site is exactly as it was. If you want to see what it would publish, there is an
overview at https://pilotdeck.co.

= Do I need an SEO plugin? =

No. Posts publish normally either way. If Yoast SEO, Rank Math, All in One SEO or
SEOPress is installed, the plugin also fills in the SEO fields. If none is installed,
there is simply nowhere for a meta description to go.

= Where is the Integration Key stored? =

In your site's options table, like any other WordPress setting. It is generated on your
site and never transmitted by the plugin. Treat it like a password: anyone holding it
can publish to your site.

= What happens if I regenerate the key? =

The previous key stops working immediately, everywhere it was pasted. Publishing resumes
once you paste the new key into Pilotdeck.

= Can Pilotdeck overwrite my existing pages or posts? =

No. Updates are only ever applied to posts this plugin created on this site. A request
that points at anything else — a page, or a post written by a human — is refused rather
than overwritten.

= I pasted a valid key and still get an authentication error. =

Some servers, mainly Apache running PHP over CGI or FastCGI, strip the `Authorization`
header before WordPress sees it. The plugin checks the standard fallback used by those
setups and also accepts an `X-Pilotdeck-Key` header. If it still fails, ask your host to
pass the `Authorization` header through to PHP.

= What is removed when I delete the plugin? =

Both of its options and the post meta it wrote. Your posts, images, categories and tags
are left untouched — they belong to your site.

== Screenshots ==

1. Settings → Pilotdeck. The Integration Key is generated on your own site; copy it once and paste it into Pilotdeck.
2. The Plugins screen, with a direct Settings link and a prompt explaining what to do next after activation.

== Changelog ==

= 1.2.1 =
First public release on WordPress.org.

* Publishes posts sent from Pilotdeck, with meta title, meta description, focus keyword
  and canonical URL written to Yoast SEO, Rank Math, All in One SEO or SEOPress.
* Emits FAQPage structured data in the page head.
* Sets the featured image from a remote URL, including CDN paths with no file extension.
* Assigns categories and tags, and schedules future-dated posts.
* Restricts updates to posts this plugin created, so a stale post ID cannot overwrite
  unrelated content.
* Works on hosts that strip the `Authorization` header, via the standard fallback and an
  `X-Pilotdeck-Key` alternative.
* Removes its options and post meta when the plugin is deleted.
