Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions log-http-requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function __construct() {
add_action( 'init', [ $this, 'init' ] );
add_action( 'admin_menu', [ $this, 'admin_menu' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'admin_scripts' ] );
add_filter( 'plugin_action_links_' . LHR_BASENAME, [ $this, 'plugins_page_link' ] );
add_filter( 'http_request_args', [ $this, 'start_timer' ] );
add_action( 'http_api_debug', [ $this, 'capture_request' ], 10, 5 );
add_action( 'lhr_cleanup_cron', [ $this, 'cleanup' ] );
Expand Down Expand Up @@ -100,6 +101,12 @@ function admin_scripts( $hook ) {
}


function plugins_page_link( $action_links ) {
$settings_page_url = admin_url( "tools.php?page=log-http-requests" );
array_unshift( $action_links, '<a href="' . esc_url( $settings_page_url ) . '">' . __( 'View Requests Log', 'log-http-requests' ) . '</a>' );
return $action_links;
}

function lhr_query() {
check_ajax_referer( 'lhr_nonce' );

Expand Down