WebP Images Generator Plugin- I Have updated this plugin for you guys

Baychaser

Member
XNullUser
Joined
Jul 13, 2025
Messages
93
Reaction score
80
Points
18
Location
Fort Wayne, IN
Website
bffsquare.com
NullCash
641
I have updated this plugin and added
1. Plugin now support option to remove original (jpg/png/gif) image once webp image has been generated.

1. New "Remove Original" Setting
2. Auto-Cleanup Logic
3. Smart URL Filtering
4. Broken Image Prevention

Make sure all 4 are checked also ignore the bottom Warning i have fixed that as well but forgot to remove it.

Plugins-Fort-Wayne-Classifieds-Buy-Sell-Locally-for-Free-bffsquare-Osclass-03-11-2026_07_05_PM.png
 

Attachments

  • webp_images.zip
    47.4 KB · Views: 2

stoic

Member
XNullUser
Joined
Nov 22, 2025
Messages
76
Reaction score
22
Points
8
Location
Caribbean
NullCash
50
Buddy!

Excellent Timing - I was looking for another version of this plugin to test (not sure which one was modified by you)

...version 1.0.1 for example preferred "GD Library" over "ImageMagick"* (thus a grayed out toggle switch)

* the php extension is enabled but it appears I missed something if the plugin error message is correct about my hosting lacking a library/support..

Anyways, I exceeded my react/download quota so have to wait until tomorrow to install and test.

Have you come across any version that allows user to toggle that switch ("Use ImageMagick instead of GD library") and in the scheme of things doesn't significantly affect the outcome (it still generates webp images of slightly larger file sizes)?
 

Baychaser

Member
XNullUser
Joined
Jul 13, 2025
Messages
93
Reaction score
80
Points
18
Location
Fort Wayne, IN
Website
bffsquare.com
NullCash
641
Buddy!

Excellent Timing - I was looking for another version of this plugin to test (not sure which one was modified by you)

...version 1.0.1 for example preferred "GD Library" over "ImageMagick"* (thus a grayed out toggle switch)

* the php extension is enabled but it appears I missed something if the plugin error message is correct about my hosting lacking a library/support..

Anyways, I exceeded my react/download quota so have to wait until tomorrow to install and test.

Have you come across any version that allows user to toggle that switch ("Use ImageMagick instead of GD library") and in the scheme of things doesn't significantly affect the outcome (it still generates webp images of slightly larger file sizes)?
Yes its not selectable but it can be changed. I had v1.0.1 to work with. But let me see if I can do something about toggle switch and im sure it can be done.
 

Baychaser

Member
XNullUser
Joined
Jul 13, 2025
Messages
93
Reaction score
80
Points
18
Location
Fort Wayne, IN
Website
bffsquare.com
NullCash
641
Aikis has brought something to my attention and I will have this fixed or you can do this as well.

To prevent the site from crashing whenever a corrupted image is encountered, you need to add a validation check to the plugin's code.

Thank you Aikis this was a good find.

Open the following file: /oc-content/plugins/webp_images/functions.php

Locate line 107 (where imagecreatefromjpeg is called) and add a check before line 112.
Post automatically merged:

Summary of Final Changes
Here is the list of exactly what was modified in your code for your text file:
  • Line 107-109 (GD Library): Added the @ symbol to imagecreatefromjpeg, imagecreatefrompng, and imagecreatefromgif to silence "corrupted header" warnings.
  • Line 112 (Validation): Replaced if(isset($im)) with if(isset($im) && $im !== false). This is the primary fix that prevents crashes by ensuring the script never processes a "false" resource.
  • Line 116-119 (Fallback Log): Added an else block to trigger when an image is invalid. It uses error_log() to record the failure and sets $success = false to prevent the original file from being deleted.
  • Line 128 (Imagick Fallback): Added an error_log() inside the catch block so you can also track failures when using the ImageMagick library.
Aikis thank you again and everyone download this version
 

Attachments

  • webp_images.zip
    47.6 KB · Views: 1
Last edited:
Top