<?php
/**
 * Plugin Name: Giuliomax Menu Builder
 * Plugin URI:  https://github.com/Giulio001/menux-free-version
 * Description: Menu management via Shortcode [menux]. Supports hamburger style, icons, role-based visibility, multilingual (WPML, Polylang, TranslatePress) and advanced layouts.
 * Version:     3.9.5
 * Author:      giuliomax
 * Author URI:  https://profiles.wordpress.org/giuliomax/
 * Text Domain: giuliomax-menu-builder
 * Domain Path: /languages
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * License:     GPL-2.0-or-later
 */

if ( ! defined( 'ABSPATH' ) ) exit;

define( 'MENUX_VERSION',  '3.9.5' );
define( 'MENUX_DIR',      plugin_dir_path( __FILE__ ) );
define( 'MENUX_URL',      plugin_dir_url( __FILE__ ) );
define( 'MENUX_BASENAME', plugin_basename( __FILE__ ) );

register_activation_hook( __FILE__, 'menux_maybe_migrate' );

add_action( 'init', function() {
    load_plugin_textdomain( 'giuliomax-menu-builder', false, dirname( MENUX_BASENAME ) . '/languages' );
} );

require_once MENUX_DIR . 'includes/helpers.php';
require_once MENUX_DIR . 'includes/migration.php';
require_once MENUX_DIR . 'includes/multilingual.php';
require_once MENUX_DIR . 'includes/style-defaults.php';
require_once MENUX_DIR . 'includes/logo.php';
require_once MENUX_DIR . 'includes/accessibility.php';
require_once MENUX_DIR . 'includes/megamenu.php';
Menux_MegaMenu::register_hooks();
require_once MENUX_DIR . 'includes/css-generator.php';
require_once MENUX_DIR . 'includes/assets.php';
require_once MENUX_DIR . 'includes/import-export.php';
require_once MENUX_DIR . 'includes/wp-menu-import.php';
require_once MENUX_DIR . 'includes/shortcode.php';
require_once MENUX_DIR . 'includes/block.php';
require_once MENUX_DIR . 'includes/footer-defaults.php';
require_once MENUX_DIR . 'includes/footer-css.php';
require_once MENUX_DIR . 'includes/footer-render.php';
require_once MENUX_DIR . 'includes/footer-block.php';
require_once MENUX_DIR . 'includes/woocommerce.php';
require_once MENUX_DIR . 'includes/wp-nav-integration.php';

if ( is_admin() ) {
    require_once MENUX_DIR . 'admin/admin-page.php';
    require_once MENUX_DIR . 'admin/builder.php';
    require_once MENUX_DIR . 'admin/style-panel.php';
    require_once MENUX_DIR . 'admin/logo-panel.php';
    require_once MENUX_DIR . 'admin/megamenu-panel.php';
    require_once MENUX_DIR . 'admin/accessibility-panel.php';
    require_once MENUX_DIR . 'admin/search-panel.php';
    require_once MENUX_DIR . 'admin/announcement-panel.php';
    require_once MENUX_DIR . 'admin/woocommerce-panel.php';
    require_once MENUX_DIR . 'admin/footer-page.php';
    require_once MENUX_DIR . 'admin/tutorial.php';
}
