diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/plugin-install.php
--- a/wp/wp-admin/includes/plugin-install.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/includes/plugin-install.php Fri Sep 05 18:40:08 2025 +0200
@@ -174,7 +174,8 @@
if ( $ssl && is_wp_error( $request ) ) {
if ( ! wp_is_json_request() ) {
- trigger_error(
+ wp_trigger_error(
+ __FUNCTION__,
sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.' ),
@@ -316,18 +317,23 @@
*/
function install_search_form( $deprecated = true ) {
$type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
- $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
+ $term = isset( $_REQUEST['s'] ) ? urldecode( wp_unslash( $_REQUEST['s'] ) ) : '';
?>
-
' . __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the WordPress Plugin Directory or upload a plugin in .zip format by clicking the button at the top of this page.' ) . '',
+ '
' . __( 'Plugins extend and expand the functionality of WordPress. You may install plugins in the WordPress Plugin Directory right from here, or upload a plugin in .zip format by clicking the button at the top of this page.' ) . '
',
__( 'https://wordpress.org/plugins/' )
);
break;
@@ -471,8 +482,10 @@
}
} else {
$key = array_keys( $installed_plugin );
- // Use the first plugin regardless of the name.
- // Could have issues for multiple plugins in one directory if they share different version numbers.
+ /*
+ * Use the first plugin regardless of the name.
+ * Could have issues for multiple plugins in one directory if they share different version numbers.
+ */
$key = reset( $key );
$update_file = $api->slug . '/' . $key;
@@ -800,37 +813,54 @@
$tested_wp = ( empty( $api->tested ) || version_compare( get_bloginfo( 'version' ), $api->tested, '<=' ) );
if ( ! $compatible_php ) {
- echo '
';
- _e( 'Error: This plugin requires a newer version of PHP.' );
+ $compatible_php_notice_message = '
';
+ $compatible_php_notice_message .= __( 'Error: This plugin requires a newer version of PHP.' );
+
if ( current_user_can( 'update_php' ) ) {
- printf(
+ $compatible_php_notice_message .= sprintf(
/* translators: %s: URL to Update PHP page. */
' ' . __( 'Click here to learn more about updating PHP.' ),
esc_url( wp_get_update_php_url() )
- );
-
- wp_update_php_annotation( '
';
- _e( 'Warning: This plugin has not been tested with your current version of WordPress.' );
- echo '
';
+ wp_admin_notice(
+ __( 'Warning: This plugin has not been tested with your current version of WordPress.' ),
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'notice-alt' ),
+ )
+ );
} elseif ( ! $compatible_wp ) {
- echo '
';
- _e( 'Error: This plugin requires a newer version of WordPress.' );
+ $compatible_wp_notice_message = __( 'Error: This plugin requires a newer version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
- printf(
+ $compatible_wp_notice_message .= sprintf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( 'Click here to update WordPress.' ),
- self_admin_url( 'update-core.php' )
+ esc_url( self_admin_url( 'update-core.php' ) )
);
}
- echo '