PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
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 / meta-box / error.php

error.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.7, at modules/optimization/templates/meta-box/error.php

73 lines 3.0 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--meta-box image-optimization-control--error"
15 data-image-optimization-context="meta-box"
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 <p class="image-optimization-control__property">
22 <?php esc_html_e( 'Status', 'image-optimization' ); ?>:
23
24 <span class="image-optimization-control__property-value">
25 <?php esc_html_e( 'Error', 'image-optimization' ); ?>
26 </span>
27 </p>
28
29 <p class="image-optimization-control__property">
30 <?php esc_html_e( 'Reason', 'image-optimization' ); ?>:
31
32 <span class="image-optimization-control__property-value">
33 <?php echo esc_html( $args['message'] ); ?>
34 </span>
35 </p>
36
37 <div class="image-optimization-control__action-button-wrapper">
38 <?php
39 if ( Image_Optimization_Error_Type::AUTH_ERROR === $error_type ) {
40 ?>
41 <a class="button button-secondary button-large image-optimization-control__button"
42 href="<?php echo esc_url( admin_url( 'admin.php?page=' . Settings_Module::SETTING_BASE_SLUG . '&action=connect' ) ); ?>"
43 target="_blank" rel="noopener noreferrer">
44 <?php esc_html_e( 'Connect', 'image-optimization' ); ?>
45 </a>
46 <?php
47 } if ( Image_Optimization_Error_Type::CONNECTION_ERROR === $error_type ) {
48 ?>
49 <button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again"
50 type="button">
51 <?php esc_html_e( 'Try again', 'image-optimization' ); ?>
52 </button>
53 <?php
54 } elseif ( isset( $args['images_left'] ) && 0 === $args['images_left'] && ! Core_Module::is_elementor_one() ) {
55 ?>
56 <a class="button button-secondary button-large image-optimization-control__button"
57 href="<?php echo esc_url( Utils::get_upgrade_link( 'https://go.elementor.com/io-panel-upgrade/' ) ); ?>"
58 target="_blank" rel="noopener noreferrer">
59 <?php esc_html_e( 'Upgrade', 'image-optimization' ); ?>
60 </a>
61 <?php
62 } elseif ( $args['allow_retry'] ) {
63 ?>
64 <button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again"
65 type="button">
66 <?php esc_html_e( 'Try again', 'image-optimization' ); ?>
67 </button>
68 <?php
69 }
70 ?>
71 </div>
72 </div>
73