# Changelog

All notable changes to this plugin will be documented in this file.

---

## [1.2.3] - 2026-03-03

### Added
- Added a dedicated **Rebuild Multiple Orders** submenu page for focused rebuild workflows.

### Changed
- Simplified the main **Multiple Orders** screen by moving rebuild operations to the new submenu.
- Improved admin UI/UX with clearer section hierarchy, better filter/table presentation, and a modernized rebuild layout.
- Refined user-facing terminology across menus, headings, table labels, notices, and popup content for consistency.

### Improved
- Streamlined troubleshooting flow by separating list management and rebuild operations.

---

## [1.2.2] - 2025-12-09

### Changed
- Performed full plugin integrity and compatibility checks across current WordPress and WooCommerce releases.
- Verified settings migration, metadata consistency, and renamed meta keys after the v1.2.x updates.

### Fixed
- Minor bug fixes and cleanups:
  - Resolved a race condition in AJAX linking that could leave stale meta on some orders.
  - Fixed an edge case in the "More" tab where recommendations could duplicate.
  - Ensured transients and caches are invalidated after settings changes.

### Tested
- Confirmed REST API and AJAX endpoints (including authentication) return expected responses.
- Validated multisite order fetching and metadata persistence for linked orders.
- Verified admin upgrade routine and notices run without errors.

---

## [1.2.1] - 2025-08-27

### Added
- Introduced a new **"More"** tab under the plugin settings page for plugin discovery and upsell.
- Added premium plugin showcase to help store owners find useful tools:
  - **Sequel247 Logistics Shipping** – Seamless Sequel API integration for shipping automation.
  - **Shipment Tracking** *(Coming Soon)* – Add, manage, and display tracking info on WooCommerce orders.
  - **Post/Page Import** *(Coming Soon)* – Import/export content between WordPress sites with preserved metadata.
  - **Activity Monitor Log** *(Coming Soon)* – Track and log key admin actions in the WP dashboard.

---

## [1.2.0] - 2025-08-22

### Changed
- **Renamed plugin**: Updated plugin name to **MultiOrder Sync** across all files, settings, and documentation.
- **Terminology updates**:
  - Replaced all references to **"Primary Order"** with **"Parent Order"**.
  - Replaced all references to **"Secondary Order(s)"** with **"Linked Order(s)"**.
  - Updated meta keys, labels, API responses, and internal methods for consistency.
- Updated admin UI, REST API, and settings pages to reflect the new terminology:
  - Admin meta boxes and linked order displays use updated wording.

## [1.1.0] - 2025-08-18

### Changed
- Improved the metadata structure used to store linked orders:
  - Now, **all linked orders** (parent and linked) consistently store a `multipleorders` meta entry.
- Updated the following methods to support full metadata persistence:
  - `ajax_link_orders()` now updates meta for **all orders** in the group.
  - `ajax_unlink_orders()` now properly removes metadata from all related orders.
  - `ajax_get_linked_order_details()` now outputs accurate linked order data.
- Improved the admin **Linked Orders** meta box with a clearer UI and accurate link details.
- Refactored the plugin settings page (`render_settings_page()`):
  - Now uses server-rendered tabs based on the `?tab=` URL parameter.
  - Only the active tab’s template is loaded, improving performance and clarity.
- Removed dependency on frontend JavaScript for tab switching.
- Updated admin settings templates:
  - Wrapped each tab’s content in individual PHP templates.
  - Templates are now loaded conditionally based on the selected tab.

### Deprecated
- Legacy partial `multipleorders` meta structure used prior to v1.0.1:
  - Was only set for the parent order (or only for secondaries).
  - **Fallback retained temporarily for backward compatibility.**
  - **Deprecated:** This fallback will be removed in a future major release (e.g., `v2.0.0`). Please update any custom code depending on the old structure.

### Fixed
- Fixed inconsistencies in how linked orders were displayed in the admin UI.
- Fixed issue where some linked orders were not saving metadata correctly.

---

## [1.0.0] - 2025-08-13

### Added
- Initial release of the MultiOrder Sync plugin.
- Ability to group WooCommerce orders based on customizable criteria.
- Link grouped orders into primary/secondary relationships.
- Admin UI for managing grouped orders.
- Settings panel for:
  - Order criteria.
  - Email templates.
  - Admin emails and CC.
  - API key.
- REST API:
  - Fetch grouped orders across the network:  
    `GET /wp-json/emw-mom/v1/orders`
  - Get multiple order group by order ID:  
    `GET /wp-json/emw-mom/v1/multiple-order-group/{order_id}`
- Multisite support: Fetch orders across all network sites.
- API authentication via custom API key header (`X-EMW-MOM-API-Key`).
- Toggle REST API docs in plugin settings.

### Fixed
- None — initial stable release.

### Security
- REST API secured via API key and admin toggle.

---
