This thread is resolved. Here is a description of the problem and solution.
Problem:
The client experienced an issue where 40,000+ duplicate images were created due to a hiccup, and after removing unused media, including media from translations, all media on translated pages went missing. The client is looking for a way to 'recycle' or 'retranslate' the media so that it works on the translated pages as it does on the non-translated pages.
Solution:
We recommend the following steps to address the issue:
1. If you have a backup from before these database changes were made, utilize it to restore the missing entries.
2. If no backup is available, follow these steps:
1. Create a full website backup.<br />2. Complete all translations marked as "update needed" in the Translation Editor by clicking "Complete." This will restore the missing images.<br />3. For pages/products created in secondary languages, manually restore the images in the page editor.
We always advise having a backup before making any changes to prevent such issues.
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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 25 replies, has 4 voices.
Last updated by Lucas Vidal de Andrade 4 months ago.
Assisted by: Lucas Vidal de Andrade.
Author | Posts |
---|---|
July 3, 2024 at 10:20 pm #15887118 | |
Andreas W. Supporter Languages: English (English ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, This is Andreas from the Second Tier Support Team. I have synced your media files today at: The count of media files is not identical inside the media library when changing the language inside the top admin bar. Please do not remove those media entries. They are mandatory for displaying media in other languages. The problem that your site was experiencing was a long known issue that occurred longer time ago (media entries get duplicated once a new language is added). This issues is not yet solved and the data cleanup has to be taken manually: https://wpml.org/errata/all-media-is-duplicated-when-a-new-language-is-added/ I would kindly like to encourage you to reach out to us first in case a similar issue occurs and ask for our support before taking direct action on the database. I was able to confirm that on products that are currently missing images it is sufficient to simply save the product on the WordPress Editor. You also could use the WooCommerce Bulk Edit option for this purpose but for some reason, your site is showing host errors once I am trying to edit more than 20 products at the same time. I am not sure what is causing those errors but it seems to be a server limitation. You can use a custom snippet to save all existing posts, pages, and products. Add this snippet to the end of the functions.php file of your theme: // Add a function to the admin_init hook add_action( 'admin_init', 'save_all_posts_on_refresh' ); // Define the function to save all posts on refresh function save_all_posts_on_refresh() { // Check if the current page is the posts page global $pagenow; if ( $pagenow == 'edit.php' ) { // Get all the posts $args = array( 'post_type' => array('page', 'post', 'product'), 'numberposts' => -1 ); $all_posts = get_posts( $args ); // Loop through all the posts and update them foreach ( $all_posts as $single_post ) { wp_update_post( $single_post ); } } } Now, go to Posts > All posts. Finally, remove the snippet from the functions.php file. This should have saved all posts, pages, and products and recreated the missing image translations. Let me know if you need my assistance with this task, but I recommend that you provide us FTP access first for this purpose. The private reply form is enabled again. Also, take note that you can only automatically translate content that was created in site's default language. For example, some of your products might currently not show images, as you did not create the original products in the site's default language and those original images have been removed from the server. You will need to upload the images again to the original products. You can see more details about this at WooCommerce > WooCommerce Multilingual & Multi-Currency. See the screenshot of the original products' missing images. If you take a close look you will realize that there are many products that were not created in the site's default language and as you removed the images in this language from the database you actually did not remove translation, you instead removed the original images. Apart from that I also can see products created in site default languages that are missing images. The translations can only work as expected if the original contents do have the images. Please review your site and revise if we can spot further issues in regard to the translations that need our attention and we will be glad to assist you on this matter. We would appreciate it if you could provide exact examples in this case. Best regards |
July 5, 2024 at 8:26 pm #15900155 | |
tannerT |
Your provided function crashed my server & created 14 pages, of pages, with (no title). Yes, I implemented correctly (we are a corporate level dev team). I rewrote your script to include batch processing, logging, percentage tracking, propert updating, and designation to a custom url vs. running for any admin who might hit this page. A full list of improvements can be found below: - Custom URL Trigger: Custom URL [/save-posts/] to trigger script. That code can be found here: // Register custom URL endpoint // Add query variable to catch the custom URL // Hook the function to template_redirect // Check if custom URL is accessed // Function to save posts // Get the last processed post ID from options table // Get the maximum post ID to calculate percentage complete // Get the next set of posts to process // Open the log file in append mode // Check if there are posts to update // Determine the type of post // Calculate the percentage complete // Close the log file ACTION LOG: The complete log can be found here (note logging implementations changed up top until I decided percentage based was the best manner): hidden link. Completion is identified by this message when accessing [/save-posts]: CONGRATULATIONS: All posts/products/pages have been updated. 2.) I ran some tests by: a.) Changing Admin Panel Default Language to es-us while inside of the edit admin of several products (I cannot change language on the frontend because of the another issue being experienced in an additional ticket that is getting nowhere if you want to take a look at that. It is my only other issue): hidden link So the links changed to: hidden link I then opened those pages in a new window: I GET 404 PAGE NOT FOUND FOR THESE PRODUCTS. SO LIKELY RELATIVE TO THE OTHER TICKET. b.) Testing a different manner. I started by accessing es.ellasbubbles.com. I tested the products and pages that do seem to not be affected by the issue in another ticket: - All of the links in the footer take me outside of es.ellasbubbles.com (so can't test this either. not sure if this is relative to the other ticket, dropping a comment there as well). What a mess - Most pages seem to have "some" restored, with exception to a few [Note their page ID's are listed in the update log]: hidden link Please do conduct a thorough evaluation on your end. Awaiting your comments, resolutions, and if FTP is needed enable the secure form |
July 5, 2024 at 8:34 pm #15900165 | |
tannerT |
Please note that the images on my United States English Products: hidden link Are showing in Spanish This is CRITICAL to SEO, and must resolved immediately. Let me know what your team needs to implement permanent solutions; and feel free to escalate this as high as required. Clearly, we are suffering from WPML issues for over a year that have never been addressed properly and are now placing adamant attention pressing for an affirmative resolution |
July 10, 2024 at 1:30 pm #15928261 | |
Lucas Vidal de Andrade Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hey there, I want to give you feedback, that we're analyzing your issue internally, as you may already know. I know this is taking time, but it's an usual situation that needs a greater attention from us. I'm speaking directly to Andreas about the code you sent and the specifics of the issue you're facing. We'll give you feedback as soon as we can. I appreciate your patience and cooperation. |
July 10, 2024 at 5:31 pm #15929488 | |
Lucas Vidal de Andrade Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hello, I reviewed the examples you sent. Some of them had an “update needed” status. In those cases, updating the translations resolved the issue. I did this for the following page: hidden link. To resolve these issues, please follow these steps: For pages/products created in secondary languages, you’ll need to manually restore the images in the page editor. We've already completed all pending translations for the original US-en products. Please note that in WooCommerce > WooCommerce Multilingual and Multicurrency > Products, you'll be able to which products were created in each language (check attached image on Andreas' previous reply). You'll also note that there are many French Products that have missing images (due to the same reason as pages created in secondary languages). Following these steps will solve the problem. If you have any issues or questions about specific translations, please let us know so we can assist you. We understand this might not be your preferred solution, but it’s the quickest and most effective way to resolve the problem. Your cooperation is greatly appreciated. For the English page with Spanish images: hidden link, I checked the source code for both gallery and on-page images, and they have their meta-information in English, as expected. If I’m missing something, please send me a screenshot of the exact error. If necessary, we can create a separate ticket for it. Thank you and best regards, |
July 11, 2024 at 1:37 pm #15935427 | |
tannerT |
Hi Lucas, diving right in: 1.) I can confirm that this NO CONTENT was created in the french Canadian language individually, and all originated from .com. This sounds like it may be another issue in itself (I originally had a ticket to retranslate the site from scratch and start over due to all of this misconfiguration and evident issues with previous versions of your plugin). Anyway, we expect all of these product and all of these pages to be properly identified as translated versions of their original .com page. I am 110% confident (as the CMO of Ella's Bubbles) that no individualized content was drafted for French Canada, and 110% of the content is a direct translation of .com 2.) From which page am I clicking "Update Needed"? The Translation Editor Accesible via pages? Are you intending that I take this action for over 600 pages? Please be more elaborate in your suggestions and replies for actions that are needed to be taken. You mention "We've already completed all pending translations for the original US-en products." What about Pages as well? Please feel free to proceed with resolutions instead; we are simply looking for resolutions to issues that are incurred from your plugin; and do not care to learn troubleshooting for issues that should not have otherwise occured. A query to "bulk complete updating" is preferred. No Credits Should be spent in this process 3.) There is no update from Itamar at this time. Right now we have the issues of: a.] Itamar Ticket Shall I open a third and in depth ticket regarding c? As it seems that we are going to be inside of a downward spiral of discovering more and more problems and inevitably take 10-20+ hours of support time (likely more, feel free to look at our number of tickets) until this issue is resolved. As mentioned, we are more than willing to "wipe out WPML" and restart at no expense to us. Or, if you prefer to continue to try to fix (and identifying more problems like the French Canada) along the way, I will continuously spiral into unlimited ticket creation that reaches your Second-Tier support and press this matter as absolutely hard as we need to for immediate resolutions. As you can tell, we are tired of the issues imposed by your plugin, as well as the "open ended support in the past"; and have assigned a designated representative from our company who will be taking as many hours as absolutely possible until this plugin is 110% prestine on our website. The ball is back in your court, |
July 11, 2024 at 1:43 pm #15935568 | |
tannerT |
4.) Your original code created hundreds of OEM Responses here shown at: hidden link I will also await a resolution to this additionally imposed problem (To clarify, that resolution will be to remove them, in bulk, preferably without any additional labor required on our end) |
July 12, 2024 at 8:04 pm #15944373 | |
Bobby Supporter
Languages: English (English ) Timezone: America/Los_Angeles (GMT-08:00) |
Hi there, I have reviewed your previous support threads and cannot locate a specific ticket where our team recommended deleting database entries. If you have a copy of this recommendation, please share it with me. It is also important to note that whenever a major change is made, especially on the database, there should always be a backup available to use in case something goes wrong. Do you have a backup from before these database changes were made? If yes, I recommend utilizing it, as there is no possible way of recovering these entries otherwise. Here is the suggested workaround (we have tested this and it works): 1. Create a full website backup. 2. Complete all translations marked as "update needed" in the Translation Editor by clicking "Complete." This will restore the missing images. 3. For pages/products created in secondary languages, manually restore the images in the page editor. Regarding the issues caused by running the script, the best course of action is to utilize a backup to revert those changes. This is why we always recommend having a backup before making any changes. I understand this is not an ideal situation, but it is the recommended course of action. |
July 15, 2024 at 2:29 pm #15954948 | |
tannerT |
Hi Bobby (the 3rd support representative for this case), I am not sure if my previous questions were blatantly ignored or too confusing to understand; but I am sending them here again in order so they can be answered as I have them. Otherwise, we can consider your support team as violation of TOS: 1.) From which page am I clicking "Update Needed"? The Translation Editor Accesible via pages? Are you intending that I take this action for over 600 pages? Please be more elaborate in your suggestions and replies for actions that are needed to be taken. You mention "We've already completed all pending translations for the original US-en products." What about Pages as well? Please feel free to proceed with resolutions instead; we are simply looking for resolutions to issues that are incurred from your plugin; and do not care to learn troubleshooting for issues that should not have otherwise occured. A query to "bulk complete updating" is preferred. No Credits Should be spent in this process 2.] Shall I open a third and in depth ticket regarding c? As it seems that we are going to be inside of a downward spiral of discovering more and more problems and inevitably take 10-20+ hours of support time (likely more, feel free to look at our number of tickets) until this issue is resolved. As mentioned, we are more than willing to "wipe out WPML" and restart at no expense to us. Or, if you prefer to continue to try to fix (and identifying more problems like the French Canada) along the way, I will continuously spiral into unlimited ticket creation that reaches your Second-Tier support and press this matter as absolutely hard as we need to for immediate resolutions. |
July 15, 2024 at 2:29 pm #15954950 | |
tannerT |
And to properly answer your question (in an effort to demonstrate how that can be done); no; we are not interested to restoring to a backup from 8 months ago |
July 15, 2024 at 2:30 pm #15954955 | |
tannerT |
FEEL FREE TO SIMPLY "RESOLVE THE ISSUE" AND THIS CASE CAN BE CLOSED |
July 15, 2024 at 5:18 pm #15955905 | |
Lucas Vidal de Andrade Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hey there, We are working as a team on this ticket, as it is unusual to us to get this kind of situation - that's why you are receiving replies from more than one supporter. As I said previously, it requires a greater attention from our side. Answering your questions, one by one: You mention "We've already completed all pending translations for the original US-en products." What about Pages as well? we are simply looking for resolutions to issues that are incurred from your plugin; A query to "bulk complete updating" is preferred. No Credits Should be spent in this process Shall I open a third and in depth ticket regarding c? FEEL FREE TO SIMPLY "RESOLVE THE ISSUE" AND THIS CASE CAN BE CLOSED I'm available for any other questions you might have. |
July 17, 2024 at 1:37 pm #15966580 | |
tannerT |
An absolute headache |