PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.12
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.12
2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 All 56 releases
darkify / darkify.php

darkify.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.4.12, at darkify.php

109 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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.4.12
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\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.4.12');
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 include_once ABSPATH . 'wp-admin/includes/plugin.php';
68 $pro_plugin_slug = 'darkify-pro/darkify-pro.php';
69
70 // kick-off the plugin
71 if (!is_plugin_active($pro_plugin_slug)) {
72
73 function darkify_run()
74 {
75 // Launch the plugin.
76 $darkify = new Darkify();
77 $darkify->run();
78 }
79 darkify_run();
80 }
81
82 function darkify_redirect_to($plugin)
83 {
84 if (DARKIFY_BASENAME === $plugin) {
85 $redirect_url = esc_url(admin_url('admin.php?page=darkify'));
86 exit(wp_kses_post(wp_safe_redirect($redirect_url)));
87 }
88 }
89
90 add_action('activated_plugin', 'darkify_redirect_to');
91
92 /**
93 * Initialize the plugin tracker
94 *
95 * @return void
96 */
97 function darkify_appsero_init()
98 {
99 if (!class_exists('DarkifyAppSero\Insights')) {
100 require_once DARKIFY_PATH . 'src/Admin/appsero/Client.php';
101 }
102
103 $client = new DarkifyAppSero\Client('16b2d91f-fd42-42d1-b199-5ae98213496a', 'Darkify Dark Mode', __FILE__);
104 // Active insights
105 $client->insights()->init();
106 }
107
108 add_action( 'plugins_loaded', 'darkify_appsero_init' );
109