=== Sulado Odstúpenie a reklamácie for WooCommerce ===
Contributors: tomarco
Tags: woocommerce, consumer rights, warranty claim, withdrawal, gdpr
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.12.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Slovak-law online contract withdrawal (§ 20a, required from 19 June 2026) and warranty claims for WooCommerce. PDF protocols, GDPR, HPOS.

== Description ==

**From 19 June 2026, Slovak e-shops must offer consumers an online way to withdraw from a contract** (§ 20a of Act No. 108/2024 Coll. on consumer protection). This plugin adds that statutory function to your WooCommerce store in one click — and handles the second everyday consumer-rights flow as well: online warranty claims (reklamácie) under the defect-liability rules of the Civil Code (Act No. 40/1964 Coll.), with the claim handled per Act No. 108/2024 Coll.

Activate the plugin and it sets itself up: the two front-end form pages are created and configured automatically, a discreet footer link makes them reachable from every page, and customers can also start from My Account. Every submission gives you a structured record in admin, the customer a confirmation e-mail (proof on a durable medium), and both sides a printable PDF protocol.

= For your customers =

* Contract-withdrawal form with the exact statutory "Confirm withdrawal from contract" button and an automatic 14-day period check.
* Warranty-claim form with product details (brand, model, serial number, invoice) and secure photo upload (real MIME validation, incl. HEIC from iPhones).
* Works for guests too — order ownership is verified by the order e-mail or postcode; logged-in customers simply pick their order from a dropdown.
* My Account "Returns & claims" tab listing eligible orders with one-click actions and a per-order countdown of the days left to withdraw and to file a claim.
* Live deadline banner on the withdrawal form (green / amber / red) with a days-remaining counter.

= For the store owner =

* Statutory deadline tracking out of the box: the 14-day refund deadline for withdrawals and the 30-day handling deadline for claims, with coloured countdowns and a daily e-mail reminder before they expire.
* Status workflows: withdrawals (New / In progress / Completed) and warranty claims (New / In progress / Resolved / Rejected) with the method of handling (repair, replacement, refund, price reduction, rejection).
* Native admin lists under the WooCommerce menu: status filter views with counts, sortable columns, bulk actions, search (incl. invoice number), and open-record badges in the menu.
* Full order integration: "Consumer rights" meta box and badge column on orders, private order notes, HPOS and legacy storage.
* Server-side PDF protocol (claim number RK-YYYY-NNNN, seller details, statutory notice) rendered locally with full Slovak diacritics — no external service, no data leaves your site.
* Customer and operator e-mails as native WooCommerce e-mail classes (template overrides, plain-text versions, defect-photo thumbnails for the operator).
* Dashboard widget with new / in-progress / near-deadline counts; silent anti-spam (honeypot + time-trap — no CAPTCHA to annoy customers).
* Settings live natively in WooCommerce > Settings > Súlad e-shopu — no extra top-level menu.

= Compliance & privacy =

* GDPR-ready: integrates with the WordPress personal-data export and erase tools (uploaded photos included), plus an optional data-retention auto-delete.
* Statutory wording and deadlines follow Slovak law: withdrawal under § 20a of Act No. 108/2024 Coll., defect liability (24 months) under the Civil Code, 30-day claim handling under Act No. 108/2024 Coll.
* The source language is English; UI translations are shipped for Slovak, Czech, German, Polish and Hungarian.

= What the plugin does NOT do =

* Automatic refunds or order status changes — those decisions stay fully in your hands.
* Editing your terms and conditions or providing legal advice (that remains with you and your lawyer).

== Installation ==

1. Install from Plugins > Add New (search for "Sulado") or upload the `sulado-odstupenie-a-reklamacie-for-woocommerce` folder to `/wp-content/plugins/`. WooCommerce must be active.
2. Activate the plugin. Setup runs automatically: the withdrawal and warranty-claim pages are created and configured, the footer link is enabled, and you land on a short welcome screen — the store is compliant at this point.
3. Recommended: in WooCommerce > Settings > Súlad e-shopu fill in the operator e-mail and your business IDs (IČO, DIČ, IČ DPH) so they appear on the PDF protocol. The seller name and address are taken from your store settings automatically.
4. Optional: add the two pages to your navigation menu (Appearance > Menus). Customers always reach the forms via the automatic footer link and My Account, so this is purely cosmetic; the footer link can be turned off in settings.

