[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

oik_bwtrace_loaded() – Logic invoked when oik-bwtrace is loaded

You appear to be a bot. Output may be restricted

Description

Logic invoked when oik-bwtrace is loaded

oik-bwtrace can get loaded as a normal plugin, or from the _oik-bwtrace-mu plugin Since its purpose is to enable tracing of WordPress core, plugins and themes it's coded to be able to start up lazily and not expect the whole of WordPress to be up and running. Some parts of oik-bwtrace are dependent on functions in the oik base plugin. If these functions are not available then it won't do anything. For the run-time part we now make used of shared library logic, supported by the oik-lib plugin If this has been loaded before us then we can use its logic. Otherwise we have to operate in a standalone mode.

Usage

oik_bwtrace_loaded();

Parameters

Returns

void

Source

File name: oik-bwtrace/oik-bwtrace.php
Lines:

1 to 72 of 72
function oik_bwtrace_loaded() {
  /*
	 * Since this plugin is defined to load first... so that it can perform the trace reset
	 * then we need to load oik_boot ourselves... 
	 * Amongst other things we need bw_array_get() and oik_require()
	 */
  if ( !function_exists( 'oik_require' ) ) {
    // check that oik v2.6 (or higher) is available.
    $oik_boot = dirname( __FILE__ ). "/libs/oik_boot.php";
    if ( file_exists( $oik_boot ) ) { 
      require_once( $oik_boot );
    }
  }

  /* 
	 * Only carry on if "oik_require2()" exists - which indicates oik is version 1.17 or higher 
	 *
	 * It's no longer necessary to check for oik_require2 since this is the code from the already split out oik-bwtrace
	 * If oik really is backlevel then we may have a problem.
	*/
  if ( function_exists( "oik_require2" )) {
    oik_lib_fallback( dirname( __FILE__ ) . '/libs' );
    oik_require( "libs/bwtrace.php", "oik-bwtrace" );
    oik_require( "libs/bwtrace_boot.php", "oik-bwtrace" );
    oik_require( "libs/bwtrace_log.php", "oik-bwtrace" ); 
    oik_require( "includes/bwtrace.php", "oik-bwtrace" );  // Don't use require2 as this file's no longer part of oik
  }
  
  
/** 
 * Constants for bw_trace2's $level parameter
 *
 * - The trace record is produced if the $level passed is greater than or equal to the current tracing level ( $bw_trace_on );
 * - The default value for bw_trace2 is BW_TRACE_ALWAYS
 * - The higher you set the value the more tracing you get.
 * - The testing is NOT (yet) implemented as a bit-mask.
 * - Note: Most of these values are a subset of logging levels in packages such as monolog.
 * - It's not really necessary to have CRITICAL, ALERT or EMERGENCY; ERROR will suffice
 * - See also {@link https://en.wikipedia.org/wiki/Syslog#Severity_levels}
 * 
 */
  if ( !defined( 'BW_TRACE_VERBOSE' ) ) { define( 'BW_TRACE_VERBOSE', 64 ); }
  if ( !defined( 'BW_TRACE_DEBUG' ) ) { define( 'BW_TRACE_DEBUG', 32 ); }
  if ( !defined( 'BW_TRACE_INFO' ) ) { define( 'BW_TRACE_INFO', 16 ); }              // recommended level
  if ( !defined( 'BW_TRACE_NOTICE' ) ) { define( 'BW_TRACE_NOTICE', 8 ); }
  if ( !defined( 'BW_TRACE_WARNING' ) ) { define( 'BW_TRACE_WARNING', 4 ); }
  if ( !defined( 'BW_TRACE_ERROR' ) ) { define( 'BW_TRACE_ERROR', 2 ); }
  if ( !defined( 'BW_TRACE_ALWAYS' ) ) { define( 'BW_TRACE_ALWAYS', 0 ); }      // bw_trace2() default
  
  /*
	 * Invoke the start up logic if "add_action" is available
	 * 2018/01/30 - I can't see why we need this test but it probably does no harm.
	 * 
	 */ 
  if ( function_exists( "add_action" ) ) {
    bw_trace_plugin_startup();
  }
  
  /*
	 * Selected actions, such as shutdown actions are implemented in includes/oik-actions.php
	 * 
	 */
  oik_require( "includes/bwtrace-actions.php", "oik-bwtrace" );
  bw_trace_add_selected_actions();
  
  /*
	 * Add trace command for WP-CLI
	 */
  oik_bwtrace_wp_cli();
  
  oik_bwtrace_initialise_trace_summary();

}
 

 View on GitHub View on Trac

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

Information

Function name: oik_bwtrace_loaded
Plugin ref: oik-bwtrace – debug trace for WordPress
Version: 3.2.1
Sourcefile: oik-bwtrace.php
File ref: oik-bwtrace.php
Deprecated?: No
API Letters: B,L,O

Recent plugin updates

sb-chart-block v0.3.0 sb-chart-block v0.3.0 now uses Chartjs v3.1.0. It also delivers two more Colour palettes. ...
sb-chart-block v0.2.0 sb-chart-block v0.2.0 has been updated for hosting on WordPress.org. The code now uses improved color palette selection using palette.json. ...
oik-weight-zone-shipping v0.2.4 oik-weight-zone-shipping v0.2.4 contains a fix to calculate a handling fee as a percentage of the total cart cost. ...
oik-types v2.0.0 oik-types v2.0.0 contains a fix for a problem noted with Gutenberg Navigation blocks. Existing menus were being loaded in the wrong order.  ...
oik-css v1.2.0 

Upgrade to oik-css v1.2.0 for PHP 8 support. Tested with WordPress 5.7

 ...

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: [email protected]

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-2021. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins