| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 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'] = 'optimize-missing-sizes'; |
| 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 |
$html_atts = $this->build_attributes( $data['atts'] ); |
| 21 |
?> |
| 22 |
|
| 23 |
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> |
| 24 |
<span class="dashicons dashicons-admin-generic"></span> |
| 25 |
<?php |
| 26 |
printf( |
| 27 |
/* translators: 1 is the number of thumbnails to optimize, 2 is the opening of a HTML tag that will be hidden on small screens, 3 is the closing tag. */ |
| 28 |
esc_html( _n( '%2$sOptimize %3$s%1$d missing thumbnail', '%2$sOptimize %3$s%1$d missing thumbnails', $data['count'], 'imagify' ) ), |
| 29 |
esc_html( number_format_i18n( $data['count'] ) ), |
| 30 |
'<span class="imagify-hide-if-small">', |
| 31 |
'</span>' |
| 32 |
); |
| 33 |
?> |
| 34 |
</a> |
| 35 |
|
| 36 |
<?php |
| 37 |
if ( ! empty( $data['atts']['data-processing-label'] ) ) { |
| 38 |
$this->print_js_template_in_footer( 'button/processing' ); |
| 39 |
} |
| 40 |
|