Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/wordpres.../includes
File: class-wws-debug.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// Exit if accessed directly
[2] Fix | Delete
defined( 'ABSPATH' ) || exit;
[3] Fix | Delete
[4] Fix | Delete
class WWS_Debug {
[5] Fix | Delete
[6] Fix | Delete
public function __construct() {
[7] Fix | Delete
add_action( 'template_redirect', array( $this, 'debug' ), 20 );
[8] Fix | Delete
add_filter( 'wws_debug_report', array( $this, 'plugin_custom_report' ), 20, 1 );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Display debug output
[13] Fix | Delete
*
[14] Fix | Delete
* @return void
[15] Fix | Delete
*/
[16] Fix | Delete
public function debug() {
[17] Fix | Delete
if ( ! isset( $_GET['wws_debug'] ) ) {
[18] Fix | Delete
return false;
[19] Fix | Delete
}
[20] Fix | Delete
if ( 'yes' === get_option( 'wws_debug_status' ) ) {
[21] Fix | Delete
printf( '<pre>%s</pre>', print_r( $this->report(), true ) );
[22] Fix | Delete
exit;
[23] Fix | Delete
}
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Collect the report for the debug.
[28] Fix | Delete
*/
[29] Fix | Delete
public function report() {
[30] Fix | Delete
return apply_filters( 'wpzc_debug_report', array(
[31] Fix | Delete
'Site Information' => array(
[32] Fix | Delete
'Site URL' => site_url(),
[33] Fix | Delete
'Home URL' => home_url(),
[34] Fix | Delete
),
[35] Fix | Delete
'Server Information' => array(
[36] Fix | Delete
'PHP Version' => PHP_VERSION,
[37] Fix | Delete
'Web Server Information' => $_SERVER['SERVER_SOFTWARE'],
[38] Fix | Delete
),
[39] Fix | Delete
'Current Page Information' => array(
[40] Fix | Delete
'Page ID' => get_the_ID(),
[41] Fix | Delete
'Post Type' => get_post_type(),
[42] Fix | Delete
),
[43] Fix | Delete
'WordPress Information' => array(
[44] Fix | Delete
'Version' => get_bloginfo('version'),
[45] Fix | Delete
),
[46] Fix | Delete
'WordPress Activated Plugins' => $this->activated_plugins(),
[47] Fix | Delete
'WordPress Actions' => $this->list_of_hooks(),
[48] Fix | Delete
'Plugin Admin Options' => $this->admin_options(),
[49] Fix | Delete
) );
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
/**
[53] Fix | Delete
* List of activate plugins.
[54] Fix | Delete
*/
[55] Fix | Delete
public function activated_plugins() {
[56] Fix | Delete
if ( ! function_exists( 'get_plugins' ) ) {
[57] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
$data = array();
[61] Fix | Delete
[62] Fix | Delete
$active_plugins = get_option( 'active_plugins', array() );
[63] Fix | Delete
[64] Fix | Delete
foreach ( get_plugins() as $plugin_path => $plugin ) {
[65] Fix | Delete
// If the plugin isn't active, don't show it.
[66] Fix | Delete
if ( ! in_array( $plugin_path, $active_plugins ) )
[67] Fix | Delete
continue;
[68] Fix | Delete
$data[$plugin['Name']] = $plugin['Version'] ;
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
return $data;
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* List of active hooks.
[76] Fix | Delete
*/
[77] Fix | Delete
public function list_of_hooks() {
[78] Fix | Delete
$hooks = array();
[79] Fix | Delete
[80] Fix | Delete
foreach( $GLOBALS['wp_actions'] as $action => $count ) {
[81] Fix | Delete
$hooks[$action] = $count;
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
return $hooks;
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Plugin admin options.
[89] Fix | Delete
*/
[90] Fix | Delete
public function admin_options() {
[91] Fix | Delete
// Load install class
[92] Fix | Delete
require_once WWS_PLUGIN_PATH . 'includes/class-wws-install.php';
[93] Fix | Delete
[94] Fix | Delete
return WWS_Install::admin_options();
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
/**
[98] Fix | Delete
* Custom admin report.
[99] Fix | Delete
*
[100] Fix | Delete
* @param array $report
[101] Fix | Delete
*/
[102] Fix | Delete
public function plugin_custom_report( $report ) {
[103] Fix | Delete
$custom_report = array();
[104] Fix | Delete
return array_merge( $report, $custom_report );
[105] Fix | Delete
}
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
$wws_debug = new WWS_Debug;
[109] Fix | Delete
[110] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function