Handling Big Image Protection in WordPress 5.3

Since version 5.3, WordPress will detect and scale down large image uploads automatically for optimization purposes.

For example, when you upload a 3000×4000 pixel image to your website, it will be resized to the default threshold values which is 2560px.

WordPress also marks the scaled-down images with -scaled word at the end of the file URL. For example, a resized image URL will look like: https://preventdirectaccess.com/wp-content/uploads/2020/02/sample-image-scaled.png

By default, Prevent Direct Access Gold protects your images and all its sizes based on the default file URL. Since the default scaled image URL stored under _wp_attached_file is changed, our plugin cannot detect the scaled image and serve them correctly.

As a result, our current file protection method will lead to all sizes of the scaled images returning 404.

We’re addressing the issue in the upcoming version of our PDA Gold.

Temporary Solution: Disable the scaling

Currently, you can resolve the image protection issue by temporary disabling the WordPress scaling feature with the following code:

add_filter( 'big_image_size_threshold', '__return_false' );

We will be updating our official solution soon.

Leave a Reply

Your email address will not be published. Required fields are marked *