=== Kitgenix PDF Invoicing for WooCommerce ===
Contributors: kitgenix
Donate link: https://www.paypal.com/donate/?hosted_button_id=KALF36K6JJ9B2
Tags: woocommerce, pdf invoices, invoice generator, packing slips, credit notes
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 2.0.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Generate WooCommerce PDF invoices, receipts, packing slips, credit notes and other documents with local PDF rendering.

== Description ==

**Kitgenix PDF Invoicing for WooCommerce** generates PDF order documents locally from WooCommerce data. It supports invoices, receipts, packing slips, credit notes, pro forma invoices, delivery notes and statements, with configurable numbering, templates, email attachments and customer downloads.

PDF rendering happens on the WordPress server using the bundled Dompdf library. The plugin does not require a hosted Kitgenix invoicing account and does not send order contents to an external invoicing service in order to produce the PDF.

It is designed for store owners, finance teams, fulfilment staff and support teams that need repeatable WooCommerce paperwork and a controlled record of document numbers/history.

Developed by [Kitgenix](https://kitgenix.com/).

= WooCommerce PDF Document Types =

The codebase defines seven document types:

* Invoice.
* Receipt.
* Packing Slip.
* Credit Note.
* Pro Forma Invoice.
* Delivery Note.
* Statement.

Each type can use its own generation rules and can be enabled/disabled according to the plugin's settings. Rules can consider WooCommerce order status and payment state so a document is only offered/generated when it makes sense for the store's workflow.

= PDF Invoice Features =

* Local PDF generation with bundled Dompdf.
* Seven document types.
* Four bundled visual templates: Standard, Simple, Modern and Business.
* Company logo, address and tax/VAT registration details.
* Configurable document colours and presentation settings.
* Custom CSS controls used by the PDF renderer.
* Optional uploaded custom fonts supported by the font manager.
* Token-based document-number formats.
* Zero-padding, prefixes and sequence controls.
* Sequence reset options including calendar/fiscal-year scenarios supported by settings.
* Separate credit-note identity/history handling.
* Atomic database-backed sequence table for collision-resistant numbering.
* Automatic WooCommerce email attachments.
* Test email workflow for configured attachment mapping.
* Customer downloads from My Account.
* Guest document access using a valid WooCommerce order key where the relevant route/action permits it.
* Admin order meta box/actions for generating and retrieving documents.
* Bulk generation/download archive workflows.
* Order-list filtering for document state.
* Persistent document archive/history where enabled.
* Regenerate and void controls with history records.
* Tax terminology/localisation packs.
* Custom order fields and notes in document output where configured.
* WooCommerce HPOS compatibility handling.
* Developer filters/actions for output, identifiers, custom CSS and related document behaviour.

= Four Bundled Invoice Templates =

Standard, Simple, Modern and Business templates are included in the plugin. They share the configured business identity but use different layout/presentation choices.

The template files are local to the plugin; PDF output is not generated by loading a hosted HTML template from Kitgenix.

= Document Numbering and Sequences =

Document identity is more than a filename. The plugin includes a sequence table and token-based formatting so invoices/other documents can receive consistent identifiers with prefixes and zero-padding.

Sequence periods can be configured so numbering can continue indefinitely or reset according to the supported calendar/fiscal-year rules. The sequence table is used to avoid two concurrent generation requests selecting the same next number.

Credit notes have their own mapping/history logic so refund-related documents can be tracked separately from the main invoice sequence where configured.

= Generation Rules =

A document type can be gated by order status/payment conditions. This lets stores avoid, for example, exposing a final invoice at a point in the order lifecycle where their accounting workflow expects a pro forma document instead.

The same availability checks are used by customer/admin output paths so a document button is not simply cosmetic if the order does not meet its configured rule.

= Automatic Email Attachments =

Administrators can map document types to WooCommerce email IDs. When a mapped email is generated and the document is available for the order, the plugin can create/use the relevant PDF and attach it to the outgoing message.

A test-send workflow is included so administrators can verify email attachment configuration without placing a real new order for every test.

Temporary files generated for email delivery are cleaned up after use.

= Customer Downloads =

Customer-facing actions can add document downloads to WooCommerce My Account/order areas. The plugin includes invoice and credit-note download handling and validates the order/customer context before serving protected order documents.

Guest access can use WooCommerce's order key in the supported flow, allowing legitimate guest purchasers to retrieve an eligible document without being treated as an arbitrary anonymous request.

= Persistent PDF Archive and History =

When persistent archive mode is enabled, generated documents can be stored under a hardened uploads subdirectory with metadata tracking the archived entries. Administrators can regenerate or void documents, with history events recorded against the order/document.

This provides a clearer audit trail than silently replacing a previous PDF without recording that an administrator regenerated it.

The exact accounting/legal retention period remains the site owner's responsibility; the plugin does not claim to determine jurisdiction-specific compliance requirements automatically.

= Bulk Document Export =

WooCommerce order bulk actions can generate a batch archive for selected orders/documents. The plugin creates a downloadable archive file for the requested set instead of requiring an administrator to open every order and download each PDF individually.

= Tax and Localisation =

The document display layer includes configurable tax terminology and localisation packs so labels can be adapted for VAT, GST, Sales Tax or other terminology supported by the plugin's configuration.

Order totals and line items are taken from WooCommerce's order data, helping PDFs reflect the taxes/totals WooCommerce has already calculated rather than introducing an independent tax-calculation engine.

= Branding, Custom Fonts and CSS =

Business identity settings include company details, logo and visual choices. The plugin also contains a custom-font manager that accepts supported font files and registers them with Dompdf for local rendering.

Custom document CSS can be filtered/sanitised through the plugin's rendering pipeline. Administrators should keep custom CSS print-focused and test all enabled templates after significant visual changes.

= Security and Data Handling =

PDF generation uses local WooCommerce order data. Download/admin actions are protected by the applicable WooCommerce/WordPress capability, order-key and nonce checks in their context.

Persistent archive directories are hardened by the plugin, and temporary generated files are removed after use where the workflow does not require long-term storage.

The plugin does not transmit order contents to Kitgenix to generate PDFs. External requests used by the shared admin Hub/fonts are documented separately under **External Services**.

= Developer Extensibility =

The codebase exposes filters/actions for document output and generation decisions, custom CSS, custom order fields and other integration points. Document types and renderer modules are separated into classes so integrations can modify supported output without editing bundled template files directly.

The developer section below lists the hooks currently documented by the plugin.

= Typical Uses =

* Automatic PDF invoices attached to WooCommerce emails.
* Packing slips for warehouse picking/packing.
* Delivery notes included with shipments.
* Credit notes for refunded orders.
* Pro forma invoices before final invoicing.
* Customer self-service invoice downloads from My Account.
* Branded receipts for completed orders.
* Batch export of documents for finance or fulfilment teams.

== Installation ==

1. Install via Plugins → Add New (search for "Kitgenix PDF Invoicing"), or upload the plugin ZIP file.
2. Activate the plugin. WooCommerce must already be installed and active – the plugin will deactivate itself with a notice if it isn't.
3. Go to WooCommerce → Orders and open any order to see the "Kitgenix PDF Invoicing" meta box with document download actions.
4. Go to the Kitgenix PDF Invoicing settings page to configure your company details, logo, numbering, template style, and email attachment mapping.
5. Optional: enable customer-facing downloads and My Account order actions in settings.

PDFs are rendered with the bundled Dompdf library; no external service or API key is required. Batch ZIP export uses the PHP `zip` extension when available, with an automatic fallback to WordPress's built-in ZIP support if it isn't.

== External Services ==

This plugin includes a shared "Kitgenix hub" component in wp-admin (a single top-level "Kitgenix" menu page shared across all installed Kitgenix plugins) which may fetch publicly available plugin metadata – active install counts, star ratings, and icon/banner artwork – from WordPress.org using WordPress core's `plugins_api()` function. This request is only made when an administrator views the Kitgenix hub page, sends only the relevant plugin slugs, and is cached for up to 24 hours using WordPress transients to minimise repeat calls:

* Transient: `kitgenix_hub_wporg_active_installs_v1`
* Transient: `kitgenix_hub_wporg_ratings_v1`
* Transient: `kitgenix_hub_wporg_media_v1`

No order data, customer data, or store content is ever sent as part of these requests. WordPress.org's API is governed by the WordPress.org privacy policy (https://wordpress.org/about/privacy/).

Aside from this, PDF generation happens entirely on your own server using the bundled Dompdf library. No order or customer data is sent to any third-party PDF generation, invoicing, or storage service.

== Developers ==

Text domain:
kitgenix-pdf-invoicing-for-woocommerce

Architecture:
- Modular plugin with Admin/Settings/Invoicing/Email/Frontend modules
- Document types registry (extendable) with built-in invoice, receipt, packing slip, credit note, pro forma invoice, delivery note, and statement types
- Template system with theme overrides + HTML/CSS filters
- Secure download endpoints with nonce/capability checks and optional order key validation
- Token-based numbering engine using an atomic database sequence table (with a non-atomic option-based fallback)
- Rule-based document availability controls by type, order status, and payment state
- Document status (issued/voided) and per-document history log, independent of the archived PDF file

Numbering tokens available in settings:
- {prefix}
- {order_number}
- {order_id}
- {sequence}
- {refund_sequence}
- {year}
- {yy}
- {month}
- {day}
- {country}
- {billing_country}
- {shipping_country}
- {fiscal_year}
- {fiscal_year_short}
- {fiscal_year_start}
- {fiscal_year_end}

Key filters:
- kitgenix_pdf_invoicing_modules
- kitgenix_pdf_document_types
- kitgenix_pdf_document_enabled
- kitgenix_pdf_document_user_can_download
- kitgenix_pdf_document_filename
- kitgenix_pdf_batch_archive_filename
- kitgenix_pdf_persistent_archive_enabled
- kitgenix_pdf_archive_relative_root
- kitgenix_pdf_invoice_filename (back-compat)
- kitgenix_pdf_document_attachment (inline vs download)
- kitgenix_pdf_document_template_path
- kitgenix_pdf_document_html
- kitgenix_pdf_invoice_html (back-compat)
- kitgenix_pdf_document_custom_css
- kitgenix_pdf_document_lang
- kitgenix_pdf_document_title
- kitgenix_pdf_document_body_class
- kitgenix_pdf_show_shipping_address
- kitgenix_pdf_email_document_map
- kitgenix_pdf_email_attach_document
- kitgenix_pdf_document_identifier
- kitgenix_pdf_document_number_context
- kitgenix_pdf_document_number_format
- kitgenix_pdf_sequence_use_table
- kitgenix_dompdf_enable_php (advanced; default false)

Key actions:
- kitgenix_before_stream_pdf_document
- kitgenix_after_stream_pdf_document
- kitgenix_before_stream_pdf_invoice (back-compat)
- kitgenix_after_stream_pdf_invoice (back-compat)
- kitgenix_pdf_document_archived
- kitgenix_pdf_document_regenerated
- kitgenix_pdf_document_void_status_changed
- Template hooks:
  - kitgenix_pdf_before_document / kitgenix_pdf_after_document
  - kitgenix_pdf_before_document_wrapper / kitgenix_pdf_after_document_wrapper
  - kitgenix_pdf_after_notes
  - kitgenix_pdf_after_order_data_rows

This plugin does not register any shortcodes, REST API routes, custom post types, or custom taxonomies. Integration is entirely via the WordPress action/filter hooks listed above, WooCommerce order meta boxes and order actions, and the My Account area.

== Data Handling ==

- Plugin settings stored in a single option: `kitgenix_pdf_invoicing_settings`.
- Admin activity/event log (settings saves, generation failures, skipped documents, failed attachments) stored in: `kitgenix_pdf_invoicing_event_log`.
- Anonymous generation metrics stored in: `kitgenix_pdf_invoicing_for_woocommerce_metrics`.
- Legacy (non-atomic fallback) numbering counters stored in: `kitgenix_pdf_invoicing_for_woocommerce_number_sequences`.
- Atomic numbering counters stored in a dedicated database table (`{$wpdb->prefix}kitgenix_pdf_sequences`).
- Upgrade/migration version marker stored in: `kitgenix_pdf_invoicing_for_woocommerce_db_version`.
- Custom uploaded font metadata stored in: `kitgenix_pdf_invoicing_for_woocommerce_custom_fonts`.
- Document identifiers/history stored on the order to keep documents stable:
  - `_kitgenix_pdf_invoicing_for_woocommerce_invoice_number`
  - `_kitgenix_pdf_invoicing_for_woocommerce_invoice_date`
  - `_kitgenix_pdf_invoicing_for_woocommerce_packing_slip_number`
  - `_kitgenix_pdf_invoicing_for_woocommerce_packing_slip_date`
  - `_kitgenix_pdf_invoicing_for_woocommerce_receipt_number`
  - `_kitgenix_pdf_invoicing_for_woocommerce_receipt_date`
  - `_kitgenix_pdf_invoicing_for_woocommerce_credit_note_count`
  - `_kitgenix_pdf_invoicing_for_woocommerce_credit_note_history`
  - `_kitgenix_pdf_invoicing_for_woocommerce_credit_note_refund_map`
  - `_kitgenix_pdf_invoicing_for_woocommerce_archived_documents`
- Archived PDFs stored in uploads and reused as immutable document copies when available.
- Uploaded custom font files stored under the plugin's hardened uploads sub-directory.
- Batch ZIP exports generated on demand (temporary files, deleted after download).
- Email attachments generated as temporary files and cleaned up automatically.
- No customer data is sent to a third-party PDF generation service; rendering happens locally using the bundled Dompdf library.

== Security & Privacy ==

- All admin actions protected with nonces and capability checks.
- Inputs sanitised; outputs escaped appropriately.
- Dompdf PHP execution disabled by default. Enable only if you understand the risk:
  add_filter( 'kitgenix_dompdf_enable_php', '__return_true' );

Security identifiers (exact):
- Admin meta box downloads use `admin-post.php` actions `kitgenix_admin_stream_invoice`, `kitgenix_admin_stream_receipt`, `kitgenix_admin_stream_packing_slip`, `kitgenix_admin_stream_credit_note`, `kitgenix_admin_stream_pro_forma_invoice`, `kitgenix_admin_stream_delivery_note`, and `kitgenix_admin_stream_statement`, protected by query arg `nonce` created/verified with nonce action `kitgenix_admin_pdf`.
- WordPress action hooks for those admin-post actions: `admin_post_kitgenix_admin_stream_invoice`, `admin_post_kitgenix_admin_stream_receipt`, `admin_post_kitgenix_admin_stream_packing_slip`, `admin_post_kitgenix_admin_stream_credit_note`, `admin_post_kitgenix_admin_stream_pro_forma_invoice`, `admin_post_kitgenix_admin_stream_delivery_note`, and `admin_post_kitgenix_admin_stream_statement`.
- Document status actions (regenerate/void) use `admin_post_kitgenix_admin_regenerate_document` and `admin_post_kitgenix_admin_void_document`, gated on `manage_woocommerce` and a type-and-order-scoped nonce.
- Frontend document downloads use the optional `_wpnonce` value created/verified with nonce action `kitgenix_download_{doc_type}_{order_id}`.
- WooCommerce order action key: `kitgenix_download_pdf_invoice` (hook: `woocommerce_order_action_kitgenix_download_pdf_invoice`).
- WooCommerce bulk action keys: `kitgenix_pdf_batch_export_invoice`, `kitgenix_pdf_batch_export_packing_slip`, `kitgenix_pdf_batch_export_receipt`, `kitgenix_pdf_batch_export_credit_note`, `kitgenix_pdf_batch_export_pro_forma_invoice`, `kitgenix_pdf_batch_export_delivery_note`, and `kitgenix_pdf_batch_export_statement`.

Admin page hook suffix:
- `kitgenix_page_kitgenix-pdf-invoicing-settings`

PDF generation is performed locally on your server using Dompdf. This plugin does not send customer data to a third-party PDF generation API.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =
Yes. WooCommerce must be installed and active. Every document type, download, and email attachment is generated from WooCommerce order data.

= Are PDF invoices generated automatically? =
Documents are generated on demand – when downloaded, or when a WooCommerce email is sent with that document type mapped to it. There is no scheduled/cron-based bulk generation; each document is rendered the first time it is needed and then archived for reuse.

= Can customers download their own invoices? =
Yes, if enabled in settings. Customers can download invoices and (once refunds exist) credit notes from the order details screen and the My Account Orders table. Guests can also be authorised with a valid WooCommerce order key.

= Can I bulk-generate or bulk-download invoices? =
Yes. From the WooCommerce orders list, select a set of orders and run a batch ZIP export for invoices, packing slips, receipts, credit notes, pro forma invoices, delivery notes, or statements.

= Where are the generated PDFs stored? =
Once a document is issued, an immutable copy is archived in the uploads directory and reused for later downloads instead of re-rendering a different version. Temporary files used for email attachments and batch ZIP exports are deleted automatically after use. No customer data is sent to a third-party PDF generation service.

= Can I customise the invoice template? =
Yes. Choose from four bundled template packs (Standard, Simple, Modern, Business), fine-tune the layout with the built-in visual designer (header alignment, logo scale, density, panels, table style, totals emphasis, footer alignment), or copy templates into your theme at `kitgenix-pdf-invoicing-for-woocommerce/{style}/` for full control.

= Can I add my company logo, address, and tax/VAT number? =
Yes. Company name, address, email, phone, logo, and tax/VAT ID are all configurable and appear on every generated document.

= Can I show custom order fields, such as tracking numbers? =
Yes. Add custom order meta rows in settings using one entry per line in the format `meta_key|Label`.

= Does it support VAT, GST, or Sales Tax terminology? =
Yes. A localisation pack switches document titles and tax wording (for example, "Tax Invoice" for Australia GST), with manual overrides available for the tax label and tax registration label. You can also switch between tax-inclusive and tax-exclusive price display.

= Is this compatible with WooCommerce HPOS (High-Performance Order Storage)? =
Yes. The plugin declares HPOS compatibility and its order integrations, meta box, and admin order-list filter work with both HPOS and legacy post-based order storage.

= How does credit note numbering work? =
Credit notes become available once an order has at least one refund, and are numbered against the refund itself (not its position in a list), so deleting or reordering refunds can't desynchronise or duplicate numbers.

= Can documents be regenerated or voided? =
Yes. Staff can regenerate an issued document from the order's current data (the previous file is kept, not overwritten) or void/unvoid a document without touching its archived file. Both actions are logged in a per-document history on the order screen. This provides an audit trail but does not by itself guarantee compliance with local invoicing or record-keeping requirements.

= Can I attach PDFs to WooCommerce emails? =
Yes. Map document types to WooCommerce email workflows in settings, preview which documents are mapped for a specific order, and send a test email with only the PDF attachments before relying on the live workflow.

= Does the plugin support custom document types? =
Developers can extend the document type registry via the `kitgenix_pdf_document_types` filter to add custom document types alongside the built-in ones.

= Does this plugin add any shortcodes or REST API endpoints? =
No. The plugin does not register any shortcodes, REST API routes, custom post types, or custom taxonomies. All functionality lives in the WooCommerce order screen, plugin settings, and My Account area, and is extendable via the actions and filters listed in the Developers section.

= What happens to my invoices if I uninstall the plugin? =
Archived PDF files, document history, and order meta are intentionally preserved on uninstall so you don't lose invoice, receipt, packing slip, or credit note records. Only the plugin's own settings and tracking options are removed.

== Screenshots ==

1. Settings: Company & Document Details tab, including company name, address, tax/VAT ID, and invoice prefix.
2. WooCommerce order screen: the Kitgenix PDF Invoicing meta box showing the invoice number with Preview and Download PDF actions.
3. A generated PDF invoice streamed directly in the browser.
4. WooCommerce order screen on a refunded order: invoice and credit note actions shown together in the meta box.
5. My Account → Orders: customers can use "View Invoice" to download their own order invoice.

== Uninstall ==

Uninstall removes the plugin settings option (`kitgenix_pdf_invoicing_settings`), the admin event log option (`kitgenix_pdf_invoicing_event_log`), the metrics option (`kitgenix_pdf_invoicing_for_woocommerce_metrics`), the numbering sequence option (`kitgenix_pdf_invoicing_for_woocommerce_number_sequences`), the atomic numbering sequences database table, the custom fonts metadata option, and the upgrade/migration version marker (`kitgenix_pdf_invoicing_for_woocommerce_db_version`) when uninstalled via WordPress.
It also deletes the activation redirect transient: `kitgenix_pdf_invoicing_for_woocommerce_do_activation_redirect`.
Order meta, archived document metadata, archived PDF files, document history, and uploaded custom font files are intentionally preserved to avoid accidental loss of invoice, receipt, packing slip, or credit note history. Site owners who want the uploaded font files removed too can delete the relevant uploads sub-folder manually.

== Support Development ==

If this plugin helps you generate clean WooCommerce PDFs and reduces admin work, you can support ongoing development with a one-off donation via PayPal:
https://www.paypal.com/donate/?hosted_button_id=KALF36K6JJ9B2

== Third-Party Libraries ==

This plugin bundles Dompdf (LGPL-2.1) and its dependencies (php-font-lib, php-svg-lib, html5-php, php-css-parser, thecodingmachine/safe) via Composer. Their license files are included under `vendor/` in the distributed plugin package. See https://github.com/dompdf/dompdf for the upstream project.

== Credits ==
Built with ❤︎ by @kitgenix - https://kitgenix.com
Bundled library: Dompdf (see vendor/ for licenses)

== Upgrade Notice ==

= 2.0.0 =
Recommended for all websites. Adds document status/regenerate/void controls with a per-document history log, an atomic invoice-numbering table that closes a race condition under concurrent load, a redesigned admin UI, and several security hardening and bug-fix improvements. Existing counters and credit note history are migrated automatically.

== Changelog ==

= 2.0.0 (31 August 2026) =

* New: Documents now carry an explicit status – Not generated, Issued, or Voided – visible per document type on the order screen, without ever silently replacing a historic file.
* New: Added a "Regenerate" action that lets staff deliberately re-render an already-issued PDF using the order's current data. The previously issued file is renamed and retained rather than deleted or overwritten, and the action is logged with the acting user, timestamp, and an optional reason. This does not itself guarantee compliance with jurisdiction-specific invoicing or record-keeping laws.
* New: Added "Void" and "Unvoid" actions that change a document's status without modifying or deleting its archived PDF file, creating a metadata-only audit entry.
* New: Added a per-document history log showing issued, regenerated, voided, and unvoided events, including date, acting user, and document number, directly on the WooCommerce order screen.
* New: Added a System Status tab under Settings reporting PHP, WordPress, WooCommerce, and Dompdf versions, HPOS status, uploads/archive writability, active template, PHP memory limit, and execution limits without exposing customer data or secrets.
* New: Added settings import/export under Settings → System Status using JSON files. Imports are validated field-by-field against a strict whitelist, and exported files exclude the logo media attachment ID because WordPress attachment IDs are not portable between sites.
* New: Added optional custom font uploads under Settings → Brand & Styling. Only local `.ttf`, `.otf`, and `.woff` files are accepted, validated by both extension and binary file signature, with files stored inside the plugin's existing hardened uploads directory. Remote font URLs are not accepted.
* New: Added a "Has PDF documents" filter to the WooCommerce Orders screen for both legacy and HPOS/custom-order-table views, allowing administrators to quickly find orders with or without invoices or credit notes.
* New: Redesigned the entire admin experience around the shared Kitgenix design system, with a sticky topbar, brand navigation, and a quick link to the Kitgenix Hub from every screen.
* New: Added in-page settings search with "/" and Cmd/Ctrl+K shortcuts so administrators can quickly find a field or section without manually navigating through tabs.
* New: Added a light/dark theme toggle for the admin screens, with the selected preference remembered between visits and a sensible default based on the browser's preferred colour scheme.
* New: Added a responsive mobile navigation menu for Kitgenix admin screens on narrower displays.
* Improved: Settings sections now render as clearly separated cards with icons, while checkboxes have been replaced with toggle switches throughout Settings, the email attachment matrix, and document generation rules for clearer on/off states.
* Improved: Redesigned tables, notices, badges, and button groups across the Settings, Email Preview & Test Send, and Support screens for a more consistent Kitgenix admin experience.
* Improved: The Kitgenix Hub page now shares the same topbar and brand header as the plugin's settings screens and includes Image Optimizer alongside the other Kitgenix plugins that can be installed, activated, and managed from one place.
* Improved: The WooCommerce order screen meta box now displays invoice and credit note numbers as compact badges instead of plain text.
* Improved: The Log tab now displays entries in a searchable, paginated table containing time, context, outcome, and a plain-English note instead of a plain text block.
* Improved: Invoices or credit notes that fail to attach to an order email are now recorded in the Log tab, ensuring emails sent without their expected PDF attachment are visible to administrators.
* Improved: Batch invoice generation now distinguishes orders skipped because they are not eligible for a document from orders that genuinely failed to generate, with the reason recorded in the Log tab.
* Improved: Added a reference table to the Log tab explaining what each recorded category means and whether administrator action is required.
* Improved: The Support tab is now three focused cards – a donate card with a collapsible monthly-amount picker, a "what your support funds" summary, and a "get involved" panel for reviews and plugin links – replacing the previous stack of donate, trust, and community cards.
* Improved: Moved the Log tab directly before Support in the admin navigation for a more logical workflow.
* Security: Document numbers are now assigned through a dedicated database table using an atomic increment, closing a race condition where two simultaneous requests could previously receive the same supposedly unique invoice, receipt, or credit-note number under load. Existing counters are migrated automatically and idempotently, with no numbers reset or reused.
* Security: Archived PDF storage directories are now hardened with `index.php` and `.htaccess` guards when created, adding defence in depth alongside the existing nonce, order-key, and capability checks that protect every document download.
* Security: Order-scoped actions – including admin order actions, order meta box downloads, and admin-post document streaming – now also verify WooCommerce's object-aware `edit_shop_order` capability for the specific order in addition to the existing general capability checks.
* Security: Custom font uploads are restricted to validated local font files and checked using both their extension and binary file signature before being stored inside the plugin's hardened uploads directory.
* Fix: Credit note numbering is now keyed to the stable WooCommerce refund ID instead of the refund list's array position, preventing deleted or reordered refunds from desynchronising, skipping, or duplicating credit note numbers. Existing credit note history is migrated automatically.
* Fix: PDF generation errors, including memory exhaustion or execution time limits on very large orders, are now caught and logged instead of risking an uncaught fatal error while generating an invoice or credit note.
* Fix: Corrected the MultiStore plugin listing in the Kitgenix Hub, including its name, slug, and plugin file path, so install, activate, and open actions now target the correct plugin.
* Fix: Empty document download button rows are no longer rendered in the WooCommerce order meta box when no PDF downloads are available for the order.
* Fix: Admin notices rendered on the plugin settings page can now be dismissed using a close button.
* Fix: The "Preview email attachments" and "Send test email with PDFs" buttons now have appropriate spacing from the field above them.
* Fix: Number inputs, including the email preview Order ID field, are no longer cramped to a fixed 50px width.
* Dev: Refreshed dependencies using `composer install` and `composer audit`, including Dompdf 3.1.6, with no known security advisories detected. Dompdf and its dependencies' bundled licence files remain included for redistribution.
* Dev: Added a shared `kitgenix-admin-components.js` controller providing toast and inline save confirmations, collapsible cards, copy-to-clipboard controls, and live table search for consistent behaviour across Kitgenix plugins.
* Dev: Migrated hardcoded Kitgenix brand colours in the WooCommerce order meta box and admin stylesheets to shared CSS custom properties for consistent theming across plugins.
* Dev: Refreshed and reorganised the Kitgenix logo and icon asset set used throughout the admin UI and Kitgenix Hub.
