PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | templates/admin-metabox-smush.php +28 -69 3.2.3 → 4.7.0 View file →
@@ -1,81 +1,40 @@
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; ?>>
5 - <label for='wpo_restore_single_image_<?php echo $post_id; ?>'>
6 - <span class='alignleft'> <?php _e('Restore original', 'wp-optimize'); ?></span>
7 - </label>
8 - <input type='button' id='wpo_restore_single_image_<?php echo $post_id; ?>' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" class='button-primary button alignright' value="<?php esc_attr_e('Restore', 'wp-optimize');?>">
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 + <div class="alignleft restore-icon">
6 + <label>
7 + <span> <?php esc_html_e('Restore original', 'wp-optimize'); ?></span>
8 +
9 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($restore_tooltip);?>"><span class="dashicons dashicons-editor-help"></span> </span>
10 + </label>
11 + </div>
12 +
13 + <div class='alignright'>
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');?>">
15 + </div>
9 16 </div>
10 - <p id='smush_info' class='wpo_restore_single_image'><?php echo $smush_info; ?></p>
11 - <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>
12 19 </div>
13 - <div class='wpo_smush_single_image compression_level' <?php echo $smush_display; ?>>
14 - <label for="enable_lossy_compression">
15 - <input type="radio" id="enable_lossy_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 90); ?>>
16 - <?php _e('Prioritize maximum compression', 'wp-optimize');?>
17 - <span tabindex="0" data-tooltip="<?php _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>
18 - </label>
19 - <label for="enable_lossless_compression">
20 - <input type="radio" id="enable_lossless_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 100); ?>>
21 - <?php _e('Prioritize retention of detail', 'wp-optimize');?>
22 - <span tabindex="0" data-tooltip="<?php _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>
23 - </label>
24 - <label for="enable_custom_compression">
25 - <input id="enable_custom_compression" type="radio" name="compression_level" class="smush-options compression_level" <?php checked($custom); ?>>
26 - <?php _e('Custom', 'wp-optimize');?>
27 - </label>
28 - <div class="smush-options custom_compression" <?php if (!$custom) echo 'style="display:none;"';?>>
29 - <span class="alignleft"><?php _e('Maximum compression', 'wp-optimize');?></span>
30 - <input id="custom_compression_slider" class="compression_level" data-max="Maximum Compression" type="range" step="5" value="<?php echo intval($smush_options['image_quality']); ?>" min="60" max="85" list="number" />
31 - <datalist id="number">
32 - <option value="60"/>
33 - <option value="65"/>
34 - <option value="70"/>
35 - <option value="75"/>
36 - <option value="80"/>
37 - <option value="85"/>
38 - </datalist>
39 - <span class="alignright"><?php _e('Best image quality', 'wp-optimize');?></span>
40 - </div>
41 - </div>
42 - <a href="#" class="wpo-toggle-advanced-options wpo_smush_single_image" <?php echo $smush_display; ?>><?php _e('Show advanced options', 'wp-optimize');?></a>
43 - <div class='smush-advanced wpo-advanced-options'>
44 - <h4><?php _e('Service provider', 'wp-optimize');?></h4>
45 - <fieldset class="compression_server">
46 - <label for="resmushit">
47 - <input type="radio" id="resmushit" name="compression_server_<?php echo $post_id; ?>" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?>>
48 - <a href="http://resmush.it" target="_blank"><?php _e('reSmush.it', 'wp-optimize');?></a>
49 - </label>
50 - </fieldset>
51 - <h4><?php _e('Other options', 'wp-optimize');?></h4>
52 - <fieldset class="other_options">
53 - <label for='smush_backup_<?php echo $post_id; ?>'>
54 - <input type='checkbox' name='smush_backup_<?php echo $post_id; ?>' id='smush_backup_<?php echo $post_id; ?>' <?php checked($smush_options['back_up_original']); ?>>
55 - <span><?php _e('Backup original', 'wp-optimize'); ?></span>
56 - </label>
57 - <label for='smush_exif_<?php echo $post_id; ?>'>
58 - <input type='checkbox' name='smush_exif_<?php echo $post_id; ?>' id='smush_exif_<?php echo $post_id; ?>' class="preserve_exif" <?php checked($smush_options['preserve_exif']); ?>>
59 - <span><?php _e('Keep EXIF data', 'wp-optimize'); ?></span>
60 - </label>
61 - </fieldset>
62 - </div>
63 20
64 - <?php if ($compressed_by_another_plugin) { ?>
65 - <p><b><?php _e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p>
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) { ?>
24 + <p><b><?php esc_html_e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p>
66 25 <?php } ?>
67 26
68 - <div class='wpo_smush_single_image action_button' <?php echo $smush_display; ?> >
69 - <input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_compress_<?php echo $post_id; ?>' class='button-primary button' value='<?php _e('Compress', 'wp-optimize'); ?>'/>
27 + <div class='wpo_smush_single_image action_button' style="<?php echo esc_attr($smush_display); ?>" >
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'); ?>'/>
70 29 </div>
71 30
72 - <div class='wpo_smush_mark_single_image action_button' <?php echo $smush_mark; ?> >
73 - <input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_mark_<?php echo $post_id; ?>' class='button' value='<?php _e('Mark as already compressed', 'wp-optimize'); ?>'/>
31 + <div class='wpo_smush_mark_single_image action_button' style="<?php echo esc_attr($smush_mark); ?>" >
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'); ?>'/>
74 33 </div>
75 34
76 - <div class='wpo_smush_unmark_single_image action_button' <?php echo $smush_unmark; ?> >
77 - <input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_unmark_<?php echo $post_id; ?>' class='button' value='<?php _e('Mark as uncompressed', 'wp-optimize'); ?>'/>
35 + <div class='wpo_smush_unmark_single_image action_button' style="<?php echo esc_attr($smush_unmark); ?>" >
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'); ?>'/>
78 37 </div>
79 38
80 39 <?php
81 40
@@ -89,9 +48,9 @@
89 48 $menu_page_url = network_admin_url('admin.php?page=wpo_images');
90 49 }
91 50 ?>
92 51 <div class="smush-metabox-dashboard-link">
93 - <a href="<?php echo $menu_page_url; ?>"><?php _e('WP-Optimize image settings', 'wp-optimize'); ?></a>
52 + <a href="<?php echo esc_url($menu_page_url); ?>"><?php esc_html_e('WP-Optimize image settings', 'wp-optimize'); ?></a>
94 53 </div>
95 54 </div>
96 55
97 56 <div id="smush-information-modal" class="wp-core-ui" style="display:none;">
@@ -103,5 +62,5 @@
103 62 <div class="smush-information"></div>
104 63 <input type="button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" />
105 64 </div>
106 65
107 -<script type="text/javascript">jQuery(document).trigger('admin-metabox-smush-loaded');</script>
66 +<script type="text/javascript">jQuery(document).trigger('admin-metabox-smush-loaded');</script>