=== Shippo Label Manager for WooCommerce ===
Contributors: hariomweb
Tags: woocommerce, shippo, shipping, labels, tracking
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Author: HOWPL
Author URI: https://howpl.com/
WC requires at least: 6.0
WC tested up to: 10.7

Generate, print, and manage Shippo shipping labels directly from WooCommerce orders.

== Description ==

Shippo Label Manager for WooCommerce is a simple V1 WooCommerce admin plugin for purchasing Shippo labels from the WooCommerce order admin screen.

This plugin integrates with Shippo and is not affiliated with Shippo.

Support: support@howpl.com

Website: https://howpl.org/plugin/shippo-label-manager-for-woocommerce/

V1 includes:

* WooCommerce order admin label box
* Sender and package defaults settings
* Shippo shipment creation
* Rate fetching
* Automatic cheapest-rate selection
* Label purchase
* Print and download links
* Tracking and label metadata storage using WooCommerce order CRUD methods
* Label void action
* Private order notes
* WooCommerce order list column
* WooCommerce HPOS compatibility declaration

V1 intentionally does not include checkout shipping rates, address validation, or bulk labels. The code is organized so those can be added later as separate modules.

Developer extension points include label-created and label-voided hooks, tracking-status API helper access, and settings tab registration for compatible add-ons.

== Installation ==

1. Upload the `shippo-label-manager-for-woocommerce` folder to `wp-content/plugins/`.
2. Activate `Shippo Label Manager for WooCommerce` from the WordPress Plugins screen.
3. Confirm WooCommerce is installed and active.
4. Go to WooCommerce > Shippo Label Manager.
5. Enable the plugin, choose Test Mode or Live Mode, and enter the matching Shippo API token.
6. Save sender address and package defaults.

== Usage ==

1. Open a WooCommerce order with a complete shipping address.
2. Find the `Shippo Label Manager` box.
3. Enter package dimensions and weight.
4. Click `Create Shipping Label`.
5. The plugin creates a Shippo shipment, fetches rates, buys the cheapest rate, saves label/tracking data to order meta, and adds a private order note.
6. Use `Print Shipping Label` or `Download Shipping Label`.
7. Use `Void Label` only when the label should be voided.

== Testing Checklist ==

* Activate plugin with WooCommerce active.
* Save settings.
* Add Shippo test token.
* Open WooCommerce order.
* Enter parcel weight and dimensions.
* Create shipping label.
* Confirm tracking is saved.
* Confirm label URL is saved.
* Print/download label.
* Void label.
* Confirm HPOS compatibility under WooCommerce settings/status.

== Security Notes ==

* Admin actions require a nonce.
* Admin actions require `manage_woocommerce`.
* Shippo API token is not stored in order meta, notes, logs, or displayed errors.
* Existing active labels are not silently duplicated.

== External Services ==

This plugin connects to the Shippo API at `https://api.goshippo.com` when an authorized WooCommerce manager creates shipments, loads rates, purchases labels, retrieves transactions, retrieves tracking status, or requests label voids/refunds.

Data sent to Shippo can include the configured sender address, the order recipient shipping address, parcel dimensions/weight, selected shipping service/rate identifiers, transaction identifiers, carrier tokens, and tracking numbers. This data is required for Shippo to return shipping rates, labels, tracking details, and refund/void responses.

Use of this plugin requires a Shippo account and API token. Review Shippo's terms, privacy, and API documentation before enabling the integration:

* Shippo website: https://goshippo.com/
* Shippo API documentation: https://docs.goshippo.com/
* Shippo support and billing documentation: https://support.goshippo.com/

== Frequently Asked Questions ==

= Do I need a Shippo account? =

Yes. You need a Shippo account and API token. Use a Shippo test token while testing and switch to a live token only when you are ready to create real postage labels.

= Does plugin support WooCommerce HPOS? =

Yes. The plugin declares compatibility with WooCommerce High-Performance Order Storage and uses WooCommerce order CRUD methods for order label metadata.

= What data is stored? =

The plugin stores its settings, including the configured Shippo API tokens, in the `wcslm_settings` WordPress option. On orders, it stores Shippo shipment, rate, transaction, label URL, tracking, carrier, service, label status, label file type, created timestamp, action lock, and last error metadata. API tokens are not stored in order meta or order notes.

= What happens when plugin is deleted? =

By default, uninstall keeps historical label and tracking metadata. Enable `Delete plugin data on uninstall` in the plugin settings only when you intentionally want deletion to remove settings and `_wcslm_*` order metadata.

