Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

Our next available supporter will start replying to tickets in about 9.25 hours from now. Thank you for your understanding.

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

Problem:

It is possible to encounter a problem with WooCommerce Multilingual 4.6.0:

Fatal error: Maximum execution time of 30 seconds exceeded in /…/wp-includes/class-wp-post.php on line 266

Solution:

#1 Please go to \wp-content\plugins\woocommerce-multilingual\classes\media\class-wcml-product-image-filter.php line number 31
#2 Replace this line

remove_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 11, 3 ); 

with

$removed = remove_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 11, 3 );
            if (!$removed) {
                return; 
            }

#1 Please create a full backup of the site before making changes.
#2 We have released a new version of WooCommerce Multilingual (4.6.1). Please update to the latest version before making any changes. Please also update all other WPML Add-Ons.

Update 2019-04-29: If you run a newer version from WooCommerce Multilingual, please note that the affected line changed from number #31 to #45.

100% of people find this useful.

This topic contains 13 replies, has 4 voices.

Last updated by George 7 months, 2 weeks ago.

Assigned support staff: Marcel.

Author Posts
April 18, 2019 at 6:49 am

Michael

I have a strange site behaviour after upgrading to both WC 3.6.1 and WC Multilingual 4.6.0. The default English version of the site works as it should, but every other language product list page is slow and it shows only first 3 products. Turning on the debugging mode shows errors Fatal error: Maximum execution time of 30 seconds exceeded in /…/wp-includes/class-wp-post.php on line 266 (paths and lines are always different). Going back to 4.4.2.1 solves the issue. Going back to 4.5.0 does not solve the issue. Ready to provide all the needed access to debug.

April 18, 2019 at 7:21 am #3636751

Michael

Update: it seems that deactivating Aelia Currency Switcher for WooCommerce solves the issue. I've contacted the plugin developer also. Not sure either something needs to be fixed on WC Multilingual or Aelia side so I would keep this open for now.

April 18, 2019 at 7:50 am #3636929

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

Thank you for contacting WPML Support.

This message means that you need to increase your PHP max_time_limit, but you had already a value of 600 which is enough on most hosting environments.

The plugin "Aelia Currency Switcher" is not in our compatibility list, so it didn't get tested yet. I would recommend you to invite the author to our GoGlobal program (https://wpml.org/documentation/theme-compatibility/go-global-program/) then we will help him make his plugin WPML compatible.

We also have a Currency Switcher function included, if this works for you: https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/

So let's wait for an answer from the author, then we can start a PHP Debugging if needed.
If you need anything else about this topic, don't hesitate to contact me.

Best
Marcel

April 18, 2019 at 10:41 am #3638397

Michael

Here's a reply from Aelia's developer:

Our Currency Switcher is already compatible with WPML and WCML, they have been working together smoothly for years. We haven't submitted our solution to their GoGlobal testing program, but I know for a fact that they are compatible with the WPML tools.

It looks like the last update to that plugin introduced that issue, they should be able to figure out what has changed, and why there is now an infinite loop that causes the timeout.

From our side, we didn't change anything that could cause that error. We don't test the Currency Switcher with WCML specifically, but it worked fine with it so far. Our solution doesn't interfere with the translation logic, and is not aware of "secondary languages". It works the same way in all cases.

From a technical perspective, most likely WCML is making a call that triggers the Currency Switcher logic. The Currency Switcher then makes a call that triggers something in WCML 4.5.0 or later, and this triggers another call in the Currency Switcher, causing an infinite loop.
We came across a similar issue in another plugin, and the root cause was that such plugin was calling functions like WC_Product::get_price(), WC_Product::get_regular_price() and WC_Product::get_sale_price(), without taking into account the argument passed to the function. The Currency Switcher can call WC_Product::get_regular_price('edit'), which means "return regular price, without calling any filters". If the call is intercepted by another plugin (e.g. WCML) and replaced with WC_Product::get_regular_price(), i.e. without the "edit" argument, that triggers the CS filters, which call WC_Product::get_regular_price('edit') again, ending up in an infinite loop.

