<?php
/**
 * Plugin Name:       TextToPdfNet – Text & Web to PDF Converter
 * Plugin URI:        https://texttopdf.net
 * Description:       Convert text PDF and single website content into clean PDF files effortlessly.
 * Version:           1.0.0
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * Author:            TextToPDF.net
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       texttopdfnet-text-web-to-pdf
 * Domain Path:       /languages
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

// Define plugin constants.
define( 'TEXTTOPDF_VERSION', '1.0.0' );
define( 'TEXTTOPDF_PLUGIN_FILE', __FILE__ );
define( 'TEXTTOPDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'TEXTTOPDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

// Load Composer autoloader if it exists (for Dompdf).
if ( file_exists( TEXTTOPDF_PLUGIN_DIR . 'vendor/autoload.php' ) ) {
	require_once TEXTTOPDF_PLUGIN_DIR . 'vendor/autoload.php';
}

// Include core plugin classes.
require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-plugin.php';

/**
 * Initialize the plugin.
 */
function texttopdfnet_init() {
	$plugin = new TextToPDF_Plugin();
	$plugin->run();
}
add_action( 'plugins_loaded', 'texttopdfnet_init' );
