• WordPress 3.0.5, CDN Sync Tool 1.8, AWS S3/Cloudfront

    After trying and failing miserably with W3TC’s CDN sync functionality, I installed CDN Sync Tool and began a sync operation.

    It caught thousands of files that W3TC missed but there were still a lot of missing images once the operation was done (I re-ran it twice to make sure).

    I ended up using the Manual Dir Sync feature (Thanks for providing that) and manually specifying the wp-content/uploads dir, which ran for many more hours and uploaded thousands of more images.

    After that finished the site was no longer showing broken image links everywhere. Upon closer investigation it looks like CDN Sync Tool (and W3TC) were missing all the resized versions of original images that WordPress creates when you add a big image to a post.

    Things like:
    car-150×150.jpg
    car-480×600.jpg

    … the resized versions of the original, say car.jpg.

    I need a tool that *literally* mirrors a directory and it’s contents and doesn’t look at the WordPress Media Library for knowledge of the files. My site is 5 years old and many of the images prior to Media Library are not in it or listed correctly and even many of the newer posts don’t have the resized versions added correctly to the ML by WordPress.

    Will CDN Sync Tool work for me in this case or will I just be chasing broken links for resized images in all future posts?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Backie

    (@backie)

    Well currently it does upload all new resized images as far as I know. I dunno if you’re creating these images via the image editor. If you are then it doesn’t but since I am not aware of that slight hole in the uploading I’ll patch it either tomorrow or Friday. If not then I’ll figure out what I’ve missed and look into patching it up either tomorrow or Friday.

    Thread Starter rkalla

    (@rkalla)

    Backie,

    I appreciate the reply. I really need a tool that sees the raw contents of the /uploads dir and syncs it and doesn’t exclusively rely on the media library inside of WP.

    From what I can tell the inclusion of scaled instances of images (e.g. car-150×150.jpg for small and car-500×500.jpg for large) that WP makes during it’s “crunching” phase are all ignored.

    I am also using “Add Linked Images to Gallery” plugin which makes the lives of my other writers easier as it pulls in externally linked images directly into the media library on-post and automatically adjusts all img src=”” links to point at the local copies.

    I don’t know if CDN Sync Tool would run late enough in the post-chain to catch these linked images and sync them; from what I saw during testing today the answer is “no” and I ended up with stories that have more than half the image links broken.

    I’ll be the first to admit this is sort of a “worst case” scenario for a CDN Syncing Tool, but I’m hoping the additional details will help you in it’s development.

    Plugin Contributor Backie

    (@backie)

    Well the thing with new uploads is, that the CDN Sync Tool gets the data when it’s uploading and WordPress says what the thumbnail sizes are and then it uploads those files so it’s actually uploading before it even hits the media library and is using the data that is about to be inserted to the media library. If you’re saying this is failing both on upload and in inserting the thumbnails into the media library then I suspect there is another plugin or theme messing with stuff. I’ve looked at the Add Linked Images to Gallery plugin code and can confirm it’s not that. Can you tell me what other plugins you are using?

    It would be possible to do a quick fail safe post edit hook to check and make sure everything is uploaded. However it’s not really desirable.

    Thread Starter rkalla

    (@rkalla)

    Backie,

    So CST hooks into the “Add an Image” dialog and watches only the uploads or also the crunched files as well?

    I am not familiar with the internals of Add Linked Images plugin, but does that use the same mechanism?

    So is the manual sync I performed using the side-bar in CST the correct way to mirror my entire library (probably 30k images) to S3?

    Plugin Contributor Backie

    (@backie)

    Yea when you upload an image using the media library there is a hook where you can filter the meta data. I use this hook to get locations of the images. If the thumbnail array is present then it processes that. I suspect another plugin is messing with the meta data. If you change the

    add_filter("wp_generate_attachment_metadata", array($this, "uploadMedia" )) &&

    on line 35 of lib/Cst/Plugin/Admin.php to

    add_filter("wp_generate_attachment_metadata", array($this, "uploadMedia"), 1) &&

    This may solve the issue, if it does then it’s definitely another plugin causing the issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CDN Sync Tool misses resized copies of original images’ is closed to new replies.