wp-config.php
file. Just before the end of the file, which is normally,
You appear to be a bot. Output may be restricted
require_once(ABSPATH . 'wp-settings.php');If we want to include bw_trace2(), bw_backtrace() or bw_trace() calls in WordPress core then we need to define the functions, so we include
libs/bwtrace.php
, assuming it’s present.
We also need to define the constants to activate tracing and action counting at config startup.
Set the values to true
to activate, false
otherwise.
Add the following code to wp-config.php
You appear to be a bot. Output may be restricted
define( 'BW_TRACE_CONFIG_STARTUP', true ); define( 'BW_TRACE_ON', true ); define( 'BW_COUNT_ON', true ); define( 'BW_TRACE_RESET', true ); if ( file_exists( ABSPATH . '/wp-content/plugins/oik-bwtrace/libs/bwtrace.php' ) ) { require_once( ABSPATH . '/wp-content/plugins/oik-bwtrace/libs/bwtrace.php' ); }
BW_TRACE_CONFIG_STARTUP
To start tracing fromwp-config.php
define the BW_TRACE_CONFIG_STARTUP
constant as true
.
You appear to be a bot. Output may be restricted
define( 'BW_TRACE_CONFIG_STARTUP', true );
BW_TRACE_ON
To activate trace logic define theBW_TRACE_ON
constant as true
.
You appear to be a bot. Output may be restricted
define( 'BW_TRACE_ON', true );
BW_COUNT_ON
To activate action counting define theBW_COUNT_ON
constant as true
.
This constant allows the db.php
drop-in file to control whether or not action counting is activated as part of the drop-in processing.
When you’re not interested in action counting this value should be false
.
You appear to be a bot. Output may be restricted
define( 'BW_COUNT_ON', false );
BW_TRACE_RESET
If we want the trace log file to be reset then we also need to defineBW_TRACE_RESET
as true
.
You appear to be a bot. Output may be restricted
define( 'BW_TRACE_RESET', false );
SAVEQUERIES
If you don’t defineSAVEQUERIES
then oik-bwtrace will enable it if required, but you may miss the first few queries. For example, the one that is performed to load the options that define tracing behaviour.
You appear to be a bot. Output may be restricted
define( 'SAVEQUERIES', true );
DISABLE_WP_CRON
There may be times when the trace output you see is for cron processing. If this is bothering you then you can disable it.You appear to be a bot. Output may be restricted
define('DISABLE_WP_CRON', 'true');