=== Codihi Smart Cart Order Sync for Skroutz ===
Contributors: panosrekou
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.18
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: skroutz, woocommerce, marketplace, orders, webhook

Connect WooCommerce with Skroutz Smart Cart (Orders API): instant order import and webhook automation for Greek e-commerce.

== Description ==

**Codihi Smart Cart Order Sync for Skroutz** connects your WooCommerce store with the Skroutz Smart Cart (Orders API) and Webhook systems. Skroutz is an independent marketplace platform; this plugin is an unofficial, third-party integration and is not affiliated with, endorsed by, or sponsored by Skroutz.

The plugin adds a secure webhook endpoint to your site. Skroutz calls it whenever one of your Smart Cart orders is created or changes state, and the plugin creates or updates the matching WooCommerce order.

This plugin allows merchants to:
* Automatically receive new Skroutz orders into WooCommerce through the Skroutz order webhook (customer, address, line items, Skroutz commission and fees).
* Match Skroutz line items to your WooCommerce products by SKU, Product ID, a custom meta field, or a "Smart Match" (custom meta, SKU, ID, EAN, MPN in turn).
* Have WooCommerce reduce the ordered items' stock as soon as a Skroutz order arrives, and restore it automatically if the order is rejected or cancelled — using WooCommerce's own built-in stock management. Stock levels are not sent back to Skroutz.
* Add the Skroutz shipping cost to orders you ship yourself, and see the courier, tracking codes, voucher link, dispatch deadline and payment method (including cash on delivery) on the order.
* Save the invoice request of a Skroutz customer (company, VAT number, tax office, activity, document type) on the order, and use the invoice details for the billing address.
* Map each Skroutz order state to one of your existing WooCommerce order statuses, and optionally mark delivered orders as Completed.
* Receive an email for every new Skroutz order, see Skroutz details (code, state, Skroutz Plus, express, pickup point) on the order screen, and filter the order list to Skroutz orders.

**Why choose this plugin:**
1. **Lightweight:** one webhook endpoint and one API request per webhook, no background jobs.
2. **Security-conscious:** the webhook is protected by a secret token; built following WordPress coding standards (prepared SQL statements, nonces, output escaping).
3. **No bundled libraries:** no third-party libraries or tracking scripts.

*(Upgrade to the Premium version for one-click Courier Vouchers generation, automatic invoice uploading to Skroutz, and full Skroutz Last Mile integration.)*

**Ελληνικά (Greek)**

Το **Codihi Smart Cart Order Sync for Skroutz** συνδέει το WooCommerce κατάστημά σας με το Skroutz Smart Cart (Orders API). Μόλις μια παραγγελία δημιουργηθεί ή αλλάξει κατάσταση στο Skroutz, το plugin δημιουργεί ή ενημερώνει αυτόματα την αντίστοιχη παραγγελία στο WooCommerce — χωρίς χειροκίνητη καταχώριση. Το Skroutz είναι ανεξάρτητη πλατφόρμα· το plugin είναι ανεπίσημη ενσωμάτωση τρίτου και δεν συνδέεται με το Skroutz.

