=== Avif Express ===
Contributors: Pijush_Gupta
Tags: avif, images, performance
Requires at least: 6.0
Tested up to: 6.8.1
Stable tag: 2025.08.29
Requires PHP: 7.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Autogenerate avif image on image upload and serve autogenerated Avif images instead of jpeg/png to browsers that supports Avif.

== Description ==
On upload, images like jpg, png and WebP gets converted to avif format. Converted images get served on web pages.

= Feature list =
* Images get converted on upload.
* Bulk convert previously uploaded images.
* Schedule Bulk convert in the background. 
* Bulk convert theme images.
* Local Conversion
* Cloud Conversion (Freemium)
* Serve Webpage with altered avif images.
* Fully CDN compatible.
* Backward compatibility - Browsers that don't support Avif images will get Original images served on-the-fly.
* Native Language Support for German, Spanish, Russian, French, Hindi and Bengali.

= Official documentation of Avif Express =
For a more detailed description of options and features of Avif Express, please read the [official documentation](https://github.com/Pijushgupta/avif-express "Avif Express official documentation").

== Installation ==
1. Download and Unzip the file.
2. Upload the plugin into the `wp-content/plugins/` directory of your WordPress site.
3. Activate `Avif Express` from plugin page.

== Frequently Asked Questions ==
= documentation =
Quick documentation [Avif express documentation](https://github.com/Pijushgupta/avif-express)
= How to obtain API key =
You can obtain API key from [Avif Express API](https://rapidapi.com/aavoya-aavoya-default/api/avif-express) - discontinued.
= How to generate avif images from previously uploaded images =
Go to "Avif Express" on the left sidebar menu > On the "Avif express" page > Click on the generate button on "Upload directory" row.
= How to generate avif images from theme's image =
Go to "Avif Express" on left sidebar menu > On the "Avif express" page > Click on the generate button on "Theme directory" row.
= How to replace web-page's images with avif images =
Go to "Avif Express" on left sidebar menu > On the "Avif express" page > Select the mode from the dropdown on "Rendering" row.

== Change Log ==
= 29.08.2025 =
1. Background Image processing
2. Background Image Scanning for Image processing
3. Image Lazy loading - Native, JavaScript, Background Lazy loading
4. Bug fix: - false negative condition for local image conversion. [Issue](https://github.com/Pijushgupta/avif-express/issues/24) by [David Degner](https://github.com/ddegner).
   

= 01.12.05.2025 = 
1.Improved background replacement logic.
2.Added image lazy-loading feature.
3.Bug fix: Fixed image replacement logic for images outside the upload directory.

= 02.08.2024 =
1. Fixed background image replacement bug.
2. Fixed Imagick version checking bug.
3. Added file system permission check before writing.
4. Enabled cloud conversion from localhost.

= 01.20.06.2024 =
1. Removed aviflog(wrapper of monolog), due to php version issue.

= 19.06.2024 =
1. Added cloud conversion for ease of use in case the server doesn't support AVIF conversion.
2. Added an option for a fallback image type (WebP/original) for older browsers/webviews.
3. Added a cookie to notify the server whether to catch pages for browsers that don't support AVIF. (Cookies: browser_avif_support_true, browser_avif_support_false)
4. Implemented a logging system.
5. Added system information to display local server capabilities to the end user.
6. Added on-the-fly AVIF conversion if the server supports it.

= 28.06.2023 =
Feature:
1. Externally added webp images can be served via this plugin on browser that does not support avif image. note: Image fix name should be same as source.
Bugfix
1. If server is capable of generating webp and not avif, then this plugin will generate and serve webp images. In case server is not capable of generating webp and avif both, original image will get served in case no externally added webp image found.
2. Other small bug fixes.

= 02.05.11.2023 =
Bugfix: Image Magic class checking.

= 05.11.2023 =
Bugfix: Skipping SVG processing on rendering. Checking server capability to convert Avif even when rendering is off.

= 05.07.2023 =
Backward compatibility - Browsers that don't support Avif images will get WebP images served on the fly.
Bugfix: Images that don't belongs to the same domain no logger getting skipped.

= 03.20.2023 =
Added translation for German, Spanish, Russian, French, Hindi and Bengali, for backend Admin dash.

= 02.27.2023 =
Issue: Undefined Constant. Fixed.  Pointed by [argument](https://wordpress.org/support/users/argument/,"Bug finder").

= 02.26.2023 =
ImageMagick version checking. Version '7.0.25' or above required.
Issue: Auto convert on upload was not working. Fixed : Typo in namespace.

= 02.25.2023 =
Issue: php 8.1 or 8.2 with GD with libavif support still creating 0 byte avif images. #Php_bug. Fixed with Imagick library.

= 02.23.2023 =
Issue: Migrated images with post type of attachment were not getting converted. Fixed.
Issue: php 8.1 or 8.2 with GD with libavif support still creating 0 byte avif images. Not fixed. #Php_bug

= 01.30.2023 =
Conflict with Autoptimize plugin fixed.

= 01.20.2023 =
Lowered the "Requires at least" wordpress version.
Updated Description on README.txt.
Code commenting.
Added php version checking, require at least 8.1, since imageavif() method only comes with php8.1 or later.
Added method checking for imageavif(), it prevent ajax error in case Php GD not having libavif. libavif is library required by GD to convert image to avif image.
Note: latest Plesk Obsidian(Version 18.0.49) with php 8.2 do not provide libavif to GD. No way around.

= 01.19.2023 =
Updated FAQ section on README.txt.
Added Additional file checking on frontend. If .avif file exist then only alter the image url.

== Screenshots ==
1. Setting Page
