• Resolved casparsmits

    (@casparsmits)


    Hi WooCommerce,

    My website gives an error 500 caused by allowed memory size exhaustion. I deactivated all plugins and checked them one by one, and the combination of WooCommerce with the Avada theme causes the issue. On the standard WordPress theme, the memory issue doesn’t happen.

    I changed the memory limit to 512MB and the WooCommerce status page shows the 512MB as well. On 512MB limit the error shows:

    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /home/deb110963/domains/straightdental.com/public_html/dev/wp-includes/pluggable.php on line 1002
    
    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0

    while on 256MB it showed:

    
    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /home/deb110963/domains/straightdental.com/public_html/dev/wp-includes/class-wp-hook.php on line 281
    
    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /home/deb110963/domains/straightdental.com/public_html/dev/wp-includes/class-wp-fatal-error-handler.php on line 67

    I don’t know what to do anymore to solve this issue, would anyone have any ideas?

    Best,
    Caspar

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • As you indicate yourself, the problem lies with your theme. It is therefore recommended to ask your question there.

    Sincerely

    Thread Starter casparsmits

    (@casparsmits)

    The problem disappears when I deactivate WooCommerce, so it seems to have something to do with the interaction between the theme and WooCommerce. I decided to post this both in the theme and here.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    @casparsmits usually Avada theme works quite well with WooCommerce. Do you have a child theme for Avada? You might try switching to the base Avada theme if so to confirm whether it’s an issue with the child theme rather than Avada as a whole.

    Also, do you have any custom functions added to the site?

    Thread Starter casparsmits

    (@casparsmits)

    Thank you for the great idea. When I switch to the base theme, the website works. In my child theme there is only functions.php and style.css (without custom css). I’ve been trying out the different pieces of code and the piece below somehow created the problem. Removing it solved the problem. Thank you so much!

    function defer_parsing_js($url) {
    //Add the files to exclude from defer. Add jquery.js by default
        $exclude_files = array('jquery.js');
    //Bypass JS defer for logged in users
        if (!is_user_logged_in()) {
            if (false === strpos($url, '.js')) {
                return $url;
            }
    
            foreach ($exclude_files as $file) {
                if (strpos($url, $file)) {
                    return $url;
                }
            }
        } else {
            return $url;
        }
        return "$url' defer='defer";
    
    }
    add_filter('clean_url', 'defer_parsing_js', 11, 1);
    • This reply was modified 4 years, 10 months ago by casparsmits.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Avada, WooCommerce & Allowed memory size exhausted’ is closed to new replies.