From 316d1efa23dcb9782e826ca7722a877a90d0e82a Mon Sep 17 00:00:00 2001 From: desrosj Date: Thu, 7 Mar 2024 05:58:15 +0000 Subject: [PATCH] Upload: Add links back to installer pages. This adds a link back to the plugin or theme installers when an incompatible archive error message is encountered. Props Presskopp, swissspidy, smub, pmbaldha, aneeshd16. Fixes #60578. Built from https://develop.svn.wordpress.org/trunk@57786 git-svn-id: http://core.svn.wordpress.org/trunk@57287 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../includes/class-file-upload-upgrader.php | 19 ++++++++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-file-upload-upgrader.php b/wp-admin/includes/class-file-upload-upgrader.php index 1201c6d188..48e1aac721 100644 --- a/wp-admin/includes/class-file-upload-upgrader.php +++ b/wp-admin/includes/class-file-upload-upgrader.php @@ -72,7 +72,24 @@ class File_Upload_Upgrader { if ( 'pluginzip' === $form || 'themezip' === $form ) { if ( ! wp_zip_file_is_valid( $file['file'] ) ) { wp_delete_file( $file['file'] ); - wp_die( __( 'Incompatible Archive.' ) ); + + if ( 'pluginzip' === $form ) { + $plugins_page = sprintf( + '%s', + self_admin_url( 'plugin-install.php' ), + __( 'Return to the Plugin Installer' ) + ); + wp_die( __( 'Incompatible Archive.' ) . '
' . $plugins_page ); + } + + if ( 'themezip' === $form ) { + $themes_page = sprintf( + '%s', + self_admin_url( 'theme-install.php' ), + __( 'Return to the Theme Installer' ) + ); + wp_die( __( 'Incompatible Archive.' ) . '
' . $themes_page ); + } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 07af091d2a..818650669a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-57785'; +$wp_version = '6.6-alpha-57786'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.