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 |
---|---|---|---|---|---|---|
10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | - | - |
16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | - | - |
Supporter timezone: Asia/Jerusalem (GMT+03:00)
Tagged: Performance
This topic contains 19 replies, has 4 voices.
Last updated by Itamar 2 years, 2 months ago.
Assisted by: Itamar.
Author | Posts |
---|---|
May 28, 2023 at 5:37 am #13726805 | |
igorN-12 |
I have a store with ~4k woocommerce products, ukrainian and russian languages. Page before starting loading it can take up to 20s and sometimes ends in 503 error. When I disable wpml plugin then it loads fast, without 503 or any other problems. I have wp rocket pro, without it Initial response from server was 15s, now 4s. But I assume google pagespeed tracks only when page starts loading, and my pages starts loading after 10-20s. I also used wmpl troubleshooting page, it didn't help. |
May 30, 2023 at 7:55 am #13736729 | |
Alejandro WPML Supporter since 02/2018
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+02:00) |
1) Query Monitor should never remain enabled because they will basically double the slowness of the site. however can you see slow queries in it? if so, can you please copy the list and send it to us? 2) Please follow the instructions mentioned on this page: https://wpml.org/documentation/support/debugging-wpml/ Try to visit the site where it's slow once you have added those lines to your wp-config.php file and then go to your installation's wp-content folder and find the "debug.log" file that should've appeared by now (it will appear if it enocunters an error in your server). Then, upload that file into a storage platform of your choosing (Google Drive, Dropbox, etc) and send me the link (make sure it's set as "public" otherwise i won't be able to access its content) so i can download it and take a look at it, and determine where to go from there. this second step will help us understand if there are constant errors appearing on your site, which can also cause slowness and overall performance issues. Let us know how it goes. |
May 30, 2023 at 9:37 am #13737623 | |
igorN-12 |
Here is doc with slow requests by query monitor for one page. It is max what I have seen (38). But even when it shows 4-5 slow request time before page starts loading may take 10s: hidden link debug.log has only one line: |
May 31, 2023 at 4:20 am #13743097 | |
igorN-12 |
Updated debug.log: Also I disabled Query monitor, but as I know it impacts only for logged-in users, and my website struggles for everyone. And today I see, I got too often 503, I am also not able to use wp all import. |
June 1, 2023 at 4:54 pm #13756775 | |
Ahmed Mohammed Supporter Timezone: Africa/Cairo (GMT+03:00) |
Hi Igor, We sincerely apologize for the delay in getting back to you. Our support team is currently experiencing a high volume of requests. Thank you for providing the debug.log content. It has many fatal errors: From the theme: PHP Fatal error: Uncaught Error: Call to a member function get_cart_subtotal() on null in /home/fixmanua/public_html/wp-content/themes/woodstock-child/header-centered.php:165 From cyr2lat plugin: PHP Fatal error: Uncaught Error: Class 'Cyr_To_Lat\Symfony\Polyfill\Mbstring\Mbstring' not found in /home/fixmanua/public_html/wp-content/plugins/cyr2lat/src/php/class-conversion-tables.php:698 From WP Rocket: PHP Fatal error: Uncaught Error: Call to a member function withArgument() on null in /home/fixmanua/public_html/wp-content/plugins/wp-rocket/inc/Engine/HealthCheck/ServiceProvider.php:37 From WPML: PHP Fatal error: Uncaught Error: Class 'WPML_Custom_Fields_Post_Meta_Info' not found in /home/fixmanua/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/custom-field-translation/class-wpml-custom-fields-post-meta-info-factory.php:10 When we look at the slow queries you shared, the slowest one is taking 0.09 seconds and there are around 38 of them. So they should not take that much time to cause that slowness and the 503 error. Yet, PHP errors would definitely cause such issues. I noticed that you updated the debug.log file. Please let us know the steps you took to generate those errors. Also, I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private, meaning only you and I can see and access it. Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved, I will delete the local site. Let me know if this is ok with you. IMPORTANT - Please backup site files and database before providing us access. The private box looks like this: Looking forward to hearing back from you. |
June 2, 2023 at 12:18 pm #13761491 | |
Ahmed Mohammed Supporter Timezone: Africa/Cairo (GMT+03:00) |
Hi Igor, Thank you for providing the login credentials. My findings so far: 1. There was an error PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:47960 the database contains post_product while this function was called with post_product_variation That I fixed according to the following errata page: https://wpml.org/errata/fatal-error-invalidargumentexception-element_id-and-type-do-not-match/ 2. WPML troubleshooting options have noticeably improved performance, as shown in the attached screenshots. 3. I have found duplicate database queries on all admin pages called by "WPML_Installation->refresh_active_lang_cache()". I have forwarded the matter of the duplicated queries to our second-tier support team and will inform you as soon as I receive an update from them. |
June 2, 2023 at 12:48 pm #13761735 | |
igorN-12 |
Thanks. I am cleaning database, there were 1milliton rows in postmeta, now 250k, but speed the same, also I deleted 18000 orders. Now I want make some attributes not traslatable, if I uncheck this box, rows from icl_translate table automatically removed ? I have ~1900 terms in this taxonomy attribute. |
June 2, 2023 at 2:32 pm #13762137 | |
Ahmed Mohammed Supporter Timezone: Africa/Cairo (GMT+03:00) |
Hi Igor, When you set the attributes not to be translatable, the variations will not show in the translated products. It's recommended to keep them set to translatable. |
June 3, 2023 at 4:07 am #13763811 | |
igorN-12 |
Hi, thanks for support, but seems nothing changed. I tried update only prices for products and got 503. And walking through website sometimes leads to 503 also. |
June 5, 2023 at 9:21 am #13768401 | |
Ahmed Mohammed Supporter Timezone: Africa/Cairo (GMT+03:00) |
Hi Igor,
Could you please provide me with some examples of the affected products? The screenshot you shared is from WP All Import plugin. Does the issue happen while importing the same file with WPML plugins deactivated? If yes, please provide me with that file, and we'll check what is happening. Looking forward to hearing back from you. |
June 5, 2023 at 3:46 pm #13772981 | |
Ahmed Mohammed Supporter Timezone: Africa/Cairo (GMT+03:00) |
Hi Igor, Regarding the duplicated queries issues I found earlier
It turned out that the issue was happening for me because I set the profile language to English, while English isn't among the active languages list on the website. The issue has been escalated to our developers, but you should not have the issue because, as far as I see, you're not using English as your profile language. I'm still waiting for the information requested in my previous reply:
|
June 6, 2023 at 3:24 am #13774917 | |
igorN-12 |
Hi, I don't want check without wpml, then I would need to restore db. My import is id=41, you can test it, it just simple, saves only 2 custom fields, and then I run code: add_action( 'pmxi_saved_post', 'allmac_wp_import_products', 10, 3 ); function allmac_wp_import_products( $id, $xml, $update ) { $import_id = ( isset( $_GET['id'] ) ? $_GET['id'] : ( isset( $_GET['import_id'] ) ? $_GET['import_id'] : 'new' ) ); if ( $import_id == 41 ) { // import prices. $product_trans_price = get_post_meta( $id, 'product_trans_reg_price', true ); $product_trans_sale_price = get_post_meta( $id, 'product_trans_sale_price', true ); $product_sku = get_post_meta( $id, '_sku', true ); global $wpdb; $post_language_details = apply_filters( 'wpml_post_language_details', null, $id ); if ( $post_language_details['language_code'] === 'uk' ) { $language_code = 'ru'; $query = " SELECT p.ID FROM {$wpdb->posts} AS p INNER JOIN {$wpdb->prefix}icl_translations AS t ON p.ID = t.element_id INNER JOIN {$wpdb->postmeta} AS pm ON p.ID = pm.post_id WHERE p.post_type = 'product' AND p.post_status = 'publish' AND t.language_code = %s AND pm.meta_key = '_sku' AND pm.meta_value = %s "; $prepared_query = $wpdb->prepare( $query, $language_code, $product_sku ); $results = $wpdb->get_row( $prepared_query, ARRAY_A ); if ( ! empty( $results ) ) { $found_product_id = absint( $results['ID'] ); update_post_meta( $found_product_id, '_regular_price', $product_trans_price ); update_post_meta( $found_product_id, '_sale_price', $product_trans_sale_price ); $price = $product_trans_sale_price ? $product_trans_sale_price : $product_trans_price; update_post_meta( $found_product_id, '_price', $price ); // update current lang product (uk). update_post_meta( $id, '_regular_price', $product_trans_price ); update_post_meta( $id, '_sale_price', $product_trans_sale_price ); update_post_meta( $id, '_price', $price ); } } delete_post_meta( $id, 'product_trans_reg_price' ); delete_post_meta( $id, 'product_trans_sale_price' ); return; } } That's because my default language is Ukrainian, but default language for products is russian, my import file is for ukrainian products. |
June 6, 2023 at 11:41 am #13778201 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Ahmed is away, so I'll continue to help you with this issue. I've shared what you wrote with our second-tier supporter, and once I have his reply, I'll update you here. Thank you for your patience. |
June 6, 2023 at 6:39 pm #13781047 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, We want to ask the following, please. You wrote: "I don't want check without wpml, then I would need to restore db." Why do you think that you might need to restore the DB? FYI, if you deactivate WPML, its DB tables stay in the DB. They are not getting removed. So nothing should be lost. We are asking to make this test to determine if WPML is the cause of the problem. If you still get a 503 error while importing the CSV file with WP All Import, that problem is probably not coming from WPML. |
June 8, 2023 at 4:02 am #13789913 | |
igorN-12 |
Hi, thanks. I have started rebuild whole site on test site, and it works ok, but I had to make some hacks to avoid registering wpml on test site, and now I got error on plugin page. When I migrate from test site to production site is there way to enter license key, because now I cant find it, it was only on wizard install step. I also then bring wp.options table from production site to test site and it still doesn't work. Where is license key stored or how I can solve this problem? |