Output buffer problem | WordPress.org

[ad_1]

Hi @ecwid_team,
I would like to report an issue which cause other plugins to break. The problem is that you are missing to use ob_start() in one place which cause your code to close output buffer which is not started by your plugin.

The missing place is ecwid-shopping-cart.php -> ecwid_get_product_browser_url_script() function. Here is the fixed version of this function:

function ecwid_get_product_browser_url_script()
{
	if ( get_option('ecwid_disable_pb_url' ) ) {
		return;
	}

	$str = '';
	if (ecwid_is_store_page_available() && !Ecwid_Store_Page::is_store_page()) {

		$url = esc_js( Ecwid_Store_Page::get_store_url() );

        ob_start();
        ?>
        <script data-cfasync="false" type="text/javascript">
            window.ec = window.ec || Object();
            window.ec.config = window.ec.config || Object();
            window.ec.config.store_main_page_url = '<?php echo esc_js( $url ); ?>';
        </script>
        <?php 
        $str = ob_get_clean();
	}

	return $str;

}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer