Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-08:00)

Tagged: 

This topic contains 12 replies, has 0 voices.

Last updated by Bobby 1 day, 18 hours ago.

Assisted by: Bobby.

Author Posts
December 27, 2024 at 8:28 pm #16549271

idreesD

Background of the issue:
I am trying to update my site, including all plugins, themes, and WordPress core, to their latest versions. Additionally, I aim to upgrade the PHP version to 8.3 to ensure compatibility, security, and optimal performance. I wanted to report that the plugin is not fully compatible with PHP 8.3. Upon running it in a PHP 8.3 environment, the following warning is generated: Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/csi/html/wp-includes/functions.php on line 7329 Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/csi/html/wp-includes/functions.php on line 2189

Symptoms:
The plugin is not fully compatible with PHP 8.3, generating deprecated warnings related to strpos() and str_replace() functions.

Questions:
Is WPML compabitible with php 8.3 version. I am getting below warnings:
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/csi/html/wp-includes/functions.php on line 7329

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/csi/html/wp-includes/functions.php on line 2189

December 27, 2024 at 10:11 pm #16549523

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

Were you able to review my colleague's response regarding these PHP warnings?

https://wpml.org/forums/topic/warnings-after-updating-to-php-8-2/#post-14489421

When I review them they do not look related to WPML, I'd advise testing in a minimal environment to see which plugin or theme is not triggering these.

Note that WordPress itself is only in beta compatibility for PHP 8.3 and many plugins tend to follow the compatibility schedule of WordPress.

December 31, 2024 at 12:15 pm #16555794

idreesD

Hello There,

We have tested of the plugin in a minimal environment with our customized theme and PHP version 8.3. We get the following warning:

Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/csi/html/wp-includes/formatting.php on line 2819

However, upon deactivating the plugin, this warning no longer appears on the dashboard.

Look forward to your response.

January 2, 2025 at 7:04 pm #16559832

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me!

I have created a sandbox for us to further investigate.

Please access the sandbox and upload your theme.

hidden link

As your theme is custom, please do note that it has not been tested by our team as an officially supported theme would and that our support is limited when it comes to custom themes.

Our team has run tests with PHP 8.3 and this warning has not been seen before when using a standard WordPress theme such as twenty25 for example.

January 3, 2025 at 9:49 am #16560676

idreesD

Hello Team,

Thank you for the update. Unfortunately, we cannot share the client’s theme as we are bound by legal agreements. Please let us know if there’s an alternative way to proceed.

January 6, 2025 at 7:15 pm #16567428

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

I understand, no problem!

Is there a possibility to create a staging site from your side with just the theme and WPML activated? Possibly on the same server so the PHP versions are the same.

As we are not aware of any known issues with PHP 8.3 and the warnings mentioned here with just WPML it is highly likely they might be coming from a combination of a custom theme + WPML, this method will allow us to confirm this.

January 7, 2025 at 11:19 am #16569196

idreesD

Hello there,

We can't create a staging environment due to security reasons. But we have deactivated the custom theme and activated the default theme still we are getting this issues:

<b>Deprecated</b>: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/var/www/csi/html/wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-filters.php</b> on line <b>131</b>

Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/csi/html/wp-includes/formatting.php on line 2819

In messages its taking too long time. Can you arrange a call to resolve above issues?

January 7, 2025 at 7:44 pm #16571337

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me!

Unfortunately, we do not have an option for us to arrange a call.

I could possibly re assign your ticket to somebody closer to your timezone as I am located in the Pacific Standard Time (PST) zone.

Also, it's important to note that at this point we need to further investigate this issue, which we cannot do without access to either the live site or a staging site.

Is either one of these options available?

As a workaround since these are warnings and do not pose threat to your site and the way it operates you can you can safely remove these warnings by doing the following

Go in your wp-config.php file and look for define(‘WP_DEBUG’, true);.

Change it to:

define('WP_DEBUG', false);

In case access to the site is possible, i will enable the private field reply.

January 8, 2025 at 7:55 am #16572242

idreesD

Hello,

Due to security constraints, I am unable to create a staging environment. However, I have recorded a video to demonstrate the issue I am facing with WPML. You can view the video at the following link:

hidden link

I noticed that when I deactivate the WPML plugin, the warnings disappear. However, the issues persist even with the default theme activated. As when i deactivated the custom theme the warnings remain same.

Please let me know how we can proceed to resolve this.

Regards,

January 8, 2025 at 8:16 pm #16575245

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the screencast.

Please try the following steps:

1. Test in a minimal environment.

Deactivate all 3rd party plugins and leave only the WPML plugins activated, along with a standard WP theme such as Twenty25.

Does the warning still show?

2. Change the PHP Version to another one available such as 8.2 for example

Let me know your results

3. Go in your wp-config.php file and look for define(‘WP_DEBUG’, true);.

Change it to:

define('WP_DEBUG', false);

Does this help remove the warnings?

January 9, 2025 at 5:55 am #16575965

idreesD

Hello Team,

1. Test in minimal environment :

Please find video below :
hidden link

Yes, issue still shows up.

2. Change the PHP Version to another one available such as 8.2 for example

Same issue reflect on 8.2. But client wants to go to 8.3.

3. Go in your wp-config.php file and look for define(‘WP_DEBUG’, true);.

Change it to:

define('WP_DEBUG', false);

Does this help remove the warnings? =>

No these warnings doesn't remove.

Please let me know the solution.

January 9, 2025 at 3:03 pm #16578619

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

To remove the warnings please add this in the wp-config.php and replace the previously added code.

NOTE: Do not add define('WP_DEBUG', false); and define('WP_DEBUG_DISPLAY', false); twice as that will trigger an error.

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Another option is to try this workaround provided by our team:
https://wpml.org/forums/topic/deprecated-rtrim-passing-null-to-parameter-1-string-php-8-1-2/#post-13670953

Our developers are aware of this warning and a fix will be introduced in a future version of WPML. At the moment it's most likely going to be included in WPML 4.7 but I cannot provide a specific timeline for this release at the moment.

January 10, 2025 at 12:07 pm #16581954

idreesD

Hello There,

Please check below issue as well:

<b>Deprecated</b>: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/var/www/csi/html/wp-content/plugins/wp-seo-multilingual/classes/class-wpml-wpseo-filters.php</b> on line <b>131</b>

After adding this code as well i can see above warning on widgets:

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Please share solution for above issues as well.