PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | modules/optimization/classes/optimization-error-message.php +2 -1 1.6.11.7.7 View file →
@@ -20,9 +20,9 @@
20 20 }
21 21
22 22 public static function get_optimization_error_message( string $error_type ) {
23 23 if ( ! in_array( $error_type, Image_Optimization_Error_Type::get_values(), true ) ) {
24 - throw new TypeError( "Error type $error_type is not a part of Image_Optimization_Error_Type values" );
24 + throw new TypeError( esc_html( "Error type $error_type is not a part of Image_Optimization_Error_Type values" ) );
25 25 }
26 26
27 27 $messages = [
28 28 Image_Optimization_Error_Type::FILE_ALREADY_EXISTS => esc_html__( 'File with this name already exists', 'image-optimization' ),
@@ -27,8 +27,9 @@
27 27 $messages = [
28 28 Image_Optimization_Error_Type::FILE_ALREADY_EXISTS => esc_html__( 'File with this name already exists', 'image-optimization' ),
29 29 Image_Optimization_Error_Type::QUOTA_EXCEEDED => esc_html__( 'Plan quota reached', 'image-optimization' ),
30 30 Image_Optimization_Error_Type::GENERIC => esc_html__( 'Optimization error', 'image-optimization' ),
31 + Image_Optimization_Error_Type::CONNECTION_ERROR => esc_html__( 'Connection error', 'image-optimization' ),
31 32 ];
32 33
33 34 if ( isset( $messages[ $error_type ] ) ) {
34 35 return $messages[ $error_type ];