#46613 closed defect (bug) (fixed)
Ensure plugin auto updates are blocked if required PHP version is not supported
Reported by: | TimothyBlynJacobs | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Site Health | Keywords: | servehappy has-patch commit |
Focuses: | Cc: |
Description
In #43987 and #44350 plugin updates were blocked from the UI if the PHP requirements were not met. This should be extended to prevent an auto update from skipping this check and being installed automatically.
I think doing the same requires_php
checks from the UI in WP_Automatic_Updater::should_update()
would work.
Attachments (4)
Change History (15)
#5
in reply to:
↑ 4
@
6 years ago
Replying to afragen:
If this is the correct place for the test can we reverse the
version_compare
So we don’t need!
.
Another advantage of having a function handle this.
@afragen Good point. Whether or not the placement is correct, I've updated the patch for code brevity.
If it needs to be moved elsewhere, let me know.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
6 years ago
#8
@
6 years ago
46613.4.diff updates the version compare to not include =
. If the version returned by phpinfo()
is exactly the same as the required minimum version, then the update should be allowed.
Also, I have reversed the comparison so that the local version is listed first in the comparison. This matches the two other version_compare()
calls above making it a little harder to get tripped up.
If this is the correct place for the test can we reverse the
version_compare
So we don’t need!
.Another advantage of having a function handle this. 😉