* Αυτόματη λήψη των νέων παραγγελιών Skroutz στο WooCommerce (πελάτης, διεύθυνση, προϊόντα, προμήθεια και χρεώσεις Skroutz).
* Αντιστοίχιση των προϊόντων με βάση SKU, ID προϊόντος, προσαρμοσμένο meta πεδίο ή «Smart Match» (meta, SKU, ID, EAN, MPN με τη σειρά).
* Μείωση αποθέματος με την άφιξη της παραγγελίας και αυτόματη επαναφορά όταν απορριφθεί, ακυρωθεί ή λήξει. Το απόθεμα δεν στέλνεται πίσω στο Skroutz.
* Προσθήκη των μεταφορικών του Skroutz στις παραγγελίες που στέλνετε εσείς, και εμφάνιση courier, tracking, voucher, προθεσμίας αποστολής και τρόπου πληρωμής (και αντικαταβολής) στην παραγγελία.
* Καταχώριση του τιμολογίου που ζητά ο πελάτης (εταιρεία, ΑΦΜ, ΔΟΥ, επάγγελμα, τύπος παραστατικού) στην παραγγελία, και χρήση των στοιχείων τιμολογίου ως διεύθυνση τιμολόγησης.
* Αντιστοίχιση κάθε κατάστασης Skroutz με δική σας κατάσταση παραγγελίας WooCommerce και προαιρετική ολοκλήρωση των παραδοθέντων παραγγελιών.
* Ειδοποίηση με email για κάθε νέα παραγγελία Skroutz, πλαίσιο «Skroutz Marketplace» στην παραγγελία (κωδικός, κατάσταση, Skroutz Plus, express, σημείο παραλαβής) και φίλτρο «μόνο παραγγελίες Skroutz» στη λίστα.
* Ασφάλεια: το webhook προστατεύεται με μυστικό κωδικό, και το plugin δεν περιέχει εξωτερικές βιβλιοθήκες ή εργαλεία παρακολούθησης.
* Διεπαφή και ενσωματωμένο εγχειρίδιο στα ελληνικά, συμβατότητα με HPOS.

