Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    The correct answer is ‘maybe’…

    If you call the function ewww_image_optimizer_update_table() and provide it with the parameters defined, a record will be created telling EWWW that they have already been optimized. I would not recommend this unless you KNOW that your generated images are fully optimized. Check a few in the ewwwio_images table by going to Bulk Optimize and clicking the Show Optimized Images button.
    The required parameters for the function are:
    $attachment = the full/absolute path to the image
    $opt_size = the image size after optimization
    $orig_size = the image size before optimization

    In your case, you can pass the same size for $opt_size & $orig_size, but it must be the actual filesize of the image, or it will not be bypassed by EWWW.

    However, if you are using the WP_Image_Editor classes to create the images in the first place, there will be absolutely no way to bypass it, as the plugin is hooked directly into the save() function of the image editor class.

    Thread Starter niska

    (@niska)

    It would be great to have a filter that I could use to return false if optimization is not needed at some point in the code. Could you maby add that in the future?

    Plugin Author nosilver4u

    (@nosilver4u)

    sticking this as a feature request. I’ll take a look at it next week and see if it is even feasible.

    Plugin Author nosilver4u

    (@nosilver4u)

    Well, took me a lot longer to get back to this than I thought, but the filter will be in the next release (next week).

    Thread Starter niska

    (@niska)

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Bypass EWWW programatically?’ is closed to new replies.