meta-box.php
2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?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.
*/
use Smush\Core\Core;
if ( ! defined( 'WPINC' ) ) {
die;
}
?>
<p>
<?php esc_html_e( 'Bulk Smush detects images that can be optimized and allows you to compress them in bulk.', 'wp-smushit' ); ?>
</p>
<?php if ( 0 === $uncompressed ) : ?>
<div class="sui-notice sui-notice-success">
<div class="sui-notice-content">
<div class="sui-notice-message">
<span class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></span>
<p><?php esc_html_e( 'All attachments have been smushed. Awesome!', 'wp-smushit' ); ?></p>
</div>
</div>
</div>
<?php else : ?>
<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 if ( ! WP_Smush::is_pro() && $uncompressed > 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) 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">
<?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?>
</a>
<?php endif; ?>