<?php
/**
 * Plugin Name: New User Approve
 * Plugin URI: http://newuserapprove.com/
 * Description: Allow administrators to approve users once they register. Only approved users will be allowed to access the site. For support, please go to the <a href="http://wordpress.org/support/plugin/new-user-approve">support forums</a> on wordpress.org.
 * Author: New User Approve
 * Version: 3.2.9
 * Tested up to: 7.0.4
 * Author URI: https://newuserapprove.com/
 * Text Domain: new-user-approve
 *
 * @package New_User_Approve
 */

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

if ( ! defined( 'NUA_VERSION' ) ) {
	define( 'NUA_VERSION', '3.2.9' );
}

if ( ! defined( 'NUA_FILE' ) ) {
	define( 'NUA_FILE', __FILE__ );
}

/**
 * Initialize Freemius SDK for the plugin.
 *
 * @return Freemius|null The Freemius instance or null if not initialized.
 */
function nua_init_fs() {
	global $nua_fs;

	if ( ! isset( $nua_fs ) && file_exists( __DIR__ . '/freemius/start.php' ) ) {
		// Include Freemius SDK.
		require_once __DIR__ . '/freemius/start.php';

		$nua_fs = fs_dynamic_init(
			array(
				'id'                  => '5930',
				'slug'                => 'new-user-approve',
				'type'                => 'plugin',
				'public_key'          => 'pk_ee61e9ff1f383893927fd96595470',
				'is_premium'          => false,
				'premium_suffix'      => 'Premium',
				'has_addons'          => false,
				'has_paid_plans'      => false,
				'has_premium_version' => true,
				'has_affiliation'     => 'selected',
				'menu'                => array(
					'slug'    => 'new-user-approve-admin',
					'contact' => false,
					'support' => false,
					'account' => false,
					'pricing' => false,
				),
				'is_live'             => true,
			)
		);

		// Signal that SDK was initiated.
		do_action( 'nua_fs_loaded' );
	}

	return $nua_fs;
}

/**
 * Initialize and return the main New User Approve plugin instance.
 *
 * @return PW_New_User_Approve The main plugin instance.
 */
function pw_new_user_approve() {
	// Init Freemius.
	nua_init_fs();

	// requiring the New User Approve Main file.
	require_once __DIR__ . '/class-pw-new-user-approve.php';
	return PW_New_User_Approve::instance();
}
pw_new_user_approve();
