<?php
/**
 * Plugin Name:      GoodMeet
 * Description:      Google Meet Integration for WordPress.
 * Version:          1.2.1
 * Author:           Sovlix
 * Author URI:       https://sovlix.com/
 * License:          GPL-2.0+
 * License URI:      http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:      goodmeet
 * Requires at least: 5.0
 * Tested up to:     7.0
 *
 * @package SOVLIX\GOODMEET
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require_once __DIR__ . '/vendor/autoload.php';

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

		if ( ! isset( $goodmeet_fs ) ) {
			// Activate multisite network integration.
			if ( ! defined( 'WP_FS__PRODUCT_19165_MULTISITE' ) ) {
				define( 'WP_FS__PRODUCT_19165_MULTISITE', true );
			}

			// Include Freemius SDK.
			require_once __DIR__ . '/vendor/freemius/wordpress-sdk/start.php';
			add_filter( 'fs_playground_anonymous_mode_goodmeet', '__return_false' );

			$goodmeet_fs = fs_dynamic_init(
				array(
					'id'                  => '19165',
					'slug'                => 'goodmeet',
					'premium_slug'        => 'goodmeet-pro',
					'type'                => 'plugin',
					'public_key'          => 'pk_4312ea613fca6226920cec922c00d',
					'is_premium'          => false,
					// 'premium_suffix'      => 'Pro',
					// If your plugin is a serviceware, set this option to false.
					'has_premium_version' => true,
					'has_addons'          => false,
					'has_paid_plans'      => true,
					'parallel_activation' => array(
						'enabled'                  => true,
						'premium_version_basename' => 'goodmeet-pro/goodmeet-pro.php',
					),
					'menu'                => array(
						'slug'       => 'goodmeet',
						'first-path' => 'admin.php?page=goodmeet-settings',
						'support'    => false,
						'contact'    => false,
						'network'    => true,
					),
					'is_live'             => true,
				)
			);
		}

		return $goodmeet_fs;
	}

	// Init Freemius.
	goodmeet_fs();
	// Signal that SDK was initiated.
	do_action( 'goodmeet_fs_loaded' );
}

if ( ! defined( 'GOODMEET_VERSION' ) ) {
	define( 'GOODMEET_VERSION', '1.2.1' );
	define( 'GOODMEET_FILE', __FILE__ );
	define( 'GOODMEET_PATH', dirname( GOODMEET_FILE ) );
	define( 'GOODMEET_INCLUDES', GOODMEET_PATH . '/includes' );
	define( 'GOODMEET_FRONTEND', GOODMEET_PATH . '/includes/Frontend' );
	define( 'GOODMEET_TEMPLATES', GOODMEET_PATH . '/templates' );
	define( 'GOODMEET_URL', plugin_dir_url( GOODMEET_FILE ) );
	define( 'GOODMEET_ASSETS', GOODMEET_URL . 'assets' );
	define( 'GOODMEET_CSS_DIR', GOODMEET_URL . 'assets/css/' );
	define( 'GOODMEET_BUILD_CSS_DIR', GOODMEET_URL . 'assets/dist/' );
	define( 'GOODMEET_JS_DIR', GOODMEET_URL . 'assets/dist/' );

	// Load plugin base file.
	include_once GOODMEET_INCLUDES . '/goodmeet-plugin.php';
}
