PluginProbe ʕ •ᴥ•ʔ
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) / 9.5.11
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) v9.5.11
9.5.11 9.5.10.1 9.5.10 trunk 9.4.0 9.4.1 9.4.2 9.4.3 9.5.0 9.5.0.1 9.5.0.2 9.5.1 9.5.2 9.5.2.2 9.5.2.3 9.5.3 9.5.3.1 9.5.3.2 9.5.4 9.5.5 9.5.6 9.5.7 9.5.8 9.5.9
really-simple-ssl / uninstall.php
really-simple-ssl Last commit date
assets 4 weeks ago core 4 weeks ago languages 4 weeks ago lets-encrypt 4 weeks ago lib 4 weeks ago mailer 4 weeks ago modal 4 weeks ago placeholders 4 weeks ago progress 4 weeks ago security 4 weeks ago settings 4 weeks ago testssl 4 weeks ago upgrade 4 weeks ago .wp-env.json 4 weeks ago SECURITY.md 4 weeks ago class-admin.php 4 weeks ago class-cache.php 4 weeks ago class-certificate.php 4 weeks ago class-front-end.php 4 weeks ago class-installer.php 4 weeks ago class-mixed-content-fixer.php 4 weeks ago class-multisite.php 4 weeks ago class-server.php 4 weeks ago class-site-health.php 4 weeks ago class-wp-cli.php 4 weeks ago compatibility.php 4 weeks ago force-deactivate.txt 4 weeks ago functions.php 4 weeks ago index.php 4 weeks ago readme.txt 4 weeks ago rector.php 4 weeks ago rlrsssl-really-simple-ssl.php 4 weeks ago rsssl-auto-loader.php 4 weeks ago sbom.json.gz 4 weeks ago ssl-test-page.php 4 weeks ago system-status.php 4 weeks ago uninstall.php 4 weeks ago upgrade.php 4 weeks ago
uninstall.php
215 lines
1 <?php
2 // If uninstall is not called from WordPress, exit
3 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4 exit();
5 }
6
7 if ( defined('RSSSL_UPGRADING_TO_PRO') ) {
8 exit();
9 }
10
11 $rsssl_settings = is_multisite() ? get_site_option( 'rsssl_options' ) : get_option( 'rsssl_options' );
12 if ( isset( $rsssl_settings['delete_data_on_uninstall'] ) && $rsssl_settings['delete_data_on_uninstall'] ) {
13 $rsssl_options = [
14 "rsssl_enable_csp_defaults",
15 "rsssl_elementor_upgraded",
16 "rsssl_redirect_to_http_check",
17 "rsssl_pro_permissions_policy_headers_for_php",
18 "rsssl_license_attempts",
19 "rsssl_csp_report_url",
20 "rsssl_iteration",
21 "rsssl_scan",
22 "rsssl_progress",
23 "rsssl_current_action",
24 "rsssl_scan_type",
25 "rsssl_scan_active",
26 "rsssl_xmlrpc_db_version",
27 "rsssl_first_version",
28 "rsssl-pro-current-version",
29 "rsssl_xmlrpc_learning_mode_activation_time",
30 "rsssl_pro_defaults_set",
31 "rsssl_after_default_setup_completed",
32 "rsssl_ms_elementor_private_replace_progress",
33 "rsssl_ms_elementor_urls_upgraded",
34 "rsssl_ms_elementor_public_replace_progress",
35 "rsssl_csp_report_only_activation_time",
36 "rsssl_csp_report_token",
37 "rsssl_key",
38 "rsssl_transients",
39 "rsssl_pro_license_activation_limit",
40 "rsssl_ssl_verify",
41 "rsssl_pro_license_activations_left",
42 "rsssl_pro_license_expires",
43 "rsssl_csp_db_version",
44 "rsssl_debug_log_folder_suffix",
45 "rsssl_xmlrpc_learning_mode_activation_time",
46 "rsssl_port_check_2082",
47 "rsssl_port_check_8443",
48 "rsssl_port_check_2222",
49 "rsssl_csp_db_upgraded",
50 "rsssl_scan_completed_no_errors",
51 "rsssl_last_scan_time",
52 "rsssl_test_wp_login_available",
53 "rsssl_country_db_version",
54 "rsssl_country_import_version",
55 "rsssl_geo_ip_database_file",
56 "rsssl_login_attempts_db_version",
57 'rsssl_notification_email',
58 'rsssl_remaining_tasks',
59 'rsssl_activation_timestamp',
60 'rsssl_activation_timestamp',
61 'rsssl_flush_caches',
62 'rsssl_skip_dns_check',
63 'rsssl_skip_challenge_directory_request',
64 'rsssl_hosting_dashboard',
65 'rsssl_options',
66 'rsssl_le_dns_tokens',
67 'rsssl_le_dns_records_verified',
68 'rsssl_private_key_path',
69 'rsssl_certificate_path',
70 'rsssl_intermediate_path',
71 'rsssl_le_certificate_generated_by_rsssl',
72 'rsssl_ssl_dirname',
73 'rsssl_create_folders_in_root',
74 'rsssl_htaccess_file_set_',
75 'rsssl_initial_alias_domain_value_set',
76 'rsssl_le_start_renewal',
77 'rsssl_le_start_installation',
78 'rsssl_le_installation_progress',
79 'rsssl_activation_time',
80 'rsssl_le_certificate_installed_by_rsssl',
81 'rsssl_installation_error',
82 'rsssl_le_dns_configured_by_rsssl',
83 'rsssl_onboarding_dismissed',
84 'rsssl_ssl_detection_overridden',
85 'rsssl_http_methods_allowed',
86 'rsssl_show_onboarding',
87 'rsssl_deactivate_list',
88 'rsssl_firewall_error',
89 'rsssl_completed_fixes',
90 'rsssl_rest_api_optimizer_not_writable',
91 'rsssl_ssl_labs_data',
92 'rsssl_current_version',
93 'rsssl_network_activation_status',
94 'rsssl_run',
95 'rsssl_wp_version_detected',
96 'rsssl_admin_notices',
97 'rsssl_plusone_count',
98 'rsssl_siteprocessing_progress',
99 'rsssl_ssl_activation_active',
100 'rsssl_network_activation_status',
101 'rsssl_siteprocessing_progress',
102 'rsssl_header_detection_nonce',
103 'rsssl_htaccess_error',
104 'rsssl_htaccess_rules',
105 'rsssl_options',
106 'rsssl_404_cache',
107 'rsssl_404_notice_shown',
108 'rsssl_key',
109 'rsssl_change_detection_next_index',
110 'rsssl_change_detection_completed',
111 'rsssl_change_detection_mail_recently_sent',
112 'rsssl_files_with_wrong_permissions',
113 'rsssl_permissions_mail_recently_sent',
114 'rsssl_permission_check_next_index',
115 'rsssl_permission_check_completed',
116 'rsssl_homepage_contains_404_resources',
117 'rsssl_pro_password_change_required_users_checked',
118 'rsssl_activated_recommended_features_extendify',
119 'rsssl_pro_redirect_to_settings_page',
120 'rsssl_redirect_to_settings_page',
121 'rsssl_firewall_environment_signature',
122 'rsssl_csp_header_test_status',
123 'rsssl_csp_header_test_status_expiry',
124 'rsssl_permalink_changed_to_plain',
125 ];
126 foreach ( $rsssl_options as $rsssl_option_name ) {
127 delete_option( $rsssl_option_name );
128 delete_site_option( $rsssl_option_name );
129 }
130 $rsssl_transients = [
131 'rsssl_tls_version',
132 'rsssl_redirects_to_homepage',
133 'rsssl_cert_expiration_date',
134 'rsssl_sent_cert_expiration_warning',
135 'rsssl_scan_post_count',
136 'rsssl_scan',
137 'rsssl_stop_certificate_expiration_check',
138 'rsssl_pro_license_status',
139 'rsssl_xmlrpc_allowed',
140 'rsssl_http_methods_allowed',
141 'rsssl_code_execution_allowed_status',
142 'rsssl_directory_indexing_status',
143 'rsssl_htaccess_test_success',
144 'rsssl_can_use_curl_headers_check',
145 'rsssl_curl_error',
146 'rsssl_mixed_content_fixer_detected',
147 'rsssl_admin_notices',
148 'rsssl_plusone_count',
149 'rsssl_testpage',
150 'rsssl_plugin_download_active',
151 'rsssl_le_generate_attempt_count',
152 'rsssl_alias_domain_available',
153 'rsssl_le_install_attempt_count',
154 'rsssl_cw_t',
155 'rsssl_cw_server_id',
156 'rsssl_certinfo',
157 'rsssl_csp_header_test_status',
158 ];
159 foreach ( $rsssl_transients as $rsssl_transient ) {
160 delete_transient( $rsssl_transient );
161 delete_site_transient( $rsssl_transient );
162 }
163
164 // Clean up user meta data
165 global $wpdb;
166 $prefix = 'rsssl_';
167
168 // Check for % rsssl_ % to also catch _rsssl_ keys
169 $wpdb->query(
170 $wpdb->prepare(
171 "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE %s",
172 '%' . $wpdb->esc_like( $prefix ) . '%'
173 )
174 );
175
176
177 require_once(ABSPATH . 'wp-admin/includes/file.php');
178 WP_Filesystem();
179
180 function rsssl_delete_directory_wpfilesystem($dir) {
181 global $wp_filesystem;
182 if ($wp_filesystem->is_dir($dir)) {
183 $objects = $wp_filesystem->dirlist($dir);
184 foreach ($objects as $object => $objectdata) {
185 if ($wp_filesystem->is_dir($dir . "/" . $object)) {
186 rsssl_delete_directory_wpfilesystem($dir . "/" . $object);
187 }
188 else {
189 $wp_filesystem->delete($dir . "/" . $object);
190 }
191 }
192 $wp_filesystem->rmdir($dir);
193 }
194 }
195
196 $upload_dir = wp_upload_dir();
197 $really_simple_ssl_dir = $upload_dir['basedir'] . '/really-simple-ssl';
198 rsssl_delete_directory_wpfilesystem($really_simple_ssl_dir);
199
200 global $wpdb;
201 $table_names = array(
202 $wpdb->base_prefix . 'rsssl_csp_log',
203 $wpdb->base_prefix . 'rsssl_xmlrpc',
204 $wpdb->base_prefix . 'rsssl_country',
205 $wpdb->base_prefix . 'rsssl_login_attempts',
206 $wpdb->base_prefix . 'rsssl_geo_block',
207 $wpdb->base_prefix . 'rsssl_event_logs',
208 );
209
210 foreach($table_names as $table_name){
211 $sql = "DROP TABLE IF EXISTS $table_name";
212 $wpdb->query($sql);
213 }
214 }
215