This plugin doesnt work on established sites
]]>“Error establishing a database connection”
]]>Transparent PNGs don’t seem to convert correctly. Is it possible to add PNG exclusion to the conversion? I’m using local conversion.
Here is an example with the original PNG and the converted AVIF:
]]>I have a problem with rendering avif files in a wordpress installation running in a subfolder with the subfolder being in the url.
The Utilty:attachmentUrlToPath function calls ABSPATH but the parsed url path also has the subfolder name in it.
Example: test.domain.com/sitefolder becomes media/htdocs/sitefolder/sitefolder/pathtoimage
]]>So I wonder, if I set HTML to be cached by Cloudflare and say a device that supports avif loads the page, but then a device of similar screen size but that doesn’t support avif, will the second load the same cached avif version?
]]>Hi. I checked your ImageMagick generation code. Many Imagick older versions should work when supporting AVIF generation, now I generated AVIF with ImageMagick 6.9.11-60.
You should check not the version but for Imagick, a simple example that I checked for some old installations:
$imagick = new Imagick();
$formats = $imagick->queryFormats();
if (in_array('AVIF', $formats)) {
echo "AVIF support is available.";
} else {
echo "AVIF support is not available.";
}
Also, your plugin is working with WordPress 6.5.2, PHP 8.0, and PHP 8.1, but breaks Oxygen Page Builder, and maybe other page builders, but I attached functions.php shortcode to disable your plugin on Front-end editors like Oxygen. For example, you can implement that in your version check, to enhance compatible installations, also your syntax is compatible with much older ImageMagick, so when AVIF if supported, so should work.
/**
* storing imageMagick version
*/
if (!defined('AVIFE_IMAGICK_VER')) {
if (class_exists('Imagick')) {
$v = Imagick::getVersion();
$imagick = new Imagick();
$formats = $imagick->queryFormats();
preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', $v['versionString'], $v);
if (version_compare($v[1], '7.0.25') >= 0) {
define('AVIFE_IMAGICK_VER', $v[1]);
} elseif (in_array('AVIF', $formats)) {// check AVIF support on older ImageMagick
define('AVIFE_IMAGICK_VER', $v[1]);
}
else {
define('AVIFE_IMAGICK_VER', 0);
}
} else {
define('AVIFE_IMAGICK_VER', 0);
}
}
]]>
function disable_avif_express_for_oxygen($plugins) {
// Check if any of the specified GET parameters are set
if (isset($_GET['ct_builder']) || isset($_GET['ct_inner']) || isset($_GET['ct_template']) || isset($_GET['oxygen_iframe']) || isset($_GET['action'])) {
// Specify the plugin directory and main file for the plugin you want to disable
$plugin_to_disable = 'avif-express/avif-express.php';
// Search for the specified plugin in the list of active plugins
$key = array_search($plugin_to_disable, $plugins);
// If found, unset it from the active plugins array
if (false !== $key) {
unset($plugins[$key]);
}
}
// Return the modified array of active plugins
return $plugins;
}
// Add the above function to the 'option_active_plugins' filter
add_filter('option_active_plugins', 'disable_avif_express_for_oxygen');
It can generate error 500 or break the Oxygen Page Structure Tab, when we add this shortcode your plugin works perfectly on Oxygen powered Websites.
]]>As caching plugins like WP Rocket and Flying Press, possible others only checking WebP support, and push only WebP (if supported).
So my rewrite now is doing to push generated AVIFs for my client when browser supports that:
# Rewrite AVIFs
<IfModule mod_rewrite.c>
RewriteEngine On
# Check if AVIF is supported by the browser
RewriteCond %{HTTP_ACCEPT} image/avif
# Check if the .avif file exists
RewriteCond %{DOCUMENT_ROOT}/$1.avif -f
# Serve the .avif file content for the .webp request
RewriteRule ^(wp-content/uploads/.+)\.webp$ $1.avif [T=image/avif,E=accept:avif,L]
</IfModule>
# Rewrite AVIFs END
You can safely add that into your plugin, that rewrite is working in main WordPress folder.
]]>I’ve bulk converted the entire media library, as well as enabled conversion on upload, and there are zero avif files in my media directory, and everything remains as a png. How do I fix this? The plugin simply isn’t working.
]]>Hello,
I am using Cloudyway server for my wordpress site.
Installed this plugin and showing i need to update “Php GD with libavif or Imagick” Already updated but still showing this warning.
How can i fix this issue?
]]>Hi, does this work for mobile devices? Some images are missing on Android/iOS (Safari and Chrome)
]]>I have 2 images with the same name – one is png and the other jpg. They are 2 totally different pics. But on the website for obvious reasons I can only see one of them in 2 instances. Reason is obvious but there should be an error message or notification during bulk convert that there were 2 images with different extensions, so they weren’t converted and offer a link to both so user can find and replace where necessary. Without this notification I stumbled upon this issue by accident, now need to visit every page to make sure no more issues like this exists.
]]>Love this plugin, still testing and came across something strange. I noticed that after running a bulk convert on 12k images, after the job was complete everything look alright on my PC but my phone was showing me some missing images. A quick look and I noticed that the called avif files that didn’t load on mobile device, had a different name to the original jpg file. There is no rule to this, files have different length of names, none uses capital letters nor empty spaces in their names. But the result is, I have files that look like this:
project-name-branding.jpg is renamed to project-name-brandin.avif and while it loads on a desktop for some reason it doesn’t on a mobile. I had to manually check every page on a mobile device, then edit each page / post / project / etc and reupload the images with new names, and only then the mobile shows the newly uploaded and ‘on load’ converted avif file that has the same name as jpg file.
]]>Several Questions:
Thank you!
]]>Hi, I can see the avif image version are created, but even after I activate the rendering I can’t see webp nor avif versions served on the frontend. I can see the following in the request header though:
Accept image/avif,image/webp,*/*
I’m running in local server currently.
]]>Hello my website is on Siteground and their support told me that imagick version is 6.9.12-70 and cannot be updated.
Is there a way to make the plugin work with this older imagick version?
]]>Hello,
some cache plugins prevent Avif express to serve avif files, hope that helps.
Running php 8.0 and latest wp (6.2.2).
Works
Doesn’t work (serves jpg)
Hi,
something weird, my uploads images are well converted to avif (checked in directory), but it still the jpegs version which are served.
To be more precise, in my pages where i uploaded a jpg image it’s now an avif => great!
But i use this plugin Flipbox – Awesomes Flip Boxes Image Overlay on some pages and then it’s only jpegs which are displayed.
Ok, so to test i added Converter for Media (free version), and converted all my uploads to webp (by the way your plugin was supposed to make the conversion it did not), then rechecked the page where the flipbox plugin runs and the webp are well served ; i checked htaccess, it seems converter for media didn’t add anything concerning webp.
I’m clueless to where to search,…, your plugin is great, but there is still room for improvement.
Keep going
]]>Hi!
Thank for your work!
I need help with your plugin when I activated I have some errors on product page with variations price like (</div>) this:
</div>
Price
</div>
Preorder....
</div>
I need advice to dissappear this </div>!
Thank you!
]]>Hi there,
I’d like to give AVIF images a try but am wondering if there are any known conflict issues using another plugin to generate Webp images.
Ideally I’d show AVIF to compatible browsers and Webp to any that aren’t compatible with AVIF.
Is this possible and if so is there a Webp plugin I should use for confirmed compatability?
Thank you for your help!
]]>Hi,
Will this plugin make it possible to upload .avif images? and also we don’t want to convert any images just let us upload .avif images
]]>The error is:
Php GD with libavif or Imagick(ver >= 7.0.25) is not installed/enabled. Please contact the server admin!
The server has this PHP extension installed:
lsphp81-imagick/jammy,now 3.7.0-1+jammy amd64 [installed]
]]>Hi, does this plugin work with Nginx servers?
]]>Is it posible to generate the avif file on demand. This option can generate only used images.
Thank you.
]]>Does the plugin save the original files or delete them when converting? Where are the avif files saved?
]]>On startup, I see this error: “Php GD Extension or libavif is not installed/enabled. Please contact the server admin!” I have Ubuntu 22.04 installed on my server. I understand that this system comes with the libavif-dev package. That is, the package is installed, but the plugin doesn’t see it.
]]>Your plugin works with Multisite?
]]>