Enable Media Replace

Descrição

A free, lightweight and easy to use plugin that allows you to seamlessly replace an image or file in your Media Library by uploading a new file in its place. No more deleting, renaming and re-uploading files!
Supported by the friendly team that created ShortPixel 🙂

Um poupador de tempo real

Você não acha tedioso e complicado ter que primeiro apagar um arquivo, e então enviar outro com o mesmo nome, cada vez que você precisa atualizar uma imagem ou qualquer arquivo enviado para a biblioteca de mídia do WordPress?

Bem, não mais!

Now you’ll be able to replace any uploaded file from the media “edit” view, where it should be. Media replacement can be done in one of two ways:

É simples substituir um arquivo

  1. Apenas substituir o arquivo. Esta opção requer que você faça upload de um arquivo do mesmo tipo que você está substituindo. O nome do anexo original permanecerá o mesmo, não importa qual seja o nome do arquivo enviado.
  2. Substituir o arquivo, usar o novo nome e atualizar todos os links. Se você marcar essa opção, o nome e o tipo do arquivo que você está prestes a enviar irão substituir o arquivo atual. Todos os links apontando para o arquivo atual serão atualizados para apontar para o nome do novo arquivo.

This plugin is very powerful and a must-have for any larger sites built with WordPress. It now also comes with preview of the replaced image!

Exibe o horário de modificação do arquivo

There is a shortcode available which picks up the file modification date and displays it in a post or a page. The code is:
[file_modified id=XX format=XXXX] where the “id” is required and the “format” is optional and defaults to your current WordPress settings for date and time format.

