• Resolved pxydigital

    (@pxydigital)


    I am having trouble bulk offloading, and offloading images individually as well.

    When I use the bulk offload feature, it will offload the first few (maybe 4-8), and then go back to saying “Processing first images” and that would be the end of it.

    If I go to the Media Library and try to individually offload images, it sometimes works, but mostly gives an error saying “processing error” — I have to try the same image a couple of times for the offload to work.

    Can’t find anything in the error log either.

    Maybe a CLI command to bulk sync would resolve this issue?

    I do however want to highlight that everything works perfectly for newly uploaded images. I just can’t get it to offload the images I uploaded before I set up this plugin.

    One more thing: for the images that I was able to offload after a couple of tries, the URLs never changed. It only changed if I went into the block editor, and reselected the image.

    Could be bad hosting as well.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @pxydigital,

    Could you please try to trigger this error with the browser console open and see if there are any errors in the console. And if not, check the “Network” tab you should see a new XHR request after clicking on the “Offload” link, if you click on that request name it should give you some details. Please check if there are any errors in the response.

    Best regards,
    Anton

    Thread Starter pxydigital

    (@pxydigital)

    This is what I see in the failed admin-ajax request:
    https://snipboard.io/YonZsF.jpg

    After multiple tries, the offloading was completed without an error, but it didn’t really do the job. First, the total number of images shown was wrong. It was showing 45 when I had 70 odd.

    Also, for the offloaded images, the image replacement on the front end will only work for images that I actually attached to the pages. For example, my current site was migrated from a local environment to the server, so all the images were migrated manually. The image replacement didn’t work for those (and yes, I had Parse page for images enabled as well). Maybe because WordPress database things the images that were manually migrated aren’t attached to these pages?

    Another issue I came across was the Bulk Remove — it will tell me that everything was removed from Cloudflare, but in reality, that is not the case. There’s always a couple of images left in Cloudflare.

    Either way, none of these are big issues. It could be an error with my hosting provider as well, or how I migrated this site. I am not manually reuploading all the images to each of my pages, to offload them to Cloudflare — which works great.

    Amazing plugin though, great job. Thank you for making this open source! Kudos. And thank you for replying to me..

    Plugin Author Anton Vanyukov

    (@vanyukov)

    @pxydigital,

    I have added a beta version which should fix the bulk offload issue. If you want to try it out, you can grab the zip from here: https://github.com/av3nger/cf-images/releases/tag/1.6.0-beta.1

    Just install it over the current plugin and you should be good to go.

    Best regards,
    Anton

    Thread Starter pxydigital

    (@pxydigital)

    Thanks for that, Anton! To help you along, I did some testing, and this is what I found.

    Issue #1:

    The bulk offloading mostly works, and this is why I say “mostly” works:

    1. I found at least one instance of the bulk loading going back to the first image and then doing nothing. Here’s a screenshot:
    https://snipboard.io/79jsuq.jpg

    2. Even when it does succeed, in most cases, it will skip over a portion of the images. I will then have to go back and offload them individually. I’m not sure why, but it does skip images.

    Issue #2
    When offloading individual images, there’s a processing error that comes through. It is not an issue with the image because after I try a couple of times, it works.

    Issue 3#
    As I mentioned earlier, it doesn’t replace the image URL on the front end unless WordPress knows it is “attached” to a page. I am using the Kandence (free) theme, which uses the Block Editor, so everything should be pretty standard.

    Issue #4

    If the image is attached as a background image through CSS, the URL doesn’t get changed, and WordPress serves the original image to the user. Here’s an example:
    https://snipboard.io/JCTQHa.jpg

    Yes, I do have Parse page for images enabled.

    Issue #5

    Image Compressor don’t work if I enable compression after uploading the images, and offloading them to Cloudflare. I did a bulk compress, and the Compression savings say:
    “NaN undefined”

    Each image says 0 bytes saved, even when I try compress them individually. I have no way to try again because the plugin things the images are compressed. Working great for newly upload images though.

    Issue #6

    Generate alt text doesn’t work. I get a reply back saying “The provided image url can not be accessed. status code: 403.” Same for new and old images.

    Issue #6

    Bulk offload doesn’t actually remove all images from Cloudflare Images

    Issue #7

    When I delete an image from the Media Library, I think it should delete it from Cloudflare Images too, but it doesn’t.

    Nothing useful was logged in the error log.

    Sorry for all this. Just sharing what I found. Thank you so much for maintaining a great plugin. I am not an engineer, otherwise, I would have investigated and submitted a PR.

    Thread Starter pxydigital

    (@pxydigital)

    Issue #6 – Update

    Alt Text works if I disable custom domain

    Plugin Author Anton Vanyukov

    (@vanyukov)

    @pxydigital,

    Issues #1 and #2, hopefully, are fixed in the new beta. At least, the bulk process should no longer halt or get stuck on failed images.

    Regarding #3 – I would recommend enabling logging, view the page and check the logs. What’s the error for the images that are not replaced?

    #4 – At the moment, this is not supported. In the future I might add support with Cloudflare workers.

    #5 – If an image fails to compress, it will be skipped. This can be overwritten by removing the image _cf_images_skip_compress meta value.

    #6 – The image must be publicly accessible for the caption generation to work. If you’re saying that this works without a custom domain. And, considering, that you have issue #3. I’m thinking, maybe, your mapped domain is not connected to Cloudflare or does not have a proper CNAME record?

    #7 – Are you getting any error in the logs?

    This is the latest beta:
    https://github.com/av3nger/cf-images/releases/tag/1.6.0-beta.2

    Thread Starter pxydigital

    (@pxydigital)

    Thanks! I’ll test out the new beta and let you know, I appreciate it!

    Thread Starter pxydigital

    (@pxydigital)

    Hey Anton, there is a critical error that gets triggered when trying to uninstall the new beta.

    Confirming that this is the case on my local as well.

    [11-Nov-2023 07:15:39 UTC] PHP Fatal error: Trait "CF_Images\App\Traits\Helpers" not found in /public_html/wp-content/plugins/cf-images-2/app/class-settings.php on line 26
    [11-Nov-2023 07:15:48 UTC] PHP Fatal error: Trait "CF_Images\App\Traits\Helpers" not found in /public_html/wp-content/plugins/cf-images-2/app/class-settings.php on line 26

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Hi @pxydigital,

    Sorry for that, I have re-uploaded the beta with the fix.

    Thread Starter pxydigital

    (@pxydigital)

    Hey Anton,

    Thank you so much for fixing things so quickly. I took a look at the new beta, and the bulk offloading is mostly working just fine. The error log is also working correctly (because it didn’t properly log things for me before), so I was able to drill down on things a little bit.

    Seeing this on the plugin error log:

    [2023-11-12T05:55:28+00:00] Cannot run get_attachment_image_src(), returning original. Attachment ID: 2586. Image: Array ( [0] => https://website.com/wp-content/uploads/2023/11/image-name-2023-11-08-at-06.33.59-768×516.png [1] =>

    768 [2] => 516 [3] => 1 ) [2023-11-12T05:55:28+00:00] Found attachment ID 2586 from image class name.

    When loading pages on the front, errors like the above are recorded. Look at the attachment ID in both of the above errors; it is the same. It looks like the plugin is first unable to find the image, but then immediately afterward, it finds the image.

    All the images are loading correctly on the front end, though.

    This is why some images fail to offload when offloading in bulk and individually:
    [2023-11-12T05:19:27+00:00] Operation timed out after 5000 milliseconds with 0 bytes received

    This could be due to a limitation with my hosting, but I swear I have maxed out all of my PHP settings, and my max execution time is much higher. Having a CLI command could potentially avoid this, I think. Any recommendations to avoid this are welcome, as the timeout is happening a lot. My website is a photography website (pretty much a hobby site) that is still in development by me, and I have plans to upload and offload 100s and 100s of images — if I could manually upload them to the server and then offload using the CLI command, that would be perfect.

    Bulk deleting images through the plugin or through the gallery doesn’t delete most of the images from Cloudflare. Nothing is recorded on the error log. I saw the below error in the log, which could be related:
    [2023-11-12T05:25:17+00:00] Missing Cloudflare Image ID or hash. Attachment ID: 2829. Image: Array ( [0] => https



    That is all! Sorry if I am bombarding you with stupid non-issues.

    Plugin Author Anton Vanyukov

    (@vanyukov)

    The logs will log everything, including exclusions – don’t look at it as an issue. As long as the front-end is working, disable logging and you should be good to go.

    I’ve bumped the timeout to 10 seconds in the upcoming version. That should fix your issues.

    The bulk delete issue is probably the result of timeouts. If you’re worried about extra images, you can bulk delete everything from the plugin, and just manually delete everything else in Cloudflare and bulk offload again.

    Best regards,
    Anton

    Thread Starter pxydigital

    (@pxydigital)

    Got it, thanks! Looking forward to the new version.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.