**Γρήγορη εκκίνηση:** Codihi Plugins → Skroutz Orders → Connection & Security. Επικολλήστε το API Token από το Skroutz Merchants Panel (ενότητα API), αντιγράψτε το Webhook URL και βάλτε το στο πεδίο Webhook URL του Merchants Panel. Η αποδοχή/απόρριψη των παραγγελιών και τα vouchers γίνονται από το Merchants Panel. Η Premium έκδοση προσθέτει δημιουργία vouchers, αυτόματη αποστολή παραστατικών και πλήρη ενσωμάτωση Skroutz Last Mile.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/codihi-skroutz-orders-api-free` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to Codihi Plugins -> Skroutz Orders to configure the settings.
4. Add your Skroutz API Token, check the Webhook Secret, and copy the Webhook URL shown there into the Skroutz Merchants Panel.

== Frequently Asked Questions ==

= What do I need before I install the plugin? =
An active WooCommerce store, a Skroutz Smart Cart merchant account with an API Token (you create it in the Skroutz Merchants Panel, under API), and a site that Skroutz can reach over the internet (HTTPS recommended). A site on localhost or behind a maintenance/password wall cannot receive webhooks.

= How do I connect my store to Skroutz? =
1. Go to Codihi Plugins → Skroutz Orders → Connection & Security.
2. Paste your Skroutz API Token and keep (or change) the Webhook Secret. Save.
3. Copy the Webhook URL shown on the same tab. It already contains the secret.
4. Paste that URL into the Webhook URL field of the Skroutz Merchants Panel.

To change the Webhook Secret later, edit it (or press "Generate new secret" for a random one), save, copy the Webhook URL again and update it in the Skroutz Merchants Panel. The old URL stops working immediately.

= Which Skroutz order states does the plugin handle? =
New (Skroutz sends it as "open"), accepted, ready (Skroutz Last Mile), dispatched, delivered, rejected, canceled and expired. Each state can be mapped to one of your existing WooCommerce order statuses under Status Mapping, or left as "No Change". Stock is reduced for new, accepted, ready, dispatched and delivered orders, and restored for rejected, canceled and expired orders.

= Which WooCommerce statuses are used by default? =
New → On hold, dispatched → Completed, rejected / canceled / expired → Cancelled. Accepted, ready and delivered leave the status unchanged. You can change every one of these in Status Mapping, and tick "Auto Complete" to mark delivered orders as Completed.

= How are Skroutz products matched to my WooCommerce products? =
Skroutz sends your own product identifier (shop_uid) with every line item. Under Product Matching you choose how it is looked up: by SKU, by Product ID, by a custom meta field (for example an ID imported from another platform), or with "Smart Match", which tries custom meta, SKU, ID, EAN and MPN in turn.

= What happens if a product cannot be matched? =
The order is still imported so you never lose a sale. The line appears as "Unknown Product (SKU: …)" with the right quantity and price, no stock is changed for it, and an error is written to the log (if logging is on). Fix the identifier in Product Matching or on the product, then edit the order manually.

= Does it work with variable products (sizes, colours)? =
Yes. For items with a size Skroutz sends the product code (shop_uid) and the variation code (shop_variation_uid). The plugin looks up the variation first, in the way chosen in Product Matching (SKU, Product ID or custom meta), and checks that it belongs to the matching product, so the stock of the right size is reduced. Each variation needs its own unique SKU (or custom meta value) that matches your Skroutz feed. If no variation is found, the product found through shop_uid is used.

= Can the same order be imported twice? =
No. Orders are recognised by their Skroutz order code, and while one delivery of an order is being processed a second one (for example a retry from Skroutz) is held back with an HTTP 409 and retried later. If Skroutz sends the same webhook again, or the order changes state, the existing WooCommerce order is updated instead of a new one being created. Older events that arrive late are ignored, and orders you have already cancelled or refunded in WooCommerce are not reopened by later Skroutz updates.

= If I edit an imported order, will the next webhook overwrite my changes? =
The customer address, line items and Skroutz fees are written only when the order is created. Later webhooks for the same order update the Skroutz details, the order status (according to your Status Mapping) and the stock. Your manual edits to the address or items are kept.

= Is the Skroutz shipping cost added to the order? =
Yes, for orders you ship yourself. Skroutz only sends a shipping cost for those orders. It is added to the new WooCommerce order as a shipping line named "Skroutz Marketplace shipping", so the total is goods plus shipping minus the Skroutz commission and fees. With taxes switched on it is kept as net + VAT, so the amount stays as Skroutz sent it. Orders fulfilled by Skroutz have no shipping line.

= Which courier and payment details does the plugin show? =
The "Skroutz Marketplace" box on the order shows the courier, the tracking codes, the number of parcels, a link to the courier voucher, the dispatch deadline (in red once it has passed and the order is not shipped yet), the time you must accept a new order by, and the payment method. Cash on delivery orders are marked "not paid yet". The details are refreshed on every Skroutz update. The plugin shows the voucher that Skroutz provides; creating vouchers is part of the Premium version.

= Does WooCommerce add VAT on top of the Skroutz prices? =
No. Skroutz amounts already include VAT. With taxes switched on, each product line and the Skroutz shipping line are kept as net + VAT at your shop's own rate, so the order total stays exactly the Skroutz amount (for example 88,90 € = 71,69 € + 17,21 € VAT) and the VAT has its own line for your invoices. The Skroutz commission and fee lines carry no VAT. "Recalculate" in the order screen gives the same total. With taxes switched off the amounts are kept as Skroutz sent them. Orders imported before version 1.1.17 are left as they are.

= What happens when a customer asks for an invoice? =
Skroutz sends the invoice details with the order. The plugin saves the document type (receipt, invoice, invoice for article 39a VAT exemption, or EU cross-border VIES invoice), the company, VAT number, tax office and activity on the order, and on a new order it uses the company and the invoice address as the billing details (the shipping address stays the customer's delivery address). A note is added to the order, and the "Skroutz Marketplace" box shows the document, company, VAT number and tax office. Values you have already entered on the order are never overwritten. The plugin does not issue the invoice itself.

= Can I use the invoice details with my invoicing or myDATA plugin? =
The details are stored in the order fields _billing_document_type, _billing_vat, _billing_tax_office and _billing_activity, which are the fields used by the Codihi Checkout Invoice and Codihi myDATA plugins, so those can pick them up. For other invoicing plugins you can read the same fields, or the "_skroutz_invoice_document" field with the Skroutz document type.

= Which billing country is used for EU cross-border (VIES) invoices? =
Skroutz does not send a billing country for an invoice, so the plugin uses the delivery country (Greece if none was sent) and adds an order note asking you to check it before you issue the invoice.

= How are the Skroutz commission and fees shown? =
As negative fee lines named "Skroutz Commission" and "Other Skroutz Fees", so the WooCommerce order total is what you actually receive from Skroutz.

= Which email address is used for the customer? Will customers get WooCommerce emails? =
Skroutz does not share the customer's email, so the plugin sets a placeholder (skroutz_ORDERCODE@skroutz.gr) as the billing email. The plugin itself never emails customers. WooCommerce's own customer emails (for example "Order completed") would be addressed to the placeholder and are not delivered, so you can switch them off under WooCommerce → Settings → Emails.

= Which country is used for the address? =
The country Skroutz sends with the customer address (country_code). If Skroutz sends none, or a country WooCommerce does not know, Greece is used. The Skroutz region is saved as a custom field and as an order note.

= Can I get an email when a Skroutz order arrives? =
Yes. Tick "Enable notification" under Email Notification in the settings. It goes to the address you enter, or to the site administrator email if you leave it blank, with a direct link to the new order.

= Where can I see which orders came from Skroutz? =
The WooCommerce orders list has a Skroutz column with an icon that shows the Skroutz state when you hover over it, and a filter that shows "Skroutz orders only". Each Skroutz order has a "Skroutz Marketplace" box with the order code, state, Skroutz Plus, express delivery, pickup point and locker information.

= Orders are not arriving. What should I check? =
1. The Webhook URL in the Skroutz Merchants Panel is the one currently shown in the plugin (including the token).
2. The API Token is valid and the Webhook Secret is not empty (an empty secret rejects all requests).
3. Your site is reachable from the internet and the REST API is not blocked: open `/wp-json/` on your site, and check security plugins, firewalls (WAF), CDN rules, maintenance mode and password-protection (HTTP authentication) for that address.
4. Turn on "Enable logging" in the settings and look at WooCommerce → Status → Logs (source "smart-cart"). Every webhook that reaches the plugin is logged; if nothing appears, the request is being blocked on the way or rejected because the token in the URL does not match your Webhook Secret (Skroutz then reports an HTTP 401).

= Where are the logs? =
Enable logging in the plugin settings. Entries are written with the WooCommerce logger and are visible under WooCommerce → Status → Logs (source: "smart-cart"). Leave logging off when you don't need it.

= Does the plugin accept or reject orders on Skroutz, create vouchers or send stock to Skroutz? =
No. The Free version only reads orders: you accept or reject them, print vouchers and update your product feed from the Skroutz Merchants Panel. Voucher generation, automatic invoice upload and the full Last Mile integration are part of the Premium version.

= Is it compatible with HPOS (High-Performance Order Storage)? =
Yes. The plugin declares compatibility and uses only the WooCommerce order API, so it works with both the classic and the new order tables.

= Who can change the settings? =
Users who can manage WooCommerce (the "manage_woocommerce" capability), normally Administrators and Shop managers.

= Does the plugin track users or contact other servers? =
No tracking and no bundled libraries. The plugin contacts api.skroutz.gr only when a Skroutz webhook arrives, and an admin who opens the "Codihi Plugins" overview page triggers a plain request for the public Codihi product list. See the "External services" section for the details.

= Is this an official Skroutz plugin? =
No. It is an independent integration by Codihi and is not affiliated with, endorsed by or sponsored by Skroutz.

= Is there a Greek version of the settings and the manual? =
Yes. The admin screens are translated into Greek, and the built-in User Manual is available in Greek and English (it opens in the language of your admin profile, with a switch at the top).

= What happens to my data when I uninstall the plugin? =
Deleting the plugin removes its settings. Orders already imported stay in WooCommerce as normal orders.

= Does a Skroutz order reduce my WooCommerce stock? =
Yes. When a Skroutz order is imported, WooCommerce's own stock management reduces the ordered items' stock as part of the normal order-creation flow, and restores it automatically if you reject or cancel the order. This plugin does not send stock levels back to Skroutz — you still need to keep your Skroutz product feed/listing up to date the way you already do today.

= How do I manage Vouchers? =
Voucher generation is a Premium feature. In the Free version, you manage acceptance/rejection from the Skroutz Merchants Panel, and the plugin strictly handles the WooCommerce order creation and stock deduction.

== Screenshots ==

1. The Skroutz Orders API settings page.
2. The Skroutz order details box on the WooCommerce order screen.

== External services ==

This plugin connects your store to the Skroutz Smart Cart API, operated by Skroutz S.A., so that orders placed on the Skroutz marketplace can be imported into WooCommerce.

When a Skroutz order webhook is received, the plugin calls `https://api.skroutz.gr` (using the API token you enter in Settings) to fetch the full order details — customer, line items and shipping data — so the corresponding WooCommerce order can be created or updated. The request carries only your API token and the Skroutz order code; nothing is sent to Skroutz unless a Skroutz order webhook is received.

