Opened 7 months ago
Last modified 6 months ago
#61742 new defect (bug)
Ensure plugin auto updates are blocked if required WordPress version is not supported
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
Similar to #46613: In https://github.com/WordPress/wordpress-develop/commit/26869439ff6b94b103355061e8befebcf93868cd there is an implementation that checks if the required PHP version is compatible with the current PHP version while trying to do an auto-update.
We could potentially add the following code after https://github.com/WordPress/wordpress-develop/blob/e87f42252b6b09971f21fb27f3a50e1e1fdf26e4/src/wp-admin/includes/class-wp-automatic-updater.php#L293-L298 to also check for the required WordPress version:
<?php // If updating a plugin or theme, ensure the minimum PHP and WordPress version requirements are satisfied. if ( in_array( $type, array( 'plugin', 'theme' ), true ) ) { if ( ! empty( $item->requires_php ) && version_compare( PHP_VERSION, $item->requires_php, '<' ) ) { return false; } if ( ! empty( $item->requires ) && is_wp_version_compatible( $item->requires ) ) { return false; } }
We had this case from on of your plugin users that the auto update was executed but the minimum required WordPress version did not match.
Or is there a specific reason why this is not already implemented?