• Resolved blindpet

    (@blindpet)


    Seeing this error in my logs (have 256 MB RAM allocated to php7-fpm with nginx)

    PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 79528624 bytes) in /var/www/guides.wp-bullet.com/wp-content/plugins/svg-support/functions/thumbnail-display.php on line 23

    Disabling the svg support plugin resolved an error I was having here

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

    (@blindpet)

    Added post so I can follow

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @blindpet,

    Firstly, thanks for your support and sorry for the inconvenience!

    I’m not 100% sure how my plugin would affect memory like that, especially that much :O

    I’m not sure how this is affecting the object cache, but it is certainly a possibility. The entire code of the file in question is:

    
    <?php
    /**
     * ADD ABILITY TO VIEW THUMBNAILS IN WP 4.0+
     */
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    add_action( 'admin_init', 'bodhi_svgs_display_thumbs' );
    function bodhi_svgs_display_thumbs() {
    
    	ob_start();
    
    	add_action( 'shutdown', 'bodhi_svgs_thumbs_filter', 0 );
    	function bodhi_svgs_thumbs_filter() {
    
    	    $final = '';
    	    $ob_levels = count( ob_get_level() );
    
    	    for ( $i = 0; $i < $ob_levels; $i++ ) {
    
    	        $final .= ob_get_clean();
    
    	    }
    
    	    echo apply_filters( 'final_output', $final );
    
    	}
    
    	add_filter( 'final_output', 'bodhi_svgs_final_output' );
    	function bodhi_svgs_final_output( $content ) {
    
    		$content = str_replace(
    			'<# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',
    			'<# } else if ( \'svg+xml\' === data.subtype ) { #>
    				<img class="details-image" src="{{ data.url }}" draggable="false" />
    			<# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',
    
    			$content
    		);
    
    		$content = str_replace(
    			'<# } else if ( \'image\' === data.type && data.sizes ) { #>',
    			'<# } else if ( \'svg+xml\' === data.subtype ) { #>
    				<div class="centered">
    					<img src="{{ data.url }}" class="thumbnail" draggable="false" />
    				</div>
    			<# } else if ( \'image\' === data.type && data.sizes ) { #>',
    
    			$content
    		);
    
    		return $content;
    
    	}
    
    }
    

    Let me know if I can help any further.
    Cheers
    Ben

    Plugin Author Benbodhi

    (@benbodhi)

    Did you ever get this sorted @blindpet?

    Thread Starter blindpet

    (@blindpet)

    After I disabled the object cache and things started working I stopped digging.

    Plugin Author Benbodhi

    (@benbodhi)

    Thanks for the update ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal errors’ is closed to new replies.