• Using WP Offload media for offloading.

    When uploading files if they have different name all goes fine. But if I upload two times the same file (no difference how separate in time) WP Offload media assigns the same value for S3 bucket URL. post_name in table wp_posts has different names for same file (so it seems wordpress works properly) but finally offloaded url has same value in wp_as3cf_items.

    It is like WP Offload Media is not performing any conflict check in S3 or it is not using source path from wp_posts either.

    I did two times a clean install/uninstall.

    Any clue where I can start debugging or what can be happening?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter xam1

    (@xam1)

    More details, it happens with files scaled by wordpress only. It seems when scaling wordpress don’t change name. But WP Offload Media shouldn’t be checking if name already exists in bucket. Thanks.

    Thread Starter xam1

    (@xam1)

    If I don’t offload media,wordpress is uploading files correctly, changing name to scaled files, i.e. file-scaled.jpg, file-1-scaled.jpg etc. When I start offloading again then offloaded url remains constant (file-scaled.jpg or whatever but always the same…) Again any clue? any setting to check? This is a big problem if two users upload same file name but with different content. Thanks.

    Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi there!

    WP Offload Media Support Team here, Thanks for reaching out with your query we would be happy to assist

    This should be prevented automatically by WordPress itself. If a new upload has the same file name with an existing image, WordPress automatically renames the second file and appends a number at the end.

    For example:
    Existing/original image is filename.png
    New upload / duplicate filename will then be automatically rewritten to filename-1.png

    I tried to replicate the issue by having the WP Offload Media’s ‘Offload Media’ setting enabled and then uploading the same image twice with the same filename on Media Library and WordPress automatically renames the second file which avoids the duplicate URL.

    It’s also the same for different files but same filename. WordPress automatically rewrites the filename and appends a number at the end regardless if WP Offload Media is enabled or disabled.

    Could you please let us know how you uploaded those images? Did you upload those via the WordPress media library or were you using another tool to upload those files?

    If you used a different tool/plugin, would you mind trying to replicate it using WordPress media library instead?

    However, if you’ve used WordPress media library to upload, could you please temporarily deactivate other plugins and use a default theme such as Twenty twenty to check for conflicts.

    If the issue persists, please provide a step-by-step on how you upload your images so we can replicate it as closely as possible.

    Looking forward to hearing back!

    Thread Starter xam1

    (@xam1)

    Thank you!

    I did the search you asked and took me a while to find the problem.

    General conditions:

    1. It only happens with images big enough to be scaled. I’m using the same image always of 4,7Mb.
    2. All tests with same configuration: no other plugins except WPOM when needed in test.
    3. All uploads using WordPress media library only.
    4. Theme twentytwenty always.

    Specific tests:

    a) If I user your plugin with the theme in this conditions it works well.

    b) if I add the following code to theme’s functions.php:

    add_filter( ‘intermediate_image_sizes’, ‘__return_empty_array’ );

    and WPOM is offloading then it doesn’t change number. wrong behaviour.

    c) If I add the filter and stop offloading then it works well again

    It is happening only when both the filter and WPOM are activated.

    (I upload 5 times the same file in each scenario as I have cache and some times it takes time to reflect changes in code – puting or deleting the filter), but when the change in code takes place the behaviour is constant).

    I can reproduce the situation always.

    Let’s see if you can reproduce it. Just let me know if you can reproduce it please.

    Many thanks

    Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @xam1 ,

    Thanks for the additional details. I tried the steps you provided in my local site, but I was not able to replicate the issue you experienced.

    See screen recording below:

    https://share.getcloudapp.com/DOuK8e81

    If this keeps happening for you, something you can do is enabling “Add Object Version to Bucket Path”. This adds a unique timestamp to the path of the item in the bucket. Now even if 2 users upload the same filenames, it will only cause a conflict if WordPress receives both files at exactly the same second.

    I hope this helps. Let us know if you have any other questions

    Thread Starter xam1

    (@xam1)

    Thank you, I had object versioning enabled.

    I’ll keep digging to understand what’s going on.

    Thanks for your interest.

    Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @xam1 ,

    We’re always happy to help. Let us know if you have any other questions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP Offload Media repeating offload url, no conflict check in S3’ is closed to new replies.