<?php
/**
 * Plugin Name:       DreamFast Commerce Float
 * Plugin URI:        https://dreamfast-themes.com/plugins/commerce-float/
 * Description:       Quick contact and sticky add-to-cart buttons for WooCommerce stores.
 * Version:           1.1.0
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * Author:            DreamFast
 * Author URI:        https://dreamfast-themes.com/
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       dreamfast-commerce-float
 * Domain Path:       /languages
 * WC requires at least: 7.0
 * WC tested up to:   10.8
 *
 * @package DreamFast_CF
 */

defined( 'ABSPATH' ) || exit;

define( 'DREAMFAST_CF_FREE', true );
define( 'DREAMFAST_CF_VERSION', '1.1.0' );
define( 'DREAMFAST_CF_FILE', __FILE__ );
define( 'DREAMFAST_CF_PATH', plugin_dir_path( __FILE__ ) );
define( 'DREAMFAST_CF_URL', plugin_dir_url( __FILE__ ) );
define( 'DREAMFAST_CF_PRO_UPGRADE_URL', 'https://dreamfast-themes.com/plugins/commerce-float/' );

require_once DREAMFAST_CF_PATH . 'includes/woocommerce-compat.php';
require_once DREAMFAST_CF_PATH . 'includes/integrations/freemius-loader.php';

if ( ! DREAMFAST_CF_FREE && function_exists( 'dreamfast_cf_fs' ) ) {
	dreamfast_cf_fs()->set_basename( true, __FILE__ );
}

register_activation_hook(
	__FILE__,
	static function () {
		if ( ! class_exists( '\DreamFast\CommerceFloat\Plugin' ) ) {
			require_once DREAMFAST_CF_PATH . 'includes/class-plugin.php';
		}
		\DreamFast\CommerceFloat\Plugin::activate();
	}
);

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

if ( ! function_exists( 'dreamfast_cf_init' ) ) {
	/**
	 * Bootstrap plugin after plugins_loaded.
	 */
	function dreamfast_cf_init() {
		\DreamFast\CommerceFloat\Plugin::instance()->init();
	}
	add_action( 'plugins_loaded', 'dreamfast_cf_init', 5 );
}
