first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
if ( ! class_exists( 'WCL_Plugin' ) ) {
return;
}
$install_button = WCL_Plugin::app()->getInstallComponentsButton( 'WordPress', 'robin-image-optimizer/robin-image-optimizer.php' );
$delete_button = WCL_Plugin::app()->getDeleteComponentsButton( 'WordPress', 'robin-image-optimizer/robin-image-optimizer.php' );
$license_page_url = WRIO_Plugin::app()->getPluginPageUrl( 'rio_license' );
?>
<div class="plugin-card">
<div class="plugin-card-top">
<div class="name column-name">
<h3>
<a href="https://wordpress.org/plugins/robin-image-optimizer/" class="thickbox open-plugin-details-modal">
<?php _e( 'Robin image optimizer', 'robin-image-optimizer' ); ?>
<img src="<?php echo WCL_PLUGIN_URL; ?>/admin/assets/img/rio-icon-128x128.png" class="plugin-icon" alt="">
</a>
</h3>
</div>
<div class="desc column-description">
<p><?php _e( 'Automatic image optimization without any quality loss. No limitations, no paid plans. The best WordPress image optimization plugin allows optimizing any amount of images for free!', 'robin-image-optimizer' ); ?></p>
</div>
</div>
<div class="plugin-card-bottom" style="text-align: right">
<?php if ( ! wrio_is_license_activate() ) : ?>
<a href="<?php echo $license_page_url; ?>" class="button">
<span class="dashicons dashicons-lock" style="font-size: 15px;line-height: 1.7;color: #ff5722;"></span>
<?php _e( 'License', 'robin-image-optimizer' ); ?>
</a>
<?php endif; ?>
<?php $delete_button->renderButton(); ?><?php $install_button->renderButton(); ?>
</div>
</div>

View File

