eventbrite-for-the-events-c.../includes/class-eb4tec-loader.php
Laurence Horrocks-Barlow f3bc795d9a Initial release of Eventbrite for The Events Calendar (v1.0.0)
Bidirectional sync between Eventbrite and The Events Calendar, with
WooCommerce ticket purchasing that bypasses Eventbrite's processing
fees by registering buyers as free attendees via API. Includes venue/
organizer sync, QR code ticket generation, attendee management with
CSV export, scheduled sync via WP-Cron, and real-time Eventbrite
webhooks.
2026-05-17 08:48:04 +01:00

52 lines
1.8 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
final class EB4TEC_Loader {
public function __construct() {
if ( ! class_exists( 'Tribe__Events__Main' ) ) {
add_action( 'admin_notices', [ $this, 'notice_tec_missing' ] );
return;
}
if ( ! class_exists( 'WooCommerce' ) ) {
add_action( 'admin_notices', [ $this, 'notice_woo_missing' ] );
return;
}
$settings = new EB4TEC_Settings();
$api = new EB4TEC_API_Client();
$venue_sync = new EB4TEC_Venue_Sync( $api );
$org_sync = new EB4TEC_Organizer_Sync( $api );
$ticket_manager = new EB4TEC_Ticket_Manager( $api );
$qr = new EB4TEC_QR_Code();
$woocommerce = new EB4TEC_WooCommerce( $api, $ticket_manager, $qr );
$event_sync = new EB4TEC_Event_Sync( $api, $venue_sync, $org_sync, $ticket_manager, $woocommerce );
$cron = new EB4TEC_Cron( $event_sync );
$attendees = new EB4TEC_Attendees( $api );
$webhook = new EB4TEC_Webhook( $api, $event_sync );
$shortcodes = new EB4TEC_Shortcodes( $api, $ticket_manager );
$frontend = new EB4TEC_Frontend( $ticket_manager );
}
public function notice_tec_missing(): void {
echo '<div class="notice notice-error"><p>' .
wp_kses(
__( '<strong>Eventbrite for The Events Calendar</strong> requires <a href="https://theeventscalendar.com/" target="_blank">The Events Calendar</a> to be installed and active.', 'eb4tec' ),
[ 'strong' => [], 'a' => [ 'href' => [], 'target' => [] ] ]
) .
'</p></div>';
}
public function notice_woo_missing(): void {
echo '<div class="notice notice-error"><p>' .
wp_kses(
__( '<strong>Eventbrite for The Events Calendar</strong> requires <a href="https://woocommerce.com/" target="_blank">WooCommerce</a> to be installed and active.', 'eb4tec' ),
[ 'strong' => [], 'a' => [ 'href' => [], 'target' => [] ] ]
) .
'</p></div>';
}
}