public function handle_webhook(WP_REST_Request $request) { // 1. Tratar validação inicial (CRC) $raw = $request->get_body(); $data = json_decode($raw, true); if (isset($data['event']) && $data['event'] === 'endpoint.url_validation') { $plain = $data['payload']['plainToken'] ?? ''; $encrypted = hash_hmac('sha256', $plain, self::VERIFICATION_TOKEN); return [ 'plainToken' => $plain, 'encryptedToken' => $encrypted ]; } // 2. Obter headers de forma confiável $all_headers = getallheaders(); $ts = $all_headers['x-zm-request-timestamp'] ?? $all_headers['X-ZM-REQUEST-TIMESTAMP'] ?? ''; $hash = $all_headers['x-zm-signature'] ?? $all_headers['X-ZM-SIGNATURE'] ?? ''; $received_token = $all_headers['verification-token'] ?? $all_headers['VERIFICATION-TOKEN'] ?? ''; // 3. Verificação de token legado if ($received_token !== self::VERIFICATION_TOKEN) { return new WP_REST_Response(['error' => 'Invalid verification token'], 401); } // 4. Calcular assinatura esperada $message = "v0:{$ts}:{$raw}"; $expected = 'v0=' . hash_hmac('sha256', $message, self::VERIFICATION_TOKEN); // 5. Comparar assinaturas if (!hash_equals($expected, $hash)) { // Log detalhado para diagnóstico $log = "Falha na assinatura!\n"; $log .= "Timestamp: {$ts}\n"; $log .= "Recebido: {$hash}\n"; $log .= "Esperado: {$expected}\n"; $log .= "Mensagem: {$message}\n"; file_put_contents(WP_CONTENT_DIR . '/zoom-debug.log', $log, FILE_APPEND); return new WP_REST_Response(['error' => 'Invalid signature'], 401); } // ... restante do código para processar gravações ... }1 - Uncaught Error: Class "Zoom_Sync_Basic" not found in /home/wwwesmtc/public_html/wp-content/plugins/zoom-sync-basic/zoom-sync-basic.php:18 Stack trace: #0 /home/wwwesmtc/public_html/wp-includes/class-wp-hook.php(324): {closure}('') #1 /home/wwwesmtc/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #2 /home/wwwesmtc/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /home/wwwesmtc/public_html/wp-settings.php(578): do_action('plugins_loaded') #4 /home/wwwesmtc/public_html/wp-config.php(82): require_once('/home/wwwesmtc/...') #5 /home/wwwesmtc/public_html/wp-load.php(50): require_once('/home/wwwesmtc/...') #6 /home/wwwesmtc/public_html/wp-blog-header.php(13): require_once('/home/wwwesmtc/...') #7 /home/wwwesmtc/public_html/index.php(17): require('/home/wwwesmtc/...') #8 {main} thrown - /home/wwwesmtc/public_html/wp-content/plugins/zoom-sync-basic/zoom-sync-basic.php - 18