PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.2.5
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.2.5
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.2.5, at darkify.php

124 lines 5.3 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://themeatelier.net/downloads/darkify/
18 * Description: Darkify is for a stylish, modern darkmode look that people love.
19 * Version: 1.2.5
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 /**
34 * Currently plugin version.
35 * Start at version 1.0.0 and use SemVer - https://semver.org
36 * Rename this for your plugin and update it as you release new versions.
37 */
38 define('DARKIFY_VERSION', '1.2.5');
39 define('DARKIFY_DIR_URL', plugin_dir_url(__FILE__));
40 define('DARKIFY_BASENAME', plugin_basename(__FILE__));
41 define('DARKIFY_PATH', plugin_dir_path(__FILE__));
42 define('DARKIFY_DIR_NAME', dirname(__FILE__));
43
44 /**
45 * The code that runs during plugin activation.
46 * This action is documented in includes/class-darkify-activator.php
47 */
48 function darkify_activate()
49 {
50 require_once DARKIFY_PATH . 'includes/class-darkify-activator.php';
51 Darkify_Activator::activate();
52 }
53
54 /**
55 * The code that runs during plugin deactivation.
56 * This action is documented in includes/class-darkify-deactivator.php
57 */
58 function darkify_deactivate()
59 {
60 require_once DARKIFY_PATH . 'includes/class-darkify-deactivator.php';
61 Darkify_Deactivator::deactivate();
62 }
63
64 register_activation_hook(__FILE__, 'darkify_activate');
65 register_deactivation_hook(__FILE__, 'darkify_deactivate');
66
67 require DARKIFY_PATH . 'includes/class-darkify.php';
68
69
70 function darkify_run()
71 {
72 $plugin = new Darkify_Main();
73 $plugin->run();
74 }
75 darkify_run();
76
77 add_action('admin_menu', 'add_plugin_page');
78 function add_plugin_page()
79 {
80 // This page will be under "Settings"
81 add_menu_page(
82 esc_html__('Darkify', 'darkify'),
83 esc_html__('Darkify', 'darkify'),
84 'manage_options',
85 'darkify',
86 'darkify_settings',
87 'data:image/svg+xml;base64,' . base64_encode('<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.5 1.5C23.5 0.671573 22.8284 0 22 0C21.1716 0 20.5 0.671573 20.5 1.5V4.5C20.5 5.32843 21.1716 6 22 6C22.8284 6 23.5 5.32843 23.5 4.5V1.5Z" fill="white"/><path d="M34 22C34 28.6274 28.6274 34 22 34C15.3726 34 10 28.6274 10 22C10 15.3726 15.3726 10 22 10C28.6274 10 34 15.3726 34 22Z" fill="white"/><path d="M22 38C22.8284 38 23.5 38.6716 23.5 39.5V42.5C23.5 43.3284 22.8284 44 22 44C21.1716 44 20.5 43.3284 20.5 42.5V39.5C20.5 38.6716 21.1716 38 22 38Z" fill="white"/><path d="M10.6863 10.6863C10.1005 11.2721 9.15074 11.2721 8.56495 10.6863L6.44363 8.56498C5.85784 7.97919 5.85784 7.02945 6.44363 6.44366C7.02942 5.85787 7.97916 5.85787 8.56495 6.44366L10.6863 8.56498C11.2721 9.15077 11.2721 10.1005 10.6863 10.6863Z" fill="white"/><path d="M35.435 37.5564C36.0208 38.1421 36.9705 38.1421 37.5563 37.5564C38.1421 36.9706 38.1421 36.0208 37.5563 35.435L35.435 33.3137C34.8492 32.7279 33.8995 32.7279 33.3137 33.3137C32.7279 33.8995 32.7279 34.8493 33.3137 35.435L35.435 37.5564Z" fill="white"/><path d="M10.6863 33.3137C11.2721 33.8995 11.2721 34.8492 10.6863 35.435L8.56495 37.5563C7.97916 38.1421 7.02942 38.1421 6.44363 37.5563C5.85784 36.9706 5.85784 36.0208 6.44363 35.435L8.56495 33.3137C9.15074 32.7279 10.1005 32.7279 10.6863 33.3137Z" fill="white"/><path d="M37.5563 8.56496C38.1421 7.97918 38.1421 7.02943 37.5563 6.44364C36.9705 5.85786 36.0208 5.85786 35.435 6.44364L33.3137 8.56496C32.7279 9.15075 32.7279 10.1005 33.3137 10.6863C33.8995 11.2721 34.8492 11.2721 35.435 10.6863L37.5563 8.56496Z" fill="white"/><path d="M6 22C6 22.8284 5.32843 23.5 4.5 23.5H1.5C0.671573 23.5 0 22.8284 0 22C0 21.1716 0.671573 20.5 1.5 20.5H4.5C5.32843 20.5 6 21.1716 6 22Z" fill="white"/><path d="M42.5 23.5C43.3284 23.5 44 22.8284 44 22C44 21.1716 43.3284 20.5 42.5 20.5H39.5C38.6716 20.5 38 21.1716 38 22C38 22.8284 38.6716 23.5 39.5 23.5H42.5Z" fill="white"/></svg>'),
88 9
89 );
90 do_action('darkify_before_upgrade_pro_menu');
91 add_submenu_page(
92 'darkify',
93 __('👑 Upgrade to Pro!',
94 'darkify'),
95 sprintf('<span style="color: #35b747;font-weight: bold;" class="darkify-get-pro-text">%s</span>', __('👑 Upgrade to Pro!', 'darkify')),
96 'manage_options',
97 'https://1.envato.market/darkify');
98 do_action('darkify_after_upgrade_pro_menu');
99 }
100
101 /**
102 * Options page callback
103 */
104 function darkify_settings() {}
105
106
107 /**
108 * Initialize the plugin tracker
109 *
110 * @return void
111 */
112 function darkify_appsero_init()
113 {
114
115 if (!class_exists('DarkifyAppSero\Insights')) {
116 require_once DARKIFY_PATH . 'admin/appsero/Client.php';
117 }
118
119 $client = new DarkifyAppSero\Client('d1635433-15b4-474b-98f8-0c0809dec2c1', 'Darkify', __FILE__);
120 // Active insights
121 $client->insights()->init();
122 }
123
124 darkify_appsero_init();