AI Verified
Convert To WebP
<p>Snippet to convert JPG / PNG / Gif to WebP automatically on upload. Used GD or ImageMagick</p>
PHP
Voted: 19 by 23 user(s)
Scroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: Not Specified
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
Free & Pro
Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.
Pro Only (Coming Soon)
You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.
Last modified:
04/07/2024
This snippet has the following status:
AI Verified
This snippet has been tested by our AI bot, see any comments below.
AI Bot Comments:
Potential vulnerability found : Arbitrary File Deletion
Found on line : 20
Code : unlink( $file_path )
Vulnerable line : 29
Code : $file_path = $upload['file']);
Potential vulnerability found : Arbitrary File Deletion
Found on line : 51
Code : unlink($file_path)
Vulnerable line : 29
Code : $file_path = $upload['file']);
Found 2 vulnerabilities
19
7 months ago
Is it possible to add the IPTC fields of the original file (jpg) to the converted file in the database, or to get the wp_post ID of the new file?
7 months ago
wp_get_attachment_metadata not working.
3 months ago
It doesn't work for me anymore, it used to work
2 months ago
It not manage name duplication but override the file
2 months ago
Fixed the wrong overwriting error editing line 40 ($new_file_path = $dirname . '/' . $filename . '.webp';) with these two lines: $def_filename = wp_unique_filename($dirname, $filename . '.webp' ); $new_file_path = $dirname . '/' . $def_filename;
1 month ago
@Rightnow I have updated the original code with your change. Thanks :)
2 days ago
Great work Mark, much appreciated!
Please see some snippets below related to this snippet..
General
AI Verified
Added: 10 months ago
Last Updated: 10 months ago
<p>Adds the excerpt input box to pages, just like posts.</p>
General
AI Verified
General
AI Verified
These are some popular snippets from this users codevault..
General
AI Verified
Added: 8 months ago
Last Updated: 3 weeks ago
<p>Snippet to convert JPG / PNG / Gif to WebP automatically on upload. Used GD or ImageMagick</p>
WordPress Admin
AI Verified
Added: 8 months ago
Last Updated: 5 months ago
A snippet to duplicate posts and pages and CPTS.
General
AI Verified
Category
Snippet Status