diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 44c04175abaf2..2beff559ff621 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -2800,10 +2800,19 @@ public function get_test_search_engine_visibility() { */ public function get_test_opcode_cache(): array { $opcode_cache_enabled = false; - if ( function_exists( 'opcache_get_status' ) ) { - $status = @opcache_get_status( false ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Warning emitted in failure case. - if ( $status && true === $status['opcache_enabled'] ) { + if ( extension_loaded( 'Zend OPcache' ) ) { + $enabled = ini_get( 'opcache.enable' ); + + if ( $enabled ) { $opcode_cache_enabled = true; + + // Only try to read status if it actually works. + if ( function_exists( 'opcache_get_status' ) ) { + $status = @opcache_get_status( false ); + if ( is_array( $status ) && isset( $status['opcache_enabled'] ) ) { + $opcode_cache_enabled = (bool) $status['opcache_enabled']; + } + } } } diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index b655af53f0cb6..864f65b5ee104 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -218,7 +218,7 @@ function display_setup_form( $error = null ) { die( '

' . __( 'Already Installed' ) . '

' . '

' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '

' . - '

' . __( 'Log In' ) . '

' . + '

' . __( 'Log In' ) . '

' . '' ); } @@ -462,7 +462,7 @@ function display_setup_form( $error = null ) { -

+

post_name ) && in_array( $post_status, array( 'draft', 'pending' ), true ) ) { - $post_parent = ! empty( $post->post_parent ) ? $post->post_parent : 0; + if ( ! empty( $post->post_parent ) ) { + $post_parent = (int) $post->post_parent; + } else { + $post_parent = ! empty( $post_before->post_parent ) ? (int) $post_before->post_parent : 0; + } $post->post_name = wp_unique_post_slug( $post->post_name, $post->ID,