== Frequently Asked Questions ==

= Does it work for a logged-out customer? =
Yes. Order ownership is verified by the order e-mail or postcode.

= Does the plugin handle e-mail deliverability? =
Not directly - it sends via `wp_mail()`. For reliable delivery of confirmations, set up SMTP (e.g. FluentSMTP) and SPF/DKIM on the site.

= Are uploaded warranty claim photos safe? =
Yes. Files are validated by their real content (magic bytes) against a strict image whitelist, stored with random names and an extension derived from the validated type, so non-image files (e.g. PHP) are rejected before they are written.

= Is it HPOS (High-Performance Order Storage) compatible? =
Yes. The plugin declares custom_order_tables compatibility and the order meta box, badge column, notes and reverse links all work with both HPOS and the legacy post-based order storage.

= Is it GDPR compliant? =
It integrates with the built-in WordPress personal-data tools: submitted withdrawals and warranty claims are included in the Export and Erase requests for a given e-mail (uploaded photos are removed too). You can also enable an optional retention period after which old records are deleted automatically.

= Does it change my order status or issue refunds automatically? =
No. The plugin records and documents the request and runs its own status workflow, but it never changes the WooCommerce order status or issues a refund by itself. Those actions stay fully in your hands.

= Does the plugin replace a lawyer or guarantee compliance? =
No. It is a tool to help you collect and document withdrawals and warranty claims in line with Slovak law - Act No. 108/2024 Coll. (withdrawal, § 20a; 30-day claim handling) and the Civil Code, Act No. 40/1964 Coll. (defect liability, the 24-month warranty period). It is not legal advice; your terms, deadlines and final decisions remain your responsibility.

= Which languages are available? =
The source language is English and UI translations are shipped for Slovak, Czech, German, Polish and Hungarian. Strings use the standard WordPress translation system, so the interface can be translated into any language. Note: the statutory texts (deadlines, protocol notice) reflect Slovak law - the withdrawal right under Act No. 108/2024 Coll. and the 24-month defect liability under the Civil Code (Act No. 40/1964 Coll.); for other jurisdictions have the legal wording reviewed by a local lawyer.

= Does it use any external service to generate the PDF? =
No. PDF protocols are rendered on your own server with the bundled DOMPDF library and bundled DejaVu Sans fonts. Remote loading is disabled, so no customer data leaves your site.

= What is "Sulado"? =
"Sulado" is the brand name of the plugin; the rest of the title ("Odstúpenie a reklamácie for WooCommerce") describes what it does - online contract withdrawals (odstúpenie od zmluvy) and warranty claims (reklamácie) for WooCommerce.

== Screenshots ==

1. Front-end contract withdrawal form with the statutory "Confirm withdrawal from contract" button and the live deadline banner.
2. Front-end warranty claim form with product fields and secure photo upload.
3. My Account "Returns & claims" tab listing eligible orders with per-order withdrawal and warranty-claim countdowns.
4. Admin warranty-claims list (native WP_List_Table) with status filter views, coloured badges and bulk actions.
5. Admin contract-withdrawals list with the New / In progress / Completed status workflow.
6. "Consumer rights" meta box on the WooCommerce order edit screen (HPOS), with status control and Print / Download PDF actions.
7. Generated PDF warranty-claim protocol (claim number RK-YYYY-NNNN, seller details, statutory notice).
8. WooCommerce > Settings > Súlad e-shopu settings screen.
9. Dashboard widget: new, in-progress, near-deadline and all-time counts.

== Changelog ==

= 0.12.1 =
* Fixed: the bundled translations are loaded again, so the translations shipped with the plugin (including the Slovak strings added in 0.12.0) are available immediately after updating, without waiting for the translate.wordpress.org language packs to rebuild. The WordPress.org packs still take priority; the bundled files only fill the gaps.

