getHttpTransporter(); // Don't wrap if already wrapped. if ( $current_transporter instanceof Logging_Http_Transporter ) { $wrapped = true; return; } // Create a logging wrapper around the existing transporter. $logging_transporter = new Logging_Http_Transporter( $current_transporter, self::$log_manager ); // Replace the transporter with the logging version. $registry->setHttpTransporter( $logging_transporter ); $wrapped = true; } catch ( \Throwable $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch // Silently fail - logging is optional and shouldn't break the site. } } }