=== ShipSavvy Shipping ===
Contributors: shipsavvy
Tags: shipping, woocommerce, shipping labels, tracking, canada
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Send your WooCommerce orders to ShipSavvy and show carrier tracking numbers to your customers.

== Description ==

ShipSavvy Shipping connects your WooCommerce store to your ShipSavvy account.

When an order is placed, the plugin sends it to ShipSavvy so a shipment can be created for it. Once carrier tracking numbers are available they are shown on the order in your WordPress admin and on the customer's order details page.

**What the plugin does**

* Sends new WooCommerce orders to your ShipSavvy account
* Exports orders that were placed before you connected, on demand
* Shows the ShipSavvy shipment ID as a column on the orders list
* Shows carrier tracking numbers on the order edit screen and to your customers
* Works with both WooCommerce High-Performance Order Storage and legacy order storage

**Requirements**

A ShipSavvy account and an API token are required. You can create an account at https://www.shipsavvy.com/sign-up

== External services ==

This plugin connects to the ShipSavvy API (https://api.shipsavvy.com), a third-party shipping service operated by ShipSavvy, to create and track shipments for your WooCommerce orders. Sending data to this service is required for the plugin to work.

The following requests are made:

1. **Verifying your account** — when you open the plugin settings screen, your ShipSavvy account email address is sent so the saved API token can be validated.
2. **Registering your store** — after your credentials are verified, your site URL is sent once to register the store as an integration.
3. **Checking the integration status** — the identifier of that integration is sent to confirm the store is still connected. This happens when the settings screen is opened and before each order is sent.
4. **Creating a shipment** — when an order is placed, or when you run a manual export, the following order data is sent: the order number, the order date, the shipping address, the recipient's name, phone number and email address, the name, quantity, price and SKU of each item on the order, and the store's own details (base address, site name, the administrator email address, and the sender name and phone number set on the plugin settings screen).
5. **Reading tracking numbers** — the shipment identifier is sent to retrieve carrier names and tracking numbers for display.

No data is sent until you have saved an API token on the plugin settings screen.

Service provided by ShipSavvy:

* Terms of service: https://www.shipsavvy.com/terms-of-service
* Privacy policy: https://www.shipsavvy.com/privacy-policy

== Installation ==

1. Install and activate the plugin.
2. Go to **WooCommerce → Settings → ShipSavvy**.
3. Enter the API token from your [ShipSavvy account settings](https://my.shipsavvy.com/account-settings) and the email address on that account, then save.
4. The connection test on the same screen confirms the store is connected.
5. Optionally set a default sender name and phone number, and use **Run export** to send orders placed before you connected.

== Frequently Asked Questions ==

= Where do I find my API token? =

In your ShipSavvy dashboard, under account settings: https://my.shipsavvy.com/account-settings

= Do I need a ShipSavvy account? =

Yes. The plugin sends orders to ShipSavvy, so an account and an API token are required. You can sign up at https://www.shipsavvy.com/sign-up

= Which orders are sent? =

New orders are sent as they are placed. The manual export on the settings screen sends existing orders with the status Processing or Pending that have not been sent yet.

= Does the plugin work with High-Performance Order Storage? =

Yes. The plugin declares compatibility with HPOS and reads and writes order data through the WooCommerce order API, so it works with both HPOS and legacy order storage.

= What happens if ShipSavvy cannot be reached? =

The order is left untouched and a note explaining the failure is added to it. You can send the order later using the manual export.

== Changelog ==

= 1.2.1 =
* No functional changes. Release used to verify the automated WordPress.org SVN deployment pipeline.

= 1.2.0 =
* Added real-time carrier rates at checkout for both block and classic checkout, off by default.
* Added a merchant-configurable flat rate, used whenever live rates cannot be retrieved so checkout is never left without a shipping option.
* Added a debug mode that suppresses live rates and logs rate requests to WooCommerce → Status → Logs.
* Added a configurable API base URL so the plugin can be pointed at a non-production environment.
* The carrier and service the customer chose are now recorded on the order.
* Added a warm-up request from the cart page so the rate service is already running by the time the customer reaches checkout.
* Rates are requested at checkout rather than on the cart page, whose shipping calculator has no city field and would price an incomplete address.
* A failed quote is no longer cached for the rest of the session; previously rates only appeared after the customer edited their address.

= 1.1.0 =
* Reworked the plugin to follow WordPress plugin standards: all functions, classes and constants are prefixed, all output is escaped and all input is sanitized.
* Replaced the standalone admin scripts with proper AJAX endpoints protected by a nonce and a capability check.
* Added support for WooCommerce High-Performance Order Storage.
* Added error handling for every request to the ShipSavvy API; failures are now recorded as an order note instead of failing silently.
* Tracking lookups are cached for five minutes rather than being requested on every page load.
* Orders are no longer sent to ShipSavvy twice.
* Removed the redirect on activation in favour of a dismissible notice.

= 1.0.1 =
* Added UUID, customer order number and order date.

= 1.0.0 =
* Initial launch.

== Upgrade Notice ==

= 1.2.0 =
Adds optional real-time carrier rates at checkout. The feature is off by default and existing settings are kept; enable it under WooCommerce → Settings → ShipSavvy and add “ShipSavvy Real-Time Rates” to a shipping zone.

= 1.1.0 =
Standards and reliability update. The settings screen has moved to WooCommerce → Settings → ShipSavvy; your saved token, email and sender details are kept.
