Plugin Contributor
CoolHappy
(@narinder-singh)
Hi,
Thank you for reporting this issue.
The warning you’re seeing: Undefined array key ‘elementor_preview’ is caused by the plugin accessing the elementor_preview value from the URL without properly ensuring the key exists first. In PHP 8+, accessing a non-existent array key triggers a warning, which is why your error logs are filling up with thousands of entries.
To resolve this, please update the following file:
File path:
/connect-polylang-elementor/includes/elementor-assets.php
(around line 57)
Replace this line:
$is_preview = isset( $_GET[‘elementor_preview’] ) && ! empty( sanitize_key( wp_unslash( $_GET[‘elementor_preview’] ) ) );
With the following code:
$preview_val = isset( $_GET[‘elementor_preview’] ) ? sanitize_key( wp_unslash( $_GET[‘elementor_preview’] ) ) : ”; $is_preview = $preview_val !== ”;
This change ensures that $_GET['elementor_preview'] is only accessed when it actually exists, preventing PHP 8 from generating the “Undefined array key” warning. There is no change in functionality — this is strictly a compatibility fix and will stop the excessive log entries.
Please refer to the screenshot here for reference:
https://prnt.sc/HSTOcEUF9HzX
After applying this change, the warnings should stop immediately.
We will include these changes in upcoming updates.
Let us know if you need any assistance.