diff --git a/wporg-two-factor.php b/wporg-two-factor.php index 995663d9..8f12b093 100644 --- a/wporg-two-factor.php +++ b/wporg-two-factor.php @@ -41,6 +41,14 @@ function is_2fa_beta_tester() : bool { function load_webauthn_plugin() { global $wpdb; + // Bail if the WebAuthn plugin is unavailable. + if ( ! class_exists( '\WildWolf\WordPress\TwoFactorWebAuthn\Plugin' ) ) { + if ( 'production' === wp_get_environment_type() ) { + trigger_error( 'Two Factor WebAuthn plugin missing.', E_USER_WARNING ); + } + return; + } + $webauthn = WebAuthn_Plugin::instance(); $webauthn->init();