PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.4
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.4
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
image-optimization / modules / optimization / templates / details-view / error.php

error.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.4, at modules/optimization/templates/details-view/error.php

84 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 $error_type = isset( $args['optimization_error_type'] ) ? $args['optimization_error_type'] : '';
13 ?>
14 <div class="image-optimization-control image-optimization-control--details-view image-optimization-control--error"
15 data-image-optimization-context="details-view"
16 data-image-optimization-status="error"
17 data-image-optimization-allow-retry="<?php echo esc_attr( $args['allow_retry'] ); ?>"
18 data-image-optimization-action="<?php echo esc_attr( $args['action'] ); ?>"
19 data-image-optimization-image-id="<?php echo esc_attr( $args['image_id'] ); ?>"
20 data-image-optimization-can-be-restored="<?php echo esc_attr( $args['can_be_restored'] ); ?>">
21 <span class="setting image-optimization-setting">
22 <span class="name image-optimization-control__property">
23 <?php esc_html_e( 'Status', 'image-optimization' ); ?>:
24 </span>
25
26 <span class="image-optimization-control__property-value">
27 <?php esc_html_e( 'Error', 'image-optimization' ); ?>
28 </span>
29 </span>
30
31 <span class="setting image-optimization-setting">
32 <span class="name image-optimization-control__property">
33 <?php esc_html_e( 'Reason', 'image-optimization' ); ?>:
34 </span>
35
36 <span class="image-optimization-control__property-value">
37 <?php echo esc_html( $args['message'] ); ?>
38 </span>
39 </span>
40
41 <span class="setting image-optimization-setting">
42 <span class="name image-optimization-control__property"></span>
43
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 ?>
81 </span>
82 </span>
83 </div>
84