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
Fix fatal error introduced in #449 #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @swissspidy. Overall this looks good to me, though I'm not sure I like the idea of the caller of the Plugin_Context
class constructor having to take care of the normalization.
On the one hand, it makes sense from a separation of concerns perspective, because it works differently for WP core and WP-CLI. On the other hand, it would be great to implement this internally in the class.
Maybe we could go with a pragmatic approach within the Plugin_Context
constructor? If wp_normalize_path()
exists, use that, otherwise if we're in CLI and the WP-CLI method exists, use that, otherwise do nothing - or maybe even throw an exception cause this should never happen? WDYT?
IDK, don't have a strong opinion. We can keep doing it in the constructor, but throwing an exception seems overkill. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation WFM, though I do think being strict here is safer than silently letting a problematic configuration continue. Not a big deal either way, so my feedback is just nit-picks.
Note that there are some lint failures due to the CLI function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @swissspidy for the PR! Left some feedbacks.
What if we provide polyfill function for |
I think a polyfill for an edge case that should never ever happen is overkill. Here it‘s only not available because of the hacky object-cache.php drop-in |
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Introduced in #449
Reported in WordPress/plugin-check-action#68
To reproduce:
cc @ernilambar