Changeset 3439319
- Timestamp:
- 01/14/2026 09:22:33 AM (2 weeks ago)
- Location:
- images-to-avif/trunk
- Files:
-
- 3 edited
-
images-to-avif.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
tabs/tab-general.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
images-to-avif/trunk/images-to-avif.php
r3438659 r3439319 4 4 Plugin URI: https://www.paypal.me/jakubnovaksl 5 5 Description: Convert JPG, PNG, GIF and WEBP images to AVIF and speed up your web 6 Version: 1. 06 Version: 1.1 7 7 Author: KubiQ 8 8 Author URI: https://kubiq.sk … … 292 292 $files = scandir( $folder ); 293 293 $converted = 0; 294 295 $skip_until = false; 296 $avif_processed_file = $folder . '/.avif-processed.json'; 297 if( file_exists( $avif_processed_file ) ){ 298 $skip_until = trim( file_get_contents( $avif_processed_file ) ); 299 } 300 294 301 foreach( $files as $file ){ 295 302 if( ! $only_missing || ! file_exists( $folder . '/' . $file . '.avif' ) ){ 296 if( substr( $file, -5 ) != '.webp' || ! file_exists( substr( $folder . '/' . $file, 0, -5 ) ) ){ 297 $converted += $this->convert_image( $folder . '/' . $file ) ? 1 : 0; 303 if( substr( $file, -5 ) != '.avif' ){ 304 if( substr( $file, -5 ) != '.webp' || ! file_exists( substr( $folder . '/' . $file, 0, -5 ) ) ){ 305 if( $skip_until ){ 306 if( $skip_until == $folder . '/' . $file ){ 307 $skip_until = false; 308 } 309 }else{ 310 $converted += $this->convert_image( $folder . '/' . $file ) ? 1 : 0; 311 file_put_contents( $avif_processed_file, $folder . '/' . $file, LOCK_EX ); 312 } 313 } 298 314 } 299 315 } 300 316 } 317 318 wp_delete_file( $avif_processed_file ); 319 301 320 /* translators: amount of converted files */ 302 321 printf( esc_html__( '%d converted', 'images-to-avif' ), intval( $converted ) ); -
images-to-avif/trunk/readme.txt
r3438659 r3439319 6 6 Requires PHP: 7.0 7 7 Tested up to: 6.9 8 Stable tag: 1. 08 Stable tag: 1.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 34 34 ## Hooks for developers 35 36 #### images_to_avif_extensions37 Maybe you want to support also less famous JPEG extension like jpe, jfif or jif38 39 `add_filter( 'images_to_avif_extensions', 'extra_images_to_avif_extensions', 10, 1 );40 function extra_images_to_avif_extensions( $extensions ){41 $extensions[] = 'jpe';42 $extensions[] = 'jfif';43 $extensions[] = 'jif';44 return $extensions;45 }`46 35 47 36 #### images_to_avif_sizes … … 179 168 == Changelog == 180 169 170 = 1.1 = 171 * optimize old images convert process 172 * remove not working images_to_avif_extensions filter 173 181 174 = 1.0 = 182 175 * First version -
images-to-avif/trunk/tabs/tab-general.php
r3438659 r3439319 112 112 </th> 113 113 <td> 114 <?php $this->extensions = apply_filters( 'images_to_avif_extensions', $this->extensions ); ?>115 114 <?php foreach( $this->extensions as $images_to_avif_extension ): ?> 116 115 <br>
Note: See TracChangeset
for help on using the changeset viewer.