lib/ImageHelper.php
public static function img_to_webp( $src, $quality = 80, $force = false ) {
        $op = new Image\Operation\ToWebp($quality);
        return self::_operate($src, $op, $force);
    }
public static function img_to_webp( $src, $quality = 80, $force = false ) {
        $op = new Image\Operation\ToWebp($quality);
        return self::_operate($src, $op, $force);
    }
public static function img_to_webp ( $ src , $ quality = 80 , $ force = false ) { $ op = new Image \ Operation \ ToWebp ( $ quality ) ; return self :: _operate ( $ src , $ op , $ force ) ; }
Generates a new image by converting the source into WEBP if supported by the server

@param string  $src      a url or path to the image (http://example.org/wp-content/uploads/2014/image.webp)
or (/wp-content/uploads/2014/image.jpg)
If webp is not supported, a jpeg image will be generated
@param int     $quality  ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)
@param bool    $force
Generates a new image by converting the source into WEBP if supported by the server