Coder Social home page Coder Social logo

log-http-requests's Introduction

=== Log HTTP Requests ===
Contributors: mgibbs189
Tags: log, wp_http, requests, update checks, api
Requires at least: 5.0
Tested up to: 6.2.2
Stable tag: trunk
License: GPLv2

Log and view all WP HTTP requests

== Description ==

= Log and view all WP HTTP requests =

How long do [core / plugin / theme] update checks take to run? What data about my site is being sent out? What about all those ajax requests? The answers to these questions are just a few clicks away.

This plugin logs all WP_HTTP requests and displays them in a table listing for easy viewing. It also stores the runtime of each HTTP request.

= Available Hooks =
Customize the length (in days) before older log items are removed:

<pre>
add_filter( 'lhr_expiration_days', function( $days ) {
    return 7; // default = 1
});
</pre>

Don't log items from a specific hostname:

<pre>
add_filter( 'lhr_log_data', function( $data ) {
    if ( false !== strpos( $data['url'], 'wordpress.org' ) ) {
        return false;
    }
    return $data;
});
</pre>

In the above example, the `$data` array keys correspond to columns within the `lhr_log` database table.

= Important Links =
* [Github โ†’](https://github.com/FacetWP/log-http-requests)

== Installation ==

1. Download and activate the plugin.
2. Browse to `Tools > Log HTTP Requests` to view log entries.

== Changelog ==

= 1.4.1
* Fixed PHP8 deprecation notices

= 1.4 =
* Added extra ajax role validation (props pluginvulnerabilities.com)

= 1.3.2 =
* Escaped URL field to prevent possible XSS (props Bishop Fox)

= 1.3.1 =
* Ensured compatibility with WP 5.8

= 1.3 =
* Minor PHP cleanup
* Ensured compatibility with WP 5.7

= 1.2 =
* Moved "Log HTTP Requests" to the `Tools` menu (props @aaemnnosttv)
* Added "Status" column to show HTTP response code (props @danielbachhuber)
* Added prev/next browsing to the detail modal (props @marcissimus)
* Added keyboard support (up, down, esc) to the detail modal (props @marcissimus)
* Added raw timestamp to "Date Added" column on hover
* Added hook docs to the readme

= 1.1 =
* Added `lhr_log_data` hook to customize logged data (return FALSE to skip logging)
* Added `lhr_expiration_days` hook

= 1.0.4 =
* Minor styling tweak

= 1.0.3 =
* Better visibility for long URLs

= 1.0.2 =
* Minor design tweaks
* Replaced `json_encode` with `wp_send_json`

= 1.0.1 =
* Tested compatibility against WP 4.9.4

= 1.0.0 =
* Initial release

log-http-requests's People

Contributors

aaemnnosttv avatar danielbachhuber avatar mgibbs189 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

log-http-requests's Issues

Request: Add navigation to details modal

It would be nice if the user could click forward/backwards from the details view to go to the next/previous item in the log (similar to the attachment details modal).

As part of this, the request URL would need to be added to the modal as well (something I feel would be a good addition even now), but that's the easy part ๐Ÿ˜„

Let me know if you'd be open to a PR for this.

Dont limit the URL field width

Hi,

thanks for the very helpful plugin!

Could you please remove the 400px width limitation from the ".widefat .field-url div" field?
Thanks!

2018-05-29_11h39_43

Request: A switch to pause logging

I'd like to be able to stop logging but still be able to browse what has already been logged.

i.e. once I get a full day's logs, I don't really need to gather more data, but I still need to be able to see what was recorded.

Better yet if there is a "stop logging in x hours" option!

Configure cleanup() period

I'm using Log HTTP Requests to debug production interactions with a 3rd party API.

Because I'm not able to review the logs every day, it would be useful if I could change the cleanup period from -1 days to a week or so.

Something you'd be open to a pull request for?

Deprecation notices: PHP 8.2 compatibility

I've got these 2 Deprecation messaging in my error_log:

Creation of dynamic property LHR_Upgrade::$version is deprecated
Stacktrace:
wp-content/plugins/log-http-requests/includes/class-upgrade.php:6
LHR_Upgrade->__construct()
wp-content/plugins/log-http-requests/log-http-requests.php:65
Log_HTTP_Requests->init()
wp-includes/class-wp-hook.php:308
do_action('init')
wp-settings.php:623
Screenshot image

And the second one:

Creation of dynamic property LHR_Upgrade::$last_version is deprecated

Stracktrace:
wp-content/plugins/log-http-requests/includes/class-upgrade.php:7
LHR_Upgrade->__construct()
wp-content/plugins/log-http-requests/log-http-requests.php:65
Log_HTTP_Requests->init()
wp-includes/class-wp-hook.php:308
do_action('init')
wp-settings.php:623
Screenshot image

Potential fix:

https://php.watch/versions/8.2/dynamic-properties-deprecated#exempt
#[AllowDynamicProperties]

Suggestion: Add menu page under Tools

Currently the plugin adds its admin view under the general Settings admin menu.

I think it may be a bit more intuitive for users to find this under the Tools menu, particularly because it has no settings ๐Ÿ˜„

I'm happy to send a PR for this if you're open to the idea. Thanks for the plugin!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.