[SMUSH] Images are not showing since being super-smushed: converted from .png to .jpeg.

I got this solution online from your articles:

To solve this issue, Please select converted JPEG image instead of PNG where image is missing , Or you can re upload PNG . If you want to keep "Convert PNG to JPEG (lossy)" option on, make sure that "Make a copy of my original images " option is also on. So the image missing occurrence will not happen again. Or You can use image after converting from PNG to JPEG.

My issues is that, we have Hundreds of blog entries and going through wach post 1 by 1 and re-uploading the image or converting the path is NOT something we can afford to accomplish.
Please tell me what solution can bring back all of our .png images that we converted to .jpegs?

  • James Morris

    Hello Paul

    I apologize for the delay here. I've pinged our SLS Team to request an update on this issue. Please keep in mind that more complex issues can take a bit to investigate. Also, our SLS Team does have a queue they have to follow as well. Unfortunately, at this time, their queue is a little high. They will be investigating this further as soon as possible.

    Thank you for your patience.

    Best regards,

    James Morris

  • Konstantinos Xenos

    Hi Paul ,

    Let's take a step back please as I'm a bit confused here and I see a lot of other things before even making it possible to debug the issue or help you get around it.

    I see that most of your plugins need updates ( 49 out of 130 ) which is ok not much of a deal but anything could be giving conflicts. I also see that you're using the Query Monitor, which is pretty good if you want to develop or debug / find information but it also adds stress as it needs to catch and show everything that is going on within the installation.

    Part from the above mentioned that might be troubling but not -that- much of big warnings I'm noticing that all of your blog posts ( the ones that I've tried to open to see what pictures might be having issues ) and https://resqme.com/EN/blog are returning a 404 error. Your media library even though there are console errors ( via the query monitor ) seems to be loading everything so I can't be 100% sure what to look for on that side as well for the time being.

    All of these if possible should be resolved so we can work easier finding out solutions to help you out as they might be hiding other underlying problems making it more difficult.

    I also see that in Smush you don't have the "Make a copy of my full size images" option enabled, this means that Smush wouldn't keep any backups of the original files to make a revert back when needed in case of an error, I'm not sure if this option was originally switched on but since I see it off at this point I have to inform you that unfortunately there might not be original images to revert back to on the server at this point.

    If you proceed on making any updates to fix the various issues do keep backups of both database & files first as in some cases even updates might make things not working properly due to other various conflicts.

    Tell me how can I help so we can see this through!

    Regards,
    Konstantinos

  • Paul

    Greetings,

    Thank you for taking the time to reply with such detail, although it is essential to our sanity that we focus on the symptoms causing the issue and NOT, "what-if" solutions that do not solve the problem described.

    Your plugin converted the extensions of all my .png images into .jpgs... Although it FAILED to convert the images paths. This is causing hundreds of images on our site to be missing.

    With all due respect, please do not give us the run-around. We pay a premium for support, and expect the respect that talented developers deserve.

    First, you stated "I see that most of your plugins need updates ( 49 out of 130 )". This is a fact, but does not play a roll in the issue we are facing with your plugin. Please do not pull the attention away from your code. This issues have been caused to many other Wordpress users and your hypothesis that other plugins are causing the issue is not applicable.

    " https://resqme.com/EN/blog are returning a 404 error" - This was caused by our site being temporally being down for a few hours. I apologize for issues this may have caused... Please continue testing your site plugin.

    For the purpose of troubleshooting, please refer to the following page:
    https://resqme.com/EN/contact/
    Here you can see that the contact image is not showing, only a white blank box with the following text underneath:
    "resqme, Inc.
    718 East Mason Street, Santa Barbara, CA 93103, USA"
    This white blank box should be populated with this image:
    https://resqme.com/EN/wp-content/uploads/2016/03/res-about2.png

    The 'res-about.jpg' images was converted from .png into .jpg using your plugin. The file was renamed, but the path on the page remained for the .png.

    This can be confirmed by viewing the converted image here:
    https://resqme.com/EN/wp-content/uploads/2016/03/res-about2.jpg

    So you see, your plugin converted the extensions of all my .png images into .jpgs... Although it FAILED to convert the images paths. This is causing hundreds of images on our site to be missing.

    Manually fixing the paths of all the images is NOT something we can afford. One of your other admins already admitted faulty code and tried to supply an updated plugin that did not change the issue. Once again, your team is well aware of this coding issue, please do not blame other factors on this issue.

    Thank you for your prompt reply to this serious matter, as we are now going into week 2 of this problem and have paid for premium support to avoid this exact situation.

  • Konstantinos Xenos

    Hi again Paul ,

    Unfortunately the WP login details that you had provided us are not working any more ( the FTP is still good ) as I wanted to check how the contact page that you mentioned is set up.

    Could you grant us access again in the admin so we can take a look how the posts are set up? You can do that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question by following this example:

    Subject: "Attn: Konstantinos Xenos"
    
    - Admin login ( if Multisite please provide Super Admin details ):
    Admin Username:
    Admin Password:
    Login URL: 
    
    - Link back to this thread for reference
    - Any other relevant URLs -or- information regarding the issue that was not included in this thread

    Smush will update any URLs are within the content of a post. If your theme or various plugins are writing these URLs in their own meta or equivalent those should be manually updated. For example the image in the Contact page that you pointed me to at least from the front-end doesn't seem to be within the_content().

    I've been going through your blog posts / pages randomly via the front-end to check on missing images but the ones I've found are in posts/pages that also have all the others images showing properly so yet again I can't be sure if only a percentage of them didn't get a URL update, which would be odd to happen on only some of the images within a post.

    As for the code that you mention you've been provided, I see that the code was for restoring the original images. If you didn't check the option "Make a copy of my full size images" as I mentioned on my last reply, there are no images to restore to, so that code wouldn't work as well.

    What we could do as an automation so you don't have to go through all posts as you say is to iterate through them and check if the content has any .PNG images that have .JPG alternatives as well to update those URLs. Since this would be a custom code again for this particular issue it might take a while to create and test before we can provide something solid.

    Regards,
    Konstantinos

  • Panos

    Hi Paul ,

    Just to sum up here and hopefully provide a solution :slight_smile:

    What has happened is that after replacing png files to jpg in the media folder, Smush will replace all posts content with the new jpg files. When a page builder is used (in your case Zion builder), the content of the posts is not stored in the post_content, but in some post meta field or some options field.

    I checked Zion builder provided with your theme, and it stores the content in post_meta table with meta key zn_page_builder_els

    I have prepared a script that will try restore all pngs entries to jpg, if the jpg exists for all posts.
    Before using it please confirm that you have kept a backup of your database.

    Once you have the database backup ready, you can download the script from here:
    https://gist.github.com/wpmudev-sls/c6a354cc7b7b7da38bab127e6e17cf42

    Unzip and upload extracted file to the wp-content/mu-plugins folder (you can simply create that folder if it doesn't exist).

    Then visit yoursite.com/wp-admin/admin.php?page=wpmudev-pngjpg-builders (or click on the new Smush submenu in admin)

    Click the Zion Builder check and after a while it should count how many records have been found that contain png. It still has not replaced anything though.

    By clicking on the Restore those PNGS button it should start replacing png files to jpg and for each record (meta_id not post_id) it should list which images have been replaced. If the jpg file does not exist it won't replace the image.

    Please let us know if you would like us to install and run it on your site. But you first need confirm you have a db backup and send in admin access again as Konstantinos mentioned above.

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.