Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-smush.../app/views/bulk
File: meta-box.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Bulk Smush meta box.
[2] Fix | Delete
*
[3] Fix | Delete
* @since 2.9.0
[4] Fix | Delete
* @package WP_Smush
[5] Fix | Delete
*
[6] Fix | Delete
* @var Smush\Core\Core $core Instance of Smush\Core\Core
[7] Fix | Delete
* @var bool $hide_pagespeed Check whether to show PageSpeed recommendation or not.
[8] Fix | Delete
* @var bool $is_pro Check if PRO user or not.
[9] Fix | Delete
* @var bool $lossy_enabled Is lossy enabled.
[10] Fix | Delete
* @var integer $unsmushed_count Count of the images that need smushing.
[11] Fix | Delete
* @var integer $resmush_count Count of the images that need re-smushing.
[12] Fix | Delete
* @var integer $total_images_to_smush Total count of all images to smush. Unsmushed images + images to re-smush.
[13] Fix | Delete
* @var string $upgrade_url Upgrade to PRO link.
[14] Fix | Delete
* @var string $bulk_upgrade_url Bulk Smush upgrade to PRO url.
[15] Fix | Delete
*/
[16] Fix | Delete
[17] Fix | Delete
if ( ! defined( 'WPINC' ) ) {
[18] Fix | Delete
die;
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
?>
[22] Fix | Delete
[23] Fix | Delete
<?php if ( 0 !== absint( $core->total_count ) ) : ?>
[24] Fix | Delete
<p><?php esc_html_e( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk.', 'wp-smushit' ); ?></p>
[25] Fix | Delete
<?php endif; ?>
[26] Fix | Delete
[27] Fix | Delete
<?php
[28] Fix | Delete
// If there are no images in media library.
[29] Fix | Delete
if ( 0 === absint( $core->total_count ) ) {
[30] Fix | Delete
?>
[31] Fix | Delete
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
[32] Fix | Delete
<span class="wp-smush-no-image tc">
[33] Fix | Delete
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>"
[34] Fix | Delete
alt="<?php esc_attr_e( 'No attachments found - Upload some images', 'wp-smushit' ); ?>">
[35] Fix | Delete
</span>
[36] Fix | Delete
<?php endif; ?>
[37] Fix | Delete
<p class="wp-smush-no-images-content tc">
[38] Fix | Delete
<?php esc_html_e( 'We haven’t found any images in your media library yet so there’s no smushing to be done!', 'wp-smushit' ); ?><br>
[39] Fix | Delete
<?php esc_html_e( 'Once you upload images, reload this page and start playing!', 'wp-smushit' ); ?>
[40] Fix | Delete
</p>
[41] Fix | Delete
<span class="wp-smush-upload-images sui-no-padding-bottom tc">
[42] Fix | Delete
<a class="sui-button sui-button-blue tc" href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>">
[43] Fix | Delete
<?php esc_html_e( 'UPLOAD IMAGES', 'wp-smushit' ); ?>
[44] Fix | Delete
</a>
[45] Fix | Delete
</span>
[46] Fix | Delete
<?php
[47] Fix | Delete
return;
[48] Fix | Delete
}
[49] Fix | Delete
?>
[50] Fix | Delete
[51] Fix | Delete
<?php $this->view( 'progress-bar', array( 'count' => $total_images_to_smush ), 'common' ); ?>
[52] Fix | Delete
[53] Fix | Delete
<div class="smush-final-log sui-hidden">
[54] Fix | Delete
<div class="smush-bulk-errors"></div>
[55] Fix | Delete
<div class="smush-bulk-errors-actions sui-hidden">
[56] Fix | Delete
<a href="<?php echo esc_url( admin_url( 'upload.php' ) ); ?>" class="sui-button sui-button-icon sui-button-ghost">
[57] Fix | Delete
<i class="sui-icon-photo-picture" aria-hidden="true"></i>
[58] Fix | Delete
<?php esc_html_e( 'View all', 'wp-smushit' ); ?>
[59] Fix | Delete
</a>
[60] Fix | Delete
</div>
[61] Fix | Delete
</div>
[62] Fix | Delete
[63] Fix | Delete
<?php
[64] Fix | Delete
// This notice goes above the pagespeed recommendations in Pro.
[65] Fix | Delete
if ( $is_pro ) :
[66] Fix | Delete
$this->view( 'all-images-smushed-notice', array( 'all_done' => empty( $total_images_to_smush ) ), 'common' );
[67] Fix | Delete
endif;
[68] Fix | Delete
?>
[69] Fix | Delete
[70] Fix | Delete
<?php if ( ! $hide_pagespeed ) : ?>
[71] Fix | Delete
<div class="wp-smush-pagespeed-recommendation sui-border-frame <?php echo empty( $total_images_to_smush ) ? '' : 'sui-hidden'; ?>">
[72] Fix | Delete
[73] Fix | Delete
<p class="dismiss-recommendation sui-hidden-sm sui-hidden-md sui-hidden-lg" style="text-align: right;">
[74] Fix | Delete
<span class="sui-icon-close sui-sm" aria-hidden="true"></span>
[75] Fix | Delete
<?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?>
[76] Fix | Delete
</p>
[77] Fix | Delete
<span class="smush-recommendation-title">
[78] Fix | Delete
<?php esc_html_e( 'Still having trouble with PageSpeed tests? Give these a go…', 'wp-smushit' ); ?>
[79] Fix | Delete
</span>
[80] Fix | Delete
[81] Fix | Delete
<span class="dismiss-recommendation sui-actions-right sui-hidden-xs">
[82] Fix | Delete
<span class="sui-icon-close sui-sm" aria-hidden="true"></span>
[83] Fix | Delete
<?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?>
[84] Fix | Delete
</span>
[85] Fix | Delete
[86] Fix | Delete
<ol class="smush-recommendation-list">
[87] Fix | Delete
<?php if ( ! $is_pro ) : ?>
[88] Fix | Delete
<li class="smush-recommendation-lossy">
[89] Fix | Delete
<?php
[90] Fix | Delete
printf(
[91] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[92] Fix | Delete
esc_html__( 'Upgrade to Smush Pro for advanced lossy compression. %1$sTry pro free%2$s.', 'wp-smushit' ),
[93] Fix | Delete
'<a href="' . esc_url( $upgrade_url ) . '" target="_blank" style="color: #8D00B1;">',
[94] Fix | Delete
'</a>'
[95] Fix | Delete
);
[96] Fix | Delete
?>
[97] Fix | Delete
</li>
[98] Fix | Delete
<?php elseif ( ! $this->settings->get( 'lossy' ) ) : ?>
[99] Fix | Delete
<li class="smush-recommendation-lossy">
[100] Fix | Delete
<?php
[101] Fix | Delete
printf(
[102] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[103] Fix | Delete
esc_html__( 'Enable %1$sSuper-Smush%2$s for advanced lossy compression to optimize images further with almost no visible drop in quality.', 'wp-smushit' ),
[104] Fix | Delete
'<a href="#" class="wp-smush-lossy-enable">',
[105] Fix | Delete
'</a>'
[106] Fix | Delete
);
[107] Fix | Delete
?>
[108] Fix | Delete
</li>
[109] Fix | Delete
<?php endif; ?>
[110] Fix | Delete
<li class="smush-recommendation-resize">
[111] Fix | Delete
<?php
[112] Fix | Delete
if ( ! $is_pro ) :
[113] Fix | Delete
printf(
[114] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[115] Fix | Delete
esc_html__( ' %1$sRead article %2$s “How To Ace Google’s Image PageSpeed Recommendations With Smush”.', 'wp-smushit' ),
[116] Fix | Delete
'<a href="' . esc_url( 'https://goo.gl/kCqWxS' ) . '" target="_blank">',
[117] Fix | Delete
'</a>'
[118] Fix | Delete
);
[119] Fix | Delete
else :
[120] Fix | Delete
printf(
[121] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[122] Fix | Delete
esc_html__( 'Make sure your images are the right size for your theme. %1$sLearn more%2$s.', 'wp-smushit' ),
[123] Fix | Delete
'<a href="https://premium.wpmudev.org/blog/smush-pagespeed-image-compression/" target="_blank">',
[124] Fix | Delete
'</a>'
[125] Fix | Delete
);
[126] Fix | Delete
endif;
[127] Fix | Delete
?>
[128] Fix | Delete
</li>
[129] Fix | Delete
<?php if ( ! $this->settings->get( 'resize' ) ) : ?>
[130] Fix | Delete
<li class="smush-recommendation-resize-original">
[131] Fix | Delete
<?php
[132] Fix | Delete
printf(
[133] Fix | Delete
/* translators: %1$s: opening a tag, %2$s: closing a tag */
[134] Fix | Delete
esc_html__( 'Enable %1$sResize Full Size Images%2$s to scale big images down to a reasonable size and save a ton of space.', 'wp-smushit' ),
[135] Fix | Delete
'<a href="#" class="wp-smush-resize-enable">',
[136] Fix | Delete
'</a>'
[137] Fix | Delete
);
[138] Fix | Delete
?>
[139] Fix | Delete
</li>
[140] Fix | Delete
<?php endif; ?>
[141] Fix | Delete
</ol>
[142] Fix | Delete
</div>
[143] Fix | Delete
<?php endif; ?>
[144] Fix | Delete
[145] Fix | Delete
<?php
[146] Fix | Delete
// This notice goes below the pagespeed recommendations in Free.
[147] Fix | Delete
if ( ! $is_pro ) :
[148] Fix | Delete
$this->view( 'all-images-smushed-notice', array( 'all_done' => empty( $total_images_to_smush ) ), 'common' );
[149] Fix | Delete
endif;
[150] Fix | Delete
?>
[151] Fix | Delete
[152] Fix | Delete
<div class="wp-smush-bulk-wrapper sui-border-frame<?php echo empty( $total_images_to_smush ) ? ' sui-hidden' : ''; ?>">
[153] Fix | Delete
[154] Fix | Delete
<div id="wp-smush-bulk-content">
[155] Fix | Delete
<?php WP_Smush::get_instance()->admin()->print_pending_bulk_smush_content( $total_images_to_smush, $resmush_count, $unsmushed_count ); ?>
[156] Fix | Delete
</div>
[157] Fix | Delete
[158] Fix | Delete
<div id="wp-smush-all-button-container">
[159] Fix | Delete
<button type="button" class="wp-smush-all sui-button sui-button-blue" title="<?php esc_attr_e( 'Click to start Bulk Smushing images in Media Library', 'wp-smushit' ); ?>">
[160] Fix | Delete
<?php esc_html_e( 'BULK SMUSH NOW', 'wp-smushit' ); ?>
[161] Fix | Delete
</button>
[162] Fix | Delete
</div>
[163] Fix | Delete
[164] Fix | Delete
<?php if ( ! $is_pro ) : ?>
[165] Fix | Delete
<div id="wp-smush-bulk-smush-upsell-row" class="sui-row">
[166] Fix | Delete
<div class="sui-col-sm-6">
[167] Fix | Delete
<h3><?php esc_html_e( 'Free Trial + 30% Discount for Smush users!', 'wp-smushit' ); ?></h3>
[168] Fix | Delete
<p>
[169] Fix | Delete
<?php
[170] Fix | Delete
if ( Smush\Core\Core::$max_free_bulk < $total_images_to_smush ) :
[171] Fix | Delete
printf(
[172] Fix | Delete
/* translators: 1. total count of images to smush, 2. opening 'strong' tag, 3. closing 'strong' tag. */
[173] Fix | Delete
esc_html__( 'Bulk smush %2$sall your %1$s images%3$s in one-click and get a %2$s30%% Welcome Discount%3$s just for Smush Free users!', 'wp-smushit' ),
[174] Fix | Delete
esc_html( $total_images_to_smush ),
[175] Fix | Delete
'<strong>',
[176] Fix | Delete
'</strong>'
[177] Fix | Delete
);
[178] Fix | Delete
else :
[179] Fix | Delete
esc_html_e( 'Get Smush Pro and bulk optimize every image you’ve ever added to your site with one click.', 'wp-smushit' );
[180] Fix | Delete
endif;
[181] Fix | Delete
?>
[182] Fix | Delete
</p>
[183] Fix | Delete
[184] Fix | Delete
<a href="<?php echo esc_url( $bulk_upgrade_url ); ?>" class="sui-button sui-button-purple" target="_blank">
[185] Fix | Delete
<?php esc_html_e( 'Try pro absolutely free', 'wp-smushit' ); ?>
[186] Fix | Delete
</a>
[187] Fix | Delete
<p><small><?php esc_html_e( '*Discount applies to all annual plans.', 'wp-smushit' ); ?></small></p>
[188] Fix | Delete
</div>
[189] Fix | Delete
<div class="sui-col-sm-6 wp-smush-hidden-xl">
[190] Fix | Delete
<ul class="smush-pro-features">
[191] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[192] Fix | Delete
<?php esc_html_e( 'Fix Google PageSpeed image recommendations', 'wp-smushit' ); ?>
[193] Fix | Delete
</div></li>
[194] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[195] Fix | Delete
<?php esc_html_e( '10 GB Smush CDN', 'wp-smushit' ); ?>
[196] Fix | Delete
</div></li>
[197] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[198] Fix | Delete
<?php esc_html_e( 'Smush original images', 'wp-smushit' ); ?>
[199] Fix | Delete
</div></li>
[200] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[201] Fix | Delete
<?php esc_html_e( '2x better compression', 'wp-smushit' ); ?>
[202] Fix | Delete
</div></li>
[203] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[204] Fix | Delete
<?php esc_html_e( 'Serve a next-gen format with WebP conversion', 'wp-smushit' ); ?>
[205] Fix | Delete
</div></li>
[206] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[207] Fix | Delete
<?php esc_html_e( 'Copy your full size images', 'wp-smushit' ); ?>
[208] Fix | Delete
</div></li>
[209] Fix | Delete
</ul>
[210] Fix | Delete
</div>
[211] Fix | Delete
[212] Fix | Delete
<div class="sui-col-sm-3 wp-smush-show-xl">
[213] Fix | Delete
<ul class="smush-pro-features">
[214] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[215] Fix | Delete
<?php esc_html_e( 'Fix Google PageSpeed image recommendations', 'wp-smushit' ); ?>
[216] Fix | Delete
</div></li>
[217] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[218] Fix | Delete
<?php esc_html_e( '10 GB Smush CDN', 'wp-smushit' ); ?>
[219] Fix | Delete
</div></li>
[220] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[221] Fix | Delete
<?php esc_html_e( 'Smush original images', 'wp-smushit' ); ?>
[222] Fix | Delete
</div></li>
[223] Fix | Delete
</ul>
[224] Fix | Delete
</div>
[225] Fix | Delete
<div class="sui-col-sm-3 wp-smush-show-xl">
[226] Fix | Delete
<ul class="smush-pro-features">
[227] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[228] Fix | Delete
<?php esc_html_e( '2x better compression', 'wp-smushit' ); ?>
[229] Fix | Delete
</div></li>
[230] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[231] Fix | Delete
<?php esc_html_e( 'Serve a next-gen format with WebP conversion', 'wp-smushit' ); ?>
[232] Fix | Delete
</div></li>
[233] Fix | Delete
<li class="smush-pro-feature-row"><div class="smush-pro-feature-title">
[234] Fix | Delete
<?php esc_html_e( 'Copy your full size images', 'wp-smushit' ); ?>
[235] Fix | Delete
</div></li>
[236] Fix | Delete
</ul>
[237] Fix | Delete
</div>
[238] Fix | Delete
</div>
[239] Fix | Delete
[240] Fix | Delete
<?php endif; ?>
[241] Fix | Delete
[242] Fix | Delete
</div>
[243] Fix | Delete
[244] Fix | Delete
<?php
[245] Fix | Delete
if ( $is_pro && $lossy_enabled ) {
[246] Fix | Delete
?>
[247] Fix | Delete
<p class="wp-smush-enable-lossy tc sui-hidden">
[248] Fix | Delete
<?php esc_html_e( 'Tip: Enable Super-Smush in the Settings area to get even more savings with almost no visible drop in quality.', 'wp-smushit' ); ?>
[249] Fix | Delete
</p>
[250] Fix | Delete
<?php
[251] Fix | Delete
}
[252] Fix | Delete
[253] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function