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