-
Notifications
You must be signed in to change notification settings - Fork 56
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 addon checks not being executed when running runtime checks #751
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Wanna rebase to make that more clear? |
Yes, I just had this open against Here you can see the Behat tests passing with the latest state of this PR, including all the ones that used to be commented out: https://github.com/WordPress/plugin-check/actions/runs/11525465349 |
# """ | ||
And STDOUT should contain: | ||
""" | ||
ExampleRuntimeCheck.ForbiddenScript,WARNING |
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.
Nice!
This is a child PR of #749. Please merge that one first.
Fixes #607.
As noted prior, despite our various fixes related to e.g. #597, addon runtime checks still don't work as of today. This PR aims to fix that.
It looks like the underlying problem is that the
Default_Check_Repository
runs thewp_plugin_check_checks
filter too early when any runtime checks are being run. Now that I noticed it, it seems like an obvious oversight, but was kind of hard to spot 😅To address this problem, we simply need to ensure the filter is run again after plugins have been loaded.
For the scenario where the
Default_Check_Repository
is instantiated when plugins are already loaded, no change is needed, in this case we can set a flag that the checks are "fully initialized" from the start.