PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backup, Restore, Migration & Clone / 4.1.4
WP STAGING – WordPress Backup, Restore, Migration & Clone v4.1.4
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 1 year 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
155 lines
1 <?php
2
3 /**
4 * This namespace is wrong! Is namespacing here even required?
5 * Test carefully if consider removing it. Our code should generally always be namespaced to prevent name conflicts.
6 */
7 namespace WPStaging\Backend;
8
9 /**
10 * Uninstall WP-Staging
11 *
12 * @package WPSTG
13 * @subpackage Uninstall
14 * @copyright Copyright (c) 2015, René Hermenau
15 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
16 * @since 0.9.0
17 */
18 // No direct access
19 if (!defined('WP_UNINSTALL_PLUGIN')) {
20 exit;
21 }
22
23 /**
24 * Avoid using const here, we don't want to load the whole plugin
25 */
26 class uninstall
27 {
28 public function __construct()
29 {
30 $this->init();
31 }
32
33 private function init()
34 {
35 $options = json_decode(json_encode(get_option("wpstg_settings", [])));
36
37 /**
38 * @todo Write a query that delete all the options from option table where option_name like (wpstg_* or wpstgpro_*)
39 * but not in (wpstg_existing_clones, wpstg_existing_clones_beta, wpstg_staging_sites, wpstg_connection)
40 * but there will be not need of this condition once we add a routine that deletes staging sites
41 */
42 if (isset($options->unInstallOnDelete) && $options->unInstallOnDelete === '1') {
43 // Options
44 delete_option("wpstg_version_upgraded_from");
45 delete_option("wpstg_version");
46 delete_transient("wpstg_login_link_settings");
47 delete_option("wpstgpro_version_upgraded_from");
48 delete_option("wpstgpro_version");
49 // @see \WPStaging\Backend\Pro\Upgrade\Upgrade::OPTION_UPGRADE_DATE
50 delete_option("wpstgpro_upgrade_date");
51 // @see \WPStaging\Backend\Upgrade\Upgrade::OPTION_UPGRADE_DATE
52 delete_option("wpstg_free_upgrade_date");
53 delete_option("wpstg_installDate"); // @deprecated
54 // @see \WPStaging\Backend\Upgrade\Upgrade::OPTION_INSTALL_DATE
55 delete_option("wpstg_free_install_date");
56 // @see \WPStaging\Backend\Pro\Upgrade\Upgrade::OPTION_INSTALL_DATE
57 delete_option("wpstgpro_install_date");
58 delete_option("wpstg_firsttime"); // @deprecated
59 delete_option("wpstg_is_staging_site");
60 delete_option("wpstg_settings");
61 delete_option("wpstg_rmpermalinks_executed");
62 delete_option("wpstg_activation_redirect");
63 delete_option("wpstg_disabled_items_notice"); // @deprecated
64 delete_option("wpstg_clone_settings");
65 delete_option("wpstg_clone_excluded_files_list");
66 delete_option("wpstg_different_prefix_backup_notice");
67 /* @see \WPStaging\Pro\Notices\EntireNetworkCloneServerConfigNotice::OPTION_NAME */
68 delete_option("wpstg_entire_network_clone_notice");
69 // Old notice used for display cache on staging site.
70 delete_option("wpstg_disabled_cache_notice"); // @deprecated
71 // Old option, now moved inside wpstg_clone_settings
72 delete_option("wpstg_emails_disabled"); // @deprecated
73 delete_option("wpstg_disabled_mail_notice"); // @deprecated
74 // Option related to staging sites shifting from one db option to another
75 delete_option("wpstg_structure_updated"); // @deprecated
76 /**
77 * Option releted to the latest WP STAGING PRO version
78 * @see WPStaging\Pro\License::OPTION_PRO_LATEST_VERSION
79 */
80 delete_option("wpstg_pro_latest_version");
81 // Option that hold the old snapshots
82 delete_option("wpstg_snapshots"); // @deprecated
83 delete_option("wpstg_access_token");
84 delete_option("wpstg_backups");
85 delete_option("wpstg_old_staging_sites_backup"); // @deprecated
86 delete_option("wpstg_staging_sites_backup");
87 delete_option("wpstg_missing_cloneName_routine_executed");
88 delete_option('wpstg_googledrive');
89 delete_option('wpstg_amazons3');
90 delete_option('wpstg_sftp');
91 delete_option('wpstg_digitalocean');
92 delete_option('wpstg_wasabi');
93 delete_option('wpstg_dropbox');
94 delete_option('wpstg_one-drive');
95 delete_option('wpstg_free_backup_notice_dismissed');
96 delete_option('wpstg_first_backup_speed_index');
97 delete_option('wpstg_backup_speed_index');
98 delete_option('wpstg_backup_speed_modal_shown');
99 delete_option('wpstg_backup_notice_is_closed');
100 delete_option('wpstg_backup_notice_remind_me');
101 delete_option('wpstg_resave_permalinks_executed');
102
103 // @see \WPStaging\Backup\BackupScheduler::OPTION_BACKUP_SCHEDULES
104 delete_option('wpstg_backup_schedules');
105
106 /**
107 * @see \WPStaging\Framework\Security\UniqueIdentifier::IDENTIFIER_OPTION_NAME;
108 */
109 delete_option("wpstg_unique_identifier");
110
111
112 /* Do not delete these fields without actually deleting the staging site
113 * @create a delete routine which deletes the staging sites first
114 */
115 //delete_option( "wpstg_existing_clones" );
116 //delete_option( "wpstg_existing_clones_beta" );
117 //delete_option( "wpstg_staging_sites" );
118 //delete_option( "wpstg_connection" );
119
120 // Old wpstg 1.3 options for admin notices
121 delete_option("wpstg_start_poll");
122 delete_option("wpstg_hide_beta");
123 delete_option("wpstg_RatingDiv");
124
125 // New 2.x options for admin notices
126 delete_option("wpstg_poll");
127 delete_option("wpstg_rating");
128 delete_option("wpstg_beta");
129
130 /* @see \WPStaging\Staging\FirstRun::FIRST_RUN_KEY */
131 delete_option('wpstg_execute');
132
133 /* @see \WPStaging\Framework\BackgroundProcessing\Queue::QUEUE_TABLE_VERSION_KEY */
134 delete_option('wpstg_queue_table_version');
135
136 /** @see \WPStaging\Framework\BackgroundProcessing\Queue::QUEUE_TABLE_STRUCTURE_VERSION_KEY */
137 delete_option('wpstg_queue_table_structure_version');
138
139 /** @see \WPStaging\Framework\Notices\WarningsNotice::OPTION_NAME */
140 delete_option('wpstg_warnings_notice');
141
142 // Delete events
143 wp_clear_scheduled_hook('wpstg_weekly_event');
144
145 // Transients
146 delete_transient("wpstg_issue_report_submitted");
147
148 /** @see \WPStaging\Framework\Assets::TRANSIENT_REST_URL */
149 delete_transient('wpstg_rest_url');
150 }
151 }
152 }
153
154 new uninstall();
155