I’ll reply myself. The “Disable async processing” option did that job. Turned it on and images are now uploaded when added to the library.
By the way I’ve got some other issue. It seems that images which are in my pages linked this way:
<a class="arishow" href="https://www.xxx.com/wp-content/uploads/2022/09/xxx.png"><img class="aligncenter wp-image-20168 size-medium" src="https://www.xxx.com/wp-content/uploads/2022/09/xxx-300x209.png" width="300" height="208" /></a>
doesn’t load from the imagedeliver.net domain but locally. I mean the image in the <a href> tag which opens in a gallery view (arishow).
How can I make them open from cdn?
@rocketraf,
Currently, only the actual images are supported for offload. Links will not get replaced. I can add a filter to adjust the regex that searches for images, however, I would not recommend this approach, because links will require an additional query (at least one) to the database to map the link to the actual attachment ID. This often negates any performance benefits you might get from serving the image via CDN.
Best regards,
Anton
Anton are you able to comment on whether or not this is the method that WP Media Offload uses? Thank you
@justinfreid,
Offloading to S3 is different, because the paths in the links stay the same… For example, let’s say we use WP Media Offload, then the image https://www.xxx.com/wp-content/uploads/2022/09/xxx.png becomes something like https://s3.amazonaws.com/my-images-bucket/2022/09/xxx.png
This makes it easy to just look for all images on the page and replace https://www.xxx.com/wp-content/uploads/ with https://s3.amazonaws.com/my-images-bucket/ and problem solved.
With Cloudflare Images the URL is different, it requires an image hash + the width (at the very minimum). https://imagedelivery.net/image-hash/2022/09/xxx.png/w=500 So it’s not possible to just replace the images, the plugin needs to find that image in the media library, get the image hash, get the required width and then create a URL.
And it’s not worth to replace the links inside the <a> tags, because those do not get downloaded during the page load, hence there’s no benefit for performance.
Best regards,
Anton