=== Woo2Fluent — WooCommerce to FluentCart Migrator ===
Contributors:      motacreative
Tags:              woocommerce, fluentcart, migration, import, subscriptions
Requires at least: 6.0
Tested up to:      6.7
Stable tag:        2.3.1
Requires PHP:      8.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Migrate WooCommerce products, orders, and customers directly into FluentCart — no CSV juggling required.

== Description ==

**Woo2Fluent** is the fastest way to move your store data from WooCommerce to [FluentCart](https://fluentcart.com/). When both plugins are active on the same WordPress install, data moves directly — no intermediate files, no manual cleanup.

**Free features:**

* Direct database-to-database migration (Products, Orders, Customers)
* Batch processing with live progress bars — no page refresh
* Simple, variable, grouped, and external product types
* Product images lazily sideloaded in the background so migration is never blocked
* Variation images queued via WP-Cron
* Full audit log with per-row status
* Re-import from saved history
* CSV Export / Import for cross-server (legacy) migrations
* Import modes: Create new only / Update existing only / Create + update
* Match by SKU or FluentCart Post ID
* Dry-run mode (simulate without writing to the database)

**[Pro features](https://motalabs.co.uk/woo2fluent/#pricing):**

* Coupon / discount code migration
* Tax rate migration
* WooCommerce Subscriptions migration
* YITH WooCommerce Subscriptions migration
* **Migration filters** — migrate a subset by subscription status (e.g. active only for a cutover), order status / date range, or product publish status. One-click "Cutover: active subscriptions only" preset. Available in the UI and via WP-CLI flags.
* **Stripe readiness check** — after migration, verify the migrated `cus_` references resolve in the Stripe account FluentCart is connected to and each has a payment method attached. Read-only; never charges or writes to Stripe. Catches the wrong-account / test-live mismatch before go-live.
* One-click "Migrate Everything" pipeline — all entities in a single automated run
* Priority email support

== Installation ==

1. Upload the `woo-to-fluentcart-migrator` folder to `/wp-content/plugins/` or install via **Plugins → Add New**.
2. Activate the plugin through the **Plugins** menu.
3. Navigate to **Tools → Woo → FluentCart**.
4. Go to the **Migrate** tab, select what to migrate, and click **Start Migration**.

== Frequently Asked Questions ==

= Does this work without WooCommerce installed? =
The export side requires WooCommerce to be active. FluentCart must be active as the import target. If you are migrating across servers, use the CSV Export tab on the WooCommerce server and the CSV Import tab on the FluentCart server.

= Will my existing FluentCart data be overwritten? =
Only if you choose "Update existing only" or "Create new + update existing" import mode. The default "Create new only" mode skips any product that already has a matching SKU in FluentCart.

= What happens to product images? =
Images are queued for background downloading (lazy sideload). The plugin uses `media_sideload_image()` and processes images via WP-Cron so migration is never blocked by slow image downloads. You can also trigger image processing manually from the **CSV Import** tab.

= What FluentCart version is required? =
The plugin targets FluentCart 1.x and above. Table names are detected at runtime via `SHOW TABLES LIKE`, so the plugin adapts gracefully to schema changes.

= My server times out during migration. What should I do? =
Lower the **Batch Size** (default 20). Each AJAX request processes one batch, so a smaller batch size keeps each request well within PHP's max_execution_time.

= Is there a Pro version? =
Yes — [Woo2Fluent Pro](https://motalabs.co.uk/woo2fluent/#pricing) adds coupon migration, tax rates, WooCommerce Subscriptions, YITH Subscriptions, and a one-click "Migrate Everything" pipeline.

== Screenshots ==

1. The **Migrate** tab — select entities and watch live progress bars.
2. **Migration History** — per-row log viewer with re-import controls.
3. **CSV Export** — products, orders, and customers for cross-server migrations.

== Changelog ==

= 2.3.1 =
* Fix: progress counters were wildly overstated on any entity large enough to
  need more than one batch. The server returns a running total each batch, but
  the browser was adding those totals together, compounding them — a 7,472
  order run reported "updated: 281,845". Counts are now assigned, not summed.
  Single-batch entities were always correct, which is why this went unnoticed.
* Fix: the migration filters panel put the "Orders from / to" date fields on the
  same line as the order status checkboxes, so they collided.
* New: Woo2Fluent's own admin screens no longer show other plugins' notices.
  A migration is a high-stakes, focused task and unrelated licence nags next to
  the Start Migration button are noise. Filter `wtfm_suppress_foreign_notices`
  to false to opt out.
* Rename: the plugin is now Woo2Fluent.

= 2.3.0 =
* New (Pro): Migration filters — narrow a run by subscription status, order
  status / date range, or product publish status. A "Cutover: active
  subscriptions only" preset does the standard active-only cutover in one
  click. Also exposed as WP-CLI flags (--subscription-status, --orders-status,
  --orders-since, --orders-until, --product-status); `wp wtfm status` previews
  the filtered counts.
* New (Pro): Stripe readiness check — verifies migrated `cus_` references
  resolve in FluentCart's connected Stripe account and each has a default
  payment method. Read-only (GET /customers only); the key is read from
  FluentCart's config in memory and never stored or logged. New "Stripe
  Readiness" tab and `wp wtfm readiness` command (exits non-zero if any
  reference is missing, so a deploy can gate on it).
* Engine: filter plumbing on the base migrator + products / orders migrators
  (dormant without Pro); free installs keep migrate-everything behaviour.

= 2.2.0 =
* Orders and Customers now migrate into FluentCart's NATIVE tables
  (fct_orders, fct_order_items, fct_order_transactions, fct_order_addresses,
  fct_customers, fct_customer_addresses) so they appear in FluentCart's admin,
  reports and customer profiles — previously they were written as hidden
  custom-post-type records.
* Money stored as integer cents; Woo statuses mapped to FluentCart's canonical
  set; refunds carried as payment_status=refunded with refund transactions.
* New shared write layer (WTFM_FCT_Writer) with email-deduped customer upsert.
* SKU rewriting is now opt-in via the `wtfm_migrate_sku` filter (the hardcoded
  MANP-→WOB- client rule is gone).
* Idempotent re-runs via deterministic uuids (woo-order-{id}).

= 2.1.0 =
* New: WP-CLI runner — `wp wtfm migrate` and `wp wtfm status` for running large
  migrations server-side over SSH instead of the browser AJAX flow.
* New: `--dry-run` flag for the direct migration path (map without writing).
* Supports `--entities`, `--mode`, and `--batch-size`; automatically picks up
  Pro-registered migrators (coupons, tax rates, WCS/YITH subscriptions).

= 2.0.0 =
* Complete rewrite — modular architecture replacing the original monolith.
* New: Direct migration tab (no CSV required).
* New: Per-entity live progress bars powered by AJAX batch processor.
* New: Abstract migrator base class — easily extensible by premium addons.
* New: `wtfm_register_migrators` action hook for third-party extensions.
* New: Pro addon support via tab filter hooks.
* Preserved: Full backward compatibility with existing CSV exports and history.
* Improved: Variation image queue now uses WP-Cron reliably.
* Fixed: `get_processor()` public accessor missing from plugin singleton.

= 1.3.3 =
* Bugfix: variation image queue reliability improvements.
* Added: reimport overlay with live progress bar.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.0 =
Major rewrite. All existing CSV history and saved exports remain compatible. No database schema changes.

== Privacy Policy ==

This plugin does not collect or transmit any user data. All migration processing happens within your own WordPress installation.
