wp_create_nonce( "dbcl_security" ) ) ); } add_action( 'debug_bar_enqueue_scripts', 'dbcl_enqueue' ); /** * Ajax callback that retrieves the cache object information. */ function dbcl_ajax() { check_ajax_referer( 'dbcl_security', 'security' ); $dbcl_key = filter_input( INPUT_POST, 'dbcl_key', FILTER_SANITIZE_STRING ); $dbcl_group = filter_input( INPUT_POST, 'dbcl_group', FILTER_SANITIZE_STRING ); $cache = wp_cache_get( $dbcl_key, $dbcl_group ); if ( ! $cache ) { return wp_send_json_error(); } ob_start(); print_r( $cache ); $cache = esc_html( ob_get_clean() ); return wp_send_json_success( array( 'cache' => $cache ) ); } add_action( 'wp_ajax_dbcl', 'dbcl_ajax' );