Copy environment

Image Proxy

Image proxy service is used to improve WordPress image size regeneration logic. By default, WordPress automatically generates all registered image sizes for each uploaded image. Proxy service disables the default logic and generates the image sizes only when requested.

Out of the box our theme supports the following proxies:

Local image proxy

Read more about Lando image proxy services here.

For local development with Lando the image proxy is automatically enabled in Theme.php. if you have any problems you can disable it by removing APP_ENV=local in .env file or contact our core developers team. IMGPROXY_MAX_ANIMATION_FRAMES: the maximum of animated image frames to be processed. Default: 1.

GIF files

Since the processing of animated images is a pretty heavy process, only one frame is processed by default. You can increase the maximum of animation frames to process with the following variable:

Cloudimage proxy

Cloudimage proxy can be enabled in functions.php by defining const THEME_CLOUDIMAGE_ALLOWED as true. This adds a token field in the WordPress admin general settings section. If the token is added the service will work out of the box.

For the proxy we are using Cloudimage API v7, you can read more about it here.

Creating custom image proxy service

To add a custom image proxy service we should create a class in gotoAndPlay\Plugins. Created class should extend our abstract class ImageProxy in gotoAndCore\Utils.

In ImageProxy we have 2 abstract functions which need to be defined in our class.

  1. function getProxyBaseUrl which should always return our proxy base url
  2. function buildFullProxyUrl is used to build the actual proxy url from parameters

You might need to add other custom functionality but keep in mind these two functions are required for the proxy to work.

Take a look at the CloudImageProxy class in gotoAndCore\Plugins for an implementation example.