[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_trace_output_buffer() – Trace anything left in the output buffer(s)

You appear to be a bot. Output may be restricted

Description

Trace anything left in the output buffer(s)

We need to test if there is anything in the output buffer before calling ob_get_flush() otherwise it produces a Notice that can get returned to a client. Calling ob_get_status() appears to help in this regard. Note: We don't cater for multiple output buffers. Artisteer 4.0 saves information in $theme_ob_stack, so we trace that in case it contains Warnings or Fatal messages. When zlib.output_compression is on then ob_get_status() may return an array like the following. ` Array [name] => (string) "zlib output compression" [type] => (integer) 0 [flags] => (integer) 20512 [level] => (integer) 1 [chunk_size] => (integer) 16384 [buffer_size] => (integer) 20480 [buffer_used] => (integer) 3935 ` In this case should not try to call ob_get_flush() because we get another Notice, due to output handler incompatibilities. As a workaround we first check if zlib.output_compression is set in the php.ini file

Usage

bw_trace_output_buffer();

Parameters

Returns

void

Source

File name: oik-bwtrace/includes/oik-actions.php
Lines:
1 to 23 of 23
function bw_trace_output_buffer() {
  if ( ini_get( 'zlib.output_compression') ) {
    return;
  }
  //$ob = ob_get_contents();
  $status = ob_get_status();
  
  bw_trace2( $status, "output buffer status", false );
  if ( count( $status ) ) {
    $ob = ob_get_flush();
    bw_trace2( $ob, "output buffer", false );
    if ( defined( "WP_DEBUG") && WP_DEBUG ) {
      //echo "output buffer";
      //print_r( $ob );
    }
  }    
  global $theme_ob_stack;
  bw_trace2( $theme_ob_stack, "theme_ob_stack", false );
  if ( defined( "WP_DEBUG") && WP_DEBUG ) {
    //echo "theme_ob_stack";
    //print_r( $theme_ob_stack );
  }  
}
 
 View on GitHub View on Trac

Published: November 1, 2016 | Last updated: November 1, 2016

Information

Function name: bw_trace_output_buffer
Plugin ref: oik-bwtrace – debug trace for WordPress
Version: 3.4.1
Sourcefile: includes/oik-actions.php
File ref: includes/oik-actions.php
Deprecated?: No
API Letters:

Recent plugin updates

oik v4.9.2 Upgrade to oik v4.9.2 for support for PHP 8.1 and PHP 8.2. ...
oik-block v0.3.0 oik-block v0.3.0 no longer displays the Editor selection meta box ...
oik-blocks v1.4.3 Upgrade to oik-blocks v1.4.3 for PHP 8.2 support. ...
cookie-cat v1.4.6 Upgrade to cookie-cat v1.4.6 for PHP 8.1 & PHP 8.2 support. ...
oik-fields v1.54.0 oik-fields v1.54.0 caters for the deprecation of get_page_by_title() in WordPress 6.2. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: herb@bobbingwide.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.3.1. PHP: 7.4.33. Memory limit: 768M