Troubleshooting Common Fatal Errors in Complianz – GDPR/CCPA Cookie Consent
Content
Users of the Complianz – GDPR/CCPA Cookie Consent plugin occasionally encounter PHP fatal errors that can disrupt website functionality or block access to the WordPress admin area. This guide compiles the most common errors and their solutions based on community reports and fixes.
Common Fatal Errors and Their Solutions
1. Fatal Error: Uncaught TypeError in class-document.php
Error Message Example: Uncaught TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
Why it happens: This error often occurs when another plugin or theme incorrectly overrides the global `$post` object, breaking standard WordPress functionality.
Solution: The Complianz team has addressed this in recent updates. Ensure you are running the latest version of the plugin. If the error persists, check for conflicts by temporarily deactivating other plugins.
2. Fatal Error: Call to undefined function cmplz_get_cookiebanners()
Error Message Example: PHP Fatal error: Uncaught Error: Call to undefined function cmplz_get_cookiebanners()
Why it happens: This is typically related to the 'Always Active' addon. The error appears if the required plugin files are missing or if there is a version incompatibility.
Solution: Reinstall the addon by carefully following the official instructions. Ensure that all files are correctly placed in the `mu-plugins` directory.
3. Fatal Error: Uncaught Error: Class "PharData" not found
Error Message Example: Uncaught Error: Class "PharData" not found in .../class-geoip.php
Why it happens: This error indicates that the PHP `Phar` extension, which is required for handling GeoIP database files, is not installed or enabled on your server.
Solution: Contact your web hosting provider and request that they enable the `Phar` extension for your PHP installation.
4. Fatal Error: Uncaught TypeError in admin-class-documents.php
Error Message Example: Argument #2 ($post) must be of type WP_Post, null given
Why it happens: This error can occur in the WordPress customizer when a function receives a `null` value instead of a valid `WP_Post` object.
Solution: This has been fixed in newer versions of the plugin. Update Complianz to the latest available version.
5. Fatal Error: Call to undefined method WP_Error::save()
Error Message Example: Uncaught Error: Call to undefined method WP_Error::save()
Why it happens: This error is related to WebP image generation for YouTube placeholders. It occurs if the plugin tries to call a method on a `WP_Error` object, usually because the image download or processing failed.
Solution: A recent update added a check for this functionality. Update the plugin. If your server does not support WebP generation, the plugin should now handle this gracefully.
6. Fatal Error: Allowed memory size exhausted
Error Message Example: PHP Fatal error: Allowed memory size of ... bytes exhausted
Why it happens: Certain processes, like a cookie scan or loading complex admin pages, can require more memory than is currently allocated to PHP.
Solution:
- Increase your PHP memory limit. You can try adding this line to your `wp-config.php` file:
define('WP_MEMORY_LIMIT', '256M'); - Disable the automatic cookie scan in Complianz > Settings to see if this resolves the immediate issue.
General Troubleshooting Steps
If you encounter any error, always follow these steps first:
- Update Everything: Ensure WordPress, your theme, and all plugins (especially Complianz) are updated to their latest versions. Many errors are patched in subsequent releases.
- Conflict Test: Deactivate all other plugins and switch to a default WordPress theme (like Twenty Twenty-Four). If the error disappears, reactivate your plugins and theme one by one to identify the source of the conflict.
- Check Server Requirements: Verify that your server meets all requirements, including a supported PHP version (7.4 or higher) and necessary PHP extensions like `Phar`.
- Enable Debugging: Enable WordPress debugging by adding the following lines to your `wp-config.php` file to get more detailed error messages. Remember to disable this on a live site after troubleshooting.
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); // Logs errors to wp-content/debug.log define( 'WP_DEBUG_DISPLAY', false ); // Hides errors from being displayed on screen
By following this guide, you can resolve the most frequently reported fatal errors and restore your site's functionality. For persistent issues, checking the official WordPress plugin forum for similar reports is often helpful.
Related Support Threads Support
-
New Update blocks /wp-admin login pagehttps://wordpress.org/support/topic/new-update-blocks-wp-admin-login-page/
-
Version 6.5.2 breaks Woocommerce Products Editinghttps://wordpress.org/support/topic/version-6-5-2-breaks-woocommerce-products-editing/
-
Fatal error Feed RSShttps://wordpress.org/support/topic/fatal-error-feed-rss/
-
Vimeo integration giving PHP Warning – query string adding in extra & ‘shttps://wordpress.org/support/topic/vimeo-integration-giving-php-warning-query-string-adding-in-extra-s/
-
My website is having errorhttps://wordpress.org/support/topic/my-website-is-having-error-2/
-
Fatal error after update to WordPress 6.5.2https://wordpress.org/support/topic/fatal-error-after-update-to-wordpress-6-5-2/
-
E_ERRORhttps://wordpress.org/support/topic/e_error-26/
-
Problem wordpress 6.7 Error 403https://wordpress.org/support/topic/problem-wordpress-6-7-error-403/
-
Critical Errorhttps://wordpress.org/support/topic/critical-error-599/
-
Fatal TypeError after login as administratorhttps://wordpress.org/support/topic/fatal-typeerror-after-login-as-administrator/
-
Fatal error in Complianz when generating WebP images for YouTube videoshttps://wordpress.org/support/topic/fatal-error-in-complianz-when-generating-webp-images-for-youtube-videos/
-
Fatal Error in EDD_SL_Plugin_Updater.phphttps://wordpress.org/support/topic/fatal-error-in-edd_sl_plugin_updater-php/
-
WP admin new post – cmplz_document::revert_divs_to_summary() errorhttps://wordpress.org/support/topic/wp-admin-new-post-cmplz_documentrevert_divs_to_summary-error/
-
Fatal errorhttps://wordpress.org/support/topic/fatal-error-4542/
-
Fatal error: Uncaught TypeErrorhttps://wordpress.org/support/topic/fatal-error-uncaught-typeerror-37/
-
Fatal error after updatehttps://wordpress.org/support/topic/fatal-error-after-update-139/
-
Broken Pluginhttps://wordpress.org/support/topic/broken-plugin-71/
-
Error fatalhttps://wordpress.org/support/topic/error-fatal-38/
-
Logging in as admin makes home page error 500https://wordpress.org/support/topic/logging-in-as-admin-makes-home-page-error-500/