HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/gopalak/public_html/wp-content/plugins/totalcontest-lite/src/Limitations/Quota.php
<?php

namespace TotalContest\Limitations;

use TotalContestVendors\TotalCore\Limitations\Limitation;

/**
 * Class Quota
 * @package TotalContest\Limitations
 */
class Quota extends Limitation {
	/**
	 * @return bool|\WP_Error
	 */
	public function check() {
		$quota        = isset( $this->args['value'] ) ? (int) $this->args['value'] : false;
		$currentValue = isset( $this->args['currentValue'] ) ? (int) $this->args['currentValue'] : false;
		$message      = empty( $this->args['message'] ) ? esc_html__( 'The quota has been exceeded.', 'totalcontest' ) : $this->args['message'];

		if ( $quota && $quota > 0 && $quota <= $currentValue ):
			return new \WP_Error( 'quota', $message );
		endif;

		return true;
	}
}