<?php

/**
 * Plugin Name:       Copyfend – Content Protection, Anti-Copy & Anti-Scraping
 * Plugin URI:        https://lofitec.com/plugins/copyfend/
 * Description:       Layered, SEO-safe content protection: deter copy/paste & right-click, turn copying into an attribution backlink, and (PRO) block scrapers server-side, watermark images, and run DMCA tools.
 * Version:           1.1.3
 * Requires at least: 6.3
 * Requires PHP:      7.4
 * Author:            Lofitec
 * Author URI:        https://lofitec.com
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       copyfend
 *
 *
 * @package Copyfend
 */
defined( 'ABSPATH' ) || exit;
define( 'CSHIELD_VERSION', '1.1.3' );
define( 'CSHIELD_FILE', __FILE__ );
define( 'CSHIELD_DIR', plugin_dir_path( __FILE__ ) );
define( 'CSHIELD_URL', plugin_dir_url( __FILE__ ) );
define( 'CSHIELD_BASENAME', plugin_basename( __FILE__ ) );
if ( function_exists( 'cshield_fs' ) ) {
    cshield_fs()->set_basename( false, __FILE__ );
} else {
    /**
     * DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE
     * `function_exists` CALL ABOVE TO PROPERLY WORK.
     */
    if ( !function_exists( 'cshield_fs' ) ) {
        // Create a helper function for easy SDK access.
        function cshield_fs() {
            global $cshield_fs;
            if ( !isset( $cshield_fs ) ) {
                // Include Freemius SDK.
                require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
                $cshield_fs = fs_dynamic_init( array(
                    'id'               => '31401',
                    'slug'             => 'copyfend',
                    'type'             => 'plugin',
                    'public_key'       => 'pk_069c0cd8094c6956c6c15067cde03',
                    'is_premium'       => false,
                    'premium_suffix'   => 'Pro',
                    'has_addons'       => false,
                    'has_paid_plans'   => true,
                    'is_org_compliant' => true,
                    'trial'            => array(
                        'days'               => 3,
                        'is_require_payment' => true,
                    ),
                    'menu'             => array(
                        'slug'    => 'copyfend',
                        'support' => false,
                    ),
                    'is_live'          => true,
                ) );
            }
            return $cshield_fs;
        }

        // Init Freemius.
        cshield_fs();
        // Signal that SDK was initiated.
        do_action( 'cshield_fs_loaded' );
    }
    /* ---- Copyfend plugin bootstrap ---- */
    require_once CSHIELD_DIR . 'includes/class-cshield.php';
    register_activation_hook( __FILE__, array('CShield', 'activate') );
    register_deactivation_hook( __FILE__, array('CShield', 'deactivate') );
    // Freemius manages the uninstall lifecycle, so cleanup runs via its hook (no uninstall.php).
    cshield_fs()->add_action( 'after_uninstall', array('CShield', 'uninstall') );
    add_action( 'plugins_loaded', array('CShield', 'instance') );
}