rebase from live enviornment
This commit is contained in:
13
wp/plugins/imagify/views/button/compare-images.php
Normal file
13
wp/plugins/imagify/views/button/compare-images.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
printf(
|
||||
'<a href="%1$s" data-id="%2$d" data-backup-src="%3$s" data-full-src="%4$s" data-full-width="%5$d" data-full-height="%6$d" data-target="#imagify-comparison-%2$d" class="imagify-compare-images imagify-modal-trigger hide-if-no-js">%7$s</a>',
|
||||
esc_url( $data['url'] ),
|
||||
$data['media_id'],
|
||||
esc_url( $data['backup_url'] ),
|
||||
esc_url( $data['original_url'] ),
|
||||
$data['width'],
|
||||
$data['height'],
|
||||
esc_html__( 'Compare Original VS Optimized', 'imagify' )
|
||||
);
|
||||
31
wp/plugins/imagify/views/button/delete-webp.php
Normal file
31
wp/plugins/imagify/views/button/delete-webp.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-imagify-delete-webp';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Deleting...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-image-rotate"></span>
|
||||
<?php esc_html_e( 'Delete WebP images', 'imagify' ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
33
wp/plugins/imagify/views/button/generate-webp.php
Normal file
33
wp/plugins/imagify/views/button/generate-webp.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-imagify-generate-webp';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Generating...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-admin-generic"></span>
|
||||
<?php
|
||||
esc_html_e( 'Generate WebP versions', 'imagify' );
|
||||
?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
39
wp/plugins/imagify/views/button/optimize-missing-sizes.php
Normal file
39
wp/plugins/imagify/views/button/optimize-missing-sizes.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'optimize-missing-sizes';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-admin-generic"></span>
|
||||
<?php
|
||||
printf(
|
||||
/* 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. */
|
||||
esc_html( _n( '%2$sOptimize %3$s%1$d missing thumbnail', '%2$sOptimize %3$s%1$d missing thumbnails', $data['count'], 'imagify' ) ),
|
||||
number_format_i18n( $data['count'] ),
|
||||
'<span class="imagify-hide-if-small">',
|
||||
'</span>'
|
||||
);
|
||||
?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
30
wp/plugins/imagify/views/button/optimize.php
Normal file
30
wp/plugins/imagify/views/button/optimize.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-primary button-imagify-optimize';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<?php esc_html_e( 'Optimize', 'imagify' ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
16
wp/plugins/imagify/views/button/processing.php
Normal file
16
wp/plugins/imagify/views/button/processing.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
if ( empty( $data['label'] ) ) {
|
||||
$data['label'] = '%s';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="button button-imagify-processing">
|
||||
<span class="imagify-spinner"></span>
|
||||
<?php echo esc_html( $data['label'] ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
46
wp/plugins/imagify/views/button/re-optimize.php
Normal file
46
wp/plugins/imagify/views/button/re-optimize.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-imagify-manual-reoptimize';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
|
||||
}
|
||||
|
||||
$level_labels = [
|
||||
0 => __( 'Lossless', 'imagify' ),
|
||||
1 => __( 'Smart', 'imagify' ),
|
||||
2 => __( 'Smart', 'imagify' ),
|
||||
];
|
||||
$level_label = $level_labels[ $data['optimization_level'] ];
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-admin-generic"></span>
|
||||
<span class="imagify-hide-if-small">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s is an optimization level. */
|
||||
esc_html__( 'Re-Optimize with %s compression', 'imagify' ),
|
||||
'</span>' . esc_html( $level_label ) . '<span class="imagify-hide-if-small">'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
31
wp/plugins/imagify/views/button/refresh-status.php
Normal file
31
wp/plugins/imagify/views/button/refresh-status.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-imagify-refresh-status';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Refreshing status...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-image-rotate"></span>
|
||||
<?php esc_html_e( 'Refresh status', 'imagify' ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
31
wp/plugins/imagify/views/button/restore.php
Normal file
31
wp/plugins/imagify/views/button/restore.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button-imagify-restore attachment-has-backup';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Restoring...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
?>
|
||||
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<span class="dashicons dashicons-image-rotate"></span>
|
||||
<?php esc_html_e( 'Restore Original', 'imagify' ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
48
wp/plugins/imagify/views/button/retry-optimize.php
Normal file
48
wp/plugins/imagify/views/button/retry-optimize.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
$html_atts = '';
|
||||
|
||||
if ( empty( $data['atts'] ) ) {
|
||||
$data['atts'] = [];
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['class'] ) ) {
|
||||
// Class used for JS.
|
||||
$data['atts']['class'] = 'button button-imagify-optimize';
|
||||
}
|
||||
|
||||
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
|
||||
// Used for JS.
|
||||
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
|
||||
}
|
||||
|
||||
$html_atts = $this->build_attributes( $data['atts'] );
|
||||
|
||||
if ( ! empty( $data['error'] ) ) {
|
||||
?>
|
||||
<strong>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
imagify_translate_api_message( $data['error'] ),
|
||||
[
|
||||
'br' => true,
|
||||
'code' => true,
|
||||
'em' => true,
|
||||
'strong' => true,
|
||||
]
|
||||
);
|
||||
?>
|
||||
</strong>
|
||||
<br/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
|
||||
<?php esc_html_e( 'Try again', 'imagify' ); ?>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
|
||||
$this->print_js_template_in_footer( 'button/processing' );
|
||||
}
|
||||
Reference in New Issue
Block a user