@@ -0,0 +1,53 @@
<?php defined( 'ABSPATH' ) || die( 'Cheatin uh?' ); ?>
<div class="wrio-swal-subtitle"><?php _e( 'What you need to know before starting optimization.', 'robin-image-optimizer' ); ?></div>
<div class="wrio-swal-content">
<ul class="wrio-list-infos">
<li>
<span class="wrio-info-icon">
<svg width="36" height="33" viewBox="0 0 36 33" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero">
<path d="m35.38 26.295c0-.002 0-.002 0 0l-13.501-23.787c-.8-1.41-2.247-2.252-3.873-2.252-1.625 0-3.071.843-3.872 2.252l-13.5 23.786c-.791 1.393-.78 3.051.027 4.437.807 1.386 2.246 2.214 3.846 2.214l27 0c1.6 0 3.038-.828 3.844-2.212.807-1.386.818-3.045.029-4.437m-1.325 3.681c-.534.919-1.488 1.469-2.548 1.469l-27 0c-1.062 0-2.01-.549-2.55-1.469-.534-.919-.541-2.02-.018-2.941l13.5-23.787c.529-.934 1.489-1.493 2.566-1.493 1.078 0 2.038.558 2.568 1.493l13.502 23.786c.523.924.516 2.025-.02 2.943"></path>
<path d="m18.01 9.459c-.414 0-.75.336-.75.75l0 10.772c0 .414.336.75.75.75.414 0 .75-.336.75-.75l0-10.772c0-.414-.336-.75-.75-.75"></path>
<path d="m18.01 24.933c-.414 0-.75.336-.75.75l0 .373c0 .414.336.75.75.75.414 0 .75-.336.75-.75l0-.373c0-.416-.336-.75-.75-.75"></path>
</g>
</svg>
</span>
<span><?php _e( 'If you choose to optimize now, you should keep this page open until bulk optimization is performed. If you leave, the optimization process will stop and you will need to run it again.', 'robin-image-optimizer' ); ?></span>
</li>
<li>
<span class="wrio-info-icon">
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero">
<path d="m18 36c-9.925 0-18-8.07-18-18 0-9.925 8.07-18 18-18 9.925 0 18 8.07 18 18 0 9.925-8.07 18-18 18m0-34.435c-9.06 0-16.435 7.372-16.435 16.435 0 9.06 7.372 16.435 16.435 16.435 9.06 0 16.435-7.372 16.435-16.435 0-9.06-7.372-16.435-16.435-16.435"></path>
<path d="m27.391 18.783l-9.391 0c-.432 0-.783-.351-.783-.783l0-12.522c0-.432.351-.783.783-.783.432 0 .783.351.783.783l0 11.739 8.609 0c.432 0 .783.351.783.783 0 .432-.351.783-.783.783"></path>
</g>
</svg>
</span>
<span>
<?php
$optimize_type = WRIO_Plugin::app()->getOption( 'image_optimization_type', 'schedule' );
if ( $optimize_type === 'schedule' ) {
_e( 'If you choose scheduled optimization, you can leave this page or close the tab. The plugin will optimize images on a schedule until they are all optimized. This method is slower than alternatives, but you don\'t have to wait.', 'robin-image-optimizer' );
} elseif ( $optimize_type === 'background' ) {
_e( 'If you have selected background optimization, you can leave this page or close the tab. The plugin will optimize images automatically until they are all optimized. This method is faster than scheduled or manual optimization. (beta)', 'robin-image-optimizer' );
}
?>
</span>
</li>
<li>
<span class="wrio-info-icon">
<svg width="36" height="47" viewBox="0 0 36 47" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero" transform="translate(-594-569)">
<path d="m13.304 31.3l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0-4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 9.391l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m-8.609-22.696c0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783l-25.04 0c-.432 0-.783.351-.783.783m30.522-18l-21.913 0c-.105 0-.207.022-.302.061-.045.019-.08.053-.121.08-.044.03-.094.05-.131.088l-12.522 12.522c-.036.036-.056.085-.085.127-.028.042-.064.078-.083.125-.039.095-.061.197-.061.302l0 32.87c0 .432.351.783.783.783l34.435 0c.432 0 .783-.351.783-.783l0-45.39c0-.432-.351-.783-.783-.783m-22.696 2.672l0 9.85-9.85 0 9.85-9.85m21.913 42.719l-32.87 0 0-31.3 11.739 0c.432 0 .783-.351.783-.783l0-11.739 20.348 0 0 43.826m-3.913-23.478l-25.04 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-14.09 0c-.432 0-.783.351-.783.783l0 14.09c0 .011.006.019.006.03.003.063.019.121.036.182.011.039.017.08.034.116.022.047.056.086.086.128.03.041.056.083.094.117.009.009.014.02.023.03.03.025.066.033.097.052.045.028.091.058.142.077.05.017.1.023.152.031.038.003.072.02.111.02l14.09 0c.161 0 .302-.059.426-.144.014-.009.03-.005.044-.014.014-.011.02-.025.033-.036.044-.038.08-.081.114-.128.028-.038.055-.072.075-.111.022-.044.034-.091.049-.141.014-.052.028-.102.031-.155.002-.019.011-.033.011-.052l0-14.09c0-.434-.351-.784-.783-.784m-12.417 14.09l2.446-2.936 2.576 1.288c.34.171.75.072.977-.23l1.722-2.295 3.13 4.173-10.852 0m11.634-1.567l-3.287-4.383c-.296-.394-.958-.394-1.252 0l-1.957 2.608-2.547-1.273c-.327-.164-.72-.08-.952.199l-2.528 3.033 0-11.14 12.522 0 0 10.955m-9.391-6.259c.862 0 1.565-.703 1.565-1.565 0-.862-.703-1.565-1.565-1.565-.862 0-1.565.703-1.565 1.565 0 .862.703 1.565 1.565 1.565"
transform="translate(594 569)" fill="#ccc" fill-rule="nonzero"></path>
</g>
</svg>
</span>
<span>
<?php _e( 'Remember that the optimization of a large number of images may take some time depending on your server and network speed.', 'robin-image-optimizer' ); ?>
<span>
</span></span>
</li>
</ul>
</div>
<!-- wrio-swal-content -->

View File

