get_option('blog_id'); $attachment_id = $this->get_option('attachment_id'); $source = $this->get_option('attachment_source'); if (is_multisite()) switch_to_blog($blog_id); $images = WPO_Image_Utils::get_attachment_files($attachment_id); $images['original'] = $source; foreach ($images as $image) { WPO_WebP_Utils::do_webp_conversion($image); } $webp_converter = new WPO_WebP_Convert(); $destination = $webp_converter->get_destination_path($source); if (file_exists($destination)) { update_post_meta($attachment_id, 'wpo-webp-conversion-complete', true); } if (is_multisite()) restore_current_blog(); return true; } } endif;