Title: Milan&#39;s Invoices for Woo
Author: milangru
Published: <strong>December 5, 2026</strong>
Last modified: December 5, 2026

---

Search plugins

![](https://ps.w.org/milans-invoices-for-woo/assets/banner-772x250.png?rev=3846419)

![](https://ps.w.org/milans-invoices-for-woo/assets/icon-256x256.png?rev=3846419)

# Milan's Invoices for Woo

 By [milangru](https://profiles.wordpress.org/milangru/)

[Download](https://downloads.wordpress.org/plugin/milans-invoices-for-woo.1.0.1.zip)

 * [Details](https://wordpress.org/plugins/milans-invoices-for-woo/#description)
 * [Reviews](https://wordpress.org/plugins/milans-invoices-for-woo/#reviews)
 *  [Installation](https://wordpress.org/plugins/milans-invoices-for-woo/#installation)
 * [Development](https://wordpress.org/plugins/milans-invoices-for-woo/#developers)

 [Support](https://wordpress.org/support/plugin/milans-invoices-for-woo/)

## Description

Milan’s Invoices for Woo generates a branded PDF invoice the moment an order reaches
the Processing status, attaches it to the WooCommerce “Customer Processing Order”
and “Customer Completed Order” emails (and to the manual “Email invoice / order 
details to customer” order action), and gives both admins and customers a secure
way to download it afterwards.

**Features**

 * Automatic PDF generation on order status change to Processing, with duplicate-
   generation protection.
 * Attaches the invoice to the relevant customer-facing WooCommerce emails automatically.
 * Admin settings screen (WooCommerce > Milan’s Invoices) for company details, bank
   account info, and a WYSIWYG header/footer with placeholder support ({order_number},{
   order_date}, {customer_name}, {total_amount}).
 * Live invoice preview on the settings screen, rendered from your most recent real
   order. The preview reflects your current form values, so you can see changes 
   before saving them.
 * HPOS-compatible order metabox with Download / Regenerate Invoice actions.
 * Customer-facing “Download PDF Invoice” button on My Account > Orders.
 * Secure downloads: invoices are served only through a nonce- and capability-checked
   handler, and the invoices folder is protected from direct access (nginx needs
   one extra rule, see Installation).
 * Unguessable invoice filenames: each order gets a random per-order token stored
   in order meta and appended to the filename.
 * Full i18n support (text domain: `milans-invoices-for-woo`).

**Bundled libraries**

This plugin bundles [Dompdf](https://github.com/dompdf/dompdf) v3.1.6 (LGPL-2.1)
to render PDFs, together with its dependencies php-font-lib, php-svg-lib, masterminds/
html5, sabberworm/php-css-parser and thecodingmachine/safe, in the `vendor/` folder.
Exact versions are listed in `composer.json` / `composer.lock` in the GitHub repository:
https://github.com/milangru/Milan-s-Invoices-for-Woo

## Screenshots

[⌊Settings screen with live invoice preview.⌉⌊Settings screen with live invoice 
preview.⌉[

Settings screen with live invoice preview.

[⌊Order admin metabox with Download / Regenerate actions.⌉⌊Order admin metabox with
Download / Regenerate actions.⌉[

Order admin metabox with Download / Regenerate actions.

[⌊Download PDF Invoice button in My Account > Orders.⌉⌊Download PDF Invoice button
in My Account > Orders.⌉[

Download PDF Invoice button in My Account > Orders.

[⌊A generated PDF invoice.⌉⌊A generated PDF invoice.⌉[

A generated PDF invoice.

## Installation

 1. Upload the plugin to `wp-content/plugins/milans-invoices-for-woo/`, or install 
    it through the WordPress plugins screen.
 2. This plugin requires its bundled PHP dependencies to be present under `vendor/`.
    If you’re installing from a release zip, these are already included. If you’re 
    building from source, run `composer install --no-dev --optimize-autoloader` in 
    the plugin directory first (see the README.md in the GitHub repository for a note
    on a one-time Dompdf packaging quirk).
 3. Activate the plugin through the “Plugins” screen in WordPress. Activation automatically
    creates `wp-content/uploads/milans-invoices-for-woo/` with a hardening `.htaccess`(`
    Deny from all` / `Options -Indexes`) and an empty `index.php`.
 4. Go to WooCommerce > Milan’s Invoices and fill in your company details, bank account,
    and invoice header/footer.
 5. **nginx users only:** nginx ignores `.htaccess`, so add `location ^~ /wp-content/
    uploads/milans-invoices-for-woo/ { deny all; }` inside your site’s `server { ...}`
    block, then reload nginx. This blocks HTTP access to the whole invoices folder,
    so a direct URL returns 403 even with the correct token. The plugin’s own download
    handler is unaffected. On multisite the path is `/wp-content/uploads/sites/N/milans-
    invoices-for-woo/`, so adjust the rule accordingly.

## FAQ

### Does this work with WooCommerce’s High-Performance Order Storage (HPOS)?

Yes, the plugin declares HPOS compatibility and the order metabox works with both
HPOS and legacy post-based order storage.

### Where are invoice PDFs stored?

In `wp-content/uploads/milans-invoices-for-woo/`, which is protected from direct
browsing via `.htaccess` and an empty `index.php`. Downloads are only served through
a nonce-protected, capability-checked handler. On nginx, you must add the equivalent`
deny all` rule manually (see Installation).

### Can invoice filenames be guessed?

Not in practice. Each filename includes a random 20-character per-order token, and
the folder is protected against direct HTTP access (automatically on Apache, via
the rule in Installation on nginx).

### Does this work on nginx?

Yes, but nginx ignores `.htaccess`, so you must add the `location ^~ /wp-content/
uploads/milans-invoices-for-woo/ { deny all; }` rule manually (see Installation).
Invoice downloads through the plugin work either way.

### Can customers download their own invoices?

Yes, from My Account > Orders, for orders in Processing or Completed status once
an invoice has been generated for them.

### What happens to my invoices when I delete the plugin?

Nothing is deleted by default, because invoices often have to be retained. To remove
all plugin data on deletion, enable “Delete all plugin data” under WooCommerce >
Milan’s Invoices > Data before deleting the plugin.

### Does the settings preview show changes I haven’t saved yet?

Yes. Click “Refresh Preview” and the preview is rendered with whatever is currently
in the form, including the header and footer editors. Nothing is saved until you
click “Save Settings”.

### Why does the preview say it needs an order?

The preview is rendered from your most recent real order, so at least one order 
must exist in your store.

### Images do not appear in the PDF.

Make sure the PHP GD extension is enabled on your server. Only images stored in 
the WordPress uploads directory (media library) can be used; images from other sites
or from your theme folder are not loaded for security reasons.

### I rebuilt vendor/ after upgrading Dompdf and now get “Path cannot be empty”

Dompdf’s Composer distribution does not ship a `VERSION` file that its own `Options`
constructor unconditionally reads. Recreate the file with the correct installed 
version; see “Build notes” in the GitHub README. The shipped `vendor/` already contains
the correct file.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Milan's Invoices for Woo” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ milangru ](https://profiles.wordpress.org/milangru/)

[Translate “Milan's Invoices for Woo” into your language.](https://translate.wordpress.org/projects/wp-plugins/milans-invoices-for-woo)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/milans-invoices-for-woo/),
check out the [SVN repository](https://plugins.svn.wordpress.org/milans-invoices-for-woo/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/milans-invoices-for-woo/)
by [RSS](https://plugins.trac.wordpress.org/log/milans-invoices-for-woo/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.1

 * Security hardening and WordPress.org compliance fixes: unguessable invoice filenames,
   slug-based uploads folder, inline settings notice, documented nginx protection.
 * New: the settings-page preview now reflects unsaved form values, including the
   header and footer editors.
 * Invoices from 1.0.0 are moved to unguessable file names automatically the first
   time they are opened, emailed or regenerated. Only the file name is stored, so
   moving the site no longer breaks invoices.
 * Dompdf no longer fetches remote URLs and can only read the uploads directory;
   logos and product images from the media library still work.
 * The invoice is no longer attached to the admin “New order” email.
 * Admin notices appear only on the order edit screen (and the missing-WooCommerce
   notice only on the Plugins screen); the confirmation dialog no longer uses inline
   JavaScript.
 * New opt-in setting and uninstall.php to remove settings, invoice PDFs and invoice
   order meta when the plugin is deleted. Nothing is removed by default.

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.0.1**
 *  Last updated **9 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [DOMPDF](https://wordpress.org/plugins/tags/dompdf/)[invoice](https://wordpress.org/plugins/tags/invoice/)
   [orders](https://wordpress.org/plugins/tags/orders/)[pdf](https://wordpress.org/plugins/tags/pdf/)
   [woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/milans-invoices-for-woo/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/milans-invoices-for-woo/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/milans-invoices-for-woo/reviews/)

## Contributors

 *   [ milangru ](https://profiles.wordpress.org/milangru/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/milans-invoices-for-woo/)