HEX
Server: nginx/1.18.0
System: Linux vps-9dcdb12e 5.15.0-176-generic #186-Ubuntu SMP Fri Mar 13 11:01:42 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.24
Disabled: exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
Upload Files
File: /var/www/interadres.pl/wp-content/plugins/wp-smushit/core/class-file-utils.php
<?php

namespace Smush\Core;

class File_Utils {
	private $file_sizes_cache = array();
	/**
	 * @var Settings|null
	 */
	private $settings;

	public function __construct() {
		$this->settings = Settings::get_instance();
	}

	public function is_large_file( $file_path ) {
		$file_size = $this->get_file_size( $file_path );
		$cut_off   = $this->settings->get_large_file_cutoff();

		return $file_size > $cut_off;
	}

	public function get_file_size( $file_path ) {
		if ( ! isset( $this->file_sizes_cache[ $file_path ] ) ) {
			$this->file_sizes_cache[ $file_path ] = file_exists( $file_path ) ? filesize( $file_path ) : 0;
		}

		return $this->file_sizes_cache[ $file_path ];
	}
}