Giter Site home page Giter Site logo

pierre-lannoy / wp-traffic Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 4.54 MB

Full featured monitoring & analytics for WordPress APIs.

Home Page: https://perfops.one/

License: GNU General Public License v3.0

PHP 37.34% CSS 3.05% JavaScript 59.62%
analytics reporting wordpress wordpress-api wordpress-plugin

wp-traffic's People

Contributors

pierre-lannoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wprobot

wp-traffic's Issues

Class “Traffic\Plugin\Feature\Memory“ not found

Describe the bug
Thanks to Decalog, we've caught a bunch of Class “Traffic\Plugin\Feature\Memory“ not found from the event log.

Warning: Outbound API record: Class “Traffic\Plugin\Feature\Memory“ not found
Warning: Inbound API record: Class “Traffic\Plugin\Feature\Memory“ not found

Expected behavior
We didn't expect the plugin to throw errors.

Screenshots

# Site Backend
0  do_action(`admin_init`)
       ./wp-admin/admin.php:175
1  WP_Hook->do_action(Array)
       ./wp-includes/plugin.php:517
2  WP_Hook->apply_filters(``, Array)
       ./wp-includes/class-wp-hook.php:332
3  _maybe_update_themes(``)
       ./wp-includes/class-wp-hook.php:308
4  wp_update_themes()
       ./wp-includes/update.php:1041
5  wp_remote_post(`https://api.wordpress.org/themes/update-check/1.1/`, Array)
       ./wp-includes/update.php:719
6  WP_Http->post(`https://api.wordpress.org/themes/update-check/1.1/`, Array)
       ./wp-includes/http.php:179
7  WP_Http->request(`https://api.wordpress.org/themes/update-check/1.1/`, Array)
       ./wp-includes/class-wp-http.php:616
8  do_action(`http_api_debug`, Array, `response`, `WpOrg\Requests\Requests`, Array, `https://api.wordpress.org/themes/update-check/1.1/`)
       ./wp-includes/class-wp-http.php:421
9  WP_Hook->do_action(Array)
       ./wp-includes/plugin.php:517
10  WP_Hook->apply_filters(``, Array)
       ./wp-includes/class-wp-hook.php:332
# Rest API Request
0  require(`/var/www/blog/wp-blog-header.php`)
       ./index.php:17
1  wp()
       ./wp-blog-header.php:16
2  WP->main(``)
       ./wp-includes/functions.php:1334
3  WP->parse_request(``)
       ./wp-includes/class-wp.php:780
4  do_action_ref_array(`parse_request`, Array)
       ./wp-includes/class-wp.php:399
5  WP_Hook->do_action(Array)
       ./wp-includes/plugin.php:565
6  WP_Hook->apply_filters(``, Array)
       ./wp-includes/class-wp-hook.php:332
7  rest_api_loaded(WP)
       ./wp-includes/class-wp-hook.php:308
8  WP_REST_Server->serve_request(`/manage/v1/whoami`)
       ./wp-includes/rest-api.php:410
9  apply_filters(`rest_pre_echo_response`, Array, WP_REST_Server, WP_REST_Request)
       ./wp-includes/rest-api/class-wp-rest-server.php:517
10  WP_Hook->apply_filters(Array, Array)
       ./wp-includes/plugin.php:205

Environment (please complete the following information):

  • PHP version: 8.1.15
  • WordPress version: 6.2
  • Other info: Decalog event

Fatal error with NFS

Describe the bug
When WordPress (more exactly, the wp-content/plugin directory) is mounted from a remote NFS drive, FlockMutex will fail to get the file lock, resulting in uncaught exceptions.

To Reproduce
Steps to reproduce the behavior:

  1. Use NFS for wp-content/plugin.
  2. Enable Decalog and Traffic.
  3. Run wp log tail.

Expected behavior
This should work...

Screenshots

Fatal error: Uncaught malkusch\lock\exception\LockAcquireException: Failed to lock the file. in /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/FlockMutex.php:142
Stack trace:
#0 /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/FlockMutex.php(123): malkusch\lock\mutex\FlockMutex->acquireNonBlockingLock()
#1 /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/util/Loop.php(99): malkusch\lock\mutex\FlockMutex->malkusch\lock\mutex\{closure}()
#2 /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/FlockMutex.php(126): malkusch\lock\util\Loop->execute(Object(Closure))
#3 /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/FlockMutex.php(164): malkusch\lock\mutex\FlockMutex->lockBusy()
#4 /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/LockMutex.php(43): malkusch\lock\mutex\FlockMutex->lock()
#5 /mnt/wordpress/wp-content/plugins/traffic/includes/features/class-memory.php(171): malkusch\lock\mutex\LockMutex->synchronized(Object(Closure))
#6 /mnt/wordpress/wp-content/plugins/traffic/includes/features/class-memory.php(114): Traffic\Plugin\Feature\Memory::write_records_to_memory()
#7 /mnt/wordpress/wp-includes/class-wp-hook.php(306): Traffic\Plugin\Feature\Memory::write()
#8 /mnt/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#9 /mnt/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#10 /mnt/wordpress/wp-includes/load.php(1144): do_action('shutdown')
#11 [internal function]: shutdown_action_hook()
#12 {main}
  thrown in /mnt/wordpress/wp-content/plugins/decalog/includes/libraries/lock/mutex/FlockMutex.php on line 142

Environment (please complete the following information):

  • PHP version: 8.1.17
  • WordPress 6.2
  • Other info: Decalog / NFS

Additional context
flock on NFS requires writing permission. Change r to w should help.

Implement tracing compatibility with Decalog

Is your feature request related to a problem? Please describe.
It would be useful for performance and debugging purposes to record API calls into trace spans produced by decalog (in a similar way to database calls are implemented)

Describe the solution you'd like
WP-Traffic integrated into the tracing component of decalog (ie. user makes request to page, Wordpress has an outgoing API call needed to service that request - request would be logged in the trace span and pushed to jaeger).

Describe alternatives you've considered
Simply analysing the logs in WP-Traffic (this misses other context, like DB calls produced alongside, along with potentially other trace data that is unified with the Decalog data (ie. traces produced by NGINX or other API services) allows us to see the entire request flow (and ideally where slowdowns or issues may occur)

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.