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.

Update: Solution to WordPress Scaled Images

Since Prevent Direct Access Gold version 3.1.4, the protection of scaled images is handled by our built-in feature.

Once you protect down-size images whose file URL includes the “-scaled” word, both the original image file and all its sizes will be moved and protected under our _pda folder. We also update the actual file URL under _wp_attached_file. As a result, other file protection functions such as File Access Permission and Search & Replace will work as usual.

If your scaled images are already uploaded and protected by the older versions of our PDA Gold, all sizes except for the original image file will be moved to our private folder. That’s why these files cannot be unprotected properly.

To resolve it, please follow the steps below:

  1. Update Prevent Direct Access Gold to the latest version (at least 3.1.4)
  2. Find all scaled images under Media List View
  3. Unprotect all these files and then protect them again. Use our built-in bulk actions to (un)protect multiple files at once.

In case you still can’t unprotect your images, it’s likely that our plugin couldn’t move all sizes of your images. If so, you will need to manually move those sizes to the correct folder.

Let’s say this is your protected images: pda.com/wp-content/uploads/_pda/2020/02/img-protection-scaled.jpg

  1. Install “WP File Manager” plugin
  2. Go to “wp-content/uploads/2020/02” and search for “img-protection”
  3. Move other sizes of the image to “uploads/_pda/2020/02/”
  4. Once done, your images should be (un)protected successfully again

Temporary Solution: Disable the scaling (no longer needed)

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.