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.
64 lines
2.1 KiB
PHP
64 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Eventbrite for The Events Calendar
|
|
* Plugin URI: https://git.ankh-morpork.discworld.network/laurence/eventbrite-for-the-events-calendar
|
|
* Description: Bidirectional sync between Eventbrite and The Events Calendar, with WooCommerce ticket
|
|
* purchasing that bypasses Eventbrite's processing fees while keeping Eventbrite as the
|
|
* attendee source of truth. Includes venue/organizer sync, QR code tickets, attendee
|
|
* management, scheduled sync, and real-time Eventbrite webhooks.
|
|
* Version: 1.0.0
|
|
* Author: Laurence Horrocks-Barlow
|
|
* Author URI: https://qsplace.co.uk
|
|
* Text Domain: eb4tec
|
|
* Domain Path: /languages
|
|
* License: GPLv2 or later
|
|
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
* Requires at least: 6.0
|
|
* Requires PHP: 8.0
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
define( 'EB4TEC_VERSION', '1.0.0' );
|
|
define( 'EB4TEC_FILE', __FILE__ );
|
|
define( 'EB4TEC_DIR', plugin_dir_path( __FILE__ ) );
|
|
define( 'EB4TEC_URL', plugin_dir_url( __FILE__ ) );
|
|
|
|
register_activation_hook( __FILE__, function (): void {
|
|
require_once EB4TEC_DIR . 'includes/class-eb4tec-cron.php';
|
|
EB4TEC_Cron::schedule();
|
|
flush_rewrite_rules();
|
|
} );
|
|
|
|
register_deactivation_hook( __FILE__, function (): void {
|
|
require_once EB4TEC_DIR . 'includes/class-eb4tec-cron.php';
|
|
EB4TEC_Cron::unschedule();
|
|
} );
|
|
|
|
register_uninstall_hook( __FILE__, 'eb4tec_uninstall' );
|
|
|
|
function eb4tec_uninstall(): void {
|
|
if ( ! get_option( 'eb4tec_delete_on_uninstall' ) ) {
|
|
return;
|
|
}
|
|
|
|
global $wpdb;
|
|
|
|
// Remove all plugin options.
|
|
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'eb4tec_%'" );
|
|
|
|
// Remove all plugin post meta.
|
|
$wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '\_eb4tec\_%'" );
|
|
|
|
// Remove transients.
|
|
$wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient_eb4tec_%' OR option_name LIKE '_transient_timeout_eb4tec_%'" );
|
|
}
|
|
|
|
add_action( 'plugins_loaded', function (): void {
|
|
foreach ( glob( EB4TEC_DIR . 'includes/class-eb4tec-*.php' ) as $file ) {
|
|
require_once $file;
|
|
}
|
|
new EB4TEC_Loader();
|
|
} );
|