@@ -0,0 +1,53 @@
<?php defined( 'ABSPATH' ) || die( 'Cheatin uh?' ); ?>
<div class="wrio-swal-subtitle"><?php _e( 'What you need to know before starting conversion.', 'robin-image-optimizer' ); ?></div>
<div class="wrio-swal-content">
<ul class="wrio-list-infos">
<li>
<span class="wrio-info-icon">
<svg width="36" height="33" viewBox="0 0 36 33" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero">
<path d="m35.38 26.295c0-.002 0-.002 0 0l-13.501-23.787c-.8-1.41-2.247-2.252-3.873-2.252-1.625 0-3.071.843-3.872 2.252l-13.5 23.786c-.791 1.393-.78 3.051.027 4.437.807 1.386 2.246 2.214 3.846 2.214l27 0c1.6 0 3.038-.828 3.844-2.212.807-1.386.818-3.045.029-4.437m-1.325 3.681c-.534.919-1.488 1.469-2.548 1.469l-27 0c-1.062 0-2.01-.549-2.55-1.469-.534-.919-.541-2.02-.018-2.941l13.5-23.787c.529-.934 1.489-1.493 2.566-1.493 1.078 0 2.038.558 2.568 1.493l13.502 23.786c.523.924.516 2.025-.02 2.943"></path>
<path d="m18.01 9.459c-.414 0-.75.336-.75.75l0 10.772c0 .414.336.75.75.75.414 0 .75-.336.75-.75l0-10.772c0-.414-.336-.75-.75-.75"></path>
<path d="m18.01 24.933c-.414 0-.75.336-.75.75l0 .373c0 .414.336.75.75.75.414 0 .75-.336.75-.75l0-.373c0-.416-.336-.75-.75-.75"></path>
</g>
</svg>
</span>
<span><?php _e( 'If you choose to convert now, you should keep this page open until bulk conversion is performed. If you leave, the conversion process will stop and you will need to run it again.', 'robin-image-optimizer' ); ?></span>
</li>
<li>
<span class="wrio-info-icon">
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero">
<path d="m18 36c-9.925 0-18-8.07-18-18 0-9.925 8.07-18 18-18 9.925 0 18 8.07 18 18 0 9.925-8.07 18-18 18m0-34.435c-9.06 0-16.435 7.372-16.435 16.435 0 9.06 7.372 16.435 16.435 16.435 9.06 0 16.435-7.372 16.435-16.435 0-9.06-7.372-16.435-16.435-16.435"></path>
<path d="m27.391 18.783l-9.391 0c-.432 0-.783-.351-.783-.783l0-12.522c0-.432.351-.783.783-.783.432 0 .783.351.783.783l0 11.739 8.609 0c.432 0 .783.351.783.783 0 .432-.351.783-.783.783"></path>
</g>
</svg>
</span>
<span>
<?php
$optimize_type = WRIO_Plugin::app()->getOption( 'image_optimization_type', 'schedule' );
if ( $optimize_type === 'schedule' ) {
_e( 'If you choose scheduled conversion, you can leave this page or close the tab. The plugin will convert images on a schedule until they are all converted. This method is slower than alternatives, but you don\'t have to wait.', 'robin-image-optimizer' );
} elseif ( $optimize_type === 'background' ) {
_e( 'If you have selected background conversion, you can leave this page or close the tab. The plugin will convert images automatically until they are all converted. This method is faster than scheduled or manual conversion. (beta)', 'robin-image-optimizer' );
}
?>
</span>
</li>
<li>
<span class="wrio-info-icon">
<svg width="36" height="47" viewBox="0 0 36 47" xmlns="http://www.w3.org/2000/svg">
<g fill="#ccc" fill-rule="nonzero" transform="translate(-594-569)">
<path d="m13.304 31.3l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0-4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 9.391l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m-8.609-22.696c0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783l-25.04 0c-.432 0-.783.351-.783.783m30.522-18l-21.913 0c-.105 0-.207.022-.302.061-.045.019-.08.053-.121.08-.044.03-.094.05-.131.088l-12.522 12.522c-.036.036-.056.085-.085.127-.028.042-.064.078-.083.125-.039.095-.061.197-.061.302l0 32.87c0 .432.351.783.783.783l34.435 0c.432 0 .783-.351.783-.783l0-45.39c0-.432-.351-.783-.783-.783m-22.696 2.672l0 9.85-9.85 0 9.85-9.85m21.913 42.719l-32.87 0 0-31.3 11.739 0c.432 0 .783-.351.783-.783l0-11.739 20.348 0 0 43.826m-3.913-23.478l-25.04 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-14.09 0c-.432 0-.783.351-.783.783l0 14.09c0 .011.006.019.006.03.003.063.019.121.036.182.011.039.017.08.034.116.022.047.056.086.086.128.03.041.056.083.094.117.009.009.014.02.023.03.03.025.066.033.097.052.045.028.091.058.142.077.05.017.1.023.152.031.038.003.072.02.111.02l14.09 0c.161 0 .302-.059.426-.144.014-.009.03-.005.044-.014.014-.011.02-.025.033-.036.044-.038.08-.081.114-.128.028-.038.055-.072.075-.111.022-.044.034-.091.049-.141.014-.052.028-.102.031-.155.002-.019.011-.033.011-.052l0-14.09c0-.434-.351-.784-.783-.784m-12.417 14.09l2.446-2.936 2.576 1.288c.34.171.75.072.977-.23l1.722-2.295 3.13 4.173-10.852 0m11.634-1.567l-3.287-4.383c-.296-.394-.958-.394-1.252 0l-1.957 2.608-2.547-1.273c-.327-.164-.72-.08-.952.199l-2.528 3.033 0-11.14 12.522 0 0 10.955m-9.391-6.259c.862 0 1.565-.703 1.565-1.565 0-.862-.703-1.565-1.565-1.565-.862 0-1.565.703-1.565 1.565 0 .862.703 1.565 1.565 1.565"
transform="translate(594 569)" fill="#ccc" fill-rule="nonzero"></path>
</g>
</svg>
</span>
<span>
<?php _e( 'Remember that the conversion of a large number of images may take some time depending on your server and network speed.', 'robin-image-optimizer' ); ?>
<span>
</span></span>
</li>
</ul>
</div>
<!-- wrio-swal-content -->

