| @@ -117,9 +117,8 @@ | ||
| 117 | 117 | $memory_limit = '-1 / ' . esc_html__('Unlimited', 'adminify') . ' (' . (int) WP_MEMORY_LIMIT . ' MB)'; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if ((int) WP_MEMORY_LIMIT < (int) @ini_get('memory_limit') && WP_MEMORY_LIMIT != '-1' || (int) WP_MEMORY_LIMIT < (int) @ini_get('memory_limit') && @ini_get('memory_limit') != '-1') { |
| 121 | - /* translators: %s: Server PHP memory limit, e.g. "256 MB" */ | |
| 122 | 121 | $memory_limit .= ' <span class="warning"><span class="dashicons dashicons-warning"></span> ' . sprintf(__('The WP PHP Memory Limit is less than the %s Server PHP Memory Limit', 'adminify'), (int) @ini_get('memory_limit') . ' MB') . '!</span>'; |
| 123 | 122 | } |
| 124 | 123 | |
| 125 | 124 | return $memory_limit; |
| @@ -140,9 +139,8 @@ | ||
| 140 | 139 | $php_version = PHP_VERSION; |
| 141 | 140 | } |
| 142 | 141 | |
| 143 | 142 | if ($php_version != 'N/A' && version_compare($php_version, '7.3', '<')) { |
| 144 | - /* translators: 1: Current PHP version, 2: Link to WordPress requirements page */ | |
| 145 | 143 | $php_version = '<span class="warning"><span class="dashicons dashicons-warning"></span> ' . sprintf(__('%1$s - Recommend PHP version of 7.3. See: %2$s', 'adminify'), esc_html($php_version), '<a href="https://wordpress.org/about/requirements/" target="_blank" rel="noopener">' . __('WordPress Requirements', 'adminify') . '</a>') . '</span>'; |
| 146 | 144 | } |
| 147 | 145 | |
| 148 | 146 | return $php_version; |
| @@ -407,24 +405,14 @@ | ||
| 407 | 405 | * WP Memory Usage |
| 408 | 406 | */ |
| 409 | 407 | public function get_wp_memory_usage() |
| 410 | 408 | { |
| 411 | - // Get PHP memory limit | |
| 412 | - $php_memory_limit = ini_get('memory_limit'); | |
| 413 | - | |
| 414 | - // Get WordPress memory limit if defined | |
| 415 | - $wordpress_memory_limit = defined('WP_MEMORY_LIMIT') ? WP_MEMORY_LIMIT : null; | |
| 416 | - | |
| 417 | - // Determine the effective memory limit with PHP memory limit taking priority | |
| 418 | - $get_memory_limit = $php_memory_limit ? $php_memory_limit : $wordpress_memory_limit; | |
| 419 | - | |
| 420 | - | |
| 421 | 409 | // Get WP Memory Limit |
| 422 | - // $get_memory_limit = WP_MEMORY_LIMIT; | |
| 423 | - // if ((int) WP_MEMORY_LIMIT > (int) @ini_get('memory_limit')) { | |
| 424 | - // // WP Limit can't be greater than Server Limiit | |
| 425 | - // $get_memory_limit = @ini_get('memory_limit'); | |
| 426 | - // } | |
| 410 | + $get_memory_limit = WP_MEMORY_LIMIT; | |
| 411 | + if ((int) WP_MEMORY_LIMIT > (int) @ini_get('memory_limit')) { | |
| 412 | + // WP Limit can't be greater than Server Limiit | |
| 413 | + $get_memory_limit = @ini_get('memory_limit'); | |
| 414 | + } | |
| 427 | 415 | |
| 428 | 416 | $memory_limit_convert = $this->convert_memory_size($get_memory_limit); |
| 429 | 417 | $memory_limit_format = size_format($memory_limit_convert); |
| 430 | 418 | $memory_limit = $memory_limit_convert; |
| @@ -532,12 +520,9 @@ | ||
| 532 | 520 | $result['free'] = 0; |
| 533 | 521 | $result['used'] = 0; |
| 534 | 522 | |
| 535 | 523 | $lines = null; |
| 536 | - // $path defaults to '/'. Escape it before composing the shell | |
| 537 | - // command so any future caller-supplied path can't break out | |
| 538 | - // into additional commands. | |
| 539 | - exec( sprintf( 'df /P %s', escapeshellarg( $path ) ), $lines ); | |
| 524 | + exec(sprintf('df /P %s', $path), $lines); | |
| 540 | 525 | |
| 541 | 526 | foreach ($lines as $index => $line) { |
| 542 | 527 | if ($index != 1) { |
| 543 | 528 | continue; |