Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Admin_Status::output_plugins_info( array $plugins, array $untested_plugins )
Prints the information about plugins for the system status report.
Description Description
Used for both active and inactive plugins sections.
Parameters Parameters
- $plugins
-
(Required) List of plugins to display.
- $untested_plugins
-
(Required) List of plugins that haven't been tested with the current WooCommerce version.
Return Return
(void)
Source Source
File: includes/admin/class-wc-admin-status.php
private static function output_plugins_info( $plugins, $untested_plugins ) { $wc_version = Constants::get_constant( 'WC_VERSION' ); foreach ( $plugins as $plugin ) { if ( ! empty( $plugin['name'] ) ) { // Link the plugin name to the plugin url if available. $plugin_name = esc_html( $plugin['name'] ); if ( ! empty( $plugin['url'] ) ) { $plugin_name = '<a href="' . esc_url( $plugin['url'] ) . '" aria-label="' . esc_attr__( 'Visit plugin homepage', 'woocommerce' ) . '" target="_blank">' . $plugin_name . '</a>'; } $has_newer_version = false; $version_string = $plugin['version']; $network_string = ''; if ( strstr( $plugin['url'], 'woothemes.com' ) || strstr( $plugin['url'], 'woocommerce.com' ) ) { if ( ! empty( $plugin['version_latest'] ) && version_compare( $plugin['version_latest'], $plugin['version'], '>' ) ) { /* translators: 1: current version. 2: latest version */ $version_string = sprintf( __( '%1$s (update to version %2$s is available)', 'woocommerce' ), $plugin['version'], $plugin['version_latest'] ); } if ( false !== $plugin['network_activated'] ) { $network_string = ' – <strong style="color: black;">' . esc_html__( 'Network enabled', 'woocommerce' ) . '</strong>'; } } $untested_string = ''; if ( array_key_exists( $plugin['plugin'], $untested_plugins ) ) { $untested_string = ' – <strong style="color: #a00;">'; /* translators: %s: version */ $untested_string .= esc_html( sprintf( __( 'Installed version not tested with active version of WooCommerce %s', 'woocommerce' ), $wc_version ) ); $untested_string .= '</strong>'; } ?> <tr> <td><?php echo wp_kses_post( $plugin_name ); ?></td> <td class="help"> </td> <td> <?php /* translators: %s: plugin author */ printf( esc_html__( 'by %s', 'woocommerce' ), esc_html( $plugin['author_name'] ) ); echo ' – ' . esc_html( $version_string ) . $untested_string . $network_string; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </td> </tr> <?php } } }