<?php
/**
 * Plugin Name: Auto Content Writer By SRH
 * Description: Automatically generate blog posts based on admin-defined business details using Gemini API (Google AI).
 * Version: 1.0.1
 * Author: SRH Web Agency
 * Author URI: https://srhwebagency.com/
 * Requires at least: 5.6
 * Requires PHP: 7.4
 * License: GPLv2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: auto-content-writer-by-srh
 * Contributors: srhwebagency
 */

defined('ABSPATH') || exit;

// Script for handle js
function acwbsrh_enqueue_manual_blog_script($hook) {
    wp_enqueue_script(
        'acwbsrh-custom-js',
        plugin_dir_url(__FILE__) . 'js/acwbsrh-custom.js',
        [],
        time(),
        true
    );

    wp_localize_script('acwbsrh-custom-js', 'acwbsrh_ajax', [
        'ajax_url' => admin_url('admin-ajax.php'),
    ]);
    wp_localize_script('acwbsrh-custom-js', 'acwbsrh_siteurl', [
        'ajax_url' => site_url(),
    ]);
}
add_action('admin_enqueue_scripts', 'acwbsrh_enqueue_manual_blog_script');

// Include all modules
require_once plugin_dir_path(__FILE__) . 'admin/menus.php';
require_once plugin_dir_path(__FILE__) . 'admin/business-settings.php';
require_once plugin_dir_path(__FILE__) . 'admin/generate-blog.php';
require_once plugin_dir_path(__FILE__) . 'admin/scheduled-settings.php';
require_once plugin_dir_path(__FILE__) . 'admin/how-to-use.php';
require_once plugin_dir_path(__FILE__) . 'admin/api-menu.php';
require_once plugin_dir_path(__FILE__) . 'admin/coming-soon.php';

// Cron, Callbacks and helper functions
require_once plugin_dir_path(__FILE__) . 'includes/cron.php';
require_once plugin_dir_path(__FILE__) . 'includes/generate-callback.php';