This service is provided by Skroutz S.A.: [Terms of Use](https://www.skroutz.gr/terms), [Privacy Policy](https://www.skroutz.gr/privacy).

**Codihi product catalog (codihi.com)**

When an administrator opens the "Codihi Plugins" overview page in wp-admin, the plugin requests the public product list from `https://codihi.com/wp-json/wc/store/v1/products` to show the other Codihi plugins with their prices. It is a plain GET request: no store, customer or order data is sent, and the result is cached for 12 hours. If codihi.com cannot be reached, a built-in list without prices is shown instead. Nothing is requested from codihi.com on any other page or on the front end.

This service is provided by Codihi: [Terms of Use](https://codihi.com/terms-and-conditions/), [Privacy Policy](https://codihi.com/privacy-policy/).

== Changelog ==

= 1.1.18 =
* Fixed: VAT was still added on top of the Skroutz price (e.g. 11,99 € became 11,99 € + 2,88 € VAT). The plugin wrote the Skroutz price on a copy of the order line that WooCommerce hands out, so the order kept the shop's own price, taxed it, and the net + VAT split never ran. It now writes on the order's own line: the Skroutz price (VAT included) is the line's final amount, split into net + VAT, and the order total is what the customer paid.
* Fixed: without HPOS, sorting the orders list by the Skroutz column hid every non-Skroutz order. All orders now stay in the list.
* Fixed: without HPOS, the "Skroutz orders only" filter also filtered other lists of the same page; it now filters only the orders list.
* Fixed: with HPOS, the "Skroutz orders only" filter did not show above the orders list and did not filter. It now shows and filters.
* Fixed: with the Pro version also active, this plugin could miss it (depending on the order WordPress loads plugin folders) and keep running. It then answered the Skroutz webhook with its own key and refused the Pro version's orders. It now checks again once all plugins are loaded and pauses itself.
* Fixed: every Skroutz order has the made-up address skroutz_<code>@skroutz.gr, and WooCommerce sent every customer email there (bounces on the shop's server, order details to a domain that is not the customer's). Customer emails to that address are no longer sent. Store emails are not affected.

= 1.1.17 =
* Fixed: WooCommerce added its own VAT on top of the Skroutz prices, which already include VAT, in every shop with taxes switched on (e.g. 88,90 € became 110,24 €), whatever "Prices entered with tax" says. Each line the plugin adds (products and the Skroutz shipping line) is now kept as net + VAT at the shop's own rate, once, when the order is imported: the total is exactly the Skroutz amount (88,90 € = 71,69 € + 17,21 € VAT), the VAT has its own line, so invoices and myDATA get the right VAT, and "Recalculate" in the order screen gives the same total. Orders imported earlier are left as they are.
* Fixed: the "Skroutz Commission" / "Other Skroutz Fees" lines never carry VAT, also after "Recalculate".
* Removed: the settings warning that asked to switch WooCommerce to "Prices entered with tax". It is no longer needed, and the VAT was added on top with either setting. The FAQ entry was updated.

= 1.1.16 =
* Fixed: the "Only Skroutz" filter of the orders list did nothing with WooCommerce's HPOS order storage.
* Changed: the "Available in Pro" panel says that the Pro version prints with the Codihi Print Agent (no browser needed) instead of QZ Tray.

= 1.1.15 =
* Changed: the "Available in Pro" panel and the User Manual now mention automatic printing, which the Pro version gained (vouchers on the thermal printer, order sheets on the normal printer). Nothing changes in how this plugin works.
* Changed: the shared "Codihi Plugins" overview page shows a "Custom Plugin" card (made-to-order plugins, with links to codihi.com).

= 1.1.14 =
* Added: a warning on the settings page when WooCommerce has taxes on but prices entered without tax. Skroutz amounts already include VAT, so WooCommerce would add VAT on top and the order totals would be higher than in Skroutz. A matching FAQ entry was added.

= 1.1.13 =
* Fixed: correct order total when the shop has taxes switched on. WooCommerce treats the negative "Skroutz Commission" and "Other Skroutz Fees" lines like a discount and reduces the VAT by them, so with prices that include VAT the total came out lower than goods plus shipping minus commission (for example 0.97 less on a 4.05 commission). The tax on those lines (and on the shipping cost) is now removed again and the tax lines and totals are rebuilt. Nothing changes when taxes are off.

= 1.1.12 =
* Fixed: the "Express delivery" badge was never shown, because the code looked for a field called express_delivery while Skroutz sends express. Both names are read now.

= 1.1.11 =
* Fixed: duplicate orders from webhook retries. Skroutz re-sends a webhook up to 4 times within 20 minutes when it does not get a 200, so two deliveries of the same order could overlap and both create a WooCommerce order. Deliveries are now serialised per Skroutz order code; the second one receives HTTP 409 and Skroutz retries it a moment later.
* Fixed: outdated webhooks no longer roll an order back. The time of the last applied event is stored and an older event is ignored (answered with 200 so Skroutz stops retrying). Before, a late "new" after a "canceled" could take the stock of a cancelled order again.
* Fixed: orders the merchant already settled are left alone. Refunded orders are not changed; Cancelled orders only accept a Skroutz cancel / reject / expiry; Completed orders are not moved back by new / accepted / ready.
* Fixed: product variations. For items with a size Skroutz sends a shop_variation_uid, which was ignored so only the variable parent was matched. The variation is now looked up first (SKU, ID or custom meta, as set in Product Matching, among variations only) and must belong to the product matched through shop_uid; otherwise the previous matching applies.
* Added: invoice details from Skroutz. When a customer asks for an invoice, the document type, company, VAT number, tax office and activity are saved on the order (using the same order fields as the Codihi Checkout Invoice and Codihi myDATA plugins), and on a new order the billing company and billing address are taken from the invoice details while the shipping address stays the delivery address. The "Skroutz Marketplace" box on the order shows the document, company, VAT number and tax office.
* Added: shipping cost and courier details. For orders the merchant ships, the Skroutz shipping cost is added to the new order as a shipping line. Courier, voucher link, tracking codes, parcels, dispatch deadline, accept-before time and payment method (cash on delivery orders are marked "not paid yet") are saved on every webhook and shown in the "Skroutz Marketplace" box on the order.
* Added: the delivery address now uses the country Skroutz sends (country_code) instead of always Greece, and a "Generate new secret" button next to the Webhook Secret.

= 1.1.10 =
* Changed: the readme has many more FAQ entries and a Greek description.
* Added: Greek translation (el) bundled in /languages, loaded with load_plugin_textdomain(). A Greek language pack from translate.wordpress.org, if one is published, takes precedence.

= 1.1.9 =
* Changed: every text in the order box, the order-list column and filter, the admin menu and the Pro-active notice is now in English and translatable (some of it was hard-coded in Greek). Skroutz order states share one translatable list.

= 1.1.8 =
* Fixed: new Skroutz orders did not reduce stock on arrival. Skroutz sends new orders with the state "open", which the plugin did not recognise (it expected "new"), so the order stayed "Pending payment" and its stock was only reduced once it was accepted. "open" is now treated as "new": the "New" status mapping applies and stock is reduced immediately.
* Added: "Expired" state (order not accepted in time). It restores stock and has its own Status Mapping entry (default: Cancelled).

= 1.1.7 =
* Fixed (WordPress.org review): no CSS is printed as a raw <style> tag any more. The "Codihi Plugins" menu icon and Overview page styles are now added with wp_register_style() / wp_add_inline_style() on admin_enqueue_scripts, and the Overview styles load only on that page (Codihi_Hub_1 and Codihi_Hub_2).

= 1.1.6 =
* Fixed: choosing "No Change (Ignore)" in the Status Map was saved as an empty value and silently replaced by the default mapping (e.g. DISPATCHED → Completed). It is now honoured, and the dropdown shows the default that actually applies when nothing has been saved.
* Changed: the readme now describes exactly what the code does (webhook endpoint, product matching, inbound-only stock handling — no stock is sent to Skroutz), with the correct settings location.
* Changed: "External services" now also documents the product catalog request the "Codihi Plugins" overview page makes to codihi.com.
* Changed: removed "sync" wording from the in-plugin manual's product-matching and stock sections.
* Added: the User Manual tab is now also available in English. It opens in Greek for Greek-language admins and in English for everyone else, with a switch at the top.
* Fixed: Plugin Check "OutputNotEscaped" errors in the shared "Codihi Plugins" menu (Codihi_Hub_2): the menu-icon CSS is now attached with wp_add_inline_style() instead of being printed as a raw <style> tag.
* Changed: the Webhook URL is now a field on the Connection tab, right below the Webhook Secret it contains, instead of a notice at the top of the page.
* Fixed: the manual said a rejected/cancelled order always becomes "Cancelled"; it now explains that this depends on the Status Map, while the stock is restored in every case.
* Changed: the Settings page no longer shows disabled Pro-only fields (Order Defaults tab, Auto Accept, Auto Pick-up Time, Auto Sync, Order Management, Manual Import, Advanced Webhook Protection, custom statuses). They are replaced by an informational "Available in Pro" panel of feature cards with a single link, which each user can close with its × button (and reopen from the User Manual); every setting shown now works in this plugin.
* Fixed: the "Learn more about Pro" link now always opens the Pro product page. It used to look the product up in the merchant's own database, so on every store other than codihi.com it fell back to the codihi.com home page.
* Changed: "Plugin URI" now points to the plugin's current page instead of an old address that redirected.
* Removed: a stray copy of the Skroutz API documentation (`orders_api.html.md.erb`) that was not used by the plugin.

= 1.1.5 =
* The Overview product map now includes the plugins about to be sold (AI Product Importer, Quick Edit, Semantic Search, Checkout Invoice, myDATA, Barcode Stock Updater, Product Presentation, Language Switch) (Codihi_Hub_2).

= 1.1.4 =
* The "Codihi Plugins" menu now sits right under Settings so it no longer leaves an odd gap before Appearance (Codihi_Hub_2).

= 1.1.3 =
* The brand-coloured "Codihi Plugins" menu icon is now always visible, not only on hover (Codihi_Hub_2).

= 1.1.2 =
* "Codihi Plugins" Overview: the brand-coloured menu icon now renders correctly (WordPress was repainting it white), and installed-plugin cards link to each plugin's settings page automatically (Codihi_Hub_2).

= 1.1.1 =
* The "Codihi Plugins" Overview now also lists every plugin sold on codihi.com, with price and a link to get it (Codihi_Hub_2).

= 1.1.0 =
* Η σελίδα ρυθμίσεων μεταφέρθηκε στο κοινό μενού «Codihi Plugins».

= 1.0.23 =
* Fixed: cancelling or rejecting an order did not return the stock when the default status mapping had been changed. WooCommerce only restores stock on "Cancelled" and "Pending", so shops that mapped Rejected/Canceled to "Refunded" or "Failed", or to "No Change", never got the stock back. Stock is now settled from the Skroutz state itself and applied last, so it is correct for every mapping.


= 1.0.22 =
* Changed: `readme.txt` no longer describes a "stock sync" with Skroutz (short description, feature bullet, FAQ, "External services"). The plugin only ever fetches order details from `https://api.skroutz.gr`; it has no code that pushes WooCommerce stock levels to Skroutz. What actually happens — WooCommerce's own built-in stock management reducing/restoring the ordered items' stock as a Skroutz order is imported/rejected/cancelled — is now described accurately and distinguished from the (nonexistent) outbound sync.

= 1.0.21 =
* Changed: renamed the plugin from "Codihi Skroutz Orders API - Free" to **Codihi Smart Cart Order Sync for Skroutz**, to drop the discouraged "Free" term and place "Skroutz" in a non-affiliation-implying structure, per WordPress.org Plugin Directory naming guidelines.
* Removed: `codihi_skroutz_free_register_custom_statuses()`, `codihi_skroutz_free_add_custom_statuses()` and their stock-transition hooks — a fully working implementation of custom WooCommerce order-status creation that had no UI in the Free version to enable it, but would still run if a `custom` status mapping was set (e.g. a leftover option value from a PRO downgrade). Per the Directory's guidelines, a built-in feature can't ship gated behind PRO like this; creating custom statuses is now exclusively part of the PRO plugin's own codebase. The webhook's order-status handling already no-ops safely on a stray `custom` value.
* Fixed: the sub-tab switcher on the Settings page was a raw `<script>` tag printed inline in the page markup, flagged by the WordPress.org Plugin Check. It is now registered with `wp_enqueue_script()` / `wp_add_inline_script()`, loaded only on the plugin's own settings page.
* Removed: the disabled "Create New (Custom) — PRO only" option from the status-mapping dropdown. It could never be selected, which is the locked-built-in-feature pattern the Plugin Directory guidelines disallow; the plain explanatory text about the PRO-only custom-status feature elsewhere on the page is unaffected.
* Removed: an unused `assets/js/admin.js` left over from the PRO codebase — it was never enqueued and its two AJAX actions (voucher/invoice handling, manual order import) have no matching handler in the Free version.
* Changed: `readme.txt` — removed the "background sync routines" claim (no cron-based sync is implemented in the Free version; the plugin only reacts to incoming Skroutz webhooks), reworded the status-mapping bullet to avoid implying the Free version can create custom WooCommerce statuses, added a non-affiliation note, and added an "External services" section documenting the Skroutz API connection.
* Changed: `Contributors` in `readme.txt` now lists the actual WordPress.org account (`panosrekou`) instead of a non-account name.

= 1.0.20 =
* Fixed: "Plugin URI" and "Author URI" in the plugin header were identical, which WordPress.org flags as an error (a plugin URI must describe the plugin, an author URI must describe the author). They now point to two distinct, real pages.

= 1.0.19 =
* Changed: "Payment Gateway", "Shipping", "User ID" and "Billing Email" are now marked as PRO-only in Settings → Order Defaults. They were never applied by the Free version's webhook order-creation logic, so saving them had no effect — they now show a clear upgrade badge instead of a misleading, non-functional field.
* Removed: "Variation participation attributes" and "Color/Parent ID" settings — never used by the actual product-matching logic (which relies on SKU/Product ID/Custom Meta/Smart Match), removed rather than left as misleading UI (same cleanup as the PRO version, v1.2.3).
* Fixed: leftover "variation attributes" text in the in-plugin User Manual, describing a setting that no longer exists.
* Security: hardened a few read-only admin list filters and settings-page inputs/outputs (defensive escaping and sanitization, no behavior change).

= 1.0.18 =
* Added: official HPOS (High-Performance Order Storage) compatibility declaration — the plugin is no longer listed as incompatible and no longer blocks you from enabling HPOS.
* Changed: internal hardening of API response handling, so a failed call to Skroutz can never turn into a fatal error (same fix as the PRO version).

= 1.0.17 =
* Changed: IP allowlist validation and replay protection for incoming webhooks are now marked as PRO-only features in Settings → Connection & Security.

= 1.0.16 =
* Changed: "Create New (Custom)" order status is now a PRO-only feature. The Free version can still map Skroutz states to any of your existing WooCommerce statuses.

= 1.0.15 =
* Added: Auto Complete logic for delivered Skroutz orders.

= 1.0.13 =
* Security: the webhook now fails closed (rejects the request) instead of allowing unauthenticated calls when no Webhook Secret is configured, and token comparison uses a timing-safe check.
* Security: a random Webhook Secret is now generated automatically on activation, so the webhook is never left unprotected.
* Security: the Webhook Secret field can no longer be saved empty by mistake.
* Added: plugin icon on the settings page, matching the Premium version.

= 1.0.1 =
* Fixed: 100% Compliance with WordPress.org Plugin Check.
* Security: Implemented strict $wpdb->prepare for all queries.
* Security: Massively improved escaping and nonce validation.
* i18n: Unified text domains and added translator comments.

= 1.0.0 =
* Initial release.
