dd-trace-php
dd-trace-php copied to clipboard
Add WordPress widget name as the resource
Description
Reworks the widgets section of the WordPress integration:
- Drops
WP_Widget::display_callbackand instead trace overrides of theWP_Widget::widgetmethod, and use theWP_Widget::$nameas the resource. - Drops
WP_Widget_Factory::_register_widgetsfor its parent callwp_widgets_init. This is a minor change.
Here's what it looked like before:

And after:

It's much easier to see the widget responsible for the queries now.
Readiness checklist
- [ ] Changelog has been added to the release document.
- [ ] Tests added for this feature/bug.
Reviewer checklist
- [x] Appropriate labels assigned.
- [x] Milestone is set.