ciao!

ci sono alcune cose che non ho ben capito sulla creazione di plugin per admin in wordpress.
in pratica devo creare un calendario, ed ho deciso di usare un plugin per jquery.
nel file php principale ho messo questo:
Codice PHP:
defined('ABSPATH') || exit;
define('PL_PATH'plugin_dir_path(__FILE__));
define('MY_DOMAIN''https://www.mattepuffo.com/wp/');
define('MY_DOMAIN_PLUGINS'MY_DOMAIN 'wp-content/plugins/calendar-woocommerce/');
define('FULL_CAL_VER''fullcalendar-4.2.0');

add_action('admin_menu''wc_calendar_setup_menu');

function 
wc_calendar_setup_menu() {
    
add_menu_page('WC Calendar''Calendar''manage_options''wc_calendar''init''dashicons-calendar-alt'10);
}

function 
init() {
    include_once 
plugin_dir_path(__FILE__) . 'calendar_page.php';

poi in calendar_page.php:
codice:
<link rel="stylesheet" href="<?php echo MY_DOMAIN_PLUGINS; ?>js/<?php echo FULL_CAL_VER; ?>/packages/core/main.css">
<link rel="stylesheet" href="<?php echo MY_DOMAIN_PLUGINS; ?>js/<?php echo FULL_CAL_VER; ?>/packages/daygrid/main.css">
<script src="<?php echo MY_DOMAIN_PLUGINS; ?>js/<?php echo FULL_CAL_VER; ?>/packages/core/main.js"></script>
<script src="<?php echo MY_DOMAIN_PLUGINS; ?>js/<?php echo FULL_CAL_VER; ?>/packages/interaction/main.js"></script>
<script src="<?php echo MY_DOMAIN_PLUGINS; ?>js/<?php echo FULL_CAL_VER; ?>/packages/daygrid/main.js"></script>
<script src="<?php echo MY_DOMAIN_PLUGINS; ?>js/script.js"></script>
<style>
    #script-warning {
        display: none;
        background: #eee;
        border-bottom: 1px solid #ddd;
        padding: 0 10px;
        line-height: 40px;
        text-align: center;
        font-weight: bold;
        font-size: 12px;
        color: red;
    }

    #loading {
        display: none;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    #calendar {
        max-width: 90%;
        margin: 10px auto;
        padding: 10px;
        background-color: white;
    }
</style>
<div id="script-warning">
    <code>php/get-events.php</code> must be running.
</div>
<div id="loading">loading...</div>
<div id="calendar"></div>
infine script.js:
codice:
document.addEventListener('DOMContentLoaded', function () {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
        plugins: ['interaction', 'dayGrid', 'timeGrid', 'list'],
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
        defaultDate: '2019-06-12',
        editable: true,
        navLinks: true, // can click day/week names to navigate views
eventLimit: true, // allow "more" link when too many events
events: {
            url: './lib/get-events.php',
            failure: function () {
                document.getElementById('script-warning').style.display = 'block'
}
        },
        loading: function (bool) {
            document.getElementById('loading').style.display = bool ? 'block' : 'none';
        }
    });

    calendar.render();
});
domanda / problema 1
funziona quasi tutto, tranne la chiamata ajax.
e qui non ho capito come indicare il path giusto

domanda / problema 2
nel complesso, a prescindere che funziona quasi tutto, non ho capito se sto seguendo la strada giusta.

suggerimenti???