= 0.12.0 =
* Changed: the German withdrawal texts (the short intro, the Widerrufsbelehrung and the Muster-Widerrufsformular) are now translatable. On a multilingual store (e.g. WPML/Polylang) the German source still shows in German, while other language versions can display a translation. The PDF claim protocol stays in the jurisdiction language.
* Added the bundled Slovak (sk_SK) translation of those German withdrawal texts (the official Slovak withdrawal instruction and model form) and completed the Slovak translation of the 0.11.0 settings strings (jurisdiction page-language selector, the "Rename pages" button and notices).
* Fixed: the Slovak withdrawal-form intro for the Slovak jurisdiction was missing its translation and could appear in English.

= 0.11.1 =
* Changed: the German withdrawal page default is now titled "Widerruf" (URL /widerruf) instead of "Widerrufsrecht" - the common customer-facing term for the page itself. Use the "Rename pages to match the selected country" button to apply it to an existing page; the old URL redirects automatically.

= 0.11.0 =
* New: the auto-created "Withdrawal" and "Warranty claim" pages now follow the selected jurisdiction. Switching the country renames their titles and URL slugs into that country's language (Slovak for Slovakia, German "Widerrufsrecht"/"Gewährleistung" for Germany); the old URLs redirect to the new ones automatically.
* New: a "EU page language" setting for the generic EU jurisdiction lets you pick the language of the page titles and URLs (English, German, French, Spanish, Italian, Dutch, Polish, Czech, Hungarian), or follow the site language.
* New: a "Rename pages to match the selected country" button in the settings re-applies the page language on demand (for pages created before this version). Pages you renamed yourself are never overwritten.
* No database or settings migration. Existing Slovak stores are unaffected: their pages already match and reconcile to a no-op.

= 0.10.1 =
* Completed the Slovak (sk_SK) translation of the strings introduced in 0.10.0 (the jurisdiction selector, the legal-text override section and the withdrawal-instruction heading).
* Refreshed the localized plugin-directory screenshots (English, Slovak, German). No functional changes.

= 0.10.0 =
* New: a "Legal jurisdiction" setting (Slovakia, Germany, or generic EU). The warranty-claim protocol notice, the withdrawal instruction, the seller-ID labels and the claim-handling deadline all follow this choice. Defaults to Slovakia, so existing stores are unaffected.
* New: the withdrawal form now shows the full statutory withdrawal instruction and a model withdrawal form for the selected jurisdiction (Slovak "Poučenie" + formulár, the EU Directive 2011/83 Annex I model, or the German Muster-Widerrufsbelehrung + Muster-Widerrufsformular).
* New: "Legal texts (override)" settings - paste your own legally warranted wording (e.g. from a legal-text service or your lawyer) to replace any statutory text; optional {seller}/{days}/{months} placeholders.
* New: complete German (de_DE) interface translation.
* Changed: the statutory 30-day claim-handling deadline (a Slovak/Czech rule) now applies only where the chosen jurisdiction imposes it; for Germany and the generic EU it is omitted from the protocol, reminders, dashboard and customer e-mail.
* Internal: statutory texts moved into per-jurisdiction "legal packs" so further countries can be added without touching the rendering code. No database or settings migration; Slovak output is unchanged.

= 0.9.2 =
* Fixed: the countdown badges on the My Account "Returns & claims" tab and the automatic footer link now load the plugin stylesheet everywhere they render (previously they appeared unstyled outside the two form pages).

= 0.9.1 =
* Form shortcodes are now prefixed: `[oodz_odstupenie_od_zmluvy]` and `[oodz_reklamacia]` (previously `[odstupenie_od_zmluvy]` / `[reklamacia]`).
* The warranty-claim PDF protocol loads its stylesheet as a local file instead of an inline style block.
* The My Account prefill links now carry a nonce, verified before any order data is read.
* Settings code cleanup (removed a redundant WooCommerce settings filter).

= 0.9.0 =
* Plugin name and slug finalised for the WordPress.org directory.
* Updated the bundled DOMPDF PDF library to 3.1.5.
* The printable warranty-claim protocol's browser view now loads its stylesheet and print script through the WordPress enqueue API instead of inline tags; the generated PDF is unchanged.
* The one-click setup prompt is limited to the Plugins, WooCommerce and plugin screens (no longer shown across the whole dashboard).
* Hardened the data layer: custom-table queries now pass the table name through the prepared %i identifier placeholder (WP 6.2+).

