CMS Project Sync
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
<div class="sui-box-body" style="padding: 6px 25px; display:flex; align-items: center;">
|
||||
<img style="margin-right: 15px" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-config-icon.png' ); ?>" srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-config-icon.png' ); ?> 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-config-icon@2x.png' ); ?> 2x" alt="<?php esc_attr_e( 'Smush Logo', 'wp-smushit' ); ?>"/>
|
||||
<p>
|
||||
<span style="display:block; margin-bottom:10px;">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Opening strong tag, 2: Closing strong tag */
|
||||
esc_html__( 'Optimization is in progress. Please %1$sdo not close this tab or navigate away%2$s from this page, to avoid process failure.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Notification for auto Bulk Smush on scan completed while re-checking images.
|
||||
*/
|
||||
?>
|
||||
<div class="sui-notice sui-notice-grey wp-smush-auto-bulk-smush-notification sui-hidden">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
|
||||
<p>
|
||||
<?php
|
||||
esc_html_e( 'Once Smush completes the recheck process it will begin the Smush, it is recommended to keep this page open to initiate bulk image compression.', 'wp-smushit' );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$docs_link = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_troubleshooting_docs_cron_disabled',
|
||||
),
|
||||
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#troubleshooting-guide'
|
||||
);
|
||||
?>
|
||||
<div class="sui-notice sui-notice-warning smush-cron-disabled-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s1$d - Open link, %2$s - Close the link */
|
||||
esc_html__( 'It seems cron is disabled on your site. Please enable cron before running Bulk Smush to ensure everything works as expected. %1$sLearn More%2$s', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( $docs_link ) . '" target="_blank"><strong>',
|
||||
'</strong></a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="sui-notice-actions"><button class="sui-button-icon" data-notice-close="smush-box-cron-disabled-notice" type="button"><span class="sui-icon-check" aria-hidden="true"></span><span class="sui-screen-reader-text"><?php esc_html_e( 'Close this notice', 'wp-smushit' ); ?></span></button></div>
|
||||
</div>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Show Unlimited upsell on Bulk Smush completed.
|
||||
*
|
||||
* @var string $bulk_upgrade_url Upgrade pro url.
|
||||
* @var string $global_upsell_desc Upgrade pro notice description.
|
||||
*/
|
||||
?>
|
||||
<div class="sui-box-body sui-margin-top wp-smush-global-upsell wp-smush-upsell-on-completed sui-hidden">
|
||||
<div class="smush-box-image">
|
||||
<img class="sui-image-icon" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/global-upsell-icon.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/global-upsell-icon@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush Upsell Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="sui-box-content">
|
||||
<p>
|
||||
<?php echo esc_html( $global_upsell_desc ); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url( $bulk_upgrade_url ); ?>" class="smush-upsell-link" target="_blank">
|
||||
<?php
|
||||
esc_html_e( 'Get Smush Pro', 'wp-smushit' );
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* Hub connect section template for Smush bulk optimization page.
|
||||
*
|
||||
* @package WP_Smush
|
||||
* @since 3.22.0
|
||||
*
|
||||
* @var int $images_count Number of images found for optimization.
|
||||
* @var string $connect_url URL for connecting to WPMU DEV.
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="smush-hub-connect">
|
||||
<div class="smush-hub-connect-box sui-box-body">
|
||||
<div class="smush-connect-message sui-block-content-center sui-message sui-margin-top sui-spacing-top--40">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/hub-connect.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/hub-connect@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_attr_e( 'Graphic CDN', 'wp-smushit' ); ?>">
|
||||
|
||||
<div class="smush-connect-content sui-message-content">
|
||||
<?php if ( ! is_network_admin() && $images_count > 0 ) : ?>
|
||||
<p class="smush-images-found-text sui-no-margin">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: number of images found */
|
||||
esc_html__( 'Smush found %s images waiting to be compressed', 'wp-smushit' ),
|
||||
'<strong>' . esc_html( $images_count ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<h2 class="smush-connect-title">
|
||||
<?php esc_html_e( 'Connect Now to Unlock Bulk Smush', 'wp-smushit' ); ?>
|
||||
</h2>
|
||||
|
||||
<p class="smush-connect-description sui-no-margin">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s: opening strong tag, %2$s: closing strong tag */
|
||||
esc_html__( 'To start smushing your images, you\'ll just need to connect your site to WPMU DEV. It\'s %1$stotally free%2$s. It\'ll take just a %1$sfew seconds%2$s and there\'s %1$sno credit card%2$s needed or fiddly API key copy-pasting involved.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>',
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<a href="<?php echo esc_url( $connect_url ); ?>"
|
||||
class="smush-connect-button sui-button sui-button-blue sui-margin-top smush-button-dark-blue"
|
||||
>
|
||||
<?php esc_html_e( 'CONNECT MY SITE', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="smush-hub-connect-benefits">
|
||||
<div class="smush-benefits-container sui-box-body">
|
||||
<h2 class="smush-benefits-title sui-box-body sui-spacing-bottom--50">
|
||||
<?php esc_html_e( 'When you connect, you\'ll get', 'wp-smushit' ); ?>
|
||||
</h2>
|
||||
|
||||
<div class="smush-benefits-grid benefits-grid sui-margin-bottom">
|
||||
<div class="smush-benefit-item benefit-item">
|
||||
<div class="smush-benefit-icon benefit-icon">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/api-connect-icon.svg' ); ?>" alt="<?php esc_attr_e( 'Bulk Smush API Access Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="smush-benefit-content benefit-content">
|
||||
<h3 class="smush-benefit-title">
|
||||
<?php esc_html_e( 'Instant access to Bulk Smush API', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<p class="smush-benefit-description">
|
||||
<?php esc_html_e( 'Optimize everything in your Media Library to make your site as light as a feather.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="smush-benefit-item benefit-item">
|
||||
<div class="smush-benefit-icon benefit-icon">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/unlimited-smush-icon.svg' ); ?>" alt="<?php esc_attr_e( 'Unlimited Smushing Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="smush-benefit-content benefit-content">
|
||||
<h3 class="smush-benefit-title">
|
||||
<?php esc_html_e( 'Unlimited Bulk Smushing', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<p class="smush-benefit-description">
|
||||
<?php esc_html_e( 'Compress ALL your images - no limits or additional credits required.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="smush-benefit-item benefit-item">
|
||||
<div class="smush-benefit-icon benefit-icon">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/directory-smush-icon.svg' ); ?>" alt="<?php esc_attr_e( 'PNG to JPEG Conversion Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="smush-benefit-content benefit-content">
|
||||
<h3 class="smush-benefit-title">
|
||||
<?php esc_html_e( 'Directory Smush', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<p class="smush-benefit-description">
|
||||
<?php esc_html_e( 'Automatically bulk Smush images in a directory outside the Media Library.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="smush-benefit-item benefit-item">
|
||||
<div class="smush-benefit-icon benefit-icon">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/auto-smush-icon.svg' ); ?>"
|
||||
alt="<?php esc_attr_e( 'Auto-Smushing Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="smush-benefit-content benefit-content">
|
||||
<h3 class="smush-benefit-title">
|
||||
<?php esc_html_e( 'Auto-Smushing on Upload', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<p class="smush-benefit-description">
|
||||
<?php esc_html_e( 'Optimize all new images as soon as they\'re uploaded, keeping your site fast effortlessly.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Limit reached notice metabox on bulk smush page.
|
||||
*
|
||||
* @var bool $smush_type Whether the notice is for directory smush or bulk smush.
|
||||
*/
|
||||
$smush_type = $smush_type ?? 'bulk-smush';
|
||||
?>
|
||||
<div id="<?php echo esc_attr( $smush_type ); ?>-limit-reached-notice" class="sui-notice sui-notice-warning sui-hidden smush-limit-reached-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
$is_directory_smush = 'directory-smush' === $smush_type;
|
||||
$upgrade_url = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => $is_directory_smush ? 'smush_directory_smush_paused_50_limit' : 'smush_bulk_smush_paused_50_limit',
|
||||
)
|
||||
);
|
||||
printf(
|
||||
/* translators: %s1$d - bulk smush limit, %2$s - upgrade link, %3$s - <strong>, %4$s - </strong>, %5$s - Bulk Smush limit */
|
||||
esc_html__( 'The free version of Smush only allows you to compress %1$d images at a time. Skip limits, save time. Bulk Smush unlimited images — %2$sGet Smush Pro!%3$s', 'wp-smushit' ),
|
||||
(int) Smush\Core\Core::get_bulk_pause_limit(),
|
||||
'<a class="smush-upsell-link" href="' . esc_url( $upgrade_url ) . '" target="_blank">',
|
||||
'</a>',
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<div class="smush-final-log bulk-smush-final-log sui-hidden">
|
||||
<div class="smush-bulk-error-header">
|
||||
<div class="smush-bulk-error-row">
|
||||
<div class="smush-bulk-image-data">
|
||||
<div class="smush-bulk-image-title">
|
||||
<?php esc_html_e( 'File Name', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
<div class="smush-image-error"><?php esc_html_e( 'Status', 'wp-smushit' ); ?></div>
|
||||
</div>
|
||||
<div class="smush-bulk-image-actions">
|
||||
<?php esc_html_e( 'Actions', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="smush-bulk-errors"></div>
|
||||
<div class="smush-bulk-errors-actions sui-hidden">
|
||||
<a href="<?php echo esc_url( apply_filters( 'smush_unsmushed_media_filter_url', admin_url( 'upload.php?mode=list&attachment-filter=post_mime_type:image&smush-filter=failed_processing' ) ) ); ?>" class="sui-button">
|
||||
<i class="sui-icon-eye" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'View all in library', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<span class="sui-button sui-button-ghost wp_smush_ignore_all_failed_items">
|
||||
<?php esc_html_e( 'Ignore all', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* Compression Level.
|
||||
*
|
||||
* @var $name string Compression field name.
|
||||
* @var $value mixed Current compression value.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
$settings = Settings::get_instance();
|
||||
$lossy_level_setting = $settings->get_lossy_level_setting();
|
||||
$level_basic = Settings::get_level_lossless();
|
||||
$level_super = Settings::get_level_super_lossy();
|
||||
$level_ultra = Settings::get_level_ultra_lossy();
|
||||
$level_labels = array(
|
||||
Settings::get_level_lossless() => __( 'Basic', 'wp-smushit' ),
|
||||
Settings::get_level_super_lossy() => __( 'Super', 'wp-smushit' ),
|
||||
Settings::get_level_ultra_lossy() => __( 'Ultra', 'wp-smushit' ),
|
||||
);
|
||||
|
||||
$level_notices = array(
|
||||
Settings::get_level_lossless() => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sBasic:%2$s Achieve flawless, lossless compression for pixel-perfect images. Minimal file size reduction, negligible impact on speed.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
Settings::get_level_super_lossy() => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sSuper:%2$s Harness the power of lossy compression for substantial file size reduction with excellent image clarity. Accelerate page loads for better performance.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
Settings::get_level_ultra_lossy() => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sUltra:%2$s Unlock unprecedented compression levels up to 5x greater than Super, while preserving remarkable image quality. The ultimate choice for unparalleled performance.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="sui-tabs sui-side-tabs wp-smush-lossy-level-tabs">
|
||||
<div role="tablist" class="sui-tabs-menu">
|
||||
<!-- Basic -->
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
id="lossy-level__basic"
|
||||
class="sui-tab-item<?php echo $level_basic === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-controls="lossy-level__basic-notice">
|
||||
<?php echo esc_html( $settings->get_lossy_level_label( $level_basic ) ); ?>
|
||||
</button>
|
||||
<input
|
||||
type="radio"
|
||||
class="sui-screen-reader-text"
|
||||
aria-hidden="true"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
value="<?php echo (int) $level_basic; ?>"
|
||||
<?php checked( $lossy_level_setting, $level_basic, true ); ?> />
|
||||
|
||||
<!-- Super -->
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
id="lossy-level__super"
|
||||
class="sui-tab-item<?php echo $level_super === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-controls="lossy-level__super-notice"
|
||||
tabindex="-1">
|
||||
<?php echo esc_html( $settings->get_lossy_level_label( $level_super ) ); ?>
|
||||
</button>
|
||||
<input
|
||||
type="radio"
|
||||
class="sui-screen-reader-text"
|
||||
aria-hidden="true"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
value="<?php echo (int) $level_super; ?>"
|
||||
<?php checked( $lossy_level_setting, $level_super, true ); ?> />
|
||||
<!-- Ultra -->
|
||||
<?php
|
||||
$utm_link = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_ultra_bulksmush_radio',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<a target="_blank" href="<?php echo esc_url( $utm_link ); ?>" class="sui-tab-item wp-smush-ultra-compression-link wp-smush-upsell-ultra-compression">
|
||||
<?php esc_html_e( '🚀 Ultra - unlock 5x more compression', 'wp-smushit' ); ?>
|
||||
<span class="sui-icon-open-new-window" aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="sui-tabs-content">
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__basic-notice"
|
||||
class="sui-tab-content<?php echo $level_basic === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__basic"
|
||||
tabindex="0">
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_basic ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__super-notice"
|
||||
class="sui-tab-content<?php echo $level_super === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__super"
|
||||
tabindex="0"
|
||||
hidden>
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_super ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__ultra-notice"
|
||||
class="sui-tab-content<?php echo $level_ultra === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__ultra"
|
||||
tabindex="0"
|
||||
hidden>
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_ultra ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<div class="sui-message">
|
||||
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_attr_e( 'No attachments found - Upload some images', 'wp-smushit' ); ?>"
|
||||
class="sui-image"
|
||||
>
|
||||
|
||||
<div class="sui-message-content">
|
||||
<p>
|
||||
<?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>
|
||||
<?php esc_html_e( 'Once you upload images, reload this page and start playing!', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<a class="sui-button sui-button-blue" href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>">
|
||||
<?php esc_html_e( 'UPLOAD IMAGES', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk Smush meta box header.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Title.
|
||||
*/
|
||||
use Smush\Core\Next_Gen\Next_Gen_Manager;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$start_bulk_webp_conversion = ! empty( $_GET['smush-action'] ) && 'start-bulk-next-gen-conversion' === wp_unslash( $_GET['smush-action'] );
|
||||
$next_gen_manager = Next_Gen_Manager::get_instance();
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title">
|
||||
<?php
|
||||
echo esc_html( $title );
|
||||
if ( $start_bulk_webp_conversion ) {
|
||||
echo ' ';
|
||||
// translators: %s - Next-Gen Conversion.
|
||||
printf( esc_html__( 'with %s Conversion', 'wp-smushit' ), esc_html( $next_gen_manager->get_active_format_name() ) );
|
||||
}
|
||||
?>
|
||||
</h3>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<small>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - a href opening tag, %2$s - a href closing tag */
|
||||
esc_html__( 'Smush individual images via your %1$sMedia Library%2$s', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( admin_url( 'upload.php' ) ) . '" title="' . esc_html__( 'Media Library', 'wp-smushit' ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</small>
|
||||
</div>
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk Smush meta box.
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var Smush\Core\Core $core Instance of Smush\Core\Core
|
||||
* @var bool $total_count
|
||||
* @var integer $unsmushed_count Count of the images that need smushing.
|
||||
* @var integer $resmush_count Count of the images that need re-smushing.
|
||||
* @var integer $remaining_count Remaining count of all images to smush. Unsmushed images + images to re-smush.
|
||||
* @var string $bulk_upgrade_url Bulk Smush upgrade to PRO url.
|
||||
* @var string $upsell_cdn_url Upsell CDN URL.
|
||||
* @var string $in_processing_notice
|
||||
*/
|
||||
use Smush\Core\Stats\Global_Stats;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
if ( 0 !== absint( $total_count ) ) :
|
||||
$msg = __( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk.', 'wp-smushit' );
|
||||
?>
|
||||
<p><?php echo esc_html( $msg ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$this->view(
|
||||
'loopback-error-dialog',
|
||||
array(),
|
||||
'modals'
|
||||
);
|
||||
|
||||
// If there are no images in media library.
|
||||
if ( 0 === absint( $total_count ) ) {
|
||||
$this->view( 'media-lib-empty', array(), 'views/bulk' );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view(
|
||||
'auto-bulk-smush-notification',
|
||||
array(),
|
||||
'views/bulk'
|
||||
);
|
||||
|
||||
$this->view(
|
||||
'limit-reached-notice',
|
||||
array(),
|
||||
'views/bulk'
|
||||
);
|
||||
// Progress bar.
|
||||
$this->view(
|
||||
'progress-bar',
|
||||
array(
|
||||
'count' => $remaining_count,
|
||||
'in_processing_notice' => $in_processing_notice,
|
||||
),
|
||||
'common'
|
||||
);
|
||||
|
||||
// All images are smushed.
|
||||
$this->view( 'all-images-smushed-notice', array( 'all_done' => empty( $remaining_count ) ), 'common' );
|
||||
|
||||
// List errors.
|
||||
$this->view( 'list-errors', array(), 'views/bulk' );
|
||||
|
||||
?>
|
||||
<div class="wp-smush-bulk-wrapper sui-border-frame<?php echo empty( $remaining_count ) ? ' sui-hidden' : ''; ?>">
|
||||
<div id="wp-smush-bulk-content">
|
||||
<?php WP_Smush::get_instance()->admin()->print_pending_bulk_smush_content( $remaining_count, $resmush_count, $unsmushed_count ); ?>
|
||||
</div>
|
||||
<?php
|
||||
$bulk_smush_class = 'wp-smush-all';
|
||||
|
||||
if ( Global_Stats::get()->is_outdated() ) {
|
||||
$bulk_smush_class .= ' wp-smush-scan-and-bulk-smush';
|
||||
}
|
||||
|
||||
?>
|
||||
<button type="button" class="<?php echo esc_attr( $bulk_smush_class ); ?> sui-button sui-button-blue" title="<?php esc_attr_e( 'Click to start Bulk Smushing images in Media Library', 'wp-smushit' ); ?>">
|
||||
<?php esc_html_e( 'BULK SMUSH', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php
|
||||
$global_upsell_desc = __( 'Smush Pro lets you optimize in the background. Unlock Ultra Smush, blazing-fast CDN, and more.', 'wp-smushit' );
|
||||
|
||||
$this->view(
|
||||
'global-upsell',
|
||||
array(
|
||||
'bulk_upgrade_url' => $bulk_upgrade_url,
|
||||
'global_upsell_desc' => $global_upsell_desc,
|
||||
),
|
||||
'views/bulk'
|
||||
);
|
||||
Reference in New Issue
Block a user