id, array( 'plugins', 'plugins-network' ), true ) || ! current_user_can( 'activate_plugins' ) ) {
return;
}
$other = get_file_data( __FILE__, array( 'name' => 'Plugin Name' ) );
printf(
'
',
esc_html(
sprintf(
/* translators: 1: the edition that is running, 2: the edition that is not. */
__( '%1$s and %2$s are both active. They are two editions of the same plugin and only one can run: %1$s is running, %2$s is not. Deactivate the one you do not want.', 'adi-site-bridge' ),
ADIBRIDGE_EDITION,
$other['name']
)
)
);
}
);
return;
}
define( 'ADIBRIDGE_VERSION', '0.2.1' );
define( 'ADIBRIDGE_DIR', __DIR__ );
define( 'ADIBRIDGE_FILE', __FILE__ );
defined( 'ADIBRIDGE_EDITION' ) || define( 'ADIBRIDGE_EDITION', 'ADI Site Bridge' );
spl_autoload_register(
static function ( $class ) {
if ( 0 !== strpos( $class, 'AdiBridge\\' ) ) {
return;
}
// AdiBridge\Mcp_Server -> includes/class-mcp-server.php; AdiBridge\Adapters\Acf -> includes/adapters/class-acf.php
$parts = explode( '\\', substr( $class, strlen( 'AdiBridge\\' ) ) );
$name = array_pop( $parts );
$dir = $parts ? strtolower( implode( '/', $parts ) ) . '/' : '';
$file = ADIBRIDGE_DIR . '/includes/' . $dir . 'class-' . strtolower( str_replace( '_', '-', $name ) ) . '.php';
if ( is_readable( $file ) ) {
require_once $file;
}
}
);
add_action(
'plugins_loaded',
static function () {
AdiBridge\Plugin::boot();
}
);