PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 2.0.4
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v2.0.4
3.1.4 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 All 93 releases
ultimate-store-kit / includes / utils.php

utils.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 2.0.4, at includes/utils.php

82 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Classes;
4
5 if (!defined('ABSPATH')) exit; // Exit if accessed directly
6
7 class Utils {
8
9
10 public static function get_site_domain() {
11 return str_ireplace('www.', '', parse_url(home_url(), PHP_URL_HOST));
12 }
13
14 public static function readable_num($size) {
15 $l = substr($size, -1);
16 $ret = substr($size, 0, -1);
17 $byte = 1024;
18
19 switch (strtoupper($l)) {
20 case 'P':
21 $ret *= 1024;
22 case 'T':
23 $ret *= 1024;
24 case 'G':
25 $ret *= 1024;
26 case 'M':
27 $ret *= 1024;
28 case 'K':
29 $ret *= 1024;
30 }
31 return $ret;
32 }
33
34 /**
35 * For get wp environment for ultimate store kit
36 * @return [type] [description]
37 */
38 public static function get_environment_info() {
39
40 // Figure out cURL version, if installed.
41 $curl_version = '';
42 if (function_exists('curl_version')) {
43 $curl_version = curl_version();
44 $curl_version = $curl_version['version'] . ', ' . $curl_version['ssl_version'];
45 }
46
47
48 // WP memory limit.
49 $wp_memory_limit = self::readable_num(WP_MEMORY_LIMIT);
50 if (function_exists('memory_get_usage')) {
51 $wp_memory_limit = max($wp_memory_limit, self::readable_num(@ini_get('memory_limit')));
52 }
53
54
55 return array(
56 'home_url' => get_option('home'),
57 'site_url' => get_option('siteurl'),
58 'version' => BDTUSK_VER,
59 'wp_version' => get_bloginfo('version'),
60 'wp_multisite' => is_multisite(),
61 'wp_memory_limit' => $wp_memory_limit,
62 'wp_debug_mode' => (defined('WP_DEBUG') && WP_DEBUG),
63 'wp_cron' => !(defined('DISABLE_WP_CRON') && DISABLE_WP_CRON),
64 'language' => get_locale(),
65 'external_object_cache' => wp_using_ext_object_cache(),
66 'php_version' => phpversion(),
67 'php_post_max_size' => self::readable_num(ini_get('post_max_size')),
68 'php_max_execution_time' => ini_get('max_execution_time'),
69 'php_max_input_vars' => ini_get('max_input_vars'),
70 'curl_version' => $curl_version,
71 'suhosin_installed' => extension_loaded('suhosin'),
72 'max_upload_size' => wp_max_upload_size(),
73 'default_timezone' => date_default_timezone_get(),
74 'fsockopen_or_curl_enabled' => (function_exists('fsockopen') || function_exists('curl_init')),
75 'soapclient_enabled' => class_exists('SoapClient'),
76 'domdocument_enabled' => class_exists('DOMDocument'),
77 'gzip_enabled' => is_callable('gzopen'),
78 'mbstring_enabled' => extension_loaded('mbstring'),
79 );
80 }
81 }
82