You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In its version 3.3.8, the plugin Enable Media Replace changed some things to adapt to WordPress 5.3’s new upload process.
Since this version, our compatibility is broken. Currently, Imagify is hooking 'emr_unfiltered_get_attached_file' to initiate everything:
But now in \EnableMediaReplace\Replacer::__construct():
if (function_exists('wp_get_original_image_path')) // WP 5.3+
{
$source_file = wp_get_original_image_path($post_id);
if ($source_file === false) // if it's not an image, returns false, use the old way.$source_file = trim(get_attached_file($post_id, apply_filters( 'emr_unfiltered_get_attached_file', true )));
}
else$source_file = trim(get_attached_file($post_id, apply_filters( 'emr_unfiltered_get_attached_file', true )));
If wp_get_original_image_path() doesn’t return false, the hook 'emr_unfiltered_get_attached_file' is not triggered anymore.
This results in the images being improperly optimized, and the old backup file + old webp images not being replaced. Plugin.
The text was updated successfully, but these errors were encountered:
Scope a solution ✅
Hook 'wp_handle_replace' instead of 'emr_unfiltered_get_attached_file'. The only downside is that this hook is located outside the class EnableMediaReplace\Replacer. The perfect solution would be to have a hook available at the beginning of EnableMediaReplace\Replacer->replaceWith(). Since the hook 'wp_handle_replace' is always used before creating a new instance of Replacer, it will work. This hook is also used by ShortPixel.
- Bugfix: Correctly optimize thumbnails during auto-optimization of image upload (#491)
- Bugfix: Fix broken compatibility with Enable Media Replace plugin after WordPress 5.3 (#493)
In its version 3.3.8, the plugin Enable Media Replace changed some things to adapt to WordPress 5.3’s new upload process.
Since this version, our compatibility is broken. Currently, Imagify is hooking
'emr_unfiltered_get_attached_file'
to initiate everything:But now in
\EnableMediaReplace\Replacer::__construct()
:If
wp_get_original_image_path()
doesn’t returnfalse
, the hook'emr_unfiltered_get_attached_file'
is not triggered anymore.This results in the images being improperly optimized, and the old backup file + old webp images not being replaced.
Plugin.
The text was updated successfully, but these errors were encountered: