=== PDF Gift Cards for WooCommerce ===
Contributors: fabiendst, kafestudio
Tags: woocommerce, gift card, pdf, voucher, gift voucher, personalized, coupon
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically generate personalized PDF gift cards for WooCommerce orders with a Drag & Drop template editor. No design skills needed.

== Description ==

**PDF Gift Card** lets you create beautiful, fully personalized PDF gift cards for your WooCommerce store.

It lets store owners upload their own PDF design and dynamically populate it with real order data — no coding required.

= How it works =

1. **Upload** your PDF design (created in Canva, Illustrator, Affinity Designer, etc.)
2. **Drag & drop** dynamic fields onto your template
3. **Associate** the template with any WooCommerce product
4. When an order is placed, the **PDF is automatically generated** and attached to the confirmation email

= Available dynamic fields =

* Product name
* Customer name
* Recipient name
* Personalized message
* Purchase date
* Expiry date
* Order number
* Unique voucher code
* Price
* Product image *(Pro)*
* Site logo *(Pro)*
* QR Code *(Pro)*

= What's included in the Free plan =

* 1 template
* All text fields
* PDF preview with real product data
* Product associations
* Multilingual admin: English, French, German, Spanish, Dutch

= Upgrade to Pro =

* **Unlimited templates**
* Image fields (logo, product photo, QR code)
* Plugin language selector
* Priority email support
* Automatic updates

= Multilingual support =

The plugin interface is fully translated into:
French, English, German (Deutsch), Spanish (Espanol), Dutch (Nederlands)

= Security & GDPR =

* Generated PDFs stored in a protected, non-public directory
* Configurable auto-deletion of PDFs after N days
* No personal data stored beyond what WooCommerce already holds

= Requirements =

* WordPress 6.0+
* WooCommerce 8.0+
* PHP 8.0+

== Installation ==

1. Upload the `pdf-gift-card` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** screen
3. Go to **PDF Gift Cards** in your WordPress admin menu
4. Create your first template, upload your PDF design, and drag & drop your fields
5. Associate the template with a WooCommerce product
6. Done!

== Frequently Asked Questions ==

= Does this work with any PDF file? =

Yes. Any PDF created in Canva, Adobe Illustrator, Affinity Designer or any other tool works as a base template.

= Can the customer fill in the recipient's name themselves? =

Yes. The plugin adds a "Recipient name" and "Personalized message" field on the product page, which the customer fills in before adding to cart. These values are then injected into the PDF.

= Is the generated PDF attached to the WooCommerce order email? =

Yes. The PDF is automatically attached to the customer's order confirmation email. You can also enable a separate dedicated email.

= Is this GDPR compliant? =

Yes. PDFs are stored in a protected, non-publicly-accessible directory. You can configure automatic deletion after a number of days (default: 365).

= Does it work with variable products? =

Yes, both simple and variable WooCommerce products are supported.

= Is it compatible with WooCommerce HPOS? =

Yes, the plugin fully supports WooCommerce High Performance Order Storage (HPOS / custom order tables).

= What's the difference between Free and Pro? =

The Free plan allows 1 template with text fields. The Pro plan unlocks unlimited templates, image fields (logo, product photo, QR code), and priority support.

== Screenshots ==

1. Template list — overview of your gift card templates
2. Drag & Drop editor — place fields anywhere on your PDF
3. Field properties panel — font, size, color, alignment
4. Product associations — link templates to WooCommerce products
5. PDF preview — test with real product data before going live
6. Customer-facing gift card — what your buyer receives

== Changelog ==

= 1.1.1 — 2026-06-04 =
* Fix: Templates and data are never deleted on plugin uninstall
* Fix: DB migration (maybe_upgrade) now correctly runs on plugin update
* Fix: Editor upload button was non-functional due to a script timing issue
* Fix: PDF preview not rendering (PDF.js IIFE wrapper — import.meta syntax)
* Fix: Special characters and emoji icons corrupted in editor field list

= 1.1.0 — 2026-06-03 =
* Security: PDF filenames now use a random 24-character token (no longer guessable)
* Security: Temporary QR code files are now properly deleted after PDF generation
* Improvement: Error notification email subject now uses the site name dynamically
* Improvement: Upgraded PDF.js from 3.11.174 to 5.7.284 (bundled locally)
* Improvement: Replaced deprecated PHP filesystem functions with WP_Filesystem equivalents
* Fix: PHP syntax errors caused by escaped variables in admin class
* Fix: Removed load_plugin_textdomain() — auto-loaded since WordPress 4.6
* Compatibility: Tested up to WordPress 7.0 and WooCommerce 9.6

= 1.0.0 — 2026-05-14 =
* Initial release

== Upgrade Notice ==

= 1.1.1 =
Important bugfix release. Prevents accidental data loss on update/uninstall. Recommended for all users.

= 1.1.0 =
Security and compatibility update. Recommended for all users.

= 1.0.0 =
Initial release. Install and start creating your first gift card template!
