<?php
/**
 * Plugin Name: MonkeyDesign Content Expiry
 * Plugin URI:  https://monkeydesign.hu/en/products/content-expiry
 * Description: Automatically expire posts, pages, and custom post types on a set date. Lightweight, secure, and PRO-ready.
 * Version:     1.1.0
 * Author:      MonkeyDesign
 * Author URI:  https://monkeydesign.hu
 * License:     GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: monkeydesign-content-expiry
 * Domain Path: /languages
 * Requires PHP: 8.0
 * Requires at least: 6.0
 */

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

if ( function_exists( 'mce_fs' ) ) {
	mce_fs()->set_basename( true, __FILE__ );
} else {

	if ( ! function_exists( 'mce_fs' ) ) {
		function mce_fs() {
			global $mce_fs;

			if ( ! isset( $mce_fs ) ) {
				require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';

				$mce_fs = fs_dynamic_init( array(
					'id'                  => '30807',
					'slug'                => 'monkeydesign-content-expiry',
					'premium_slug'        => 'content-expiry-md-pro',
					'type'                => 'plugin',
					'public_key'          => 'pk_c8997291bde9071de9bce407c22af',
					'is_premium'          => false,
					'premium_suffix'      => 'PRO',
					'has_premium_version' => true,
					'has_addons'          => false,
					'has_paid_plans'      => true,
					'is_org_compliant'    => true,
					'menu'                => array(
						'slug'    => 'content-expiry-md',
						'support' => false,
					),
				) );
			}

			return $mce_fs;
		}

		mce_fs();
		do_action( 'mce_fs_loaded' );
	}

	define( 'MDCE_VERSION',     '1.1.0' );
	define( 'MDCE_PLUGIN_FILE', __FILE__ );
	define( 'MDCE_PLUGIN_DIR',  plugin_dir_path( __FILE__ ) );
	define( 'MDCE_PLUGIN_URL',  plugin_dir_url( __FILE__ ) );

	require_once MDCE_PLUGIN_DIR . 'includes/class-plugin.php';

	add_action( 'plugins_loaded', [ MDCE\Plugin::class, 'boot' ] );
}
