function ewww_image_optimizer_bulk_loop()
{
global $ewww_debug;
global $ewww_exceed;
// verify that an authorized user has started the optimizer
$permissions = apply_filters('ewww_image_optimizer_bulk_permissions', '');
if (!wp_verify_nonce($_REQUEST['ewww_wpnonce'], 'ewww-image-optimizer-bulk') || !current_user_can($permissions)) {
wp_die(__('Cheatin’ eh?', EWWW_IMAGE_OPTIMIZER_DOMAIN));
}
if (!empty($_REQUEST['ewww_sleep'])) {
sleep($_REQUEST['ewww_sleep']);
}
// retrieve the time when the optimizer starts
$started = microtime(true);
// get the attachment ID of the current attachment
$attachment = $_POST['ewww_attachment'];
// get the 'bulk attachments' with a list of IDs remaining
$attachments = get_option('ewww_image_optimizer_bulk_attachments');
$meta = wp_get_attachment_metadata($attachment, true);
// do the optimization for the current attachment (including resizes)
$meta = ewww_image_optimizer_resize_from_meta_data($meta, $attachment, false);
if (!empty($ewww_exceed)) {
echo '-9exceeded';
die;
}
if (!empty($meta['file'])) {
// output the filename (and path relative to 'uploads' folder)
printf("<p>" . __('Optimized image:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <strong>%s</strong><br>", esc_html($meta['file']));
} else {
printf("<p>" . __('Skipped image, ID:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . " <strong>%s</strong><br>", $attachment);
}
if (!empty($meta['ewww_image_optimizer'])) {
// tell the user what the results were for the original image
printf(__('Full size – %s', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "<br>", $meta['ewww_image_optimizer']);
}
// check to see if there are resized version of the image
if (isset($meta['sizes']) && is_array($meta['sizes'])) {
// cycle through each resize
foreach ($meta['sizes'] as $size) {
if (!empty($size['ewww_image_optimizer'])) {
// output the results for the current resized version
printf("%s – %s<br>", $size['file'], $size['ewww_image_optimizer']);
}
}
}
// calculate how much time has elapsed since we started
$elapsed = microtime(true) - $started;
// output how much time has elapsed since we started
printf(__('Elapsed: %.3f seconds', EWWW_IMAGE_OPTIMIZER_DOMAIN) . "</p>", $elapsed);
global $ewww_attachment;
$ewww_attachment['id'] = $attachment;
$ewww_attachment['meta'] = $meta;
add_filter('w3tc_cdn_update_attachment_metadata', 'ewww_image_optimizer_w3tc_update_files');
// update the metadata for the current attachment
wp_update_attachment_metadata($attachment, $meta);
// remove the first element from the $attachments array
if (!empty($attachments)) {
array_shift($attachments);
}
// store the updated list of attachment IDs back in the 'bulk_attachments' option
update_option('ewww_image_optimizer_bulk_attachments', $attachments);
if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
echo '<div style="background-color:#ffff99;">' . $ewww_debug . '</div>';
}
ewww_image_optimizer_debug_log();
ewwwio_memory(__FUNCTION__);
die;
}
function ewww_manage_image_custom_column($column_name, $id)
{
// check to make sure we're outputing our custom column
if ($column_name == 'ewww_image_optimizer') {
// get the metadata
$meta = new flagMeta($id);
if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
$print_meta = print_r($meta->image->meta_data, TRUE);
$print_meta = preg_replace(array('/ /', '/\\n+/'), array(' ', '<br />'), $print_meta);
echo '<div style="background-color:#ffff99;font-size: 10px;padding: 10px;margin:-10px -10px 10px;line-height: 1.1em">' . $print_meta . '</div>';
}
// grab the image status from the meta
$status = $meta->image->meta_data['ewww_image_optimizer'];
$msg = '';
// get the image path from the meta
$file_path = $meta->image->imagePath;
// get the mimetype
$type = ewww_image_optimizer_mimetype($file_path, 'i');
// get the file size
$file_size = size_format(filesize($file_path), 2);
$file_size = str_replace('B ', 'B', $file_size);
$valid = true;
// if we don't have a valid tool for the image type, output the appropriate message
switch ($type) {
case 'image/jpeg':
if (!EWWW_IMAGE_OPTIMIZER_JPEGTRAN && !EWWW_IMAGE_OPTIMIZER_CLOUD) {
$valid = false;
$msg = '<br>' . sprintf(__('%s is missing', EWWW_IMAGE_OPTIMIZER_DOMAIN), '<em>jpegtran</em>');
}
break;
case 'image/png':
if (!EWWW_IMAGE_OPTIMIZER_PNGOUT && !EWWW_IMAGE_OPTIMIZER_OPTIPNG && !EWWW_IMAGE_OPTIMIZER_CLOUD) {
$valid = false;
$msg = '<br>' . sprintf(__('%s is missing', EWWW_IMAGE_OPTIMIZER_DOMAIN), '<em>optipng/pngout</em>');
}
break;
case 'image/gif':
if (!EWWW_IMAGE_OPTIMIZER_GIFSICLE && !EWWW_IMAGE_OPTIMIZER_CLOUD) {
$valid = false;
$msg = '<br>' . sprintf(__('%s is missing', EWWW_IMAGE_OPTIMIZER_DOMAIN), '<em>gifsicle</em>');
}
break;
default:
$valid = false;
}
// let user know if the file type is unsupported
if ($valid == false) {
_e('Unsupported file type', EWWW_IMAGE_OPTIMIZER_DOMAIN);
return;
}
// output the image status if we know it
if (!empty($status)) {
echo $status;
echo "<br>" . sprintf(__('Image Size: %s', EWWW_IMAGE_OPTIMIZER_DOMAIN), $file_size);
printf("<br><a href=\"admin.php?action=ewww_flag_manual&force=1&attachment_ID=%d\">%s</a>", $id, __('Re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN));
// otherwise, tell the user that they can optimize the image now
} else {
_e('Not processed', EWWW_IMAGE_OPTIMIZER_DOMAIN);
echo "<br>" . sprintf(__('Image Size: %s', EWWW_IMAGE_OPTIMIZER_DOMAIN), $file_size);
printf("<br><a href=\"admin.php?action=ewww_flag_manual&attachment_ID=%d\">%s</a>", $id, __('Optimize now!', EWWW_IMAGE_OPTIMIZER_DOMAIN));
}
}
}
function ewww_ngg_bulk_preview()
{
global $ewww_debug;
if (!empty($_POST['doaction'])) {
// if there is no requested bulk action, do nothing
if (empty($_REQUEST['bulkaction'])) {
return;
}
// if there is no media to optimize, do nothing
if (empty($_REQUEST['doaction']) || !is_array($_REQUEST['doaction'])) {
return;
}
}
list($fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count) = ewww_image_optimizer_count_optimized('ngg');
// make sure there are some attachments to process
if ($fullsize_count < 1) {
echo '<p>' . __('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
return;
}
// ewww_image_optimizer_cloud_verify(false);
?>
<div class="wrap">
<div id="icon-upload" class="icon32"></div><h2><?php
_e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</h2>
<?php
// Retrieve the value of the 'bulk resume' option and set the button text for the form to use
$resume = get_option('ewww_image_optimizer_bulk_ngg_resume');
if (empty($resume)) {
$button_text = __('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
} else {
$button_text = __('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
}
?>
<div id="ewww-bulk-loading"></div>
<div id="ewww-bulk-progressbar"></div>
<div id="ewww-bulk-counter"></div>
<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
<br /><input type="submit" class="button-secondary action" value="<?php
_e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
" />
</form>
<div id="ewww-bulk-status"></div>
<form class="ewww-bulk-form">
<p><label for="ewww-force" style="font-weight: bold"><?php
_e('Force re-optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</label> <input type="checkbox" id="ewww-force" name="ewww-force"></p>
<p><label for="ewww-delay" style="font-weight: bold"><?php
_e('Choose how long to pause between images (in seconds, 0 = disabled)', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</label> <input type="text" id="ewww-delay" name="ewww-delay" value="<?php
if ($delay = ewww_image_optimizer_get_option('ewww_image_optimizer_delay')) {
echo $delay;
} else {
echo 0;
}
?>
"></p>
<div id="ewww-delay-slider" style="width:50%"></div>
</form>
<div id="ewww-bulk-forms">
<p class="ewww-bulk-info"><?php
printf(__('%1$d images have been selected (%2$d unoptimized), with %3$d resizes (%4$d unoptimized).', EWWW_IMAGE_OPTIMIZER_DOMAIN), $fullsize_count, $unoptimized_count, $resize_count, $unoptimized_resize_count);
?>
<br />
<?php
_e('Previously optimized images will be skipped by default.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</p>
<form id="ewww-bulk-start" class="ewww-bulk-form" method="post" action="">
<input type="submit" class="button-secondary action" value="<?php
echo $button_text;
?>
" />
</form>
<?php
// if there is a previous bulk operation to resume, give the user the option to reset the resume flag
if (!empty($resume)) {
?>
<p class="ewww-bulk-info"><?php
_e('If you would like to start over again, press the Reset Status button to reset the bulk operation status.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</p>
<form id="ewww-bulk-reset" class="ewww-bulk-form" method="post" action="">
<?php
wp_nonce_field('ewww-image-optimizer-bulk-reset', 'ewww_wpnonce');
?>
<input type="hidden" name="ewww_reset" value="1">
<input type="submit" class="button-secondary action" value="<?php
_e('Reset Status', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
" />
</form>
<?php
}
echo '</div></div>';
if (ewww_image_optimizer_get_option('ewww_image_optimizer_debug')) {
//.........这里部分代码省略.........
function ewww_image_optimizer_aux_images_script($hook)
{
// make sure we are being called from the proper page
if ('ewww-image-optimizer-auto' !== $hook && empty($_REQUEST['scan'])) {
return;
}
global $ewww_debug;
global $wpdb;
$ewww_debug .= "<b>ewww_image_optimizer_aux_images_script()</b><br>";
// initialize the $attachments variable for auxiliary images
$attachments = null;
// check the 'bulk resume' option
$resume = get_option('ewww_image_optimizer_aux_resume');
// check if there is a previous bulk operation to resume
if (!empty($resume)) {
// retrieve the attachment IDs that have not been finished from the 'bulk attachments' option
$attachments = get_option('ewww_image_optimizer_aux_attachments');
} else {
// collect a list of images from the current theme
$child_path = get_stylesheet_directory();
$parent_path = get_template_directory();
$attachments = ewww_image_optimizer_image_scan($child_path);
if ($child_path !== $parent_path) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($parent_path));
}
// collect a list of images in auxiliary folders provided by user
if ($aux_paths = ewww_image_optimizer_get_option('ewww_image_optimizer_aux_paths')) {
foreach ($aux_paths as $aux_path) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($aux_path));
}
}
// collect a list of images for buddypress
if (is_plugin_active('buddypress/bp-loader.php') || function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('buddypress/bp-loader.php')) {
// get the value of the wordpress upload directory
$upload_dir = wp_upload_dir();
// scan the 'avatars' and 'group-avatars' folders for images
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/avatars'), ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/group-avatars'));
}
if (is_plugin_active('buddypress-activity-plus/bpfb.php') || function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('buddypress-activity-plus/bpfb.php')) {
// get the value of the wordpress upload directory
$upload_dir = wp_upload_dir();
// scan the 'avatars' and 'group-avatars' folders for images
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/bpfb'));
}
if (is_plugin_active('wp-symposium/wp-symposium.php') || function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('wp-symposium/wp-symposium.php')) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan(get_option('symposium_img_path')));
}
if (is_plugin_active('ml-slider/ml-slider.php') || function_exists('is_plugin_active_for_network') && is_plugin_active_for_network('ml-slider/ml-slider.php')) {
$slide_paths = array();
$sliders = get_posts(array('numberposts' => -1, 'post_type' => 'ml-slider', 'post_status' => 'any', 'fields' => 'ids'));
foreach ($sliders as $slider) {
$slides = get_posts(array('numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'attachment', 'post_status' => 'inherit', 'fields' => 'ids', 'tax_query' => array(array('taxonomy' => 'ml-slider', 'field' => 'slug', 'terms' => $slider))));
foreach ($slides as $slide) {
$backup_sizes = get_post_meta($slide, '_wp_attachment_backup_sizes', true);
$type = get_post_meta($slide, 'ml-slider_type', true);
$type = $type ? $type : 'image';
// backwards compatibility, fall back to 'image'
if ($type === 'image') {
foreach ($backup_sizes as $backup_size => $meta) {
if (preg_match('/resized-/', $backup_size)) {
$path = $meta['path'];
$image_size = filesize($path);
$query = $wpdb->prepare("SELECT id FROM {$wpdb->ewwwio_images} WHERE BINARY path LIKE %s AND image_size LIKE '{$image_size}'", $path);
$already_optimized = $wpdb->get_results($query);
$mimetype = ewww_image_optimizer_mimetype($path, 'i');
if (preg_match('/^image\\/(jpeg|png|gif)/', $mimetype) && empty($already_optimized)) {
$slide_paths[] = $path;
}
}
}
}
}
}
$attachments = array_merge($attachments, $slide_paths);
}
// store the filenames we retrieved in the 'bulk_attachments' option so we can keep track of our progress in the database
update_option('ewww_image_optimizer_aux_attachments', $attachments);
}
ewww_image_optimizer_debug_log();
// submit a couple variables to the javascript to work with
$attachments = json_encode($attachments);
if (!empty($_REQUEST['scan'])) {
if (empty($attachments)) {
_e('Nothing to optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
} else {
echo $attachments;
}
die;
} else {
return;
}
}
function ewww_image_optimizer_aux_images_script($hook)
{
ewwwio_debug_message('<b>' . __FUNCTION__ . '()</b>');
// make sure we are being called from the proper page
if ('ewww-image-optimizer-auto' !== $hook && empty($_REQUEST['ewww_scan'])) {
return;
}
session_write_close();
global $wpdb;
if (!empty($_REQUEST['ewww_force'])) {
ewwwio_debug_message('forcing re-optimize: true');
}
// initialize the $attachments variable for auxiliary images
$attachments = null;
// check the 'bulk resume' option
$resume = get_option('ewww_image_optimizer_aux_resume');
// check if there is a previous bulk operation to resume
if (!empty($resume)) {
ewwwio_debug_message('resuming from where we left off, no scanning needed');
// retrieve the attachment IDs that have not been finished from the 'bulk attachments' option
$attachments = get_option('ewww_image_optimizer_aux_attachments');
} else {
ewwwio_debug_message('getting fresh list of files to optimize');
$attachments = array();
// collect a list of images from the current theme
$child_path = get_stylesheet_directory();
$parent_path = get_template_directory();
$attachments = ewww_image_optimizer_image_scan($child_path);
if ($child_path !== $parent_path) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($parent_path));
}
if (!function_exists('is_plugin_active')) {
// need to include the plugin library for the is_plugin_active function
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// collect a list of images for buddypress
if (is_plugin_active('buddypress/bp-loader.php') || is_plugin_active_for_network('buddypress/bp-loader.php')) {
// get the value of the wordpress upload directory
$upload_dir = wp_upload_dir();
// scan the 'avatars' and 'group-avatars' folders for images
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/avatars'), ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/group-avatars'));
}
if (is_plugin_active('buddypress-activity-plus/bpfb.php') || is_plugin_active_for_network('buddypress-activity-plus/bpfb.php')) {
// get the value of the wordpress upload directory
$upload_dir = wp_upload_dir();
// scan the 'avatars' and 'group-avatars' folders for images
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($upload_dir['basedir'] . '/bpfb'));
}
if (is_plugin_active('grand-media/grand-media.php') || is_plugin_active_for_network('grand-media/grand-media.php')) {
// scan the grand media folder for images
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan(WP_CONTENT_DIR . '/grand-media'));
}
if (is_plugin_active('wp-symposium/wp-symposium.php') || is_plugin_active_for_network('wp-symposium/wp-symposium.php')) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan(get_option('symposium_img_path')));
}
if (is_plugin_active('ml-slider/ml-slider.php') || is_plugin_active_for_network('ml-slider/ml-slider.php')) {
$slide_paths = array();
$slides = $wpdb->get_col("\n\t\t\t\tSELECT wpposts.ID \n\t\t\t\tFROM {$wpdb->posts} wpposts \n\t\t\t\tINNER JOIN {$wpdb->term_relationships} term_relationships\n\t\t\t\t\t\tON wpposts.ID = term_relationships.object_id\n\t\t\t\tINNER JOIN {$wpdb->terms} wpterms \n\t\t\t\t\t\tON term_relationships.term_taxonomy_id = wpterms.term_id\n\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} term_taxonomy\n\t\t\t\t\t\tON wpterms.term_id = term_taxonomy.term_id\n\t\t\t\tWHERE \tterm_taxonomy.taxonomy = 'ml-slider'\n\t\t\t\t\tAND wpposts.post_type = 'attachment'\n\t\t\t\t");
foreach ($slides as $slide) {
$backup_sizes = get_post_meta($slide, '_wp_attachment_backup_sizes', true);
$type = get_post_meta($slide, 'ml-slider_type', true);
$type = $type ? $type : 'image';
// backwards compatibility, fall back to 'image'
if ($type === 'image') {
foreach ($backup_sizes as $backup_size => $meta) {
if (preg_match('/resized-/', $backup_size)) {
$path = $meta['path'];
$image_size = ewww_image_optimizer_filesize($path);
if (!$image_size) {
continue;
}
$already_optimized = ewww_image_optimizer_find_already_optimized($path);
$mimetype = ewww_image_optimizer_mimetype($path, 'i');
if (preg_match('/^image\\/(jpeg|png|gif)/', $mimetype) && empty($already_optimized)) {
$slide_paths[] = $path;
}
}
}
}
}
$attachments = array_merge($attachments, $slide_paths);
}
// collect a list of images in auxiliary folders provided by user
if ($aux_paths = ewww_image_optimizer_get_option('ewww_image_optimizer_aux_paths')) {
foreach ($aux_paths as $aux_path) {
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan($aux_path));
}
}
// scan images in two most recent media library folders if the option is enabled, and this is a scheduled optimization
if ('ewww-image-optimizer-auto' == $hook && ewww_image_optimizer_get_option('ewww_image_optimizer_include_media_paths')) {
// retrieve the location of the wordpress upload folder
$upload_dir = wp_upload_dir();
// retrieve the path of the upload folder
$upload_path = $upload_dir['basedir'];
$this_month = date('m');
$this_year = date('Y');
$attachments = array_merge($attachments, ewww_image_optimizer_image_scan("{$upload_path}/{$this_year}/{$this_month}/"));
if (class_exists('DateTime')) {
$date = new DateTime();
$date->sub(new DateInterval('P1M'));
//.........这里部分代码省略.........
function ewww_ngg_bulk_preview()
{
if (!empty($_REQUEST['doaction'])) {
// if there is no requested bulk action, do nothing
if (empty($_REQUEST['bulkaction'])) {
return;
}
// if there is no media to optimize, do nothing
if (empty($_REQUEST['doaction']) || !is_array($_REQUEST['doaction'])) {
return;
}
}
// retrieve the attachments array from the db
$attachments = get_option('ewww_image_optimizer_bulk_ngg_attachments');
// make sure there are some attachments to process
if (count($attachments) < 1) {
echo '<p>' . esc_html__('You do not appear to have uploaded any images yet.', EWWW_IMAGE_OPTIMIZER_DOMAIN) . '</p>';
return;
}
?>
<div class="wrap">
<h1><?php
esc_html_e('Bulk Optimize', EWWW_IMAGE_OPTIMIZER_DOMAIN);
if (ewww_image_optimizer_get_option('ewww_image_optimizer_cloud_key')) {
$verify_cloud = ewww_image_optimizer_cloud_verify(false);
echo '<a id="ewww-bulk-credits-available" target="_blank" class="page-title-action" style="float:right;" href="https://ewww.io/my-account/">' . esc_html__('Image credits available:', EWWW_IMAGE_OPTIMIZER_DOMAIN) . ' ' . ewww_image_optimizer_cloud_quota() . '</a>';
}
echo '</h1>';
// Retrieve the value of the 'bulk resume' option and set the button text for the form to use
$resume = get_option('ewww_image_optimizer_bulk_ngg_resume');
if (empty($resume)) {
$button_text = esc_attr__('Start optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
} else {
$button_text = esc_attr__('Resume previous bulk operation', EWWW_IMAGE_OPTIMIZER_DOMAIN);
}
?>
<div id="ewww-bulk-loading"></div>
<div id="ewww-bulk-progressbar"></div>
<div id="ewww-bulk-counter"></div>
<form id="ewww-bulk-stop" style="display:none;" method="post" action="">
<br /><input type="submit" class="button-secondary action" value="<?php
esc_attr_e('Stop Optimizing', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
" />
</form>
<div id="ewww-bulk-widgets" class="metabox-holder" style="display:none">
<div class="meta-box-sortables">
<div id="ewww-bulk-last" class="postbox">
<button type="button" class="handlediv button-link" aria-expanded="true">
<span class="screen-reader-text"><?php
esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
<h2 class="hndle"><span><?php
esc_html_e('Last Image Optimized', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</span></h2>
<div class="inside"></div>
</div>
</div>
<div class="meta-box-sortables">
<div id="ewww-bulk-status" class="postbox">
<button type="button" class="handlediv button-link" aria-expanded="true">
<span class="screen-reader-text"><?php
esc_html_e('Click to toggle', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
<h2 class="hndle"><span><?php
esc_html_e('Optimization Log', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</span></h2>
<div class="inside"></div>
</div>
</div>
</div>
<div id="ewww-bulk-forms">
<p class="ewww-bulk-info"><?php
printf(esc_html__('We have %d images to optimize.', EWWW_IMAGE_OPTIMIZER_DOMAIN), count($attachments));
?>
<br />
<?php
esc_html_e('Previously optimized images will be skipped by default.', EWWW_IMAGE_OPTIMIZER_DOMAIN);
?>
</p>
<form id="ewww-bulk-start" class="ewww-bulk-form" method="post" action="">
<input type="hidden" id="ewww-delay" name="ewww-delay" value="0">
<input type="submit" class="button-secondary action" value="<?php
echo $button_text;
?>
" />
</form>
<?php
// if there is a previous bulk operation to resume, give the user the option to reset the resume flag
if (!empty($resume)) {
?>
<p class="ewww-bulk-info"><?php
//.........这里部分代码省略.........
请发表评论