| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="image-optimization-control image-optimization-control--list-view image-optimization-control--error" |
| 7 |
data-image-optimization-context="list-view" |
| 8 |
data-image-optimization-status="error" |
| 9 |
data-image-allow-retry="<?php echo esc_attr( $args['allow_retry'] ); ?>" |
| 10 |
data-image-optimization-action="<?php echo esc_attr( $args['action'] ); ?>" |
| 11 |
data-image-optimization-image-id="<?php echo esc_attr( $args['image_id'] ); ?>" |
| 12 |
data-image-optimization-can-be-restored="<?php echo esc_attr( $args['can_be_restored'] ); ?>"> |
| 13 |
|
| 14 |
<?php |
| 15 |
$message = esc_html( $args['message'] ); |
| 16 |
|
| 17 |
if ( false === $args['allow_retry'] ) { |
| 18 |
$message_chunks = explode( '. ', $message, 2 ); |
| 19 |
|
| 20 |
$message = "<span class='image-optimization-control__error-title'>{$message_chunks[0]}</span>"; |
| 21 |
|
| 22 |
if ( isset( $message_chunks[1] ) ) { |
| 23 |
$message .= "<span class='image-optimization-control__error-subtitle'>{$message_chunks[1]}</span>"; |
| 24 |
} |
| 25 |
} |
| 26 |
?> |
| 27 |
|
| 28 |
<span class='image-optimization-control__error-message'><?php echo $message; ?></span> |
| 29 |
|
| 30 |
<?php if ( $args['allow_retry'] ) { ?> |
| 31 |
<?php if ( isset( $args['images_left'] ) && 0 === $args['images_left'] ) { ?> |
| 32 |
<a class="button button-secondary button-large image-optimization-control__button" |
| 33 |
href="https://go.elementor.com/io-panel-upgrade/" |
| 34 |
target="_blank" rel="noopener noreferrer"> |
| 35 |
<?php esc_html_e( 'Upgrade', 'image-optimization' ); ?> |
| 36 |
</a> |
| 37 |
<?php } else { ?> |
| 38 |
<button class="button button-secondary button-large button-link-delete image-optimization-control__button image-optimization-control__button--try-again" |
| 39 |
type="button"> |
| 40 |
<?php esc_html_e( 'Try again', 'image-optimization' ); ?> |
| 41 |
</button> |
| 42 |
<?php } ?> |
| 43 |
<?php } ?> |
| 44 |
</div> |
| 45 |
|