| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* E2pdf Graph Helper |
| 5 |
* |
| 6 |
* @copyright Copyright 2017 https://e2pdf.com |
| 7 |
* @license GPLv3 |
| 8 |
* @version 1 |
| 9 |
* @link https://e2pdf.com |
| 10 |
* @since 1.01.02 |
| 11 |
*/ |
| 12 |
if (!defined('ABSPATH')) { |
| 13 |
die('Access denied.'); |
| 14 |
} |
| 15 |
|
| 16 |
class Helper_E2pdf_Extension { |
| 17 |
|
| 18 |
public function is_plugin_active($plugin) { |
| 19 |
if (!function_exists('is_plugin_active')) { |
| 20 |
include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 21 |
} |
| 22 |
if (is_plugin_active($plugin)) { |
| 23 |
return true; |
| 24 |
} |
| 25 |
list($dir, $file) = explode('/', $plugin); |
| 26 |
$plugins = (array) get_option('active_plugins', array()); |
| 27 |
if (is_multisite()) { |
| 28 |
$plugins = array_merge($plugins, array_keys((array) get_site_option('active_sitewide_plugins', array()))); |
| 29 |
} |
| 30 |
if (!empty(preg_grep('/' . $file . '$/i', $plugins))) { |
| 31 |
return true; |
| 32 |
} |
| 33 |
return false; |
| 34 |
} |
| 35 |
|
| 36 |
} |
| 37 |
|