rosell-dk / webp-express

Wordpress plugin for serving autogenerated WebP images instead of jpeg/png to browsers that supports WebP
GNU General Public License v3.0
225 stars 64 forks source link

Add warning icon next to converters that triggers warnings - and prevent the warnings from bubbeling up #537

Closed rosell-dk closed 2 years ago

rosell-dk commented 2 years ago

Warnings are shown on admin screen. Such warning should not go to the screen, should they?

The particular warnings were reported here: https://wordpress.org/support/topic/warnings-in-the-dashboard/#post-15058436

Examples:

Warning: exec(): Unable to fork [nice /data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Binaries/cwebp-061-linux-x86-64 -metadata none -q 61 -alpha_q '85' -near_lossless 60 -sharp_yuv -m 6 -low_memory '/data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/plugins/webp-express/test/small-q61.jpg' -o '/data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/uploads/webp-express-test-conversion.webp.lossless.webp' 2>&1] in /data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/Cwebp.php on line 250

Warning: exec(): Unable to fork [nice ffmpeg -i '/data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/plugins/webp-express/test/small-q61.jpg' -y -qscale '61' -lossless 0 -compression_level 4 '/data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/uploads/webp-express-test-conversion.webp.lossy.webp' 2>&1] in /data/4/2/42d8abce-6eee-4499-bda1-d635a4d88b5b/northkiteboarding.cz/web/wp-content/plugins/webp-express/vendor/rosell-dk/webp-convert/src/Convert/Converters/FFMpeg.php on line 152
rosell-dk commented 2 years ago

These warnings are triggered in the test run, which is used for indicating which converters that works.

It is generally desirable not to suppress warnings. In this case, however, it is better to suppress and indicate next to the converter that it triggered warnings (and should be disabled)

rosell-dk commented 2 years ago

Here are more info on the actual warning: https://www.sitepoint.com/community/t/unable-to-fork-on-a-unix-environment/1617/7

rosell-dk commented 2 years ago

I have implemented warning icon next to converters that triggers warnings. Not closing, as I should test the code a bit more...