PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 2.0.1
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v2.0.1
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 / uninstall.php

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

65 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Fired when the plugin is uninstalled.
5 *
6 * When populating this file, consider the following flow
7 * of control:
8 *
9 * - This method should be static
10 * - Check if the $_REQUEST content actually is the plugin name
11 * - Run an admin referrer check to make sure it goes through authentication
12 * - Verify the output of $_GET makes sense
13 * - Repeat with other user roles. Best directly by using the links/query string parameters.
14 * - Repeat things for multisite. Once for a single site in the network, once sitewide.
15 *
16 * This file may be updated more in future version of the Boilerplate; however, this is the
17 * general skeleton and outline for how the file should work.
18 *
19 * For more information, see the following discussion:
20 * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
21 *
22 * @link https://themeatelier.net/
23 * @since 1.0.0
24 *
25 * @package Darkify
26 */
27
28 // If uninstall not called from WordPress, then exit.
29 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
30 exit;
31 }
32
33
34 /**
35 * Delete plugin data function.
36 *
37 * @return void
38 */
39 function darkify_delete_plugin_data()
40 {
41 // Delete plugin option settings.
42 $options = [
43 'darkify',
44 'darkify_pro_version',
45 'darkify_pro_db_version',
46 'darkify_pro_first_version',
47 'darkify_pro_activation_date',
48 'themeatelier_offer_banner_dismissed_new_year_2026',
49 ];
50
51 foreach ($options as $option_name) {
52 delete_option($option_name);
53 delete_site_option($option_name);
54 }
55 }
56
57 // Load WPTP file.
58 require plugin_dir_path(__FILE__) . '/darkify.php';
59 $darkify_plugin_settings = get_option('darkify');
60 $darkify_data_delete = isset($darkify_plugin_settings['darkify_data_remove']) ? $darkify_plugin_settings['darkify_data_remove'] : false;
61
62 if ($darkify_data_delete) {
63 darkify_delete_plugin_data();
64 }
65