PHP 8.2.31
Preview: recover.php Size: 1.71 KB
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/malcare-security/recover.php

<?php
if (!defined('ABSPATH')) exit;
if (!class_exists('MCRecover')) :
	class MCRecover {
		public static $default_secret_key = 'bv_default_secret_key';

		public static function defaultSecret($settings) {
			$secret = self::getDefaultSecret($settings);
			if (empty($secret)) {
				$secret = MCRecover::refreshDefaultSecret($settings);
			}
			return $secret;
		}

		public static function refreshDefaultSecret($settings) {
			$key_details = array();
			$key_details["key"] = MCAccount::randString(32);
			$key_details["expires_at"] = time() + (24 * 60 * 60);

			$settings->updateOption(self::$default_secret_key, $key_details);

			return $key_details["key"];
		}


		public static function deleteDefaultSecret($settings) {
			$settings->deleteOption(self::$default_secret_key);
		}

		public static function getDefaultSecret($settings) {
			$key_details = $settings->getOption(self::$default_secret_key);

			if (is_array($key_details) && $key_details["expires_at"] > time()) {
				return $key_details["key"];
			}

			return null;
		}

		public static function getSecretStatus($settings) {
			$key_details = $settings->getOption(self::$default_secret_key);
			$status = 'ACTIVE';
			if (!is_array($key_details)) {
				  $status = 'DELETED';
			} elseif ($key_details["expires_at"] <= time()) {
				  $status = 'EXPIRED';
			}

			return $status;
		}

		public static function validate($key) {
			return $key && strlen($key) >= 32;
		}

		public static function find($settings, $pubkey) {
			if (!self::validate($pubkey)) {
				return null;
			}

			$secret = self::getDefaultSecret($settings);
			if (!self::validate($secret)) {
				return null;
			}

			$account = new MCAccount($settings, $pubkey, $secret);
			return $account;
		}
	}
endif;

Directory Contents

Dirs: 10 × Files: 18

Name Size Perms Modified Actions
admin DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
callback DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
css DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
img DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
js DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
protect DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
wp_2fa DIR
- drwxr-xr-x 2026-06-07 01:29:47
Edit Download
7.14 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
10.68 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
7.15 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
19.46 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
8.69 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
32.35 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
1.71 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
2.92 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
17.52 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
13.86 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
1.04 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
5.60 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
6.10 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
34.64 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
2.29 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
1.57 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
2.06 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download
2.32 KB lrw-r--r-- 2026-06-07 01:29:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).