| 1 |
<?php |
| 2 |
/* |
| 3 |
* CookieAdmin |
| 4 |
* https://cookieadmin.net |
| 5 |
* (c) Softaculous Team |
| 6 |
*/ |
| 7 |
|
| 8 |
// We need the ABSPATH |
| 9 |
if (!defined('ABSPATH')) exit; |
| 10 |
|
| 11 |
define('COOKIEADMIN_BASE', plugin_basename(COOKIEADMIN_FILE)); |
| 12 |
define('COOKIEADMIN_DIR', plugin_dir_path(__FILE__)); |
| 13 |
define('COOKIEADMIN_VERSION', '1.0.3'); |
| 14 |
define('COOKIEADMIN_URL', plugins_url('', COOKIEADMIN_FILE)); |
| 15 |
define('COOKIEADMIN_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 16 |
define('COOKIEADMIN_PRO_URL', 'https://cookieadmin.net/pricing?from=plugin'); |
| 17 |
define('COOKIEADMIN_WWW_URL', 'https://cookieadmin.net/'); |
| 18 |
|
| 19 |
include_once(COOKIEADMIN_DIR.'includes/functions.php'); |
| 20 |
|
| 21 |
function cookieadmin_autoloader($class){ |
| 22 |
|
| 23 |
if(!preg_match('/^CookieAdmin\\\(.*)/is', $class, $m)){ |
| 24 |
return; |
| 25 |
} |
| 26 |
|
| 27 |
$m[1] = str_replace('\\', '/', $m[1]); |
| 28 |
|
| 29 |
if(strpos($class, 'CookieAdmin\lib') === 0){ |
| 30 |
if(file_exists(COOKIEADMIN_DIR.$m[1].'.php')){ |
| 31 |
include_once(COOKIEADMIN_DIR.$m[1].'.php'); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
// For Pro |
| 36 |
if(file_exists(COOKIEADMIN_DIR.'includes/'.strtolower($m[1]).'.php')){ |
| 37 |
include_once(COOKIEADMIN_DIR.'includes/'.strtolower($m[1]).'.php'); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
spl_autoload_register(__NAMESPACE__.'\cookieadmin_autoloader'); |
| 42 |
|
| 43 |
|
| 44 |
if(!class_exists('CookieAdmin')){ |
| 45 |
#[\AllowDynamicProperties] |
| 46 |
class CookieAdmin{ |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
add_action('plugins_loaded', 'cookieadmin_load_plugin'); |