Skip to content

Automate the conversion of images in your media library to the .webp format (on your own server) and conditionally serve them to supported browsers on the front end.

Notifications You must be signed in to change notification settings

CodeParrots/webp-images

Repository files navigation

WebP Images

Banner Image

Contributors: codeparrots, eherman24
Tags: webp, image, compression, automation, media-library, conditional, browser, support
Requires at least: 4.0
Tested up to: 4.9
Stable tag: 1.1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Bye-bye third party services - automate the conversion of images in your media library to the .webp format (on your own server) and conditionally serve them to supported browsers on the front end.

Build Status License PHP 5.6

Description

Important: cwebp must be installed on the server and readily available in the system $PATH, for this plugin to function correctly. This is not available on shared hosting.

Note: Not an ideal solution for shared hosting as webp will not be installed. In this case, you may want to take a look at third party services.

cwebp Installation

MacOS: $ brew install webp

Additional Installation Instructions: Downloading and Installing WebP

Supported Image Types:

  • jpg, jpeg
  • png

How Does This Work

Anytime an image is uploaded through the media library a related .webp image is generated inside of a subdirectory in the uploads directory.

Example: wp-content/uploads/webp/

On the front end of your site, if a .webp format is available for the media element than the .webp format will be served. If not, or if a browser doesn't support .webp formats - then the original image will be served to the browser.

Screenshots

Screenshot 1

Install Instructions

  1. Install cwebp - https://developers.google.com/speed/webp/docs/cwebp
  2. Upload and use media library as usual. When an image is uploaded a .webp image will be generated inside of the wp-content/uploads/webp/ directory.
  3. If supported, the .webp image will be served to the browser, otherwise the original will be referenced.

Changelog

1.1.0 - February 18th, 2018

  • New: Added stylesheet.
  • Update: Removed the wp_die() statement when cwebp is not installed. Plugin should still work remotely, without the image compression attempts, allowing users to use this locally and upload it to a remote site.
  • Update: Updated build process.
  • Update: Update .pot file.
  • Update: Reworked the compression listings on the media element table.
  • Update: Updated the JavaScript.

1.0.0 - February 17, 2018

  • Initial Release.

About

Automate the conversion of images in your media library to the .webp format (on your own server) and conditionally serve them to supported browsers on the front end.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published