Api_Server::has_credits()

has_credits


Return Return

(bool)


Source Source

File: src/core/classes/class-api-server.php

	public static function has_credits() {

		$license = self::has_valid_license();

		if ( 'Uncanny Automator Pro' === $license['item_name'] ) {
			return true;
		}

		if ( intval( $license['paid_usage_count'] ) >= intval( $license['usage_limit'] ) ) {
			throw new \Exception( __( 'Not enough credits', 'uncanny-automator' ) );
		}

		return true;
	}