| @@ -1,9 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\System_Info\Reporters; |
| 3 | 3 | |
| 4 | -use Elementor\Plugin; | |
| 5 | - | |
| 6 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | 5 | exit; // Exit if accessed directly. |
| 8 | 6 | } |
| 9 | 7 | |
| @@ -14,9 +12,9 @@ | ||
| 14 | 12 | * active plugins. |
| 15 | 13 | * |
| 16 | 14 | * @since 1.0.0 |
| 17 | 15 | */ |
| 18 | -class Plugins extends Base_Plugin { | |
| 16 | +class Plugins extends Base { | |
| 19 | 17 | |
| 20 | 18 | /** |
| 21 | 19 | * Active plugins. |
| 22 | 20 | * |
| @@ -40,9 +38,15 @@ | ||
| 40 | 38 | * @return array Active plugins. |
| 41 | 39 | */ |
| 42 | 40 | private function get_plugins() { |
| 43 | 41 | if ( ! $this->plugins ) { |
| 44 | - $this->plugins = Plugin::$instance->wp->get_active_plugins()->all(); | |
| 42 | + // Ensure get_plugins function is loaded | |
| 43 | + if ( ! function_exists( 'get_plugins' ) ) { | |
| 44 | + include ABSPATH . '/wp-admin/includes/plugin.php'; | |
| 45 | + } | |
| 46 | + | |
| 47 | + $active_plugins = get_option( 'active_plugins' ); | |
| 48 | + $this->plugins = array_intersect_key( get_plugins(), array_flip( $active_plugins ) ); | |
| 45 | 49 | } |
| 46 | 50 | |
| 47 | 51 | return $this->plugins; |
| 48 | 52 | } |
| @@ -71,9 +75,9 @@ | ||
| 71 | 75 | * |
| 72 | 76 | * @return bool True if the site has active plugins, False otherwise. |
| 73 | 77 | */ |
| 74 | 78 | public function is_enabled() { |
| 75 | - return (bool) $this->get_plugins(); | |
| 79 | + return ! ! $this->get_plugins(); | |
| 76 | 80 | } |
| 77 | 81 | |
| 78 | 82 | /** |
| 79 | 83 | * Get active plugins report fields. |