== Screenshots ==

1. Shippo Label Manager settings page.
2. WooCommerce order label panel before a label is created.
3. WooCommerce order label panel after a label is created.
4. Manual rate selection for orders using Free Shipping or no selected shipping service.

== Upgrade Notice ==

= 1.3.4 =
Keeps unrelated third-party admin notices out of the Shippo settings header.

= 1.3.3 =
Aligns the free plugin release version with the Pro all-orders recovery scan fix.

= 1.3.2 =
Adds Shippo transaction-list support used by Pro automatic full recovery.

= 1.3.1 =
Aligns the free plugin release version with the Pro full recovery import and manual full recovery update.

= 1.3.0 =
Adds settings-page version badges and aligns with the Pro selectable recovery update.

= 1.2.9 =
Aligns the free plugin release version with the Pro manual recovery fallback.

= 1.2.8 =
Aligns the free plugin release version with the Pro direct-note recovery fix.

= 1.2.7 =
Aligns the free plugin release version with the Pro recovery note-matching update.

= 1.2.6 =
Aligns the free plugin release version with the Pro recovery scan update.

= 1.2.5 =
Aligns the free plugin release version with the Pro recovery update.

= 1.2.4 =
Adds uninstall data protection and recovered-label order panel handling.

= 1.0.12 =
Adds inline recipient shipping address editing in the order label panel.

= 1.0.11 =
Adds extension points used by Shippo Label Manager for WooCommerce Pro.

= 1.0.10 =
Adds WordPress.org readiness improvements, uninstall cleanup, localized JavaScript strings, transient-based admin notices, UTC timestamps, and stronger AJAX response handling.

== Changelog ==

= 1.3.4 =
* Keep unrelated third-party admin notices from being injected into the Shippo settings hero header.

= 1.3.3 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.3.3.

= 1.3.2 =
* Add Shippo transaction-list API support for Pro automatic full recovery.

= 1.3.1 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.3.1.

= 1.3.0 =
* Add a settings-page version badge showing Free and Pro plugin versions for remote debugging.
* Align release version with Shippo Label Manager for WooCommerce Pro 1.3.0.

= 1.2.9 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.2.9.

= 1.2.8 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.2.8.

= 1.2.7 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.2.7.

= 1.2.6 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.2.6.

= 1.2.5 =
* Align release version with Shippo Label Manager for WooCommerce Pro 1.2.5.

= 1.2.4 =
* Add a Data Safety setting to preserve label and tracking history on uninstall by default.
* Require explicit opt-in before uninstall removes settings and `_wcslm_*` order metadata.
* Show basic-recovered tracking details in the order label panel without enabling print/download actions until label URLs are restored.
* Refresh the Shippo Label Manager settings page UI.

= 1.0.12 =
* Add inline recipient shipping address editing to the order label panel.
* Save corrected recipient addresses to the WooCommerce order before loading Shippo rates or creating labels.
* Clear stale Shippo address errors and loaded rates after a recipient address change.

= 1.0.11 =
* Add `wcslm_label_created` and `wcslm_label_voided` hooks.
* Add settings tab extension support for add-ons.
* Add Shippo tracking-status API helper.
* Add order label summary action hook for add-on UI.

= 1.0.10 =
* Add uninstall cleanup for settings and order label metadata.
* Localize admin JavaScript strings and improve non-JSON AJAX response handling.
* Replace URL-based redirected notices with current-user transients.
* Store label creation timestamps in UTC.
* Improve rate matching to prefer exact service matches before fuzzy matching.
* Update WordPress.org metadata and readme sections.

= 1.0.9 =
* Disable label actions when required Shippo setup values are missing and show the missing setup fields in the order panel and settings page.

= 1.0.8 =
* Add Shippo request loading overlay, page-leave warning, order update button protection, order action locks, and duplicate-label rechecks.

= 1.0.7 =
* Correct Shippo label void/refund endpoint and improve non-JSON API error messages.

= 1.0.6 =
* Persist the selected Shippo Environment explicitly and use it for token selection.

= 1.0.5 =
* Replace the Test Mode checkbox with an explicit Shippo Environment setting and show the active mode on order labels.

= 1.0.4 =
* Open external label download links in a new tab.

= 1.0.3 =
* Add manual Shippo rate selection for Free Shipping or orders without a selected shipping service.

= 1.0.2 =
* Use AJAX for order admin label actions and move label UI into the main order panel.

= 1.0.1 =
* Fix order admin label actions inside WooCommerce metabox forms.

= 1.0.0 =
* Initial V1 release.
