=== Shipment Tracking DDT for WooCommerce ===
Tags: woocommerce, tracking, shipment, ddt
Requires at least: 6.0.1
Tested up to: 6.7.2
Stable tag: 1.5.4
WC requires at least: 9.0
WC tested up to: 10.5.3
Requires PHP: 8.0
Contributors: giangel84
Donate link: https://www.paypal.com/donate?hosted_button_id=DEFQGNU2RNQ4Y
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Add your Tracking code to WooCommerce orders and attach the DDT!

== Description ==

Add your Tracking code to WooCommerce orders and attach the DDT!


== Installation ==

* Install the Plugin and Activate it.
* Go to WooCommerce Email settings and adjust subject as you need.
* Go to WooCommerce->Settings->Tracking and set your desidered options.
* Open an order and add the tracking informations (Code and/or Tracking link) and upload your DDT (only PDF accepted, max 5MB file size), then set order as shipped, or send email with manual actions.
* That's all! Enjoy.

== Donate ==
If you like this plugin and want to support my work, you can also make a donation at this address: https://www.paypal.com/donate?hosted_button_id=DEFQGNU2RNQ4Y - Thank you very much!

== Changelog ==
2026-03-06 - version 1.5.4
* Plugin now fully talk in english
* Add italian translation
* Declared compatibility with WC product_instance_caching

2026-03-04 - version 1.5.3

* Added full support for WooCommerce Legacy (non-HPOS) mode: metabox, save handlers and admin columns now work in both HPOS and Legacy mode.
* Fixed remaining $_SESSION usage in DDT email class (replaced with transients).
* Fixed order status comparison bug: get_status() returns 'shipped' not 'wc-shipped'.
* Fixed wrong option name in DDT email template (hw_stddt_ -> hwit_stddt_), which prevented the "include tracking info with DDT" setting from working.
* Fixed plain text email templates using get_post_meta() instead of $order->get_meta() (HPOS incompatible).
* Fixed $tracking_info undefined variable in frontend order details page.
* Fixed missing array key checks for $ddt_pdf_data in frontend functions (PHP warnings on empty DDT).
* Fixed JavaScript output using improper shortcode pattern, replaced with proper admin_footer hook with screen check.
* Fixed multiple unnecessary $order->save() calls when saving tracking meta (now saves once).
* Fixed upload_dir filter not being removed after DDT upload.
* Fixed esc_attr used instead of esc_html_e for "Elimina file" button text.
* Fixed text domain inconsistencies in email templates and shipped status registration.
* Fixed unescaped user data output in admin columns and frontend functions.
* Removed HPOS-only requirement notice (plugin now works in both modes).
* Fixed critical: get_option() without default value caused emails to never send if settings page wasn't saved.
* Fixed critical: trigger_only_shipping_mail() required both courier AND code, now accepts code OR link.
* Fixed: email type 2 (separate) now correctly triggers DDT email automatically on status change.
* Fixed: email type 1 repeat mode no longer sends DDT attachment twice.
* Fixed: attachments accumulation and invalid values in wp_mail().
* Added setup_locale/restore_locale for proper email localization.
* Tested with WooCommerce 10.5.3 and WordPress 6.7.2.
