=== PlanBatch ===
Contributors: siaccslv
Tags: social media, auto share, social media scheduling, auto post, social images
Requires at least: 5.8
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

Turn published posts into branded social images from your own templates, then schedule them to Facebook, Instagram and LinkedIn.

== Description ==

PlanBatch connects your WordPress site to your PlanBatch account (https://planbatch.com). When you publish a post, PlanBatch renders a branded image for it from one of your own templates and schedules a social post on the channels you connected: Facebook, Instagram or LinkedIn. You can also share the link with a caption instead, if that is all you want.

You choose per site:

* Which post types trigger auto-share.
* Whether to share the link with a caption, or generate a branded image from one of your PlanBatch templates.
* A caption pattern with {title}, {url} and {excerpt} placeholders.
* Which platforms to post to.

The plugin is a thin client. Image generation, caption building, scheduling and publishing all happen in your PlanBatch account, and every scheduled post is visible and editable in your PlanBatch calendar before it goes out.

A PlanBatch account is required. PlanBatch has a free plan; higher volumes need a paid plan.

== External services ==

This plugin is a client for PlanBatch (https://planbatch.com), a social media scheduling service operated by the plugin author. The plugin makes no external requests until you explicitly connect the site from Settings, PlanBatch.

What is sent, and when:

* On every request once connected: the plugin's version number, in a header. It is recorded against this site's API key so that support knows which version a site runs. It is not used for anything else and it identifies the site's key, not a person.
* When you click Connect: your site URL and site name, to create the connection request.
* When a post you configured for auto-share is published: an identifier built from your site URL and the post ID, the post title, its excerpt, its permalink, its featured image URL, its tag names (used for the {hashtags} placeholder), and for a WooCommerce product its formatted price. Alongside these go the settings you chose: caption pattern, first comment pattern, link tracking parameters, platform and placement choices, the template, any template field values, and a scheduled time if you set one.
* When you use Tools, PlanBatch Bulk Share: the same for each item you selected, in one request. If you enable gallery images, this includes the WooCommerce product gallery image URLs for the selected products.
* When you open the plugin settings page or the bulk share page while connected: authenticated requests for your PlanBatch plan, connected channels, templates, a template's field list, and Pinterest boards, to populate the forms.

PlanBatch downloads the images a shared post references and stores its own copy, so that a post scheduled for later still publishes with its image if the original is moved or deleted.

Nothing is sent before you connect. No browsing data, no visitor or analytics data, no content of unpublished posts, no post content beyond the fields listed above, and nothing from post types you did not select.

What is sent, in plain language: https://planbatch.com/wordpress/data
Terms of service: https://planbatch.com/terms
Privacy policy: https://planbatch.com/privacy

== Installation ==

1. Create a PlanBatch account at https://planbatch.com/signup if you do not have one. The free plan needs no payment details and is enough to use this plugin.
2. Install and activate the plugin.
3. Go to Settings, PlanBatch and click Connect to PlanBatch.
4. Approve the connection in the PlanBatch tab that opens, and pick which of your brands this site belongs to.
5. Choose post types, image mode, caption pattern and platforms, then save.
6. Publish a post. The PlanBatch column on the posts list shows the share status.

== Frequently Asked Questions ==

= Do I need a PlanBatch account? =

Yes. The plugin is a client for PlanBatch and does no scheduling, rendering or publishing on its own, so nothing works without connecting an account. You can register at https://planbatch.com/signup. The free plan requires no payment details and covers 20 posts, 30 generated images and 2 connected channels a month; higher volumes need a paid plan.

= Does editing an already-published post share it again? =

No. Auto-share fires only when a post first becomes published. PlanBatch also deduplicates on its side, so a hook firing twice cannot create two social posts.

= Where do I see or edit the scheduled social posts? =

In your PlanBatch calendar at https://planbatch.com. The plugin only shows whether scheduling succeeded.

= How do I disconnect? =

Click Disconnect on the settings page, then revoke this site's API key in your PlanBatch settings.

== Screenshots ==

1. Settings, PlanBatch: connect the site, choose which post types auto-share, and set the caption pattern, first comment and link tracking.
2. The PlanBatch panel on the post editor: give one post its own template, summary, caption and time without changing the site-wide settings.
3. Tools, PlanBatch Bulk Share: drip-schedule posts and products you have already published, over the days and times you choose.
4. The posts list: a PlanBatch column showing whether each post is scheduled, skipped or not sent yet, with the reason on hover.
5. Template fields on Bulk Share: leave "use the post's own text" ticked and every post fills that field with its own, or untick it and type one value for the whole batch.
6. The result in PlanBatch: the posts this site scheduled, spread over the days and times chosen in Bulk Share, ready to edit or move before they publish.

== Upgrade Notice ==

= 1.0.0 =
First public release. If you were running a pre-release copy, reconnect the site only if the settings page reports it is not connected.

== Changelog ==

= 1.0.0 =
* First public release.
* The plugin now tells PlanBatch which version it is, so a site running an old copy can be recognised rather than guessed at.

= 0.2.0 =
* New: a PlanBatch panel on the post editor, so a post can have its own template, placeholder text, caption, platforms and time instead of the site-wide settings.
* New: fill a branded template's own text fields per post, so templates that need a headline and a subline can be used from WordPress at all.
* New: turn sharing off for a single post, without changing the settings for every other post.
* New: choose whether a post scheduled in WordPress reaches the calendar when it publishes (recommended) or as soon as it is scheduled.
* New: a share is taken back off the calendar automatically if the post is trashed before it publishes, or corrected if its address changes.
* Fixed: WooCommerce prices were shared with the currency symbol as raw HTML, so a caption read "&#36;249.00" instead of "$249.00". Affected every currency.
* Fixed: a product on sale shared a caption repeating itself ("Original price was... Current price is..."). It now reads as the shop shows it, "$249.00 $199.00".
* Fixed: a post built with Divi, WPBakery or Fusion and no hand-written excerpt shared its layout markup ("[et_pb_section][et_pb_row]...") as the caption. The words inside are shared instead.
* Fixed: on Divi 5 the same post shared an empty caption instead, because the newer builder registers its shortcodes and WordPress then removed the text along with them.
* Fixed: a page built in Elementor shared no caption text at all, since Elementor keeps its content outside the post body. Its text is now read.
* Fixed: an [elementor-template] embed appeared in the caption as raw shortcode.
* Fixed: the PlanBatch box could sit below the visible area of the editor, so it looked like the plugin had no per-post settings at all. It now appears under the editor in the classic screen and in the sidebar in the block editor.
* New: the PlanBatch box shows the summary it will share and lets you replace it for one post, so you can see the wording before it goes out instead of after.
* New: a post with content that PlanBatch cannot read a summary from now says so on the posts list, instead of quietly sharing the title alone.
* New: if the summary PlanBatch reads still looks like page-builder code rather than a sentence, it is left out and reported instead of being posted to your accounts.

= 0.1.1 =
* Bulk Share: large selections are submitted in batches so the whole selection is scheduled, with visible progress.
* Bulk Share: warns before scheduling when link mode would exclude a channel that requires an image, instead of reporting it afterwards.
* Bulk Share: Add time now starts each new row half an hour after the last one.
* Fixed: a batch split into several requests could place two items on the same time slot.
* Fixed: a connected Instagram account could be reported as not connected.

= 0.1.0 =
* Initial release: connect flow, auto-share on publish with link or branded-image mode, caption pattern, per-platform selection, status column.
