=== Social Queue for Buffer ===
Contributors: ak
Tags: buffer, social media, autopost, crossposting, scheduling
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WordPress posts to Buffer with per-channel templates, scheduling, reposting, clear failure logs, and optional AI rewriting.

== Description ==

Social Queue for Buffer connects WordPress to Buffer's current API. It can send
new and updated posts, pages, and public custom post types to selected Buffer
channels. It also includes weekly reposting for older content.

Free features:

* Buffer OAuth 2 connection with PKCE, or a personal Buffer API key
* Multiple channel selection with live refresh
* Per-channel templates and scheduling overrides
* Per-post-type publish and update controls
* Queue, next-in-queue, immediate, and relative scheduling
* Category and tag filters
* Weekly repost engine
* Per-post override meta box
* Test Mode and Buffer draft mode
* Activity log with visible error states
* Import of compatible settings from WordPress to Buffer by WP Zinc

Optional hosted service:

* Cloudflare Workers AI can rewrite status text in seven styles
* AI output must keep the original URL and pass the plugin's length checks
* If AI is unavailable or rejects the output, the original text is posted
* AI logs state whether rewriting succeeded or the original text was used

The hosted AI service costs $5.99 USD monthly or $34.99 USD yearly for one
WordPress site. All local publishing, channel, scheduling, and repost features
remain free. The yearly option is the recommended value. Active subscribers can
open Stripe's Customer Portal from the AI & License page to update payment
details, change billing, or cancel.

This plugin is not affiliated with or endorsed by Buffer or WP Zinc. Buffer is
a trademark of its respective owner.

== External Services ==

This plugin connects to external services only when you configure or use the
related feature:

1. Buffer API

The plugin sends OAuth credentials or your personal API key to Buffer to list
channels and create scheduled posts. Status text, channel IDs, schedule choices,
and links are sent to Buffer when you publish or test a live send.

Buffer Terms: https://buffer.com/terms
Buffer Privacy Policy: https://buffer.com/privacy

2. Social Queue Premium Service

When you activate or validate a premium license, the plugin sends the license
key, WordPress site URL, and plugin version to the Social Queue service hosted
on Cloudflare Workers. When AI rewriting is enabled, it also sends the status
text and selected rewrite style. The service uses Stripe to confirm subscription
status and Cloudflare Workers AI to produce the rewrite. It does not send
executable code to WordPress.

Service: https://wp-to-buffer-licenses.trishul.workers.dev/health
Terms: https://marketmate.io/terms
Privacy Policy: https://marketmate.io/privacy

3. Stripe Checkout

The Buy Monthly and Buy Yearly buttons open Stripe-hosted checkout. Payment and
billing details are entered directly on Stripe. After payment, Stripe redirects
to the Social Queue service to display the license key.

Stripe Terms: https://stripe.com/legal/consumer
Stripe Privacy Policy: https://stripe.com/privacy

== Installation ==

1. Upload the plugin folder or install it from the WordPress Plugin Directory.
2. Activate Social Queue for Buffer.
3. Go to Settings > Social Queue for Buffer.
4. Register a Buffer app at https://publish.buffer.com/settings/api and save the
   redirect URI shown on the Connection page. Alternatively, enter a Buffer
   personal API key.
5. Connect to Buffer, refresh channels, and select default channels.
6. Configure Post Types and optional per-channel templates.
7. Enable Test Mode for the first dry run and review the Log page.

AI rewriting is optional. Purchase a monthly or yearly subscription on the
AI & License page, enter the license key shown after checkout, choose a style,
and run the built-in rewrite test before enabling it for live posts.

== Screenshots ==

1. Connect Buffer and see the exact firewall hosts required for outbound HTTPS.
2. Give each Buffer channel its own template and scheduling behavior.
3. Configure publishing rules, templates, categories, and tags by post type.
4. Schedule older content for weekly reposting with separate rules per post type.
5. Activate optional AI rewriting, choose a style, and test it before publishing.
6. Review successful sends, AI fallback, and failed channel sends in one activity log.

== Frequently Asked Questions ==

= Does WordPress run the AI model? =

No. AI rewriting runs on Cloudflare Workers AI. Your WordPress server and
computer do not need an LLM, proxy, SSH tunnel, or background process.

= What happens if AI rewriting fails? =

The original status text is used. The activity log records the failure and
labels the send as using the original text.

= What should a firewall allow? =

Buffer publishing requires outbound HTTPS to auth.buffer.com and api.buffer.com.
Premium license and AI calls require outbound HTTPS to
wp-to-buffer-licenses.trishul.workers.dev. A blocked premium request does not
block free publishing. Existing validated licenses keep a bounded grace period,
and an AI failure posts the original text.

Advanced installations can route the premium service through an approved HTTPS
proxy by defining WP2BL_SERVICE_URL in wp-config.php or filtering
wp2bl_service_url. Insecure HTTP overrides are rejected.

= Are per-channel settings paid? =

No. Per-channel templates and scheduling overrides are free. Payment is for the
hosted AI rewriting service.

= How many sites can use one AI subscription? =

One WordPress site. A license binds to the first site where it is activated.

= Is this the WP Zinc plugin? =

No. It includes an importer for compatible legacy settings, but it is an
independent plugin and is not affiliated with WP Zinc.

== Changelog ==

= 1.5.0 =
* Added explicit WordPress 6.0 and PHP 7.4 runtime guards.
* Added firewall allowlist guidance for Buffer and premium services.
* Added a validated HTTPS service URL override for approved corporate proxies.
* Preserved free publishing and original-text fallback when premium services are blocked.

= 1.4.0 =
* Added live monthly and yearly Stripe subscriptions for the hosted AI service.
* Added Cloudflare Worker license issuance, one-site activation, and validation.
* Added self-service Stripe billing and cancellation through Customer Portal.
* Replaced the local Mac proxy and SSH tunnel with Cloudflare Workers AI.
* Added seven AI rewrite styles and a connection/style test.
* Split administration into Connection, Channels, Post Types, Repost, AI, and Log pages.
* Added free per-channel template and scheduling overrides.
* Added explicit LLM enhanced vs fallback labels in send logs.
* Fixed partial settings saves erasing values owned by other admin pages.

= 1.3.0 =
* Added weekly reposting, status previews, AI fallback logging, and WP Zinc import improvements.

= 1.2.0 =
* Added setup checks and WP Zinc settings import.

= 1.1.0 =
* Added category and tag filters per post type.

= 1.0.0 =
* Initial release.
