PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.1.1
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.1.1
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 1 year ago Backup 1 year ago Basic 1 year ago Core 1 year ago Framework 1 year ago Frontend 1 year ago Notifications 1 year ago Staging 1 year ago assets 1 year ago languages 1 year ago resources 1 year ago vendor_wpstg 1 year ago views 1 year ago CONTRIBUTING.md 1 year ago Deactivate.php 2 years ago README.md 1 year ago SECURITY.md 2 years ago autoloader.php 3 years ago bootstrap.php 1 year ago constantsFree.php 1 year ago freeBootstrap.php 2 years ago install.php 1 year ago opcacheBootstrap.php 1 year ago readme.txt 1 year ago runtimeRequirements.php 1 year ago uninstall.php 1 year ago wp-staging-error-handler.php 1 year ago wp-staging.php 1 year ago
uninstall.php
144 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 delete_option('wpstg_dropbox');
86 delete_option('wpstg_one-drive');
87 delete_option('wpstg_free_backup_notice_dismissed');
88 delete_option('wpstg_first_backup_speed_index');
89 delete_option('wpstg_backup_speed_index');
90 delete_option('wpstg_backup_speed_modal_shown');
91 delete_option('wpstg_backup_notice_is_closed');
92 delete_option('wpstg_backup_notice_remind_me');
93 delete_option('wpstg_resave_permalinks_executed');
94
95 // @see \WPStaging\Backup\BackupScheduler::OPTION_BACKUP_SCHEDULES
96 delete_option('wpstg_backup_schedules');
97
98 /**
99 * @see \WPStaging\Framework\Security\UniqueIdentifier::IDENTIFIER_OPTION_NAME;
100 */
101 delete_option("wpstg_unique_identifier");
102
103
104 /* Do not delete these fields without actually deleting the staging site
105 * @create a delete routine which deletes the staging sites first
106 */
107 //delete_option( "wpstg_existing_clones" );
108 //delete_option( "wpstg_existing_clones_beta" );
109 //delete_option( "wpstg_staging_sites" );
110 //delete_option( "wpstg_connection" );
111
112 // Old wpstg 1.3 options for admin notices
113 delete_option("wpstg_start_poll");
114 delete_option("wpstg_hide_beta");
115 delete_option("wpstg_RatingDiv");
116
117 // New 2.x options for admin notices
118 delete_option("wpstg_poll");
119 delete_option("wpstg_rating");
120 delete_option("wpstg_beta");
121
122 /* @see \WPStaging\Staging\FirstRun::FIRST_RUN_KEY */
123 delete_option('wpstg_execute');
124
125 /* @see \WPStaging\Framework\BackgroundProcessing\Queue::QUEUE_TABLE_VERSION_KEY */
126 delete_option('wpstg_queue_table_version');
127
128 /** @see \WPStaging\Framework\BackgroundProcessing\Queue::QUEUE_TABLE_STRUCTURE_VERSION_KEY */
129 delete_option('wpstg_queue_table_structure_version');
130
131 /** @see \WPStaging\Framework\Notices\WarningsNotice::OPTION_NAME */
132 delete_option('wpstg_warnings_notice');
133
134 // Delete events
135 wp_clear_scheduled_hook('wpstg_weekly_event');
136
137 // Transients
138 delete_transient("wpstg_issue_report_submitted");
139 }
140 }
141 }
142
143 new uninstall();
144