• First off, I am loving this plugin, so thanks for making it!

    Unfortunately I just ran into an huge performance issue. Whenever the plugin is activated and in CLI mode (the settings don’t matter!), the media library grinds to a halt and takes 10 or more seconds to show anything.

    Here’s what seems to be happening:

    The media library calls ‘query-attachments’ to get a list of media to display

    query-attachments, somewhere, calls media_meta for every media

    the IME plugin adds a filter to media_meta: ime_filter_media_meta

    Here’s the issue. on every call to ime_filter_media_meta we get a call to ime_mode_valid():

    function ime_filter_media_meta( $content, $post ) {
    global $wp_version;

    if ( ! ime_mode_valid() ) {
    return $content;
    }

    ime_mode_valid calls ime_im_cli_valid :

    /* Check if mode is valid */
    function ime_mode_valid( $mode = null ) {
    if ( empty( $mode ) ) {
    $mode = ime_get_option( 'mode' );
    }
    $fn = 'ime_im_' . $mode . '_valid';
    return ( ! empty( $mode ) && function_exists( $fn ) && call_user_func( $fn ) );
    }

    This eventually calls ime_im_cli_check_executable which actually executes imagemagick

    function ime_im_cli_check_executable($fullpath) {
    if ( ! ime_is_executable($fullpath) || ! function_exists('exec') ) {
    return false;
    }

    @exec( '"' . $fullpath . '" --version', $output );

    ImageMagick is a heavy program, and it ends up being executed at least dozens of times, doing nothing each time, every time you load a page in the media library.

    Suggestions: Set a global var and check just once? I’ve commented out the check for now so I can keep using the plugin until it’s fixed.

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author Rickard Westerlind

    (@rickardw)

    Thanks for the feedback. I will realease a new version in a few weeks (planned) and will definitely fix this in that upcoming version.

Viewing 1 replies (of 1 total)

The topic ‘CLI Mode breaks Media Library usability.’ is closed to new replies.