This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<div class="sui-notice sui-notice-info">
<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( 'Bulk smush is running in the background.', 'wp-smushit' );
?>
</p>
</div>
</div>
</div>

View File

@ -0,0 +1,54 @@
<?php
/**
* Bulk compress dashboard meta box.
*
* @since 3.8.6
* @package WP_Smush
*
* @var int $uncompressed Number of uncompressed attachments.
* @var string $upsell_url Upsell URL.
* @var bool $background_processing_enabled Whether background processing is enabled or not.
* @var bool $background_in_processing Whether BO is in processing or not.
* @var int $total_count Total count.
*/
?>
<div class="sui-notice sui-notice-warning">
<div class="sui-notice-content">
<div class="sui-notice-message">
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
<p>
<?php
printf( /* translators: %d - number of uncompressed attachments */
esc_html__( 'You have %d images that needs compressing!', 'wp-smushit' ),
(int) $uncompressed
);
?>
</p>
</div>
</div>
</div>
<?php
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
$show_bulk_limit_notice = ! $bg_optimization->can_use_background();
if ( $show_bulk_limit_notice && $uncompressed > \Smush\Core\Core::MAX_FREE_BULK ) : ?>
<div class="sui-notice sui-notice-upsell">
<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
printf( /* translators: %1$s - opening <a> tag, %2$s - closing </a> tag, %3$s - number of images */
esc_html__( '%1$sUpgrade to Pro%2$s to bulk smush all images in one click. Free users can smush %3$s images per batch.', 'wp-smushit' ),
'<a href="' . esc_url( $upsell_url ) . '" target="_blank" class="smush-upsell-link">',
'</a>',
(int) \Smush\Core\Core::MAX_FREE_BULK
);
?>
</p>
</div>
</div>
</div>
<?php endif; ?>
<a href="<?php echo esc_url( $this->get_url( 'smush-bulk' ) ); ?>" class="sui-button sui-button-blue wp-smush-bulk-smush-link">
<?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?>
</a>

View File

@ -0,0 +1,11 @@
<div class="sui-notice sui-notice-info">
<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( 'We havent found any images in your media library yet so theres no compression to be done!', 'wp-smushit' ); ?></p>
</div>
</div>
</div>
<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>

View File

@ -0,0 +1,35 @@
<?php
/**
* Bulk compress dashboard meta box.
*
* @since 3.8.6
* @package WP_Smush
*
* @var int $uncompressed Number of uncompressed attachments.
* @var string $upsell_url Upsell URL.
* @var bool $background_processing_enabled Whether background processing is enabled or not.
* @var bool $background_in_processing Whether BO is in processing or not.
* @var int $total_count Total count.
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( $background_processing_enabled ) {
$msg = __( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk in the background without any quality loss.', 'wp-smushit' );
} else {
$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
if ( $background_in_processing ) {
$this->view( 'background-in-processing', array(), 'views/dashboard/bulk' );
} elseif ( 0 === $total_count ) {
$this->view( 'media-lib-empty', array(), 'views/dashboard/bulk' );
} elseif ( 0 === $uncompressed ) {
$this->view( 'all-images-smushed-notice', array( 'all_done' => true ), 'common' );
} else {
$this->view( 'exists-uncompressed', array( 'uncompressed' => $uncompressed, 'upsell_url' => $upsell_url ), 'views/dashboard/bulk' );
}