Troubleshooting Common ElementsKit PHP Errors and Warnings
Content
If you use the ElementsKit Elementor addon, you might occasionally encounter PHP errors, warnings, or notices. These can range from simple deprecation messages that appear in debug logs to fatal errors that crash your site. This guide will help you understand the most common issues and how to resolve them.
Common ElementsKit Errors and Their Causes
Based on community reports, here are some frequent problems:
- Fatal Error: Cannot declare class... because the name is already in use: This often occurs due to a plugin conflict, especially if another plugin or theme uses a class with the same name. It was a known issue in older versions of ElementsKit but has been reportedly fixed in newer releases (e.g., version 3.4.2).
- PHP Warnings: Undefined index (e.g., margin_tablet, margin_mobile): This warning often points to a compatibility issue between ElementsKit and a specific Elementor version. The error message originates from Elementor's core files but can be triggered by ElementsKit's One Page Scroll module.
- Deprecated function warnings (e.g., get_page_by_title): As WordPress evolves, it deprecates old functions. The ElementsKit team has historically addressed these by releasing patches that replace deprecated functions with modern equivalents.
- PHP Notices in error logs (e.g., undefined array key, attempt to read property on string): These are often non-critical notices that appear when debug mode is enabled. They indicate places in the code where variables are being used before their existence is checked, but they may not affect front-end functionality.
General Troubleshooting Steps
Before diving into specific fixes, always follow these foundational steps:
- Update Everything: Ensure WordPress, your theme, Elementor, and ElementsKit are all updated to their latest versions. Many conflicts are resolved in updates.
- Clear All Caches: Clear your browser cache, any WordPress caching plugins, server-level cache (e.g., Varnish), and CDN caches (e.g., Cloudflare).
- Conflict Test: The most reliable way to identify a conflict is to:
- Switch your theme to a default WordPress theme like Twenty Twenty-Four or Hello Elementor.
- Deactivate all plugins except for Elementor and ElementsKit.
- If the error disappears, reactivate your plugins one-by-one to identify the culprit.
- If the error remains, it is likely a conflict between Elementor and ElementsKit.
Solutions for Specific Errors
For "Undefined index" Warnings (margin_tablet, padding_mobile, etc.)
This is a common compatibility warning. A workaround suggested by the ElementsKit team is to disable the module that often triggers it.
- Go to WordPress Dashboard > ElementsKit > Modules.
- Find the "One Page Scroll" module.
- If you are not using it, disable it and check if the warnings stop.
For "Cannot declare class" Fatal Errors
- First, update ElementsKit to the very latest version. This specific error was addressed in an update.
- If updating is not possible or the error persists, perform a conflict test as described above. The conflict is often with another plugin or the theme.
For Deprecation Warnings
These warnings are common when using older PHP versions or when plugins need to catch up to WordPress core changes. While they don't usually break your site, they clutter logs.
- Check the ElementsKit changelog or support forums to see if a fix has been released.
- If a fixed version is available, update the plugin.
- If no fix is available yet, you can suppress deprecation notices by ensuring
WP_DEBUG_DISPLAYis set tofalsein yourwp-config.phpfile, though this does not fix the underlying cause.
When to Seek Further Help
If the steps above do not resolve your issue, the problem might be more specific to your setup. When seeking help in community forums, be prepared to provide:
- The exact and complete error message from your logs.
- Your System Info from Elementor (Elementor > System Info).
- The steps you took to reproduce the error.
- The steps you have already taken to try to resolve it (e.g., conflict test results).
Most issues can be resolved through careful troubleshooting, keeping software updated, and temporarily disabling conflicting plugins or modules.
Related Support Threads Support
-
Fatal error on last version (+ how to fix it)https://wordpress.org/support/topic/fatal-error-on-last-error-how-to-fix-it/
-
Conflict with GeoDirectory Google Analytics addonhttps://wordpress.org/support/topic/conflict-with-geodirectory-google-analytics-addon/
-
Critical Errorhttps://wordpress.org/support/topic/critical-error-649/
-
[issue with the plugin]https://wordpress.org/support/topic/issue-with-the-plugin-14/
-
Notices on lottie widgethttps://wordpress.org/support/topic/notices-on-lottie-widget/
-
These strings use the esc_html() function and are not translatedhttps://wordpress.org/support/topic/these-strings-use-the-esc_html-function-and-are-not-translated-13/
-
Fatal Errorhttps://wordpress.org/support/topic/fatal-error-4801/
-
Issue with wordpress 6.2 using deprecated function get_page_by_titlehttps://wordpress.org/support/topic/issue-with-wordpress-6-2-using-deprecated-function-get_page_by_title/
-
Please fix warningshttps://wordpress.org/support/topic/please-fix-warnings/
-
does not have a method ‘register_sub_menus’https://wordpress.org/support/topic/does-not-have-a-method-register_sub_menus/
-
Crash in latest version: Undefined constant ElementorControls_Manager::NOTICEhttps://wordpress.org/support/topic/crash-in-latest-version-undefined-constant-elementorcontrols_managernotice/
-
error section-controls.phphttps://wordpress.org/support/topic/error-section-controls-php/
-
Problem in back endhttps://wordpress.org/support/topic/problem-in-back-end/
-
Disable the annoying admin Panel/dashboard noticehttps://wordpress.org/support/topic/disable-the-annoying-admin-panel-dashboard-notice/
-
php error in wp-adminhttps://wordpress.org/support/topic/php-error-in-wp-admin-2/
-
New errors in debug.log since updatehttps://wordpress.org/support/topic/new-errors-in-debug-log-since-update/
-
php warning after update from 3.2.0 to v 3.2.1https://wordpress.org/support/topic/php-warning-after-update-from-3-2-0-to-v-3-2-1/
-
Fatal Error after updating to latest versionhttps://wordpress.org/support/topic/fatal-error-after-updating-to-latest-version-3/
-
PHP Notice: register_rest_route was calledhttps://wordpress.org/support/topic/php-notice-register_rest_route-was-called/
-
Critical Error on my Sitehttps://wordpress.org/support/topic/critical-error-on-my-site/
-
Fatal errorhttps://wordpress.org/support/topic/fatal-error-3716/
-
PHP warning from page-list widgethttps://wordpress.org/support/topic/php-warning-from-page-list-widget/
-
Deprecated warning in debug modehttps://wordpress.org/support/topic/deprecated-warning-in-debug-mode/
-
Fatal Errorhttps://wordpress.org/support/topic/fatal-error-4821/
-
Elementor Conflicthttps://wordpress.org/support/topic/elementor-conflict-37/
-
Brokenhttps://wordpress.org/support/topic/broken-708/
-
Apache Error logs warninghttps://wordpress.org/support/topic/apache-error-logs-warning/
-
Error using ClientLogo widgethttps://wordpress.org/support/topic/error-using-clientlogo-widget/
-
PHP Notice: Undefined index: margin_tablethttps://wordpress.org/support/topic/php-notice-undefined-index-margin_tablet-2/
-
PHP Notice: Undefined index: margin_tablethttps://wordpress.org/support/topic/php-notice-undefined-index-margin_tablet/
-
UPDATE3.4.0 Fatal error: Cannot declare classhttps://wordpress.org/support/topic/update3-4-0-fatal-error-cannot-declare-class/