<?php
/**
 * Plugin Name:       Beitrag Steward — Mitgliedsbeiträge & SEPA-Lastschrift für Vereine
 * Plugin URI:        https://store.lessbutmore.ai
 * Description:       Membership dues for German Vereine: member and mandate registry, SEPA direct-debit XML (pain.008) your bank accepts after 15 Nov 2026, a file validator, and PDF contribution statements.
 * Version:           0.1.2
 * Author:            migkapa
 * Author URI:        https://github.com/migkapa
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       beitrag-steward
 * Domain Path:       /languages
 * Requires at least: 6.2
 * Requires PHP:      7.4
 */

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

define( 'BSTEW_PATH', plugin_dir_path( __FILE__ ) );
define( 'BSTEW_URL', plugin_dir_url( __FILE__ ) );
define( 'BSTEW_VERSION', '0.1.2' );

add_action( 'init', function () {
	load_plugin_textdomain( 'beitrag-steward', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
} );

require_once BSTEW_PATH . 'includes/functions.php';
require_once BSTEW_PATH . 'includes/class-bstew-crypto.php';
require_once BSTEW_PATH . 'includes/class-bstew-store.php';
require_once BSTEW_PATH . 'includes/class-bstew-sepa-writer.php';
require_once BSTEW_PATH . 'includes/class-bstew-validator.php';
require_once BSTEW_PATH . 'includes/class-bstew-pdf.php';

if ( is_admin() ) {
	require_once BSTEW_PATH . 'includes/class-bstew-settings.php';
	require_once BSTEW_PATH . 'includes/class-bstew-admin-members.php';
	require_once BSTEW_PATH . 'includes/class-bstew-admin-run.php';
	require_once BSTEW_PATH . 'includes/class-bstew-admin-validator.php';
}

register_activation_hook( __FILE__, 'bstew_activate' );

function bstew_activate() {
	BSTEW_Store::install();
	bstew_prepare_storage_dir();
}
