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: Custom Work, Performance
This topic contains 8 replies, has 2 voices.
Last updated by Christopher Amirian 3 months, 1 week ago.
Assisted by: Christopher Amirian.
Author | Posts |
---|---|
July 28, 2024 at 10:55 am #16011932 | |
witoldW |
Background of the issue: Upon further inspection, it turned out that nearly all of the posts are of type attachment, that they come from WPML duplicating records for translating media metadata and that while turning WPML on and off several times (including the support tickets here) last year, when I was setting it up initially, I duplicated media meta several times, which turned into this exponential cascade of db records. Steps I've already taken: You might ask, why 3 and not 1 in the regex. Here lies the current problem I need help with. This cleaned up 400 out of 440k of my wp_posts and most of wp_postmeta. My website performance is mostly fixed, but the cleanup is not complete yet. Link to a page where the issue can be seen: hidden link Symptoms: Actual behavior: The translated products now have a broken link to the media file, whose corresponding wp_post doesn't exist. Moreover, deleting the _thumbnail_id meta from the translated product still doesn't help - what happens instead is that the default woocommerce product placeholder image gets shown. Questions: Please advise on the best course of action. Best Regards, |
July 28, 2024 at 11:02 am #16011938 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Please set the next reply as private to provide the login information of the website copy that has the performance issue before the usage of queries on the database. I also need permission that we might be able to copy that to our server for further investigation or do changes on the current copy that might break the website so, we need a copy of the website that we can freely work on. Thanks. |
July 29, 2024 at 4:21 pm #16017228 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Thank you for the login information. The Database amount is huge and I am stuck in the process of copying it to report. But I am working on this and will get back to you as soon as I find a way |
July 29, 2024 at 4:27 pm #16017254 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
For now I asked some basic questions from the second tier to see if they can provide some general solutions regarding the duplicate entries that I can apply on the current website without copying it. Waiting fro their reply.... |
July 30, 2024 at 3:50 pm #16021356 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Would you please use this plugin to identify the duplicated entries and remove them? https://wordpress.org/plugins/media-deduper/ Thanks. |
July 30, 2024 at 6:46 pm #16022001 | |
witoldW |
I've installed and run the plugin on the staging site. It found 200k duplicates, but there is no bulk way to remove them. Also, there should be closer to 400k as mentioned previously. I've said previously I tried media deduplicator. This problem was created by your plugin not cleaning up after itself properly and it should be easy for you to get me the SQL to fix this. This is a very serious issue right now, please treat me seriously. |
August 1, 2024 at 6:14 pm #16031074 | |
witoldW |
Hello, is any progress being made? |
August 2, 2024 at 5:51 pm #16034498 | |
witoldW |
delete post, meta from wp_posts post Thank you. My business would go bankrupt before you fixed it. I leave it here for posterity though as many other people face this problem too. I used post.ID filter bc there are no duplicated posts before this ID. In this way I saved all media files that aren't product images. USE THIS QUERY FOR INSPIRATION, BUT MAKE SURE YOU UNDERSTAND WHAT YOU'RE DOING FIRST! ALWAYS HAVE A BACKUP! |
August 5, 2024 at 8:19 am #16037936 | |
Christopher Amirian Supporter
Languages: English (English ) Timezone: Asia/Yerevan (GMT+04:00) |
Hi there, Thank you for the solution that you shared. I also need to add that manipulating database with queries need a complete backup of the website before anyone trying such solutions. Thanks. |