= 0.8.0 =
* New: attach documents (e.g. the withdrawal form and the warranty-claim form) from the Media Library to selected WooCommerce order e-mails, so the customer receives them on a durable medium with the order confirmation.
* Admin "Add warranty claim": the order field now searches existing orders (by number, name or e-mail) while still allowing a manually typed order number.
* Warranty-claims list: new "Handling deadline" column with a coloured countdown of the days left within the statutory 30-day handling period.
* Warranty period is now a setting (default 24 months, shortenable for used goods); the printed/PDF protocol notice was updated to the law in force since 1 July 2024 (Civil Code defect liability + Directive 2019/771; the old 12-month expert-assessment text was removed).
* Protocol heading simplified ("Confirmation of claim submission").
* Czech, German, Polish and Hungarian translations added — 5 UI locales total.

= 0.7.0 =
* Renamed to "Odstúpenie od zmluvy a reklamácie pre WooCommerce" to reflect both functions (slug unchanged).
* Withdrawal form: logged-in customers select their order from a dropdown (own orders only); live deadline banner (green / amber / red) with a days-remaining counter and a client-side expiry guard; clearer notice for guests.
* Warranty claim form: new brand / model / serial / date-of-purchase / invoice-number fields; order dropdown with ownership-checked prefill; HEIC/HEIF photo upload.
* My Account "Returns & claims": per-order countdown of the days left to withdraw and to file a warranty claim.
* Withdrawal statuses simplified to New / In progress / Completed (the "Rejected" state applies only to warranty claims).
* Admin: coloured status badges in both lists; search by invoice number and record ID; delete a warranty claim with safe photo cleanup; defect-photo thumbnails in the operator e-mail; photo count and "no photos" state; dashboard in-progress and all-time totals; enriched order link (status / date / total).
* Settings: optional seller name / address overrides, plus a correspondence address and phone on the protocol.
* Security: realpath-contained photo deletion (directory-traversal and symlink safe); date-partitioned photo storage (YYYY/MM); filterable hourly submission rate limit.
* Code quality: full WordPress Coding Standards (PHPCS) and PHPStan level 5 compliance.

= 0.6.0 =
* Admin lists rebuilt as native WP_List_Table: status filter views with counts, sortable + toggleable columns (Screen Options), bulk and per-row status changes, search and pagination.
* Count badges next to Withdrawals/Warranty claims in the WooCommerce menu (open records); they drop as items are resolved.
* Withdrawals now have a status workflow (New / In progress / Resolved / Rejected).
* Manual warranty claim creation: an "Add warranty claim" form and a button on the order screen (pre-filled from the order).
* Protocol now uses a clean claim number (RK-YYYY-NNNN) and shows product identification; no internal data.
* "Send to customer" moved to the native "Order: actions" dropdown.
* My Account: a "Returns & claims" tab listing eligible orders with withdraw/claim actions; public link shortcode [oodz_odkaz]; clearer link placement help in settings.
* 14-day refund deadline reminder for withdrawals (cron + dashboard).
* GDPR: personal-data export and erasure integration + optional data retention auto-delete.
* Configurable withdrawal-exceptions notice on the form.
* Silent anti-spam (honeypot + time-trap) on the public forms.

= 0.5.0 =
* Server-side PDF of the warranty claim protocol (bundled DOMPDF): "Download PDF" action and PDF attached to the customer "claim handled" e-mail; UTF-8/Slovak diacritics via DejaVu.
* Resolution panel on the order: explicit "Save resolution" button (saves with the order) plus "Print", "Download PDF" and "Send to customer".
* Resolution changes are now logged to the order timeline as a private note (with no duplicate note on subsequent order updates).
* Date display unified to DD. MM. YYYY on the order panel and protocol.
* Front-end forms: extra bottom spacing; accent colour pulled from the (block) theme with a safe fallback.

