Skip to content Skip to sidebar

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.

This topic contains 24 replies, has 0 voices.

Last updated by Kor 1 day, 23 hours ago.

Assisted by: Kor.

Author Posts
September 12, 2025 at 12:05 pm #17397414

raulE-2

Background of the issue:
I am trying to use Additional Variation Images Gallery (GetWooPlugins) with WooCommerce and WPML String Translation active on PHP 8.2 (or higher). On a single product page I expected the main product image and the variation gallery to load normally.
This setup works fine on PHP 7.4 but breaks on higher versions.

Symptoms:
The product page breaks and only shows the header and footer.
In the debug log I see:
<code>Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /wp-includes/shortcodes.php on line 246</code>

The issue only happens when WPML String Translation (3.3.3) is active together with Woo Variation Gallery (1.3.28).
If I deactivate WPML String Translation, the page loads normally.

Questions:
- How can I resolve the deprecated str_contains() error on PHP 8.2?
- Why does this issue only occur when WPML String Translation is active, and not with WooCommerce + Woo Variation Gallery alone?
- Is there a patch or fix available for PHP 8.2 compatibility?

Thanks in advance, have a nice day! 🙂

September 12, 2025 at 12:52 pm #17397664

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

Before moving forward, can you please try the following?

Take a full backup of your site and database before proceeding. It is highly advised to try these on a dev or staging site first, so your live site isn't compromised.

1) Upgrade MySQL to also minimum required version, see https://wpml.org/home/minimum-requirements/ for details.
2) Update WPML plugins to the latest versions, including WPML and String Translation. The String Translation plugin in use is way older.
3) Deactivate all plugins except WPML and String Translation.
4) Switch to a standard theme like 2024 or 2021.
5) Check for the issue if it still happens.
6) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
7) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.

Please let me know your findings and I'll try my best to help you further on the matter.

Regards.

P.S.: I'll be off over the weekend and 'll be able to attend on Monday.

September 14, 2025 at 9:54 pm #17400386

raulE-2

Hi Waqas,

Thanks for the quick reply, I hope you had a nice weekend.

1) The database runs on MariaDB 10.11.10, which is above WPML’s minimum requirement (MariaDB 10.1 / MySQL 5.6).
2) The plugins have been updated:
- WPML Multilingual CMS 4.8.1
- WPML String Translation 3.4.0
- WooCommerce Multilingual & Multicurrency 5.5.2

I have followed the recommended troubleshooting steps:
- Deactivated all plugins except WPML and String Translation
- Switched to a standard theme (Twenty Twenty-Four)
- Re-tested the product page
- Reactivated plugins one by one while checking
- Finally switched back to my theme

Unfortunately, the problem continues to occur between WPML string translation and Additional Variation Images Gallery for WooCommerce. For your information, this happens on PHP 8.0 or higher (no problem on lower versions).

If you need more information, please let me know. Thanks again for your help.

Kind regards,
Raúl

September 15, 2025 at 9:10 am #17401177

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates and taking your time to test all these.

May I request you to reproduce the issue in this sandbox? hidden link (one-click login).

This is a fresh sandbox site with WPML plugins. Please configure WPML as needed, then add the required plugins (i.e. Additional Variation Images Gallery for WooCommerce and/or etc), as well as, the theme (if needed). And then create some sample content to reproduce the issue.

This sandbox is using PHP 8.1.2-1ubuntu2.22 and a different environment. So if the issue is reproducible here then it'll be evident that issue persists out of the box, otherwise, we'll have to look into your setup.

Please note down the steps when you reproduce the problem, so I can then check the same in different setups (i.e. local and etc).

Please let me know when you're ready.

September 18, 2025 at 6:30 pm #17414544

raulE-2

Hi Waqas,

Apologies for the slightly delayed reply and thanks for the sandbox. I'll let you know as soon as I'm ready.

Kind regards,
Raúl

September 19, 2025 at 4:06 am #17415131

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sure, please take your time.