View File

@@ -0,0 +1,38 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* AVIF conversion button template.
* Premium feature only.
*
* @var array $data
* @var WRIO_Page $page
*/
$cron_running = WRIO_Plugin::app()->getPopulateOption( 'avif_conversion_cron_running', false );
$process_running = WRIO_Plugin::app()->getPopulateOption( $data['scope'] . '_avif_process_running', false );
if ( ! $cron_running || $cron_running != $data['scope'] ) {
$cron_running = false;
}
if ( ! $process_running || $process_running != $data['scope'] . '_avif' ) {
$process_running = false;
}
$button_classes = [
'wio-optimize-button',
];
$button_name = __( 'Convert to AVIF', 'robin-image-optimizer' );
if ( $cron_running || $process_running ) {
$button_classes[] = 'wrio-cron-mode wio-running';
$button_name = $process_running ? __( 'Stop conversion', 'robin-image-optimizer' ) : __( 'Stop schedule conversion', 'robin-image-optimizer' );
}
?>
<button type="button" id="wrio-start-avif-conversion" data-format="avif" class="<?php echo join( ' ', $button_classes ); ?>">
<?php echo esc_attr( $button_name ); ?>
</button>

View File

@@ -0,0 +1,40 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* WebP conversion button template.
* Available for all users (free and premium).
*
* @var array $data
* @var WRIO_Page $page
*/
$cron_running = WRIO_Plugin::app()->getPopulateOption( 'conversion_cron_running', false );
$process_running = WRIO_Plugin::app()->getPopulateOption( $data['scope'] . '_webp_process_running', false );
if ( ! $cron_running || $cron_running != $data['scope'] ) {
$cron_running = false;
}
if ( ! $process_running || $process_running != $data['scope'] . '_webp' ) {
$process_running = false;
}
$button_classes = [
'wio-optimize-button',
];
$button_name = __( 'Convert to WebP', 'robin-image-optimizer' );
if ( $cron_running || $process_running ) {
$button_classes[] = 'wrio-cron-mode wio-running';
$button_name = $process_running ? __( 'Stop conversion', 'robin-image-optimizer' ) : __( 'Stop scheduled conversion', 'robin-image-optimizer' );
} else {
$button_name = __( 'Convert to WebP', 'robin-image-optimizer' );
}
?>
<button type="button" id="wrio-start-conversion" data-format="webp" class="<?php echo join( ' ', $button_classes ); ?>">
<?php echo esc_attr( $button_name ); ?>
</button>

View File

@@ -0,0 +1,61 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
$cron_running = WRIO_Plugin::app()->getPopulateOption( 'cron_running', false );
$process_running = WRIO_Plugin::app()->getPopulateOption( 'process_running', false );
if ( ! $cron_running || $cron_running != $data['scope'] ) {
$cron_running = false;
}
if ( ! $process_running || $process_running != $data['scope'] ) {
$process_running = false;
}
$button_classes = [
'wio-optimize-button',
];
$button_name = '';
if ( $cron_running || $process_running ) {
$button_classes[] = 'wrio-cron-mode wio-running';
$button_name = $process_running ? __( 'Stop background optimization', 'robin-image-optimizer' ) : __( 'Stop schedule optimization', 'robin-image-optimizer' );
} else {
$button_name = __( 'Start Optimization', 'robin-image-optimizer' );
}
// Get enabled formats for the message
$enabled_formats = [];
// For custom-folders and nextgen, only show "Compression" since format conversion is only for Media Library for the moments.
$show_formats = ! in_array( $data['scope'], [ 'custom-folders', 'nextgen-gallery' ], true );
if ( $show_formats && class_exists( 'WRIO_Format_Converter_Factory' ) ) {
$enabled_formats = WRIO_Format_Converter_Factory::get_enabled_formats();
}
// Build dynamic message based on enabled formats
$format_message = '';
if ( $show_formats && ! empty( $enabled_formats ) ) {
$features = [ __( 'Compression', 'robin-image-optimizer' ) ];
$features = array_merge( $features, array_map( 'strtoupper', $enabled_formats ) );
$format_message = implode( ' • ', $features );
} else {
$format_message = __( 'Only Compression', 'robin-image-optimizer' );
}
?>
<button type="button" id="wrio-start-optimization" class="<?php echo join( ' ', $button_classes ); ?>">
<?php echo esc_attr( $button_name ); ?>
</button>
<?php if ( ! empty( $format_message ) ) : ?>
<p class="wrio-optimization-format-info">
<?php echo esc_html( $format_message ); ?>
</p>
<?php endif; ?>

