mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Plugins: Block plugin updates if required PHP version is not supported.
When a plugin states it requires a specific minimum PHP version (as defined in the `requires_php` field included in the plugin update API response), a user should not be allowed to update that plugin when the server does not satisfy the minimum PHP version. When this scenario is encountered, the update buttons and links are disabled and links to educational resources about PHP are displayed to the user with a notice. Props afragen, schlessera, desrosj. Fixes #43987. git-svn-id: https://develop.svn.wordpress.org/trunk@44937 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -769,8 +769,8 @@ function install_plugin_information() {
|
||||
' ' . __( '<a href="%s" target="_blank">Click here to learn more about updating PHP</a>.' ),
|
||||
esc_url( wp_get_update_php_url() )
|
||||
);
|
||||
echo '</p>';
|
||||
wp_update_php_annotation();
|
||||
|
||||
wp_update_php_annotation( '</p><p><em>', '</em>' );
|
||||
} else {
|
||||
echo '</p>';
|
||||
}
|
||||
@@ -827,7 +827,14 @@ function install_plugin_information() {
|
||||
break;
|
||||
case 'update_available':
|
||||
if ( $status['url'] ) {
|
||||
echo '<a data-slug="' . esc_attr( $api->slug ) . '" data-plugin="' . esc_attr( $status['file'] ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>';
|
||||
if ( $compatible_php ) {
|
||||
echo '<a data-slug="' . esc_attr( $api->slug ) . '" data-plugin="' . esc_attr( $status['file'] ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>';
|
||||
} else {
|
||||
printf(
|
||||
'<button type="button" class="button button-primary button-disabled right" disabled="disabled">%s</button>',
|
||||
_x( 'Cannot Update', 'plugin' )
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'newer_installed':
|
||||
|
||||
Reference in New Issue
Block a user