=== Axagen Bulk Invoice Generator ===
Contributors: axagen
Tags: woocommerce, invoice, bulk, pdf, orders
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 0.4.5
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Bulk PDF invoices for WooCommerce — filter by date, status, or order number and download a ZIP. Supports Latin, Extended Latin and Cyrillic.

== Description ==

Bulk Invoice Generator lets you export WooCommerce orders as PDF invoices in bulk. Filter by date range, order status, starting order number, or limit the count — then download everything as a single ZIP file with one click.

**Features:**

* Filter orders by date range, status, starting order number, and max count
* Live progress bar during generation
* Download all invoices as a single ZIP
* Seller info, logo, IBAN, VAT number configurable in settings
* Supports Latin, Extended Latin, and Cyrillic scripts (Estonian, Russian, English, and more)
* Automatic table header color picker
* Works with both legacy WooCommerce order storage and HPOS (High-Performance Order Storage)
* Compatible with PHP 8.4

**Requirements:**

* WooCommerce 7.0 or later
* For styled PDF invoices: [dompdf](https://github.com/dompdf/dompdf) (optional — plain text fallback included)

== Installation ==

1. Upload the `axagen-bulk-invoice-generator` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **WooCommerce → Bulk Invoices** to configure your seller info
4. Use the Generate ZIP form to filter and download invoices

**Optional — styled PDF invoices:**

By default the plugin generates simple plain-text PDFs. For formatted invoices with your logo, colors, and proper layout, install dompdf:

1. Download [dompdf v3.x](https://github.com/dompdf/dompdf/releases) as a ZIP
2. Extract and rename the folder to `dompdf`
3. Place it inside the plugin folder: `axagen-bulk-invoice-generator/dompdf/`

== Frequently Asked Questions ==

= Does this work with HPOS? =

Yes. The plugin automatically detects whether your store uses legacy order storage (wp_posts) or High-Performance Order Storage and queries accordingly.

= What PDF library does it use? =

It uses [dompdf](https://github.com/dompdf/dompdf) if available in the plugin folder. If not found, it falls back to a built-in plain-text PDF generator that requires no external libraries.

= How many invoices can it generate at once? =

Tested with 1,000+ orders. Memory usage is kept low by processing orders one at a time and running garbage collection every 10 orders. For very large batches (2,000+), increase your PHP `memory_limit` and `max_execution_time`.

= Does it support multiple languages? =

Yes — the plugin renders Latin, Extended Latin, and Cyrillic scripts (covering Estonian, Russian, English, and more). Select the invoice language in plugin settings.

= Where is the generated ZIP stored? =

The ZIP is written to `wp-content/uploads/bulk-invoices-tmp/` and deleted immediately after download.

== Screenshots ==

1. Plugin settings page — configure seller info, logo, language, and colors
2. Generate ZIP form — filter by date, status, order number, and count
3. Example generated invoice PDF

== Changelog ==

= 0.4.5 =
* Added uninstall.php — deletes all plugin settings (the 14 axagbuin_invoice_* options), any leftover axagbuin_job_* transients, and the temporary ZIP working folder when the plugin is deleted from Plugins screen.

= 0.4.4 =
* Replaced raw ini_set('memory_limit', ...) calls with WordPress's own wp_raise_memory_limit('admin') helper in handle_download() and handle_stream() — this only ever raises (never lowers) the limit, respects the site's configured ceiling, and is the WordPress-native way to do this instead of a direct PHP ini_set() call.

= 0.4.3 =
* Fixed load_dompdf() checking the wrong paths for the bundled dompdf library — it never checked dompdf/vendor/autoload.php (the actual location Composer installs to), only dompdf/autoload.inc.php and vendor/dompdf/autoload.inc.php, neither of which exist in this bundle. Invoices were silently falling back to plain-text PDFs instead of styled ones.

= 0.4.2 =
* Fixed phpcs:ignore comments on ini_set() calls to also suppress Squiz.PHP.DiscouragedFunctions.Discouraged (previously only listed WordPress.PHP.IniSet.Risky, leaving 5 Plugin Check warnings unsuppressed)

= 0.4.1 =
* Moved inline admin JS/CSS to properly enqueued assets (wp_enqueue_script/wp_enqueue_style)
* Replaced WP_CONTENT_DIR usage in dompdf chroot with wp_upload_dir()
* Bounded memory_limit increase (was unlimited) to 512M, scoped and restored after generation
* Renamed all functions, classes, options, transients, and hooks to use a unique axagbuin_ prefix
* Namespaced client-supplied job keys under a plugin-specific transient prefix to prevent arbitrary transient overwrites

= 0.4.0 =
* Redesigned invoice layout: logo + seller top, ARVE title standalone, buyer + order meta two-column
* Added product variation/meta lines under product names
* Fixed date and status filters using direct SQL (compatible with PHP 8.4)
* Transient-based live progress bar (works with buffered Apache servers)
* Settings now save via wp_ajax (admin-post.php bypass fix)
* Added cancel button during generation

= 0.3.6 =
* Initial public release
* Support for HPOS and legacy WooCommerce storage
* EN/ET/RU language support
* Dual-path SQL filtering

== Upgrade Notice ==

= 0.4.0 =
Redesigned invoice layout and PHP 8.4 compatibility fixes. Recommended update.
