Files
wp-content
mu-plugins
plugins
activitypub
includes
model
peer
rest
table
class-activity-dispatcher.php
class-activitypub.php
class-admin.php
class-debug.php
class-hashtag.php
class-health-check.php
class-signature.php
functions.php
languages
templates
LICENSE
activitypub.php
readme.txt
authLdap-2.3.1
authldap
disable-wordpress-core-update
gitium
gp-premium
menu-icons
simple-local-avatars
static-html-output-plugin
wp-mail-smtp
wp-piwik
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
laipower/wp-content/plugins/activitypub/includes/class-debug.php

31 lines
734 B
PHP

<?php
namespace Activitypub;
/**
* ActivityPub Debug Class
*
* @author Matthias Pfefferle
*/
class Debug {
/**
* Initialize the class, registering WordPress hooks
*/
public static function init() {
if ( WP_DEBUG && WP_DEBUG_LOG ) {
\add_action( 'activitypub_safe_remote_post_response', array( '\Activitypub\Debug', 'log_remote_post_responses' ), 10, 4 );
}
}
public static function log_remote_post_responses( $response, $url, $body, $user_id ) {
\error_log( "Request to: {$url} with response: " . \print_r( $response, true ) );
}
public static function write_log( $log ) {
if ( \is_array( $log ) || \is_object( $log ) ) {
\error_log( \print_r( $log, true ) );
} else {
\error_log( $log );
}
}
}