clearfy-component-card.php
7 months ago
modal-bulk-optimization.php
7 months ago
modal-webp-conversion.php
7 months ago
part-bulk-convert-avif-button.php
7 months ago
part-bulk-convert-webp-button.php
7 months ago
part-bulk-optimization-button.php
7 months ago
part-bulk-optimization-log.php
7 months ago
part-bulk-optimization-select-site.php
7 months ago
part-bulk-optimization-servers.php
7 months ago
part-bulk-optimization-statistic.php
7 months ago
part-bulk-optimization-tabs.php
7 months ago
part-bulk-optimization-total.php
7 months ago
part-page-header.php
7 months ago
part-settings-page-error-log-options.php
7 months ago
part-bulk-optimization-log.php
221 lines
| 1 | <?php |
| 2 | |
| 3 | defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 4 | |
| 5 | /** |
| 6 | * @var array $data |
| 7 | * @var WRIO_Page $page |
| 8 | */ |
| 9 | ?> |
| 10 | <style> |
| 11 | /** |
| 12 | * Стили временно в коде. |
| 13 | * Если такой вариант реализации прокрутки для таблицы подойдёт, то стили нужно будет перенести в основной файл |
| 14 | * Пример взят с https://jsfiddle.net/tsayen/xuvsncr2/28/ |
| 15 | */ |
| 16 | |
| 17 | .wrio-table-container { |
| 18 | height: 25em; |
| 19 | } |
| 20 | |
| 21 | .wrio-table-container table { |
| 22 | display: flex; |
| 23 | flex-flow: column; |
| 24 | height: 100%; |
| 25 | width: 100%; |
| 26 | } |
| 27 | |
| 28 | .wrio-table-container table thead { |
| 29 | /* head takes the height it requires, |
| 30 | and it's not scaled when table is resized */ |
| 31 | flex: 0 0 auto; |
| 32 | width: calc(100% - 0.9em); |
| 33 | } |
| 34 | |
| 35 | .wrio-table-container table tbody { |
| 36 | /* body takes all the remaining available space */ |
| 37 | flex: 1 1 auto; |
| 38 | display: block; |
| 39 | overflow-y: scroll; |
| 40 | } |
| 41 | |
| 42 | .wrio-table-container table tbody tr { |
| 43 | width: 100%; |
| 44 | } |
| 45 | |
| 46 | .wrio-table-container table thead, |
| 47 | .wrio-table-container table tbody tr { |
| 48 | display: table; |
| 49 | table-layout: fixed; |
| 50 | } |
| 51 | |
| 52 | .wrio-table-container table tbody tr { |
| 53 | width: 100%; |
| 54 | word-break: break-all; |
| 55 | |
| 56 | } |
| 57 | |
| 58 | .flash { |
| 59 | -moz-animation: flash 1s ease-out; |
| 60 | -webkit-animation: flash 1s ease-out; |
| 61 | -ms-animation: flash 1s ease-out; |
| 62 | animation: flash 1s ease-out; |
| 63 | } |
| 64 | |
| 65 | @-webkit-keyframes flash { |
| 66 | 0% { |
| 67 | background-color: transparent; |
| 68 | } |
| 69 | 30% { |
| 70 | background-color: #fffade; |
| 71 | } |
| 72 | 100% { |
| 73 | background-color: transparent; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | @-moz-keyframes flash { |
| 78 | 0% { |
| 79 | background-color: transparent; |
| 80 | } |
| 81 | 30% { |
| 82 | background-color: #fffade; |
| 83 | } |
| 84 | |
| 85 | 100% { |
| 86 | background-color: transparent; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | @-ms-keyframes flash { |
| 91 | 0% { |
| 92 | background-color: transparent; |
| 93 | } |
| 94 | 30% { |
| 95 | background-color: #fffade; |
| 96 | } |
| 97 | 100% { |
| 98 | background-color: transparent; |
| 99 | } |
| 100 | } |
| 101 | </style> |
| 102 | <div class="wrio-optimization-progress"> |
| 103 | <div class="wbcr-factory-page-group-header" style="margin-bottom:0;"> |
| 104 | <strong><?php esc_html_e( 'Optimization log', 'robin-image-optimizer' ); ?></strong> |
| 105 | <p><?php esc_html_e( 'Optimization log shows the last 100 optimized images. You can check the quality of the image by clicking on the file name.', 'robin-image-optimizer' ); ?></p> |
| 106 | </div> |
| 107 | <div class="<?php echo esc_attr( empty( $data['process_log'] ) ? 'wrio-table-container-empty' : 'wrio-table-container' ); ?>"> |
| 108 | <table class="wrio-table"> |
| 109 | <thead> |
| 110 | <tr> |
| 111 | <th></th> |
| 112 | <th><?php esc_html_e( 'File name', 'robin-image-optimizer' ); ?></th> |
| 113 | <th><?php esc_html_e( 'Initial size', 'robin-image-optimizer' ); ?></th> |
| 114 | <th><?php esc_html_e( 'Optimized size', 'robin-image-optimizer' ); ?></th> |
| 115 | <?php if ( 'custom-folders' !== $data['scope'] ) : ?> |
| 116 | <th><?php esc_html_e( 'Compressed thumbnails', 'robin-image-optimizer' ); ?></th> |
| 117 | <?php endif; ?> |
| 118 | <th><?php esc_html_e( 'Overall Saving', 'robin-image-optimizer' ); ?></th> |
| 119 | </tr> |
| 120 | </thead> |
| 121 | <tbody> |
| 122 | <?php if ( empty( $data['process_log'] ) ) : ?> |
| 123 | <tr> |
| 124 | <td colspan="<?php echo( 'custom-folders' !== $data['scope'] ? '9' : '8' ); ?>"><?php esc_html_e( "You don't have optimized images.", 'robin-image-optimizer' ); ?></td> |
| 125 | </tr> |
| 126 | <?php else : ?> |
| 127 | <?php foreach ( (array) $data['process_log'] as $item ) : ?> |
| 128 | <?php if ( isset( $item['type'] ) && 'error' === $item['type'] ) : ?> |
| 129 | <tr class="wrio-table-item wrio-row-id-<?php echo esc_attr( $item['id'] ); ?> wrio-error" data-attachment-id="<?php echo esc_attr( $item['attachment_id'] ?? $item['id'] ); ?>"> |
| 130 | <td> |
| 131 | <?php if ( ! empty( $item['original_url'] ) ) : ?> |
| 132 | <a href="<?php echo esc_url( $item['original_url'] ); ?>" target="_blank"> |
| 133 | <img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt=""> |
| 134 | </a> |
| 135 | <?php else : ?> |
| 136 | <img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt=""> |
| 137 | <?php endif; ?> |
| 138 | </td> |
| 139 | <td> |
| 140 | <a href="<?php echo esc_attr( $item['url'] ); ?>" target="_blank"><?php echo esc_attr( $item['file_name'] ); ?></a> |
| 141 | </td> |
| 142 | <td colspan="<?php echo( 'custom-folders' !== $data['scope'] ? '7' : '6' ); ?>"> |
| 143 | <?php esc_html_e( 'Error', 'robin-image-optimizer' ); ?>: |
| 144 | <?php if ( isset( $item['error_msg'] ) ) : ?> |
| 145 | <?php echo esc_attr( $item['error_msg'] ); ?> |
| 146 | <?php else : ?> |
| 147 | <?php esc_html_e( 'An unexpected error occurred. Please try again.', 'robin-image-optimizer' ); ?> |
| 148 | <?php endif; ?> |
| 149 | </td> |
| 150 | </tr> |
| 151 | <?php else : ?> |
| 152 | <tr class="wrio-table-item wrio-row-id-<?php echo esc_attr( $item['id'] ); ?>" data-attachment-id="<?php echo esc_attr( $item['attachment_id'] ?? $item['id'] ); ?>"> |
| 153 | <td> |
| 154 | <?php if ( ! empty( $item['original_url'] ) ) : ?> |
| 155 | <a href="<?php echo esc_url( $item['original_url'] ); ?>" target="_blank"> |
| 156 | <img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt=""> |
| 157 | </a> |
| 158 | <?php else : ?> |
| 159 | <img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt=""> |
| 160 | <?php endif; ?> |
| 161 | </td> |
| 162 | <td> |
| 163 | <a href="<?php echo esc_attr( $item['url'] ); ?>"><?php echo esc_attr( $item['file_name'] ); ?></a> |
| 164 | </td> |
| 165 | <td class="wrio-original-size"> |
| 166 | <?php echo esc_attr( $item['original_size'] ); ?> |
| 167 | </td> |
| 168 | <td class="wrio-optimized-size"> |
| 169 | <?php echo esc_attr( $item['optimized_size'] ); ?> |
| 170 | </td> |
| 171 | <?php if ( $data['scope'] !== 'custom-folders' ) : ?> |
| 172 | <td class="wrio-thumbnails-count"> |
| 173 | <?php echo esc_attr( $item['thumbnails_count'] ); ?> |
| 174 | </td> |
| 175 | <?php endif; ?> |
| 176 | <td class="wrio-total-saving"> |
| 177 | <?php echo esc_attr( $item['total_saving'] ); ?> |
| 178 | </td> |
| 179 | </tr> |
| 180 | <?php endif; ?> |
| 181 | <?php endforeach; ?> |
| 182 | <?php endif; ?> |
| 183 | </tbody> |
| 184 | </table> |
| 185 | </div> |
| 186 | </div> |
| 187 | |
| 188 | <?php if ( 'media-library' === $data['scope'] && ! wrio_is_license_activate() && ! wrio_is_avif_banner_dismissed() ) : ?> |
| 189 | <div class="wrio-avif-upsell-banner" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wrio_dismiss_avif_banner' ) ); ?>"> |
| 190 | <button type="button" class="wrio-avif-banner-dismiss" aria-label="<?php esc_attr_e( 'Dismiss', 'robin-image-optimizer' ); ?>">×</button> |
| 191 | <div class="wrio-avif-banner-icon"> |
| 192 | <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 193 | <path d="M13 2L3 14h7v8l10-12h-7V2z" fill="#FFB638" stroke="#FF9800" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path> |
| 194 | </svg> |
| 195 | </div> |
| 196 | <div class="wrio-avif-banner-content"> |
| 197 | <div class="wrio-avif-banner-header"> |
| 198 | <h3 class="wrio-avif-banner-title"><?php esc_html_e( 'Want even smaller files?', 'robin-image-optimizer' ); ?></h3> |
| 199 | <span class="wrio-avif-pro-badge"><?php esc_html_e( 'PRO', 'robin-image-optimizer' ); ?></span> |
| 200 | </div> |
| 201 | <p class="wrio-avif-banner-description"> |
| 202 | <?php |
| 203 | printf( |
| 204 | /* translators: %1$s and %2$s are <strong> tags wrapping the compression percentage */ |
| 205 | esc_html__( 'AVIF format delivers %1$s20-50%% better compression%2$s than WebP. Unlock AVIF conversion to maximize your savings.', 'robin-image-optimizer' ), |
| 206 | '<strong>', |
| 207 | '</strong>' |
| 208 | ); |
| 209 | ?> |
| 210 | </p> |
| 211 | <div class="wrio-avif-banner-actions"> |
| 212 | <a href="<?php echo esc_url( WRIO_Plugin::app()->get_support()->get_pricing_url( true, 'avif_banner' ) ); ?>" class="wrio-avif-unlock-button" target="_blank" rel="noopener"> |
| 213 | <?php esc_html_e( 'Unlock AVIF Conversion', 'robin-image-optimizer' ); ?> |
| 214 | </a> |
| 215 | <a href="https://developers.google.com/speed/webp/faq#what_is_the_difference_between_webp_and_avif" target="_blank" rel="noopener" class="wrio-avif-learn-more"> |
| 216 | <?php esc_html_e( 'Learn more about AVIF', 'robin-image-optimizer' ); ?> |
| 217 | </a> |
| 218 | </div> |
| 219 | </div> |
| 220 | </div> |
| 221 | <?php endif; ?> |