I have a problem when I use the GD option:[2024-10-20 14:41:22][notice]Converting header-home.jpg to AVIF failed. Error:Converted image is 0 KB and has been deleted. This usually happens because your AVIF library is not working properly. Please check the AVIF library.
When I use the Imagick option, it seems that it converts some AVIF files but it freezes after converting about 20/25 images.
What can I do to resolve this?
]]>Hi,
we are using already a CDN and can’t switch for several reasons. We are using Amazon S3 with Amazon CloudFront. The Plugin: https://deliciousbrains.com/wp-offload-media/ helps us a lot with this.
Is there a way to upload existing and already converted Files into this CDN?
Cheers J
]]>hi
thanks for your great plugin. there are two important issues i like to address.
first when png images converted to avif they got black background!
second it should be an option for users to let them delete original images after being converted to avif/webp
thank you
Hi, thanks for your plugin.
Question #1: Using Chrome Dev Tool, I noticed the AVIF files are loading as expected. But when I run a Performance test using Webpagetest, I noticed the images are loaded twice. Here is a screenshot: https://tinyurl.com/ypyfo2d5
Is this expected behavior?
Question #2: My server runs on Apache. Upon reviewing the htaccess, I did not see any Rewrite rules for CompressX. Is this normal?
Thank you.
Hello there!
I’ve been wrestling with watermark plugins on the WordPress directory for hours, and I finally figured out why nothing works. Turns out, these plugins can’t apply watermarks to images converted to WebP or AVIF formats. People have been asking for this feature for ages (see here ).
The delay in fixing this issue is likely because it’s a technical nightmare for these plugins. They don’t have a complete view of the image upload process and assume images are uploaded traditionally.
But that’s not the point of this post.
What matters here is the golden opportunity to make CompressX the ultimate converter and watermark plugin. Since we handle the entire process from image upload to conversion, we know exactly where the image comes from and where it should go. This means we can apply a watermark seamlessly during the process.
Don’t jump to conclusions just yet!?? I’ve sketched out a little diagram of how this could work. (I’m no coding expert, but I’m sure the CompressX wizards ???♂???can make it even simpler. Let’s just imagine this idea for now.) See the image.
I think I’ve provided enough info to spark some real thought and give CompressX a chance to dominate this overlooked segment of watermarking.
]]>Forgive me if I am just being dumb, but I don’t get how it works. Where are the Webp and AVIF converted files stored? I can see on the front end a converted image. When I right-click it and get the link address it shows a PNG file in the normal location. When I right-click and select save as it shows it as an AVIF file. I am confused.
]]>Hello. I wanted to ask is it possible to get it working with litespeed?
Thank you
]]>Hello!
Thanks for your great CompressX plugin.
I convert my images to webp and avif with no problems.
Except that on my client’s server, the process is very slow and I have sometimes a 504.
A workaround is to disable the auto converting process while a new upload and do the convert after, in the media page.
But it is not very user-friendly.
It could be great to have a cron job running once per day to run the process (only on the images not processed or maybe it could be a config option).
Let me know what do you think about that and if I could help with some informations.
Thanks!
Regards,
Brice
Hello ,
when I enable the plugin I get this error .
.htaccess rewrite rules – we’ve detected that .htaccess write rules are not executed on your Apache server, this can be because the server is not configured correctly for using .htaccess file from custom locations. For more details, please read this doc –?How-to: Config Apache htaccess Rules
AllowOverride All is enabled.
https://ibb.co/PCnmMvQ
I’m using Nginx as my caching proxy, and I’ve followed the Nginx guide closely: https://compressx.io/docs/config-nginx-htaccess-rules/
However, my site is still not serving .webp or .avif images.
In the Media Gallery, I see it compressing and generating the new .webp and .avif images:
https://i.imgur.com/9OENKAF.png
Does this have fallback functionality for incompatible browsers that do not have AVIF or WebP support?
]]>Hi,
I have 2 of my sites where the avif format is not supported, in my browser console, there is only the webp format, is it related to the directives of my .htaccess file?
Here is the link to download my htaccess file (located at the root on my FTP) => https://fromsmash.com/PstHCSjZ~j-ct
The link of a video capture of the problem => https://www.loom.com/share/1a51faf4f2e24f05b23c5b983de85052?sid=14853f42-af18-4a41-9238-f4614e4c2b4c
]]>hi, i have installed the CompressX plugin for a while now, it does compress the images and put them in the “compressx-nextgen/upload” folder, but the website is still showing the old jpg files, i need to make sure that files are webP and AVIF, here is my .htaccess and check environment results
here is the .htaccess inside the wp-content folder
# BEGIN CompressX
# ?????????????? (????) ??? "BEGIN CompressX" ? "END CompressX"
# ?? ??? ???? ????? ???????? ? ??? ???? ?? ?????? ???????? ??????? ?????? ????.
# ?? ?????? ?? ?????????????? ??? ??? ????????? ???????? ?????? ??.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteOptions Inherit
RewriteCond %{QUERY_STRING} original$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
RewriteCond %{HTTP_ACCEPT} image/avif
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.avif -f
RewriteRule (.+)\.avif /wp-content/compressx-nextgen/$1.avif [NC,T=image/avif,L]
RewriteCond %{HTTP_ACCEPT} image/avif
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.jpg.avif -f
RewriteRule (.+)\.jpg$ /wp-content/compressx-nextgen/$1.jpg.avif [NC,T=image/avif,L]
RewriteCond %{HTTP_ACCEPT} image/avif
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.png.avif -f
RewriteRule (.+)\.png$ /wp-content/compressx-nextgen/$1.png.avif [NC,T=image/avif,L]
RewriteCond %{HTTP_ACCEPT} image/avif
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.jpeg.avif -f
RewriteRule (.+)\.jpeg$ /wp-content/compressx-nextgen/$1.jpeg.avif [NC,T=image/avif,L]
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.webp -f
RewriteRule (.+)\.webp /wp-content/compressx-nextgen/$1.webp [NC,T=image/webp,L]
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.jpg.webp -f
RewriteRule (.+)\.jpg$ /wp-content/compressx-nextgen/$1.jpg.webp [NC,T=image/webp,L]
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.png.webp -f
RewriteRule (.+)\.png$ /wp-content/compressx-nextgen/$1.png.webp [NC,T=image/webp,L]
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.jpeg.webp -f
RewriteRule (.+)\.jpeg$ /wp-content/compressx-nextgen/$1.jpeg.webp [NC,T=image/webp,L]
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "(?i)\.(jpg|png|webp|jpeg)(\.(webp|avif))?$">
Header always set Cache-Control "private"
Header append Vary "Accept"
</FilesMatch>
</IfModule>
# END CompressX
above was the .htaccess that plugin makes inside wp-contents folder, and below is my .htaccess in the root that is public_html folder
BEGIN LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block!
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule .litespeed_conf.dat - [F,L] marker ASYNC start
RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax.php
RewriteCond %{QUERY_STRING} action=async_litespeed
RewriteRule .* - [E=noabort:1] marker ASYNC end marker MOBILE start
RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile] marker MOBILE end marker CACHE RESOURCE start
RewriteRule wp-content/./[^/](responsive|css|js|dynamic|loader|fonts).php - [E=cache-control:max-age=3600] marker CACHE RESOURCE end marker WEBP start
RewriteCond %{HTTP_ACCEPT} "image/webp"
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
RewriteCond %{HTTP_USER_AGENT} iPhone.Version/(\d{2}).Safari
RewriteCond %1 >13
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp] marker WEBP end marker DROPQS start
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga marker DROPQS end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END LSCACHE BEGIN NON_LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! marker BROWSER CACHE start
ExpiresActive on
ExpiresByType application/pdf A31557600
ExpiresByType image/x-icon A31557600
ExpiresByType image/vnd.microsoft.icon A31557600
ExpiresByType image/svg+xml A31557600
ExpiresByType image/jpg A31557600
ExpiresByType image/jpeg A31557600
ExpiresByType image/png A31557600
ExpiresByType image/gif A31557600
ExpiresByType image/webp A31557600
ExpiresByType video/ogg A31557600
ExpiresByType audio/ogg A31557600
ExpiresByType video/mp4 A31557600
ExpiresByType video/webm A31557600
ExpiresByType text/css A31557600
ExpiresByType text/javascript A31557600
ExpiresByType application/javascript A31557600
ExpiresByType application/x-javascript A31557600
ExpiresByType application/x-font-ttf A31557600
ExpiresByType application/x-font-woff A31557600
ExpiresByType application/font-woff A31557600
ExpiresByType application/font-woff2 A31557600
ExpiresByType application/vnd.ms-fontobject A31557600
ExpiresByType font/ttf A31557600
ExpiresByType font/otf A31557600
ExpiresByType font/woff A31557600
ExpiresByType font/woff2 A31557600 marker BROWSER CACHE end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END NON_LSCACHE BEGIN CompressX
RewriteEngine On Redirect requests for PNG, JPEG, and JPG images to the compressx-nextgen directory if they exist
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/uploads/$1 [F]
RewriteRule ^wp-content/uploads/(.*).(jpg|jpeg|png)$ /wp-content/compressx-nextgen/uploads/$1.$2 [NC,L] Specific conditions for WebP and AVIF formats
RewriteCond %{HTTP_ACCEPT} image/avif
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/uploads/$1.avif -f
RewriteRule ^wp-content/uploads/(.*).(jpg|jpeg|png)$ /wp-content/compressx-nextgen/uploads/$1.avif [NC,T=image/avif,L]
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/uploads/$1.webp -f
RewriteRule ^wp-content/uploads/(.*).(jpg|jpeg|png)$ /wp-content/compressx-nextgen/uploads/$1.webp [NC,T=image/webp,L] END CompressX BEGIN WordPress ?????????????? (????) ??? "BEGIN WordPress" ? "END WordPress" ?? ??? ???? ????? ???????? ? ??? ???? ?? ?????? ???????? ??????? ?????? ????. ?? ?????? ?? ?????????????? ??? ??? ????????? ???????? ?????? ??.
RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] END WordPress php -- BEGIN cPanel-generated handler, do not edit Set the “ea-php81” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php81 .php .php8 .phtml php -- END cPanel-generated handler, do not edit Disable PageSpeed
ModPagespeed off
please someone help me, it’s getting frustrating and so on nerves, here is my website address:
if you need some example take a look at this product for example, the image of it is still jpg but it should be webp or avif:
]]>I am doing my best to promote this fabulous plugin by contributing to translation. However, even the translated strings are not reflected in the plugin pages. Please keep working on it. Thanks!
]]>Is there any WP CLI command for bulk processing? For processing 743 images, it seems to take almost forever. I set GD / AVIF/ Lossless for 3 additional image sizes in addition to original image. The max size is only 800×800. Thought i gets done within a few hours, but I am still at 121 after 8 hours.
]]>amazing plugin however it doesn’t seem to work as there not showing in the formats it says all are compressed but nothing is showing all are showing in jpg and png
]]>I’ve compressed all images in webp and avif put its not serving them in any browser would you know why this is happening? thank you
]]>Hello,
Best,
Alex
It seems that CompressX keeps track of the file conversion which does not recognize any manual changes (addition, deletion, etc.) inside compressx-nextgen folder. For those who already have converted images and wish to use them for this plugin, it would be a good option for the plugin to manually scan the existing .webp and .avif files in relevant folders and update its database based on the scan results (by matching filenames, perhaps?). This avoids force re-processing all images (which takes days for thousands of original images and their thumbnails) and overloading server resources. Coming from other similar plugin such as Converter for Media, it was a redundant and time-consuming process having to convert all images for this specific plugin.
]]>If the plugin is deactivated, image has cf-cache-status: HIT
If the plugin is activated, image has cf-cache-status: BYPASS
Why?
]]>I deleted all images using the built-in option and executed a fresh bulk processing. However, after calculating the total number of images to process, the process stops with the message, “No unoptimized images found.” Please help me successfully bul-convert images.
]]>hello,
after several tests I realize that Enable auto-resizing large images does not work as expected,
after investigation
I finally understood that it must mean by (large images) images larger than (2048×2048)
as you can see in this image
but what I tried to do and probably anyone by enters their own values, in our example (1200×1200)
is to see any image exceeding the value (Maximum Width x Maximum Height) go through the resize or force resize.
only the 2880×2160 image has been resized.
and the other two 1600×960 are not affected (normally and logically I should normally see 1200×720 twice)
so maybe integrate this function (force respect my Maximum Width x Maximum Height) or another similar name,
but you understood the goal and the idea
what do you think?
the idea is to make compressx able to handle this, and avoid installing another plugin to do this task
Edit :
just in case if someone wonder why to do this
it is in the case where we really need to control which images wordpress generates or not and control the space / server resources.
for my case I use this snippet
// disable generated image sizes
function cx_disable_image_sizes( $sizes ) {
unset( $sizes['thumbnail'] ); // disable thumbnail size
unset( $sizes['medium'] ); // disable medium size
unset( $sizes['large'] ); // disable large size
unset( $sizes['medium_large'] ); // disable medium-large size
unset( $sizes['1536x1536'] ); // disable 2x medium-large size
unset( $sizes['2048x2048'] ); // disable 2x large size
return $sizes;
}
add_action('intermediate_image_sizes_advanced', 'cx_disable_image_sizes');
to tell wordpress to stop generating unwanted images, I only need images converted and resized by compressx.
if you also see it useful to integrate this snippet directly into the options to directly deactivate the generation of images, it would be a plus, otherwise we always have our code snippets to use just in case.
]]>hello,
i find this plugin incredible i discover the AVIF format i converted all my images everything works as expected the gain is not negligible!
my only concern is the huge space that the original images occupy and i need to delete them (i know perfectly what i do with my site) i need this delete original images function.
for the moment i find this possibility in other plugins but not here and it is regrettable that this scenario is not taken into account
can you take this scenario into consideration?
a kind of [Advanced mode] and clearly notify that it is irreversible and all the warnings or type the word ‘I agree’
(for the novice public who clicks everywhere)
and just allow us to free up the space that the original images occupy
]]>Could you offer CLI commands to execute conversion in ssh/PuTTY, instead of having to keep open the pluging page during conversion?
]]>Hey, have you tested on multisite, yet?
For some reason the styled UI isn’t loading on the settings page. I can see all the settings, but just in plain WordPress interface elements, and none of the save buttons work.
I have installed on a single site, too, and can see the UI load there, so wondered if it might be an issue with multisite?
]]>I tried on OpenLiteSpeed, the latest WordPress, PHP 8.1, Latest chrome. The conversion worked well, but the file is saved in /wp-content/compressx-nextgen/uploads/2024/07/shiping-1.webp.avif. However, the rewrite does not work automatically.
]]>I tested the plugin with a newly uploaded JPG.Enable it to compress & convert the new uploaded images
is enabled.
At first, the image is served as AVIF type as expected.
If I disable and re-enable the plugin, the image is served as JPG type.
Let me know if you need more details.
]]>When clicking the Optimize
button beside an image in the Media library, both .webp
and .avif
files are created regardless of the checkboxes selected in the Output Formats section in Settings. Bulk optimization works as expected.
Thank you for the great plugin.
I noticed that the first set of image/avif
rules in the generated .htaccess
files uses .webp
instead of .avif
in the RewriteRule
line (line 15).
Also, there seems to be a mistake in how the second path RewriteCond
is being generated. It outputs the same path as the first one, but without slashes, like so:
RewriteCond %{DOCUMENT_ROOT}/wp-content/compressx-nextgen/$1.avif -f [OR]
RewriteCond %{DOCUMENT_ROOT}/wp-contentcompressx-nextgen/$1.avif -f
I think you should check the class-compressx-webp-rewrite.php
code.
Hello It’s me again (sorry ^^’),
I started the bulk processing this morning on my blog (3500+ images), and it stopped after ~2h I think (I think the message was timeout but I’m not sure).
Well ok, that happen when you have a long script. But after I refreshed the page, and reclicked the “Start Bulk Processing”, it says “Scanning images : 3097 found” for a second (that’s the right number I think), and then “No unoptimized images found”.
I’ve not digged into your codebase, but it may be something like the images where tagged as optimized when I started the first Bulk Processing, before they were treated, and the timeout happened.
I let you look into this ??
Also, I may have some improvements advices for you (no request, just things you could add), where do you want me to post them ? by email ? on this forum ?
Thank you again for your support, I’ve been there when I first shipped my plugin ^^’