Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #914810

    Hi,
    I have seen the big amount of similar issues in the forum, but I think just increasing the allowed memory size as usually proposed will NOT solve my problem.
    We have a WP website with A LOT (>5000) of files in the media library. Before the backend and the theme were working fine, but since we uploaded all those files, the avia layout builder is not working porperly anymore. For some content elements the modal window for editing them stay empty. There is a loading graphic for a few seconds and than it stays white. For others it is working. The WP attachment browser / media selector is working fine in other places. Strange: It is working for some media based elements like “Image with Hotspots” and “Masonry Gallery”, but NOT for “Image” and “Masonry”.
    In the php error log I get these:
    [Mon Feb 19 20:34:11.457994 2018] [:error] [pid 20029] [client 83.223.243.54:54551] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/***/wp-includes/wp-db.php on line 1889, referer: https://***/wp-admin/post.php?post=6274&action=edit
    I don’t think wp-db.php is the problem!? I don’t think just increasing the momory limit will solve our problem.
    Why are these modals taking up so much memory? Why are some working, some not? What gets loaded in the background?
    Kind regards

    • This topic was modified 7 years, 5 months ago by Riseleap.
    #914814

    Hey,

    Thanks for contacting us!

    256M usually is enough for most sites however it seems like you are going to need to increase it to 512M. As you said, wp-db.php file is not the problem but increasing memory limit would solve the issue. Please contact your hosting provider and ask them to increase it to 512M :)

    Best regards,
    Yigit

    #914820

    Hi, thanks for your quick answer. I was expecting this, but I am not really happy with the solution. WHY is this tiny modal window taking up so much memory?? Why would it work with other content elements. If our media library grows (it will), we will get the error again, even with GBs of memory!?
    I think there must be some loop in the avia framework somewhere checking ALL attachments at once? Possible?
    Kind regards

    #915021

    Hi,

    We will provide the feedback to our developers, they will review and if there is any loop they will fix it.!
    Thank you very much for your feedback we much appreciate

    Best regards,
    Basilis

    #915613

    Hi,
    can you please tell me where I can find the code which generates these popups?
    Kind regards

    #915632

    Hi,
    i just found out that enfold is limiting the memory use itself to 256MB, so changing the PHP and WP limit to a higher value does not work.
    /wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/html-helper.class.php
    line 745:

    
                //necessary for installations with thousands of posts
                @ini_set("memory_limit","256M");
    
    #915895

    Hi Riseleap,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look? Can you please specify the pages where it is happening?

    Best regards,
    Victoria

    #917342

    Hi.
    Unfortunately our chief of development would not like anyone else to have an admin access to our development site, so we have to solve this somehow differently, sorry.
    BUT:
    I got an idea, where our problem is. The hard-coded setting of the memory limit, mentioned above, is inside the function generating the “linkpicker”. We have have a database table wp_term_taxonomy with more than 50,000 entries already and they are all written in an array to build the linkpicker.
    There is a different code defining the allowed post types and taxonomies:
    /wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/generic-helper.class.php line 288:
    $taxonomies = apply_filters(‘avia_public_taxonomies’, $taxonomies);
    How can I exclude some taxonomies types from this filter??
    Kind regards

    #917344

    How can I add another post type here NOT to be a public:
    /wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/generic-helper.class.php
    line 256

                $post_types         = get_post_types(array('public' => false, 'name' => 'attachment', 'show_ui'=>false, 'publicly_queryable'=>false), 'names', 'NOT');
    

    ??

    #917518

    Hi,

    Try as the following

    
    $post_types         = get_post_types(array('public' => false, 'name' => array('attachment','evemts'), 'show_ui'=>false, 'publicly_queryable'=>false), 'names', 'NOT');
    

    and let us know if that would work out.

    Best regards,
    Basilis

    #917613

    Hi,
    sorry, but it does not work.

    #917968

    Hi,

    yes diged into it a bit more and it is not so simple it seems.
    It would require a lot of custom code so you can loop with a for each inside the post types.
    I am afraid if you need to get it further you would need to hire someone help you.

    Best regards,
    Basilis

    #917980

    If I simply replace ‘attachments’ with our post_type, it works.
    I would just have both to be not “public” to keep the linkpicker as clean as possible. The existance of the array with “allowed post types” makes me think that the developer was thinking of the possibility of adding some more!?

    #918478

    Ok, are these your standard answers? First you recommend to raise the memory limit, which does not work because of a hard-coded limit in the code. And if that does not work you tell me to get some paid customization?
    I think it does not require a lot of code! It just needs to make 2 post_type non-public instead of one, so it is just a question of the right syntax in one line of code, which might be really easy for the developer of this code.

    #918669

    Hi,

    Yes, even if you google it, you can see that it does require a huge editing to make it work.
    You need to go through all the post types so they can be visible.

    Best regards,
    Basilis

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.