Recent

CLIclass

CLI

Manage WebP and AVIF conversion from the command line.

Namespace: WebberZone\Image_Optimizer\CLI
Since: 1.0.0
Source: includes/cli/class-cli.php line 27

Methods

status()

Show what this server can encode and how much of the library is done.

EXAMPLES

wp wzio status

Since: 1.0.0
Line: 42

public function status( $args, $assoc_args ): void;
Type Name Description
mixed $args
mixed $assoc_args

Returns: void

convert()

Convert one or more attachments immediately.

OPTIONS

[…] : Attachment IDs to convert. Omit to convert everything not yet handled.

[–force] : Re-encode even when an up-to-date optimized copy already exists.

[–formats=] : Comma separated list of formats to generate, overriding the settings.

[–dry-run] : Report what would be converted without writing anything.

EXAMPLES

wp wzio convert 7214
wp wzio convert --formats=webp,avif --force

Since: 1.0.0
Line: 108

public function convert( $args, $assoc_args ): void;
Type Name Description
mixed $args
mixed $assoc_args

Returns: void

queue()

Add every unconverted attachment to the background queue.

OPTIONS

[–force] : Requeue attachments that already have a conversion record.

EXAMPLES

wp wzio queue

Since: 1.0.0
Line: 202

public function queue( $args, $assoc_args ): void;
Type Name Description
mixed $args
mixed $assoc_args

Returns: void

run()

Work through the queue.

OPTIONS

[–batch=] : Attachments per batch. Defaults to the configured batch size.

[–max-batches=] : Stop after this many batches. Defaults to running until the queue is empty.

EXAMPLES

wp wzio run

Since: 1.0.0
Line: 234

public function run( $args, $assoc_args ): void;
Type Name Description
mixed $args
mixed $assoc_args

Returns: void

clean()

Delete the generated files for one or more attachments.

OPTIONS

[…] : Attachment IDs. Omit to clean every attachment that has a record.

[–yes] : Skip the confirmation prompt.

EXAMPLES

wp wzio clean 7214

Since: 1.0.0
Line: 293

public function clean( $args, $assoc_args ): void;
Type Name Description
mixed $args
mixed $assoc_args

Returns: void