Skip to content
Open
15 changes: 12 additions & 3 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function display_setup_form( $error = null ) {
die(
'<h1>' . __( 'Already Installed' ) . '</h1>' .
'<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' .
'<p class="step"><a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log In' ) . '</a></p>' .
'<p class="step"><a class="button button-primary" href="' . esc_url( wp_login_url() ) . '">' . __( 'Log In' ) . '</a></p>' .
'</body></html>'
);
}
Expand Down Expand Up @@ -462,7 +462,7 @@ function display_setup_form( $error = null ) {
</tr>
</table>

<p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>
<p class="step"><a class="button button-primary" href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>

<?php
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,11 @@ public function update_item( $request ) {
* To ensure that a unique slug is generated, pass the post data with the 'publish' status.
*/
if ( ! empty( $post->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,
Expand Down
Loading