: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
public function __construct() {
add_action( 'template_redirect', array( $this, 'debug' ), 20 );
add_filter( 'wws_debug_report', array( $this, 'plugin_custom_report' ), 20, 1 );
public function debug() {
if ( ! isset( $_GET['wws_debug'] ) ) {
if ( 'yes' === get_option( 'wws_debug_status' ) ) {
printf( '<pre>%s</pre>', print_r( $this->report(), true ) );
* Collect the report for the debug.
public function report() {
return apply_filters( 'wpzc_debug_report', array(
'Site Information' => array(
'Site URL' => site_url(),
'Home URL' => home_url(),
'Server Information' => array(
'PHP Version' => PHP_VERSION,
'Web Server Information' => $_SERVER['SERVER_SOFTWARE'],
'Current Page Information' => array(
'Page ID' => get_the_ID(),
'Post Type' => get_post_type(),
'WordPress Information' => array(
'Version' => get_bloginfo('version'),
'WordPress Activated Plugins' => $this->activated_plugins(),
'WordPress Actions' => $this->list_of_hooks(),
'Plugin Admin Options' => $this->admin_options(),
* List of activate plugins.
public function activated_plugins() {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
$active_plugins = get_option( 'active_plugins', array() );
foreach ( get_plugins() as $plugin_path => $plugin ) {
// If the plugin isn't active, don't show it.
if ( ! in_array( $plugin_path, $active_plugins ) )
$data[$plugin['Name']] = $plugin['Version'] ;
public function list_of_hooks() {
foreach( $GLOBALS['wp_actions'] as $action => $count ) {
$hooks[$action] = $count;
public function admin_options() {
require_once WWS_PLUGIN_PATH . 'includes/class-wws-install.php';
return WWS_Install::admin_options();
public function plugin_custom_report( $report ) {
$custom_report = array();
return array_merge( $report, $custom_report );
$wws_debug = new WWS_Debug;