Make WordPress Core

Changeset 61448


Ignore:
Timestamp:
01/07/2026 04:46:00 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Site Health: Check plugin data in WP_Recovery_Mode_Email_Service::get_debug().

This resolves a PHP warning when preparing debug information for the fatal error protection email if ::get_plugin() returned false due to the failing plugin not being found.

Follow-up to [46273].

Props mukesh27, afwebdev, abcd95, sainathpoojary, ankitkumarshah, SergeyBiryukov.
Fixes #62816.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-recovery-mode-email-service.php

    r55703 r61448  
    341341                $wp_version = get_bloginfo( 'version' );
    342342
    343                 if ( $extension ) {
    344                         $plugin = $this->get_plugin( $extension );
    345                 } else {
    346                         $plugin = null;
    347                 }
    348 
    349343                $debug = array(
    350344                        'wp'    => sprintf(
    … …  
    361355                );
    362356
    363                 if ( null !== $plugin ) {
    364                         $debug['plugin'] = sprintf(
    365                                 /* translators: 1: The failing plugins name. 2: The failing plugins version. */
    366                                 __( 'Current plugin: %1$s (version %2$s)' ),
    367                                 $plugin['Name'],
    368                                 $plugin['Version']
    369                         );
     357                if ( $extension ) {
     358                        $plugin = $this->get_plugin( $extension );
     359
     360                        if ( is_array( $plugin ) ) {
     361                                $debug['plugin'] = sprintf(
     362                                        /* translators: 1: The failing plugin's name. 2: The failing plugin's version. */
     363                                        __( 'Current plugin: %1$s (version %2$s)' ),
     364                                        $plugin['Name'],
     365                                        $plugin['Version']
     366                                );
     367                        }
    370368                }
    371369
Note: See TracChangeset for help on using the changeset viewer.