@@ -59,12 +59,12 @@ public function admin_init() {
5959 register_setting ('media ' , $ field );
6060 add_settings_field ($ field , self ::translate ('Connection status ' ), $ this ->get_method ('render_pending_status ' ), 'media ' , $ section );
6161
62- add_action ('wp_ajax_tiny_image_sizes_notices ' , $ this ->get_method ('image_sizes_notices ' ));
62+ add_action ('wp_ajax_tiny_image_sizes_notice ' , $ this ->get_method ('image_sizes_notice ' ));
6363 add_action ('wp_ajax_tiny_compress_status ' , $ this ->get_method ('connection_status ' ));
6464 }
6565
66- public function image_sizes_notices () {
67- $ this ->render_image_sizes_notices ($ _GET ["image_sizes_selected " ], $ _GET [ " original_selected " ]);
66+ public function image_sizes_notice () {
67+ $ this ->render_image_sizes_notice ($ _GET ["image_sizes_selected " ]);
6868 exit ();
6969 }
7070
@@ -179,28 +179,23 @@ public function render_api_key() {
179179 }
180180
181181 public function render_sizes () {
182- echo '<p> ' . self ::translate_escape ('You can choose to compress different image sizes created by WordPress here ' ) . '.<br/> ' ;
183- echo self ::translate_escape ('Remember each additional image size will affect your TinyPNG monthly usage ' ) . "! " ;?>
182+ echo '<p> ' . self ::translate_escape ('Choose sizes to compress ' ) . ': ' ;?>
184183<input type="hidden" name="<?php echo self ::get_prefixed_name ('sizes[ ' . self ::DUMMY_SIZE .'] ' ); ?> " value="on"/></p>
185184<?php
186- $ original_enabled = false ;
187185 foreach ($ this ->get_sizes () as $ size => $ option ) {
188- if ($ size === Tiny_Metadata::ORIGINAL ) {
189- $ original_enabled = $ option ['tinify ' ];
190- }
191186 $ this ->render_size_checkbox ($ size , $ option );
192187 }
193188
194- echo '<div id="tiny-image-sizes-notices "> ' ;
195- $ this ->render_image_sizes_notices (count (self ::get_active_tinify_sizes ()), $ original_enabled );
189+ echo '<div id="tiny-image-sizes-notice "> ' ;
190+ $ this ->render_image_sizes_notice (count (self ::get_active_tinify_sizes ()));
196191 echo '</div> ' ;
197192 }
198193
199194 private function render_size_checkbox ($ size , $ option ) {
200195 $ id = self ::get_prefixed_name ("sizes_ $ size " );
201196 $ field = self ::get_prefixed_name ("sizes[ $ size] " );
202197 if ($ size === Tiny_Metadata::ORIGINAL ) {
203- $ label = self ::translate_escape ("original " );
198+ $ label = self ::translate_escape ("original " ) . ' ( ' . self :: translate_escape ( ' overwritten by compressed image ' ) . ' ) ' ;
204199 } else {
205200 $ label = $ size . " - $ {option['width ' ]}x $ {option['height ' ]}" ;
206201 }?>
@@ -209,7 +204,7 @@ private function render_size_checkbox($size, $option) {
209204<?php
210205 }
211206
212- public function render_image_sizes_notices ($ active_image_sizes_count, $ original_selected ) {
207+ public function render_image_sizes_notice ($ active_image_sizes_count ) {
213208 echo '<br/> ' ;
214209 if ($ active_image_sizes_count < 1 ) {
215210 echo '<p> ' . self ::translate_escape ('With these settings no images will be compressed ' ) . '.</p> ' ;
@@ -218,11 +213,12 @@ public function render_image_sizes_notices($active_image_sizes_count, $original_
218213 $ free_images_per_month = floor (self ::MONTHLY_FREE_COMPRESSIONS / $ active_image_sizes_count );
219214
220215 echo '<p> ' ;
221- printf (self ::translate_escape ('With these settings you can compress %s images for free each month ' ) . '. ' , $ free_images_per_month );
216+ echo self ::translate_escape ('With these settings you can compress ' );
217+ echo ' <strong> ' ;
218+ printf (self ::translate_escape ('%s images ' ), $ free_images_per_month );
219+ echo '</strong> ' ;
220+ echo self ::translate_escape ('for free each month ' ) . '. ' ;
222221 echo '</p> ' ;
223- if ($ original_selected ) {
224- echo '<p> ' . self ::translate_escape ('Note: your original images will be overwritten with the compressed versions ' ) . '!</p> ' ;
225- }
226222 }
227223 }
228224
0 commit comments