<?php
/**
 * Freemius bootstrap.
 *
 * @package Consortia_Quick_Find_Replace
 */

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

if ( ! function_exists( 'consortia_qfr_fs' ) ) {
	/**
	 * Create a helper function for easy Freemius SDK access.
	 *
	 * @return Freemius|null
	 */
	function consortia_qfr_fs() {
		global $consortia_qfr_fs;

		if ( isset( $consortia_qfr_fs ) ) {
			return $consortia_qfr_fs;
		}

		$sdk_path = CONSORTIA_QFR_DIR . 'vendor/freemius/start.php';

		if ( ! file_exists( $sdk_path ) ) {
			return null;
		}

		require_once $sdk_path;

		$consortia_qfr_fs = fs_dynamic_init(
			array(
				'id'                  => '27779',
				'slug'                => 'consortia-quick-find-replace',
				'type'                => 'plugin',
				'public_key'          => 'pk_e927222db261e7004a2bc77b2d9ee',
				'is_premium'          => false,
				// If your plugin is a serviceware, set this option to false.
				'has_premium_version' => true,
				'has_addons'          => false,
				'has_paid_plans'      => true,
				'is_org_compliant'    => true,
				'menu'                => array(
					'first-path' => 'plugins.php',
					'support'    => false,
				),
			)
		);

		return $consortia_qfr_fs;
	}

	// Init Freemius when the SDK is packaged.
	if ( consortia_qfr_fs() ) {
		do_action( 'consortia_qfr_fs_loaded' );
	}
}
