AI Verified
Convert To WebP
Snippet to convert JPG / PNG / Gif to WebP automatically on upload. Used GD or ImageMagick
PHP
Voted: 15 by 17 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:
30/03/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 : 20
Code : unlink( $file_path )
Vulnerable line : 29
Code : $file_path = $upload['file']);
Found 2 vulnerabilities
15
5 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?
5 months ago
wp_get_attachment_metadata not working.
1 month ago
It doesn't work for me anymore, it used to work
1 week ago
It not manage name duplication but override the file
1 week 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;
Please see some snippets below related to this snippet..
General
Unverified
Added: 7 months ago
Last Updated: 7 months ago
<p>Prevents unhelpful zooming on forms for mobile devices</p>
General
AI Verified
Added: 5 months ago
Last Updated: 5 months ago
Snippet used to connect to code snippet cloud and enable/disable access to the cloud..
General
AI Verified
Added: 6 months ago
Last Updated: 6 months ago
Allows debugging which plugin/theme/code is causing Content Control rules to be registered too early.
These are some popular snippets from this users codevault..
General
AI Verified
Added: 5 months ago
Last Updated: 1 month ago
Snippet to convert JPG / PNG / Gif to WebP automatically on upload. Used GD or ImageMagick
WordPress Admin
AI Verified
Added: 5 months ago
Last Updated: 2 months ago
A snippet to duplicate posts and pages and CPTS.
General
AI Verified
Added: 2 months ago
Last Updated: 2 months ago
Allows you to uses Google Maps API to autosuggest an address in an Elementor Form.
Category
Snippet Status