So [file_modified id=870] would display the last time the file with ID 870 was updated on your site. To get the ID for a file, check the URL when editing a file in the media library (see screenshot #4)

If you want more control over the format used to display the time, you can use the format option, so [file_modified id=870 format=Y-m-d] would display the file modification date but not the time. The format string uses standard PHP date() formatting tags.

Compatible and recommended Plugins =

  • ShortPixel Image Optimization – Enable Media Replace is fully compatible with this plugin. Once enabled, ShortPixel will automatically optimize the images you replace using Enable Media Replace.
  • Resize Image After Upload plugin – automatically resize images upon upload to save traffic & disk space. Good for SEO and compatible with EMR.
  • Regenerate Thumbnails Advanced – Fast, free and simple to use plugin to regenerate the thumbnails for your site after changing a theme (for example). Supported & maintained by ShortPixel

Wishlist / Coming attractions

Do you have suggestions? Feel free to contact ShortPixel here

Contribute

Want to help us improve the plugin feel free to submit PRs via GitHub here.

Imagens de tela

  • O novo link na biblioteca de mídia.
  • O botão de substituição de mídia, como visto na exibição "Editar mídia".
  • As opções de upload.
  • Obtenha a ID do arquivo no URL de edição do arquivo

Instalação

Instalação rápida e fácil:

  1. Envie a pasta enable-media-replace para o diretório de plugins
  2. Ative o plugin por meio do menu “Plugins” no WordPress
  3. Feito!

FAQ

O que este plugin faz exatamente?

Este plugin facilita atualizar/substituir arquivos que foram enviados para a biblioteca de mídia do WordPress.

Como ele funciona?

Uma nova opção estará disponível no modo de exibição de Editar mídia, chamado “Substituir mídia”. Esse é o lugar onde você poderá enviar um novo arquivo para substituir o antigo.

Eu troquei um arquivo, mas ele não mudou!

Existem duas razões principais para isto acontecer.

Primeira: Certifique-se de que você não está visualizando uma versão em cache do arquivo, especialmente se você substituiu uma imagem. Pressione “Recarregar” no seu navegador para certificar-se.

Segunda: Se o arquivo realmente parece inalterado, certifique-se de que WordPress tem permissões de gravação para os arquivos em sua pasta de uploads. Se você alguma vez já moveu sua instalação WP (talvez quando você migrou para um novo servidor), as permissões de seus arquivos enviados geralmente são redefinidas, então o WordPress pode já não ter mais as permissões para alterar os arquivos. Se você não sabe como fazer isso, entre em contato com o seu servidor de hospedagem web.

Avaliações

5 de setembro de 2019
It might be a simple work for developers to replace the image. But its quite complicated to explain that to content authors, And thanks for Enable Media Replace Team for coming up with a nice solution in UI. Also wonderful and quick support.
1 de agosto de 2019
Been trying to get help for about 4 months now - all they say is clear your cache, when you tell them you've done that already.......silence - useless!
23 de julho de 2019
Until this latest update (3.3.4), no problem. The latest update has completely removed the ability to do what this plugin was intended to do...replace assets. Also, the changelog illustrates just plain laziness. You can't include "*cache killer*" and expect everyone to understand what's behind that. As a "gateway" to ShortPixel's Image Optimizer plugin, this is a bad look.
23 de julho de 2019
The latest update has removed the "Replace Media" button LOL. And as that's all this plugin does, well, you can guess what I think of it. This developer CANNOT possibly test their plugins before release. They just can't. If they did, they would have noticed that the button that this plugin revolves around is missing. Just a shocking, shocking bug. This will - and should - reflect badly on ShortPixel and their paid plugins. If they're this sloppy with a simple image replacement plugin, what are they like with their image optimisation plugins? This plugin is now useless. It's like a shopping cart plugin with no checkout button LOL.
23 de julho de 2019
3.3.3 was working well as we are using it to replace pdf on our sites. 3.3.4, the replace media button / link did show up on the page we are supposed to replaced. Buggy, otherwise, a very good product.
Leia todas as 201 avaliações

Contribuidores e desenvolvedores

“Enable Media Replace” é um software com código aberto. As seguintes pessoas contribuíram para este plugin.

Contribuidores

“Enable Media Replace” foi traduzido para 25 localidades. Obrigado aos tradutores por suas contribuições.

Traduzir “Enable Media Replace” para o seu idioma.

Interessado no desenvolvimento?

Navegue pelo código, dê uma olhada no repositório SVN ou assine o registro de desenvolvimento via RSS.

Registro de alterações

3.3.6

Release date: 5th September 2019
* fix JSON compatibility for hostings that don’t have JSON module activated

3.3.5

Release date: 25th July 2019
* fix Replace button on the MediaLibrary image details popup

3.3.4

Release date: 23rd July 2019
* compatibility fixes for WP version 4.8 and below
* cache killer

3.3.3

Release date: 19th July 2019
* Fix error “using $this when not in object context” on some PHP versions

3.3.2

Release date: 17th July 2019
* Check if medium size !> 400px, display that one, otherwise smallest.
* Fixed: Links not updated when using Advanced Custom Fields
* Fixed: Fails silently when file is too big for upload
* When source file does not exist, show placeholder instead of failed image load
* Fixed: Fatal error when replacing images
* Fixed: Not the right time zone on replace
* Fixed Beaver Builder incompatibility by not allowing replace with rename.
* Fixed: Cannot replace non default WordPress file types, even those allowed to upload [ Media Library Assistant compat ]
* Fixed: error when trying to remove a file that doesn’t exist – because the files are actually on another server

3.3.1

Release date: 18th June 2019
* Fix error class not found on WPEngine

3.3.0

  • When replacing an image and changing the name, Search / Replace is now also done on the meta_value of postmeta.
  • Replace PDF thumbnails too
  • Copy title from EXIF
  • RTL View incorporated into the CSS
  • ‘wp_handle_upload’ filter should be treated as such (and not as action)
  • Use wp_attached_file instead of the GUID
  • Fix: replace missing file
  • Fix: aphostrophe breaking the upload
  • Fix: broken “before” image
  • Fix: update properly the date
  • Fix: errors for non-image items in Media Library
  • Fix: empty admin menu item created
  • Refactored all the code

3.2.9

  • properly replace thumbnails names in the content when the replaced image has a different aspect ratio, thus the new thumbnails have a different height in the name.

3.2.8

  • fix for failures in link updating when replacing file because of addslashes – use prepared query instead
  • replace basename with wp_basename because basename doesn’t work well with UTF8

3.2.7

  • Add minimum required php version to run the plugin.
  • Security: Prevent direct access to php files.
  • Security: Prevent direct access to directories.
  • Security: Escape translation strings using esc_attr__() and esc_html__() functions.
  • Fix RTL issues.

3.2.6

  • no more 404 error if no image was selected when trying to replace it
  • added preview so you can check the image being replaced and also the image that’s being replaced with
  • .dat files can be replaced (functionality accidentally removed in the previous version)
  • added compatibility with S3 upload plugin
  • when an image is replaced the date is also updated

3.2.5

  • remove the leftover setcookie and the plugins recommendations.

3.2.4

  • Fix PDF thumbnails not replaced when replacing a PDF
  • Fix not replacing text files with .dat extension

3.2.3

  • disable ShortPixel recommendation on secondary sites of a multisite install when it was network activated.

3.2.2

  • Fixed compatibility with ShortPixel and Resize Image After Upload
  • Added ShortPixel links and images, fixed the problem of ShortPixel recommendation not dismissing.

3.2.1

  • Correção de erro, erro de digitação fez os metadados mudarem (graças ao usuário do GitHub icecandy!)
  • Removidos os links e imagens do Shortpixel

3.2

  • Testado até o WP 4.9.4
  • Added Shortpixel link in replace media screen

3.1.1

  • Fixed bug introduced in an earlier version, preventing the updating of URLs on pages/posts if the link did not contain the domain name

3.1

  • Got rid of some pesky old code, and added some better filtering options, thanks to GitHub users speerface, aaemnnosttv, and ururk
  • Brand new, shiny code to replace other image sizes in embedded media, thanks to GitHub user ianmjones!
  • Testado com WP 4.8

3.0.6

  • Testado até o WP 4.7.2
  • New PT translations (thanks Pedro Mendonca! https://github.com/mansj/enable-media-replace/commit/b6e63b9a8a3ae46b3a6664bd5bbf19b2beaf9d3f)

3.0.5

  • Testado até o WP 4.6.1

3.0.4

  • Fixed typo in .pt translations (https://github.com/mansj/enable-media-replace/pull/18)
  • Fixed better error handling in modification date functions (https://github.com/mansj/enable-media-replace/pull/16)
  • Testado até o WP 4.4.1

3.0.3

  • Scrapped old method of detecting media screen, button to replace media will now show up in more places, yay!
  • Made sure the call to get_attached_file() no longer skips filters, in response to several users wishes.
  • Suppressed error messages on chmod()
  • Adicionada a tradução japonesa (Obrigado, chacomv!)

3.0.2

  • Arquivos de idioma foram limpos
  • Tradução para o Português adicionada (graças a pedro-mendonca!)
  • Testado até o WP 4.1
  • Adicionadas as traduções ausentes em Sueco

3.0.1

  • Tiny fix to re-insert the EMR link in the media list view.

3.0

  • Atualizado para o WordPress 4.0
  • Now inheriting permissions of the replaced files, Thank you Fiwad

2.9.7RC1

2.9.6

  • Added fix by Grant K Norwood to address a possible security problem in SQL statements. Thanks Grant!
  • Created GitHub repo for this plugin, please feel free to contribute at github.com/mansj/enable-media-replace

2.9.5

  • Correção de erro no shortcode exibindo a data de modificação de um arquivo
  • Atualizadas todas as consultas do banco de dados em preparação para o WP 3.9

2.9.4

  • Bug fix for timezone changes in WordPress
  • Minor UI change to inform the user about what actually happens when replacing an image and using a new file name

2.9.3

  • Added call to update_attached_file() which should purge changed files for various CDN and cache plugs. Thanks Dylan Barlett for the suggestion! (https://wordpress.org/support/topic/compatibility-with-w3-total-cache)
  • Suprimido possível erro no novo gancho adicionado em 2.9.2

2.9.2

  • Pequena correção de erro
  • Added hook for developers to enable purging possible CDN when updating files – thanks rubious for the suggestion!

2.9.1

  • Adicionada tradução para o português brasileiro, graças ao Roger Nobrega!
  • Added filter hook for file name creation, thanks to Jonas Lundman for the code!
  • Added modification date to the edit attachment screen, thanks to Jonas Lundman for the code!
  • Enhanced the deletion method for old file/image thumbnails to never give unnecessary error messages and more accurately delete orphaned thumbs

2.9

  • Adicionada tradução em Português (PT), graças ao Bruno Miguel Bras Silva!
  • Novo link de edição na biblioteca de mídia
  • After uploading, the plugin now takes you back to edit screen instead of library

2.8.2

  • Made another change to the discovery of media context which will hopefully fix a bug in certain cases. Thanks to “Joolee” at the WordPress.org forums!
  • Added a new, supposedly better Russian translation from “Vlad”.

2.8.1

  • Fixed a small bug which could create error messages on some systems when deleting old image files.

2.8

  • New and safer method for deleting thumbnails when a new image file is uploaded.
  • New translations for simplified Chinese (thanks Tunghsiao Liu) and Italian (grazie Marco Chiesi)
  • Adicionado o método de detecção da tela de envio para garantir compatibilidade com as versões anteriores à 3.5

2.7

  • A couple of changes made to ensure compatibility with WordPress 3.5. Thanks to Elizabeth Powell for the fixes!

2.6

  • New and improved validation of uploaded files, now using WP’s own functions for checking file type and extension. Thanks again to my old friend Ulf “Årsta” Härnhammar for keeping us all on our toes! 🙂 This should also hopefully fix the problems people have been having with their installations claiming that perfectly good PDF files are not allowed file types.

2.5.2

  • The “more reliable way” of determining MIME types turned out to be less reliable. Go figure. There seems to be no perfect way of performing a reliable check for MIME-types on an uploaded file that is also truly portable. I have now made checks for the availability of mime_content_type() before using it, using the old method as a fall-back. It is far from beautiful, so if anybody has a better way of doing it, please contact me!

2.5.1

  • Bug fix – there is now a more reliable way of determining file type on your upload so you can upload PDF files without seeing that pesky “File type does not meet security guidelines” message.
  • Nova tradução para dinamarquês – graças a Michael Bering Petersen!

2.5

  • Testado com o WordPress 3.2.1
  • Nova tradução para alemão – graças a Martin Lettner!
  • New translation to French – thanks to François Collette!

2.4.1

  • Bug fix for WordPress 3.1 RC. Now properly tested and should be working with 3.1 whenever it finally comes out. 🙂

2.4

  • Bug fixes, security fixes. Thanks to my old pal Ulf “Årsta” Härnhammar for pointing them out!
  • New method for uploading avoids going around WP, for greater security.

2.3

  • Lots of code trimmed and enhanced, thanks to Ben ter Stal! Now working properly with Windows systems, better security, optimized loading, and much more.
  • Adicionada tradução holandesa por Ben ter Stal.

2.2

  • Correção de erro, corrigido um erro de digitação em popup.php, graças a Bill Dennen e outros por identificar isto!

2.1

  • New shortcode – display file modification date on your site (see description for more info)
  • A couple of bug fixes for final release of 3.0 – Thanks to Jim Isaacs for pointing them out!

2.0.1

  • Adicionado suporte para administração com SSL

2.0

  • Pop-up substituído com navegação em linha ao substituir mídia
  • Instruções adicionadas no link de administrador em Mídia

1.4.1

  • Testado com o WordPress 3.0 beta 2

1.4

  • Removed short tags for better compatibility.

1.3

  • Added support for wp_config setting “FORCE_SSL_ADMIN”

1.2

  • Adicionada a tradução russa, graças a Fat Cower.

1.1

  • Correção de erro menor, agora funciona no IE8 também!

1.0

  • Primeira versão estável do plugin.