=== Pipeline Buster ===
Contributors: hhmentalhh
Tags: woocommerce, ai, product onboarding, content generation, automation
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.8.14
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Stop writing product listings by hand. Upload images — Pipeline Buster generates complete descriptions, How To guides, and SEO fields automatically.

== Description ==

**Pipeline Buster** eliminates the most painful part of running a WooCommerce store: writing product content from scratch.

Drop in your product photos, packaging shots, and manual pages. The AI reads everything using vision, extracts specs and features, writes a complete product listing, and creates a matching "How To Use" post — published and linked in one pass. No copy-pasting. No tab-switching. No blank page.

**Core workflow:**

1. Upload product images (drag & drop — up to 10 images)
2. Select your tone, content depth, and How To format template
3. Review and edit everything before it goes live
4. Publish — product listing + How To post created and linked automatically

**What gets generated:**

* Full product description (SEO-optimized, structured)
* Short description with How To link
* Yoast SEO focus keyword and meta description
* Complete "How To Use" post with step-by-step guide
* Product images, featured image, and gallery — all set automatically
* Bidirectional product ↔ How To post link injection

**Content controls:**

* **Tone:** Professional, Friendly, Technical, Playful, Philosophical, or Custom (write your own style brief)
* **Depth:** Express (tight, conversion-focused), Standard (balanced), Rich (SEO-dense, long-form)
* **How To Format Templates:** Choose a structural skeleton before AI runs — step-by-step, narrative, quick start, and more. AI fills it, you approve it.
* **Tone Reference:** Select an existing post as a style example — AI matches it. No extra API cost.
* **Custom Style Brief:** Describe your brand voice in your own words. AI writes in that voice.
* **Any Language:** Write your Custom tone brief in Spanish, French, Portuguese, German, Japanese, or any language your AI provider supports — and every output (description, How To guide, Yoast focus keyword, meta description) is generated natively in that language. Not translated. Written from scratch. Your store is search-ready in the target language from day one.

**Two review modes:**

* **Simple mode** — essentials only: name, price, stock, categories. Everything else auto-filled.
* **Expert mode** — every field visible and editable before publishing.

**Guide Mode (How To Only):**

Have a product listing already but missing the How To content? Switch to Guide Mode: upload manual photos or product images → AI writes the How To post only → optionally link it to an existing product. Perfect for stores with image-only guides that need real text content.

**Built for real stores:**

Pipeline Buster was built on and battle-tested at a real WooCommerce store before public release. It handles discontinued products, niche devices, and incomplete image sets — cases where web search fails and AI vision fills the gap.

**Bring your own API key. Your data stays yours.**

Works with leading AI providers. Anthropic Claude is recommended for best results.

No data is stored on our servers. Your API key is encrypted locally using AES-256-CBC. Your images are sent directly from your server to your chosen AI provider — we never see them.

