| @@ -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 | } |