If you want to follow WordPress’s execution you may also want to activate the action trace logic. Using the action trace helps you to determine the sequence of action and filter calls in your WordPress site without having to resort to using a PHP debugger or other low level profiling functionality.
Use oik-bwtrace to see what’s actually happening in your WordPress server.
Debug trace for WordPress
- The primary purpose of debug trace is to help in the development of PHP code: plugins or themes.
- The primary purpose of action trace is to help you understand the sequence of events in the server.
- This plugin provides the admin interface to trace functions and action and filter tracing built into plugins that use the oik / bw APIs.
- Dependent upon the oik base plugin
Except for HTML comments, neither oik bwtrace nor oik action trace alters the output of your web pages. They write their output to a file on the server which you can browse in a separate window.
You can also use the oik trace facilities to assist in problem determination in a live site.
- Easy to code APIs: bw_trace2(), bw_backtrace() and bw_trace()
- Tracing can be enabled programmatically
- Does not require
WP_DEBUGto be defined
- Dynamically activates trace functions
- Implemented as lazy just-in-time code
- Provides contextual information
- Action trace counts help you understand the sequence of actions and filters
- Can be used during regression testing
- Traces ALL server functionality, including AJAX and other background requests
- Minimum performance overhead when tracing is not enabled
- Can be activated in
db.phpto trace code before WordPress is fully loaded
- Does not need to be activated if started programmatically or from
- Ability to choose the IP address to trace, defaults to ALL requests
- Writes summary trace record for each transaction into a daily log
- Ad-hoc tracing of user selected action hooks and filters
Trace record file
The trace record output can include:
- Fully qualified source file name
- Trace record count
- Time stamp
- Current post ID
- Number of database queries that have been performed.
- Current and peak memory usage (in bytes)
Checking the Trace ‘shutdown’ status report and log in summary file checkbox in Settings > action options will cause oik-bwtrace to record a summary record for each transaction in your server. A new file is created every day. See Daily trace summary report – bwtrace.vt.mmdd.
Use the following APIs to debug your own code
- oik-bwtrace – requirements for a standalone plugin
- An introduction to problem determination with oik-bwtrace – debug trace for WordPress
- Daily trace summary report – bwtrace.vt.mmdd
- Settings > oik trace options
- Settings > oik action options
- Debug trace dependency on the oik base plugin
- Start tracing from wp-config.php
- oik-bwtrace modifications to wp-includes/plugin.php
- Settings > oik action options – part 2
- oik-bwtrace output file – bwtrace.loh
- oik-bwtrace action and filter trace file – bwaction.loh – Deprecated
- WordPress plugins for debugging or problem determination