Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI functionality for filtering specific plugins and themes #211

Open
XVII opened this issue Oct 10, 2024 · 6 comments
Open

Add UI functionality for filtering specific plugins and themes #211

XVII opened this issue Oct 10, 2024 · 6 comments
Labels
✨ new-feature The new and the shiny! 👋 help wanted We could use some help with this one!

Comments

@XVII
Copy link

XVII commented Oct 10, 2024

wp_sentry_before_send does a great job at filtering based on any custom situation, it may be more "friendly" to provide a UI to allow certain plugins to be included/excluded, then based on severity?

This would kind of be like setting logging levels, used in other languages, on a per-namespace basis (in this case core/plugin/theme) to more easily tune what goes to Sentry. It would basically help automate the "Check the the frame happened inside a theme or plugin" part of the doco.

For example:

Area Error Warn Info Debug Notice
Core
Plugins
Themes
Plugin X
Plugin Y
Theme Z

An additional filter that might be useful would be:

Area Error Warn Info Debug Notice
Public / anonymous users
Logged in Users
Users by Role

This obviously could be implemented in code, but a UI would help improve the "friendliness" of such configurations.

@stayallive
Copy link
Owner

The usual problem with any UI setting is that WordPress only has provisions to store it in the database which is available pretty late so the settings take some time to take effect reducing their usefulness.

I can agree it might be useful to be able to ignore some especially noisy plugins from time to time but not sure the UI is the way to go here. There is a reason no setting to date is configured using the UI.

@XVII
Copy link
Author

XVII commented Oct 10, 2024

Ah yeh, good point. I forget it needs to run ASAP.

Maybe the UI can be a visual representation of what's happening? Similar to the other checkboxes that are disabled, and point people to Documentation on how to "change" it.

I'm unsure of the best data structure assuming it needs to be implemented in PHP, but something along the lines of an object/array with plugin/theme "folder name" by "error type" would help me squash a lot of noise.

@stayallive
Copy link
Owner

That is of course always an option (showing it in the UI) but that can also grow to a massive table.

As for how to configure, we might get away with simply doing:

define('SENTRY_PLUGIN_LOG_LEVEL', [
	'some/plugin'  => null,    // drop everything
    'other/plugin' => 'error', // only "error" level and above
]);

Unsure what "level" config makes sense here but something like this could work possibly. 

@XVII
Copy link
Author

XVII commented Oct 14, 2024

Yeh I like that, seems simple enough.

That pattern would work well for other types too, i.e. Themes, or even User Roles.

@stayallive
Copy link
Owner

Yes, although at some point the wp_sentry_before_send hook is going to be preffered instead of me maintaining all sorts of filtering code 🫣

I do however think that muting certain messages from plugins is certainly helpful, I have a few instances where I'd like to remove notices from some plugins a bit easier to lower the noise.

@stayallive stayallive added 👋 help wanted We could use some help with this one! ✨ new-feature The new and the shiny! labels Oct 15, 2024
@XVII
Copy link
Author

XVII commented Oct 15, 2024

You'll have the best code though 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ new-feature The new and the shiny! 👋 help wanted We could use some help with this one!
Projects
None yet
Development

No branches or pull requests

2 participants