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