<?php
/**
 * Plugin Name:       Download List Block with Icons
 * Description:       Provides a Gutenberg Block to manage a download list with file type specific icons.
 * Requires at least: 6.0
 * Requires PHP:      8.0
 * Version:           4.1.2
 * Author:            Thomas Zwirner
 * Author URI:        https://www.thomaszwirner.de
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       download-list-block-with-icons
 *
 * @package download-list-block-with-icons
 */

// prevent direct access.
defined( 'ABSPATH' ) || exit;

// do nothing if PHP-version is not 8.0 or newer.
if ( PHP_VERSION_ID < 80000 ) { // @phpstan-ignore smaller.alwaysFalse
	return;
}

use DownloadListWithIcons\Plugin\Init;
use DownloadListWithIcons\Plugin\Installer;

// save the plugin-path.
const DL_PLUGIN = __FILE__;

// save the plugin-version.
const DL_VERSION = '4.1.2';

// save transient-list-name.
const DL_TRANSIENT_LIST = 'downloadlist_transients';

// get autoloader generated by composer.
require_once __DIR__ . '/vendor/autoload.php';

// initialize plugin.
Init::get_instance()->init();

// on activation or deactivation of this plugin.
register_activation_hook( DL_PLUGIN, array( Installer::get_instance(), 'activation' ) );
register_deactivation_hook( DL_PLUGIN, array( Installer::get_instance(), 'deactivation' ) );
