=== Shipper360 ===
Contributors: shipper
Tags: shipping, woocommerce, tracking, carrier vouchers
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.5
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Integrate multiple Greek shipping carriers into your WooCommerce store with real-time rates, label generation, and shipment tracking.

== Description ==

Shipper connects WooCommerce with major Greek carriers, offering real-time rates, label generation, and shipment tracking.  
A **Shipper account is required** to use this plugin.

== External Service Usage (Required by WP.org Guideline 6) ==

This plugin communicates with the external logistics platform **Shipper (shipper360.io)** to retrieve carrier rates, generate shipping labels, and process shipment tracking updates.

Shipper provides services including:
* Multi-carrier shipping rates (ACS, Speedex, Geniki)
* Shipment creation with label generation
* Delivery point lookup
* Shipment tracking and status updates
* Webhook notifications for order status changes

External service links:
* Terms of Use: https://www.shipper360.io/en/terms-of-use/
* Privacy Policy: https://www.shipper360.io/en/privacy-policy-gdpr/
* Data Processing Agreement (DPA): https://www.shipper360.io/en/dpa-data-processing-agreement/
* Website: https://www.shipper360.io

== External Service: OpenStreetMap (Map & Geocoding) ==

To let customers choose a delivery locker or store on a map at checkout, this plugin uses OpenStreetMap services. This only happens on the checkout page, and only when a pickup-point shipping method is available.

* **Map tiles** are loaded from OpenStreetMap tile servers (tile.openstreetmap.org) by the customer's browser to render the interactive pickup-point map. As the tile usage policy requires, each tile request carries your store's address as the HTTP Referer.
* **Nominatim** (nominatim.openstreetmap.org) geocodes the customer's postcode into map coordinates so the nearest pickup point can be suggested. This request is made from your server. Only the postcode and the country (Greece) are sent, along with your store's address and the plugin version to identify the request as the usage policy requires — no personal or order data. Results are cached for 7 days (postcodes that cannot be found for 1 day) to minimise requests.

OpenStreetMap links:
* Terms of Use: https://osmfoundation.org/wiki/Terms_of_Use
* Privacy Policy: https://osmfoundation.org/wiki/Privacy_Policy
* Tile Usage Policy: https://operations.osmfoundation.org/policies/tiles/
* Nominatim Usage Policy: https://operations.osmfoundation.org/policies/nominatim/

== What Data is Sent to Shipper ==

The plugin sends only the data required to provide shipping functionality:

**During rate calculation (checkout/cart):**
* Destination country, city, postcode
* Package weight and dimensions
* Cart total value (including tax, after discounts)
* Selected carrier/service
* Store API credentials

**During shipment creation (manual or automated):**
* Customer shipping name
* Shipping address (street, city, postal code, country)
* Customer phone and email
* Order number and WooCommerce order metadata
* Package contents (items, weight, dimensions)
* Selected carrier service and delivery point (if any)

**During webhook communication (from Shipper to your site):**
* Shipment status updates (accepted, in transit, delivered, failed, returned)
* Tracking number
* Carrier event timestamps
* Order status updates sent through the WooCommerce REST API as Shipper status codes, saved with the WooCommerce status you mapped to each code

No payment or billing information is ever sent to Shipper.

== Key Features ==

* Multi-carrier support (ACS, Speedex, Geniki)
* Real-time shipping rate calculation
* Automated shipping label generation
* Live shipment tracking
* Customer tracking notifications
* Delivery point selection
* Return shipment handling
* Bulk label printing
* Custom shipping rules

== Carrier Integration ==

* **ACS Courier**: Real-time rates, label generation, and tracking
* **Speedex**: Automated shipping with service area support
* **Geniki**: Complete shipping integration with delivery points

== Requirements ==

* WordPress 5.8 or higher
* WooCommerce 6.0 or higher
* PHP 7.4 or higher
* Valid Shipper API credentials

== Installation ==

1. Upload the 'shipper' folder to the '/wp-content/plugins/' directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to WooCommerce → Settings → Shipping → Shipper
4. Enter your API credentials
5. Configure your shipping preferences

== Frequently Asked Questions ==

= Do I need a Shipper account? =

