=== STS Order Export for WooCommerce ===
Contributors: piotrprach
Tags: woocommerce, export, csv, orders, reports
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Export orders to protected UTF-8 CSV or JSON with dates, statuses, column selection and bounded background jobs.

== Description ==

* Manual CSV and JSON order exports without an artificial order-count cap.
* Inclusive date range in the site timezone, status filtering and 18 selectable standard columns.
* One row per order; products, quantities and SKUs in a combined item field.
* 50-order background batches with progress and repeat-safe per-batch files.
* UTF-8 BOM for CSV, comma or semicolon delimiter and spreadsheet formula-injection protection.
* Protected owner-only downloads, deletion controls and 1–14 day automatic file retention.
* WooCommerce CRUD/HPOS support; no storefront JavaScript or per-page catalogue scanning.

Settings: WooCommerce > STS Order Export.

Optional paid add-on: https://simpletradesolutions.com/sts-order-export-pro-en/

The standalone Free plugin remains useful without an account, licence or subscription. No analytics, telemetry or remote code is loaded.

= Privacy and external services =

Export files may contain customer data, depending on selected columns. Files are written only outside the public website, accessed through capability/nonce/ownership checks, and expire after the chosen retention. No customer data is sent to an external service by Free.

= Scope of version 1.0 =

* Exports standard order-level fields only; no arbitrary custom-code execution, custom meta selector, XLSX, product-per-row mode or FTP transport.
* Exports reflect values when each batch is processed rather than a database-wide transaction snapshot. Deleting orders while a paginated job runs may change its result.
* Background work needs WooCommerce Action Scheduler and working site/server cron.
* One Pro schedule in version 1.0; missed offline days are not automatically backfilled.
* WordPress accepting an email is not proof of inbox delivery. Failed or interrupted sends require investigation and are not silently retried.

== Installation ==

1. Install and activate WooCommerce 9.0 or newer.
2. Upload the sts-order-export folder to wp-content/plugins, or install the ZIP through Plugins > Add New.
3. Activate the plugin and open WooCommerce > STS Order Export.
4. Configure the store-specific fields and test with an order before adopting a live workflow.

== Frequently Asked Questions ==

= Is the Free export limited to 50 orders? =
No. Fifty is the work size of one background batch, not an export cap. The integration test exports more than 100 real orders. Larger files remain subject to available disk and hosting resources.

= Why is the export still queued? =
The WooCommerce background queue needs site traffic or a server cron task. Check WooCommerce > Status > Scheduled Actions for the sts-order-export group.

= Can I open the CSV in Excel? =
CSV uses UTF-8 with a BOM and either commas or semicolons. Customer-controlled text beginning with spreadsheet formula characters is prefixed with an apostrophe. To preserve numeric-looking identifiers such as postcodes, import their columns as text in Excel.

= Can another shop manager download my export? =
Downloads require manage_woocommerce, a valid nonce and the job creator's user ID. Other managers cannot download a job they did not create.

= Where are files stored? =
A private per-site directory below the system temporary directory is used only if it is outside the public website. Set STS_ORDER_EXPORT_PRIVATE_DIR to an outside-webroot directory if the default is unsuitable. Files expire after 1 day by default.

= What happens when I deactivate or uninstall? =

Deactivation stops this plugin's scheduled work where applicable. Settings are retained by default. Enable the removal checkbox before uninstalling if you want settings removed. Core WooCommerce orders and products are never deleted. Invoice and parcel records remain with the order unless WooCommerce's personal-data erasure removes them. Export files can be deleted in the admin and expire while the plugin is active.

== Changelog ==

= 1.0.0 =
* First original STS release with English/Polish interfaces, HPOS order access and focused workflows.

== Upgrade Notice ==

= 1.0.0 =
Initial release. Review the documented workflow and limitations before use.
