PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / trunk
Image Optimizer – Compress Images and Convert to WebP or AVIF vtrunk
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | modules/optimization/templates/details-view/error.php +49 -19 1.2.0 → trunk View file →
@@ -1,13 +1,21 @@
1 1 <?php
2 +
3 +use ImageOptimization\Classes\Image\Image_Optimization_Error_Type;
4 +use ImageOptimization\Classes\Utils;
5 +use ImageOptimization\Modules\Settings\Module as Settings_Module;
6 +use ImageOptimization\Modules\Core\Module as Core_Module;
7 +
2 8 if ( ! defined( 'ABSPATH' ) ) {
3 9 exit; // Exit if accessed directly.
4 10 }
11 +
12 +$error_type = isset( $args['optimization_error_type'] ) ? $args['optimization_error_type'] : '';
5 13 ?>
6 14 <div class="image-optimization-control image-optimization-control--details-view image-optimization-control--error"
7 15 data-image-optimization-context="details-view"
8 16 data-image-optimization-status="error"
9 - data-image-allow-retry="<?php echo esc_attr( $args['allow_retry'] ); ?>"
17 + data-image-optimization-allow-retry="<?php echo esc_attr( $args['allow_retry'] ); ?>"
10 18 data-image-optimization-action="<?php echo esc_attr( $args['action'] ); ?>"
11 19 data-image-optimization-image-id="<?php echo esc_attr( $args['image_id'] ); ?>"
12 20 data-image-optimization-can-be-restored="<?php echo esc_attr( $args['can_be_restored'] ); ?>">
13 21 <span class="setting image-optimization-setting">
@@ -29,25 +37,47 @@
29 37 <?php echo esc_html( $args['message'] ); ?>
30 38 </span>
31 39 </span>
32 40
33 - <?php if ( $args['allow_retry'] ) { ?>
34 - <span class="setting image-optimization-setting">
35 - <span class="name image-optimization-control__property"></span>
41 + <span class="setting image-optimization-setting">
42 + <span class="name image-optimization-control__property"></span>
36 43
37 - <span class="image-optimization-control__property-value image-optimization-control__property-value--button">
38 - <?php if ( isset( $args['images_left'] ) && 0 === $args['images_left'] ) { ?>
39 - <a class="button button-secondary button-large image-optimization-control__button"
40 - href="https://go.elementor.com/io-panel-upgrade/"
41 - target="_blank" rel="noopener noreferrer">
42 - <?php esc_html_e( 'Upgrade', 'image-optimization' ); ?>
43 - </a>
44 - <?php } else { ?>
45 - <button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again"
46 - type="button">
47 - <?php esc_html_e( 'Try again', 'image-optimization' ); ?>
48 - </button>
49 - <?php } ?>
50 - </span>
44 + <span class="image-optimization-control__property-value image-optimization-control__property-value--button">
45 + <?php
46 + if ( Image_Optimization_Error_Type::AUTH_ERROR === $error_type ) {
47 + ?>
48 + <a class="button button-secondary button-large image-optimization-control__button"
49 + href="<?php echo esc_url( admin_url( 'admin.php?page=' . Settings_Module::SETTING_BASE_SLUG . '&action=connect' ) ); ?>"
50 + target="_blank" rel="noopener noreferrer">
51 + <?php esc_html_e( 'Connect', 'image-optimization' ); ?>
52 + </a>
53 + <?php
54 + } if ( Image_Optimization_Error_Type::CONNECTION_ERROR === $error_type ) {
55 + ?>
56 + <button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again"
57 + type="button">
58 + <?php esc_html_e( 'Try again', 'image-optimization' ); ?>
59 + </button>
60 + <?php
61 + } elseif ( isset( $args['images_left'] ) && 0 === $args['images_left'] ) {
62 + if ( Core_Module::is_elementor_one() ) {
63 + return;
64 + }
65 + ?>
66 + <a class="button button-secondary button-large image-optimization-control__button"
67 + href="<?php echo esc_url( Utils::get_upgrade_link( 'https://go.elementor.com/io-panel-upgrade/' ) ); ?>"
68 + target="_blank" rel="noopener noreferrer">
69 + <?php esc_html_e( 'Upgrade', 'image-optimization' ); ?>
70 + </a>
71 + <?php
72 + } elseif ( $args['allow_retry'] ) {
73 + ?>
74 + <button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again"
75 + type="button">
76 + <?php esc_html_e( 'Try again', 'image-optimization' ); ?>
77 + </button>
78 + <?php
79 + }
80 + ?>
51 81 </span>
52 - <?php } ?>
82 + </span>
53 83 </div>