Where do I download it from? I can't find it in my account.Hmmmm… do you have anything else that might be mucking with images? Like a different plugin?
Also, did you upload the new Pro version? Needs that too.
wp-content/plugins/app-for-cf-pro/DigitalPoint/Cloudflare/BasePubAdvanced.php
file, make sure it has this line in it:add_filter('wp_handle_upload_prefilter', [$this, 'filterWpUploadPrefilter']);
<?php
echo
'PHP version: ' . PHP_VERSION . "\r\n<br />" .
'PHP OS: ' . PHP_OS . "\r\n<br />" .
'Imagick class exists: ' . class_exists('Imagick') . "\r\n<br />" .
'Imagick supports WebP: ' . (\Imagick::queryformats('WEBP') ? 1 : 0) . "\r\n<br />" .
'GD w/ WebP support: ' . function_exists('imagewebp') . "\r\n<br />" .
'exif_imagetype() function exists: ' . function_exists('exif_imagetype') . "\r\n<br />" .
'image.png format: ' . exif_imagetype('image.png') . "\r\n<br />";
test.php
and also upload any PNG image to the same place with the file name image.png
. Then access it in your browser by going to http://yourdomain.com/test.php, and then copy/paste the results here.PHP version: 8.2.15
PHP OS: Linux
Imagick class exists: 1
Imagick supports WebP: 1
GD w/ WebP support: 1
exif_imagetype() function exists: 1
image.png format: 3
Okay... that looks as expected. If you edit yourResults:
Since I've removed and reinstalled it, I will upload some other images and see what happens. I don't know why I didn't already.
wp-content/plugins/app-for-cf-pro/src/DigitalPoint/Cloudflare/Base/PubAdvanced.php
file and change this: public function filterWpUploadPrefilter($file)
{
$webpCompression = $this->option('cfWebpCompression');
if (!$webpCompression || !file_exists($file['tmp_name']))
{
return $file;
}
$fileType = exif_imagetype($file['tmp_name']);
if ($fileType != IMAGETYPE_JPEG && $fileType != IMAGETYPE_PNG)
{
return $file;
}
public function filterWpUploadPrefilter($file)
{
$webpCompression = $this->option('cfWebpCompression');
header('Debug: file|' . json_encode($file), false);
header('Debug: webPCompression|' . $webpCompression, false);
if (!$webpCompression || !file_exists($file['tmp_name']))
{
header('Debug: noFile', false);
return $file;
}
$fileType = exif_imagetype($file['tmp_name']);
if ($fileType != IMAGETYPE_JPEG && $fileType != IMAGETYPE_PNG)
{
header('Debug: wrongType|' . $fileType, false);
return $file;
}
async-upload.php
get called. On that line, look at the Headers tab and the Response Headers should have multiple Debug headers. For example when it worked as expected when I tried, I ended up with 2 Debug headers like so:Debug: file|{"name":"SatyrsArriving.jpeg","type":"image\/jpeg","tmp_name":"\/tmp\/php4q8l9c","error":0,"size":104258}
Debug: webPCompression|70