Back to Community

Troubleshooting Common Fatal Errors in PDF Invoices & Packing Slips for WooCommerce

Content

If you're encountering a fatal error after updating the 'PDF Invoices & Packing Slips for WooCommerce' plugin or your server's PHP version, you're not alone. These errors can be frustrating, often causing the plugin to stop working entirely or even crashing your admin area. Based on common community reports, this guide will help you diagnose and resolve the most frequent fatal errors.

Why Do These Fatal Errors Occur?

Fatal errors in the plugin typically arise from a few key scenarios:

  • Incomplete Plugin Updates: Files may not have downloaded or installed correctly during an automatic update.
  • PHP Version or Extension Issues: The plugin requires specific PHP extensions (like DOMDocument) that might be missing on your server.
  • File Permission Problems: The plugin cannot access or write to necessary files due to restrictive server permissions.
  • Compatibility Conflicts: An update may introduce a temporary conflict with your theme, another plugin, or a custom code snippet.

Common Errors and Their Solutions

1. Class Not Found Errors (e.g., ThirdPartyPlugins, DOMDocument)

These are among the most common errors reported.

Error Examples:

  • Fatal error: Class 'WPO\IPS\Compatibility\ThirdPartyPlugins' not found
  • Fatal error: Class 'DOMDocument' not found
  • Fatal error: Class 'DOMImplementation' not found

Solutions:

  • Reinstall the Plugin: An incomplete update is a frequent cause. Completely delete the plugin from your WordPress plugins page and install it fresh from the repository. This ensures all files are correctly placed.
  • Install PHP DOM Extension: The DOMDocument and related classes are part of the PHP XML extension. Contact your hosting provider and ask them to enable the php-xml or php-dom extension for your PHP version.

2. File System and Permission Errors

These errors indicate the plugin cannot interact with your server's file system correctly.

Error Examples:

  • PHP Fatal error: Uncaught RuntimeException: This plugin only supports the direct filesystem method.
  • Warning: include_once(): Failed opening '...template-functions.php' for inclusion (Permission denied)

Solutions:

  • Force Direct Filesystem Method: If you are on a host that uses a non-standard file system (like VIP), you may need to force the direct method. Add this line to your wp-config.php file above the /* That's all, stop editing! Happy publishing. */ line:
    define('FS_METHOD', 'direct');
    Note: Some specialized hosting environments may not support the direct method. Consult your host's documentation.
  • Check File Permissions: The Permission denied warning suggests the web server user does not have read access to the plugin files. Contact your hosting support to check and correct the file permissions for the plugin's directory, typically located at /wp-content/plugins/woocommerce-pdf-invoices-packing-slips/.

3. PHP 8.x Compatibility Warnings

While the core plugin is compatible with PHP 8.x, some deprecated code notices might appear, especially with extensions or custom templates.

Error Example:

  • PHP Deprecated: Return type of ... should either be compatible with DateTime::setTimezone(...

Solution:

  • Ensure you are using the latest version of the plugin and any associated premium extensions, as these warnings are often fixed in subsequent updates. If the notice is non-fatal and everything works, you can safely suppress deprecation warnings in a production environment, but updating is the best long-term solution.

General Troubleshooting Steps

If the specific error isn't listed above, follow these steps to isolate the problem.

  1. Conflict Test: Temporarily switch to a default WordPress theme (like Twenty-Twenty Four) and disable all other plugins except WooCommerce and the PDF Invoices plugin. If the error disappears, re-enable your plugins and theme one by one to identify the conflict.
  2. Check for Custom Code: If you are using a custom PDF template or custom code snippets (e.g., from a functions.php file), try switching to the default "Simple" template and disabling the custom code. An outdated custom template is a common source of errors after plugin updates.
  3. Review Server Error Logs: Your hosting provider should give you access to error logs (often in a logs/ directory or via a control panel like cPanel). These logs provide the complete error message and stack trace, which is essential for diagnosing the root cause.

By methodically working through these solutions, you can usually resolve the fatal error and get your PDF generation back up and running. If your issue persists after trying these steps, sharing the exact error message and your environment details (WordPress, WooCommerce, PHP versions) on a community forum can help others provide more specific assistance.

Related Support Threads Support