PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / trunk
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization vtrunk
4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 All 135 releases
← All changes | inc/cli/cli_setting.php +8 -9 3.11.1 → trunk View file →
@@ -31,14 +31,13 @@
31 31 $data = $request->get_user_data( $api_key );
32 32 if ( $data === false || is_wp_error( $data ) ) {
33 33 $extra = '';
34 34 if ( is_wp_error( $data ) ) {
35 - /**
36 - * Error from api.
37 - *
38 - * @var WP_Error $data Error object.
39 - */
40 - $extra = sprintf( __( '. ERROR details: %s', 'optimole-wp' ), $data->get_error_message() );
35 + $extra = sprintf(
36 + /* translators: Error details */
37 + __( '. ERROR details: %s', 'optimole-wp' ),
38 + $data->get_error_message()
39 + );
41 40 }
42 41
43 42 return \WP_CLI::error( __( 'Can not connect to Optimole service', 'optimole-wp' ) . $extra );
44 43 }
@@ -128,13 +127,13 @@
128 127
129 128 /**
130 129 * Clear cache.
131 130 *
132 - * --type=<type>
131 + * [--type=<type>]
133 132 * : The type of cache to clear. Default is images.
134 133 */
135 134 public function clear_cache( $args, $assoc_args ) {
136 - $type = '';
135 + $type = 'images';
137 136
138 137 // If assoc_args has a type key, use that.
139 138 if ( isset( $assoc_args['type'] ) && $assoc_args['type'] === 'assets' ) {
140 139 $type = $assoc_args['type'];
@@ -146,7 +145,7 @@
146 145 if ( is_wp_error( $token ) ) {
147 146 \WP_CLI::error( $token->get_error_message() );
148 147 }
149 148
150 - \WP_CLI::success( sprintf( 'Cache type %s cleared', $assoc_args['type'] ) );
149 + \WP_CLI::success( sprintf( 'Cache type %s cleared', $type ) );
151 150 }
152 151 }