PluginProbe
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF / 2.0.7
Robin Image Optimizer – Unlimited Image Optimization, WebP & AVIF v2.0.7
2.0.7 2.0.6 2.0.5 trunk 1.3.7 1.4.0 1.4.1 1.4.2 1.4.6 1.5.0 1.5.3 1.5.6 1.5.8 1.6.5 1.6.6 1.6.9 1.7.0 1.7.4 1.8.1 1.8.2 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 All 26 releases
robin-image-optimizer / views / part-bulk-convert-avif-button.php
part-bulk-convert-avif-button.php
39 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
4
5 /**
6 * AVIF conversion button template.
7 * Premium feature only.
8 *
9 * @var array $data
10 * @var WRIO_Page $page
11 */
12
13 $cron_running = WRIO_Plugin::app()->getPopulateOption( 'avif_conversion_cron_running', false );
14 $process_running = WRIO_Plugin::app()->getPopulateOption( $data['scope'] . '_avif_process_running', false );
15
16 if ( ! $cron_running || $cron_running != $data['scope'] ) {
17 $cron_running = false;
18 }
19
20 if ( ! $process_running || $process_running != $data['scope'] . '_avif' ) {
21 $process_running = false;
22 }
23
24 $button_classes = [
25 'wio-optimize-button',
26 ];
27
28 $button_name = __( 'Convert to AVIF', 'robin-image-optimizer' );
29
30 if ( $cron_running || $process_running ) {
31 $button_classes[] = 'wrio-cron-mode wio-running';
32 $button_name = $process_running ? __( 'Stop conversion', 'robin-image-optimizer' ) : __( 'Stop schedule conversion', 'robin-image-optimizer' );
33 }
34
35 ?>
36 <button type="button" id="wrio-start-avif-conversion" data-format="avif" class="<?php echo join( ' ', $button_classes ); ?>">
37 <?php echo esc_attr( $button_name ); ?>
38 </button>
39