From 362f8111ea76f4cd8d84d8ee56083e6f0ee4db2d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 10 Jan 2024 14:37:19 -0500 Subject: [PATCH] Add a limit to image library query --- core/A2_Optimized_Optimizations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/A2_Optimized_Optimizations.php b/core/A2_Optimized_Optimizations.php index c18970a..54c6552 100644 --- a/core/A2_Optimized_Optimizations.php +++ b/core/A2_Optimized_Optimizations.php @@ -898,7 +898,7 @@ public function get_best_practices() { ], 'large_images' => [ 'title' => 'Large Images in the Media Library', - 'description' => 'Images larger than 1mb may not be properly optimized and could cause performance issues for your site visitors.', + 'description' => 'Images larger than 1mb may not be properly optimized and could cause performance issues for your site visitors. For performance reasons, A2 Optimized only looks the latest 1000 images in your media library.', 'config_url' => admin_url() . 'upload.php', 'status' => $this->is_active('large_images', false), ], @@ -1423,7 +1423,7 @@ public function is_active($optimization, $value_only = true) { $args = [ 'post_type' => 'attachment', - 'numberposts' => -1, + 'numberposts' => 1000, 'post_mime_type' => 'image', 'post_status' => null, 'post_parent' => null, // any parent