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: Bug, Documentation request, Performance
This topic contains 54 replies, has 2 voices.
Last updated by basv-25 1 year, 5 months ago.
Assisted by: Andreas W..
Author | Posts |
---|---|
June 15, 2023 at 10:36 am #13831487 | |
basv-25 |
Thanks Andreas |
June 16, 2023 at 10:16 am #13838471 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, I just want to let you know that I am still testing on localhost with a copy of your database - After some more testing, I could now somehow recreate the issue with my older product on the sandbox. The product was earlier duplicated into language that I removed from the site, the product began to behave oddly after using identical settings as on your site (WCML & WPML Language and Settings) on my sandbox. Sadly I do not see this issue with a new product on the sandbox. At the moment I do still need some more time for testing, and I will be escalating a minimal copy of your site to second-tier support later today and notifying you before I take this step. Best regards |
June 16, 2023 at 10:43 am #13838665 | |
basv-25 |
Hi Andreas, perfect, thank you for all your efforts |
June 17, 2023 at 5:18 am #13843237 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Would it work for you to disable: WPML > Settings > Post and Page Synchronization > Synchronize comments on duplicate content and instead, activate: WooCommerce > WooCommerce Multilingual & Multi-Currency > Settings > Product reviews Please let me know if this is an acceptable workaround. Best regards |
June 17, 2023 at 6:10 am #13843277 | |
basv-25 |
I think that is the best option for us. The problem doesn’t occur then. Still strange that the duplicate reviews doesn’t work on our site but this is a good solution. We’ll go this route Andreas, thanks. Ps does the reviewers country flag also appear all in the same language at your end? I should expect that a review from USA has a US flag and from the Netherlands have a Dutch flag. Instead they get the flag of the current language at my end. |
June 17, 2023 at 5:26 pm #13844111 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, I was sadly not able to see the review section on the Staging on each product page: I only do see them here: hidden link Is this the page you refer to? Usually, if you enabled in WCML that the reviews should be made available in all languages will allow you to translate those reviews with WPML String Translation - this is why there are those flags. Please read this: I have escalated this issue to our second-tier support team and I will be awaiting their feedback. Best regards |
June 17, 2023 at 6:55 pm #13844165 | |
basv-25 |
Hi Andreas, Here a link to the staging area where the reviews appear on a product page: Here you see the review of Gary Dufel added in lots of languages (because these were duplicated in our earlier set-up with duplicated comments). I would expect that each comment has its own flag in the language that the comment is posted. But the flags that you see all are from the current language. If you switch languages via the language switcher the flags also change. In the new setup we're going to delete all these duplicated languages and only keep the original comment. In the case of Gary Dufel which is posted on the en-US page, I would then expect a US flag with his review. And another French review from a French client which is on the fr-fr page I would expect a French flag to show up at that French review. Not the flag of the current selected language of the visitor. Hope we can solve this flag thing and then I would say, case closed 🙂 Thanks so much! |
June 17, 2023 at 7:05 pm #13844189 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, So you mean, that it would be expected, that those duplicated reviews are using different flags? It is somehow expected, as a duplicate is actually not really an independent translation - it is always connected to the original content and gets overwritten once the original content is edited and saved. Now, in fact, WC Reviews in their nature are somehow like Post Comments in WordPress. But what I personally actually would expect in this case, is that reviews are not duplicated because the WPML Settings for duplicating comments is activated - t should only apply for Post Comments - as we have a separate setting for reviews on WCML. I would not like to close yet, as I am waiting for the second-tier support to review the issue and provide feedback. I hope this is fine with you. Best regards |
June 17, 2023 at 7:20 pm #13844197 | |
basv-25 |
Hi Andreas, thanks for your feedback. Let's indeed first wait on the second-tier support. Thanks! |
June 17, 2023 at 7:25 pm #13844199 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, You are very welcome - I will keep you updated as soon I received feedback. Best regards |
June 20, 2023 at 11:08 pm #13863367 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Please take note that the issue has been escalated further to the WCML development team. It appears to me that the WPML Settings Option here is dedicated to post comments, and it seems that usually, reviews should not be affected by that. For now, the second-tier support has provided me with the following snippet which I added to the functions.php file of your child theme and it seems to solve the issue: add_action ('wp_insert_comment', 'test_remove_hooks0', 1, 10); function test_remove_hooks0($var) { global $wp_filter; $comment = get_comment( $var ); $type = get_post_type($comment->comment_post_ID); if ($type == "product") { foreach ( $wp_filter["wp_insert_comment"]->callbacks[100] as $key => $value ) { if ( str_contains( $key, 'duplication_insert_comment' ) ) { remove_action( 'wp_insert_comment', $key, 100 ); } } } return $var; } Could you please run a test on the staging and let me know if you need further assistance? Best regards |
June 21, 2023 at 8:23 am #13865101 | |
basv-25 |
Good morning Andreas, Thank you and the second-tier for the investigation. I'm not sure if I totally understand but if I'm correct than: A) the duplicate comments option is ment only for comments on posts not for woo reviews B) because of a bug, the comments of my reviews we're duplicated as well C) I liked the bug of option B but it didn't function, so I contacted you to make the bug work 🙂 D) In a future release (or with the custom code) the bug is fixed and the function (that doesn't function) to duplicate woo reviews dissapears again E) I now go further with the wcml option to "make woo reviews visible in all languages" and don't have my reviews duplicated Am I right ? Thanks! ps I made a new product with 1 review and duplicated it in all languages with the option "duplicate comments" activated but this gives a critical error on staging. (for me not important because I can leave the duplicate comments option off, because we don't have comments on posts. |
June 21, 2023 at 6:07 pm #13870831 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, I am sorry, but I did not experience this critical error on my test - this means I will need to revise the provided workaround on your staging site, and would like to ask you for some patience on this matter. A) The WordPress Comment Object does be default include any post comment, which also includes WooCommerce Product Reviews - this is why I recommended to our second tier support, that the options might be misleading, as it should be designed for post comments only, not for product reviews and the second tier support confirmed - we will have to wait for feedback from our developers on this matter. B) I will need to do some testing, to see how this actually behaves with normal posts and if the duplicated reviews are expected, but in general we already have the option to display reviews in all languages in WooCommerce Multilingual, which for duplicating the reviews is actually not necessary. C) Same as B) 🙂 D) Same as B) 🙂 E) Yes, you should "make woo reviews visible in all languages" and you could even translate them with WPML String Translation. This is why duplicating the reviews is actually not necessary and this is why we might need to exclude them from the post-comment duplication option in a future update of WCML, but we will need to wait for the devs to decide this. Best regards |
June 22, 2023 at 1:56 am #13872357 | |
Andreas W. Supporter Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, The debug.log on your staging is currently showing the following Deprecated Errors that are related to the plugins: - WooCommerce EU VAT Number This means that those plugins seem not yet to be optimized for the latest version of PHP - usually, those errors should not harm the site. The option "Synchronize comments on duplicate content" is enabled on the Staging and our Workaround is inside the functions.php of the Salient Child Theme. I then created and translated a new product, left a review, and duplicated it into one language, and I did not receive any fatal errors. The review only appears once on the original product and once on the duplicated product, as expected. The debug.log is not showing any issues related to WPML. I can not confirm the fatal error that you are reporting. Please revise the staging and maybe provide me more detailed steps about how to recreate the issue, in case you can still recreate it there. Best regards |
June 22, 2023 at 10:36 am #13875481 | |
basv-25 |
Hi Andreas, I just tried to update the WPML test product and it worked. I then made 10 duplicates and the product crashes again while updating. Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /www/bloomming_194/public/wp-content/plugins/query-monitor/collectors/db_queries.php on line 272 Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 2097160 bytes) in /www/bloomming_194/public/wp-includes/class-wpdb.php on line 2476 I then deactivated: And tried again but with the same result. Thanks, |