{eac}Doojigger Reference

debugging_extension extends abstract_extension

Extension: debugging - file logging & debugging - {eac}Doojigger for WordPress

Tags
category

WordPress Plugin

author

Kevin Burkholder KBurkholder@EarthAsylum.com

copyright

Copyright (c) 2024 EarthAsylum Consulting <www.EarthAsylum.com>

link
https://eacDoojigger.earthasylum.com/
see
https://eacDoojigger.earthasylum.com/phpdoc/

Table of Contents

ALIAS  = null
ALLOW_ADMIN  = 0b1
ALLOW_ALL  = self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI
ALLOW_CLI  = 0b10000
ALLOW_CRON  = 0b1000
ALLOW_NETWORK  = 0b100
ALLOW_NON_PHP  = 0b1000000
DEFAULT_DISABLED  = 0b100000
ONLY_ADMIN  = 0b10
VERSION  = '24.0830.1'
__call()  : mixed
magic method to call plugin or extension methods
__construct()  : void
constructor method
__destruct()  : void
Extension destructor
__get()  : mixed
magic method to call parent plugin __get()
addActionsAndFilters()  : void
Add filters and actions - called from main plugin
addShortcodes()  : void
Add extension shortcodes
admin_options_help()  : void
Add help tab on admin page
admin_options_settings()  : void
register options on options_settings_page
capture_deprecated_wrong()  : void
capture wp 'deprecated' & 'doing_it_wrong' errors
capture_heartbeat()  : array<string|int, mixed>
capture wp 'heartbeat'
capture_wp_error()  : void
capture wp errors when a new error is added - wp_error_added hook
clean_filepath()  : void
strip leading directory from file
debug_debugging()  : array<string|int, mixed>
Get the debugging array for our own filter
debug_logdata()  : array<string|int, mixed>
Get the debugging log array
file_log_data()  : bool
Write to the log file.
getAlias()  : const
get the extension alias
getClassName()  : bool
getClassName - get the class/extension name without namespace
getVersion()  : const
get the extension version
initialize()  : void
initialize method - called from main plugin
install_actiontimer()  : string
install/uninstall actiontimer
is_network_enabled()  : bool
is_network_enabled - set or test extension enabled for use at the network level
is_network_option()  : bool|mixed
is this class network enabled and does option match a value
isEnabled()  : bool
isEnabled - set or test extension enabled for use
logClose()  : void
Finish and close the log.
options_form_post_wp_debugging()  : mixed
filter for options_form_post_wp_debugging
page_debugging_help()  : string
filter for current_screen, help screen
page_debugging_output()  : string
filter for wp_footer, admin_footer
page_log_data()  : bool
save data to output on page footer
phpErrorHandler()  : void
Handle PHP errors
print_backtrace()  : void
print_backtrace like wp_debug_backtrace_summary
purge_logs()  : void
purge old log files - (never runs for network_admin)
requestURL()  : void
Log request server values
showErrorReporting()  : array<string|int, mixed>|string
show error reporting strings

Constants

ALLOW_ALL

public mixed ALLOW_ALL = self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI

Methods

__call()

magic method to call plugin or extension methods

public __call(mixed $method, mixed $arguments) : mixed
Parameters
$method : mixed

the method name or [extension,method]

$arguments : mixed

the arguments to method name

Return values
mixed

result of method called

__construct()

constructor method

public __construct(object $plugin) : void
Parameters
$plugin : object

main plugin object

Return values
void

__get()

magic method to call parent plugin __get()

public __get(string $property) : mixed
Parameters
$property : string

the property name or extension name

Return values
mixed

result of plugin __get()

addActionsAndFilters()

Add filters and actions - called from main plugin

public addActionsAndFilters() : void
Return values
void

addShortcodes()

Add extension shortcodes

public addShortcodes() : void

Called after loading, instantiating, and initializing all extensions

Return values
void

admin_options_settings()

register options on options_settings_page

public admin_options_settings() : void
Tags
access

public

Return values
void

capture_deprecated_wrong()

capture wp 'deprecated' & 'doing_it_wrong' errors

public capture_deprecated_wrong( ...$args) : void
Parameters
$args :

arguments vary by hook being captured

Return values
void

capture_heartbeat()

capture wp 'heartbeat'