Yes, you need a valid Shipper account to use this plugin. Visit [shipper360.io](https://shipper360.io) to create an account.

= Which carriers are supported? =

ACS, Speedex, and Geniki.

= How are shipping rates calculated? =

Rates are calculated in real time based on:
* Package dimensions and weight
* Delivery destination
* Selected carrier
* Your negotiated or standard rates

= Can I track shipments? =

Yes, tracking is available through:
* WooCommerce order page
* Customer order emails
* Tracking page widget

== Changelog ==

= 1.1.5 =
* New: Shipper can update orders through the WooCommerce REST API using a numeric Shipper status code (e.g. `"status": 3`). The code is translated to a WooCommerce status through the mapping on the Orders tab, for single and batch order requests. A code with no mapped status is rejected with a 400 error instead of the order silently becoming "Pending payment". Orders sent with a WooCommerce status slug are handled as before.
* New: Cash on delivery is disabled for every ACS Shipper (`acs_shipper`) service, which cannot collect COD.
* Fix: The `[shipper_tracking]` shortcode always reported "API token not configured". It now uses the API token saved under WooCommerce → Shipper.
* Fix: The cart total sent for rate calculation now includes tax, so free-shipping thresholds set in Shipper are checked against what the customer actually pays.
* Fix: Custom CSS from the Styling tab now loads after the pickup point map stylesheet, so it can override the map's styles too.
* Fix: Carrier slugs that contain an underscore are now read correctly when deciding whether cash on delivery is available.
* Improvement: The Styling tab's CSS field now starts with the plugin's default styles, ready to edit. Saving them unchanged stores nothing, so future plugin style updates still reach your store. Empty the field and save to go back to the defaults.
* Improvement: The Orders tab explains that the status mapping also applies to order status updates received through the REST API.

= 1.1.4 =
* Fix: The pickup point map could show "Access blocked: App is not following the tile usage policy" instead of map tiles, typically on stores whose security plugin, CDN or server sets a strict Referrer-Policy. Tiles are now loaded from the single `tile.openstreetmap.org` host and always send the Referer that OpenStreetMap requires.
* Fix: Postcode geocoding requests to Nominatim now identify the plugin version and your store, as the Nominatim usage policy requires.
* Fix: Choosing a BoxNow locker could keep showing "Box Now widget is still loading" when BoxNow only appeared after the customer entered their address. The BoxNow map now loads when BoxNow becomes available, and opens as soon as it has loaded if the customer clicks early.
* Improvement: Postcodes that Nominatim cannot find are cached for a day, instead of being looked up again on every checkout.
* Improvement: Map attribution now reads "© OpenStreetMap contributors", as required by the OpenStreetMap licence.

= 1.1.3 =
* New: Styling tab (WooCommerce → Shipper) for adding your own CSS to the checkout carrier presentation, loaded after the plugin stylesheet so no `!important` is normally needed.
* New: The Styling tab documents every CSS class the plugin renders — shipping options, delivery address box, pickup point map and tracking widget — plus the carrier slugs and brand colours, with click-to-copy selectors and ready-made examples.
* Improvement: The CSS field uses the WordPress code editor (syntax highlighting and CSS linting), falling back to a plain text area when the highlighter is disabled in your profile.

= 1.1.2 =
* Fix: Checkout and carrier styles/scripts (including the pickup point map) are no longer enqueued when the Shipper shipping method is disabled in all shipping zones. The tracking widget styles continue to load wherever the `[shipper_tracking]` shortcode is used.

= 1.1 =
* New: Pickup point / locker selection at checkout with an interactive map (lockers and stores), including nearest-point suggestion based on the delivery postcode.
* New: Dedicated admin settings page (WooCommerce → Shipper360) with General, Orders, Tracking and Cache management tabs.
* New: Subscription plan awareness — plan and remaining vouchers are shown, and the tracking feature is gated to Advanced/Enterprise plans with an upgrade notice on Starter.
* New: Configurable WooCommerce order status → Shipper status mapping sent with webhooks.
* New: Sandbox/demo mode toggle to switch between the production and demo Shipper API.
* New: Wolt Drive carrier support.
* Improvement: Cash on delivery is now disabled only for pickup points that cannot collect COD (e.g. ACS smartpoints/stores) while home delivery and BoxNow lockers keep COD.
* Improvement: Webhook payload now includes the selected locker code and pickup point details, and backfills a missing phone number from custom checkout meta (filterable via `shipper360_meta_field_fallbacks`).
* Improvement: Duplicate `order.updated` webhook fired while an order is being created is now suppressed.
* Improvement: Admin styles/scripts now load only on the plugin's own settings screen.
* Improvement: Pickup points and postcode geocoding results are cached (transients) to reduce API calls.
* Security: Tracking API requests now verify SSL certificates.
* Compatibility: Tested up to WordPress 7.0.

= 1.0 =
* Initial release
* Multi-carrier support
* Real-time rate calculation
* Automated label generation
* Shipment tracking
* Customer notifications
* Return handling

== Upgrade Notice ==

= 1.1.5 =
Fixes the tracking shortcode reporting a missing API token, includes tax in the cart total sent for shipping rates, and lets Shipper update order statuses through the REST API using Shipper status codes.

= 1.1.4 =
Fixes the pickup point map showing "Access blocked" instead of map tiles. Recommended for all stores using the pickup point map.

= 1.1.3 =
Adds a Styling tab for customising the checkout carrier presentation with your own CSS, including a reference for every class the plugin renders. No existing settings are changed.

= 1.1.2 =
Fixes checkout styles being loaded when the Shipper shipping method is disabled.

= 1.1 =
Adds checkout pickup point/locker selection with map, a new settings page, and subscription-plan and order-status-mapping support. Tested up to WordPress 7.0.

= 1.0 =
Initial release of the Shipper plugin for WooCommerce.

== Support ==

For support please contact:
* info@shipper360.io

== Privacy Policy ==

This plugin processes:
* Order shipping details
* Customer delivery data
* Store location information

This data is transmitted securely to the external Shipper service for:
* Shipping rate calculation
* Label generation
* Tracking updates

For full Shipper privacy details, please review:
* https://www.shipper360.io/en/privacy-policy-gdpr/