| @@ -1,19 +1,13 @@ | ||
| 1 | -<?php if (!defined('WPO_VERSION')) die('No direct access.'); ?> | |
| 1 | +<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?> | |
| 2 | 2 | <div id='smush-metabox-inside-wrapper'> |
| 3 | - <div class='wpo_restore_single_image' <?php echo $restore_display; ?>> | |
| 4 | - <div class='restore_possible' <?php echo $restore_action; ?>> | |
| 3 | + <div class='wpo_restore_single_image' style="<?php echo esc_attr($restore_display); ?>"> | |
| 4 | + <div class='restore_possible' style="<?php echo esc_attr($restore_action); ?>"> | |
| 5 | 5 | <div class="alignleft restore-icon"> |
| 6 | 6 | <label> |
| 7 | 7 | <span> <?php esc_html_e('Restore original', 'wp-optimize'); ?></span> |
| 8 | 8 | |
| 9 | - <?php | |
| 10 | - $message = __('Only the original image will be restored.', 'wp-optimize'); | |
| 11 | - $message .= ' '; | |
| 12 | - $message .= __('In order to restore the other sizes, you should use a plugin such as "Regenerate Thumbnails".', 'wp-optimize'); | |
| 13 | - ?> | |
| 14 | - | |
| 15 | - <span tabindex="0" data-tooltip="<?php echo esc_attr($message);?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 9 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($restore_tooltip);?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 16 | 10 | </label> |
| 17 | 11 | </div> |
| 18 | 12 | |
| 19 | 13 | <div class='alignright'> |
| @@ -19,75 +13,27 @@ | ||
| 19 | 13 | <div class='alignright'> |
| 20 | 14 | <input type='button' id='wpo_restore_single_image_<?php echo esc_attr($post_id); ?>' data-blog='<?php echo esc_attr(get_current_blog_id()); ?>' data-id="<?php echo esc_attr($post_id); ?>" class='button-primary button' value="<?php esc_attr_e('Restore', 'wp-optimize');?>"> |
| 21 | 15 | </div> |
| 22 | 16 | </div> |
| 23 | - <p id='smush_info' class='wpo_restore_single_image'><?php echo esc_html($smush_info); ?></p> | |
| 24 | - <div id="wpo_smush_details"><?php echo $smush_details; ?></div> | |
| 17 | + <p id='smush_info'><?php echo esc_html($smush_info); ?></p> | |
| 18 | + <div id="wpo_smush_details"><?php echo $smush_details; // phpcs:ignore WordPress.Security.EscapeOutput -- Output is already escaped ?></div> | |
| 25 | 19 | </div> |
| 26 | - <div class='wpo_smush_single_image compression_level' <?php echo $smush_display; ?>> | |
| 27 | - <label for="enable_lossy_compression"> | |
| 28 | - <input type="radio" id="enable_lossy_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 60); ?>> | |
| 29 | - <?php esc_html_e('Prioritize maximum compression', 'wp-optimize');?> | |
| 30 | - <span tabindex="0" data-tooltip="<?php esc_attr_e('Potentially uses lossy compression to ensure maximum savings per image, the resulting images are of a slightly lower quality', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 31 | - </label> | |
| 32 | - <label for="enable_lossless_compression"> | |
| 33 | - <input type="radio" id="enable_lossless_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 92); ?>> | |
| 34 | - <?php esc_html_e('Prioritize retention of detail', 'wp-optimize');?> | |
| 35 | - <span tabindex="0" data-tooltip="<?php esc_attr_e('Uses lossless compression, which results in much better image quality but lower filesize savings per image', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 36 | - </label> | |
| 37 | - <label for="enable_custom_compression"> | |
| 38 | - <input id="enable_custom_compression" type="radio" name="compression_level" class="smush-options compression_level" <?php checked($custom); ?>> | |
| 39 | - <?php esc_html_e('Custom', 'wp-optimize');?> | |
| 40 | - </label> | |
| 41 | - <div class="smush-options custom_compression" <?php if (!$custom) echo 'style="display:none;"';?>> | |
| 42 | - <span class="alignleft"><?php esc_html_e('Maximum compression', 'wp-optimize');?></span> | |
| 43 | - <input id="custom_compression_slider" class="compression_level" data-max="<?php esc_attr_e('Maximum Compression', 'wp-optimize'); ?>" type="range" step="5" value="<?php echo intval($smush_options['image_quality']); ?>" min="65" max="90" list="number" /> | |
| 44 | - <datalist id="number"> | |
| 45 | - <option value="65"/> | |
| 46 | - <option value="70"/> | |
| 47 | - <option value="75"/> | |
| 48 | - <option value="80"/> | |
| 49 | - <option value="85"/> | |
| 50 | - <option value="90"/> | |
| 51 | - </datalist> | |
| 52 | - <span class="alignright"><?php esc_html_e('Best image quality', 'wp-optimize');?></span> | |
| 53 | - </div> | |
| 54 | - </div> | |
| 55 | - <a href="#" class="wpo-toggle-advanced-options wpo_smush_single_image" <?php echo $smush_display; ?>><?php esc_html_e('Show advanced options', 'wp-optimize');?></a> | |
| 56 | - <div class='smush-advanced wpo-advanced-options'> | |
| 57 | - <h4><?php esc_html_e('Service provider', 'wp-optimize');?></h4> | |
| 58 | - <fieldset class="compression_server"> | |
| 59 | - <label for="resmushit"> | |
| 60 | - <input type="radio" id="resmushit" name="compression_server_<?php echo esc_attr($post_id); ?>" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?>> | |
| 61 | - <a href="http://resmush.it" target="_blank"><?php esc_html_e('reSmush.it', 'wp-optimize');?></a> | |
| 62 | - </label> | |
| 63 | - </fieldset> | |
| 64 | - <h4><?php esc_html_e('Other options', 'wp-optimize');?></h4> | |
| 65 | - <fieldset class="other_options"> | |
| 66 | - <label for='smush_backup_<?php echo esc_attr($post_id); ?>'> | |
| 67 | - <input type='checkbox' name='smush_backup_<?php echo esc_attr($post_id); ?>' id='smush_backup_<?php echo esc_attr($post_id); ?>' <?php checked($smush_options['back_up_original']); ?>> | |
| 68 | - <span><?php esc_html_e('Backup original', 'wp-optimize'); ?></span> | |
| 69 | - </label> | |
| 70 | - <label for='smush_exif_<?php echo esc_attr($post_id); ?>'> | |
| 71 | - <input type='checkbox' name='smush_exif_<?php echo esc_attr($post_id); ?>' id='smush_exif_<?php echo esc_attr($post_id); ?>' class="preserve_exif" <?php checked($smush_options['preserve_exif']); ?>> | |
| 72 | - <span><?php esc_html_e('Keep EXIF data', 'wp-optimize'); ?></span> | |
| 73 | - </label> | |
| 74 | - </fieldset> | |
| 75 | - </div> | |
| 76 | 20 | |
| 77 | - <?php if ($compressed_by_another_plugin) { ?> | |
| 21 | + <?php echo $smush_settings_form; // phpcs:ignore WordPress.Security.EscapeOutput -- Output is already escaped ?> | |
| 22 | + | |
| 23 | + <?php if ($compressed_by_another_plugin && !$smush_marked) { ?> | |
| 78 | 24 | <p><b><?php esc_html_e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p> |
| 79 | 25 | <?php } ?> |
| 80 | 26 | |
| 81 | - <div class='wpo_smush_single_image action_button' <?php echo $smush_display; ?> > | |
| 27 | + <div class='wpo_smush_single_image action_button' style="<?php echo esc_attr($smush_display); ?>" > | |
| 82 | 28 | <input type='button' data-blog='<?php echo esc_attr(get_current_blog_id()); ?>' data-id="<?php echo esc_attr($post_id); ?>" id='smush_compress_<?php echo esc_attr($post_id); ?>' class='button-primary button' value='<?php esc_attr_e('Compress', 'wp-optimize'); ?>'/> |
| 83 | 29 | </div> |
| 84 | 30 | |
| 85 | - <div class='wpo_smush_mark_single_image action_button' <?php echo $smush_mark; ?> > | |
| 31 | + <div class='wpo_smush_mark_single_image action_button' style="<?php echo esc_attr($smush_mark); ?>" > | |
| 86 | 32 | <input type='button' data-blog='<?php echo esc_attr(get_current_blog_id()); ?>' data-id="<?php echo esc_attr($post_id); ?>" id='smush_mark_<?php echo esc_attr($post_id); ?>' class='button' value='<?php esc_attr_e('Mark as already compressed', 'wp-optimize'); ?>'/> |
| 87 | 33 | </div> |
| 88 | 34 | |
| 89 | - <div class='wpo_smush_unmark_single_image action_button' <?php echo $smush_unmark; ?> > | |
| 35 | + <div class='wpo_smush_unmark_single_image action_button' style="<?php echo esc_attr($smush_unmark); ?>" > | |
| 90 | 36 | <input type='button' data-blog='<?php echo esc_attr(get_current_blog_id()); ?>' data-id="<?php echo esc_attr($post_id); ?>" id='smush_unmark_<?php echo esc_attr($post_id); ?>' class='button' value='<?php esc_attr_e('Mark as uncompressed', 'wp-optimize'); ?>'/> |
| 91 | 37 | </div> |
| 92 | 38 | |
| 93 | 39 | <?php |