• Resolved Jordy Meow

    (@tigroumeow)


    Hello,

    I am the developer of the plugin called “WP Retina 2x. I believe a plugin should only do one thing and do it well, so my plugin creates a lot of big images for retina devices but doesn’t optimize them (at all).

    I came across your plugin very recently and I didn’t have the chance to try it yet. However, do you know if your plugin works well with mine? My plugin creates the @2x images directly (= they are not created as media in WP, they are in the shadows of the main images) through the wp_get_image_editor function. Is your plugin overriding wp_get_image_editor?

    I’m often asked to add options to optimize the images and I would love to recommend using your plugin. I will also definitely ask this recommendation in my FAQ too πŸ™‚

    Thanks a lot for reading!
    Jordy.

    https://wordpress.org/plugins/ewww-image-optimizer/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Jordy Meow

    (@tigroumeow)

    Oh no! It seems it doesn’t work with WP Engine since they don’t let you use “exec”…

    The cloud version seems to be the solution but I would like to know first if my plugin “@2x” files could be handled. We can also talk through this by email if you like.

    Plugin Author nosilver4u

    (@nosilver4u)

    I’m happy to inform you that it extends the wp_image_editor _save() function for ImageMagick, GD, and Gmagick, so WP Retina 2X images are supported. In fact, I have special code for your plugin, to ensure the images don’t get double-optimized. If memory serves me correct, your 2x plugin renames the images after using the wp_image_editor functions, which created the need for that specific bit of code.

    And regarding WPEngine, they don’t allow the regular version of the plugin, but they do allow this one: https://wordpress.org/plugins/ewww-image-optimizer-cloud/

    This naturally uses the cloud service exclusively, and has no mention of the exec() function per their request.

    Plugin Author nosilver4u

    (@nosilver4u)

    Well, I thought it was working properly, but it seems WP Retina 2x might be re-creating images unnecessarily. I’ve just got an email from a customer regarding their quota being used up very quickly. I checked the logs and it seems to indicate that retina images are being recreated on every page load. Might be a bug when WP Retina 2x is checking to see if the image already exists.

    Thread Starter Jordy Meow

    (@tigroumeow)

    First, thanks for the good news. I am a WPEngine user and I don’t think I need this optimization, but is there a way I can “try out” the cloud version of the plugin for a little while? Just to see if it works perfectly? I really want to add this in the plugin description.

    About the plugin re-creating images that is impossible. Images are only created when new photos are uploaded, re-generated, or when the Retina admin is used (there is a bulk generate feature). Is this person using another plugin than mine? I wouldn’t be surprised if another plugin generates those images on demand.

    Plugin Author nosilver4u

    (@nosilver4u)

    I thought that was how your’s worked, so I was a bit surprised myself. Haven’t heard back from them yet, so I’ll let you know. Doing a quick search for the @2x suffix found an article that gives instructions for retina images in wordpress, and mention of several other plugins as well.

    Shoot me an email via my contact form at shanebishop.net and I’ll set you up with a dev key.

    Thread Starter Jordy Meow

    (@tigroumeow)

    I sent you an email.

    Okay, let’s see what he say, I am curious. But he probably uses another plugin, maybe he should try wp-retina-2x instead… πŸ™‚

    Thread Starter Jordy Meow

    (@tigroumeow)

    Hello again,

    Actually it doesn’t optimize the @2x images, they are simply skipped. I used the “Optimize now!” in the Media Library on a few files and all the media sizes were properly optimized but not the @2x.

    As you probably know, those @2x files are not registered in WP (they don’t need to be since the users shouldn’t interact with them directly). Your plugin should check if there is a @2x version of the files.

    If you like, you can use function of my plugin directly. I have a function called wr2x_get_retina( $file ) that will return the full path to the retina image for a given image, or null it there isn’t any.

    Plugin Author nosilver4u

    (@nosilver4u)

    Hmm, interesting. I’ll have to take a look and see what I’m doing related to Retina images. I thought for sure I had some sort of special code in there to account for them. Are you using the wp_image_editor class to create the resizes?

    If not, I’ll definitely make use of that function, it would be most helpful.

    UPDATE: I went back and looked at some old support threads, and should clarify how it is ‘supposed’ to work. All new retina images should be optimized via the extension of WP_Image_Editor. To optimize previously created retina images, one would normally configure Folders to Optimize with the path to your Media Library, and run the Scan & Optimize (after you’ve already Bulk Optimized the Media Library).

    However, with that function you mentioned, we could take care of Retina images while we do the Media Library, just need to think through how to only do it during the bulk process, since it won’t be necessary during new uploads.

    Thread Starter Jordy Meow

    (@tigroumeow)

    Yes, it works with WP Retina 2x and the new uploaded images. And as you mentioned, it probably also works during the bulk optimize since it would go over all the physical files.

    However, it would be awesome if it could work in the Media Library too πŸ™‚ I am doing my testing with those first and an user would think that this “Optimize Now!” would also optimize the retina images. Let me know, that would be really really super…

    Plugin Author nosilver4u

    (@nosilver4u)

    Thread Starter Jordy Meow

    (@tigroumeow)

    That was fast! And that works too πŸ™‚ That’s really great, I love the combo of both our plugins πŸ™‚ I’m glad to have you around!

    One more feature request but it’s up to you to do it or not. I’d love to be able to optimize the sized JPGs agressively while skipping the original ones. That way if something goes wrong we can still regenerate the sized JPGs with high quality. That’s basically a rollback πŸ™‚

    Plugin Author nosilver4u

    (@nosilver4u)

    That’s pretty much what this option does: “Exclude full-size images from lossy optimization”
    It’s on the advanced tab for EWWW IO

    Thread Starter Jordy Meow

    (@tigroumeow)

    And you know what, it’s checked! I am pretty sure I did… Oh well πŸ˜‰ Everything is perfect.

    By the way, are you checking manually for the “@2x” or are you using my wr2x_get_retina( $file ) function? I am asking since the suffix is handled dynamically on my side (even though the user cannot change it yet) but it might be different one day for 2 reasons. The first is that a few users requested me to add an option to pick a different suffix. The second and more important reason is that we might have more than @2x in the future (like @3x, @4x…) and that function would return an array. For backward compatibility, I will keep this function returning a single retina file, but if one more argument is specified ( $file, $all_retina_sizes = true / false by default ) it would return an array.

    Plugin Author nosilver4u

    (@nosilver4u)

    currently I’m using your wr2x_get_retina() function, so if you remember down the road, let me know when/if the results end up becoming an array

    Thread Starter Jordy Meow

    (@tigroumeow)

    It will never become an array for backward compatibility except if you provide an extra argument. I will poke you when that happens, so you can optimize all those new files too.

    It works like a charm now πŸ™‚ I added a section about your plugin in my FAQ!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Compatibility with WP Retina 2x’ is closed to new replies.