PluginProbe ʕ •ᴥ•ʔ
TinyPNG – JPEG, PNG & WebP image compression / 3.6.13
TinyPNG – JPEG, PNG & WebP image compression v3.6.13
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 5 months ago account-status-create-advanced.php 5 months ago account-status-create-simple.php 5 months ago account-status-loading.php 3 years ago bulk-optimization-form.php 5 months ago bulk-optimization-upgrade-notice.php 5 months ago bulk-optimization.php 2 months ago compress-details-processing.php 5 months ago compress-details.php 5 months ago dashboard-widget.php 2 months ago notice-feedback.php 2 months ago optimization-chart.php 5 months ago request-review.php 2 months ago settings-conversion-delivery.php 2 months ago settings-conversion-enabled.php 2 months ago settings-conversion-output.php 2 months ago settings-conversion.php 2 months ago settings-diagnostics.php 5 months ago settings-original-image-original.php 2 months ago settings-original-image-preserve.php 2 months ago settings-original-image.php 2 months ago settings.php 2 months ago
bulk-optimization.php
328 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 echo '<br />';
59 require __DIR__ . '/request-review.php';
60 } elseif ( $stats['optimized-image-sizes'] > 0 ) {
61 if ( $percentage_of_files > 75 ) {
62 /* translators: %s: friendly user name */
63 printf( esc_html__( '%s, you are doing great!', 'tiny-compress-images' ), $this->friendly_user_name() );
64 } else {
65 /* translators: %s: friendly user name */
66 printf( esc_html__( '%s, you are doing good.', 'tiny-compress-images' ), $this->friendly_user_name() );
67 }
68 echo ' ';
69 /* translators: %1$d%2$s: percentage optimised */
70 printf( esc_html__( '%1$d%2$s of your image library is optimized.', 'tiny-compress-images' ), $percentage_of_files, '%' );
71 echo ' ';
72 /* translators: %s: bulk optimization title */
73 printf( esc_html__( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ), esc_html__( 'bulk optimization', 'tiny-compress-images' ) );
74 } else {
75 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' );
76 }
77 ?>
78 </p>
79 <?php if ( Tiny_Settings::wr2x_active() ) { ?>
80 <p>
81 <?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' ); ?>
82 </p>
83 <?php } ?>
84 <table class="totals">
85 <tr>
86 <td class="item">
87 <h3>
88 <?php
89 echo wp_kses(
90 __( 'Uploaded <br> images', 'tiny-compress-images' ),
91 array(
92 'br' => array(),
93 )
94 )
95 ?>
96 </h3>
97 <span id="uploaded-images">
98 <?php echo $stats['uploaded-images']; ?>
99 </span>
100 </td>
101 <td class="item">
102 <h3>
103 <?php
104 echo wp_kses(
105 __( 'Unoptimized <br> image sizes', 'tiny-compress-images' ),
106 array(
107 'br' => array(),
108 )
109 )
110 ?>
111 </h3>
112 <span id="optimizable-image-sizes">
113 <?php echo $stats['available-unoptimized-sizes']; ?>
114 </span>
115 <div class="tooltip">
116 <span class="dashicons dashicons-info"></span>
117 <div class="tip">
118 <?php if ( $stats['uploaded-images'] > 0 && sizeof( $active_tinify_sizes ) > 0 && $stats['available-unoptimized-sizes'] > 0 ) { ?>
119 <p>
120 <?php
121 printf(
122 /* translators: %1$s: number of sizes that can be optimised, %2$s number of images */
123 esc_html__(
124 'With your current settings you can still optimize %1$s image sizes from your %2$s uploaded JPEG, PNG, and WebP images.',
125 'tiny-compress-images'
126 ),
127 $stats['available-unoptimized-sizes'],
128 $stats['uploaded-images']
129 );
130 ?>
131 </p>
132 <?php } ?>
133 <p>
134 <?php
135 if ( 0 == sizeof( $active_tinify_sizes ) ) {
136 esc_html_e( 'Based on your current settings, nothing will be optimized. There are no active sizes selected for optimization.', 'tiny-compress-images' );
137 } else {
138 esc_html_e( 'These sizes are currently activated for optimization:', 'tiny-compress-images' );
139 echo '<ul>';
140 for ( $i = 0; $i < sizeof( $active_tinify_sizes ); ++$i ) {
141 $name = $active_tinify_sizes[ $i ];
142 if ( '0' == $name ) {
143 echo '<li>- ' . esc_html__( 'Original image', 'tiny-compress-images' ) . '</li>';
144 } else {
145 echo '<li>- ' . esc_html( ucfirst( $name ) ) . '</li>';
146 }
147 }
148 echo '</ul>';
149 }
150 ?>
151 </p>
152 <p>
153 <?php if ( sizeof( $active_tinify_sizes ) > 0 ) { ?>
154 <?php
155 printf(
156 wp_kses(
157 /* translators: %d: number of sizes to be compressed */
158 _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' ),
159 array(
160 'strong' => array(),
161 )
162 ),
163 count( $active_tinify_sizes )
164 )
165 ?>
166 <?php } ?>
167 <?php
168 printf(
169 wp_kses(
170 /* translators: %s: link to settings page saying here */
171 __( 'You can change these settings %s.', 'tiny-compress-images' ),
172 array(
173 'a' => array(
174 'href' => array(),
175 ),
176 )
177 ),
178 '<a href=' . admin_url( 'options-general.php?page=tinify' ) . '>' . __( 'here', 'tiny-compress-images' ) . '</a>'
179 )
180 ?>
181 </p>
182 </div>
183 </div>
184 </td>
185 <td class="item costs">
186 <h3>
187 <?php
188 echo wp_kses(
189 __( 'Estimated <br> cost', 'tiny-compress-images' ),
190 array(
191 'br' => array(),
192 )
193 )
194 ?>
195 </h3>
196 <span id="estimated-cost">$ <?php echo number_format( $estimated_costs, 2 ); ?></span>
197 USD
198 <?php if ( $estimated_costs > 0 ) { ?>
199 <div class="tooltip">
200 <span class="dashicons dashicons-info"></span>
201 <div class="tip">
202 <p>
203 <?php
204 printf(
205 wp_kses(
206 /* translators: %1$d %2$s: number of image sizes, %3$s: link saying upgrade here */
207 __( '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' ),
208 array(
209 'strong' => array(),
210 'a' => array(
211 'href' => array(),
212 ),
213 )
214 ),
215 Tiny_Config::MONTHLY_FREE_COMPRESSIONS,
216 esc_html__( 'image sizes', 'tiny-compress-images' ),
217 '<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>'
218 );
219 ?>
220 </p>
221 </div>
222 </div>
223 <?php } ?>
224 </td>
225 </tr>
226 </table>
227 <div class="notes">
228 <?php
229 printf(
230 wp_kses(
231 /* translators: %s: link to settings page saying here */
232 __( 'Configure compression settings %s.', 'tiny-compress-images' ),
233 array(
234 'a' => array(
235 'href' => array(),
236 ),
237 )
238 ),
239 '<a href=' . admin_url( 'options-general.php?page=tinify' ) . '>' . __( 'here', 'tiny-compress-images' ) . '</a>'
240 )
241 ?>
242 </div>
243 </div>
244 </div>
245 <div class="savings">
246 <div class="inner">
247 <h3><?php esc_html_e( 'Total Savings', 'tiny-compress-images' ); ?></h3>
248 <p>
249 <?php esc_html_e( 'Statistics based on all available JPEG, PNG, and WebP images in your media library.', 'tiny-compress-images' ); ?>
250 </p>
251 <?php
252 require_once __DIR__ . '/optimization-chart.php';
253 ?>
254 <div class="legend">
255 <table>
256 <tr>
257 <td id="optimized-image-sizes" class="value emphasize">
258 <?php echo $stats['optimized-image-sizes']; ?>
259 </td>
260 <td class="description">
261 <?php echo _n( 'image size optimized', 'image sizes optimized', $stats['optimized-image-sizes'], 'tiny-compress-images' ); ?>
262 </td>
263 </tr>
264 <tr>
265 <td id="unoptimized-library-size" class="value" data-bytes="<?php echo $stats['unoptimized-library-size']; ?>" >
266 <?php echo ( $stats['unoptimized-library-size'] ? size_format( $stats['unoptimized-library-size'], 2 ) : '-' ); ?>
267 </td>
268 <td class="description">
269 <?php esc_html_e( 'initial size', 'tiny-compress-images' ); ?>
270 </td>
271 </tr>
272 <tr>
273 <td id="optimized-library-size" class="value emphasize" data-bytes="<?php echo $stats['optimized-library-size']; ?>" class="green">
274 <?php echo ( $stats['optimized-library-size'] ? size_format( $stats['optimized-library-size'], 2 ) : '-' ); ?>
275 </td>
276 <td class="description">
277 <?php esc_html_e( 'current size', 'tiny-compress-images' ); ?>
278 </td>
279 </tr>
280 </table>
281 </div>
282 </div>
283 </div>
284 </div>
285 <?php $show_notice = $is_on_free_plan && $stats['available-unoptimized-sizes'] > $remaining_credits; ?>
286 <div class="optimize">
287 <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;' : ''; ?>">
288 <div id="progress-size" class="progress">
289 </div>
290 <div class="numbers" >
291 <span id="optimized-so-far"><?php echo $stats['optimized-image-sizes']; ?></span>
292 /
293 <span><?php echo $stats['optimized-image-sizes'] + $stats['available-unoptimized-sizes']; ?></span>
294 <span id="percentage"></span>
295 </div>
296 </div>
297 <?php
298 if ( $stats['available-unoptimized-sizes'] > 0 ) {
299 require_once __DIR__ . '/bulk-optimization-form.php';
300 }
301 ?>
302 </div>
303 <?php
304 if ( $show_notice ) {
305 require_once __DIR__ . '/bulk-optimization-upgrade-notice.php';
306 }
307 ?>
308 </div>
309 <script type="text/javascript">
310 <?php echo 'jQuery(function() { bulkOptimization(' . json_encode( $stats['available-for-optimization'] ) . ')})'; ?>
311 </script>
312 <table class="wp-list-table widefat fixed striped media whitebox" id="optimization-items" >
313 <thead>
314 <tr>
315 <?php // column-author WP 3.8-4.2 mobile view ?>
316 <th class="thumbnail"></th>
317 <th class="column-primary" ><?php esc_html_e( 'File', 'tiny-compress-images' ); ?></th>
318 <th class="column-author"><?php esc_html_e( 'Initial Size', 'tiny-compress-images' ); ?></th>
319 <th class="column-author"><?php esc_html_e( 'Current Size', 'tiny-compress-images' ); ?></th>
320 <th class="column-author savings"><?php esc_html_e( 'Savings', 'tiny-compress-images' ); ?></th>
321 <th class="column-author status"><?php esc_html_e( 'Status', 'tiny-compress-images' ); ?></th>
322 </tr>
323 </thead>
324 <tbody>
325 </tbody>
326 </table>
327 </div>
328