Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter chillibasket

    (@chillibasket)

    Thanks! I just tested it now and can confirm that the problem is fixed.

    Thread Starter chillibasket

    (@chillibasket)

    In Gallery.php the issue was that it is doing a database search even when the post_parent ID is 0. Since the admin page is not a post, this bug causes the database to load all posts and all images. To solve this, one extra condition could be added to the if-statement on line 207; I quickly tested it on my site and it appears to work:

    } else if ($id != 0) {
    $attachments = get_children( array(
    'post_parent' => $id,
    'post_status' => 'inherit',
    'post_type' => 'attachment',
    'post_mime_type' => 'image',
    'order' => $atts['order'],
    'orderby' => $atts['orderby'],
    ) );
    }

    Let me know if you can replicate this issue and the potential fix. If so I can mark this as resolved.

    Thread Starter chillibasket

    (@chillibasket)

    I installed the “Query Monitor” plugin to see which database queries were using up excessive memory. When loading the “Justified Gallery” settings page, four large database request are made within the file wp-content/plugins/justified-gallery/includes/Gallery.php:214:

    • WP_Query->get_posts() – loads ~28,000 rows
    • _prime_post_caches() – loads ~28,000 rows
    • WP_Term_Query->get_terms() – loads ~28,000 rows
    • update_meta_cache() – loads ~113,000 rows

    These database queries appear to be very inefficient and are pretty much loading the whole database into memory. For small websites this usually does not cause a problem but since my website has an unusually large database, it is causing the memory issues and this was the root cause of the critical error I saw. The Settings page does not appear to show any information which would warrant these database queries, so I’m unsure as to why they are called.

    Thread Starter chillibasket

    (@chillibasket)

    Thanks for the extremely quick reply!

    Several of these warnings appear: PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /***.com/wp-includes/class-wp-scripts.php on line 710
    But the main error appears to be a memory allocation fault: PHP Fatal error: Allowed memory size of 314572800 bytes exhausted (tried to allocate 20480 bytes) in /***.com/wp-includes/class-wpdb.php on line 2153

    The same errors also appear when Smart Slider is deactivated, so probably it is not the cause.

    (Edit) I’ve provisionally fixed this issue by increasing the WordPress memory limit in wp-config.php. I’ll have a closer look at why this limit was being exceeded this weekend when I have more time.

    • This reply was modified 1 year, 8 months ago by chillibasket.
    Thread Starter chillibasket

    (@chillibasket)

    I had a quick look at the source code and there seems to be an easy fix to this issue. In “block-editor.css” I changed:

    .is-selected .wp-block-katex-block-editor .katex-editor,
    .is-typing .wp-block-katex-block-editor .katex-editor  {
        display: block;
    }

    to

    .is-selected > .wp-block-katex-block-editor .katex-editor ,
    .is-typing > .wp-block-katex-block-editor .katex-editor  {
        display: block;
    }

    To make sure that only the “is-selected” and “is-typing” classes for each specific block are used and instead of the ones for the outer container.

Viewing 5 replies - 1 through 5 (of 5 total)