PHP Class The_SEO_Framework\Debug

Holds plugin debug functions.
Since: 2.7.1
Inheritance: implements the_seo_framework\Debug_Interface
Exibir arquivo Open project: sybrew/the-seo-framework

Public Properties

Property Type Description
$the_seo_framework_debug Cached debug/profile properties.
$the_seo_framework_debug_hidden

Protected Properties

Property Type Description
$add_debug_output Whether to accumulate data.
$debug_output Enqueue the debug output.

Public Methods

Method Description
_deprecated_filter ( string $filter, string $version, string $replacement = null ) Mark a filter as deprecated and inform when it has been used.
_deprecated_function ( string $function, string $version, string $replacement = null ) Mark a function as deprecated and inform when it has been used.
_doing_it_wrong ( string $function, string $message, string $version ) Mark a function as deprecated and inform when it has been used.
_inaccessible_p_or_m ( string $p_or_m, string $message = '' ) Mark a property or method inaccessible when it has been used.
debug_init ( string $method, boolean $store, double $debug_key ) : void Debug init. Simplified way of debugging a function, only works in admin.
debug_key_wrapper ( string $key, boolean $ignore = false ) : string Wrap debug key in a colored span.
debug_output ( ) Echos debug output.
debug_screens ( ) Adds found screens in the admin footer when debugging is enabled.
debug_value_wrapper ( string $value, boolean $ignore = false ) : string Wrap debug value in a colored span.
get_debug_information ( mixed $values = null ) : string Parses input values and wraps them in human-readable elements.
get_instance ( ) : object Gets the class instance. It's set when it's null.
has_debug_output ( ) : boolean Determines if there's debug output.
output_debug ( ) Outputs the debug_output property.
output_debug_header ( ) Outputs the debug header.
output_debug_query ( ) Outputs debug query.
profile ( boolean $echo = false, boolean $from_last = false, string $what = 'time', string $key = '' ) : float Count the timings and memory usage.
set_instance ( $debug = null, $hidden = null ) Sets the class instance.

Protected Methods

Method Description
__clone ( ) Cloning of this object is forbidden.
__construct ( ) Constructor.
__wakeup ( ) Unserializing instances of this object is forbidden.
error_handler ( array $error, string $message ) Echos error.
error_handler_deprecated ( $code, $message ) The SEO Framework error handler.
error_handler_doing_it_wrong ( $code, $message ) The SEO Framework error handler.
error_handler_inaccessible_call ( $code, $message ) The SEO Framework error handler.
get_debug_header_output ( ) : string Wraps header output in front-end code.
get_debug_query_output ( ) : string Wraps query status booleans in human-readable code.
timer ( $reset = false ) : float Times code until it's called again.

Method Details

__clone() final protected method

Cloning of this object is forbidden.
final protected __clone ( )

__construct() final protected method

Constructor.
final protected __construct ( )

__wakeup() final protected method

Unserializing instances of this object is forbidden.
final protected __wakeup ( )

_deprecated_filter() public method

Mark a filter as deprecated and inform when it has been used.
Since: 2.7.1
public _deprecated_filter ( string $filter, string $version, string $replacement = null )
$filter string The function that was called.
$version string The version of WordPress that deprecated the function.
$replacement string Optional. The function that should have been called. Default null.

_deprecated_function() public method

Taken from WordPress core, but added extra parameters and linguistic alterations. The current behavior is to trigger a user error if WP_DEBUG is true.
Since: 2.6.0
public _deprecated_function ( string $function, string $version, string $replacement = null )
$function string The function that was called.
$version string The version of WordPress that deprecated the function.
$replacement string Optional. The function that should have been called. Default null.

_doing_it_wrong() public method

Taken from WordPress core, but added extra parameters and linguistic alterations. The current behavior is to trigger a user error if WP_DEBUG is true.
Since: 2.6.0
public _doing_it_wrong ( string $function, string $message, string $version )
$function string The function that was called.
$message string A message explaining what has been done incorrectly.
$version string The version of WordPress where the message was added.

_inaccessible_p_or_m() public method

The current behavior is to trigger a user error if WP_DEBUG is true.
Since: 2.7.0
public _inaccessible_p_or_m ( string $p_or_m, string $message = '' )
$p_or_m string The Property or Method.
$message string A message explaining what has been done incorrectly.

