<?php

/*
Plugin Name: Generatify
Description: Transform your website into a complete Artificial Intelligence (AI) suite with context-aware chatbot for content generation and general assistance, task automation, AI helpdesk agent, smart suggestions, content moderation, and seamless integrations with ChatGPT, Claude, Gemini, and more.
Plugin URI: https://daftplug.com/generatify/
Version: 1.2.0
Author: DaftPlug
Author URI: https://daftplug.com/
License: GPLv3
Text Domain: generatify
Domain Path: /languages
Requires at least: 7.0
Requires PHP: 7.4
*/
namespace DaftPlug\Generatify;

if ( !defined( 'ABSPATH' ) ) {
    exit;
}
if ( function_exists( '\\DaftPlug\\Generatify\\generatify_pro' ) ) {
    \DaftPlug\Generatify\generatify_pro()->set_basename( false, __FILE__ );
} else {
    $generatify_autoload_path = __DIR__ . '/vendor/autoload.php';
    if ( file_exists( $generatify_autoload_path ) ) {
        require_once $generatify_autoload_path;
    }
    // Init Freemius SDK
    if ( !function_exists( '\\DaftPlug\\Generatify\\generatify_pro' ) ) {
        // Create a helper function for easy SDK access.
        function generatify_pro() {
            global $generatify_pro;
            if ( !isset( $generatify_pro ) ) {
                // Include Freemius SDK.
                // SDK is auto-loaded through composer
                $generatify_pro = \fs_dynamic_init( [
                    'id'                             => '20512',
                    'slug'                           => 'generatify',
                    'premium_slug'                   => 'generatify-pro',
                    'type'                           => 'plugin',
                    'public_key'                     => 'pk_107b7563c90390ad876d8a27d9c42',
                    'is_premium'                     => false,
                    'premium_suffix'                 => '(Pro)',
                    'has_addons'                     => false,
                    'has_paid_plans'                 => true,
                    'is_org_compliant'               => true,
                    'bundle_id'                      => '20420',
                    'bundle_public_key'              => 'pk_fe5ea0f481c10a8938d37ffed52b9',
                    'bundle_license_auto_activation' => true,
                    'menu'                           => [
                        'slug'       => 'generatify',
                        'first-path' => 'admin.php?page=generatify',
                        'pricing'    => true,
                        'contact'    => true,
                        'account'    => true,
                        'support'    => true,
                        'addons'     => false,
                    ],
                    'is_live'                        => true,
                ] );
            }
            return $generatify_pro;
        }

    }
    // Init Freemius.
    \DaftPlug\Generatify\generatify_pro();
    // Signal that SDK was initiated.
    do_action( 'generatify_pro_loaded' );
    // Define plugin constants
    define( 'GENERATIFY_VERSION', '1.2.0' );
    define( 'GENERATIFY_FILE', __FILE__ );
    define( 'GENERATIFY_BASENAME', plugin_basename( __FILE__ ) );
    define( 'GENERATIFY_DIR_URL', plugin_dir_url( __FILE__ ) );
    define( 'GENERATIFY_DIR_PATH', plugin_dir_path( __FILE__ ) );
    define( 'GENERATIFY_UPLOAD_DIR', trailingslashit( wp_upload_dir()['basedir'] ) . 'generatify/' );
    define( 'GENERATIFY_UPLOAD_URL', trailingslashit( wp_upload_dir()['baseurl'] ) . 'generatify/' );
    // Include Helpers
    require_once GENERATIFY_DIR_PATH . 'includes/helpers/Utils.php';
    // Include Admin
    require_once GENERATIFY_DIR_PATH . 'includes/admin/Admin.php';
    // Include Features
    require_once GENERATIFY_DIR_PATH . 'includes/features/Features.php';
    // Initialize Admin and Features
    add_action( 'init', function () {
        new Admin();
        new Features();
    } );
}