<?php
/**
 * Plugin Name: Consortia Quick Find & Replace
 * Description: Adds a small find/replace helper to the post editor for the current document only.
 * Version: 2.1.39
 * Author: Consortia Addons
 * Author URI: https://www.consortia.no/
 * License: GPL-2.0+
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: consortia-quick-find-replace
 * Requires at least: 5.0
 * Requires PHP: 7.4
 *
 * @package Consortia_Quick_Find_Replace
 */

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

define( 'CONSORTIA_QFR_VERSION', '2.1.39' );
define( 'CONSORTIA_QFR_FILE', __FILE__ );
define( 'CONSORTIA_QFR_DIR', plugin_dir_path( __FILE__ ) );
define( 'CONSORTIA_QFR_URL', plugin_dir_url( __FILE__ ) );

register_activation_hook( __FILE__, 'consortia_qfr_activate' );

/**
 * Store a one-time admin notice flag on activation.
 *
 * @return void
 */
function consortia_qfr_activate() {
	update_option( 'consortiaqfr_show_welcome_notice', 1, false );
}

if ( function_exists( 'consortia_qfr_fs' ) ) {
	$consortia_qfr_fs = consortia_qfr_fs();

	if ( $consortia_qfr_fs ) {
		$consortia_qfr_fs->set_basename( true, __FILE__ );
	}
} else {
	require_once CONSORTIA_QFR_DIR . 'includes/freemius.php';
	require_once CONSORTIA_QFR_DIR . 'includes/class-qfr-settings.php';
	require_once CONSORTIA_QFR_DIR . 'includes/class-qfr-plugin.php';

	Consortia_Qfr_Settings::init();
	Consortia_Qfr_Plugin::init();

	do_action( 'consortiaqfr_loaded' );
}
