eInvoice Validator for VAMPIRE – Manual
1 · Overview
The eInvoice Validator for VAMPIRE is a WordPress plugin that checks electronic invoices according to EN 16931. It is self-contained: the validation engine VAMPIRE PHP is included in the plugin and runs in the same PHP process as WordPress. You need no Java, no background service and no outside server.
It is meant for operators of a WordPress site who want to offer suppliers, customers or colleagues a validation page, also on ordinary web hosting without Java.
What the plugin does:
- It checks XRechnung 3.0.2 (UBL Invoice, UBL CreditNote and CII, including the variants Extension and CVD), the EN 16931 core, Peppol BIS Billing 3.0.21 (Invoice and CreditNote) and Factur-X / ZUGFeRD 2.5.2 in the profiles EN16931 and EXTENDED. These are eight rule packages and fourteen scenarios.
- It accepts XML files and hybrid PDF files (ZUGFeRD, Factur-X). From a PDF the visitor's browser extracts the embedded XML; only the XML goes to the server.
- It shows the validation report with result, validation steps, explained findings and a field-by-field view of the document.
- It offers the report as XML in the report format of the KoSIT validator (
rep:report) for download. - On request the report lists every rule checked with its result, including the satisfied ones ("Positive test report").
- On request it checks ZUGFeRD and Factur-X invoices against several editions of the format and shows the result per edition in a table.
- It limits the file size and the number of uploads per visitor and day.
- It lets you install new rule packages as a ZIP and accepts rule profiles of your own from the Rule Studio.
- It gives an invoice opened in the eInvoice Viewer the button Validate with VAMPIRE.
What the plugin does not do:
- It stores no invoices and no reports. It is not an archive.
- It reads only the embedded XML from a PDF. A PDF without embedded XML is rejected with a message.
- It does not check by itself whether a newer edition of a rule set has appeared in the meantime. What was shipped or installed as a rule package applies.
- Not included in the single check are the ZUGFeRD profiles MINIMUM, BASIC WL and BASIC and the seven national variants for RO, PT, BE, RS, IT, HR and TR. Such an invoice gets "No result" with the missing rule set as the reason. With the setting "Check against every edition", on the other hand, the three ZUGFeRD profiles are checked, against the editions 2.1 to 2.5.2 (chapter 4).
- It has no queue for very large documents. According to measurement, an invoice with 1000 lines takes about 40 seconds and 174 MB of memory.
- The report is a technical record of a check and not a certification.
Requirements:
| What | Requirement |
|---|---|
| WordPress | 5.8 or newer |
| PHP | 8.2 or newer (hard limit) |
| PHP extensions | dom, libxml, bcmath |
| Memory | 256 MB recommended |
| Java | not needed |
| Other plugins | none; the plugin checks on its own |
| Visitor's browser | with JavaScript enabled |
screenshots/vv-bericht.en.pngDrop zone and below it the validation report with result, findings and field-by-field view of a sample invoice2 · Installation
The plugin is free and licensed under the GNU General Public License, version 2 or later. The validation engine VAMPIRE PHP and the bundled rule packages are free as well. There is no licence key.
Installing
Caution: PHP 8.2 is a hard limit. If the server runs an older version, the plugin stays inactive and shows the message "eInvoice Validator for VAMPIRE needs PHP 8.2 or newer. This server runs PHP …, so the plugin stays inactive." in the admin area. No white page results from this.
Updating
The plugin does not look for new versions by itself and makes no request to the outside. You get a new version like any other plugin under Dashboard → Updates. Independently of that you can install new rule sets without replacing the plugin: as a rule package on the settings page (see chapter 4).
Removing
You deactivate and delete the plugin under Plugins. The WordPress database holds its settings and a key for the folder name of the rule profiles; installed rule packages and rule profiles are stored below the uploads folder. All eInvoice tools of the site share the design kit choice. The plugin does not clean up on deletion: settings, installed rule packages and rule profiles stay. Anyone wanting to get rid of them switches back with Switch back to the bundled rule packages before deleting, which deletes the uploaded package, and deletes every rule profile in its table row.
3 · First steps
screenshots/vv-systemcheck.en.pngSection "Systemcheck" of the settings page with green ticksscreenshots/vv-ablage.en.pngDrop zone on a WordPress page, below it the line with the day's remaining uploads4 · Working with the eInvoice Validator
Submitting an invoice for checking
The visitor drags a file onto the drop zone, or clicks it and chooses a file; Enter or Space also open the file selection. Files ending in .xml or .pdf are accepted. During the check a note stands below the zone, then the report appears. If a daily limit applies, it also says there how many uploads remain today.
Submitting ZUGFeRD and Factur-X PDFs
With a PDF the visitor's browser reads out the embedded invoice XML and sends only this XML to the server. The PDF itself does not leave the visitor's computer. The library needed for this (1.7 MB) is only loaded when a PDF is actually dropped. If the PDF contains no XML, the message that this PDF carries no e-invoice appears.
Reading the validation report
The report shows the result at the top, below it the validation steps with their figures and the findings, filterable by level. Every finding has a plain-language explanation and names the affected field or attachment. Below follows the field-by-field view of the document; fields that break a rule carry a note. Numbers and dates follow the language of the site: German writes 5.900,00 EUR and 01.12.2017, English 5,900.00 EUR and 2017-12-01, French 5 900,00 EUR. If a text is missing in the chosen language, the English one appears with a note about it.
If a rule set requires a visible notice, for example the rules for Factur-X and ZUGFeRD, this notice stands above the report.
Understanding "No result"
A document the plugin could not check is never reported as accepted and never as rejected. It gets an orange bar with the stamp "No result" and one of three reasons:
- The rule set is not included. The report names the missing rule set with its edition.
- The edition is not included yet. The invoice names in the field BT-24 an edition for which there is no rule set yet, such as XRechnung 4.0.
- The check stopped at a rule that could not be evaluated for this document. The report then shows the engine's message in English. In this case there is no report to download.
In all three cases the report says explicitly that this says nothing about whether the invoice is correct.
screenshots/vv-kein-ergebnis.en.pngOrange bar with the stamp "No result" and the reason "edition not included yet"Downloading the report
A button above the report saves it as an XML file named after the invoice with the suffix -report.xml. In the report the engine names itself with version and rule packages, not as the KoSIT validator. Tools that read KoSIT validator reports also read this file.
A second button, "Download report.html", saves the report the engine itself writes as an HTML page, unchanged. The page opens without an internet connection and can be printed and passed on. The engine writes it in German, also on an English website.
Positive test report: every rule with its result
If the setting "Positive test report" is on, the report gets the section "Checked rules". It names every rule of the rule sets used with its result: satisfied, violated, not applicable or not checked. It also names every rule set with its edition, the time of the check and a checksum of the document. Two further buttons appear above the report: one saves the complete report with all rules as a JSON file (…-rule-report.json), the other a print version as an HTML file (…-checked-rules.html), which the browser can save as a PDF through its print dialog.
Note: The section is a technical record of a check and not a certification. The report says so too.
screenshots/vv-gepruefte-regeln.en.pngSection "Checked rules" in the report, above it the three download buttonsChecking against every edition
A ZUGFeRD or Factur-X invoice does not say which edition of the format it follows. With the setting "Check against every edition", every invoice submitted is additionally checked against the editions of its format, and a table above the report shows the result per edition. There are two levels: the cascade checks from the newest edition downwards until an edition accepts the invoice. The full matrix checks every edition and takes up to seven times as long.
The plugin brings rule sets for this for the ZUGFeRD editions 2.1, 2.2, 2.3.2, 2.3.3, 2.4, 2.5 and 2.5.2, each in the profiles MINIMUM, BASIC WL, BASIC, EN16931 and EXTENDED. So the table also checks the three small profiles the single check lacks. The report below is the report of the edition the table chose, and report.xml and report.html are those of that edition too. When the chosen edition checks with the rule sets of the single check, as with XRechnung, the single check stands there. A sentence between table and report says which of the two reports stands below.
screenshots/vv-fassungen-tabelle.en.pngTable above the report with the result per edition for a ZUGFeRD invoiceInstalling rule packages
The section "Rule packages" of the settings page shows identifier, edition and licence of every rule set the site checks with. With the form "Install a rule package from your shop account ( ZIP file )" and the button Install rule package you install a rule package. It replaces the rule sets; the engine stays as it is. An unsuitable package is rejected, and the previous rule sets stay in use. The button Switch back to the bundled rule packages switches back and deletes the installed package.
screenshots/vv-regelpakete.en.pngSection "Rule packages" with the table of rule sets and the upload formApplying rule profiles from the Rule Studio
A rule profile from the Rule Studio adds your own rules to the official ones, or switches official rules off, replaces them or changes their severity. In the section "Rule profiles", under "Install a rule profile from the Rule Studio ( .json or .js file )", you choose the exported profile file and click Install rule profile. The table shows per profile name and version, syntax and rule sets as well as the number of own and switched-off rules. Every finding from a profile is marked in the report with the profile's name, so a rule of your own never looks like a rule of the standard.
- The profiles are applied in the order of their names.
- A profile for UBL does not apply to a CII invoice and vice versa.
- A profile with the same name replaces the existing one.
- An invalid file is rejected; "Delete" in the table row removes a profile.
Caution: If the profile folder contains a file that cannot be loaded, not a single profile is applied. The settings page shows this file in red with the reason, and a note above the report says that the check ran without the rule profiles. Delete the file or upload it again corrected.
screenshots/vv-regelprofile.en.pngSection "Rule profiles" with one installed profile and the upload formLooking at the systemcheck and the scope of checking
The systemcheck shows PHP version, the three extensions needed, memory limit, run time and the number of rule packages found. Every row is green or red; a red one names the next step. It is determined anew every time the page loads. Below it, the table "What this installation checks" names document type and rule packages, read from the same scenario file the check uses.
5 · Settings
All settings are under eInvoice Validator → VAMPIRE. The page is visible to users with the right to manage options (administrators).
screenshots/vv-einstellungen.en.pngSettings page with the six fields from "Maximum upload size" to "Design kit"| Setting | Default | Effect |
|---|---|---|
| Maximum upload size | 8 MB | Largest file accepted. 1 to 64 MB are allowed; any other value is set to 8. Below the field it says: "The server's own upload limit still applies and wins when it is lower." |
| Daily uploads per role | every role 20 | A table with one row for guests ( not logged in ) and one row for each role of the site. Per row: empty means unlimited, 0 means no access, a number means that many checks per calendar day. Logged-in users are counted by user, guests by IP address. A user with several roles gets the most generous value. Administrators are never limited. Until the table is saved for the first time, the previous single value applies to every role. |
| Behind a proxy or CDN | off | The box "Read the visitor address from X-Forwarded-For" reads the visitor's address from this header. |
| Positive test report | off | The report gets the section "Checked rules" and two additional downloads (JSON and print version as HTML). If the installation's engine cannot supply the list, the field is locked and says so. |
| Check against every edition | off | Three values: "Off: the single check only", "Cascade: from the newest edition down until one accepts the invoice" and "Full matrix: every edition", which takes up to seven times as long. If the installation contains no rule packages per edition, the field is locked and says that they come with an update of the plugin or the rule package. The plugin brings them. |
| Design kit | Kit H | Look of drop zone and report. The choice applies to all eInvoice tools of the site. |
Caution: Only switch on "Behind a proxy or CDN" when a proxy really stands in front of the site. Otherwise a visitor can claim any address, and the daily limit comes to nothing.
Shortcode
| Shortcode | Attributes | Effect |
|---|---|---|
[sppv_validator] | none | Shows the drop zone and, after the check, the report. |
[sppv_validator]The shortcode evaluates no attributes; the settings apply to every page with the shortcode.
6 · Special cases
You run the site behind a CDN or reverse proxy. Switch on "Behind a proxy or CDN". The address the proxy appended is then counted, not one the visitor can send along themselves.
You want to file a record with the invoice. Switch on "Positive test report". After the check, save the print version as an HTML file and turn it into a PDF in the browser's print dialog.
You receive ZUGFeRD invoices and do not know which edition they were created to. Set "Check against every edition" to "Cascade". The table above the report shows which edition accepts the invoice.
You want to check requirements of your own on supplier invoices. Write the rules in the Rule Studio, export the profile and upload the file with the profile's name in the section "Rule profiles". The file index.js that the Rule Studio writes next to it is the list of profiles and not a profile; it is rejected.
A new edition of a rule set has appeared. Download the new rule package as a ZIP file and install it in the section "Rule packages". If something does not fit, switch back to the bundled rule packages with one button. Your rule profiles are kept.
7 · Working with other packages
None of the following packages is a requirement. The validator checks on its own.
| Package | What is added |
|---|---|
| eInvoice Validation Explorer for KoSIT | If it is installed, it takes over the display of the report with its own, more detailed presentation. No setting is needed for this. |
| eInvoice Viewer for PEPPOL & EN16931 from 2.35.0 | Shows the same invoice as a readable document and gives it the button Validate with VAMPIRE. The report then appears in the viewer, and the check counts against the same daily limit as on the page with the shortcode. On the viewer's settings page, "Add-ons available from role" decides who sees the button. |
| eInvoice Viewer – Extended Profiles | Findings about fields of an extension (BT-X) show their value from the document, and the rules of ZUGFeRD / Factur-X EXTENDED and EXTENDED-CTC-FR are explained. Without the add-on such a finding shows the identifier and the checker's message, and the report says so above the result. |
| eInvoice Rule Studio for VAMPIRE | Writes the rule profiles you install on the settings page. |
| Other eInvoice tools on the same site | Share the design kit choice. |
8 · Troubleshooting
The messages appear in the language of the site; the table gives the English wording.
| Sign | Cause | Remedy |
|---|---|---|
| The admin area says the plugin needs PHP 8.2 or newer and stays inactive. | The server runs an older PHP version. | Have your host set PHP 8.2 or newer. |
| A row in the systemcheck is red. | An extension is missing, memory is too tight, or no rule packages were found. | Follow the next step below the red row. |
| "Please choose a PDF or XML file." or "… an XML file." | The file has an extension other than .pdf or .xml or is not XML. | Submit the invoice as XML or as a hybrid PDF. |
| "The file is too large." | The file exceeds the configured size or the server's upload limit. | Raise "Maximum upload size"; if the server limit is smaller, have your host raise it. |
| "The file is empty." or "The file could not be read." | The file has no content or is damaged. | Export the invoice again and submit it again. |
| "This PDF carries no e-invoice. …" | The PDF contains no embedded XML, for example because it was only printed. | Submit the invoice XML or a real ZUGFeRD or Factur-X PDF. |
| "You have reached the daily upload limit. Please try again tomorrow." | The visitor address's daily limit is used up. | Come back the next day; as the operator, raise the role's number in "Daily uploads per role" or empty the field. |
| "This tool is not available for your account." | The visitor's role has a 0 in "Daily uploads per role". | As the operator, enter a number for this role or empty the field. |
| "Security check failed. Please reload the page." or "The upload failed. Please try again." | The security token is invalid, or the transfer was interrupted. | Reload the page and try again; for large documents check memory and run time in the systemcheck. |
| Bar "No result". | Rule set missing, edition not included yet, or the check stopped at a rule. | Read the reason in the bar (chapter 4). For a missing edition install a newer rule package; for a stop, pass the engine's message to support. |
| The field "Positive test report" or "Check against every edition" is locked. | The installation's engine or rule packages do not support the function. | Update the plugin or the rule package. |
| "An uploaded rule package is registered, but its files are missing. …" | The files were removed during a restore or clean-up. | Upload the rule package again or switch back to the bundled rule packages. |
| "The rule profile was refused: …" | The file is not a valid profile; the reason follows in English. | Correct the profile in the Rule Studio and export it again. |
| "The uploads folder is not writable, so the rule package cannot be stored." or "The uploads folder cannot be written, so the profile cannot be stored." | WordPress cannot write there. | Have your host check the write permissions. |
9 · Privacy and security
What stays in the browser: A dropped PDF is read in the visitor's browser and not transmitted. The download files (report as XML, report as JSON, print version) are created in the browser from the server's answer.
What goes to the server: The invoice XML is sent to your own WordPress site and checked there. It goes to no other server: the plugin makes no request to the outside, neither to invoicePress nor to third parties. The rule packages are in the plugin or in your uploads folder.
What is stored: The invoice is checked in memory and not stored; no copy arises in the uploads folder, and the report and print version are not stored on the server either. Only the number of uploads a visitor address made in the day is counted, without the document. The counter is a short-lived entry in the WordPress database that expires after one day; for logged-in users it holds the user ID, for anonymous visitors only a hash of their IP address. Your settings, installed rule packages and rule profiles are stored permanently.
Security:
- The server accepts only XML. There is no PDF reader in PHP, no
execand no subprocess. - Every check needs a fresh security token, which the page fetches before the upload.
- A rule profile is a data file and is never run as a program, not even in the form
.js. - The rule profiles folder carries a random part in its name and is blocked against requests with an
.htaccessfile. On nginx this file has no effect; there only the random name protects it.
10 · For developers
| Kind | Name | Meaning |
|---|---|---|
| Shortcode | sppv_validator | Drop zone and report; without attributes. |
| Filter | sppv_force_enqueue | With true, forces stylesheet and script to load on pages in whose content the shortcode is not found. |
| Filter | einvoice/report_html | Lets another plugin take over the display of the report. |
| Filter | einvoice/engine_base_dir | Through it the plugin reports the folder of its rule packages to other plugins. It does not overwrite an existing answer. |
| REST route | POST /wp-json/einvoice/v1/validate-php | Checks a file in the field file; requires the shared security token of the namespace einvoice/v1. |
| AJAX action | sppv_nonce | Returns a fresh security token. |
| AJAX action | sppv_validate | Checks a file; fields nonce and file. Leads into the same processing as the REST route. The viewer's button uses the same two actions. |
| Static methods | SPPV_Plugin::bridge_texts(), SPPV_Plugin::instance()->enqueue_bridge_script() | Label, running message and error message of the viewer's button, and the report script on the viewer's page. The viewer only shows the button when both exist. |
| JavaScript | window.SPPV_renderReport( container, data ) | Draws a check result into an element; also registered as renderReport under EInvoice.register( 'validator', … ). |
| Constants | SPPV_VERSION, SPPV_SHORTCODE, SPPV_FILE, SPPV_DIR, SPPV_URL | Version, shortcode name, main file, folder and URL of the plugin. |
| Options | sppv_max_filesize_mb, sppv_role_limits ( the table per role; until it is saved for the first time, the earlier single value sppv_daily_limit applies ), sppv_trust_proxy, sppv_rule_report, sppv_multi_edition | The settings from chapter 5. sppv_multi_edition knows off, cascade and matrix. |
The answer of a successful check contains html, view (explainer, lite or raw), cssUrl, xml, filename and remaining; with the positive test report switched on, additionally ruleReport, ruleReportFilename, rulePrint and rulePrintFilename. Errors come with message and one of the status codes 400, 403, 413, 415, 422 or 429.
11 · Versions
1.12.1
- With "Check against every edition" switched on, the report below the table is that of the chosen edition.
- New: the button "Download report.html" saves the engine's HTML report.
- The report and its notes speak of the "result" of a check.
1.11.0
- The plugin is free and licensed under the GNU General Public License, version 2 or later; it comes through wordpress.org.
- New rule packages are installed as a ZIP file, without a shop account.
1.10.0
- The daily limit can be set per role, with its own row for guests; 0 means no access.
- An invoice opened in the eInvoice Viewer from 2.35.0 gets the button "Validate with VAMPIRE".
- New: rule profiles from the Rule Studio can be installed on the settings page; their findings appear in the report with the profile's name.
- Answers appear in the language of the page, also for logged-in users whose profile language differs.
1.9.0
- New setting "Positive test report": the report lists every rule with its result, including the satisfied ones, and can be downloaded and printed.
- New setting "Check against every edition": ZUGFeRD and Factur-X invoices are checked from the newest edition downwards, and a table shows the result per edition.
- An invoice naming an edition the rule package does not contain yet, such as XRechnung 4.0, gets "No result" with the reason instead of "Rejected".
- New rule packages can be uploaded as a ZIP from the shop account.
- The invoice view no longer marks an IBAN with wrong check digits; the validation report is not affected.
- The package names origin and licence of every rule set and contains the licence texts.
1.8.1 – Texts appear in the font of the chosen design kit. The document view marks fields that break a rule with a translated note below the field.
1.8.0 – The rules of ZUGFeRD / Factur-X EXTENDED and EXTENDED-CTC-FR are only explained with the "Extended Profiles" add-on. Long CII invoices are checked much faster; 400 lines take about a third of the previous time. Behind a proxy, the daily limit counts the address the proxy appended.
1.7.0 to 1.5.0 – With Extended Profiles, findings about fields of an extension show their value; the design kit can be chosen; the report appears in the Validation Explorer's view.
12 · List of images
This list shows which screenshots this manual expects and which were found in the folder screenshots/ of the package. An image is always named key.language.png, for example vv-bericht.en.png. The images show sample data only.
| Status | File | What it shows |
|---|---|---|
| – | vv-bericht.en.png | Drop zone and below it the validation report with result, findings and field-by-field view of a sample invoice |
| – | vv-systemcheck.en.png | Section "Systemcheck" of the settings page with green ticks |
| – | vv-ablage.en.png | Drop zone on a WordPress page, below it the line with the day's remaining uploads |
| – | vv-kein-ergebnis.en.png | Orange bar with the stamp "No result" and the reason "edition not included yet" |
| – | vv-gepruefte-regeln.en.png | Section "Checked rules" in the report, above it the three download buttons |
| – | vv-fassungen-tabelle.en.png | Table above the report with the result per edition for a ZUGFeRD invoice |
| – | vv-regelpakete.en.png | Section "Rule packages" with the table of rule sets and the upload form |
| – | vv-regelprofile.en.png | Section "Rule profiles" with one installed profile and the upload form |
| – | vv-einstellungen.en.png | Settings page with the six fields from "Maximum upload size" to "Design kit" |