=== PublishDeck ===
Contributors: frictionsort
Tags: syndication, content-distribution, remote-publishing, content-sync, multisite
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Write posts on one hub site and publish each to one of your WordPress sites as real, editable blocks. Nothing to install on those sites.

== Description ==

Running several WordPress sites means signing in to each one to publish, or copying posts by hand and losing images and blocks. PublishDeck gives your team **one hub** to write in and to see every post, site and result.

Write in the block editor on the hub, choose the post's site in the editor sidebar, and publish. PublishDeck sends it in the background as block markup, so it stays fully editable in that site's block editor, with its author, categories, tags, featured image and media.

The receiving sites need **nothing installed**: no companion plugin, no custom endpoint. PublishDeck uses the WordPress core REST API and an Application Password over HTTPS, so any up-to-date WordPress site can receive posts, including sites in a multisite network.

= Who it is for =

* **Publishers** running several niche or brand sites from one editorial team.
* **Agencies** writing and approving client posts in one place, each published to the client's site.
* **Organisations** with regional or department sites.

= Features =

* **Blocks stay blocks** - posts travel as block markup, never flattened to HTML.
* **One site per post** - connect as many sites as you need and send each post to the one it belongs on.
* **Two-way sync** - pull edits made on a site back into the hub, one post or all at once, with a conflict warning.
* **Block compatibility check** - each block is compared with the blocks the site has registered, so you are warned before one would not display there.
* **People and access** - find each site's users, match them to hub accounts by email, and set each person's level per site: Write (drafts for that site to approve), Publish or Editor.
* **Deleted copies are noticed** - the editor offers **Re-publish** or **Remove link**, and your hub post is never changed because of it.
* **Media** - images and files upload with the post, and are removed only when no other post sent from the hub uses them.
* **Dashboard, Content and Activity** - statistics, site health, every hub post with its state, quick edit, and a log of every push and pull with Retry.
* **Built to be safe** - pushes run in the background, a retried job never makes a second copy, and the hub post stays the source.

= How it works =

1. On the receiving site, create an Application Password for an account that can publish there.
2. On the hub, open **PublishDeck > Sites**, add the site's address with that account and password, and test the connection.
3. Write a post on the hub and choose the site in the editor sidebar.
4. Save or publish. A background job sends the post and records the result in **Activity**.

= External services =

PublishDeck connects only to the WordPress sites you add on its **Sites** screen. It sends nothing to the plugin author or any other service: no telemetry, no remote scripts or fonts.

It contacts a site when you connect it, when a post is published, updated, pulled, trashed or removed there, when you sync people, and on scheduled checks that the site is reachable and each copy still exists. Every request goes to that site's REST API at `/wp-json/`, over HTTPS, signed in with the Application Password you entered.

* **Sent:** the post's title, content, excerpt, slug, status, date, categories, tags, featured image and media; its sticky, format, comment, ping and password settings; footnotes and any post meta keys you allow in Settings. To credit the right author, the hub author's email address is sent as a search on the site's user list.
* **Read:** the copies of your posts, the site's registered blocks, and its users' names, email addresses and roles, to match them to hub accounts.

PublishDeck never creates, edits or deletes users on a connected site. Every site it talks to is one you connected, so no third-party terms apply.

= Source code and third-party libraries =

