• The bulk remove isn’t removing my images from cloudflare.

    Here’s what I did:

    • Bulk offloaded images successfully into cloudflare
    • Needed to restart and instead keep the media structure with the offloaded image urls. So I followed the instructions to try to bulk remove.
    • When I tried to bulk remove, a couple of images removed correctly, but it stopped removing them.
    • Turned on the logs- looked like it had to do something with how it’s trying to pull the IDs from cloudflare. Maybe the IDs were stored incorrectly.
    • I don’t remember if the images were being removed if I went to the media library and hit the remove from cloudflare button, but it at least updated the image to say that it was removed from cloudflare.
    • I went through and manually dumped all of the images on cloudflare’s side.
    • Had to deactivate this plugin, since now the image urls are pointing to non existing images in cloudflare.

    I think that my next steps are to:

    • Create a script that will go through the other 1000+ media to remove the “offloaded” boolean (I’m guessing that this is how this is being displayed)
    • Forget about the script and run through each image manually to turn off the “offloaded” boolean

    Wondering if there’s an easy way to do this without having to build out the script myself. Is there an offloading “dump” that just resets each media’s “offloaded” property?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter benzend

    (@benzend)

    Here’s some extra logs when running bulk remove, might help:

    [2024-05-31T16:44:01+00:00] Missing Cloudflare Image ID or hash. Attachment ID: 253. Image: Array
    (
    [0] => https://foo.bar/wp-content/uploads/2021/05/foo_icon_clear.png
    )

    [2024-05-31T16:44:01+00:00] Missing Cloudflare Image ID or hash. Attachment ID: 253. Image: Array
    (
    [0] => https://foo.bar/wp-content/uploads/2021/05/foo_icon_clear.png
    [1] => 224
    [2] => 225
    [3] =>
    )

    [2024-05-31T16:44:01+00:00] Missing Cloudflare Image ID or hash. Attachment ID: 253. Image: Array
    (
    [0] => https://foo.bar/wp-content/uploads/2021/05/foo_icon_clear.png
    )

    [2024-05-31T16:44:01+00:00] Missing Cloudflare Image ID or hash. Attachment ID: 253. Image: Array
    (
    [0] => https://foo.bar/wp-content/uploads/2021/05/foo_icon_clear.png
    [1] => 224
    [2] => 225
    [3] =>
    )
    Thread Starter benzend

    (@benzend)

    Also, here’s something that might help someone else out if they’re experiencing this:

    • Go to your media library
    • At the top of the page where it says “screen options”, set your load limit to something like 100 (I’m doing 500 at the moment)
    • Make sure your plugin is activated, or you won’t see your offloaded status, making the following steps useless
    • Open your inspector’s console and run this script:
    let items = document.querySelectorAll('.cf-images-undo');
    let timeBetweenClick = 1000;
    function clickSlowly(arr) {
    for (let i = 0; i < arr.length; i++) {
    setTimeout(() => {
    arr[i].click();
    }, timeBetweenClick * i)
    }
    }
    clickSlowly(items);

    This should run through each image and attempt to set offloaded to false, or rather, remove the image from CF in case the bulk removing doesn’t work

    • This reply was modified 5 months, 1 week ago by benzend.
    Plugin Author Anton Vanyukov

    (@vanyukov)

    It looks like bulk remove got stuck on image 253. When this happens, the easiest would be to try and fix that image via the media library, because processing individual images will actual print the error message for that image.

    Best regards,
    Anton

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