=== PlanBatch ===
Contributors: siaccslv
Tags: auto post, social media, instagram, bluesky, woocommerce
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Auto-share new posts to Instagram, Facebook, Bluesky, LinkedIn profiles and Pinterest, and drip-schedule old posts and products.

== Description ==

PlanBatch shares your WordPress posts and WooCommerce products to Instagram, Facebook, LinkedIn, Bluesky and Pinterest, as a link with a caption or as a branded image made from your own template. It connects your site to your PlanBatch account (https://planbatch.com), which renders the images, schedules the posts and publishes them through each network's official API.

What the plugin does:

* **Auto-share new posts.** When a post, page, product or any post type you pick is published, PlanBatch schedules a social post for it on the networks you chose.
* **Drip-schedule what you already have.** Tools, PlanBatch Bulk Share takes posts and WooCommerce products you published long ago and spreads them over the days and times you choose, one per slot, so a back catalogue becomes weeks of posts in one go. Products can go out as a carousel of their gallery images.
* **Re-share older posts automatically.** Turn on recycling and PlanBatch re-shares content it has already published for you to Facebook, Instagram and LinkedIn on a schedule you set, within your plan's monthly allowance. Mark any post "Never recycle" from the posts list to keep it out.
* **Branded images from your templates.** Pick a PlanBatch template and each post fills it with its own title, text and featured image. A template's text fields can take the post's own text or a value you type, an emoji field is a dropdown of the emoji PlanBatch can draw, and an icon field searches the icons PlanBatch can draw, with a preview.
* **Every post in a bulk share can differ.** Bulk Share sets the defaults for the whole batch, then any selected post can have its own template, field values, caption, first comment and networks. A post starts from its own PlanBatch panel when it has one.
* **Captions you control.** A caption pattern with {title}, {url}, {excerpt}, {hashtags} and {price} placeholders, an optional first comment for the link, and tracking parameters added to the link.
* **Per-post overrides.** A PlanBatch panel on the post editor gives one post its own template, text, caption, networks and time, or turns sharing off for it.
* **Status on the posts list.** A PlanBatch column shows whether each post is scheduled, skipped or not sent yet, and why.

Networks: Instagram, Facebook, Bluesky, LinkedIn profiles and Pinterest are live. A Pin needs a branded image and a board. LinkedIn Pages and Threads are built in PlanBatch and in review with those platforms; they are not available to customers until each platform approves them, and Threads appears in the plugin only for accounts PlanBatch has given early access.

Behind the plugin, PlanBatch is a bulk social media tool: it turns a spreadsheet, a form, your images and videos, or your WordPress posts into branded posts and publishes them from one calendar. Every post the plugin schedules appears in that calendar, where you can edit, move or delete it before it goes out. The plugin itself is a thin client and renders nothing on your server.

A PlanBatch account is required. The free plan needs no payment details and includes 20 scheduled posts and 30 generated images a month, 2 connected channels and 1 brand. Paid plans start at $19 a month (prices exclude VAT).

== 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.
* When you search an icon field: the text you typed, to list matching icon names. Your browser then loads small pictures of icons from planbatch.com.
* When a template preview is drawn while you edit: the template and the field values on screen, to draw the picture. Nothing is stored.
* When you use Prepare for AI in Bulk Share: for each selected post, its title, link, summary, subheadings with their first sentence, categories and tags, so PlanBatch can write the prompt. Nothing is stored and nothing is sent to any AI service; you copy the prompt into the assistant you choose.
* When you import an assistant's answer: the text you pasted, to check it against your templates. Nothing is stored or scheduled until you press Schedule.
* When Bulk Share shows a template preview: a request for that template's preview, and your browser then loads the picture from PlanBatch's image storage through a link that expires within the hour.

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?utm_source=wordpress.org&utm_medium=plugin-listing 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?utm_source=wordpress.org&utm_medium=plugin-listing. The free plan requires no payment details and includes 20 scheduled posts and 30 generated images a month and 2 connected channels; higher volumes need a paid plan, from $19 a month excluding VAT.

= Which social networks can it post to? =

Instagram, Facebook, Bluesky, LinkedIn profiles and Pinterest. A Pin needs a branded image and a board, so Pinterest auto-shares only when both are set; a post without them is left out of Pinterest and the PlanBatch column says so. LinkedIn Pages and Threads are in review with those platforms and become available when each one approves PlanBatch. A Facebook Page and the Instagram account linked to it count as two connected channels.

= Can it share posts I published before installing it? =

Yes. Tools, PlanBatch Bulk Share lists your published posts, pages and products. Select the ones you want, pick the days of the week and times of day, and PlanBatch schedules one item per slot until all of them are placed. Anything already shared through PlanBatch is skipped unless you tick "Share these again".

= Does it work with WooCommerce? =

Yes. Products can auto-share when published and can be bulk shared like posts. The {price} placeholder adds the price as the shop shows it, sale price included, and Bulk Share can post a product's gallery images as a carousel of up to 10.

= 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. To share older posts again on purpose, use recycling on the settings page or "Share these again" in Bulk Share.

= Does it generate images on my server? =

No. Images are rendered by PlanBatch from your templates. Your site sends the post's title, excerpt, link and image address, and nothing heavy runs in WordPress.

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

In your PlanBatch calendar at https://planbatch.com. The plugin shows whether scheduling succeeded; the calendar is where you change a post before it publishes.

= 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: the connection, the post types that auto-share, image mode, caption pattern, first comment and link tracking.
2. The PlanBatch panel on the post editor: give one post its own template, template text, networks, 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, and decide whether anything shared before goes out again.
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.6 =
Templates are chosen from thumbnails with a live preview, carousels are built from a post's own subheadings, and Bulk Share can prepare a prompt for an AI assistant and import its answer. Every post in a batch can differ. Pinterest can be auto-shared.

= 1.0.5 =
Listing and readme refresh only. No change to how the plugin works.

= 1.0.4 =
A template's emoji field is now a list of the emoji PlanBatch can draw, instead of a text box.

= 1.0.3 =
The link to connect accounts opens PlanBatch's Connections page.

= 1.0.2 =
Bluesky can be chosen wherever the other networks can, once a Bluesky account is connected in PlanBatch. Pinterest is now chosen per post, with its own board picker.

= 1.0.1 =
Auto-share no longer sends to Pinterest from the site-wide defaults. Tick Pinterest in a post's PlanBatch panel to publish that post as a Pin.

= 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.6 =
* New: templates are chosen from thumbnails drawn in your brand, with the one that suits the post suggested first, and a live preview redraws as you type.
* New: carousel templates post as a carousel from WordPress: a cover, steps started from the post's own subheadings, and a closing slide, all editable.
* New: fields start from what the post already says: its title and summary as placeholders, and a number from the title, its category and a fitting icon as values you can change. Nothing is filled with invented text.
* New: Bulk Share can prepare a prompt for ChatGPT, Claude or another assistant, and import its answer to fill each post for you to check before scheduling.
* New: Bulk Share has an Each post section. Every selected post starts from the batch settings, or from its own PlanBatch panel when it has one, and can be given its own template (with a preview drawn in your brand), field values, caption, first comment and networks.
* New: icon fields search the icons PlanBatch can draw and show the chosen one, in Bulk Share and in the post's PlanBatch panel. PlanBatch now refuses an icon name it cannot draw instead of publishing a blank.
* Changed: Pinterest can be a site default for auto-share, like any other network. A post is left out of Pinterest only when it has no branded image or no board, and the PlanBatch column says so.
* Changed: settings that only apply to some networks (the Pinterest board, Story placements) show only while those networks are ticked, and product galleries only on a site with products.
* Changed: when the Pinterest account has no boards yet, the plugin says so instead of showing an empty list.
* New: Threads appears for accounts PlanBatch has given early access while Threads is in review.
* Changed: the plugin listing and readme name Pinterest as live, alongside Instagram, Facebook, Bluesky and LinkedIn profiles. LinkedIn Pages and Threads stay in review.
* Fixed: in the block editor, the Mode and Pinterest board lists no longer run past the edge of the PlanBatch panel, and updating the plugin can no longer leave the browser running an older copy of its scripts.
* Changed: when WordPress gives no usable excerpt (common on page-builder posts), the post's opening sentence is shared as its summary instead of the title alone. An excerpt you wrote is always used as written.
* Changed: the default template can be chosen from thumbnails in Settings whatever the image mode, since a post can switch to a branded image on its own. With no default set, a post's PlanBatch panel asks for a template instead of offering an empty default.
* Changed: a carousel template is described by what a post can hold (a cover, 1 to 8 steps and a closing slide) rather than by how many slide designs the template has.
* Changed: in Bulk Share, Prepare for AI follows the image mode: when the batch shares links, the prompt asks for captions only and offers no templates. Import says when an answer chose images that a link batch cannot use.
* Changed: the Bulk Share prompt asks for captions on the ticked networks only, with each network's caption and image limits. When they take carousels of different lengths (Pinterest 5, Bluesky 4), you choose between the same slides everywhere or a shorter carousel written for those networks, with the most images a post can cost either way. A post shows which networks got their own slides, and can give them its carousel instead.

= 1.0.5 =
* Changed: the plugin listing and readme describe what the plugin does today, including Bulk Share, recycling and which networks are live or in review. No code change.

= 1.0.4 =
* Changed: a template's emoji field, in a post's PlanBatch panel and in Bulk Share, is a list of the emoji PlanBatch can draw on the image. Any other emoji used to come out as a box; PlanBatch now refuses it.

= 1.0.3 =
* Changed: the link to connect accounts now opens the Connections page in PlanBatch, where connected accounts now live, instead of Settings.

= 1.0.2 =
* New: Bluesky. A Bluesky account connected in PlanBatch can be chosen in the settings, in a post's PlanBatch panel and in Bulk Share, with its own first comment. Evergreen recycling does not post to Bluesky.
* Changed: Pinterest is no longer offered among the site-wide auto-share networks, because it could never auto-share: Pinterest wants every Pin chosen by hand. Tick it on the post itself, in its PlanBatch box, as before.
* New: a Pinterest board picker in each post's PlanBatch box, shown once Pinterest is ticked. The settings page keeps a default board, which the picker starts from.
* Changed: the PlanBatch box greys out networks that are not connected in PlanBatch, as the settings page already did.
* Fixed: uninstalling the plugin also removes its cached templates and boards.

= 1.0.1 =
* Changed: auto-share no longer sends to Pinterest from the site-wide defaults. A post is published as a Pin only when Pinterest is ticked in its own PlanBatch panel, because Pinterest requires each Pin to be chosen. If the defaults include Pinterest and a post has no such choice, the other platforms are shared as before and the PlanBatch column says Pinterest was left out. Bulk Share, where you pick each post, is unchanged.
* Changed: the PlanBatch panel no longer ticks Pinterest for you from the site defaults.
* Changed: the sign-up links on the settings page and in this readme say they came from the plugin, so PlanBatch can tell how people find it. Nothing is sent from your site.

= 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.
