<?php
/**
 * Plugin Name:       Trendly AI Post - Trending Topics from Google News
 * Plugin URI:        https://github.com/sharmagautamnitish0006
 * Description:       AI-powered WordPress plugin that generates SEO-optimized posts from trending topics using Google News, Gemini and Pexels.
 * Version:           1.1.0
 * Author:            Nitish Sharma
 * Author URI:        https://www.linkedin.com/in/nitish-sharma-0006g/
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       trendly-ai-post
 * Domain Path:       /languages
 * Requires at least: 5.0
 * Requires PHP:      7.4
 */

if ( ! defined( 'WPINC' ) ) {
    die;
}

// Define plugin constants
if ( ! defined( 'TRENDLY_AI_POST_VERSION' ) ) {
    define( 'TRENDLY_AI_POST_VERSION', '1.1.0' );
}
if ( ! defined( 'TRENDLY_AI_POST_FILE' ) ) {
    define( 'TRENDLY_AI_POST_FILE', __FILE__ );
}
if ( ! defined( 'TRENDLY_AI_POST_PATH' ) ) {
    define( 'TRENDLY_AI_POST_PATH', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'TRENDLY_AI_POST_URL' ) ) {
    define( 'TRENDLY_AI_POST_URL', plugin_dir_url( __FILE__ ) );
}

// Autoload includes
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-activator.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-deactivator.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-loader.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-i18n.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-api-handler.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-post-generator.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-duplicate.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-seo-preview.php';
require_once TRENDLY_AI_POST_PATH . 'includes/trendly-ai-post-seo.php';
require_once TRENDLY_AI_POST_PATH . 'admin/trendly-ai-post-admin.php';

/**
 * Activation & Deactivation hooks
 */
function trendly_ai_post_activate() {
    Trendly_AI_Post_Activator::activate();
}
function trendly_ai_post_deactivate() {
    Trendly_AI_Post_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'trendly_ai_post_activate' );
register_deactivation_hook( __FILE__, 'trendly_ai_post_deactivate' );

/**
 * Begin execution of the plugin
 */
function run_trendly_ai_post() {
    $plugin = new Trendly_AI_Post();
    $plugin->run();
}

run_trendly_ai_post();
