[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: class-kkart-geolite-integration.php
File is not writable. Editing disabled.
<?php /** * Wrapper for MaxMind GeoLite2 Reader * * This class provide an interface to handle geolocation and error handling. * * Requires PHP 5.4+. * * @package Kkart\Classes * @since 3.4.0 * @deprecated 3.9.0 */ defined( 'ABSPATH' ) || exit; /** * Geolite integration class. * * @deprecated 3.9.0 */ class KKART_Geolite_Integration { /** * MaxMind GeoLite2 database path. * * @var string */ private $database = ''; /** * Logger instance. * * @var KKART_Logger */ private $log = null; /** * Constructor. * * @param string $database MaxMind GeoLite2 database path. */ public function __construct( $database ) { $this->database = $database; } /** * Get country 2-letters ISO by IP address. * Returns empty string when not able to find any ISO code. * * @param string $ip_address User IP address. * @return string * @deprecated 3.9.0 */ public function get_country_iso( $ip_address ) { kkart_deprecated_function( 'get_country_iso', '3.9.0' ); $iso_code = ''; try { $reader = new MaxMind\Db\Reader( $this->database ); // phpcs:ignore PHPCompatibility.LanguageConstructs.NewLanguageConstructs.t_ns_separatorFound $data = $reader->get( $ip_address ); if ( isset( $data['country']['iso_code'] ) ) { $iso_code = $data['country']['iso_code']; } $reader->close(); } catch ( Exception $e ) { $this->log( $e->getMessage(), 'warning' ); } return sanitize_text_field( strtoupper( $iso_code ) ); } /** * Logging method. * * @param string $message Log message. * @param string $level Log level. * Available options: 'emergency', 'alert', * 'critical', 'error', 'warning', 'notice', * 'info' and 'debug'. * Defaults to 'info'. */ private function log( $message, $level = 'info' ) { if ( is_null( $this->log ) ) { $this->log = kkart_get_logger(); } $this->log->log( $level, $message, array( 'source' => 'geoip' ) ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.95 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A