| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The plugin bootstrap file |
| 5 |
* |
| 6 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 7 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 8 |
* registers the activation and deactivation functions, and defines a function |
| 9 |
* that starts the plugin. |
| 10 |
* |
| 11 |
* @link https://themeatelier.net/ |
| 12 |
* @since 1.0.0 |
| 13 |
* @package Darkify |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: Darkify |
| 17 |
* Plugin URI: https://darkifywp.com/ |
| 18 |
* Description: Darkify is for a stylish, modern darkmode look that people love. |
| 19 |
* Version: 1.5.2 |
| 20 |
* Author: ThemeAtelier |
| 21 |
* Author URI: https://themeatelier.net/ |
| 22 |
* License: GPL-2.0+ |
| 23 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 |
* Text Domain: darkify |
| 25 |
* Domain Path: /languages |
| 26 |
*/ |
| 27 |
|
| 28 |
// If this file is called directly, abort. |
| 29 |
if (!defined('WPINC')) { |
| 30 |
die; |
| 31 |
} |
| 32 |
|
| 33 |
require_once __DIR__ . '/vendor/autoload.php'; |
| 34 |
|
| 35 |
use ThemeAtelier\Darkify\Includes\Darkify; |
| 36 |
|
| 37 |
/** |
| 38 |
* Currently plugin version. |
| 39 |
* Start at version 1.0.0 and use SemVer - https://semver.org |
| 40 |
* Rename this for your plugin and update it as you release new versions. |
| 41 |
*/ |
| 42 |
if (!defined('DARKIFY_VERSION')) { |
| 43 |
define('DARKIFY_VERSION', '1.5.2'); |
| 44 |
} |
| 45 |
if (!defined('DARKIFY_FILE')) { |
| 46 |
define('DARKIFY_FILE', __FILE__); |
| 47 |
} |
| 48 |
if (!defined('DARKIFY_DIR_URL')) { |
| 49 |
define('DARKIFY_DIR_URL', plugin_dir_url(__FILE__)); |
| 50 |
} |
| 51 |
if (!defined('DARKIFY_BASENAME')) { |
| 52 |
define('DARKIFY_BASENAME', plugin_basename(__FILE__)); |
| 53 |
} |
| 54 |
if (!defined('DARKIFY_PATH')) { |
| 55 |
define('DARKIFY_PATH', plugin_dir_path(__FILE__)); |
| 56 |
} |
| 57 |
if (!defined('DARKIFY_DIR_NAME')) { |
| 58 |
define('DARKIFY_DIR_NAME', dirname(__FILE__)); |
| 59 |
} |
| 60 |
if (!defined('DARKIFY_DEMO_URL')) { |
| 61 |
define('DARKIFY_DEMO_URL', 'https://darkifywp.com/'); |
| 62 |
} |
| 63 |
if (!defined('DARKIFY_DOCS_URL')) { |
| 64 |
define('DARKIFY_DOCS_URL', 'https://darkifywp.com/docs/'); |
| 65 |
} |
| 66 |
|
| 67 |
function darkify_run() |
| 68 |
{ |
| 69 |
// Launch the plugin. |
| 70 |
$darkify = new Darkify(); |
| 71 |
$darkify->run(); |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* Pro version check. |
| 76 |
* |
| 77 |
* @return boolean |
| 78 |
*/ |
| 79 |
include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 80 |
if (! (is_plugin_active('darkify-pro/darkify-pro.php') || is_plugin_active_for_network('darkify-pro/darkify-pro.php'))) { |
| 81 |
darkify_run(); |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
/** |
| 86 |
* Initialize the plugin tracker |
| 87 |
* |
| 88 |
* @return void |
| 89 |
*/ |
| 90 |
function darkify_appsero_init() |
| 91 |
{ |
| 92 |
if (!class_exists('DarkifyAppSero\Insights')) { |
| 93 |
require_once DARKIFY_PATH . 'src/Admin/appsero/Client.php'; |
| 94 |
} |
| 95 |
|
| 96 |
$client = new DarkifyAppSero\Client('16b2d91f-fd42-42d1-b199-5ae98213496a', 'Darkify Dark Mode', __FILE__); |
| 97 |
// Active insights |
| 98 |
$client->insights()->init(); |
| 99 |
} |
| 100 |
|
| 101 |
add_action('plugins_loaded', 'darkify_appsero_init'); |