• Resolved Nextendweb

    (@nextendweb)


    Hi @iqpascal,

    I’m the developer of Smart Slider 3. We use ob_start function like you do in your plugin. I started to collection usage of output buffering examples in different plugins and it seems like you use different method. Here you can check my collection: https://github.com/nextend/wp-ob-plugins-themes/blob/master/README.md

    As you can see all of the popular plugins use template_redirect action to start their output buffers. Using template_include instead will result plugin conflict with other plugins.

    Your original code:

    /*
     * Attempt on output buffering to protect against headers already send mistakes 
     */
    function iqblockcountry_buffer() {
    	ob_start();
    } 
    
    /*
     * Attempt on output buffering to protect against headers already send mistakes 
     */
    function iqblockcountry_buffer_flush() {
    	ob_end_flush();
    } 
    
    if (get_option('blockcountry_buffer') == "on")
    {
        add_action ( 'init', 'iqblockcountry_buffer',1);
        add_action ( 'wp_footer', 'iqblockcountry_buffer_flush');
    }

    Suggested code:

    if (get_option('blockcountry_buffer') == "on")
    {
        add_action ( 'init', 'iqblockcountry_buffer',1);
        add_action ( 'shutdown', 'iqblockcountry_buffer_flush');
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conflict with Smart Slider 3 and code improvement suggestion’ is closed to new replies.