|
21 | 21 | <?php if ( $error ) { |
22 | 22 | // dashicons-warning available for WP 4.3+ ?> |
23 | 23 | <span class="icon dashicons dashicons-no error"></span> |
24 | | - <?php } else if ( $total['missing'] > 0 || $total['modified'] > 0 ) { ?> |
| 24 | + <?php } elseif ( $total['missing'] > 0 || $total['modified'] > 0 ) { ?> |
25 | 25 | <span class="icon dashicons dashicons-yes alert"></span> |
26 | | - <?php } else if ( $total['compressed'] > 0 && $available_unoptimized_sizes > 0 ) { ?> |
| 26 | + <?php } elseif ( $total['compressed'] > 0 && $available_unoptimized_sizes > 0 ) { ?> |
27 | 27 | <span class="icon dashicons dashicons-yes alert"></span> |
28 | | - <?php } else if ( $total['compressed'] > 0 ) { ?> |
| 28 | + <?php } elseif ( $total['compressed'] > 0 ) { ?> |
29 | 29 | <span class="icon dashicons dashicons-yes success"></span> |
30 | 30 | <?php } ?> |
31 | 31 | <span class="icon spinner hidden"></span> |
|
43 | 43 | <?php } ?> |
44 | 44 | <?php if ( $size_before - $size_after ) { ?> |
45 | 45 | <span class="message"> |
46 | | - <?php printf( esc_html__( 'Total savings %.0f%%', 'tiny-compress-images' ), (1 - $size_after / floatval( $size_before )) * 100 ) ?> |
| 46 | + <?php printf( esc_html__( 'Total savings %1$.0f%2$%', 'tiny-compress-images' ), (1 - $size_after / floatval( $size_before )) * 100 ) ?> |
47 | 47 | </span> |
48 | 48 | <br /> |
49 | 49 | <?php } ?> |
50 | 50 | <?php if ( $error ) { ?> |
51 | 51 | <span class="message error_message"> |
52 | | - <?php echo esc_html__( 'Latest error', 'tiny-compress-images' ) . ': '. esc_html__( $error, 'tiny-compress-images' ) ?> |
| 52 | + <?php echo esc_html__( 'Latest error', 'tiny-compress-images' ) . ': ' . esc_html__( $error, 'tiny-compress-images' ) ?> |
53 | 53 | </span> |
54 | 54 | <br/> |
55 | 55 | <?php } ?> |
|
91 | 91 | echo ' '; |
92 | 92 | if ( ! array_key_exists( $size_name, $active_sizes ) && ! Tiny_Image::is_retina( $size_name ) ) { |
93 | 93 | echo '<em>' . esc_html__( '(not in use)', 'tiny-compress-images' ) . '</em>'; |
94 | | - } else if ( $size->missing() && ( Tiny_Settings::wr2x_active() || ! Tiny_Image::is_retina( $size_name ) ) ) { |
| 94 | + } elseif ( $size->missing() && ( Tiny_Settings::wr2x_active() || ! Tiny_Image::is_retina( $size_name ) ) ) { |
95 | 95 | echo '<em>' . esc_html__( '(file removed)', 'tiny-compress-images' ) . '</em>'; |
96 | | - } else if ( $size->modified() ) { |
| 96 | + } elseif ( $size->modified() ) { |
97 | 97 | echo '<em>' . esc_html__( '(modified after compression)', 'tiny-compress-images' ) . '</em>'; |
98 | | - } else if ( Tiny_Image::is_retina( $size_name ) ) { |
| 98 | + } elseif ( Tiny_Image::is_retina( $size_name ) ) { |
99 | 99 | echo '<em>' . esc_html__( '(WP Retina 2x)', 'tiny-compress-images' ) . '</em>'; |
100 | | - } else if ( $size->resized() ) { |
101 | | - printf( '<em>' . esc_html__( '(resized to %dx%d)', 'tiny-compress-images' ) . '</em>', $size->meta['output']['width'], $size->meta['output']['height'] ); |
| 100 | + } elseif ( $size->resized() ) { |
| 101 | + printf( '<em>' . esc_html__( '(resized to %1$dx%1$d)', 'tiny-compress-images' ) . '</em>', $size->meta['output']['width'], $size->meta['output']['height'] ); |
102 | 102 | } |
103 | 103 | echo '</td>'; |
104 | 104 |
|
105 | 105 | if ( $size->is_duplicate() ) { |
106 | 106 | echo '<td>-</td>'; |
107 | 107 | printf( '<td colspan=2><em>' . esc_html__( 'Same file as "%s"', 'tiny-compress-images' ) . '</em></td>', esc_html__( ucfirst( $size->duplicate_of_size() ) ) ); |
108 | | - } else if ( $size->has_been_compressed() ) { |
| 108 | + } elseif ( $size->has_been_compressed() ) { |
109 | 109 | echo '<td>' . size_format( $size->meta['input']['size'], 1 ) . '</td>'; |
110 | 110 | echo '<td>' . size_format( $size->meta['output']['size'], 1 ) . '</td>'; |
111 | 111 | echo '<td>' . sprintf( esc_html__( '%s ago' ), human_time_diff( $size->end_time( $size_name ) ) ) . '</td>'; |
112 | | - } else if ( ! $size->exists() ) { |
| 112 | + } elseif ( ! $size->exists() ) { |
113 | 113 | echo '<td>-</td>'; |
114 | 114 | echo '<td colspan=2><em>' . esc_html__( 'Not present', 'tiny-compress-images' ) . '</em></td>'; |
115 | | - } else if ( isset( $size_active[ $size_name ] ) || Tiny_Image::is_retina( $size_name ) ) { |
| 115 | + } elseif ( isset( $size_active[ $size_name ] ) || Tiny_Image::is_retina( $size_name ) ) { |
116 | 116 | echo '<td>' . size_format( $size->filesize(), 1 ) . '</td>'; |
117 | 117 | echo '<td colspan=2><em>' . esc_html__( 'Not compressed', 'tiny-compress-images' ) . '</em></td>'; |
118 | | - } else if ( isset( $size_exists[ $size_name ] ) ) { |
| 118 | + } elseif ( isset( $size_exists[ $size_name ] ) ) { |
119 | 119 | echo '<td>' . size_format( $size->filesize(), 1 ) . '</td>'; |
120 | 120 | echo '<td colspan=2><em>' . esc_html__( 'Not configured to be compressed', 'tiny-compress-images' ) . '</em></td>'; |
121 | | - } else if ( ! array_key_exists( $size_name, $active_sizes ) ) { |
| 121 | + } elseif ( ! array_key_exists( $size_name, $active_sizes ) ) { |
122 | 122 | echo '<td>' . size_format( $size->filesize(), 1 ) . '</td>'; |
123 | 123 | echo '<td colspan=2><em>' . esc_html__( 'Size is not in use', 'tiny-compress-images' ) . '</em></td>'; |
124 | 124 | } else { |
|
145 | 145 | <strong> |
146 | 146 | <?php |
147 | 147 | if ( $size_before - $size_after ) { |
148 | | - printf( esc_html__( 'Total savings %.0f%% (%s)', 'tiny-compress-images' ), |
| 148 | + printf( esc_html__( 'Total savings %1$.0f%2$% (%3$s)', 'tiny-compress-images' ), |
149 | 149 | ( 1 - $size_after / floatval( $size_before ) ) * 100, |
150 | 150 | size_format( $size_before - $size_after, 1 ) |
151 | 151 | ); |
152 | 152 | } else { |
153 | | - printf( esc_html__( 'Total savings %.0f%%', 'tiny-compress-images' ), 0 ); |
| 153 | + printf( esc_html__( 'Total savings %1$.0f%2$%', 'tiny-compress-images' ), 0 ); |
154 | 154 | } |
155 | 155 | ?> |
156 | 156 | </strong> |
|
0 commit comments