debug_init() public method

Debug init. Simplified way of debugging a function, only works in admin.
Since: 2.6.0
public debug_init ( string $method, boolean $store, double $debug_key ) : void
$method string The function name.
$store boolean Whether to store the output in cache for next run to pick up on.
$debug_key double Use $debug_key as variable, it's reserved.
return void early if debugging is disabled or when storing cache values.

debug_key_wrapper() public method

Wrap debug key in a colored span.
Since: 2.3.9
public debug_key_wrapper ( string $key, boolean $ignore = false ) : string
$key string The debug key.
$ignore boolean Ignore the hidden output.
return string

debug_output() public method

Echos debug output.
Since: 2.6.0
Since: 2.7.1 is now static.
public debug_output ( )

debug_screens() public method

Adds found screens in the admin footer when debugging is enabled.
Since: 2.5.2
public debug_screens ( )

debug_value_wrapper() public method

Wrap debug value in a colored span.
Since: 2.3.9
public debug_value_wrapper ( string $value, boolean $ignore = false ) : string
$value string The debug value.
$ignore boolean Ignore the hidden output.
return string

error_handler() protected method

Echos error.
Since: 2.6.0
protected error_handler ( array $error, string $message )
$error array The Error location and file.
$message string The error message.

error_handler_deprecated() protected method

Only handles notices.
See also: E_USER_NOTICE
Since: 2.6.0
protected error_handler_deprecated ( $code, $message )

error_handler_doing_it_wrong() protected method

Only handles notices.
See also: E_USER_NOTICE
Since: 2.6.0
protected error_handler_doing_it_wrong ( $code, $message )

error_handler_inaccessible_call() protected method

Only handles notices.
See also: E_USER_NOTICE
Since: 2.6.0
protected error_handler_inaccessible_call ( $code, $message )

get_debug_header_output() protected method

This won't consider hiding the output.
Since: 2.6.5
protected get_debug_header_output ( ) : string
return string Wrapped SEO meta tags output.

get_debug_information() public method

Parses input values and wraps them in human-readable elements.
Since: 2.6.0
public get_debug_information ( mixed $values = null ) : string
$values mixed Values to be parsed.
return string $output The parsed value.

get_debug_query_output() protected method

Wraps query status booleans in human-readable code.
Since: 2.6.6
protected get_debug_query_output ( ) : string
return string Wrapped Query State debug output.

get_instance() public static method

Gets the class instance. It's set when it's null.
Since: 2.7.1
public static get_instance ( ) : object
return object The current instance.

has_debug_output() public static method

Determines if there's debug output.
Since: 2.7.1
public static has_debug_output ( ) : boolean
return boolean True if there's output.

output_debug() public static method

Outputs the debug_output property.
Since: 2.7.1
public static output_debug ( )

output_debug_header() public static method

Outputs the debug header.
Since: 2.7.1
public static output_debug_header ( )

output_debug_query() public static method

Outputs debug query.
Since: 2.7.1
public static output_debug_query ( )

profile() public method

Memory usage fetching is unreliable, i.e. Opcode.
Since: 2.6.0
public profile ( boolean $echo = false, boolean $from_last = false, string $what = 'time', string $key = '' ) : float
$echo boolean Whether to echo the total plugin time.
$from_last boolean Whether to echo the differences from the last timing.
$what string Whether to return the time or memory.
$key string When used, it will detach the profiling separately.
return float The timer in seconds. Or memory in Bytes when $what is 'memory'.

set_instance() public static method

Sets the class instance.
Since: 2.7.1
public static set_instance ( $debug = null, $hidden = null )

timer() protected method

Times code until it's called again.
Since: 2.6.0
protected timer ( $reset = false ) : float
return float PHP Microtime for code execution.

Property Details

$add_debug_output protected_oe property

Whether to accumulate data.
Since: 2.6.5
protected $add_debug_output

$debug_output protected_oe property

Enqueue the debug output.
Since: 2.6.0
protected $debug_output

$the_seo_framework_debug public_oe property

Cached debug/profile properties.
Since: 2.7.1
public $the_seo_framework_debug

$the_seo_framework_debug_hidden public_oe property

public $the_seo_framework_debug_hidden