View File

@@ -0,0 +1,221 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
?>
<style>
/**
* Стили временно в коде.
* Если такой вариант реализации прокрутки для таблицы подойдёт, то стили нужно будет перенести в основной файл
* Пример взят с https://jsfiddle.net/tsayen/xuvsncr2/28/
*/
.wrio-table-container {
height: 25em;
}
.wrio-table-container table {
display: flex;
flex-flow: column;
height: 100%;
width: 100%;
}
.wrio-table-container table thead {
/* head takes the height it requires,
and it's not scaled when table is resized */
flex: 0 0 auto;
width: calc(100% - 0.9em);
}
.wrio-table-container table tbody {
/* body takes all the remaining available space */
flex: 1 1 auto;
display: block;
overflow-y: scroll;
}
.wrio-table-container table tbody tr {
width: 100%;
}
.wrio-table-container table thead,
.wrio-table-container table tbody tr {
display: table;
table-layout: fixed;
}
.wrio-table-container table tbody tr {
width: 100%;
word-break: break-all;
}
.flash {
-moz-animation: flash 1s ease-out;
-webkit-animation: flash 1s ease-out;
-ms-animation: flash 1s ease-out;
animation: flash 1s ease-out;
}
@-webkit-keyframes flash {
0% {
background-color: transparent;
}
30% {
background-color: #fffade;
}
100% {
background-color: transparent;
}
}
@-moz-keyframes flash {
0% {
background-color: transparent;
}
30% {
background-color: #fffade;
}
100% {
background-color: transparent;
}
}
@-ms-keyframes flash {
0% {
background-color: transparent;
}
30% {
background-color: #fffade;
}
100% {
background-color: transparent;
}
}
</style>
<div class="wrio-optimization-progress">
<div class="wbcr-factory-page-group-header" style="margin-bottom:0;">
<strong><?php esc_html_e( 'Optimization log', 'robin-image-optimizer' ); ?></strong>
<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>
</div>
<div class="<?php echo esc_attr( empty( $data['process_log'] ) ? 'wrio-table-container-empty' : 'wrio-table-container' ); ?>">
<table class="wrio-table">
<thead>
<tr>
<th></th>
<th><?php esc_html_e( 'File name', 'robin-image-optimizer' ); ?></th>
<th><?php esc_html_e( 'Initial size', 'robin-image-optimizer' ); ?></th>
<th><?php esc_html_e( 'Optimized size', 'robin-image-optimizer' ); ?></th>
<?php if ( 'custom-folders' !== $data['scope'] ) : ?>
<th><?php esc_html_e( 'Compressed thumbnails', 'robin-image-optimizer' ); ?></th>
<?php endif; ?>
<th><?php esc_html_e( 'Overall Saving', 'robin-image-optimizer' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( empty( $data['process_log'] ) ) : ?>
<tr>
<td colspan="<?php echo( 'custom-folders' !== $data['scope'] ? '9' : '8' ); ?>"><?php esc_html_e( "You don't have optimized images.", 'robin-image-optimizer' ); ?></td>
</tr>
<?php else : ?>
<?php foreach ( (array) $data['process_log'] as $item ) : ?>
<?php if ( isset( $item['type'] ) && 'error' === $item['type'] ) : ?>
<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'] ); ?>">
<td>
<?php if ( ! empty( $item['original_url'] ) ) : ?>
<a href="<?php echo esc_url( $item['original_url'] ); ?>" target="_blank">
<img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt="">
</a>
<?php else : ?>
<img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt="">
<?php endif; ?>
</td>
<td>
<a href="<?php echo esc_attr( $item['url'] ); ?>" target="_blank"><?php echo esc_attr( $item['file_name'] ); ?></a>
</td>
<td colspan="<?php echo( 'custom-folders' !== $data['scope'] ? '7' : '6' ); ?>">
<?php esc_html_e( 'Error', 'robin-image-optimizer' ); ?>:
<?php if ( isset( $item['error_msg'] ) ) : ?>
<?php echo esc_attr( $item['error_msg'] ); ?>
<?php else : ?>
<?php esc_html_e( 'An unexpected error occurred. Please try again.', 'robin-image-optimizer' ); ?>
<?php endif; ?>
</td>
</tr>
<?php else : ?>
<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'] ); ?>">
<td>
<?php if ( ! empty( $item['original_url'] ) ) : ?>
<a href="<?php echo esc_url( $item['original_url'] ); ?>" target="_blank">
<img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt="">
</a>
<?php else : ?>
<img width="40" height="40" src="<?php echo esc_attr( $item['thumbnail_url'] ); ?>" alt="">
<?php endif; ?>
</td>
<td>
<a href="<?php echo esc_attr( $item['url'] ); ?>"><?php echo esc_attr( $item['file_name'] ); ?></a>
</td>
<td class="wrio-original-size">
<?php echo esc_attr( $item['original_size'] ); ?>
</td>
<td class="wrio-optimized-size">
<?php echo esc_attr( $item['optimized_size'] ); ?>
</td>
<?php if ( $data['scope'] !== 'custom-folders' ) : ?>
<td class="wrio-thumbnails-count">
<?php echo esc_attr( $item['thumbnails_count'] ); ?>
</td>
<?php endif; ?>
<td class="wrio-total-saving">
<?php echo esc_attr( $item['total_saving'] ); ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php if ( 'media-library' === $data['scope'] && ! wrio_is_license_activate() && ! wrio_is_avif_banner_dismissed() ) : ?>
<div class="wrio-avif-upsell-banner" data-nonce="<?php echo esc_attr( wp_create_nonce( 'wrio_dismiss_avif_banner' ) ); ?>">
<button type="button" class="wrio-avif-banner-dismiss" aria-label="<?php esc_attr_e( 'Dismiss', 'robin-image-optimizer' ); ?>">&times;</button>
<div class="wrio-avif-banner-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13 2L3 14h7v8l10-12h-7V2z" fill="#FFB638" stroke="#FF9800" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</div>
<div class="wrio-avif-banner-content">
<div class="wrio-avif-banner-header">
<h3 class="wrio-avif-banner-title"><?php esc_html_e( 'Want even smaller files?', 'robin-image-optimizer' ); ?></h3>
<span class="wrio-avif-pro-badge"><?php esc_html_e( 'PRO', 'robin-image-optimizer' ); ?></span>
</div>
<p class="wrio-avif-banner-description">
<?php
printf(
/* translators: %1$s and %2$s are <strong> tags wrapping the compression percentage */
esc_html__( 'AVIF format delivers %1$s20-50%% better compression%2$s than WebP. Unlock AVIF conversion to maximize your savings.', 'robin-image-optimizer' ),
'<strong>',
'</strong>'
);
?>
</p>
<div class="wrio-avif-banner-actions">
<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">
<?php esc_html_e( 'Unlock AVIF Conversion', 'robin-image-optimizer' ); ?>
</a>
<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">
<?php esc_html_e( 'Learn more about AVIF', 'robin-image-optimizer' ); ?>
</a>
</div>
</div>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,29 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
$blogs = WIO_Multisite::getBlogs( $data['scope'] );
$current_blog = WRIO_Plugin::app()->getPopulateOption( 'current_blog', 1 );
?>
<select style="width:200px;display:inline-block; height: 45px; margin-left:40px;" id="wbcr-rio-current-blog"
class="factory-dropdown factory-from-control-dropdown form-control"
data-context="<?php echo esc_attr( $data['scope'] ); ?>"
data-nonce="<?php echo wp_create_nonce( 'update_blog_id' ); ?>">
<?php foreach ( (array) $blogs as $blog ) : ?>
<?php
$blog_name = $blog->domain . $blog->path;
if ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) {
$blog_name = $blog->domain;
}
?>
<option <?php selected( $current_blog, $blog->blog_id ); ?>
value="<?php echo esc_attr( $blog->blog_id ); ?>"><?php echo esc_attr( $blog_name ); ?></option>
<?php endforeach; ?>
</select>

