<?php

/**
 * Description: This Must-Use plugin is an integral part of the
 * <strong>Error Monitor & Notifier</strong> plugin and is used for early registration of error handlers.
 * This allows to catch errors as early as possible.
 */

declare(strict_types=1);

namespace Enot;

if (!defined('WP_PLUGIN_DIR')) {
    exit;
}

// Load the Filesystem API
require_once ABSPATH . '/wp-admin/includes/file.php';

// Initializes and connects the WordPress Filesystem Abstraction classes
if (\WP_Filesystem(false)) {
    global $wp_filesystem;

	$plugin_dir = \trailingslashit(WP_PLUGIN_DIR);
	$main_plugin_file = $plugin_dir . 'error-monitor-and-notifier/error-monitor-and-notifier.php';

    // Load the plugin
    if ($wp_filesystem->is_readable($main_plugin_file)) {
        require_once $main_plugin_file;
    }
}
