• Resolved Deon

    (@deon-b)


    Hello,
    I thought the plugin would replace file
    example.jpg with the new file also named example.jpg, deleting the first example.jpg.

    Instead it creates a file named example-1.jpg and keeps in the media gallery both example.jpg and example-1.jpg

    And it uses example-1.jpg in the blog post.

    Is this how it’s supposed to work? By adding a new file rather than replacing it?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon,

    No, that’s not how it’s supposed to work. It looks like you are simply uploading a new file; can you tell me exactly, step by step, how you are using the plugin to replace your images?

    Thank you,

    Thread Starter Deon

    (@deon-b)

    Hi,
    here are my steps:

    Classic editor:

    Edit post >
    In visual editor, click on image one time, then click on the pencil (edit)
    > Click on replace > Upload > select file from computer with same name as current file > Click Replace.

    The image has been replaced in the blog post.

    When I go in media library I can see both original-image.jpeg and original-image-1.jpeg

    Old image has not been deleted and new image has an -1 added to the file name.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon,

    I believe you are not using the plugin as it should be done. You are clicking here, right? https://i.imgur.com/u0s82S2.png

    If so, that’s not our plugin. To use our plugin, you need to go to the Media Library, click on the image you want to replace, and then click here: https://i.imgur.com/B6iHI0o.png

    If that’s not what you mean, please send us a recording so we can see exactly how you are replacing the image ??

    Thank you!

    Thread Starter Deon

    (@deon-b)

    Hi,
    I am using the classic editor but I think that you are right and I was doing the equivalent of what you did in the gutemberg editor.

    I followed your directions now but it seems it creates an attachment page?
    https://pasteboard.co/K5JniZN.png

    There seems to be another problem also. In media library I do see indeed the replaced image but not in the article. Also in media library I see the right image in the square media thumbnail but when I click on the image I see again the old image.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon,

    It does not create an attachment page; the attachment page has always existed, you are just being redirected there after the replacement is successful.

    Regarding the second problem, that’s simply a cache issue, and you need to clear it. I recommend you to have a look at this article ?? https://help.shortpixel.com/article/426-how-to-clear-wordpress-cache

    Cheers!

    Thread Starter Deon

    (@deon-b)

    Hi,
    you are right, I cleared the cache and it worked.

    But I am honestly worried about the attachment page and them being indexed because of this plugin. For instance if I uninstall your plugin and click on the image, there is no attachment page opening. You say the page already exists but really it only opens up when I am using your plugin.

    With yoast I have the setting attachment page redirect to attachment itself enabled.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon,

    If you go to https://yourwebsite.com/wp-admin/post.php?post=427&action=edit (it’s an example of the attachment page), you can probably enter with and without Enable Media Replace activated. The plugin does not affect that page in any way.

    Could you please record a video showing the behaviour you are describing?

    Thank you!

    Thread Starter Deon

    (@deon-b)

    Hi,
    I tried what you wrote and it’s correct, I can enter that page even without the plugin activated.

    But I found another issue now.

    I had this image:

    <img class="aligncenter wp-image-187 size-full" src="https://cwrdp.com/wp-content/uploads/2021/06/miko-inflatable-doll.jpg" alt="miko inflatable doll" width="500" height="500" />

    And I replaced the file: “mike-inflatable-doll.jpg” with a new file.

    The new file has a different name and dimensions.

    The image has been successfully replaced, but there are 2 problems:

    1) Image looks blurry. This is because the width="500" height="500" from previous image has been kept and new image has different proportions

    https://pasteboard.co/K6zEs0W.png

    2) File name has not been updated with new file name.

    I cleared cache a few times. Is this behavior a limitation of the plugin or something is not working properly?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon,

    About issue #1, that’s something unrelated to Enable Media Replace. The plugin only replaces files and updates the links. If there is something else (like those attributes) added by your theme, then you should update those manually, but probably re-adding the image and re-saving your post will solve that ??

    About issue #2, could you please send us a URL where we can see that the image did not get replaced properly?

    Thank you,

    Thread Starter Deon

    (@deon-b)

    Hi Gerard,

    If there is something else (like those attributes) added by your theme

    Apparently in the Classic Editor adding these attributes (width and height) is default behavior:
    https://webgaku.net/wordpress/add-img-size/
    Behavior which is in place to avoid layout shifts.

    So basically you are saying Enable Media Replace is not compatible with Classic Editor as per this img attributes issue?

    I tried to update the post but nothing changes. I also cleared the cache a few times.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon!

    I hope you had a great weekend.

    About the link you sent, that’s something custom and as any custom code, we can’t know how it’s going to affect the rest of plugins or your website.

    Having said that, you don’t need to add neither the Classic Editor nor the custom code. WordPress, by default, adds the width and height parameters to any image you insert on your posts. Moreover, after replacing an image the parameters will be updated. I just did a test on a default WordPress installation and it works wonderfully.

    Cheers!

    Thread Starter Deon

    (@deon-b)

    Hi,
    you previously wrote:

    If there is something else (like those attributes) added by your theme, then you should update those manually

    And now you changed to the opposite stance:

    WordPress, by default, adds the width and height parameters to any image you insert on your posts

    Anyway in my case those width and height attributes are not being updated.

    I am using a basic wordpress theme and nothing custom.
    Where could the issue be?

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi Deon!

    I apologize for the confusion. Let me please clarify: WordPress, by default, adds the width and height parameters to any image you insert on your posts with the Image block (or at least, that’s the behaviour I’m getting). But it is possible that your theme is also playing with those attributes, so it is possible that there is some sort of conflict there.

    In any case, can you please try to reproduce the issue with a clean installation here? https://tastewp.com/ Just create a post, upload an image and replace it. If you can actually reproduce the issue, I would very much appreciate it if you could send us a recording (or detailed screenshots) with the process so we can see exactly the steps you are taking.

    Thank you,

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Doesn’t replace file, but adds new one’ is closed to new replies.