=== Sell.AI Returns - Zwroty i Reklamacje ===
Contributors: creatywniwsiecipl
Tags: woocommerce, returns, refunds, complaints, consumer-rights
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.5.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered returns and complaints management for WooCommerce. Compliant with Polish consumer law and EU Directive 2023/2673.

== Description ==

**Sell.AI Returns** gives WooCommerce store owners a complete system for handling product returns (odstąpienie od umowy) and complaints (reklamacja / rękojmia) in compliance with Polish consumer law.

= Free plan features =

* Customer-facing return/complaint request form
* Admin panel for managing and resolving requests
* Automated email notifications (customer + merchant)
* PDF confirmation document generation
* Status tracking with customisable statuses
* WooCommerce order integration
* HPOS (High-Performance Order Storage) compatible
* Cart and Checkout Blocks compatible
* **Unlimited** return and complaint requests — no monthly cap

= Sell.AI Returns Pro =

Upgrade to **Sell.AI Returns Pro** for AI-powered features and integrations:

* AI-powered automatic request classification
* Vision analysis for photo evidence
* AI-generated response drafts
* Base. integration — automatic two-way status sync and order notes
* Advanced statistics and reporting
* Multi-user role management

[Learn more →](https://trysellai.com/zwroty-reklamacje-woocommerce)

== Installation ==

1. Upload the `sell-ai-returns` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins menu in WordPress.
3. Ensure WooCommerce is installed and active.
4. Navigate to **Returns** in the WordPress admin menu.

== Frequently Asked Questions ==

= Does this plugin comply with Polish consumer law? =

Yes. The plugin is designed to follow the Polish Civil Code provisions on warranty (rękojmia), the Act on Consumer Rights (ustawa o prawach konsumenta), and EU Directive 2023/2673.

= Is the free plan limited? =

No. The free plan is fully functional with no limit on the number of return or complaint requests.

= Is the plugin multisite compatible? =

Basic multisite support is included. Each site in the network has its own settings.

== Screenshots ==

1. Customer-facing return request form
2. Admin dashboard — request list
3. Request detail view

== Changelog ==

= 1.5.4 =
* Renamed the plugin display name to "Sell.AI Returns - Zwroty i Reklamacje" for clarity in Polish search results (plugin slug and text domain are unchanged).

= 1.5.3 =
* Added a `sellai_returns_after_request_deleted` action, fired when a request is permanently deleted, so Sell.AI Returns Pro can clean up its own per-request data (see Pro changelog).

= 1.5.2 =
* Fixed the Status badge in the admin request list overflowing into the Termin (deadline) column on longer status labels (e.g. "W trakcie rozpatrywania"). Same fix applied to the customer-facing "My Account" status badge. Widened the Status column slightly for breathing room.

= 1.5.1 =
* Fixed the customer-facing return form's Ajax fallback to never hardcode the `/wp-admin/admin-ajax.php` path (broke on subdirectory installs); it now reads a server-rendered `admin_url()` value instead.
* Renamed an internal session transient from the generic `sar_session_` prefix to `sellai_returns_session_`, per WordPress.org plugin review guidelines on unique, prefixed option/transient names.

= 1.5.0 =
* Removed the monthly request limit — the free plugin is now fully functional with no cap on returns/complaints (WordPress.org Guideline 5 compliance).
* Base. integration moved to Sell.AI Returns Pro. The free settings screen now exposes generic extension points; Pro adds the Integrations tab, Base. sync and the request-detail return link.

= 1.4.0 =
* Trash (soft delete) — deleted requests now go to a Trash bin instead of being removed immediately. A new "Kosz" view in the requests list lets you restore them or delete permanently, available as both row and bulk actions. Trashed requests are hidden from the customer "My returns" view and from the dashboard counters.

= 1.3.0 =
* Pro: AI analysis now runs automatically in the background when a new request is submitted and the "automatyczna analiza AI" toggle is enabled.

= 1.2.0 =
* Feature: Base. integration — automatic return creation in Base. on request submission; bidirectional status sync (Plugin→Base. immediately, Base.→Plugin via hourly WP-Cron); status mapping UI; loop-prevention flag.
* Feature: Per-product return reason — customers select a reason per product; global legal basis is derived automatically (warranty / withdrawal / transport damage / mixed).
* Enhancement: Product price in request displayed using WooCommerce currency formatting settings.
* Fix: Base. cron sync — clamped last_log_id to minimum 1 (Base. API rejected 0).

= 1.1.0 =
* Feature: "Zwroty i reklamacje" section in WooCommerce My Account — customers can view all their return and complaint requests with type and status badges.
* Feature: Logged-in customers skip OTP email verification when accessing the form from My Account.

= 1.0.0 =
* Feature: "Zwrot / Reklamacja" button in WooCommerce My Account — orders list and order detail page.
* Feature: Logged-in customers skip email OTP verification when accessing the form from My Account.
* Feature: Base. integration — automatic status sync and bidirectional order notes.
* Enhancement: Admin settings — new Integrations tab (Base. API key, status mapping, sync log).
* Enhancement: Admin settings — returns form page selector activates My Account button automatically.
* Compatibility: WordPress 7.0, WooCommerce 10.8.

= 0.6.0 =
* Fix: OTP verification email deliverability — added From/Reply-To headers using site admin email so SPF passes on all hosting environments.
* Fix: OTP email now sends as multipart (HTML + plain text) to avoid spam filtering on Gmail and other providers.
* Fix: Order value in admin detail view displayed raw HTML instead of formatted price.
* Fix: Request description in detail view was center-aligned due to theme CSS bleeding.
* Fix: Request type badge in list view overflowed into Status column on long labels.
* Fix: Product thumbnail missing in request detail view (image field not saved in products_json).
* Enhancement: Loading spinner on Send Code, Verify, and Submit buttons during AJAX calls.

= 0.5.0 =
* First public release.
* Customer-facing form: order lookup by email + order number, email verification code, photo attachments.
* Admin panel: request list with filters, detail view with AI analysis panel (Pro), status management.
* Automated email notifications for customers and merchants.
* PDF confirmation document generation.
* WooCommerce HPOS and Cart/Checkout Blocks compatibility.
* Sell.AI Returns Pro integration: AI classification, vision analysis, response drafts.

= 0.4.0 =
* AI analysis integration and license gating for Pro features.
* Admin detail view: sidebar panel with AI-generated insights.

= 0.3.0 =
* PDF generation and email notification system.
* Request status workflow with customisable labels.

= 0.2.0 =
* Admin request list table with search, filters and bulk actions.
* WooCommerce order data integration in request detail view.

= 0.1.0 =
* Initial internal release — plugin foundation and database schema.

== Upgrade Notice ==

= 1.1.0 =
Adds "Zwroty i reklamacje" section to WooCommerce My Account. After updating, go to Settings → Permalinks and save to refresh rewrite rules (or the plugin handles it automatically on first load).

= 1.0.0 =
First stable release. Adds My Account integration button, Base. sync, and WordPress 7.0 / WooCommerce 10.8 compatibility.

= 0.6.0 =
Email deliverability fix for OTP verification codes. Recommended update for all users.
