PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.2.7
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.2.7
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / views / button / re-optimize.php

re-optimize.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.2.7, at views/button/re-optimize.php

47 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || exit;
3
4 $html_atts = '';
5
6 if ( empty( $data['atts'] ) ) {
7 $data['atts'] = [];
8 }
9
10 if ( ! isset( $data['atts']['class'] ) ) {
11 // Class used for JS.
12 $data['atts']['class'] = 'button-imagify-manual-reoptimize';
13 }
14
15 if ( ! isset( $data['atts']['data-processing-label'] ) ) {
16 // Used for JS.
17 $data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
18 }
19
20 $level_labels = [
21 0 => __( 'Lossless', 'imagify' ),
22 1 => __( 'Smart', 'imagify' ),
23 2 => __( 'Smart', 'imagify' ),
24 ];
25 $level_label = $level_labels[ $data['optimization_level'] ];
26
27 $html_atts = $this->build_attributes( $data['atts'] );
28 ?>
29
30 <a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
31 <span class="dashicons dashicons-admin-generic"></span>
32 <span class="imagify-hide-if-small">
33 <?php
34 printf(
35 /* translators: %s is an optimization level. */
36 esc_html__( 'Re-Optimize with %s compression', 'imagify' ),
37 '</span>' . esc_html( $level_label ) . '<span class="imagify-hide-if-small">'
38 );
39 ?>
40 </span>
41 </a>
42
43 <?php
44 if ( ! empty( $data['atts']['data-processing-label'] ) ) {
45 $this->print_js_template_in_footer( 'button/processing' );
46 }
47