From 4e8342be38c507b7d51b06ceb7c9b38215d55dd6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 12 Apr 2019 15:34:52 +0100 Subject: [PATCH] Check get_plugin_data exists --- .../api/v2/class-wc-rest-system-status-v2-controller.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/api/v2/class-wc-rest-system-status-v2-controller.php b/includes/api/v2/class-wc-rest-system-status-v2-controller.php index af2d4c6fa3d..70152fa3c0f 100644 --- a/includes/api/v2/class-wc-rest-system-status-v2-controller.php +++ b/includes/api/v2/class-wc-rest-system-status-v2-controller.php @@ -801,6 +801,12 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { * @return array */ public function get_active_plugins() { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + + if ( ! function_exists( 'get_plugin_data' ) ) { + return array(); + } + $active_plugins = (array) get_option( 'active_plugins', array() ); if ( is_multisite() ) { $network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );