PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.3.2
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.3.2
2.1.3 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 All 57 releases
← All changes | src/Admin/Admin.php +129 -236 1.5.51.3.2 View file →
@@ -11,15 +11,14 @@
11 11 * @author ThemeAtelier<themeatelierbd@gmail.com>
12 12 */
13 13
14 14 namespace ThemeAtelier\Darkify\Admin;
15 +
15 16 use ThemeAtelier\Darkify\Admin\TADiscountPage\TADiscountPage;
16 -use ThemeAtelier\Darkify\Admin\ReviewNotice\ReviewNotice;
17 17 use ThemeAtelier\Darkify\Admin\Views\DarkifyOptions;
18 -use ThemeAtelier\Darkify\Includes\DarkifyExternalSupport;
19 -use ThemeAtelier\Darkify\Includes\DarkifyUtils;
20 -use ThemeAtelier\Darkify\Admin\DBUpdates;
21 -use ThemeAtelier\Darkify\Admin\ReviewNotice\ThemeAtelier_Offer_Banner;
18 +use ThemeAtelier\Darkify\Helpers\DarkifyExternalSupport;
19 +use ThemeAtelier\Darkify\Helpers\DarkifyUtils;
20 +use ThemeAtelier\Darkify\Helpers\Helpers;
22 21
23 22 /**
24 23 * The admin class
25 24 */
@@ -54,12 +53,13 @@
54 53 private $version;
55 54 public $utils;
56 55 public $settings;
57 56 public $external_support;
57 +
58 58 public $unique_id;
59 +
59 60 private $plugin_name;
60 61
61 -
62 62 /**
63 63 * The class constructor.
64 64 *
65 65 * @param string $plugin_slug The slug of the plugin.
@@ -71,15 +71,18 @@
71 71 $this->external_support = new DarkifyExternalSupport($this);
72 72 if (function_exists('wp_rand')) {
73 73 $this->unique_id = wp_rand();
74 74 }
75 + DarkifyOptions::options('darkify');
75 76
76 77 $options = get_option('darkify');
77 -
78 78 $enable_admin_panel_dark_mode = isset($options['enable_admin_panel_dark_mode']) ? $options['enable_admin_panel_dark_mode'] : false;
79 79 $this->plugin_name = $plugin_slug;
80 - $this->min = (apply_filters('darkify_dev_mode', false) || WP_DEBUG) ? '' : '.min';
81 -
80 +
81 + add_filter('plugin_action_links', array($this, 'add_plugin_action_links'), 10, 2);
82 +
83 + add_action('admin_enqueue_scripts', array($this, 'darkify_admin_enqueue'));
84 +
82 85 if ($enable_admin_panel_dark_mode) {
83 86 add_action('admin_bar_menu', array($this, 'darkify_admin_bar_switch'), 9999);
84 87 add_action('admin_print_scripts', array($this, 'darkify_admin_header_script'), 1);
85 88 add_action('admin_footer', array($this, 'darkify_admin_footer_script'));
@@ -84,279 +87,169 @@
84 87 add_action('admin_print_scripts', array($this, 'darkify_admin_header_script'), 1);
85 88 add_action('admin_footer', array($this, 'darkify_admin_footer_script'));
86 89 }
87 90
88 - add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 );
89 - add_action('after_setup_theme', array($this, 'init_components'));
90 - add_filter('autoptimize_filter_js_exclude', array($this, 'darkify_exclude_js_from_cache_plugins'));
91 - add_action('admin_init', [$this, 'load_classic_editor_scripts']);
92 - new ReviewNotice();
93 - new DBUpdates();
94 - if ( ! defined( 'THEMEATELIER_OFFER_BANNER_LOADED' ) ) {
95 - define( 'THEMEATELIER_OFFER_BANNER_LOADED', true );
96 - ThemeAtelier_Offer_Banner::instance();
97 - }
98 -
99 - $active_plugins = get_option('active_plugins');
100 - foreach ($active_plugins as $active_plugin) {
101 - $_temp = strpos($active_plugin, 'darkify.php');
102 - if (false != $_temp) {
103 - add_filter('plugin_action_links_' . DARKIFY_BASENAME, array($this, 'add_plugin_action_links'), 10, 2);
104 - add_filter( 'plugin_row_meta', array( $this, 'after_darkify_row_meta' ), 10, 4 );
105 - }
106 - }
107 - add_filter( 'admin_footer_text', array( $this, 'darkify_admin_footer' ), 1, 2 );
91 + add_action('admin_menu', array($this, 'add_plugin_page'));
92 + new TADiscountPage();
108 93 }
109 94
110 - public function init_components() {
111 - DarkifyOptions::options('darkify');
95 + public function enqueue_styles()
96 + {
97 + wp_enqueue_style('ico-font', DARKIFY_DIR_URL . 'src/assets/css/icofont.css', array(), DARKIFY_VERSION, 'all');
98 + wp_enqueue_style('darkify-admin', DARKIFY_DIR_URL . 'src/Admin/assets/css/darkify-admin.css', array(), DARKIFY_VERSION, 'all');
112 99 }
113 100
114 - public function darkify_exclude_js_from_cache_plugins($excludes)
101 + public function enqueue_scripts($hook)
115 102 {
116 - $excludes .= ',client_main.js,client_main.min.js';
117 - return $excludes;
103 + if ($hook !== 'toplevel_page_darkify') {
104 + return;
105 + }
106 + wp_enqueue_script('darkify-admin', DARKIFY_DIR_URL . 'src/Admin/assets/js/darkify-admin.js', array(), DARKIFY_VERSION, 'all');
118 107 }
119 108
120 - public function enqueue_styles($hook)
109 + public function add_plugin_action_links($links, $file)
121 110 {
122 - if($hook === 'toplevel_page_darkify') {
123 - wp_enqueue_style('darkify-help-page', DARKIFY_DIR_URL . 'src/Admin/HelpPage/assets/css/help-page' . $this->min . '.css', array(), DARKIFY_VERSION, 'all');
111 + if (DARKIFY_BASENAME === $file) {
112 + $new_links = array(
113 + sprintf('<a href="%s">%s</a>', admin_url('admin.php?page=darkify#tab=control'), __('Settings', 'darkify')),
114 + );
115 + return array_merge($new_links, $links);
124 116 }
125 -
126 - $options = get_option('darkify');
127 - $enable_admin_panel_dark_mode = isset($options["enable_admin_panel_dark_mode"]) ? $options["enable_admin_panel_dark_mode"] : false;
128 - if ($enable_admin_panel_dark_mode) {
129 - if (!wp_style_is('darkify-admin-switch', 'enqueued')) {
130 - wp_enqueue_style('darkify-admin-switch', DARKIFY_DIR_URL . 'src/assets/css/client_main' . $this->min . '.css', array(), DARKIFY_VERSION, 'all');
131 - }
132 - }
133 - // Review notice CSS
134 - wp_enqueue_style('darkify-review-notice', DARKIFY_DIR_URL . 'src/Admin/ReviewNotice/assets/css/review-notice' . $this->min . '.css', array(), DARKIFY_VERSION, 'all');
117 + return $links;
135 118 }
136 119
137 - public function enqueue_scripts($hook)
120 + public function darkify_admin_enqueue($page)
138 121 {
139 122 $options = get_option('darkify');
140 - $enable_admin_panel_dark_mode = isset($options["enable_admin_panel_dark_mode"]) ? $options["enable_admin_panel_dark_mode"] : false;
141 - if ($enable_admin_panel_dark_mode) {
142 - wp_enqueue_script('darkify-admin-client-main', DARKIFY_DIR_URL . 'src/assets/js/client_main' . $this->min . '.js', array(), DARKIFY_VERSION);
143 - }
123 + $enable_default_dark_mode = $options['enable_default_dark_mode'];
124 + $enable_time = $options['enable_time'];
125 + $enable_time_based_dark = isset($enable_time['enable_time_based_dark']) ? $enable_time['enable_time_based_dark'] : "";
126 + $time_based_dark_start = isset($enable_time['time_based_dark_start']['from']) ? $enable_time['time_based_dark_start']['from'] : "";
127 + $time_based_dark_stop = isset($enable_time['time_based_dark_start']['to']) ? $enable_time['time_based_dark_start']['to'] : "";
128 + $grayscale = $options['brightness'];
129 + $enable_low_image_brightness = isset($grayscale['enable_low_image_brightness']) ? $grayscale['enable_low_image_brightness'] : "";
130 + $low_image_brightness_label = isset($grayscale['low_image_brightness_label']) ? $grayscale['low_image_brightness_label'] : "";
131 + $grayscale = isset($options['grayscale']);
132 + $enable_image_grayscale = isset($grayscale['enable_image_grayscale']) ? $grayscale['enable_image_grayscale'] : "";
133 + $image_grayscale_label = isset($grayscale['image_grayscale_label']) ? $grayscale['image_grayscale_label'] : "";
134 + $disallowed_low_grayscale_images = isset($grayscale['disallowed_low_grayscale_images']) ? $grayscale['disallowed_low_grayscale_images'] : "";
135 + $darken_background = isset($options['darken_background']);
136 + $enable_low_image_darken = isset($darken_background['enable_low_image_darken']) ? $darken_background['enable_low_image_darken'] : "";
137 + $low_image_darken_label = isset($darken_background['low_image_darken_label']) ? $darken_background['low_image_darken_label'] : "";
138 + $video_brightness = isset($options['video_brightness']);
139 + $enable_low_video_brightness = isset($video_brightness['enable_low_video_brightness']) ? $video_brightness['enable_low_video_brightness'] : "";
140 + $low_video_brightness_label = isset($video_brightness['low_video_brightness_label']) ? $video_brightness['low_video_brightness_label'] : "";
141 + $video_grayscale = isset($options['video_grayscale']);
142 + $enable_video_grayscale = isset($video_grayscale['enable_video_grayscale']) ? $video_grayscale['enable_video_grayscale'] : "";
144 143
145 - if($hook === 'toplevel_page_darkify') {
146 - wp_enqueue_script('darkify-help-page', DARKIFY_DIR_URL . 'src/Admin/HelpPage/assets/js/help-page' . $this->min . '.js', array('darkify-plugins'), DARKIFY_VERSION, true);
144 + if ($options["enable_admin_panel_dark_mode"]) {
145 + if ($this->darkify_is_dark_mode_allowed()) {
146 + if (!wp_style_is('darkify-admin-switch', 'enqueued')) {
147 + wp_enqueue_style('darkify-admin-switch', DARKIFY_DIR_URL . 'src/assets/css/client_main.css', array(), DARKIFY_VERSION, 'all');
148 + }
149 + wp_enqueue_script('darkify-admin-client-main', DARKIFY_DIR_URL . 'src/assets/js/client_main.js', array(), DARKIFY_VERSION);
150 +
151 + $darkify_data = array(
152 + 'darkify_switch_unique_id' => $this->unique_id,
153 + 'darkify_is_this_admin_panel' => is_admin() ? "1" : "0",
154 + 'darkify_enable_default_dark_mode' => $enable_default_dark_mode,
155 + 'darkify_enable_os_aware' => $options["enable_os_aware"],
156 + 'darkify_enable_keyboard_shortcut' => $options["enable_keyboard_shortcut"],
157 + 'darkify_enable_time_based_dark' => $enable_time_based_dark,
158 + 'darkify_time_based_dark_start' => $time_based_dark_start ? $time_based_dark_start : "19:00",
159 + 'darkify_time_based_dark_stop' => $time_based_dark_stop ? $time_based_dark_stop : "07:00",
160 + 'darkify_alternative_dark_mode_switch' => $options["alternative_dark_mode_switcher"],
161 + 'darkify_enable_low_image_brightness' => $enable_low_image_brightness,
162 + 'darkify_image_brightness_to' => $low_image_brightness_label,
163 + 'darkify_enable_image_grayscale' => $enable_image_grayscale,
164 + 'darkify_image_grayscale_to' => $image_grayscale_label,
165 + 'darkify_disallowed_grayscale_images' => $disallowed_low_grayscale_images,
166 + 'darkify_enable_bg_image_darken' => $enable_low_image_darken,
167 + 'darkify_bg_image_darken_to' => $low_image_darken_label,
168 + 'darkify_enable_invert_inline_svg' => $options["enable_invert_inline_svg"],
169 + 'darkify_enable_low_video_brightness' => $enable_low_video_brightness,
170 + 'darkify_video_brightness_to' => $low_video_brightness_label,
171 + 'darkify_enable_video_grayscale' => $enable_video_grayscale,
172 + // Add more variables as needed...
173 + );
174 + wp_localize_script('darkify-admin-client-main', 'darkify_data', $darkify_data);
175 + }
147 176 }
148 177 }
149 178
150 - /*
151 - Dequeue Darkify scripts and styles on specific admin pages (e.g., MainWP pages)
152 - */
153 -
154 - public function admin_dequeue_for_specefic_pages()
179 + public function darkify_admin_bar_switch($wp_admin_bar)
155 180 {
156 - $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
157 - $dequeue_pages = array(
158 - 'mainwp_tab',
159 - 'managesites',
160 - 'ManageClients',
161 - 'CostSummary',
162 - 'InsightsOverview',
163 - 'Extensions',
164 - 'RESTAPI',
165 - 'mainwp-setup',
166 - 'ThemesManage',
167 - 'PluginsManage',
168 - 'InsightsManage',
169 - 'ManageGroups',
170 - 'UpdatesManage',
171 - 'PluginsInstall',
172 - 'PluginsAutoUpdate',
173 - 'PluginsIgnore',
174 - 'PluginsAbandoned',
175 - 'PluginsIgnoredAbandoned',
176 - 'ThemesInstall',
177 - 'ThemesAutoUpdate',
178 - 'ThemesIgnore',
179 - 'ThemesAbandoned',
180 - 'ThemesIgnoredAbandoned',
181 - 'UserBulkManage',
182 - 'UserBulkAdd',
183 - 'BulkImportUsers',
184 - 'UpdateAdminPasswords',
185 - 'PostBulkManage',
186 - 'Extensions-Mainwp-Backups',
187 - 'Extensions-Mainwp-Security',
188 - 'Extensions-Mainwp-Analytics',
189 - 'Mainwp-Monitoring',
190 - 'Extensions-Mainwp-Agency',
191 - 'Extensions-Mainwp-Administrative',
192 - 'Extensions-Mainwp-Development',
193 - 'Extensions-Mainwp-Performance',
194 - 'ClientAddNew',
195 - 'ClientImport',
196 - 'ManageCostTracker',
197 - 'CostTrackerAdd',
198 - 'AddApiKeys',
199 - );
200 -
201 -
202 - if ( in_array( $page, $dequeue_pages, true ) ) {
203 - wp_deregister_style( 'darkify-admin-switch' );
204 - wp_dequeue_script( 'darkify-admin-client-main' );
181 + if ($this->darkify_is_dark_mode_allowed()) {
182 + $args = array(
183 + 'parent' => 'top-secondary',
184 + 'id' => 'darkify_admin_bar_switch_container',
185 + 'meta' => array(
186 + 'class' => 'darkify_admin_bar_switch_container',
187 + 'onclick' => 'darkify_switch_trigger()',
188 + )
189 + );
190 + $wp_admin_bar->add_node($args);
191 + }
205 192 }
206 -
207 - }
208 193
209 - /**
210 - * Review Text.
211 - *
212 - * @param string $text text.
213 - *
214 - * @return string
215 - */
216 - public function darkify_admin_footer( $text ) {
217 -
218 - $screen = get_current_screen();
219 -
220 - if ( 'toplevel_page_darkify' === $screen->id ) {
221 - $text = sprintf(
222 - /* translators: 1: start strong tag, 2: close strong tag. 3: start link 4: close link */
223 - __( '<i>Enjoying %1$sDarkify?%2$s Please rate us %3$sWordPress.org%4$s. Your positive feedback will help us grow more. Thank you! 😊</i>', 'darkify' ),
224 - '<strong>',
225 - '</strong>',
226 - '<span class="greet-footer-text-star">★★★★★</span> <a href="https://wordpress.org/support/plugin/darkify/reviews/#new-post" target="_blank">',
227 - '</a>'
228 - );
229 - }
230 -
231 - return $text;
232 - }
233 -
234 - // Plugin settings in plugin list
235 - public function add_plugin_action_links(array $links)
194 + public function darkify_is_dark_mode_allowed()
236 195 {
237 - $new_links = array(
238 - sprintf('<a href="' . esc_url(admin_url('admin.php?page=darkify')) . '">' . esc_html__('Settings', 'darkify') . '</a>'),
239 - sprintf('<a target="_blank" href="https://wordpress.org/support/plugin/darkify/">' . esc_html__('Support', 'darkify') . '</a>'),
240 - // sprintf('<a style="font-weight: bold;color:#171717" target="_blank" href="https://darkifywp.com/pricing/?ref=1">' . esc_html__('Go Pro', 'darkify') . '</a>'),
241 - );
242 196
243 - $links[] = sprintf( '<a style="font-weight: bold;color:#35b747" target="_blank" href="https://darkifywp.com/pricing/?utm_source=darkify_plugin&utm_medium=action_link&utm_campaign=regular">%s</a>', esc_html__( 'Go Pro!', 'darkify' ));
244 -
245 - return array_merge($new_links, $links);
197 + $options = get_option('darkify');
198 + $disallowed_admin_pages = isset($options["disallowed_admin_pages"]) ? $options["disallowed_admin_pages"] : "";
199 + /* Disable on Disallowed Admin Plugins */
200 + if ($this->utils->isRestrictedByDisallowedAdminPages($disallowed_admin_pages)) {
201 + return False;
202 + }
203 + return True;
246 204 }
247 205
248 - /**
249 - * Add plugin row meta link.
250 - *
251 - * @since 2.0
252 - *
253 - * @param array $plugin_meta .
254 - * @param string $file .
255 - *
256 - * @return array
257 - */
258 - public function after_darkify_row_meta( $plugin_meta, $file ) {
259 -
260 - if ( DARKIFY_BASENAME === $file ) {
261 - $plugin_meta[] = '<a href="'.DARKIFY_DEMO_URL.'" target="_blank">' . __( 'Live Demo', 'darkify' ) . '</a>';
262 - }
263 -
264 - return $plugin_meta;
265 - }
266 -
267 -
268 - public function darkify_admin_bar_switch($wp_admin_bar)
269 - {
270 - $args = array(
271 - 'parent' => 'top-secondary',
272 - 'id' => 'darkify_admin_bar_switch_container',
273 - 'meta' => array(
274 - 'class' => 'darkify_admin_bar_switch_container',
275 - 'onclick' => 'darkify_switch_trigger()',
276 - )
277 - );
278 - $wp_admin_bar->add_node($args);
279 - }
280 -
281 206 public function darkify_admin_header_script()
282 207 {
283 - include_once DarkifyUtils::darkify_locate_template('header_script.php');
208 + if ($this->darkify_is_dark_mode_allowed()) {
209 + include_once Helpers::darkify_locate_template('header_script.php');
210 + }
284 211 }
285 212
286 213 public function darkify_admin_footer_script()
287 214 {
288 - include_once DarkifyUtils::darkify_locate_template('footer_script.php');
215 + if ($this->darkify_is_dark_mode_allowed()) {
216 + include_once Helpers::darkify_locate_template('footer_script.php');
217 + }
289 218 }
290 219
291 - public function admin_menu()
220 + public function add_plugin_page()
292 221 {
293 - // global $menu, $admin_page_hooks;
294 - $capability = apply_filters( 'darkify_ui_permission', 'manage_options' );
295 - $menu_icon = '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">
296 - <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" />
297 - <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" />
298 - <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" />
299 - <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" />
300 - <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" />
301 - <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" />
302 - <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" />
303 - <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" />
304 - <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" />
305 - </svg>');
306 222 // This page will be under "Settings"
307 223 add_menu_page(
308 224 esc_html__('Darkify', 'darkify'),
309 225 esc_html__('Darkify', 'darkify'),
310 - $capability,
226 + 'manage_options',
311 227 'darkify',
312 - [$this, 'darkify_settings'],
313 - $menu_icon,
314 - 60
228 + 'darkify_settings',
229 + '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">
230 + <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" />
231 + <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" />
232 + <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" />
233 + <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" />
234 + <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" />
235 + <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" />
236 + <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" />
237 + <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" />
238 + <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" />
239 +</svg>'),
240 + 9
315 241 );
242 + do_action('darkify_before_upgrade_pro_menu');
316 243 add_submenu_page(
317 244 'darkify',
318 245 __(
319 - 'Upgrade To Pro! 👑',
246 + '👑 Upgrade to Pro!',
320 247 'darkify'
321 248 ),
322 - sprintf('<span style="color: #35b747;font-weight:600;" class="darkify-get-pro-text">%s</span>', __('Upgrade To Pro! 👑', 'darkify')),
249 + sprintf('<span style="color: #35b747;font-weight: bold;" class="darkify-get-pro-text">%s</span>', __('👑 Upgrade to Pro!', 'darkify')),
323 250 'manage_options',
324 - 'https://darkifywp.com/pricing/?utm_source=darkify_plugin&utm_medium=submenu_page&utm_campaign=regular'
251 + 'https://themeatelier.net/downloads/darkify/'
325 252 );
326 -
327 - }
328 -
329 - public function darkify_settings() {}
330 -
331 - /**
332 - * Load classic editor scripts.
333 - *
334 - * @since 5.0.0
335 - */
336 - public function load_classic_editor_scripts()
337 - {
338 - $options = get_option('darkify');
339 - $classic_editor_dark_mode = isset($options['classic_editor_dark_mode']) ? $options['classic_editor_dark_mode'] : '';
340 - if (! current_user_can('edit_posts') && ! current_user_can('edit_pages')) {
341 - return;
342 - }
343 - if (get_user_option('rich_editing') !== 'true') {
344 - return;
345 - }
346 -
347 - // Bail if admin_classic_editor is not enabled.
348 - if (! wp_validate_boolean($classic_editor_dark_mode)) {
349 - return;
350 - }
351 -
352 - add_filter('mce_external_plugins', function ($plugins) {
353 - $plugins['darkify_button'] = plugins_url('src/assets/js/admin-classic-editor.js', DARKIFY_FILE);
354 - return $plugins;
355 - });
356 -
357 - add_filter('mce_buttons', function ($buttons) {
358 - $buttons[] = 'darkify_button';
359 - return $buttons;
360 - });
253 + do_action('darkify_after_upgrade_pro_menu');
361 254 }
362 255 }