• Resolved eclev91

    (@eclev91)


    This was actually already reported here but looks like it was closed without being addressed.

    The plugin in question that handles offloading to S3 (or somewhere else) is Delicious Brains’s WP Offload Media plugin. If this plugin and its URL rewriting are enabled, your plugin’s cropped version of the images are saved locally but not re-pushed to the S3 bucket.

    Not sure how exactly one goes about being compatible, but I do know that TinyPNG’s image optimization plugin has managed it (or claims to). It’d be great to see this plugin also end up compatible.

    The workaround in the meantime is to crop the media, and then remove it and re-add it to the bucket via the WordPress admin.

    To reproduce:

    – Install WP Offload Media
    – Configure to offload all media to S3
    – Enable URL rewrites
    – Install Crop-Thumbnails
    – Upload a thumbnail
    – Crop it

    Expected result:

    – New cropped thumbnail is shown

    Actual result:

    – Original crop is shown

    • This topic was modified 5 years, 7 months ago by eclev91.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    Hi @eclev91,
    thank you for your detailed explanation and reproducing steps.

    I am sorry, but i currently don’t plan to adjust my plugin to CDN plugins (especially not to commercial once), there are many of them.

    But, if you are interested and are only a little skilled in programming than you may find a solution.

    You need the CDN-plugins PHP-function to trigger the reupload/resync off the CDN images. All you need to do is to put these function in the following hook, that is provided by my plugin:

    
    add_filter('crop_thumbnails_before_update_metadata',
        function($imageMetadata, $imageId) {
            //the code to trigger the CDN sync
        }
    },10,2);
    

    (code is not tested, but should work)

    The code will be called after the new image is saved and before the images metadata is saved.

    As far as i can see there is also a “WP Offload Media Lite” Plugin, so eventually i will have a look at it some time.

    Thread Starter eclev91

    (@eclev91)

    @volkmar-kantor totally understand. FWIW, this particular plugin listens for the wp_update_attachment_metadata filter. They said most plugins that are compatible have a call like this:

    wp_update_attachment_metadata( $attachment->ID, wp_generate_attachment_metadata( $attachment->ID, $file ) );

    Seems like something that should probably be done after a crop anyway, perhaps?

    Plugin Author Volkmar Kantor

    (@volkmar-kantor)

    hi @eclev91, thanks for investigating.
    My plugin uses the wp_update_attachment_metadata function but do not use the wp_generate_attachment_metadata cause the images only an update.

    I will have a look on if there is also a filter called “wp_update_attachment_metadata”, maybe it needs to be called seperate.

    But, please bear with me, i am currently have a heavy workload so, it will take some time.
    If you want to look for it yourself. You can find the plugin code on github (https://github.com/vollyimnetz/crop-thumbnails).

    You will find the call of wp_update_attachment_metadata in the save-function (https://github.com/vollyimnetz/crop-thumbnails/blob/9721c8d381f3aaf76a8716b9bea9da4866fcfe8e/functions/save.php#L118)

    Thread Starter eclev91

    (@eclev91)

    @volkmar-kantor I totally understand. Thanks for the GitHub link – that’s actually perfect. I’ll give it a once-over and see if this is an easy fix.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Compatibility with WP Offload Media from DeliciousBrains’ is closed to new replies.