**Developed by [ZOA](https://zoa.captelek.net)**

== Installation ==

1. Upload the `pipeline-buster` folder to `/wp-content/plugins/`, or install via the WordPress plugin installer
2. Activate the plugin through the **Plugins** screen in WordPress
3. Go to **Pipeline Buster → Settings** and enter your Anthropic or OpenAI API key
4. Go to **Pipeline Buster → New Product** and start uploading

**Requirements:**

* WordPress 6.0 or higher
* WooCommerce 7.0 or higher
* PHP 8.0 or higher
* An active Anthropic or OpenAI API key

== Frequently Asked Questions ==

= Which AI provider gives the best results? =

Anthropic Claude produces the best product copy, How To guides, and Yoast SEO fields for this use case. If you prefer a different provider, Pipeline Buster supports multiple leading AI services — results may vary.

= How much does it cost per product? =

Typical API costs run a few cents per product on Express depth, up to roughly $0.10–0.20 for Rich depth with a full image set. Standard depth falls comfortably between the two. Exact costs depend on your provider's current pricing and the number of images processed.

= Is my API key stored securely? =

Yes. The key is encrypted using AES-256-CBC with your WordPress authentication keys as the encryption seed. It is never exposed in the HTML source or stored in plain text in the database.

= Does it work on shared hosting? =

Yes. Pipeline Buster uses an asynchronous job queue (WP-Cron) to process AI requests in the background. Your browser never waits on a long PHP request — it polls for results. This was specifically designed for shared hosting environments with 30–60 second PHP timeout limits.

= Can I edit the content before publishing? =

Yes — the review screen shows every generated field and lets you edit freely before anything goes live. In Expert mode, all fields are visible at once. In Simple mode, you confirm the essentials and everything else is auto-filled.

= Does it work with Yoast SEO? =

Yes. Pipeline Buster writes directly to Yoast's focus keyword and meta description fields for both the product and the How To post. SEO traffic light indicators in the review screen show character count status in real time.

= What image formats are supported? =

JPEG, PNG, WebP, and GIF. Up to 10 images per run, 15MB total.

= Does it work with variable products? =

The current version creates simple (single-variation) products. Variable product support is on the roadmap.

= Can it generate product listings in languages other than English? =

Yes — and this is one of Pipeline Buster's most powerful capabilities. Write your Custom tone brief in any language your AI provider supports (Spanish, French, Portuguese, German, Japanese, Arabic, and many more) and the entire output is generated in that language: product description, How To guide, Yoast focus keyword, and meta description. Not translated — written natively. Your store is search-ready in that market's Google from the moment it publishes, with SEO fields targeting the right queries in the right language. No translation plugin required.

= What is Guide Mode? =

Guide Mode lets you skip the product creation step entirely. Upload manual pages or product photos, and Pipeline Buster generates only the How To post. You can optionally link it to an existing product in your store — the How To link is automatically injected into that product's short description.

= Can I use my own writing style? =

Yes. The Custom tone option lets you write a style brief in plain language — your brand voice, a reference writer, a specific personality — and the AI writes in that style. The Tone Reference option lets you select an existing post from your store as the style example.

= What happens if the AI output isn't right? =

Everything is editable in the review screen before publishing. If you want to regenerate, just go back and run it again with different tone or depth settings. Nothing is published until you click Publish.

== Screenshots ==

1. Step 1 — Drag and drop product images, choose tone, depth, and How To format template
2. Step 2 — Settings panel: content depth, tone style, and How To format template selection
3. Step 3 — Published product listing: full description and key features generated from images
4. Step 4 — Published How To guide: complete step-by-step post generated and linked automatically

== Changelog ==

= 1.8.14 =
* Improvement: Generation failures now capture the API's HTTP status code and a truncated error detail, giving more precise failure classification (rate limit vs. auth vs. provider error) than message-text matching alone
* Fix: paid-tier installs now correctly track lifetime generation count locally — previously stayed at 0 forever on the Reports page for paying customers
* Fix: paid-tier telemetry no longer overloads the same field used for free-tier lifetime counts with credit balance — corrected data on the operator side, no change to plugin behavior
* Improvement: opt-in feature-adoption signals (Guide Mode, templates, tone reference, language, AI provider) and funnel events (quota-wall reaction, Search Console connect/disconnect) reported to telemetry for operator visibility — no new data collected from end users, only aggregate feature usage on the store owner's own install

= 1.8.13 =
* Security: Google OAuth token exchange (auth code + refresh) now routed through a pipelinebuster.com proxy — client secret no longer ships in plugin code

= 1.8.12 =
* Security: rotated the Google OAuth client secret used by the Search Console integration; previous value invalidated

= 1.8.11 =
* Improvement: Process failure tracking — PHP-side errors (timeout, network, rate limit, auth, provider, parse, exception, no key, missing file) now reported to telemetry for operator visibility
* Improvement: JS-detected failures (cron never fired, PHP process killed, job not found) reported via lightweight AJAX endpoint
* Fix: JS polling silent infinite loop on `not_found` job status — now stops polling and reports correctly
* Improvement: JS process-killed watchdog raised from 240s to 300s to match PHP API timeout — eliminates false positive timeout alerts on slow-but-successful AI responses

= 1.8.10 =
* Security: $_FILES tmp_name validated with is_uploaded_file() before use in media_handle_sideload()
* Security: attachment_ids POST field sanitized with sanitize_text_field() before json_decode
* Security: colors POST field sanitized with sanitize_text_field() before json_decode
* Security: settings save() now receives only expected keys via array_intersect_key + wp_unslash
* Compatibility: pa_color taxonomy name derived via wc_attribute_taxonomy_name() — WooCommerce standard; no custom prefix conflict

= 1.8.9 =
* Build: removed .distignore — hidden files not permitted in WP.org distribution zips

= 1.8.8 =
* Security: GSC OAuth callback now uses wp_verify_nonce() on state parameter instead of custom transient — satisfies WP.org nonce requirement
* Security: $_FILES inputs sanitized with sanitize_file_name(), sanitize_mime_type(), absint()
* Prefix: transient key renamed pb_cache_150 → pipebu_cache_150 (4-char prefix compliance)
* Prefix: pa_color taxonomy registration wrapped in taxonomy_exists() guard
* Build: added .distignore to exclude deploy.py from distribution archive

= 1.8.7 =
* Quota enforcement moved server-side (pipelinebuster.com) — no local feature gate in plugin code (WP.org Guideline 5 compliant)
* Added 24-hour grace cache: installs that previously received server approval continue working during brief server downtime
* Telemetry endpoint upgraded to full usage handler with monotonic count and tamper log

= 1.8.6 =
* Output Language dropdown: 10 languages + Auto — generate product content natively in any supported language
* Fixed custom tone parse conflict when Output Language is active
* Fixed language instruction bleeding into JSON response structure
* UI strings swap client-side on language selection (Step 1 labels, placeholders, hints)

= 1.8.5 =
* Mode pills reflect correct selected state (Simple/Expert) when switching panels — active class syncs on panel transition
* Color variation review: stock quantity hint added below variations list
* Back button (Expert→Simple) now correctly sets state.uiMode and updates pill active class

= 1.8.4 =
* Color variation guide: light teal card treatment matching Step 3 variant rows
* Hero hint: added bottom margin separating it from Content Depth / Tone & Style card

= 1.8.3 =
* Polling timeout now state-aware: 90s if job never started (cron stuck), 240s if actively processing — prevents false timeouts on large image sets
* Color variation guide text matches hero hint style (12px, muted, uniform presentation)

= 1.8.2 =
* Simple/Expert mode pills: always visible; locked (non-interactive) from Step 2 onward; unlocked on reset/failure
* Price fields (Regular Price, Sale Price) always visible in Simple review — no longer hidden when color variations are active

= 1.8.1 =
* Color variation rows: card treatment with alternating teal/white backgrounds, padding, border-radius, and "Color N" label per row

= 1.8.0 =
* WP.org compliance: removed local feature gates for Guide Mode and Custom Tone — all features available on all tiers, credit quota is the only gate
* Freemius: is_premium set to false per WP.org guidelines; is_org_compliant remains true
* Prefixes: all functions, classes, constants, hooks, and option keys renamed from pb_/PB_ to pipebu_/PIPEBU_ (4-char minimum compliance)
* Enqueue: inline script and style blocks converted to wp_enqueue_script/wp_add_inline_script and wp-admin.css
* External services: readme now fully documents Google OAuth/GSC, Freemius, and pipelinebuster.com telemetry

= 1.7.0 =
* Color Variation System: checkbox to flag multi-color products, second AI call detects color names from images, review panel shows per-color rows with thumbnail + editable name + price, publishes as WooCommerce variable product with pa_color attribute and one variation per color

= 1.6.16 =
* Wall offer system: personal 3-day countdown (pb_wf/pb_wfh HMAC-secured), admin sale toggle (pb_sale), tier-up offer at quota wall with next plan name/price/savings and dynamic checkout URL

= 1.6.15 =
* Credit system: grant/deduct/strip/wall — replaces binary paid/free quota model. HMAC-secured balance + high-water-mark + license dedup. Freemius hook integration.

= 1.6.13 =
* Security hardening: stable independent HMAC key (pb_s5) — not derived from WordPress AUTH_KEY
* Attribution system: visible tag on free tier, HTML comment on all tiers, clean output on paid
* WC Admin badge, Reports page, Help & Docs page (8 sections)
* Custom tone gate — Starter+ only; server-side enforcement
* Image role tagging UI (Hero, Front, Side, Back, Detail, Box, Manual)
* Plugin icon deployed

= 1.6.0 =
* Quota system: 5-product lifetime free tier with HMAC tamper detection
* Freemius SDK integrated — licensing and upgrade flow
* Guide Mode quota enforcement: Starter+ required (free tier upgrade wall)
* Dev mode flag (pb_s2) for internal testing

= 1.5.0 =
* Google Search Console OAuth integration
* Baseline snapshot — capture T=0 GSC metrics before PB content goes live
* Before/after performance comparison dashboard

= 1.4.0 =
* Page-level banner placement
* Banner improvements across all wait states
* expressPay content filter (tone reference search quality)

= 1.3.x =
* Publish success delay for banner visibility
* Dropzone hides cleanly during upload
* Banner spacing and layout polish
* "Format used" label in Simple and Expert review modes
* Back button Expert → Simple preserves price, stock, and categories

= 1.2.x =
* Template card preview injected into review panels (full card in Expert, badge in Simple)
* SEO traffic light indicators on meta description fields
* Custom tone guard — blocks generate if Custom selected with no style input
* Tone Reference Selector — pick an existing post as AI style example
* Pre-built How To Format Templates with skeleton card previews
* Guide Mode — How To Only path, bypasses product creation
* Product Selector for linking How To posts to existing products
* Async job queue via WP-Cron — shared hosting compatible

= 1.1.x =
* Simple / Expert review mode toggle
* Expert mode carries price, stock, category from Simple
* Back button preserves analysis (no re-run needed)
* max_tokens bumped to 8192 (Rich mode no longer truncates)
* 3-attempt JSON parse with control character stripping
* Poll interval optimized for shared hosting

= 1.0.0 =
* Initial release — full async pipeline: upload → AI analyze → review → publish
* Anthropic Claude and OpenAI GPT-4o provider support
* AES-256-CBC API key encryption
* Yoast SEO field integration
* Bidirectional product ↔ How To post linking

== External Services ==

Pipeline Buster sends data to third-party AI services to analyze product images and generate content. By using this plugin, you agree to the terms and privacy policies of the service you configure.

**Anthropic (Claude API)**
When Anthropic is selected as your AI provider, product images and a structured text prompt are transmitted to Anthropic's API for content generation.
- Service: https://www.anthropic.com
- Terms of Use: https://www.anthropic.com/legal/aup
- Privacy Policy: https://www.anthropic.com/legal/privacy

**OpenAI (GPT-4o)**
When OpenAI is selected as your AI provider, product images and a structured text prompt are transmitted to OpenAI's API for content generation.
- Service: https://openai.com
- Terms of Use: https://openai.com/policies/usage-policies
- Privacy Policy: https://openai.com/policies/privacy-policy

**What is transmitted:**
- Product images uploaded during the active session (sent directly from your WordPress server to your chosen AI provider)
- A structured text prompt containing content instructions (no personally identifiable information)

**Google Search Console (optional)**
If you connect Google Search Console in Settings, Pipeline Buster uses Google OAuth 2.0 to request read-only access to your GSC data. An OAuth access token and refresh token are stored encrypted on your server. GSC data (impressions, clicks, average position) is fetched to display a before/after baseline in the Reports page. No GSC data is stored outside your server.
- Service: https://search.google.com/search-console
- Terms of Use: https://policies.google.com/terms
- Privacy Policy: https://policies.google.com/privacy

**Freemius (licensing)**
Pipeline Buster uses Freemius to handle license activation and credit purchases. When you activate a license or make a purchase, Freemius receives your site URL, WordPress version, and plugin version for license validation. No product content or customer data is shared.
- Service: https://freemius.com
- Terms of Use: https://freemius.com/terms/
- Privacy Policy: https://freemius.com/privacy/

**Pipeline Buster service (quota and usage)**
Before each generation, Pipeline Buster contacts pipelinebuster.com to check whether the install is within its service quota. After each successful generation, an anonymous usage ping is sent. Both requests contain only: a one-way hash of your site domain (not reversible to a URL), the plugin version, and usage count. No product content, customer data, images, or personally identifiable information is transmitted.
- Service: https://pipelinebuster.com
- Terms of Use: https://pipelinebuster.com/terms/
- Privacy Policy: https://pipelinebuster.com/privacy/

**What is NOT transmitted to any service:**
- Customer data or order history
- Store credentials or payment information
- Any data outside the active product session

Your AI API key is stored encrypted on your own server and is transmitted only to the AI provider you select (Anthropic or OpenAI) during content generation.

== Upgrade Notice ==

= 1.6.13 =
Recommended update. Security hardening, quota system, Freemius licensing, attribution, Reports and Help pages.

