<?php
/**
 * Convenience wrapper around Freemius's real license check.
 *
 * Whether premium modules load at all is decided in the main plugin
 * file via cecs_fs()->is__premium_only() (so Freemius's deployment
 * preprocessor can strip that code from the auto-generated free
 * version). This class is for finer-grained checks *inside* an
 * already-loaded premium class — e.g. showing an upsell instead of a
 * feature if a trial has expired — without sprinkling cecs_fs() calls
 * everywhere and without needing the __premium_only naming convention
 * (that convention only matters for code Freemius should strip; this
 * class isn't being stripped, since both free and premium code call it).
 */

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

class CPECS_License {

	public static function is_pro() {
		if ( ! function_exists( 'cecs_fs' ) ) {
			return false;
		}

		return (bool) apply_filters( 'cpecs_is_pro', cecs_fs()->can_use_premium_code() );
	}
}