= 0.4.0 =
* Warranty claim resolution workflow: record the outcome (status), method of handling (repair / replacement / refund / price reduction / rejection), a customer-facing reasoning and an internal note - on the order panel (saved with the order) or the plugin detail page.
* Printable A4 protocol (browser print): Part 1 confirmation of submission + Part 2 proof of handling, with seller details and statutory notice.
* New "Warranty claim handled" customer e-mail sent on resolution (native WC_Email; proof of handling).
* Seller details settings (company, IČO, DIČ, IČ DPH, address, contact) for the protocol.
* WordPress dashboard widget: new claims, claims near the deadline, and monthly counts.

= 0.3.0 =
* Native WooCommerce integration: order numbers in the plugin lists link to the order; a private order note + reverse-link meta are written on submission.
* "Consumer rights" panel (meta box) on the order edit screen shows the linked withdrawal / warranty claim, with warranty-claim status control - HPOS and legacy.
* "Consumer rights" badge column in the native Orders list (Withdrawn / Claim).
* Transactional e-mails migrated to native WC_Email classes (WooCommerce > Settings > Emails): customer + operator for both withdrawals and warranty claims, with template overrides and plain-text. The withdrawal customer confirmation is always sent (legal proof).
* One-off back-link migration so the panel and badge also work for pre-existing records.

= 0.2.0 =
* Settings moved into a native WooCommerce settings tab (WooCommerce > Settings > Súlad e-shopu); record lists moved under the WooCommerce menu.
* Warranty claims completed: secure photo upload (real MIME check), database storage, customer confirmation and operator notice e-mails, admin list and detail with status management, daily deadline reminder cron.
* My Account integration: "Withdraw from contract" action in the Orders list and order detail (within the withdrawal period), with form pre-fill.
* One-click onboarding: front-end pages are created automatically on first activation.
* Slovak translation (sk_SK) added; codebase and source strings converted to English.

= 0.1.0 =
* First version (scaffold): contract withdrawal module, complaint skeleton, setup wizard, admin, HPOS.

== Upgrade Notice ==

= 0.12.1 =
Loads the bundled translations again, so the Slovak (and other) strings shipped with the plugin appear right after updating, without waiting for the translate.wordpress.org packs. No data migration.

= 0.12.0 =
The German withdrawal texts are now translatable, so multilingual stores (e.g. WPML) can show them in the customer's language; the German source is unchanged. Adds the Slovak translation of those texts and of the 0.11.0 settings strings. No data migration.

= 0.11.1 =
Renames the German withdrawal page default to "Widerruf" (clearer wording). Click "Rename pages to match the selected country" to apply it to an existing page; the old URL redirects. No data migration.

= 0.11.0 =
The auto-created withdrawal and warranty-claim pages now follow the selected country: switching the jurisdiction renames their titles and URLs into that language (old URLs redirect). Existing Slovak stores are unaffected. No data or settings migration.

= 0.10.1 =
Maintenance: completes the Slovak translation of the 0.10.0 strings and refreshes the directory screenshots. No functional changes.

= 0.10.0 =
Adds selectable legal jurisdictions (Slovakia / Germany / EU), a full statutory withdrawal instruction and model form on the withdrawal page, and per-text overrides. The new jurisdiction setting defaults to Slovakia, so existing Slovak stores keep the same texts and behaviour; no data or settings migration.

= 0.9.2 =
Styling fix for the My Account countdown badges and the automatic footer link. No data migration; settings and records unchanged.

= 0.9.1 =
The withdrawal/claim form shortcodes are now prefixed ([oodz_odstupenie_od_zmluvy], [oodz_reklamacia]). If you placed the old shortcodes on custom pages, update them; the auto-created pages are handled for you.

= 0.9.0 =
Updated the bundled PDF library (DOMPDF 3.1.5), enqueue-based assets for the printable protocol, and a more focused setup prompt. No data migration; settings and records unchanged.

= 0.8.0 =
Adds order-email document attachments, an order search picker for admin-created claims, a 30-day handling-deadline countdown, a configurable warranty period, four new languages (CS/DE/PL/HU) and a post-2024 protocol notice. No data migration; slug, settings and records unchanged.

= 0.7.0 =
Display name now covers withdrawals and warranty claims; new My Account countdowns and a withdrawal deadline banner; cleaner withdrawal statuses; safer photo handling. No data migration - the slug, settings and existing records are unchanged.