The admin screens (Vue 3) and the editor sidebar (React on WordPress's own editor packages) ship compiled in `assets/`. PHP dependencies: `composer install --no-dev`.

* **Action Scheduler** by Automattic, GPL-3.0-or-later, in `vendor/woocommerce/action-scheduler/`, runs background jobs. https://actionscheduler.org/
* **Vue** and **Vue Router**, MIT, compiled into `assets/admin/`. https://vuejs.org/
* **Fraunces** typeface, Copyright 2018 The Fraunces Project Authors, SIL Open Font License 1.1; the licence is in `assets/admin/assets/Fraunces-OFL.txt`. https://github.com/undercasetype/Fraunces

== Installation ==

= Requirements =

* **Hub site:** WordPress 6.9+ and PHP 7.4 to 8.4.
* **Receiving sites:** WordPress 5.6 or later with the REST API and Application Passwords enabled, served over HTTPS, and any permalink setting except **Plain**.
* **Multisite:** each site in a network is its own hub. Network activation sets up every existing site and each new one.

= Install =

1. In wp-admin, go to **Plugins > Add Plugin**, search for **PublishDeck**, then install and activate it.
2. Follow **How it works** above to connect your first site and publish.

= Optional settings in wp-config.php =

* `FSPD_ENCRYPTION_KEY` - a fixed key for encrypting stored Application Passwords. Recommended in production, so changing your WordPress salts does not make saved passwords unreadable.
* For local development and WordPress Playground only, each set to `true`: `FSPD_ALLOW_LOCAL` turns off the HTTPS, private-address and certificate checks; `FSPD_ALLOW_PRIVATE_HOSTS` allows private addresses, still over HTTPS; `FSPD_ALLOW_INSECURE_TLS` accepts self-signed certificates. Never set them on a live site.

== Frequently Asked Questions ==

= Do I have to install anything on the receiving sites? =

No. PublishDeck uses the WordPress core REST API and an Application Password.

= Does it convert my blocks to HTML? =

No. Posts are sent as block markup and stay fully editable in the receiving site's block editor.

= Does it send pages or custom post types? =

No, only posts. They are written in PublishDeck's own post type, which is not shown on the hub's front end.

= Can writers send posts for review instead of publishing them? =

Yes. Give a person **Write** access to a site and their posts arrive there as drafts for an editor on that site to publish. To send every post as a draft, turn on **Always push as draft** in Settings.

= Does Sync from sites work on a multisite network? =

Yes, if you connect the site with a Super Admin's Application Password. With a regular subsite administrator, WordPress lists only that account, so **Sync from sites** on the **Authors** screen finds nobody else.

= What happens if the post is deleted on the receiving site? =

The editor sidebar shows that the copy is gone and offers **Re-publish** or **Remove link**. Your hub post is never deleted or unpublished because of it.

= What does pulling change on the hub post? =

A pull brings back the title, content, excerpt, status, categories, tags and featured image. It keeps the hub post's own date, sticky setting, format and password. The hub takes the site's date only when the site scheduled the post, published it while the hub date was still in the future, or published, scheduled or made private a post the hub had never dated. To pull those fields too, return `true` from the `fspd_pull_presentation_fields` filter.

= Are the stored Application Passwords secure? =

They are encrypted with libsodium and tied to the site and account they belong to. In production, also set `FSPD_ENCRYPTION_KEY` (see Installation).

= What happens when I uninstall the plugin? =

Uninstalling deletes PublishDeck's own data on the hub: its tables, settings, post meta, queued jobs, capabilities and member role (people who had it keep their accounts, with no role). Hub posts stay in the database, and the copies on your sites are not touched.

== Screenshots ==

1. The dashboard: published, live, draft, failed and scheduled posts, with each site's output over time.
2. Sites: the health of every connected site, with offline sites and connection warnings flagged.
3. Connect a site with an Application Password and test the connection.
4. Content: every hub post with its site, author and copy state, with Edit, Quick Edit and Trash on each row.
5. Quick edit: a post's title, slug, status, date, author, tags and categories, from the list.
6. Write in the block editor, then choose the one site the post publishes to.
7. Every block is checked against the chosen site; a synced pattern that exists only on the hub can be expanded inline in one click.
8. When a copy is deleted on the site, the editor offers to publish it again or remove the link.
9. Authors: people matched by email across your sites, with their access level.
10. An author's page: posts per site, posts awaiting approval, recent work and per-site access.
11. Activity: every push, pull and change across your sites, filtered by date, action and outcome (dark theme).
12. Settings: publishing defaults and the custom fields allowed to travel with a post.

== Changelog ==

= 1.0.0 =
* Initial release.
