Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client reported multiple PHP deprecation notices related to WPML after updating to PHP 8.2. These include deprecated property creation for WPML_LS_Menu_Item.
Solution:
We informed the client that these issues are already addressed in the upcoming WPML version 4.7, which is in the final QA stage. Meanwhile, we recommended a workaround involving a site backup and following the steps provided in a related support ticket: https://wpml.org/forums/topic/deprecated-errors-with-php-8-2/#post-15994511.

To prevent these warnings from displaying to site visitors, we advised disabling the debug mode in WordPress by adding

define( 'WP_DEBUG_DISPLAY', false );

to the wp-config.php file. More details on this can be found here: https://wordpress.org/documentation/article/debugging-in-wordpress/.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please open a new support ticket. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Bigul 9 months, 3 weeks ago.

Assisted by: Bigul.

Author Posts
August 14, 2024 at 6:51 am #16068807

guidoV-11

Hi Bigul, i did all the steps and the issue still exists.
Below the response of the WordPress debug.log:

[13-Aug-2024 19:36:38 UTC] PHP Deprecated: File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085
[13-Aug-2024 19:36:38 UTC] PHP Deprecated: File class-smtp.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/SMTP.php instead. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 394
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_ancestor is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 540
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_parent is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 541
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 394
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_ancestor is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 540
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_parent is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 541
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Bestand class-phpmailer.php is sinds versie 5.5.0 verouderd! Gebruik in plaats daarvan wp-includes/PHPMailer/PHPMailer.php. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Bestand class-smtp.php is sinds versie 5.5.0 verouderd! Gebruik in plaats daarvan wp-includes/PHPMailer/SMTP.php. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Bestand class-phpmailer.php is sinds versie 5.5.0 verouderd! Gebruik in plaats daarvan wp-includes/PHPMailer/PHPMailer.php. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085
[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Bestand class-smtp.php is sinds versie 5.5.0 verouderd! Gebruik in plaats daarvan wp-includes/PHPMailer/SMTP.php. The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailerPHPMailer namespace. in /data/sites/web/gvrrocks/www/wp-includes/functions.php on line 6085

Bye Guido

August 14, 2024 at 7:12 am #16068927

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Guido,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

The following notices are already fixed in the upcoming version of WPML(4.7). It is currently in the final QA stage.

[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 394

[13-Aug-2024 19:36:39 UTC] PHP Deprecated: Creation of dynamic property WPML_LS_Menu_Item::$current_item_ancestor is deprecated in /data/sites/web/gvrrocks/www/wp-includes/nav-menu-template.php on line 540

So please try the workaround suggested in the following ticket after a site backup for the time being.

https://wpml.org/forums/topic/deprecated-errors-with-php-8-2/#post-15994511

--
Thanks!

Bigul

August 14, 2024 at 10:41 am #16069786

guidoV-11

Hi Bigul, i see I'm on php 8.2.22 and WPML is on version 4.6.12.. Maybe I'll wait until WPML 4.7?

Bye Guido

August 14, 2024 at 4:14 pm #16071772

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. Yes, it happens with a conclift with PHP 8.2.* versions. But it will not cause any issues in the functionality of the plugin, just an alert. So kindly wait for the WPML 4.7 release. We will update you once it is ready.

Therefore to prevent unwanted warnings and errors from being displayed to your visitors, it's best to disable debug mode in WordPress. This is a recommended practice to ensure a smoother user experience. To do so, edit your wp-config.php file and add or modify the following line:

define( 'WP_DEBUG_DISPLAY', false );

Refer to this article for more details - https://wordpress.org/documentation/article/debugging-in-wordpress/

--
Thanks!

Bigul

August 18, 2024 at 1:59 pm #16081418

guidoV-11

Sorry for my late response! Thank you!