View File

@@ -0,0 +1,37 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
$is_premium = wrio_is_license_activate();
?>
<div class="wrio-servers" style="display:none;">
<div>
<div class="wrio-server-mode-wrap">
<span><strong><?php esc_html_e( 'Mode', 'robin-image-optimizer' ); ?>:</strong></span>
<span class="wrio-server-mode">
<?php echo esc_html( $is_premium ? __( 'Premium', 'robin-image-optimizer' ) : __( 'Free', 'robin-image-optimizer' ) ); ?>
</span>
</div>
<div class="wrio-server-status-wrap">
<span><strong><?php esc_html_e( 'Status', 'robin-image-optimizer' ); ?>:</strong></span>
<span class="wrio-server-status wrio-server-check-proccess"> </span>
</div>
<div class="wrio-premium-user-balance-wrap">
<span><strong><?php esc_html_e( 'Tokens', 'robin-image-optimizer' ); ?>:</strong></span>
<span class="wrio-premium-user-balance wrio-premium-user-balance-check-proccess"
data-toggle="tooltip"
title="<?php echo esc_attr__( 'The all images are limited, including thumbnails', 'robin-image-optimizer' ); ?>"> </span>
</div>
<div class="wrio-premium-user-update-wrap">
<span><strong><?php esc_html_e( 'Next tokens update', 'robin-image-optimizer' ); ?>:</strong></span>
<span class="wrio-premium-user-update wrio-premium-user-update-check-proccess"
data-toggle="tooltip"
title="<?php echo esc_attr__( 'Date when the limit is topped up', 'robin-image-optimizer' ); ?>"></span>
</div>
</div>
</div>