public capture_heartbeat(array<string|int, mixed> $response, array<string|int, mixed> $data, string $screen_id) : array<string|int, mixed>
Parameters
$response : array<string|int, mixed>

response data set by filters

$data : array<string|int, mixed>

request data set by browser

$screen_id : string

wp screen id

Return values
array<string|int, mixed>

$response

capture_wp_error()

capture wp errors when a new error is added - wp_error_added hook

public capture_wp_error(string $code, string $message, mixed $data, object $wp_error) : void
Parameters
$code : string

wp_error code

$message : string

wp_error message

$data : mixed

wp_error data

$wp_error : object

wp_error object

Return values
void

clean_filepath()

strip leading directory from file

public clean_filepath(mixed $file) : void
Parameters
$file : mixed
Return values
void

debug_debugging()

Get the debugging array for our own filter

public debug_debugging(mixed $debugging_array) : array<string|int, mixed>
Parameters
$debugging_array : mixed
Return values
array<string|int, mixed>

extended array with [ extension_name => [key=>value array] ]

debug_logdata()

Get the debugging log array

public debug_logdata() : array<string|int, mixed>
Return values
array<string|int, mixed>

array with [ 'LogData' => log entries ]

file_log_data()

Write to the log file.

public file_log_data(array<string|int, mixed> $data) : bool

we don't actually "write" anything but prep the string and add it to the text string.

Parameters
$data : array<string|int, mixed>
Return values
bool

getClassName()

getClassName - get the class/extension name without namespace

public getClassName([object $class = null ]) : bool
Parameters
$class : object = null

optional class object

Return values
bool

getVersion()

get the extension version

public getVersion() : const
Return values
const

VERSION string

install_actiontimer()

install/uninstall actiontimer

public install_actiontimer( $action) : string
Parameters
$action :

button value ('Install' | 'Uninstall')

Return values
string

$action

is_network_enabled()

is_network_enabled - set or test extension enabled for use at the network level

public is_network_enabled() : bool
Return values
bool

is_network_option()

is this class network enabled and does option match a value

public is_network_option(string $optionName[, mixed $value = null ]) : bool|mixed
Parameters
$optionName : string

option name

$value : mixed = null

check this value

Return values
bool|mixed

option is set and has value

isEnabled()

isEnabled - set or test extension enabled for use

public isEnabled([bool|string $enabled = null ][, bool $perm = null ]) : bool
Parameters
$enabled : bool|string = null

true|false or other extension name

$perm : bool = null

optional, to permanently set enabled option

Return values
bool

logClose()

Finish and close the log.

public logClose() : void

now we write the data to the file and clean-up.

Return values
void

options_form_post_wp_debugging()

filter for options_form_post_wp_debugging

public options_form_post_wp_debugging(mixed $value, string $fieldName, array<string|int, mixed> $metaData, mixed $priorValue) : mixed
Parameters
$value : mixed
  • the value POSTed
$fieldName : string
  • the name of the field/option
$metaData : array<string|int, mixed>
  • the option metadata
$priorValue : mixed
  • the previous value
Return values
mixed

$value

page_debugging_help()

filter for current_screen, help screen

public page_debugging_help([object $screen = null ]) : string
Parameters
$screen : object = null

current_screen

Return values
string

page_debugging_output()

filter for wp_footer, admin_footer

public page_debugging_output() : string
Return values
string

page_log_data()

save data to output on page footer

public page_log_data(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Return values
bool

phpErrorHandler()

Handle PHP errors

public phpErrorHandler(int|object $exception) : void
Parameters
$exception : int|object
  • exception or error type
Return values
void

print_backtrace()

print_backtrace like wp_debug_backtrace_summary

public print_backtrace(mixed $trace[, mixed $error = '' ]) : void
Parameters
$trace : mixed
$error : mixed = ''
Return values
void

purge_logs()

purge old log files - (never runs for network_admin)

public purge_logs([mixed $asNetAdmin = false ]) : void
Parameters
$asNetAdmin : mixed = false
Return values
void

showErrorReporting()

show error reporting strings

public showErrorReporting(int $errReporting[, bool $asArray = false ]) : array<string|int, mixed>|string
Parameters
$errReporting : int

or error_reporting()

$asArray : bool = false

return array (else string)

Return values
array<string|int, mixed>|string

Search results