diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/import.php --- a/wp/wp-admin/import.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/import.php Tue Dec 15 13:49:49 2020 +0100 @@ -9,10 +9,10 @@ define( 'WP_LOAD_IMPORTERS', true ); /** Load WordPress Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'import' ) ) { - wp_die( __( 'Sorry, you are not allowed to import content.' ) ); + wp_die( __( 'Sorry, you are not allowed to import content into this site.' ) ); } $title = __( 'Import' ); @@ -28,7 +28,7 @@ get_current_screen()->set_help_sidebar( '
' . __( 'For more information:' ) . '
' . - '' . __( 'Documentation on Import' ) . '
' . + '' . __( 'Documentation on Import' ) . '
' . '' . __( 'Support' ) . '
' ); @@ -39,10 +39,10 @@ $popular_importers = array(); } -// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt' +// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; - if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops. + if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops. wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ); exit; } @@ -53,7 +53,7 @@ wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); -require_once( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; $parent_file = 'tools.php'; ?> @@ -61,11 +61,11 @@- ' . esc_html( $_GET['invalid'] ) . '' ); - ?> +
+ ' . esc_html( $_GET['invalid'] ) . '' ); + ?>
' . __( 'No importers are available.' ) . '
'; // TODO: make more helpful + echo '' . __( 'No importers are available.' ) . '
'; // TODO: Make more helpful. } else { uasort( $importers, '_usort_by_first_member' ); ?> @@ -101,7 +101,8 @@ $data ) { - $plugin_slug = $action = ''; + $plugin_slug = ''; + $action = ''; $is_plugin_installed = false; if ( isset( $data['install'] ) ) { @@ -127,7 +128,7 @@ $action = sprintf( '%s', esc_url( $url ), - /* translators: %s: Importer name */ + /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); @@ -154,13 +155,13 @@ esc_url( $url ), esc_attr( $plugin_slug ), esc_attr( $data[0] ), - /* translators: %s: Importer name */ - esc_attr( sprintf( __( 'Install %s now' ), $data[0] ) ), + /* translators: %s: Importer name. */ + esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ), __( 'Install Now' ) ); } else { $action = sprintf( - /* translators: URL to wp-admin/import.php */ + /* translators: %s: URL to Import screen on the main site. */ __( 'This importer is not installed. Please install importers from the main site.' ), get_admin_url( get_current_network_id(), 'import.php' ) ); @@ -176,7 +177,7 @@ $action = sprintf( '%3$s', esc_url( $url ), - /* translators: %s: Importer name */ + /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'Run %s' ), $data[0] ) ), __( 'Run Importer' ) ); @@ -199,7 +200,7 @@ $action .= sprintf( ' | %3$s', esc_url( $url ), - /* translators: %s: Importer name */ + /* translators: %s: Importer name. */ esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ), __( 'Details' ) ); @@ -222,7 +223,11 @@ } if ( current_user_can( 'install_plugins' ) ) { - echo '' . sprintf( __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '
'; + echo '' . sprintf( + /* translators: %s: URL to Add Plugins screen. */ + __( 'If the importer you need is not listed, search the plugin directory to see if an importer is available.' ), + esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) + ) . '
'; } ?> @@ -232,4 +237,4 @@ wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); -include( ABSPATH . 'wp-admin/admin-footer.php' ); +require_once ABSPATH . 'wp-admin/admin-footer.php';