PluginProbe ʕ •ᴥ•ʔ
TinyPNG – JPEG, PNG & WebP image compression / 3.6.4
TinyPNG – JPEG, PNG & WebP image compression v3.6.4
3.8.0 3.7.0 3.6.14 trunk 1.0.0 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.4.0 1.5.0 1.6.0 1.7.0 1.7.1 1.7.2 2.0.0 2.0.1 2.0.2 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.0.0 3.0.1 3.1.0 3.2.0 3.2.1 3.3 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.10 3.6.11 3.6.12 3.6.13 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9
tiny-compress-images / src / views / bulk-optimization.php
tiny-compress-images / src / views Last commit date
account-status-connected.php 11 months ago account-status-create-advanced.php 11 months ago account-status-create-simple.php 4 years ago account-status-loading.php 4 years ago bulk-optimization-form.php 1 year ago bulk-optimization-upgrade-notice.php 4 years ago bulk-optimization.php 1 year ago compress-details-processing.php 4 years ago compress-details.php 10 months ago dashboard-widget.php 1 year ago optimization-chart.php 4 years ago settings.php 11 months ago
bulk-optimization.php
275 lines
1 <style>
2
3 /* Admin color scheme colors */
4
5 div.tiny-bulk-optimization div.available div.tooltip span.dashicons {
6 color: <?php echo $admin_colors[3] ?>;
7 }
8 div.tiny-bulk-optimization div.savings div.tiny-optimization-chart div.value {
9 color: <?php echo $admin_colors[2] ?>;
10 }
11 div.tiny-bulk-optimization div.savings div.tiny-optimization-chart svg circle.main {
12 stroke: <?php echo $admin_colors[2] ?>;
13 }
14 div.tiny-bulk-optimization div.savings table td.emphasize {
15 color: <?php echo $admin_colors[2] ?>;
16 }
17 div.tiny-bulk-optimization div.dashboard div.optimize div.progressbar div.progress {
18 background-color: <?php echo $admin_colors[0] ?>;
19 background-image: linear-gradient(
20 -63deg,
21 <?php echo $admin_colors[0] ?> 0%,
22 <?php echo $admin_colors[0] ?> 25%,
23 <?php echo $admin_colors[1] ?> 25%,
24 <?php echo $admin_colors[1] ?> 50%,
25 <?php echo $admin_colors[0] ?> 50%,
26 <?php echo $admin_colors[0] ?> 75%,
27 <?php echo $admin_colors[1] ?> 75%,
28 <?php echo $admin_colors[1] ?> 100%
29 );
30 }
31
32 </style>
33
34 <div class="wrap tiny-bulk-optimization tiny-compress-images" id="tiny-bulk-optimization">
35 <div class="icon32" id="icon-upload"><br></div>
36 <h2><?php esc_html_e( 'Bulk Optimization', 'tiny-compress-images' ) ?></h2>
37 <div class="dashboard">
38 <div class="statistics">
39 <div class="available">
40 <div class="inner">
41 <h3><?php esc_html_e( 'Available Images', 'tiny-compress-images' ) ?></h3>
42 <p>
43 <?php
44 if ( 0 == $stats['optimized-image-sizes'] + $stats['available-unoptimized-sizes'] ) {
45 $percentage = 0;
46 } else {
47 $percentage_of_files = round( $stats['optimized-image-sizes'] / ( $stats['optimized-image-sizes'] + $stats['available-unoptimized-sizes'] ) * 100, 2 );
48 }
49 if ( 0 == $stats['uploaded-images'] + $stats['available-unoptimized-sizes'] ) {
50 esc_html_e( 'This page is designed to bulk optimize all your images.', 'tiny-compress-images' );
51 echo ' ';
52 esc_html_e( 'You do not seem to have uploaded any JPEG, PNG or WebP images yet.', 'tiny-compress-images' );
53 } elseif ( 0 == sizeof( $active_tinify_sizes ) ) {
54 esc_html_e( 'Based on your current settings, nothing will be optimized. There are no active sizes selected for optimization.', 'tiny-compress-images' );
55 } elseif ( 0 == $stats['available-unoptimized-sizes'] ) {
56 /* translators: %s: friendly user name */
57 printf( esc_html__( '%s, this is great! Your entire library is optimized!', 'tiny-compress-images' ), $this->friendly_user_name() );
58 } elseif ( $stats['optimized-image-sizes'] > 0 ) {
59 if ( $percentage_of_files > 75 ) {
60 /* translators: %s: friendly user name */
61 printf( esc_html__( '%s, you are doing great!', 'tiny-compress-images' ), $this->friendly_user_name() );
62 } else {
63 /* translators: %s: friendly user name */
64 printf( esc_html__( '%s, you are doing good.', 'tiny-compress-images' ), $this->friendly_user_name() );
65 }
66 echo ' ';
67 /* translators: %1$d%2$s: percentage optimised */
68 printf( esc_html__( '%1$d%2$s of your image library is optimized.', 'tiny-compress-images' ), $percentage_of_files, '%' );
69 echo ' ';
70 /* translators: %s: bulk optimization title */
71 printf( esc_html__( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ), esc_html__( 'bulk optimization', 'tiny-compress-images' ) );
72 } else {
73 esc_html_e( 'Here you can start optimizing your entire library. Press the big button to start improving your website speed instantly!', 'tiny-compress-images' );
74 }
75 ?>
76 </p>
77 <?php if ( Tiny_Settings::wr2x_active() ) { ?>
78 <p>
79 <?php esc_html_e( 'Notice that the WP Retina 2x sizes will not be compressed using this page. You will need to bulk generate the retina sizes separately from the WP Retina 2x page.', 'tiny-compress-images' ); ?>
80 </p>
81 <?php } ?>
82 <table class="totals">
83 <tr>
84 <td class="item">
85 <h3>
86 <?php echo wp_kses( __( 'Uploaded <br> images', 'tiny-compress-images' ), array(
87 'br' => array(),
88 ) ) ?>
89 </h3>
90 <span id="uploaded-images">
91 <?php echo $stats['uploaded-images']; ?>
92 </span>
93 </td>
94 <td class="item">
95 <h3>
96 <?php echo wp_kses( __( 'Unoptimized <br> image sizes', 'tiny-compress-images' ), array(
97 'br' => array(),
98 ) ) ?>
99 </h3>
100 <span id="optimizable-image-sizes">
101 <?php echo $stats['available-unoptimized-sizes'] ?>
102 </span>
103 <div class="tooltip">
104 <span class="dashicons dashicons-info"></span>
105 <div class="tip">
106 <?php if ( $stats['uploaded-images'] > 0 && sizeof( $active_tinify_sizes ) > 0 && $stats['available-unoptimized-sizes'] > 0 ) { ?>
107 <p>
108 <?php
109 /* translators: %1$s: number of sizes that can be optimised, %2$s number of images */
110 printf( esc_html__( 'With your current settings you can still optimize %1$s image sizes from your %2$s uploaded JPEG, PNG, and WebP images.',
111 'tiny-compress-images'), $stats['available-unoptimized-sizes'], $stats['uploaded-images'] );
112 ?>
113 </p>
114 <?php } ?>
115 <p>
116 <?php
117 if ( 0 == sizeof( $active_tinify_sizes ) ) {
118 esc_html_e( 'Based on your current settings, nothing will be optimized. There are no active sizes selected for optimization.', 'tiny-compress-images' );
119 } else {
120 esc_html_e( 'These sizes are currently activated for optimization:', 'tiny-compress-images' );
121 echo '<ul>';
122 for ( $i = 0; $i < sizeof( $active_tinify_sizes ); ++$i ) {
123 $name = $active_tinify_sizes[ $i ];
124 if ( '0' == $name ) {
125 echo '<li>- ' . esc_html__( 'Original image', 'tiny-compress-images' ) . '</li>';
126 } else {
127 echo '<li>- ' . esc_html( ucfirst( $name ) ) . '</li>';
128 }
129 }
130 echo '</ul>';
131 }
132 ?>
133 </p>
134 <p>
135 <?php if ( sizeof( $active_tinify_sizes ) > 0 ) { ?>
136 <?php
137 /* translators: %d: number of sizes to be compressed */
138 printf( wp_kses( _n( 'For each uploaded image <strong>%d size</strong> is optimized.', 'For each uploaded image <strong>%d sizes</strong> are optimized.', count( $active_tinify_sizes ), 'tiny-compress-images' ), array(
139 'strong' => array(),
140 ) ), count( $active_tinify_sizes ) ) ?>
141 <?php } ?>
142 <?php
143 /* translators: %s: link to settings page saying here */
144 printf( wp_kses( __( 'You can change these settings %s.', 'tiny-compress-images' ), array(
145 'a' => array(
146 'href' => array(),
147 ),
148 ) ), '<a href=' . admin_url( 'options-general.php?page=tinify' ) . '>' . __( 'here', 'tiny-compress-images' ) . '</a>' )?>
149 </p>
150 </div>
151 </div>
152 </td>
153 <td class="item costs">
154 <h3>
155 <?php echo wp_kses( __( 'Estimated <br> cost', 'tiny-compress-images' ), array(
156 'br' => array(),
157 ) ) ?>
158 </h3>
159 <span id="estimated-cost">$ <?php echo number_format( $estimated_costs, 2 ) ?></span>
160 USD
161 <?php if ( $estimated_costs > 0 ) { ?>
162 <div class="tooltip">
163 <span class="dashicons dashicons-info"></span>
164 <div class="tip">
165 <p><?php
166 /* translators: %1$d %2$s: number of image sizes, %3$s: link saying upgrade here */
167 printf( wp_kses( __( 'If you wish to compress more than <strong>%1$d %2$s</strong> a month and you are still on a free account %3$s.', 'tiny-compress-images' ),
168 array(
169 'strong' => array(),
170 'a' => array(
171 'href' => array(),
172 ),
173 ) ), Tiny_Config::MONTHLY_FREE_COMPRESSIONS, esc_html__( 'image sizes', 'tiny-compress-images' ), '<a target="_blank" href="https://tinypng.com/dashboard/api?type=upgrade&mail=' . str_replace( '%20', '%2B', rawurlencode( $email_address ) ) . '">' . esc_html__( ' upgrade here', 'tiny-compress-images' ) . '</a>' );
174 ?></p>
175 </div>
176 </div>
177 <?php } ?>
178 </td>
179 </tr>
180 </table>
181 <div class="notes">
182 <?php
183 /* translators: %s: link to settings page saying here */
184 printf(wp_kses(__( 'Configure compression settings %s.', 'tiny-compress-images' ), array(
185 'a' => array(
186 'href' => array(),
187 ),
188 )), '<a href=' . admin_url( 'options-general.php?page=tinify' ) . '>' . __( 'here', 'tiny-compress-images' ) . '</a>') ?>
189 </div>
190 </div>
191 </div>
192 <div class="savings">
193 <div class="inner">
194 <h3><?php esc_html_e( 'Total Savings', 'tiny-compress-images' ) ?></h3>
195 <p>
196 <?php esc_html_e( 'Statistics based on all available JPEG, PNG, and WebP images in your media library.', 'tiny-compress-images' ); ?>
197 </p>
198 <?php
199 require_once dirname( __FILE__ ) . '/optimization-chart.php';
200 ?>
201 <div class="legend">
202 <table>
203 <tr>
204 <td id="optimized-image-sizes" class="value emphasize">
205 <?php echo $stats['optimized-image-sizes']; ?>
206 </td>
207 <td class="description">
208 <?php echo _n( 'image size optimized', 'image sizes optimized', $stats['optimized-image-sizes'], 'tiny-compress-images' ) ?>
209 </td>
210 </tr>
211 <tr>
212 <td id="unoptimized-library-size" class="value" data-bytes="<?php echo $stats['unoptimized-library-size']; ?>" >
213 <?php echo ( $stats['unoptimized-library-size'] ? size_format( $stats['unoptimized-library-size'], 2 ) : '-'); ?>
214 </td>
215 <td class="description">
216 <?php esc_html_e( 'initial size', 'tiny-compress-images' ) ?>
217 </td>
218 </tr>
219 <tr>
220 <td id="optimized-library-size" class="value emphasize" data-bytes="<?php echo $stats['optimized-library-size'] ?>" class="green">
221 <?php echo ($stats['optimized-library-size'] ? size_format( $stats['optimized-library-size'], 2 ) : '-') ?>
222 </td>
223 <td class="description">
224 <?php esc_html_e( 'current size', 'tiny-compress-images' ) ?>
225 </td>
226 </tr>
227 </table>
228 </div>
229 </div>
230 </div>
231 </div>
232 <?php $show_notice = $is_on_free_plan && $stats['available-unoptimized-sizes'] > $remaining_credits; ?>
233 <div class="optimize">
234 <div class="progressbar" id="compression-progress-bar" data-number-to-optimize="<?php echo $stats['optimized-image-sizes'] + $stats['available-unoptimized-sizes'] ?>" data-amount-optimized="0" style="<?php echo $show_notice ? 'display:none;' : '' ?>">
235 <div id="progress-size" class="progress">
236 </div>
237 <div class="numbers" >
238 <span id="optimized-so-far"><?php echo $stats['optimized-image-sizes'] ?></span>
239 /
240 <span><?php echo $stats['optimized-image-sizes'] + $stats['available-unoptimized-sizes'] ?></span>
241 <span id="percentage"></span>
242 </div>
243 </div>
244 <?php
245 if ( $stats['available-unoptimized-sizes'] > 0 ) {
246 require_once dirname( __FILE__ ) . '/bulk-optimization-form.php';
247 }
248 ?>
249 </div>
250 <?php
251 if ( $show_notice ) {
252 require_once dirname( __FILE__ ) . '/bulk-optimization-upgrade-notice.php';
253 }
254 ?>
255 </div>
256 <script type="text/javascript">
257 <?php echo 'jQuery(function() { bulkOptimization(' . json_encode( $stats['available-for-optimization'] ) . ')})'; ?>
258 </script>
259 <table class="wp-list-table widefat fixed striped media whitebox" id="optimization-items" >
260 <thead>
261 <tr>
262 <?php // column-author WP 3.8-4.2 mobile view ?>
263 <th class="thumbnail"></th>
264 <th class="column-primary" ><?php esc_html_e( 'File', 'tiny-compress-images' ) ?></th>
265 <th class="column-author"><?php esc_html_e( 'Initial Size', 'tiny-compress-images' ) ?></th>
266 <th class="column-author"><?php esc_html_e( 'Current Size', 'tiny-compress-images' ) ?></th>
267 <th class="column-author savings" ><?php esc_html_e( 'Savings', 'tiny-compress-images' ) ?></th>
268 <th class="column-author status" ><?php esc_html_e( 'Status', 'tiny-compress-images' ) ?></th>
269 </tr>
270 </thead>
271 <tbody>
272 </tbody>
273 </table>
274 </div>
275