== Changelog ==

*** Shipment Tracking DDT for WooCommerce ***
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 (consistent with trigger_full_mail).
* 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: $this->attachments never reset between calls, causing attachment accumulation.
* Fixed: $this->attachments[] = false pushed invalid values to wp_mail().
* Fixed: missing debug log in trigger_only_shipping_mail() validation failure.
* Added setup_locale/restore_locale calls for proper email localization.
* Removed obsolete WC < 3.0 version checks for billing_email.
* Tested with WooCommerce 10.5.3 and WordPress 6.7.2.

2024-10-22 - version 1.5.2

* Fixed PHP Warning:  Undefined variable $tracking_info in /wc-frontend-functions.php on line 32
* Substitution of $_SESSION with transient for notices after email sent (this fix PHP Warning headers already sent in some conditions).

2024-09-11 - version 1.5.1
* Fixed orders page view showing empty ddt file if was uploaded and then removed (array empty).
* Fixed security check at header in main plugin file
* Fixed inline CSS, by using dynamic CSS Classes
* Fixed escape of translatable string (notification in hwit_stddt_wc_admin_notice)
* Add 'woocommerce' required in plugin header

2024-09-04 - version 1.5.0
* Fixed DDT sent timestamp not saved when sending unique email
* Fixed error on custom sanitize filename (now using builtin sanitize_file_name)
* Fixed duplicated session_start
* Fixed PHP warning Undefined array key "url"/"name" in wc-admin-options.php on line 152/153
* Temporary removed filesize check to improve admin experience, we are developing options to check this info.

2024-07-16 - version 1.4.8
* Add extended log informations

2024-07-01 - version 1.4.7
* Fixed inline script doesn't work

2024-07-01 - version 1.4.6
* Fixed $_FILE handle

2024-07-01 - version 1.4.5
* Fixed inline styles and scripts security

2024-06-30 - version 1.4.4
* Fixed nonce sanitize in admin settings
* Add extended debug option

2024-05-31 - version 1.4.3
* Fixed nonce sanitize and functions prefix too short

2024-05-24 - version 1.4.2
* Fixed fatal error while sending DDT (if no file were uploaded)

2024-05-22 - version 1.4.1
* Fixed upload filename sanitize

2024-05-09 - version 1.4.0
* Fixed fatal error while verifing if hpos is active (when hpos is not active)

2024-05-08 - version 1.3.9
* Fixed another missing escape string in "tracking" column orders.

2024-05-08 - version 1.3.8
* Fixed missing escape string in "tracking" column orders.

2024-05-08 - version 1.3.7
* Fixed filesystem inclusion, which prevented chmod working properly while assigning permission after creating the new DDT/subfolder.
* update english language files.
* update .pot

2024-05-08 - version 1.3.6
* Fixed behaviour which prevented to remove tracking information (courier, code or link) from orders.
* Add default "choose" selector in courier selection.
* Add dynamic required attribute in courier selection, if code or link are not empty.

2024-05-08 - version 1.3.5
* Add column to WC orders list, showing essential tracking info.

2024-05-08 - version 1.3.4
* Security check and fixes
* Review code with WPCS
* Add Tracking Email Sent status in metabox

2024-05-07 - version 1.3.3
* Changed logic to check if shipped email should be sent.
Now the logic block sending email if both "tracking code" and "tracking link" are empty. If one of those are not empty the email is sent correctly.
* Add manual action "Send Email Tracking"

2024-05-06 - version 1.3.2
* Add DDT sent status in metabox

2024-04-24 - version 1.3.1
* Fix CSS for status-shipped label

2024-04-17 - version 1.3
* Add manual action "Send DDT"
* New Email Classes, one for send only Tracking information and one for Manual send DDT file

2024-04-15 - version 1.2
* Add CSS style for "Shipped" status column

2024-04-14 - version 1.1
* Add custom "Shipped" status to wc orders
* Shipped email sent with the new status change notification trigger

2024-04-11 - version 1.0
* First stable release
* Tested up to WC 8.7.0