This might not be the exact issue with WCML, but it could be a good starting point for an investigation.

April 18, 2019 at 4:57 pm #3640921

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

Thank you. I will discuss this tomorrow with our 2nd Tier and will reply you ASAP as I know more.

Best Marcel

April 22, 2019 at 8:37 am #3654609

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

As we have our own currency switcher inclusive, is there a particular reason why you want to use the one from Aelia? Otherwise using two products with the same functionality which are not tested for compatibility will be difficult.

Please let me know
Best Marcel

April 22, 2019 at 8:46 am #3654625

Michael

Hi Marcel,

We've used WCML Currency Switcher for a while, however, there were certain functional limitations that Aelia was able to solve. Unfortunately, it's not an option for us to revert now. And everything worked perfect for more than a year until 4.5.0 was released.

April 23, 2019 at 7:14 am #3660067

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

could you please tell me which function you are missing in our Currency Switcher?

Thanks
Best Marcel

April 23, 2019 at 7:35 am #3660133

Michael

Dear Marcel, I don't remember the exact reason now as it's been more than a year, but this switch was necessary. With all due respect, I think it's not the point of this topic. Something changed since 4.5.0 which causes this trouble.

I see lots of people have similar problems with this update causing troubles to second languages and it's not Aelia plugin they have issues with:

https://wpml.org/es/forums/topic/compatibility-with-woocommerce-version-3-6-0/
https://wpml.org/forums/topic/if-i-update-plugin-to-version-4-6-0-product-page-loading-time-extremly-slow/
https://wpml.org/forums/topic/after-the-last-update-only-the-default-language-works/
https://wpml.org/forums/topic/secondary-language-product-categories-stop-responding-with-wc-3-6-1-wcml-4-6-0/

April 24, 2019 at 10:56 am #3671831

rafydA

I have the same problem. I even deleted the AELIA Currency Switcher plugin just to test, and still could not make it work. (I deleted the plugin after the site got unaccessable)

So here is my scenario:
I have Woocommerce Multilingual 4.4.2.1 installed. IT WORKS
When I update to 4.6.1, IT BREAKS! I get the max execution timeout, even if I have it to 120 sec.
The site becomes unaccessable. So for now, no upgrade for me.

April 24, 2019 at 4:41 pm #3675281

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

Sorry, I tried to find out which functionality you need from the currency switcher to check if we may have a workaround for your use case.

Could you please try the following:

#1 Please go to \wp-content\plugins\woocommerce-multilingual\classes\media\class-wcml-product-image-filter.php line number 31
#2 Replace this line

remove_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 11, 3 ); 

with

$removed = remove_filter( 'get_post_metadata', array( $this, 'localize_image_id' ), 11, 3 );
            if (!$removed) {
                return; 
            }

#1 Please create a full backup of the site before making changes.
#2 We have released a new version of WooCommerce Multilingual (4.6.1). Please update to the latest version before making any changes. Please update also all other WPML Add-Ons.

@rafyda Could you please create a new ticket, then we will check your site also. Thank you!

Thanks
Best Marcel

April 25, 2019 at 10:32 am #3681191

Michael

Hi Marcel,

I can confirm that this code for class-wcml-product-image-filter.php fixes the issue. Thank you.

Will it be included in next WCML versions?

April 25, 2019 at 12:23 pm #3682285

Marcel
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Madrid (GMT+01:00)

Hi Michael,

perfect! Thanks for letting me know. Yes, we will include this in the next WCML version.

@rafyda Please check our workaround before you open a ticket, as it could already solve your issue as well.

I wish you both a nice day!

Kind Regards
Marcel

April 26, 2019 at 4:18 pm #3692239

George

I had the same problem and Marcel's suggestion solved it.

Thanks!