=== Ympruve Order Tracking for WooCommerce ===
Contributors: ympruve, onaeco
Tags: woocommerce, tracking, order tracking, shipment tracking
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ympruve Order Tracking adds local order and shipment tracking tools to WooCommerce.

== Description ==

Ympruve Order Tracking for WooCommerce helps store managers add shipment details and show customers clear delivery progress. Developed by Ympruve and Onae Co.

Included features:

* Manual entry of tracking number and carrier.
* Bundled carriers: UPS, USPS, FedEx, and DHL.
* Custom carriers: define your own provider name and tracking URL template, with CSV import/export.
* Clickable tracking links on the customer tracking card and in WooCommerce emails.
* Custom tracking statuses such as Packed, In Transit, Out for Delivery, and Delivered.
* My Account order tracking display.
* `[ympruve_order_tracking]` shortcode for authorized order tracking display.
* Tracking details appended to WooCommerce customer emails.
* CSV import for bulk local tracking updates.
* Local display customization for the tracking card.

The plugin stores tracking numbers, carriers, statuses, and display settings locally in WordPress/WooCommerce. This plugin does not send order, customer, tracking, or analytics data to an external Ympruve service.

Additional integrations and hosted services are available from Ympruve.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install the ZIP from Plugins > Add New.
2. Activate **Ympruve Order Tracking for WooCommerce**.
3. Make sure WooCommerce is active.
4. Go to **Ympruve Tracking** in the admin menu.
5. Add tracking details from the Ympruve Orders page or directly on WooCommerce order edit screens.
6. Use `[ympruve_order_tracking order_id="123"]` only on pages where the current customer is authorized to view that order.

== Screenshots ==

1. Ympruve Order Tracking dashboard and quick actions.
2. Orders table with local tracking editing.
3. Custom statuses manager.
4. Customer-facing tracking card.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. The plugin shows an admin notice and avoids loading WooCommerce-specific functionality if WooCommerce is inactive.

= Does this plugin support WooCommerce HPOS? =

Yes. Ympruve Order Tracking declares HPOS compatibility and uses WooCommerce order APIs for order tracking metadata.

= Does this plugin send data to Ympruve? =

No. Tracking numbers, carrier data, statuses, email settings, and customization settings are stored locally in WordPress/WooCommerce.

= How do I add tracking to a custom page? =

Use `[ympruve_order_tracking order_id="123"]`. The output is shown only to users who can manage WooCommerce or to the customer who owns the order.

== Source Code ==

The source code for the generated React admin bundle is included in this plugin package under the `/src` directory. It is built with @wordpress/scripts (webpack), and uses WordPress's bundled React (wp-element) rather than bundling its own copy.

To rebuild the generated assets:

1. Run `npm install`
2. Run `npm run build`

The generated output is written to `/assets/react/` (admin.js, admin.css, and admin.asset.php).

== Changelog ==

= 1.3.2 =
Plugin Check compliance fix.

* Housekeeping: Moved the translator comment for the CSV import summary message directly above the `__()` call so Plugin Check recognizes it (the placeholder string is unchanged).

= 1.3.1 =
Compliance and refinement fixes from early testing.

* Fixed: In Custom Statuses, saving a new or edited status now applies immediately — no second page-level "Save Changes" click needed.
* Improved: The dashboard date range now reads "Last 90 days" (was "3 months"), consistent with the 30- and 60-day options, and each KPI tile now explains exactly what it measures.
* Housekeeping: Plugin Check (PCP) compliance — carrier CSV import/export now uses WP_Filesystem instead of direct file operations, translator comments were added for all placeholder strings, `str_getcsv()` is called with explicit arguments for PHP 8.4, and uninstall database cleanup is annotated.

= 1.3.0 =
Refinements from early testing.

* New: Dashboard date-range selector — view metrics over the last 30 days, 60 days, or 3 months. All KPI tiles now respect the selected window.
* New: The Custom Carriers screen now lists the built-in carriers (UPS, USPS, FedEx, DHL) alongside your own.
* Improved: In the order tracking editor, Status is now a dropdown of your custom statuses plus the core WooCommerce statuses, instead of a free-text field.
* Improved: Restored the "Shortcode Tips" panel on the Customization screen (auto-detect on My Account pages, and per-order usage).
* Changed: The admin menu is now labelled "Order Tracking" with the location icon.
* Fixed: The admin header logo refreshes immediately when the logo image is replaced (cache-busted by file modification time).
* Fixed: Spacing between the cards on the Custom Carriers screen.

= 1.2.0 =
Carrier expansion — define your own carriers and surface tracking links everywhere.

* New: Custom Carriers screen (Ympruve Tracking → Custom Carriers) to add, edit, and delete carriers we don't bundle — a provider name plus a tracking URL template containing a single `%s` placeholder.
* New: Custom carriers merge into the same carrier source as the bundled ones, so they appear automatically in the order carrier dropdown, the customer tracking page, and tracking emails — no extra setup.
* New: CSV import and export for custom carriers (columns: Provider Name, Tracking URL). Import tolerates an optional header row, validates and sanitizes every row, de-duplicates against existing and bundled carriers, skips invalid rows instead of aborting, and reports a per-row summary.
* New: Clickable "Track Your Package" links on the customer tracking card and in WooCommerce emails (HTML button and a plain-text link), for both bundled and custom carriers.
* Security: tracking URLs are assembled at output time with `rawurlencode()` on the tracking number and `esc_url()` on the result; URL templates are validated for an http(s) scheme and exactly one `%s` placeholder before being stored.
* Cleanup: custom carriers option is removed on uninstall.

= 1.1.0 =
Admin rebuilt as a fully source-backed React app.

* Improved: The admin interface is now built from human-readable source (shipped under `/src`) with @wordpress/scripts, replacing the previous minified, source-less bundle.
* Improved: Uses WordPress's bundled React (wp-element), substantially reducing the admin bundle size.
* Improved: Dashboard, Orders, Custom Statuses, Emails, Customization, and CSV Import screens reviewed and polished.
* New: JavaScript string translations enabled (`wp_set_script_translations`) and RTL stylesheet support for the admin app.
* Compatibility: now requires WordPress 6.6 or newer (for the React JSX runtime).

= 1.0.3 =
Identity alignment and platform compatibility.

* Changed: Rebranded to "Ympruve Order Tracking for WooCommerce"; the admin menu is now "Ympruve Tracking".
* Changed: Text domain is now `ympruve-order-tracking`; bundled `languages/ympruve-order-tracking.pot` translation template.
* New: `[ympruve_order_tracking]` shortcode. The previous `[tracksight_tracking]` continues to work as a backward-compatibility alias.
* New: Declared WooCommerce HPOS (High-Performance Order Storage) compatibility.
* Fixed: Repointed plugin and product links to the canonical URL.

= 1.0.2 =
Polish and WordPress.org guideline compliance after the first uploads.

* Removed: In-dashboard promotional upsell call-to-actions from the order-edit metabox and admin screens.
* Changed: The "Upgrade" menu item now links to the product page instead of opening an in-dashboard sales screen.
* Improved: Moved inline styles, scripts, and event handlers from the order metabox into properly enqueued asset files.
* Housekeeping: General cleanup for WordPress.org review compliance.

= 1.0.1 =
* Initial Ympruve Order Tracking for WooCommerce release.
* Local WooCommerce order tracking fields.
* Customer-facing tracking card and My Account integration.
* CSV import for local tracking updates.
* Source-backed React admin bundle.

