| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | $this->bvinfo = new WPRInfo($settings); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function activate() { |
| 19 | - if (!isset($_REQUEST['blogvaultkey'])) { | |
| 19 | + if (!isset($_REQUEST['blogvaultkey'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 20 | 20 | ##BVKEYSLOCATE## |
| 21 | 21 | } |
| 22 | 22 | if (WPRAccount::isConfigured($this->settings)) { |
| 23 | 23 | /* This informs the server about the activation */ |
| @@ -32,8 +32,10 @@ | ||
| 32 | 32 | public function deactivate() { |
| 33 | 33 | $info = array(); |
| 34 | 34 | $this->siteinfo->basic($info); |
| 35 | 35 | ##DISABLECACHE## |
| 36 | + $this->process_deactivation_feedback($info); | |
| 37 | + | |
| 36 | 38 | $this->bvapi->pingbv('/bvapi/deactivate', $info); |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | 41 | public static function uninstall() { |
| @@ -40,8 +42,10 @@ | ||
| 40 | 42 | do_action('wpr_clear_pt_config'); |
| 41 | 43 | do_action('wpr_clear_dynsync_config'); |
| 42 | 44 | ##CLEARCACHECONFIG## |
| 43 | 45 | do_action('wpr_clear_bv_services_config'); |
| 46 | + do_action('wpr_clear_actlog_config'); | |
| 47 | + do_action('wpr_clear_wp_2fa_config'); | |
| 44 | 48 | do_action('wpr_remove_bv_preload_include'); |
| 45 | 49 | do_action('wpr_clear_php_error_config'); |
| 46 | 50 | } |
| 47 | 51 | |
| @@ -48,8 +52,18 @@ | ||
| 48 | 52 | public function clear_bv_services_config() { |
| 49 | 53 | $this->settings->deleteOption($this->bvinfo->services_option_name); |
| 50 | 54 | } |
| 51 | 55 | |
| 56 | + public function clear_wp_2fa_config() { | |
| 57 | + $meta_keys = array('wpr_2fa_enabled', 'wpr_2fa_secret', 'wpr_2fa_method', 'wpr_2fa_email_challenge', 'wpr_2fa_email_rate', 'wpr_2fa_attempts'); | |
| 58 | + foreach ($meta_keys as $meta_key) { | |
| 59 | + $this->settings->deleteMetaData('user', null, $meta_key, '', true); | |
| 60 | + } | |
| 61 | + | |
| 62 | + $this->settings->deleteOption(WPRWP2FA::$wp_2fa_option); | |
| 63 | + } | |
| 64 | + | |
| 65 | + | |
| 52 | 66 | ##SOUNINSTALLFUNCTION## |
| 53 | 67 | |
| 54 | 68 | public function footerHandler() { |
| 55 | 69 | $bvfooter = $this->settings->getOption($this->bvinfo->badgeinfo); |
| @@ -58,8 +72,19 @@ | ||
| 58 | 72 | <a href='.esc_url($bvfooter['badgeurl']).' target="_blank" ><img src="'.esc_url(plugins_url($bvfooter['badgeimg'], __FILE__)).'" alt="'.esc_attr($bvfooter['badgealt']).'" /></a></div>'; |
| 59 | 73 | } |
| 60 | 74 | } |
| 61 | 75 | |
| 76 | + private function process_deactivation_feedback(&$info) { | |
| 77 | + //phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 78 | + if (!isset($_GET['bv_deactivation_assets']) || !is_string($_GET['bv_deactivation_assets'])) { | |
| 79 | + return; | |
| 80 | + } | |
| 81 | + | |
| 82 | + $deactivation_assets = wp_unslash($_GET['bv_deactivation_assets']); | |
| 83 | + $info['deactivation_feedback'] = base64_encode($deactivation_assets); | |
| 84 | + //phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 85 | + } | |
| 86 | + | |
| 62 | 87 | public function removeBVPreload() { |
| 63 | 88 | $pattern = "@include '" . rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/bv-preload.php" . "';"; |
| 64 | 89 | WPRHelper::removePatternFromWpConfig($pattern); |
| 65 | 90 | } |
| @@ -64,5 +89,5 @@ | ||
| 64 | 89 | WPRHelper::removePatternFromWpConfig($pattern); |
| 65 | 90 | } |
| 66 | 91 | |
| 67 | 92 | } |
| 68 | -endif; | |
| 93 | +endif; | |