Файловый менеджер - Редактировать - /home/bean7936/perfect-community.com/442aa3/malcare-security.tar
Назад
wp_db.php 0000644 00000014153 15174712155 0006364 0 ustar 00 <?php // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared if (!defined('ABSPATH')) exit; if (!class_exists('MCWPDb')) : class MCWPDb { public function dbprefix() { global $wpdb; $prefix = $wpdb->base_prefix ? $wpdb->base_prefix : $wpdb->prefix; return $prefix; } public function prepare($query, $args) { global $wpdb; return $wpdb->prepare($query, $args); } public function getSiteId() { global $wpdb; return $wpdb->siteid; } public function getResult($query, $obj = ARRAY_A) { global $wpdb; return $wpdb->get_results($query, $obj); } public function query($query) { global $wpdb; return $wpdb->query($query); } public function getVar($query, $col = 0, $row = 0) { global $wpdb; return $wpdb->get_var($query, $col, $row); } public function getCol($query, $col = 0) { global $wpdb; return $wpdb->get_col($query, $col); } public function getLastRowId($col_name, $table_name) { $query = "SELECT MAX($col_name) AS last_id FROM $table_name"; $results = $this->getResult($query); if (empty($results) || !is_array($results) || !is_array($results[0]) || !array_key_exists("last_id", $results[0])) { return null; } $last_id = $results[0]['last_id']; if ($last_id === null) { return 0; } else if (is_numeric($last_id) === true) { return (int) $last_id; } } public function tableName($table) { return $table[0]; } public function showTables() { $tables = $this->getResult("SHOW TABLES", ARRAY_N); return array_map(array($this, 'tableName'), $tables); } public function showTableStatus() { return $this->getResult("SHOW TABLE STATUS"); } public function tableKeys($table) { return $this->getResult("SHOW KEYS FROM $table;"); } public function showDbVariables($variable) { $variables = $this->getResult("Show variables like '%$variable%' ;"); $result = array(); foreach ($variables as $variable) { $result[$variable["Variable_name"]] = $variable["Value"]; } return $result; } public function describeTable($table) { return $this->getResult("DESCRIBE $table;"); } public function showTableIndex($table) { return $this->getResult("SHOW INDEX FROM $table"); } public function checkTable($table, $type) { return $this->getResult("CHECK TABLE $table $type;"); } public function repairTable($table) { return $this->getResult("REPAIR TABLE $table;"); } public function showTableCreate($table) { return $this->getVar("SHOW CREATE TABLE $table;", 1); } public function rowsCount($table) { $count = $this->getVar("SELECT COUNT(*) FROM $table;"); return intval($count); } public function createTable($query, $name, $usedbdelta = false) { $table = $this->getBVTable($name); if (!$this->isTablePresent($table)) { if ($usedbdelta) { if (!function_exists('dbDelta')) require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($query); } else { $this->query($query); } } return $this->isTablePresent($table); } public function createTables($tables, $usedbdelta = false) { $result = array(); foreach ($tables as $table => $query) { $result[$table] = $this->createTable($query, $table, $usedbdelta); } return $result; } public function alterBVTable($query, $name) { $resp = false; $table = $this->getBVTable($name); if ($this->isTablePresent($table)) { $resp = $this->query($query); } return $resp; } public function alterTables($tables) { $result = array(); foreach ($tables as $table => $query) { $result[$table] = $this->alterBVTable($query, $table); } return $result; } public function getTableContent($table, $fields = '*', $filter = '', $limit = 0, $offset = 0) { $query = "SELECT $fields from $table $filter"; if ($limit > 0) $query .= " LIMIT $limit"; if ($offset > 0) $query .= " OFFSET $offset"; $rows = $this->getResult($query); return $rows; } public function isTablePresent($table) { return ($this->getVar("SHOW TABLES LIKE '$table'") === $table); } public function getCharsetCollate() { global $wpdb; return $wpdb->get_charset_collate(); } public function getWPTable($name) { return ($this->dbprefix() . $name); } public function getBVTable($name) { return ($this->getWPTable("bv_" . $name)); } public function truncateBVTable($name) { $table = $this->getBVTable($name); if ($this->isTablePresent($table)) { return $this->query("TRUNCATE TABLE $table;"); } else { return false; } } public function deleteBVTableContent($name, $filter = "") { $table = $this->getBVTable($name); if ($this->isTablePresent($table)) { return $this->query("DELETE FROM $table $filter;"); } else { return false; } } public function dropBVTable($name) { $table = $this->getBVTable($name); if ($this->isTablePresent($table)) { $this->query("DROP TABLE IF EXISTS $table;"); } return !$this->isTablePresent($table); } public function dropTables($tables) { $result = array(); foreach ($tables as $table) { $result[$table] = $this->dropBVTable($table); } return $result; } public function truncateTables($tables) { $result = array(); foreach ($tables as $table) { $result[$table] = $this->truncateBVTable($table); } return $result; } public function deleteRowsFromtable($name, $count = 1) { $table = $this->getBVTable($name); if ($this->isTablePresent($table)) { return $this->getResult("DELETE FROM $table LIMIT $count;"); } else { return false; } } public function replaceIntoBVTable($name, $value) { global $wpdb; $table = $this->getBVTable($name); return $wpdb->replace($table, $value); } public function insertIntoBVTable($name, $value) { global $wpdb; $table = $this->getBVTable($name); return $wpdb->insert($table, $value); } public function tinfo($name) { $result = array(); $table = $this->getBVTable($name); $result['name'] = $table; if ($this->isTablePresent($table)) { $result['exists'] = true; $result['createquery'] = $this->showTableCreate($table); } return $result; } public function getMysqlVersion() { return $this->showDbVariables('version')['version']; } } endif; wp_file_system.php 0000644 00000004450 15174712155 0010321 0 ustar 00 <?php if (!defined('ABSPATH')) exit; if (!class_exists('MCWPFileSystem')) : class MCWPFileSystem { private static $instance = null; private $filesystem = null; const RESOURCE_TYPE_FILE = 'f'; private function __construct() { $this->initFilesystem(); } private function initFilesystem() { if ($this->filesystem === null) { require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; $this->filesystem = new WP_Filesystem_Direct(null); } } public static function getInstance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; } public function putContents($file, $contents, $perm = 0644) { return $this->filesystem->put_contents($file, $contents, $perm); } public function getContents($file) { return $this->filesystem->get_contents($file); } public function removeFile($path) { return $this->filesystem->delete($path, false, self::RESOURCE_TYPE_FILE); } public function rmdir($path, $recursive = false) { return $this->filesystem->delete($path, $recursive); } public function isWritable($path) { return $this->filesystem->is_writable($path); } public function isDir($path) { return $this->filesystem->is_dir($path); } public function exists($path) { return $this->filesystem->exists($path); } public function move($source, $destination, $overwrite = false) { return $this->filesystem->move($source, $destination, $overwrite); } public function getchmodOctal($path) { return intval($this->getchmod($path), 8); } public function getchmod($path) { return $this->filesystem->getchmod($path); } public function size($file) { return $this->filesystem->size($file); } public function chmod($file, $mode = false, $recursive = false) { return $this->filesystem->chmod($file, $mode, $recursive); } public function isReadable($file) { return $this->filesystem->is_readable($file); } public function checkForErrors() { if ($this->filesystem !== null && is_wp_error($this->filesystem->errors)) { $wp_error = $this->filesystem->errors; if (!empty($wp_error->errors)) { return $wp_error->get_error_message(); } } return null; } } endif; account.php 0000644 00000016220 15174712155 0006722 0 ustar 00 <?php if (!defined('ABSPATH')) exit; if (!class_exists('MCAccount')) : class MCAccount { public $settings; public $public; public $secret; public static $api_public_key = 'bvApiPublic'; public static $accounts_list = 'bvAccountsList'; private static $default_credential = array(); public function __construct($settings, $public, $secret) { $this->settings = $settings; $this->public = $public; $this->secret = $secret; } public static function find($settings, $public) { $accounts = self::allAccounts($settings); if (array_key_exists($public, $accounts) && isset($accounts[$public]['secret'])) { $secret = $accounts[$public]['secret']; } if (empty($secret) || (strlen($secret) < 32)) { if (!empty(self::$default_credential) && array_key_exists($public, self::$default_credential) && strlen($public) >= 32) { $secret = self::$default_credential[$public]; self::addAccount($settings, $public, $secret); } else { return null; } } return new self($settings, $public, $secret); } public static function update($settings, $allAccounts) { $settings->updateOption(self::$accounts_list, $allAccounts); } public static function randString($length) { $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $str = ""; $size = strlen($chars); for( $i = 0; $i < $length; $i++ ) { $str .= $chars[rand(0, $size - 1)]; // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand } return $str; } public static function sanitizeKey($key) { return preg_replace('/[^a-zA-Z0-9_\-]/', '', $key); } public static function apiPublicAccount($settings) { $pubkey = $settings->getOption(self::$api_public_key); return self::find($settings, $pubkey); } public static function updateApiPublicKey($settings, $pubkey) { $settings->updateOption(self::$api_public_key, $pubkey); } public static function getDefaultPublicKey() { return MCHelper::arrayKeyFirst(self::$default_credential); } public static function getApiPublicKey($settings) { return $settings->getOption(self::$api_public_key); } public static function getPlugName($settings) { $bvinfo = new MCInfo($settings); return $bvinfo->plugname; } public static function allAccounts($settings) { $accounts = $settings->getOption(self::$accounts_list); if (!is_array($accounts)) { $accounts = array(); } return $accounts; } public static function accountsByPlugname($settings) { $accounts = self::allAccounts($settings); $accountsByPlugname = array(); $plugname = self::getPlugName($settings); foreach ($accounts as $pubkey => $value) { if (array_key_exists($plugname, $value) && $value[$plugname] == 1) { $accountsByPlugname[$pubkey] = $value; } } return $accountsByPlugname; } public static function accountsByType($settings, $account_type) { $accounts = self::allAccounts($settings); $accounts_by_type = array(); foreach ($accounts as $pubkey => $value) { if (array_key_exists('account_type', $value) && $value['account_type'] === $account_type) { $accounts_by_type[$pubkey] = $value; } } return $accounts_by_type; } public static function accountsByGid($settings, $account_gid) { $accounts = self::allAccounts($settings); $accounts_by_gid = array(); foreach ($accounts as $pubkey => $value) { if (array_key_exists('account_gid', $value) && $value['account_gid'] === $account_gid) { $accounts_by_gid[$pubkey] = $value; } } return $accounts_by_gid; } public static function accountsByPattern($settings, $search_key, $search_pattern) { $accounts = self::allAccounts($settings); $accounts_by_pattern = array(); foreach ($accounts as $pubkey => $value) { if (array_key_exists($search_key, $value) && MCHelper::safePregMatch($search_pattern, $value[$search_key]) == 1) { $accounts_by_pattern[$pubkey] = $value; } } return $accounts_by_pattern; } public static function isConfigured($settings) { $accounts = self::accountsByPlugname($settings); return (sizeof($accounts) >= 1); } public static function setup($settings) { $bvinfo = new MCInfo($settings); $settings->updateOption($bvinfo->plug_redirect, 'yes'); $settings->updateOption('bvActivateTime', time()); } public function authenticatedUrl($method) { $bvinfo = new MCInfo($this->settings); $qstr = http_build_query($this->newAuthParams($bvinfo->version)); return $bvinfo->appUrl().$method."?".$qstr; } public function newAuthParams($version) { $bvinfo = new MCInfo($this->settings); $args = array(); $time = time(); $sig = sha1($this->public.$this->secret.$time.$version); $args['sig'] = $sig; $args['bvTime'] = $time; $args['bvPublic'] = $this->public; $args['bvVersion'] = $version; $args['sha1'] = '1'; $args['plugname'] = $bvinfo->plugname; return $args; } public static function addAccount($settings, $public, $secret) { $accounts = self::allAccounts($settings); if (!isset($public, $accounts)) { $accounts[$public] = array(); } $accounts[$public]['secret'] = $secret; self::update($settings, $accounts); } public function info() { return array( "public" => substr($this->public, 0, 6) ); } public function updateInfo($info) { $accounts = self::allAccounts($this->settings); $account_type = $info["account_type"]; $pubkey = $info['pubkey']; if (!array_key_exists($pubkey, $accounts)) { $accounts[$pubkey] = array(); } if (array_key_exists('secret', $info)) { $accounts[$pubkey]['secret'] = $info['secret']; } $accounts[$pubkey]['account_gid'] = $info['account_gid']; $accounts[$pubkey]['lastbackuptime'] = time(); if (isset($info["speed_plugname"])) { $speed_plugname = $info["speed_plugname"]; $accounts[$pubkey][$speed_plugname] = true; } if (isset($info["plugname"])) { $plugname = $info["plugname"]; $accounts[$pubkey][$plugname] = true; } $accounts[$pubkey]['account_type'] = $account_type; $accounts[$pubkey]['url'] = $info['url']; $accounts[$pubkey]['email'] = $info['email']; self::update($this->settings, $accounts); } public static function remove($settings, $pubkey) { $accounts = self::allAccounts($settings); if (array_key_exists($pubkey, $accounts)) { unset($accounts[$pubkey]); self::update($settings, $accounts); return true; } return false; } public static function removeByAccountType($settings, $account_type) { $accounts = MCAccount::accountsByType($settings, $account_type); if (sizeof($accounts) >= 1) { foreach ($accounts as $pubkey => $value) { MCAccount::remove($settings, $pubkey); } return true; } return false; } public static function removeByAccountGid($settings, $account_gid) { $accounts = MCAccount::accountsByGid($settings, $account_gid); if (sizeof($accounts) >= 1) { foreach ($accounts as $pubkey => $value) { MCAccount::remove($settings, $pubkey); } return true; } return false; } public static function exists($settings, $pubkey) { $accounts = self::allAccounts($settings); return array_key_exists($pubkey, $accounts); } } endif; img/mc-testimony-david-mccan.jpg 0000644 00000053375 15174712155 0012643 0 ustar 00 ��� JFIF �� C $ &%# #"(-90(*6+"#2D26;=@@@&0FKE>J9?@=�� C =)#)==================================================�� d` �� �� �� �� � !�RQ b� d�BD �%k �D�DYH � h &�UA+�P !P @�AR� -l$�$@�m��$� ED �@ � eP ,�B�)� "I�B"�B�(�fԠ��z��*IT ��*"H�-h� %!@ e�@$� ��M�{x�ӎ��c?O,.`U ED �k@ % � �@T�hۗN�=�l��܌����c##�ӌu�m㗷,u(�@ (�� � ��h KRPD� � �ˡ��.�ϛ������]129��:����nh� $PD $U P2Z��� ��X߹ǯ�����~�l�L[*�R��4�>o���^j\�a ("