PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 3.0.0
WP STAGING – WordPress Backup, Restore, Migration & Clone v3.0.0
4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / uninstall.php
wp-staging Last commit date
Backend 2 years ago Backup 2 years ago Basic 2 years ago Core 2 years ago Framework 2 years ago Frontend 2 years ago assets 2 years ago languages 3 years ago vendor_wpstg 2 years ago Deactivate.php 2 years ago README.md 3 years ago autoloader.php 3 years ago bootstrap.php 2 years ago constantsFree.php 2 years ago freeBootstrap.php 3 years ago install.php 3 years ago opcacheBootstrap.php 2 years ago php56-compatibility.php 3 years ago readme.txt 2 years ago runtimeRequirements.php 2 years ago uninstall.php 3 years ago wp-staging-error-handler.php 3 years ago wp-staging.php 2 years ago
uninstall.php
132 lines
1 <?php
2
3 namespace WPStaging\Backend;
4
5 use WPStaging\Backup\BackupScheduler;
6
7 /**
8 * Uninstall WP-Staging
9 *
10 * @package WPSTG
11 * @subpackage Uninstall
12 * @copyright Copyright (c) 2015, René Hermenau
13 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
14 * @since 0.9.0
15 */
16 // No direct access
17 if (!defined('WP_UNINSTALL_PLUGIN')) {
18 exit;
19 }
20
21 class uninstall
22 {
23 public function __construct()
24 {
25 $this->init();
26 }
27
28 private function init()
29 {
30 $options = json_decode(json_encode(get_option("wpstg_settings", [])));
31
32 /**
33 * @todo Write a query that delete all the options from option table where option_name like (wpstg_* or wpstgpro_*)
34 * but not in (wpstg_existing_clones, wpstg_existing_clones_beta, wpstg_staging_sites, wpstg_connection)
35 * but there will be not need of this condition once we add a routine that deletes staging sites
36 */
37 if (isset($options->unInstallOnDelete) && $options->unInstallOnDelete === '1') {
38 // Options
39 delete_option("wpstg_version_upgraded_from");
40 delete_option("wpstg_version");
41 delete_transient("wpstg_login_link_settings");
42 delete_option("wpstgpro_version_upgraded_from");
43 delete_option("wpstgpro_version");
44 // @see \WPStaging\Backend\Pro\Upgrade\Upgrade::OPTION_UPGRADE_DATE
45 delete_option("wpstgpro_upgrade_date");
46 // @see \WPStaging\Backend\Upgrade\Upgrade::OPTION_UPGRADE_DATE
47 delete_option("wpstg_free_upgrade_date");
48 delete_option("wpstg_installDate"); // @deprecated
49 // @see \WPStaging\Backend\Upgrade\Upgrade::OPTION_INSTALL_DATE
50 delete_option("wpstg_free_install_date");
51 // @see \WPStaging\Backend\Pro\Upgrade\Upgrade::OPTION_INSTALL_DATE
52 delete_option("wpstgpro_install_date");
53 delete_option("wpstg_firsttime"); // @deprecated
54 delete_option("wpstg_is_staging_site");
55 delete_option("wpstg_settings");
56 delete_option("wpstg_rmpermalinks_executed");
57 delete_option("wpstg_activation_redirect");
58 delete_option("wpstg_disabled_items_notice"); // @deprecated
59 delete_option("wpstg_clone_settings");
60 delete_option("wpstg_clone_excluded_files_list");
61 delete_option("wpstg_different_prefix_backup_notice");
62 /* @see \WPStaging\Pro\Notices\EntireNetworkCloneServerConfigNotice::OPTION_NAME */
63 delete_option("wpstg_entire_network_clone_notice");
64 // Old notice used for display cache on staging site.
65 delete_option("wpstg_disabled_cache_notice"); // @deprecated
66 // Old option, now moved inside wpstg_clone_settings
67 delete_option("wpstg_emails_disabled"); // @deprecated
68 delete_option("wpstg_disabled_mail_notice"); // @deprecated
69 // Option related to staging sites shifting from one db option to another
70 delete_option("wpstg_structure_updated"); // @deprecated
71 // Store the latest WP STAGING PRO version
72 delete_option("wpstg_version_latest");
73 // Option that hold the old snapshots
74 delete_option("wpstg_snapshots"); // @deprecated
75 delete_option("wpstg_access_token");
76 delete_option("wpstg_backups");
77 delete_option("wpstg_old_staging_sites_backup"); // @deprecated
78 delete_option("wpstg_staging_sites_backup");
79 delete_option("wpstg_missing_cloneName_routine_executed");
80 delete_option('wpstg_googledrive');
81 delete_option('wpstg_amazons3');
82 delete_option('wpstg_sftp');
83 delete_option('wpstg_digitalocean');
84 delete_option('wpstg_wasabi');
85
86 // @see \WPStaging\Backup\BackupScheduler::OPTION_BACKUP_SCHEDULES
87 delete_option('wpstg_backup_schedules');
88
89 /**
90 * @see \WPStaging\Framework\Security\UniqueIdentifier::IDENTIFIER_OPTION_NAME;
91 */
92 delete_option("wpstg_unique_identifier");
93
94
95 /* Do not delete these fields without actually deleting the staging site
96 * @create a delete routine which deletes the staging sites first
97 */
98 //delete_option( "wpstg_existing_clones" );
99 //delete_option( "wpstg_existing_clones_beta" );
100 //delete_option( "wpstg_staging_sites" );
101 //delete_option( "wpstg_connection" );
102
103 // Old wpstg 1.3 options for admin notices
104 delete_option("wpstg_start_poll");
105 delete_option("wpstg_hide_beta");
106 delete_option("wpstg_RatingDiv");
107
108 // New 2.x options for admin notices
109 delete_option("wpstg_poll");
110 delete_option("wpstg_rating");
111 delete_option("wpstg_beta");
112
113 /* @see \WPStaging\Framework\Staging\FirstRun::FIRST_RUN_KEY */
114 delete_option('wpstg_execute');
115
116 /* @see \WPStaging\Framework\BackgroundProcessing\Queue::QUEUE_TABLE_VERSION_KEY */
117 delete_option('wpstg_queue_table_version');
118
119 /** @see \WPStaging\Framework\Notices\WarningsNotice::OPTION_NAME */
120 delete_option('wpstg_warnings_notice');
121
122 // Delete events
123 wp_clear_scheduled_hook('wpstg_weekly_event');
124
125 // Transients
126 delete_transient("wpstg_issue_report_submitted");
127 }
128 }
129 }
130
131 new uninstall();
132