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,15 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
*/
?>
<p><?php _e( 'Select a directory for optimization. All nested images and folders will be optimized recursively.', 'robin-image-optimizer' ); ?></p>
<div id="wrio-file-tree"></div>
<input id="wbcr-rio-selected-path" disabled type="text" style="width:100%;">
<p id="wbcr-rio-indexing-text" style="display:none;"><?php _e( 'The selected directory is being indexed. Found', 'robin-image-optimizer' ); ?>
<span class="wbcr-rio-indexing-counter">0</span> <?php _e( 'images.', 'robin-image-optimizer' ); ?></p>
<p id="wbcr-rio-indexing-finish-text" style="display:none;"><?php _e( 'Indexing complete. Directory successfully added and ready for optimization.', 'robin-image-optimizer' ); ?></p>

View File

@@ -0,0 +1,57 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
/**
* @var array $data
*/
$cf = WRIO_Custom_Folders::get_instance();
$custom_folders = $cf->getFolders();
?>
<div class="wrio-folders-wrapper">
<div class="wbcr-factory-page-group-header" style="margin:0;">
<strong><?php _e( 'Additional media folders', 'robin-image-optimizer' ); ?></strong>
<p><?php _e( 'Use the add folder... button to select site folders. Robin image optimizer will optimize images from the specified folders and their subfolders. The optimization status for each image in these folders can be seen in the Other Media list, under the Media menu.', 'robin-image-optimizer' ); ?></p>
<a id="wrio-add-new-folder" href="#" class="btn btn-default"><?php _e( 'Add custom folder', 'robin-image-optimizer' ); ?></a>
</div>
<div class="wbcr-factory-page-group-body">
<table class="wrio-table wbcr-rio-folders-table">
<thead>
<tr>
<th style="width: 80px"></th>
<th style="width: 200px"><?php _e( 'Status', 'robin-image-optimizer' ); ?></th>
<th style="text-align: left;"><?php _e( 'Folder', 'robin-image-optimizer' ); ?></th>
<th style="width: 100px"><?php _e( 'Cancel', 'robin-image-optimizer' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( ! empty( $custom_folders ) ) : ?>
<?php foreach ( $custom_folders as $folder ) : ?>
<tr class="wrio-table-item">
<td></td>
<td>
&nbsp;
<?php
// translators: %1$d is the number of compressed images, %2$s is the total number of images
printf( __( 'Compressed %1$d of %2$s<br>images', 'robin-image-optimizer' ), $folder->get( 'optimized_count' ), $folder->get( 'files_count' ) );
?>
</td>
<td style="text-align: left">
<span class="wrio-table-highlighter">/<?php echo esc_attr( $folder->get( 'path' ) ); ?></span>
</td>
<td data-uid="<?php echo esc_attr( $folder->get( 'uid' ) ); ?>">
<!--<button class="wbcr-rio-optimize-folder btn btn-default"><?php _e( 'Optimize', 'robin-image-optimizer' ); ?></button>
<button class="wbcr-rio-scan-folder btn btn-default"><?php _e( 'Sync', 'robin-image-optimizer' ); ?></button>
<button class="wbcr-rio-restore-folder btn btn-default" data-confirm="<?php _e( 'Recover images from backup?', 'robin-image-optimizer' ); ?>"><?php _e( 'Restore', 'robin-image-optimizer' ); ?></button>-->
<button class="wbcr-rio-remove-folder btn btn-default" data-confirm="<?php _e( 'Exclude directory from optimization?', 'robin-image-optimizer' ); ?>">
<span class="dashicons dashicons-no"></span>
</button>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,103 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
use WRIO\WEBP\HTML\Delivery as WEBP_Delivery;
/**
* @var array $data
*/
$webp_enabled = WRIO_Format_Converter_Factory::is_webp_enabled();
$avif_enabled = WRIO_Format_Converter_Factory::is_avif_enabled();
$show_options = $webp_enabled || $avif_enabled;
?>
<div class="form-group factory-control-webp_delivery_mode wrio-conversion-delivery-options"<?php echo ! $show_options ? ' style="display:none;"' : ''; ?>>
<label class="col-sm-4 control-label">
<?php esc_html_e( 'Delivery mode for converted images', 'robin-image-optimizer' ); ?>
</label>
<div class="control-group col-sm-8">
<div class="factory-control factory-control-dropdown">
<ul>
<li>
<label for="wrio-webp-options-radio-redirection">
<input
type="radio"
id="wrio-webp-options-radio-redirection"
name="wrio_webp_delivery_mode"
class="wrio-webp-options-radio"
value="<?php echo esc_attr( WEBP_Delivery::REDIRECT_DELIVERY_MODE ); ?>"
<?php disabled( ! $data['allow_redirection_mode'] ); ?>
<?php checked( WEBP_Delivery::REDIRECT_DELIVERY_MODE, $data['delivery_mode'] ); ?>
>
<?php esc_html_e( 'Redirection (via .htaccess)', 'robin-image-optimizer' ); ?>
</label>
<p class="wrio-webp-options-info">
<?php
echo wp_kses_post(
sprintf(
// translators: %1$s and %2$s are opening and closing bold tags.
__( 'This will add rules in the .htaccess that redirects directly to existing converted files. Best performance is achieved by redirecting in .htaccess. Based on testing your particular hosting configuration, we determined that your server %1$scan\'t%2$s serve the WebP/AVIF versions of the JPEG files seamlessly, via .htaccess.', 'robin-image-optimizer' ),
'<b style="color:red">',
'</b>'
)
);
?>
<br>
<?php esc_html_e( 'Server', 'robin-image-optimizer' ); ?>:
<?php
if ( 'apache' === $data['server'] ) {
echo wp_kses_post( "<span style='color:green'>" . $data['server'] . '</span>' );
} else {
echo wp_kses_post( "<span style='color:red'>" . $data['server'] . ' (' . __( 'Unsupported', 'robin-image-optimizer' ) . ')</span>' );
}
?>
</p>
</li>
<li>
<label for="wrio-webp-options-radio-picture">
<input
type="radio"
id="wrio-webp-options-radio-picture"
name="wrio_webp_delivery_mode"
class="wrio-webp-options-radio"
value="<?php echo esc_attr( WEBP_Delivery::PICTURE_DELIVERY_MODE ); ?>"
<?php checked( WEBP_Delivery::PICTURE_DELIVERY_MODE, $data['delivery_mode'] ); ?>
>
<?php esc_html_e( 'Replace <img> tags with <picture> tags, adding the Webp/AVIF to srcset.', 'robin-image-optimizer' ); ?>
</label>
<p class="wrio-webp-options-info">
<?php
echo wp_kses(
sprintf(
// translators: %1$s is 'picturefill.js', %2$s and %3$s are opening and closing strong tags.
__( 'Each &lt;img&gt; will be replaced with a &lt;picture&gt; tag that will also provide the WebP/AVIF image as a choice for browsers that support it. Also loads the %1$s for browsers that don\'t support the &lt;picture&gt; tag. You don\'t need to activate this if you\'re using the Cache Enabler plugin because your WebP/AVIF images are already handled by this plugin.%2$s Please make a test before using this option%3$s, as if the styles that your theme is using rely on the position of your <img> tag, you might experience display problems. %2$sYou can revert anytime to the previous state by just deactivating the option.%3$s', 'robin-image-optimizer' ),
'picturefill.js',
'<strong>',
'</strong>'
),
[ 'strong' => [] ]
);
?>
</p>
</li>
<li>
<label for="wrio-webp-options-radio-url">
<input
type="radio"
id="wrio-webp-options-radio-url"
name="wrio_webp_delivery_mode"
class="wrio-webp-options-radio"
value="<?php echo esc_attr( WEBP_Delivery::URL_DELIVERY_MODE ); ?>"
<?php checked( WEBP_Delivery::URL_DELIVERY_MODE, $data['delivery_mode'] ); ?>
>
<?php esc_html_e( 'Replace image URLs', 'robin-image-optimizer' ); ?>
</label>
<p class="wrio-webp-options-info">
<?php echo wp_kses_post( __( '"Image URLs" replaces the image URLs to point to the WebP/AVIF rather than the original. Handles src, srcset, common lazy-load attributes and even inline styles.', 'robin-image-optimizer' ) ); ?>
</p>
</li>
</ul>
</div>
</div>
</div>