View File

@@ -0,0 +1,74 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
if ( isset( $data['scope'] ) ) {
$scope = $data['scope'];
}
$total_images = $data['stats']['optimized'] + $data['stats']['unoptimized'];
?>
<div class="wrio-cards-container">
<!-- Image Optimization Card -->
<div class="wrio-card">
<div class="wrio-card-title"><?php _e( 'Image Optimization', 'robin-image-optimizer' ); ?></div>
<div class="wrio-donut-container">
<canvas id="wio-main-chart" width="160" height="160"
data-unoptimized="<?php echo esc_attr( $data['stats']['unoptimized'] ); ?>"
data-optimized="<?php echo esc_attr( $data['stats']['optimized'] ); ?>"
data-errors="<?php echo esc_attr( $data['stats']['error'] ); ?>"
style="display: block;">
</canvas>
<div class="wrio-donut-percent">
<span id="wio-overview-chart-percent"><?php echo esc_attr( $data['stats']['optimized_percent'] ); ?></span><span>%</span>
</div>
</div>
<div class="wrio-legend">
<div class="wrio-legend-item">
<span class="wrio-legend-dot gray"></span>
<?php _e( 'Unoptimized', 'robin-image-optimizer' ); ?> - <span id="wio-unoptimized-num"><?php echo esc_attr( $data['stats']['unoptimized'] ); ?></span>
</div>
<div class="wrio-legend-item">
<span class="wrio-legend-dot green"></span>
<?php _e( 'Optimized', 'robin-image-optimizer' ); ?> - <span id="wio-optimized-num"><?php echo esc_attr( $data['stats']['optimized'] ); ?></span>
</div>
<div class="wrio-legend-item">
<span class="wrio-legend-dot red"></span>
<?php _e( 'Error', 'robin-image-optimizer' ); ?> - <span id="wio-error-num"><?php echo esc_attr( $data['stats']['error'] ); ?></span>
</div>
</div>
<div class="wrio-size-info">
<div class="wrio-size-row">
<span><?php _e( 'Original size', 'robin-image-optimizer' ); ?></span>
<span id="wio-original-size"><?php echo esc_attr( wrio_convert_bytes( $data['stats']['original_size'] ) ); ?></span>
</div>
<div class="wrio-size-bar">
<div class="wrio-size-bar-fill" style="width: 100%"></div>
</div>
<div class="wrio-size-row">
<span><?php _e( 'Optimized size', 'robin-image-optimizer' ); ?></span>
<span id="wio-optimized-size"><?php echo esc_attr( wrio_convert_bytes( $data['stats']['optimized_size'] ) ); ?></span>
</div>
<div class="wrio-size-bar">
<div id="wio-optimized-bar" class="wrio-size-bar-fill optimized" style="width: <?php echo esc_attr( isset( $data['stats']['percent_line'] ) ? $data['stats']['percent_line'] : 0 ); ?>%"></div>
</div>
<div class="wrio-size-row">
<span><?php _e( 'Total saved', 'robin-image-optimizer' ); ?></span>
<span id="wio-total-saved" class="wrio-green"><?php echo esc_attr( $data['stats']['save_size_percent'] ); ?>%</span>
</div>
</div>
<div class="wrio-card-footer">
<?php $this->print_template( 'part-bulk-optimization-button', $data, $page ); ?>
</div>
</div>
</div>
<div class="wrio-statistic-message"></div>

View File

