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

Debug log for users being denied access #845

Open
stevejburge opened this issue May 30, 2023 · 2 comments
Open

Debug log for users being denied access #845

stevejburge opened this issue May 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@stevejburge
Copy link
Member

stevejburge commented May 30, 2023

From a customer who is trying to set up a user account, but that user is being denied access

Can I log the permissions/decision tree around the rejection message in Capabilities? This could help us solve it a lot more quickly than trial and error.

From Kevin:

It is possible to debug this part of WordPress. You can temporarily replace part of the class-wp-user.php file
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-user.php#L820
​​
Replace​ the section around line 820 with this:
https://gist.github.com/stevejburge/c10e08fb71bb3642cdb71fc75cbd9f3e​​​

This will output to the PHP error log

Could we output something into the UI of Capabilities?

@olatechpro
Copy link
Collaborator

I'm not sure this is feasible. During our discussion in slack on extractor, everybody agreed we cannot use debug_backtrace() in our development code.

Apart from that, this is better been a snippet for customer because they can simply tailor it to the capability they're targettng than us enabling it for capabilities which will easily kill their server due to debug_backtrace() content been very long and doing the check that's not tailored to the capability been debugged where user reload the page once and then check their error log will be too expensive @stevejburge

@stevejburge
Copy link
Member Author

OK, thanks @olatechpro. Let's leave this one open as an idea. Maybe a good solution will appear in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants