| 1 |
<?php if (!defined('WPO_VERSION')) die('No direct access.'); ?> |
| 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');?>"> |
| 9 |
</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> |
| 12 |
</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'], 60); ?>> |
| 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="65" max="85" list="number" /> |
| 31 |
<datalist id="number"> |
| 32 |
<option value="65"/> |
| 33 |
<option value="70"/> |
| 34 |
<option value="75"/> |
| 35 |
<option value="80"/> |
| 36 |
<option value="85"/> |
| 37 |
</datalist> |
| 38 |
<span class="alignright"><?php _e('Best image quality', 'wp-optimize');?></span> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<a href="#" class="wpo-toggle-advanced-options wpo_smush_single_image" <?php echo $smush_display; ?>><?php _e('Show advanced options', 'wp-optimize');?></a> |
| 42 |
<div class='smush-advanced wpo-advanced-options'> |
| 43 |
<h4><?php _e('Service provider', 'wp-optimize');?></h4> |
| 44 |
<fieldset class="compression_server"> |
| 45 |
<label for="resmushit"> |
| 46 |
<input type="radio" id="resmushit" name="compression_server_<?php echo $post_id; ?>" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?>> |
| 47 |
<a href="http://resmush.it" target="_blank"><?php _e('reSmush.it', 'wp-optimize');?></a> |
| 48 |
</label> |
| 49 |
</fieldset> |
| 50 |
<h4><?php _e('Other options', 'wp-optimize');?></h4> |
| 51 |
<fieldset class="other_options"> |
| 52 |
<label for='smush_backup_<?php echo $post_id; ?>'> |
| 53 |
<input type='checkbox' name='smush_backup_<?php echo $post_id; ?>' id='smush_backup_<?php echo $post_id; ?>' <?php checked($smush_options['back_up_original']); ?>> |
| 54 |
<span><?php _e('Backup original', 'wp-optimize'); ?></span> |
| 55 |
</label> |
| 56 |
<label for='smush_exif_<?php echo $post_id; ?>'> |
| 57 |
<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']); ?>> |
| 58 |
<span><?php _e('Keep EXIF data', 'wp-optimize'); ?></span> |
| 59 |
</label> |
| 60 |
</fieldset> |
| 61 |
</div> |
| 62 |
|
| 63 |
<?php if ($compressed_by_another_plugin) { ?> |
| 64 |
<p><b><?php _e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p> |
| 65 |
<?php } ?> |
| 66 |
|
| 67 |
<div class='wpo_smush_single_image action_button' <?php echo $smush_display; ?> > |
| 68 |
<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'); ?>'/> |
| 69 |
</div> |
| 70 |
|
| 71 |
<div class='wpo_smush_mark_single_image action_button' <?php echo $smush_mark; ?> > |
| 72 |
<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'); ?>'/> |
| 73 |
</div> |
| 74 |
|
| 75 |
<div class='wpo_smush_unmark_single_image action_button' <?php echo $smush_unmark; ?> > |
| 76 |
<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'); ?>'/> |
| 77 |
</div> |
| 78 |
|
| 79 |
<?php |
| 80 |
|
| 81 |
$menu_page_url = menu_page_url('wpo_images', false); |
| 82 |
|
| 83 |
if ('' === $menu_page_url && !is_multisite()) { |
| 84 |
$menu_page_url = admin_url('admin.php?page=wpo_images'); |
| 85 |
} |
| 86 |
|
| 87 |
if (is_multisite()) { |
| 88 |
$menu_page_url = network_admin_url('admin.php?page=wpo_images'); |
| 89 |
} |
| 90 |
?> |
| 91 |
<div class="smush-metabox-dashboard-link"> |
| 92 |
<a href="<?php echo $menu_page_url; ?>"><?php _e('WP-Optimize image settings', 'wp-optimize'); ?></a> |
| 93 |
</div> |
| 94 |
</div> |
| 95 |
|
| 96 |
<div id="smush-information-modal" class="wp-core-ui" style="display:none;"> |
| 97 |
<div class="smush-information"></div> |
| 98 |
<input type="button" class="wpo_primary_small button-primary information-modal-close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" /> |
| 99 |
</div> |
| 100 |
|
| 101 |
<div id="smush-information-modal-cancel-btn" style="display:none;"> |
| 102 |
<div class="smush-information"></div> |
| 103 |
<input type="button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" /> |
| 104 |
</div> |
| 105 |
|
| 106 |
<script type="text/javascript">jQuery(document).trigger('admin-metabox-smush-loaded');</script> |
| 107 |
|