• Resolved inovagora

    (@inovagora)


    Hi,

    We are using BuddyBoss that simulates the use of the BuddyPress plugin (some other plugins or features may do something similar), so in debug-info.php the plugin “buddypress/bp-loader.php” is in the $active_plugins array but not in the $plugin_details array, resulting in the following errors:

    Warning: Undefined array key “buddypress/bp-loader.php” in /data/html/wp-content/plugins/media-deduper/admin/debug-info.php on line 46

    Warning: Trying to access array offset on value of type null in /data/html/wp-content/plugins/media-deduper/admin/debug-info.php on line 46

    An easy fix is to faultproof the code with a check on the existence of the plugin in the $plugin_details array.

    Replacement of :

    foreach ( $active_plugins as $key => $plugin ) {
        echo esc_html( $plugin_details[ $plugin ]['Name'] ) . ' | Version ' . esc_html( $plugin_details[ $plugin ]['Version'] ) . "\n";
    }

    with :

    foreach ( $active_plugins as $key => $plugin ) {
        if ( isset( $plugin_details[ $plugin ] ) ) {
            echo esc_html( $plugin_details[ $plugin ]['Name'] ) . ' | Version ' . esc_html( $plugin_details[ $plugin ]['Version'] ) . "\n";
        }
    }

    Could you please integrate this in your next release?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.