• Resolved fractaleater

    (@fractaleater)


    I am using plugin Enable Media Replace. Here is LiteSpeed report# ZKGYPZSJ. My setup is to not optimize files, but to generate webp, and replace img/srcset/background: url/etc with webp. I have many optimized groups, but it looks like currently my queue is paused, but that’s another issue..

    Here’s my notes and procedure to create orphaned webp files:

    I saved an image-to-replace file and added to media library. I created a test page and used devtools to verify the image was replaced with filename.jpg.webp image, and that the the header reported type as webp. Found documentation that says some images are not replaced with webp if the jpg size is smaller than the webp size. Ok. I then opened the image details in the Media Library and used Replace media > Uploaded a new file, to upload “replace-image.jpg”. Used Replacement Options > Just replace the file, and Options > Keep the date. LiteSpeed Cache > Image Optimization > Image Optimization SummaryOptimization Status, showed Images ready to request: 1 group (7 images)”. It took like 30 minutes, but now all images, including webp have been replaced with the new image. Permanently deleted the image using Media Library, and while all JPG images are gone, the optimized jpeg.webp images are still there, but now orphaned – see “replace-image.jpg.webp”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fractaleater

    (@fractaleater)

    Follow up.. I tested a file that was not replaced with plugin Enable Media Replace. So this test was just a regular group of jpg files processed by QUIC.cloud, and returned to my server as webp. When I deleted the image from the Media Library using “Delete permanently”, all the webp files downloaded from QUIC.cloud remained, while all the group jpg files, the original size source jpg and WordPress sized jpg files, were deleted. The WordPress attachment page was also deleted, leaving behind orphans – an original size webp and WordPress sized webp files.

    Is this behavior by design or is there a problem with my configuration? If by design, is there a recommendation for how to prevent orphan buildup? Do I need to hook “delete_attachment” and manually delete webp files downloaded from QUIC.cloud?

    Plugin Support qtwrk

    (@qtwrk)

    actually it’s a bug , not sure what’s with replace , but on my test, a clean WP without any plugin , it doesn’t delete the optm’ed files , this is a bug , will notify our team to fix it

    Thread Starter fractaleater

    (@fractaleater)

    Great. Thanks for the response. I look forward to a fix.

    Concerning the plugin “Enable Media Replace”, it looks like it works by deleting the attachments, and adding a new attachment with same name and date, but in this case, the orphan problem is even more scary if the replacement image is a different size than the replaced image. Orphaned webp files from the replaced image will sit alongside replacement image webp files, and depending on the device viewport, different images will be served.. a ridiculously hard bug to track down.

    Anyway, thanks for your time looking into this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Orphaned webp files when use media library delete permanently’ is closed to new replies.