• Resolved adipl

    (@adipl)


    Plugin version: 5.0.9, PHP 8.1, WordPress 6.1

    My website started to run slowly. After checking in Query Monitor, I found some slow SQL queries caused by Meow_MWL_Core->resolve_image_id()

    The images used as (static, hardcoded in HTML) layout elements are checked in the database.

    SELECT?ID
    FROM?wp_posts
    WHERE?guid?LIKE?‘%wp-content/themes/YYYYYYY/img/cal.png%’

    Such an image does not appear in the database. Is it possible to deactivate this somehow?

    There are 8-10 such queries and they (all) take 0.4-0.5s.

    I tried (no effect):

    • resetting the cache
    • add class=”no-lightbox” to IMGs
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @adipl! ??

    Thank you for reporting the issue. Indeed, it is currently behaving in this manner. In the upcoming update, the anti-selectors will be interpreted before the request, allowing you to cancel it this way. We appreciate your patience. ??

    Thread Starter adipl

    (@adipl)

    Thanks for your answer and new version.

    It seems to me that after changing to 5.1.1 it works even worse.
    WP ?6.1.1 with Classic Editor

    On the home page (I’m logged into the WP panel, the cache plugin is disabled). Query monitor results:
    Plugin: meow-lightbox 40 select query 1 show, time: 0.198s
    all queries (on page) /total: 67 select 1 show total time 0.2039

    Caller: Meow_MWL_Core->resolve_image_id() 20 select 1 show 0.1972 time

    var mwl_settings = {“plugin_url”:”http:\/\/mydomain.test\/wp-content\/plugins\/meow-lightbox\/classes\/”,”settings”: {“backdrop_opacity”:85,”theme”:”dark”,”orientation”:”auto”,
    “selector”:”.entry-content, .gallery, .mgl-gallery, .wp-block-gallery, .wp-block-image”,

    “deep_linking”:false,”social_sharing”:false,”separate_galleries”:false, “animation_toggle”:”none”,”animation_speed”:”normal”, “low_res_placeholder”:false,”wordpress_big_image”:false,
    “right_click_protection”:true,”magnification”:true,
    “anti_selector”:”.blog, .archive, .emoji, .attachment-post-image, .no-lightbox”,”preloading”:false,”download_link”:false, “caption_source”:”caption”,”caption_ellipsis”:true,”exif”:{“title”:””,”caption”:”1″,”camera”:””,”date”:false,
    “date_timezone”:false,”lens”:””,”shutter_speed”:””,
    “aperture”:””,”focal_length”:””,”iso”:”” ,”keywords”:false},”slideshow”:{“enabled”:false,”timer”:3000},”map”:{“enabled”:false}}};

    On my homepage I don’t have (in generated soucecode) any classes from “.entry-content, .gallery, .mgl-gallery, .wp-block-gallery, .wp-block-image”
    And your plugin make select for 40 images from static layout or posts. Why your plugin try images when they are not in one of Selector?

    Maybe, to all the images on the page I should add a class with one of the anti-selector?
    In functions.php i have:

     wp_deregister_script(‘heartbeat’);
    wp_dequeue_style(‘wp-block-library’);
    wp_dequeue_style(‘wp-block-library-theme’);
    wp_dequeue_style(‘global-styles’);
    remove_action(‘wp_head’, ‘feed_links_extra’, 3);
    remove_action(‘wp_head’, ‘feed_links’, 2);

    remove_action(‘wp_head’, ‘print_emoji_detection_script’, 7);
    remove_action(‘admin_print_scripts’, ‘print_emoji_detection_script’);
    remove_action(‘wp_print_styles’, ‘print_emoji_styles’);
    remove_action(‘admin_print_styles’, ‘print_emoji_styles’);
    remove_filter(‘the_content_feed’, ‘wp_staticize_emoji’);
    remove_filter(‘comment_text_rss’, ‘wp_staticize_emoji’);
    remove_filter(‘wp_mail’, ‘wp_staticize_emoji_for_email’);
    add_filter(‘tiny_mce_plugins’, ‘disable_emojis_tinymce’);

    • This reply was modified 10 months, 2 weeks ago by adipl.
    Plugin Support Val Meow

    (@valwa)

    Hey @adipl! ??

    Thanks for reporting! In the upcoming version of the plugin, there will be an option under the performance settings to check the selector classes directly in the backend.

    This adjustment should address cases where images lack any ID indicators thus requesting their media ID in the backend before the selectors come into play. Thank you for your patience and understanding. ??

    Thread Starter adipl

    (@adipl)

    Thanks for answer. I found solution – in settings, Lightbox?-> performance, I unchecked the option “Output Buffering Enable”. And now plugin not make query about layouts images. And page load faster.

    I’m sorry for the trouble

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unnecessary database queries: about layout images’ is closed to new replies.