• Resolved JohnDBB

    (@johndbb)


    Hello,

    We have around 100 thousand images and we have seen that any image search in media library is slower since Imagify is activated. Is there anyway to improve this, please?

    Thank you in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Media

    (@wp_media)

    Hi @johndbb

    ?Sorry to hear about the issue!

    At this moment, we only have a temporary solution – our developers are looking for a more stable/permanent solution.

    You can try to add this code in your theme’s functions.php file – it will eliminate all Imagify stats and allow faster browsing through the Media Library page:

    function pfx_limit_imagify_optimize_count( $count ) {
    return 1;
    }
    add_filter( 'imagify_count_optimized_attachments', 'pfx_limit_imagify_optimize_count' );
    add_filter( 'imagify_count_attachments', 'pfx_limit_imagify_optimize_count' );
    add_filter( 'imagify_count_unoptimized_attachments', 'pfx_limit_imagify_optimize_count' );
    add_filter( 'imagify_count_saving_data', 'pfx_limit_imagify_optimize_count' );
    add_filter( 'imagify_count_error_attachments', 'pfx_limit_imagify_optimize_count' );

    Feel free to try it out and let me know if it works.

    Best Regards
    Marko

    Thread Starter JohnDBB

    (@johndbb)

    Thank you

    We have already implemented that code. It allows us to go into Media Library (before that it took forever to go into Media Library). But the problem now is when we search an image. It may take above 3 or 4 minutes to show results.

    Thank you in advance.

    Plugin Author WP Media

    (@wp_media)

    Hey @johndbb

    At this very moment, the only thing you can do is to edit Imagify core files.

    This could be just a temporary work-around and it will be overwritten whenever you update the plugin:

    In the inc/admin/upload.php file, you will find the _imagify_atttachments_filter_dropdown() function. You can comment out the 3 lines to do with counting shown here:

    function _imagify_attachments_filter_dropdown() {
    	if ( ! Imagify_Views::get_instance()->is_wp_library_page() ) {
    		return;
    	}
    
    //	$optimized   = imagify_count_optimized_attachments();
    //	$unoptimized = imagify_count_unoptimized_attachments();
    //	$errors      = imagify_count_error_attachments();
    	$status      = isset( $_GET['imagify-status'] ) ? wp_unslash( $_GET['imagify-status'] ) : 0; // WPCS: CSRF ok.

    And then just below, you will need to modify inside the

    foreach ( $options as $value => $label ) {

    to look as follows:

    foreach ( $options as $value => $label ) {
    	echo '<option value="' . $value . '" ' . selected( $status, $value, false ) . '>' . $label .
    	     //' (' . ${$value} . ')
    	'</option>';
    }

    Note that when applied, it will not show the number of images in (x) any longer next to the items in that filter drop-down, and you should be able to search for images.

    Our developers are looking for the best solution, but I still can’t give you any estimate when it could be delivered.

    Let me know if this worked.

    Best Regards
    Marko

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Media library search of images slower’ is closed to new replies.