| @@ -1,18 +1,21 @@ | ||
| 1 | -<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?> | |
| 1 | +<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?> | |
| 2 | 2 | <div id="wpo_smush_settings"> |
| 3 | 3 | <div class="wpo-info"> |
| 4 | - <a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the image compression feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a> | |
| 4 | + <a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php esc_html_e('How to use the image compression feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php esc_html_e('Close', 'wp-optimize'); ?></span></a> | |
| 5 | 5 | <div class="wpo-info__content"> |
| 6 | - <p><strong><?php _e('Not sure how to use the image compression feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our howto video below.', 'wp-optimize'); ?></p> | |
| 6 | + <p><strong><?php esc_html_e('Not sure how to use the image compression feature?', 'wp-optimize'); ?></strong> <br><?php esc_html_e('Watch our how to video below.', 'wp-optimize'); ?></p> | |
| 7 | 7 | <div class="wpo-video-preview"> |
| 8 | - <a href="https://vimeo.com/333938451" data-embed="https://player.vimeo.com/video/333938451?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/image-compression-video-preview.png" alt="Video preview" /></a> | |
| 8 | + <a href="https://vimeo.com/1014326354" data-embed="https://player.vimeo.com/video/1014326354?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo esc_url(trailingslashit(WPO_PLUGIN_URL) . 'images/notices/video-thumb.jpg'); ?>" alt="<?php esc_attr_e('Video preview', 'wp-optimize'); ?>" /></a> | |
| 9 | 9 | </div> |
| 10 | - <small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/333938451" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small> | |
| 10 | + <small>(<?php esc_html_e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <?php $wp_optimize->wp_optimize_url('https://vimeo.com/1014326354', __('Open the video in a new window', 'wp-optimize')); ?></small> | |
| 11 | 11 | </div> |
| 12 | 12 | </div> |
| 13 | 13 | <p> |
| 14 | - <?php _e('Note: Currently this feature uses third party services from reSmush.it. The performance of this free image compression service may be limited for large workloads. We are working on a premium service.', 'wp-optimize'); ?> | |
| 14 | + <?php | |
| 15 | + // translators: %s is a link to reSmush.it website | |
| 16 | + printf(esc_html__('Note: Image optimization feature is offered via %s free API', 'wp-optimize'), '<a href="https://resmush.it/" target="_blank">reSmush.it</a>'); | |
| 17 | + ?> | |
| 15 | 18 | </p> |
| 16 | 19 | <div class="wpo-fieldgroup"> |
| 17 | 20 | <div class="autosmush wpo-fieldgroup__subgroup<?php echo $smush_options['autosmush'] ? ' active' : ''; ?>"> |
| 18 | 21 | <label class="switch" for="smush-automatically"> |
| @@ -18,11 +21,11 @@ | ||
| 18 | 21 | <label class="switch" for="smush-automatically"> |
| 19 | 22 | <input type="checkbox" id="smush-automatically" <?php checked($smush_options['autosmush']); ?> > |
| 20 | 23 | <span class="slider round"></span> |
| 21 | 24 | </label> |
| 22 | - <label for="smush-automatically"><?php _e('Automatically compress newly-added images', 'wp-optimize');?> | |
| 23 | - <span tabindex="0" data-tooltip="<?php echo __('The images will be added to a background queue, which will start automatically within the next hour.', 'wp-optimize').' '.__('This prevents the site from being slowed down during media uploads.', 'wp-optimize').' '.__('The time taken to complete the compression will depend upon the size and quantity of the images.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 25 | + <label for="smush-automatically"><?php esc_html_e('Automatically compress newly-added images', 'wp-optimize');?> | |
| 24 | 26 | </label> |
| 27 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr__('The images will be added to a background queue, which will start automatically within the next hour.', 'wp-optimize').' '.esc_attr__('This prevents the site from being slowed down during media uploads.', 'wp-optimize').' '.esc_attr__('The time taken to complete the compression will depend upon the size and quantity of the images.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 25 | 28 | </div> |
| 26 | 29 | |
| 27 | 30 | <div class="wpo-fieldgroup__subgroup"> |
| 28 | 31 | <label class="switch"> |
| @@ -29,113 +32,145 @@ | ||
| 29 | 32 | <input type="checkbox" id="smush-show-metabox" class="smush-options" <?php checked($smush_options['show_smush_metabox']); ?> > |
| 30 | 33 | <span class="slider round"></span> |
| 31 | 34 | </label> |
| 32 | 35 | <label for="smush-show-metabox" class="smush-options"> |
| 33 | - <?php _e('Show compression meta-box on an image\'s dashboard media page.', 'wp-optimize');?> | |
| 34 | - <span tabindex="0" data-tooltip="<?php esc_attr_e('The image compression metabox allows you to compress specific images from the media library. But if you are using a solution other than WP-Optimize to compress your images, you can hide these metaboxes by disabling this switch.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 36 | + <?php | |
| 37 | + esc_html_e('Show compression meta-box on an image\'s dashboard media page.', 'wp-optimize'); | |
| 38 | + $message = __('The image compression metabox allows you to compress specific images from the media library.', 'wp-optimize'); | |
| 39 | + $message .= ' '; | |
| 40 | + $message .= __('But if you are using a solution other than WP-Optimize to compress your images, you can hide these metaboxes by disabling this switch.', 'wp-optimize') | |
| 41 | + ?> | |
| 35 | 42 | </label> |
| 43 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($message);?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 36 | 44 | </div> |
| 37 | 45 | |
| 38 | 46 | <div class="compression_options"> |
| 39 | - <h3><?php _e('Compression options', 'wp-optimize');?></h3> | |
| 40 | - <input type="radio" id="enable_lossy_compression" name="compression_level" <?php checked($smush_options['image_quality'], 90); ?> class="smush-options compression_level"> | |
| 41 | - <label for="enable_lossy_compression"><?php _e('Prioritize maximum compression', 'wp-optimize');?></label> | |
| 42 | - <span tabindex="0" data-tooltip="<?php _e('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> | |
| 43 | - <br> | |
| 44 | - <input type="radio" id="enable_lossless_compression" <?php checked($smush_options['image_quality'], 100); ?>name="compression_level" class="smush-options compression_level"> | |
| 45 | - <label for="enable_lossless_compression"><?php _e('Prioritize retention of detail', 'wp-optimize');?></label> | |
| 46 | - <span tabindex="0" data-tooltip="<?php _e('Uses lossless compression, which results in much better image quality but lower file size savings per image', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 47 | + <h3><?php esc_html_e('Compression options', 'wp-optimize');?></h3> | |
| 48 | + <input type="radio" id="enable_lossy_compression" name="compression_level" <?php checked($smush_options['image_quality'], 60); ?> class="smush-options compression_level"> | |
| 49 | + <label for="enable_lossy_compression"><?php esc_html_e('Prioritize maximum compression', 'wp-optimize');?></label> | |
| 50 | + <?php | |
| 51 | + // This tooltip message is also located in /templates/admin-metabox-smush-settings.php. | |
| 52 | + $message = __('Uses lossy compression to ensure maximum savings per image.', 'wp-optimize'); | |
| 53 | + $message .= ' '; | |
| 54 | + $message .= __('The resulting images are of a slightly lower quality', 'wp-optimize'); | |
| 55 | + ?> | |
| 56 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($message); ?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 47 | 57 | <br> |
| 58 | + <input type="radio" id="enable_lossless_compression" <?php checked($smush_options['image_quality'], 92); ?>name="compression_level" class="smush-options compression_level"> | |
| 59 | + <label for="enable_lossless_compression"><?php esc_html_e('Prioritize retention of detail', 'wp-optimize');?></label> | |
| 60 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Uses lossless compression, which results in much better image quality but lower file size savings per image', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 61 | + <br> | |
| 48 | 62 | <input id="enable_custom_compression" <?php checked($custom); ?> type="radio" name="compression_level" class="smush-options compression_level"> |
| 49 | - <label for="enable_custom_compression"><?php _e('Custom', 'wp-optimize');?></label> | |
| 63 | + <label for="enable_custom_compression"><?php esc_html_e('Custom', 'wp-optimize');?></label> | |
| 50 | 64 | <br> |
| 51 | 65 | <div class="smush-options custom_compression" <?php if (!$custom) echo 'style="display:none;"';?> > |
| 52 | - <span class="slider-start"><?php _e('Maximum compression', 'wp-optimize');?></span> | |
| 53 | - <input id="custom_compression_slider" class="compression_level" data-max="Maximum Compression" type="range" step="5" value="<?php echo $smush_options['image_quality']; ?>" min="60" max="85" list="number" /> | |
| 66 | + <span class="slider-start"><?php esc_html_e('Maximum compression', 'wp-optimize');?></span> | |
| 67 | + <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 esc_attr($smush_options['image_quality']); ?>" min="65" max="90" list="number" /> | |
| 54 | 68 | <datalist id="number"> |
| 55 | - <option value="60"/> | |
| 56 | 69 | <option value="65"/> |
| 57 | 70 | <option value="70"/> |
| 58 | 71 | <option value="75"/> |
| 59 | 72 | <option value="80"/> |
| 60 | 73 | <option value="85"/> |
| 74 | + <option value="90"/> | |
| 61 | 75 | </datalist> |
| 62 | - <span class="slider-end"><?php _e('Best image quality', 'wp-optimize');?></span> | |
| 76 | + <span class="slider-end"><?php esc_html_e('Best image quality', 'wp-optimize');?></span> | |
| 63 | 77 | </div> |
| 64 | - <p><?php _e('Not sure what to choose?', 'wp-optimize'); ?> <a href="https://getwpo.com/lossy-vs-lossless-image-compression-a-guide-to-the-trade-off-between-image-size-and-quality/" target="_blank"><?php _e('Read our article "Lossy vs Lossless image compression"', 'wp-optimize'); ?></a></p> | |
| 65 | - <?php if (defined('WPO_USE_WEBP_CONVERSION') && true === WPO_USE_WEBP_CONVERSION) : ?> | |
| 66 | - <h3><?php _e('WebP conversion', 'wp-optimize');?></h3> | |
| 67 | - <?php | |
| 68 | - $converters = WP_Optimize()->get_options()->get_option('webp_converters', false); | |
| 69 | - if (!$does_server_allows_local_webp_conversion) { | |
| 70 | - printf('<p>%1$s</p>', __('Note: Local WebP conversion tools are not allowed on your server.', 'wp-optimize')); | |
| 71 | - } elseif (!empty($converters)) { | |
| 72 | - printf('<p>%1$s <strong>' . implode(', ', $converters) . '</strong></p>', __('Available WebP conversion tools:', 'wp-optimize')); | |
| 78 | + <p><?php esc_html_e('Not sure what to choose?', 'wp-optimize'); ?> <?php $wp_optimize->wp_optimize_url('https://teamupdraft.com/blog/lossy-vs-lossless-image-compression/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=lossy-vs-lossless-article-from-compress-tab&utm_creative_format=text', __('Read our article "Lossy vs Lossless image compression"', 'wp-optimize')); ?></p> | |
| 79 | + | |
| 80 | + <?php if (WPO_USE_WEBP_CONVERSION) : ?> | |
| 81 | + <h3><?php esc_html_e('WebP conversion', 'wp-optimize');?></h3> | |
| 82 | + | |
| 83 | + <?php if ($does_server_allow_local_webp_conversion) : ?> | |
| 84 | + <input type="checkbox" id="enable_webp_conversion" name="webp_conversion" <?php checked($smush_options['webp_conversion']); ?> class="smush-options webp_conversion"> | |
| 85 | + <label for="enable_webp_conversion"><?php esc_html_e('Create WebP version of image', 'wp-optimize');?></label> | |
| 86 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Creates WebP image format and serves it whenever possible.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 87 | + <br> | |
| 88 | + | |
| 89 | + <?php | |
| 90 | + $converters = WP_Optimize()->get_options()->get_option('webp_converters', false); | |
| 91 | + if ($smush_options['webp_conversion'] && !empty($converters)) { | |
| 92 | + printf('<p>%1$s <strong>%2$s</strong></p>', esc_html__('Available WebP conversion tools:', 'wp-optimize'), esc_html(implode(', ', $converters))); | |
| 93 | + } | |
| 73 | 94 | ?> |
| 74 | - <input type="checkbox" id="enable_webp_conversion" name="webp_conversion" <?php checked($smush_options['webp_conversion']); ?> class="smush-options webp_conversion"> | |
| 75 | - <label for="enable_webp_conversion"><?php _e('Create WebP version of image', 'wp-optimize');?></label> | |
| 76 | - <span tabindex="0" data-tooltip="<?php _e('Creates WebP image format and serves it whenever possible.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 77 | - <br> | |
| 78 | - <?php | |
| 79 | - } else { | |
| 80 | - printf('<p>%1$s</p>', __('No WebP conversion tools are available on your web-server.', 'wp-optimize')); | |
| 81 | - } | |
| 82 | - endif; | |
| 83 | - ?> | |
| 95 | + <?php else: ?> | |
| 96 | + <?php printf('<p>%1$s</p>', esc_html__('Note: Local WebP conversion tools are not allowed on your server.', 'wp-optimize')); ?> | |
| 97 | + <?php endif; ?> | |
| 98 | + | |
| 99 | + <?php endif; ?> | |
| 84 | 100 | </div> |
| 85 | - <button type="button" class="button button-link wpo-toggle-advanced-options"><span class="text"><span class="dashicons dashicons-arrow-down-alt2"></span> <span class="wpo-toggle-advanced-options__text-show"><?php _e('Show advanced options', 'wp-optimize');?></span><span class="wpo-toggle-advanced-options__text-hide"><?php _e('Hide advanced options', 'wp-optimize');?></span></span></button> | |
| 101 | + <button type="button" class="button button-link wpo-toggle-advanced-options"><span class="text"><span class="dashicons dashicons-arrow-down-alt2"></span> <span class="wpo-toggle-advanced-options__text-show"><?php esc_html_e('Show advanced options', 'wp-optimize');?></span><span class="wpo-toggle-advanced-options__text-hide"><?php esc_html_e('Hide advanced options', 'wp-optimize');?></span></span></button> | |
| 86 | 102 | <div class="smush-advanced wpo-advanced-options"> |
| 103 | + <?php if ($does_server_allow_local_webp_conversion && !empty($converters)) : ?> | |
| 104 | + <button type="button" id="wpo_reset_webp_serving_method" class="wpo_primary_small button"><?php esc_html_e('Reset WebP serving method', 'wp-optimize'); ?></button> | |
| 105 | + <span id="wpo_reset_webp_serving_method_done" class="display-none"><span class="dashicons dashicons-yes"></span> <?php esc_html_e('The WebP serving method has been reset', 'wp-optimize');?></span> | |
| 106 | + <?php endif; ?> | |
| 87 | 107 | <div class="compression_server"> |
| 88 | - <h3><?php _e('Compression service', 'wp-optimize');?></h3> | |
| 108 | + <h3><?php esc_html_e('Compression service', 'wp-optimize');?></h3> | |
| 89 | 109 | <div> <input type="radio" name="compression_server" id="resmushit" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?> > |
| 90 | - <label for="resmushit"> | |
| 91 | - <h4><?php _e('reSmush.it', 'wp-optimize');?></h4> | |
| 92 | - <p><?php _e('Can keep EXIF data', 'wp-optimize');?></p> | |
| 93 | - <small><?php _e('Service provided by reSmush.it', 'wp-optimize'); ?></small> | |
| 94 | - </label> | |
| 110 | + <div id="wpo-resmushit-details"> | |
| 111 | + <h4><?php esc_html_e('reSmush.it', 'wp-optimize');?></h4> | |
| 112 | + <p><?php esc_html_e('Can keep EXIF data', 'wp-optimize');?></p> | |
| 113 | + <small><?php echo esc_html($compression_server_hint); ?></small> | |
| 114 | + </div> | |
| 95 | 115 | </div> |
| 96 | 116 | </div> |
| 97 | 117 | <br> |
| 98 | - <h3><?php _e('More options', 'wp-optimize');?></h3> | |
| 118 | + <h3><?php esc_html_e('More options', 'wp-optimize');?></h3> | |
| 99 | 119 | <div class="image_options"> |
| 100 | 120 | <input type="checkbox" id="smush-preserve-exif" class="smush-options preserve_exif" <?php checked($smush_options['preserve_exif']); ?> > |
| 101 | - <label for="smush-preserve-exif" class="smush-options preserve_exif"><?php _e('Preserve EXIF data', 'wp-optimize');?></label> | |
| 121 | + <label for="smush-preserve-exif" class="smush-options preserve_exif"><?php esc_html_e('Preserve EXIF data', 'wp-optimize');?></label> | |
| 102 | 122 | <br> |
| 103 | - <input type="checkbox" id="smush-backup-original" class="smush-options back_up_original" <?php checked($smush_options['back_up_original']); ?> > | |
| 104 | - <label for="smush-backup-original"><?php _e('Backup original images', 'wp-optimize');?></label> | |
| 105 | - <span tabindex="0" data-tooltip="<?php _e('The original images are stored alongside the compressed images, you can visit the edit screen of the individual images in the Media Library to restore them.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 123 | + <input type="checkbox" id="smush-backup-original" class="smush-options" <?php checked($smush_options['back_up_original']); ?> > | |
| 124 | + <label for="smush-backup-original"><?php esc_html_e('Backup original images', 'wp-optimize');?></label> | |
| 125 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The original images are stored alongside the compressed images, you can visit the edit screen of the individual images in the Media Library to restore them.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 106 | 126 | <br> |
| 107 | - <input type="checkbox" id="smush-backup-delete" class="smush-options back_up_original" <?php checked($smush_options['back_up_delete_after']); ?> > | |
| 108 | - <label for="smush-backup-delete"><?php _e('Automatically delete image backups after', 'wp-optimize');?><input id="smush-backup-delete-days" type="number" min="1" value="<?php echo (0 !== intval($smush_options['back_up_delete_after_days'])) ? intval($smush_options['back_up_delete_after_days']) : 50; ?>"><?php _e('days', 'wp-optimize');?></label><label> — <?php _e('or', 'wp-optimize'); ?></label> <button type="button" id="wpo_smush_delete_backup_btn" class="wpo_primary_small button"><?php _e('Delete all backup images now', 'wp-optimize'); ?></button> | |
| 109 | - <img id="wpo_smush_delete_backup_spinner" class="display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="..."> | |
| 127 | + <input type="checkbox" id="smush-backup-delete" class="smush-options" <?php checked($smush_options['back_up_delete_after']); ?> > | |
| 128 | + <label for="smush-backup-delete-days"><?php esc_html_e('Automatically delete image backups after', 'wp-optimize');?><input id="smush-backup-delete-days" type="number" min="1" value="<?php echo (0 !== intval($smush_options['back_up_delete_after_days'])) ? intval($smush_options['back_up_delete_after_days']) : 50; ?>"><?php esc_html_e('days', 'wp-optimize');?></label><label> — <?php esc_html_e('or', 'wp-optimize'); ?></label> <button type="button" id="wpo_smush_delete_backup_btn" class="wpo_primary_small button"><?php esc_html_e('Delete all backup images now', 'wp-optimize'); ?></button> | |
| 129 | + <img id="wpo_smush_delete_backup_spinner" class="display-none" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="..."> | |
| 110 | 130 | <span id="wpo_smush_delete_backup_done" class="dashicons dashicons-yes display-none save-done"></span> |
| 111 | 131 | <br> |
| 112 | - <button type="button" id="wpo_smush_mark_all_as_uncompressed_btn" class="wpo_primary_small button"><?php _e('Mark all images as uncompressed', 'wp-optimize'); ?></button> | |
| 132 | + <button type="button" id="wpo_smush_mark_all_as_uncompressed_btn" class="wpo_primary_small button"><?php esc_html_e('Mark all images as uncompressed', 'wp-optimize'); ?></button> | |
| 113 | 133 | <br> |
| 114 | 134 | <br> |
| 115 | - <button type="button" id="wpo_smush_restore_all_compressed_images_btn" class="wpo_primary_small button"><?php _e('Restore all compressed images', 'wp-optimize'); ?></button> <span tabindex="0" data-tooltip="<?php esc_attr_e('Only the original image will be restored. In order to restore the other sizes, you should use a plugin such as "Regenerate Thumbnails".', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 135 | + <button type="button" id="wpo_smush_restore_all_compressed_images_btn" class="wpo_primary_small button"><?php esc_html_e('Restore all compressed images', 'wp-optimize'); ?></button> | |
| 136 | + <?php | |
| 137 | + $message = __('Only the original image will be restored.', 'wp-optimize'); | |
| 138 | + $message .= ' '; | |
| 139 | + $message .= __('In order to restore the other sizes, you should use a plugin such as "Regenerate Thumbnails".', 'wp-optimize'); | |
| 140 | + ?> | |
| 141 | + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($message);?>"><span class="dashicons dashicons-editor-help"></span> </span> | |
| 116 | 142 | </div> |
| 117 | 143 | </div> |
| 118 | 144 | <div class="save-options"> |
| 119 | - <input type="button" id="wpo_smush_images_save_options_button" style="display:none" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Save options', 'wp-optimize'); ?>" /> | |
| 120 | - <img id="wpo_smush_images_save_options_spinner" class="display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="..."> | |
| 121 | - <span id="wpo_smush_images_save_options_done" class="display-none"><span class="dashicons dashicons-yes"></span> <?php _e('Saved options', 'wp-optimize');?></span> | |
| 122 | - <span id="wpo_smush_images_save_options_fail" class="display-none"><span class="dashicons dashicons-no"></span> <?php _e('Failed to save options', 'wp-optimize');?></span> | |
| 145 | + <img id="wpo_smush_images_save_options_spinner" class="display-none" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="..."> | |
| 146 | + <span id="wpo_smush_images_save_options_done" class="display-none"><span class="dashicons dashicons-yes"></span> <?php esc_html_e('Saved options', 'wp-optimize');?></span> | |
| 147 | + <span id="wpo_smush_images_save_options_fail" class="display-none"><span class="dashicons dashicons-no"></span> <?php esc_html_e('Failed to save options', 'wp-optimize');?></span> | |
| 123 | 148 | </div> |
| 124 | 149 | </div> |
| 125 | 150 | |
| 126 | 151 | <div class="uncompressed-images"> |
| 127 | - <h3><?php _e('Uncompressed images', 'wp-optimize');?></h3> | |
| 152 | + <h3><?php esc_html_e('Uncompressed images', 'wp-optimize');?></h3> | |
| 153 | + <?php if (is_multisite()) : ?> | |
| 154 | + <div id="wpo_uncompressed_images_sites_select_container"> | |
| 155 | + <label for="wpo_uncompressed_images_sites_select"><?php esc_html_e('Select site', 'wp-optimize');?> </label> | |
| 156 | + <select id="wpo_uncompressed_images_sites_select" class="wpo-select2"> | |
| 157 | + <?php foreach ($sites as $site) : ?> | |
| 158 | + <option value="<?php echo esc_attr($site->blog_id); ?>"><?php echo esc_html($site->domain . $site->path); ?></option> | |
| 159 | + <?php endforeach; ?> | |
| 160 | + </select> | |
| 161 | + </div> | |
| 162 | + <?php endif; ?> | |
| 128 | 163 | <div class="wpo_smush_images_buttons_wrap"> |
| 129 | 164 | <div class="smush-select-actions. align-left"> |
| 130 | - <a href="javascript:;" id="wpo_smush_images_select_all"><?php _e('Select all', 'wp-optimize');?></a> / | |
| 131 | - <a href="javascript:;" id="wpo_smush_images_select_none"><?php _e('Select none', 'wp-optimize');?></a> | |
| 165 | + <a href="javascript:;" id="wpo_smush_images_select_all"><?php esc_html_e('Select all', 'wp-optimize');?></a> / | |
| 166 | + <a href="javascript:;" id="wpo_smush_images_select_none"><?php esc_html_e('Select none', 'wp-optimize');?></a> | |
| 132 | 167 | </div> |
| 133 | 168 | <div class="smush-refresh-icon align-right"> |
| 134 | - <a href="javascript:;" id="wpo_smush_images_refresh" class="wpo-refresh-button"><?php _e('Refresh image list', 'wp-optimize');?> | |
| 169 | + <a href="javascript:;" id="wpo_smush_images_refresh" class="wpo-refresh-button"><?php esc_html_e('Refresh image list', 'wp-optimize');?> | |
| 135 | 170 | <span class="dashicons dashicons-image-rotate"></span> |
| 136 | 171 | </a> |
| 137 | - <img class="wpo_smush_images_loader" width="16" height="16" src="<?php echo admin_url(); ?>/images/spinner-2x.gif" /> | |
| 172 | + <img class="wpo_smush_images_loader" width="16" height="16" src="<?php echo esc_url(admin_url('/images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="..." /> | |
| 138 | 173 | </div> |
| 139 | 174 | </div> |
| 140 | 175 | <div id="wpo_smush_images_grid"></div> |
| 141 | 176 | <div class="smush-actions"> |
| @@ -143,74 +178,5 @@ | ||
| 143 | 178 | <input type="button" id="wpo_smush_mark_as_compressed" class="wpo_primary_small button align-left" value="<?php esc_attr_e('Mark as already compressed', 'wp-optimize'); ?>" /> |
| 144 | 179 | <input type="button" id="wpo_smush_get_logs" class="wpo_smush_get_logs wpo_primary_small button-primary align-right" value="<?php esc_attr_e('View logs', 'wp-optimize'); ?>" /> |
| 145 | 180 | </div> |
| 146 | 181 | </div> |
| 147 | -</div> | |
| 148 | - | |
| 149 | -<div id="wpo_smush_images_information_container" style="display:none;"> | |
| 150 | - <div id="wpo_smush_images_information_wrapper"> | |
| 151 | - <h3 id="wpo_smush_images_information_heading"><?php _e('Compressing images', 'wp-optimize');?></h3> | |
| 152 | - <h4 id="wpo_smush_images_information_server"></h4> | |
| 153 | - <div class="progress-bar orange stripes"> | |
| 154 | - <span style="width: 100%"></span> | |
| 155 | - </div> | |
| 156 | - <p><?php _e('The selected images are being processed; please do not close the browser', 'wp-optimize');?></p> | |
| 157 | - <table id="smush_stats" class="smush_stats_table"> | |
| 158 | - <tbody> | |
| 159 | - <tr class="smush_stats_row"> | |
| 160 | - <td> <?php _e('Images pending', 'wp-optimize');?></td> | |
| 161 | - <td id="smush_stats_pending_images"> ...</td> | |
| 162 | - </tr> | |
| 163 | - <tr class="smush_stats_row"> | |
| 164 | - <td> <?php _e('Images completed', 'wp-optimize');?></td> | |
| 165 | - <td id="smush_stats_completed_images"> ...</td> | |
| 166 | - </tr> | |
| 167 | - <tr class="smush_stats_row"> | |
| 168 | - <td> <?php _e('Size savings', 'wp-optimize');?></td> | |
| 169 | - <td id="smush_stats_bytes_saved"> ...</td> | |
| 170 | - </tr> | |
| 171 | - <tr class="smush_stats_row"> | |
| 172 | - <td> <?php _e('Average savings per image', 'wp-optimize');?></td> | |
| 173 | - <td id="smush_stats_percent_saved"> ...</td> | |
| 174 | - </tr> | |
| 175 | - <tr class="smush_stats_row"> | |
| 176 | - <td> <?php _e('Time elapsed', 'wp-optimize');?></td> | |
| 177 | - <td id="smush_stats_timer"> </td> | |
| 178 | - </tr> | |
| 179 | - </tbody> | |
| 180 | - </table> | |
| 181 | - </div> | |
| 182 | - <input type="button" id="wpo_smush_images_pending_tasks_cancel_button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" /> | |
| 183 | -</div> | |
| 184 | - | |
| 185 | -<div id="smush-complete-summary" class="complete-animation" style="display:none;"> | |
| 186 | - <span class="dashicons dashicons-no-alt close"></span> | |
| 187 | - <div class="animation"> | |
| 188 | - <div class="checkmark-circle"> | |
| 189 | - <div class="background"></div> | |
| 190 | - <div class="checkmark draw"></div> | |
| 191 | - </div> | |
| 192 | - </div> | |
| 193 | - <div id="summary-message"></div> | |
| 194 | - <input type="button" id="wpo_smush_get_logs" class="wpo_smush_get_logs wpo_primary_small button-primary" value="<?php esc_attr_e('View logs', 'wp-optimize'); ?>" /> | |
| 195 | - <input type="button" id="wpo_smush_clear_stats_btn" class="wpo_primary_small button-primary align-right" value="<?php esc_attr_e('Clear compression statistics', 'wp-optimize'); ?>" /> | |
| 196 | - <img id="wpo_smush_images_clear_stats_spinner" class="display-none align-right" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="..."> | |
| 197 | - <span id="wpo_smush_images_clear_stats_done" class="dashicons dashicons-yes display-none save-done align-right"></span> | |
| 198 | - <span class="clearfix"></span> | |
| 199 | - <input type="button" class="wpo_primary_small button-primary wpo_smush_stats_cta_btn" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" /> | |
| 200 | -</div> | |
| 201 | - | |
| 202 | -<div id="smush-log-modal" class="complete-animation" style="display:none;"> | |
| 203 | - <div id="log-panel"></div> | |
| 204 | - <a href="#" class="wpo_primary_small button-primary"> <?php _e('Download log file', 'wp-optimize'); ?></a> | |
| 205 | - <input type="button" class="wpo_primary_small button-primary close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" /> | |
| 206 | -</div> | |
| 207 | - | |
| 208 | -<div id="smush-information-modal" style="display:none;"> | |
| 209 | - <div class="smush-information"></div> | |
| 210 | - <input type="button" class="wpo_primary_small button-primary information-modal-close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" /> | |
| 211 | -</div> | |
| 212 | - | |
| 213 | -<div id="smush-information-modal-cancel-btn" style="display:none;"> | |
| 214 | - <div class="smush-information"></div> | |
| 215 | - <input type="button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" /> | |
| 216 | 182 | </div> |