=== Pinery Flow ===
Contributors: pinerypicks
Tags: amazon, affiliate, ai content, automation
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.6.4
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered Amazon affiliate content pipeline: pulls best sellers, generates lifestyle images and copy, and auto-publishes to your site.

== Description ==

Pinery Flow is an AI-powered content pipeline for Amazon affiliate sites. It collects products from Amazon best-seller categories, generates lifestyle images and product copy with your chosen AI provider, and auto-publishes ready-to-go posts to your WordPress site.

**Free plan** — the complete scrape → AI → publish loop, manually triggered:

* Amazon best-seller scraping (up to 2 categories)
* AI copy + lifestyle image generation via xAI (Grok), OpenAI, or Google Gemini (your own API key)
* Manual pipeline runs, up to 3 products per run
* Publish as blog posts, with SEO meta tags, Open Graph, Twitter Cards, and JSON-LD Product schema
* Amazon original-image hotlinking, ad zones, price overlays
* Works standalone or alongside the Pinery theme

**Premium** — automation, scale, and revenue optimizers:

* Scheduled hands-free automatic runs (set the interval and forget it)
* Unlimited categories and unlimited products per run
* Publish as WooCommerce affiliate products, or post + product together
* AI-written buyer FAQ under every description + FAQPage JSON-LD (the format AI answer engines cite)
* Amazon Creators API integration with hourly price refresh and on-page live price updates
* Priority support and lifetime updates (per-site license)

The Free plan works without a license. Entering a Pro license key instantly unlocks the premium features — no reinstall needed.

== Installation ==

1. Upload the plugin to your `/wp-content/plugins/` directory, or install it through the WordPress Plugins screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Open **Pinery Flow** in the admin menu and configure your AI provider, Amazon affiliate tag, and content settings.
4. (Optional) Enter your Pro license key under **Pinery Flow → Account** to unlock automation, unlimited volume and WooCommerce publishing.

== External Services ==

This plugin connects to the following external services. No data is sent anywhere without your configuration and consent:

* **Your chosen AI provider — xAI (api.x.ai), OpenAI (api.openai.com), or Google Gemini (generativelanguage.googleapis.com)**: used to generate product copy and lifestyle images. The plugin sends the scraped product title, price, and rating together with your own API key, only during pipeline runs you trigger or schedule. See the providers' terms: [xAI](https://x.ai/legal/terms-of-service), [OpenAI](https://openai.com/policies/terms-of-use), [Google](https://ai.google.dev/gemini-api/terms).
* **Amazon (www.amazon.com / creatorsapi.amazon / api.amazon.com)**: best-seller pages and product detail pages are fetched to collect public product data (title, price, rating, images, feature bullets); with Creators API credentials configured, the official API is used instead, including OAuth token requests. See [Amazon's Conditions of Use](https://www.amazon.com/gp/help/customer/display.html?nodeId=508088) and the [Amazon Associates Program terms](https://affiliate-program.amazon.com/help/operating/agreement).
* **Freemius (api.freemius.com / wp.freemius.com)**: handles licensing, secure checkout, and (only after you explicitly opt in) anonymous usage diagnostics. See the [Freemius privacy policy](https://freemius.com/privacy/) and [terms](https://freemius.com/terms/).

The plugin does not send any data to these services on behalf of your site's frontend visitors, except the optional live-price AJAX endpoint which serves cached prices only.

== Screenshots ==

1. Pipeline settings — Free-plan status card, recent runs, manual "Run Pipeline Now" and AI provider setup
2. Logs page — live auto-refresh, level filter and search across every pipeline step
3. In-dashboard Free → Pro plans and pricing
4. WooCommerce product created by the pipeline — "About this item" bullets and buyer FAQ (Pro)
5. Published blog post — live price refresh, Amazon buy button and buyer FAQ (Pro)

== Frequently Asked Questions ==

= Do I need an Amazon Associates account? =

Yes. You need an approved Amazon Associates account and tracking ID to generate compliant affiliate links.

= Which AI providers are supported? =

xAI (Grok), OpenAI, and Google Gemini. You supply your own API key for your chosen provider.

== Changelog ==

= 1.6.4 =
* WordPress.org readiness: passes the official Plugin Check with zero errors and zero warnings — full escaping/sanitization/unslash pass, safe redirects, wp_delete_file, gmdate, ordered i18n placeholders with translators comments
* readme: External Services disclosure and screenshots list; Tested up to 7.0

= 1.6.3 =
* New: Amazon "About this item" feature bullets are captured for every product and shown in the product summary column (below the category line)
* One-off backfill fills the bullets in for products created by earlier versions (runs automatically via WP-Cron after update)
* Logs auto-refresh now defaults to ON at a 5s interval, and the toggle survives the refresh itself (persisted in localStorage)

= 1.6.2 =
* Branded plugin icon on Freemius opt-in, pricing and account screens

= 1.6.1 =
* Version sync with Pinery theme 1.6.1 (no plugin changes)

= 1.6.0 =
* New: Free plan — the full scrape → AI → publish loop with manual runs, up to 2 categories and 3 products per run, publishing as blog posts
* Premium now gates: scheduled auto-runs, unlimited volume, WooCommerce publishing, buyer FAQ + FAQPage schema, Creators API + live price refresh
* Settings page shows plan status and marks premium features; free installs are no longer blocked outright

= 1.5.0 =
* Version sync with Pinery theme 1.5.0 (no plugin changes)

= 1.4.3 =
* Version sync with Pinery theme 1.4.3 (no plugin changes)

= 1.4.2 =
* Version sync with Pinery theme 1.4.2 (no plugin changes)

= 1.4.1 =
* New: AI copy now also writes a buyer FAQ — the 3 questions shoppers most want answered before purchasing, rendered below the product description on both blog posts and WooCommerce products
* New: FAQPage JSON-LD structured data on those pages — the Q&A format AI answer engines and Google rich results cite

= 1.4.0 =
* New: Publish As setting — create blog posts, WooCommerce External/Affiliate products, or both
* WooCommerce products get parsed prices, auto-mapped product categories, and the Amazon buy button
* Hourly price refresh and AJAX refresh now sync WooCommerce price fields
* Hotlinked Amazon images render on WooCommerce shop and product pages
* Product image gallery on WooCommerce product pages via Creators API

= 1.3.0 =
* Amazon Creators API integration with automatic fallback
* Improved price and rating overlays
* SEO meta, Open Graph, Twitter Card, and JSON-LD output
* License management and automatic updates
