Server IP : 15.235.198.142 / Your IP : 216.73.216.61 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/yme/wp-content/themes/oceanwp/inc/themepanel/includes/classes/ |
Upload File : |
<?php if ( ! class_exists( 'OceanWP_Theme_Panel_Helpers' ) ) { class OceanWP_Theme_Panel_Helpers { /** * Check if the request is done through a localhost. */ public static function is_localhost() { return ('127.0.0.1' === $_SERVER['REMOTE_ADDR'] || 'localhost' === $_SERVER['REMOTE_ADDR'] || '::1' === $_SERVER['REMOTE_ADDR']) ? 1 : 0; } /** * Convert alphabetical bit size to numericals */ public static function let_to_num( $size ) { $l = substr( $size, -1 ); $ret = substr( $size, 0, -1 ); switch ( strtoupper( $l ) ) { case 'P': $ret *= 1024; case 'T': $ret *= 1024; case 'G': $ret *= 1024; case 'M': $ret *= 1024; case 'K': $ret *= 1024; } return $ret; } /** * Convert boolean value to a string value (e.g. from true to 'true') */ public static function make_bool_string( $var ) { if ( false === $var || 'false' === $var || 0 === $var || '0' === $var || '' === $var || empty( $var ) ) { return 'false'; } return 'true'; } /** * Convert Bytes to MegaBytes. */ public static function bytes_to_mb( $bytes ) { return round( $bytes / ( 1024 * 1024 ), 2 ); } } }