September 22, 2025 at 6:09 pm #17423151

raulE-2

Hi Waqas,

Thank you for your patience. I was able to configure the sandbox site, but ‘unfortunately’ I was unable to reproduce the error.

Would it help if I provide a copy of my site on a separate domain for us to review?

Once again, thanks for the help!

Kind regards,
Raúl

September 22, 2025 at 8:06 pm #17423281

raulE-2

Hi Waqas,

I made a copy of the live site, which made it easier for me to troubleshoot.

At first glance, it seems that I have been able to solve the problem by taking the following steps:
1) WPML -> Settings -> Custom Fields Translation -> (Show system fields):
woo_variation_gallery_images → Copy
woo_variation_gallery_media_video → Copy
woo_variation_gallery_media_video_height → Copy
woo_variation_gallery_media_video_width → Copy
_product_image_gallery → Copy
2) Products -> Republish each product manually, one by one.

I will now try the changes on the live site and let you know as soon as this has been done.

Kind regards,
Raúl

WPML.png
September 22, 2025 at 10:35 pm #17423378

raulE-2

Hello,

Guess I celebrated a little too soon. The previous steps ended up not helping. I still need your assistance 🙂

The following new observations I made:
- If only 1 product color; the page works
- 2 or more product colors; the page breaks

Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /wp-includes/shortcodes.php on line 246

Thanks in advance.

Kind regards,
Raúl

September 24, 2025 at 5:44 am #17427398

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

The deprecation message is related to something which is causing a conflict, however, since it is just a deprecation message, it shouldn't break the site. Can you try disabling debug output for deprecated notices? Or perhaps try once with debugging not throwing any messages on frontend, but only logging instead, like following:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

And see if it breaks the site or not? If it still does, then definitely there's something else causing the issue.

And for that matter, I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

P.S.: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.

September 30, 2025 at 5:48 am #17442581

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates. I'm working on it and 'll get back to you accordingly.

October 1, 2025 at 6:54 am #17447252

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I deactivated plugins except necessary and updated WPML plugins and WordPress to latest versions and then tried to visit a few products (i.e. hidden link) but can not reproduce the said deprecation error.

I've also installed a debug log manager plugin and can see old logs in hidden link, but there are no new error. The latest error before enabling the log again was at Oct 1, 2025 - 08:44:10.

Can you please recheck and let me know? And if you're able to reproduce the issue, please note down the exact steps so I can retry accordingly.

October 6, 2025 at 5:57 pm #17461718

raulE-2

Hi Waqas,

Thanks for your reply. I took a closer look.

The problem occurs when the following plugins are active:
- Elementor Pro (-> when deactivated no issues)
- WPML String Translation
- Woo Variation Gallery

The problem is only visible on pages where there is more than one product color (for example: hidden link).

Thanks again for your help. Let me know if you need anything from my side.

Kind regards,
Raúl

October 7, 2025 at 5:32 pm #17465075

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I'm Kor, and I will be taking over from here. I've checked your link here hidden link and I'm not seeing any products or errors.

Could you replicate the issue here? hidden link

October 7, 2025 at 10:34 pm #17465502

raulE-2

Hi Kor,

No worries. Thanks for your assistance.

I checked, for the link hidden link I see the following error message:
1 PHP Deprecated str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated
WordPress core
File: /wp-admin/shortcodes.php
Line: 246
-> Page breaks (screenshots attached)

Another example where the page breaks: hidden link

I also tried to reproduce the error on hidden link by doing the following steps:
- Edit product "Femme 2025 NYC Specter 2"
- Product data -> Attributes -> 'Couleur' (= Color) -> Add a new value/color -> Save attributes
- Product data -> Variations -> Add manually -> *add random variations with the new color and fill in data as images, price etc* -> Save changes
-> However, I wasn't able to reproduce the error; the page loads correctly.

Please let me know if there is anything I can do from my side.

Kind regards,
Raúl

Broken page.png
Error log.png