*/ public static function snapshot(): array { global $wpdb; $theme = wp_get_theme(); $theme_label = trim( $theme->get( 'Name' ) . ' ' . $theme->get( 'Version' ) ); $active_option = get_option( 'active_plugins', false ); $active = is_array( $active_option ) ? $active_option : array(); if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $all = get_plugins(); $total = count( $all ); return array( 'wordpress' => (string) get_bloginfo( 'version' ), 'php' => PHP_VERSION, 'mysql' => ( is_object( $wpdb ) && method_exists( $wpdb, 'db_version' ) ) ? (string) $wpdb->db_version() : '', 'woocommerce' => defined( 'WC_VERSION' ) ? (string) WC_VERSION : null, 'theme' => $theme_label, 'active_plugins' => count( $active ), 'total_plugins' => $total, ); } }