@@ -0,0 +1,51 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
$tab_target = ! $data['is_premium'] ? ' target="_blank"' : '';
$tab_classes = ! $data['is_premium'] ? ' wrio-statistic-tab-premium-label' : '';
$purchase_url = WRIO_Plugin::app()->get_support()->get_pricing_url( true, 'statistic' );
$media_page_url = $page->getBaseUrl( 'rio_general' );
$cf_page_url = ! $data['is_premium'] ? $purchase_url : WRIO_Plugin::app()->getPluginPageUrl( 'io_folders_statistic' );
$ngg_page_url = ! $data['is_premium'] ? $purchase_url : $page->getBaseUrl( 'io_nextgen_gallery_statistic' );
?>
<div class="wrio-statistic-nav">
<ul>
<li style="z-index: 9;"<?php echo( $page->id == 'rio_general' ? ' class="active"' : '' ); ?>>
<a class="wrio-statistic-tab wio-media-library-tab" href="<?php echo $media_page_url; ?>">
<span class="dashicons dashicons-admin-media"></span>
<?php _e( 'Media library', 'robin-image-optimizer' ); ?>
<span class="wrio-statistic-tab-percent">
<?php echo apply_filters( 'wbcr/rio/optimize_template/optimized_percent', 0, 'media-library' ); ?>%
</span>
</a>
</li>
<li style="z-index: 8;"<?php echo( $page->id == 'io_folders_statistic' ? ' class="active"' : '' ); ?>>
<a class="wrio-statistic-tab wio-custom-folders-tab<?php echo $tab_classes; ?>" href="<?php echo $cf_page_url; ?>"<?php echo $tab_target; ?>>
<span class="dashicons dashicons-portfolio"></span>
<?php _e( 'Custom folders', 'robin-image-optimizer' ); ?>
<span class="wrio-statistic-tab-percent">
<?php echo apply_filters( 'wbcr/rio/optimize_template/optimized_percent', 0, 'custom-folders' ); ?>%
</span>
</a>
</li>
<?php if ( wrio_is_active_nextgen_gallery() ) : ?>
<li style="z-index: 7;"<?php echo( $page->id == 'io_nextgen_gallery_statistic' ? ' class="active"' : '' ); ?>>
<a class="wrio-statistic-tab wio-nextgen-gallery-tab<?php echo $tab_classes; ?>" href="<?php echo $ngg_page_url; ?>"<?php echo $tab_target; ?>>
<span class="dashicons dashicons-images-alt2"></span>
<?php _e( 'Nextgen gallery', 'robin-image-optimizer' ); ?>
<span class="wrio-statistic-tab-percent">
<?php echo apply_filters( 'wbcr/rio/optimize_template/optimized_percent', 0, 'nextgen' ); ?>%
</span>
</a>
</li>
<?php endif; ?>
</ul>
</div>

View File

@@ -0,0 +1,17 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
$s = '';
?>
<div class="wio-stat-totals">
<?php _e( 'Total found:', 'robin-image-optimizer' ); ?> <span id="wio-stat-totals__totals" class="wio-stat-totals__counter wio-stat-totals__loading">0</span>
<?php _e( 'Originals:', 'robin-image-optimizer' ); ?> <span id="wio-stat-totals__originals" class="wio-stat-totals__counter wio-stat-totals__loading">0</span>
<?php _e( 'Thumbnails:', 'robin-image-optimizer' ); ?> <span id="wio-stat-totals__thumbnails" class="wio-stat-totals__counter wio-stat-totals__loading">0</span>
</div>

View File

@@ -0,0 +1,16 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
* @var WRIO_Page $page
*/
?>
<div class="wbcr-factory-page-group-header" style="margin:0;">
<strong><?php echo $data['title']; ?></strong>
<p>
<?php echo $data['description']; ?>
</p>
</div>

View File

@@ -0,0 +1,28 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
*/
?>
<div class="form-group">
<label class="col-sm-4 control-label"></label>
<div class="control-group col-sm-8">
<div id="wrio-error-log-options">
<p class="wrio-error-log-options-info">
<?php _e( 'Additional logging levels. Enable these options only when the plugin support service asks for it. If you use logging always, it can slow down your site.', 'robin-image-optimizer' ); ?>
</p>
<ul>
<li>
<label for="wrio-error-log-options-checkbox-frontend">
<input type="checkbox" id="wrio-error-log-options-checkbox-frontend" name="wrio_keep_error_log_on_frontend" class="wrio-error-log-options-checkbox" value="1"<?php checked( $data['keep_error_log_on_frontend'] ); ?>>
<?php _e( 'Keep an error log on frontend', 'robin-image-optimizer' ); ?>
</label>
<p class="wrio-webp-options-info">
<?php _e( 'Option enables error logging on frontend. If for some reason webp images are not displayed on the front-end, you can use this option to catch errors and send this report to the plugin support service.', 'robin-image-optimizer' ); ?>
</p>
</li>
</ul>
</div>
</div>
</div>