function load_espresso_calendar_class()
{
    // check for duplicate copy of Calendar addon
    if (class_exists('EE_Calendar')) {
        EE_Error::add_error(sprintf(__('It appears there are multiple copies of the Event Espresso Calendar installed on your server.%sPlease remove (delete) all copies except for this version: "%s"', 'event_espresso'), '<br />', EE_CALENDAR_VERSION), __FILE__, __FUNCTION__, __LINE__);
        add_action('admin_notices', 'espresso_calendar_activation_error');
        return;
    }
    // todo: remove version check since this has been added to later versions of register_addon in EE core
    if (class_exists('EE_Addon') && version_compare(EVENT_ESPRESSO_VERSION, EE_CORE_VERSION_REQUIRED, '>=')) {
        // calendar_version
        require_once plugin_dir_path(__FILE__) . 'EE_Calendar.class.php';
        EE_Calendar::register_addon();
    } else {
        add_action('admin_notices', 'espresso_calendar_activation_error');
    }
}