' . __( 'Note:' ) . ' ';
- printf(
+ $message_class = 'updated';
+ $message = '
' . __( 'Warning:' ) . ' ';
+ $message .= '
' . sprintf(
/* translators: %s: mod_rewrite */
__( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
'mod_rewrite
'
- );
- echo '
';
+ ) . '';
} elseif ( $is_apache ) {
- echo '
' . __( 'Warning:' ) . ' ';
- printf(
+ $message_class = 'error';
+ $message = '
' . __( 'Warning:' ) . ' ';
+ $message .= sprintf(
/* translators: %s: mod_rewrite */
__( 'It looks like the Apache %s module is not installed.' ),
'mod_rewrite
'
- );
- echo '
';
+ ) . '';
}
if ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache).
- echo '
';
- printf(
+ $message .= '
' . sprintf(
/* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */
__( 'If %1$s is disabled, ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.' ),
'mod_rewrite
',
'https://httpd.apache.org/docs/mod/mod_rewrite.html',
'https://www.google.com/search?q=apache+mod_rewrite'
+ ) . '
';
+
+ wp_admin_notice(
+ $message,
+ array(
+ 'additional_classes' => array( $message_class, 'inline' ),
+ 'paragraph_wrap' => false,
+ )
);
- echo '
';
}
}
@@ -260,10 +273,17 @@
endif;
if ( WP_CONTENT_DIR !== ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) {
- echo '
' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '
';
+ $subdirectory_warning_message = '
' . __( 'Warning:' ) . ' ';
+ $subdirectory_warning_message .= __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' );
+ wp_admin_notice(
+ $subdirectory_warning_message,
+ array(
+ 'additional_classes' => array( 'error', 'inline' ),
+ )
+ );
}
- $is_www = ( 0 === strpos( $hostname, 'www.' ) );
+ $is_www = str_starts_with( $hostname, 'www.' );
if ( $is_www ) :
?>
@@ -394,7 +414,7 @@
$base = parse_url( $slashed_home, PHP_URL_PATH );
$document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
$abspath_fix = str_replace( '\\', '/', ABSPATH );
- $home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();
+ $home_path = str_starts_with( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();
$wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );
$rewrite_base = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
@@ -406,7 +426,12 @@
// Wildcard DNS message.
if ( is_wp_error( $errors ) ) {
- echo '
' . $errors->get_error_message() . '
';
+ wp_admin_notice(
+ $errors->get_error_message(),
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
}
if ( $_POST ) {
@@ -423,8 +448,14 @@
get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
+
+ wp_admin_notice(
+ '
' . __( 'Warning:' ) . ' ' . __( 'An existing WordPress network was detected.' ),
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
?>
-
-
' . __( 'Caution:' ) . ' ';
+ $notice_args = array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'inline' ),
+ );
+
if ( file_exists( $home_path . '.htaccess' ) ) {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: 1: wp-config.php, 2: .htaccess */
__( 'You should back up your existing %1$s and %2$s files.' ),
'wp-config.php
',
'.htaccess
'
);
} elseif ( file_exists( $home_path . 'web.config' ) ) {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: 1: wp-config.php, 2: web.config */
__( 'You should back up your existing %1$s and %2$s files.' ),
'wp-config.php
',
'web.config
'
);
} else {
- echo '' . __( 'Caution:' ) . ' ';
- printf(
+ $notice_message .= sprintf(
/* translators: %s: wp-config.php */
__( 'You should back up your existing %s file.' ),
'wp-config.php
'
);
}
- ?>
-
-
-
+
-
@@ -626,7 +677,7 @@
printf(
/* translators: %s: Documentation URL. */
__( 'It seems your network is running with Nginx web server.
Learn more about further configuration.' ),
- __( 'https://wordpress.org/support/article/nginx/' )
+ __( 'https://developer.wordpress.org/advanced-administration/server/web-server/nginx/' )
);
echo '';
@@ -656,7 +707,7 @@
EOF;
- echo '
';
+ echo '
';
printf(
/* translators: 1: File name (.htaccess or web.config), 2: File path. */
__( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ),
@@ -668,7 +719,16 @@
echo '
' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '
';
}
?>
-
+
+