Skip to content

Commit

Permalink
Comment all WPKitLog* usages in CoreAPI to get to build
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Apr 8, 2024
1 parent 12ba6f8 commit dc583ad
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions Sources/CoreAPI/WordPressComOAuthClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public final class WordPressComOAuthClient: NSObject {
.mapSuccess { response in
let responseObject = try JSONSerialization.jsonObject(with: response.body)

WPKitLogVerbose("Received OAuth2 response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))")
// WPKitLogVerbose("Received OAuth2 response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))")

guard let responseDictionary = responseObject as? [String: AnyObject] else {
throw URLError(.cannotParseResponse)
Expand Down Expand Up @@ -380,7 +380,7 @@ public final class WordPressComOAuthClient: NSObject {
.perform(request: builder, errorType: AuthenticationFailure.self)
.mapUnacceptableStatusCodeError(AuthenticationFailure.init(response:body:))
.mapSuccess { response in
WPKitLogVerbose("Received Social Login Oauth response.")
// WPKitLogVerbose("Received Social Login Oauth response.")

// Make sure we received expected data.
let responseObject = try? JSONSerialization.jsonObject(with: response.body)
Expand Down Expand Up @@ -700,7 +700,7 @@ public final class WordPressComOAuthClient: NSObject {
.mapSuccess { response in
let responseObject = try JSONSerialization.jsonObject(with: response.body)

WPKitLogVerbose("Received Social Login Oauth response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))")
// WPKitLogVerbose("Received Social Login Oauth response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))")
guard let responseDictionary = responseObject as? [String: AnyObject],
let responseData = responseDictionary["data"] as? [String: AnyObject],
let authToken = responseData["bearer_token"] as? String else {
Expand Down
18 changes: 9 additions & 9 deletions Sources/CoreAPI/WordPressOrgXMLRPCValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ open class WordPressOrgXMLRPCValidator: NSObject {
xmlrpcURL = try urlForXMLRPCFromURLString(nextSite, addXMLRPC: true)
originalXMLRPCURL = try urlForXMLRPCFromURLString(nextSite, addXMLRPC: false)
} catch let error as NSError {
WPKitLogError(error.localizedDescription)
// WPKitLogError(error.localizedDescription)
errorHandler(error)
return
}

validateXMLRPCURL(xmlrpcURL, success: success, failure: { (error) in
WPKitLogError(error.localizedDescription)
// WPKitLogError(error.localizedDescription)
if (error.domain == NSURLErrorDomain && error.code == NSURLErrorUserCancelledAuthentication) ||
(error.domain == NSURLErrorDomain && error.code == NSURLErrorCannotFindHost) ||
(error.domain == NSURLErrorDomain && error.code == NSURLErrorNetworkConnectionLost) ||
Expand All @@ -152,12 +152,12 @@ open class WordPressOrgXMLRPCValidator: NSObject {
return
}
// Try the original given url as an XML-RPC endpoint
WPKitLogError("Try the original given url as an XML-RPC endpoint: \(originalXMLRPCURL)")
// WPKitLogError("Try the original given url as an XML-RPC endpoint: \(originalXMLRPCURL)")
self.validateXMLRPCURL(originalXMLRPCURL, success: success, failure: { (error) in
WPKitLogError(error.localizedDescription)
// WPKitLogError(error.localizedDescription)
// Fetch the original url and look for the RSD link
self.guessXMLRPCURLFromHTMLURL(originalXMLRPCURL, success: success, failure: { (error) in
WPKitLogError(error.localizedDescription)
// WPKitLogError(error.localizedDescription)

errorHandler(error)
})
Expand Down Expand Up @@ -193,7 +193,7 @@ open class WordPressOrgXMLRPCValidator: NSObject {

if baseURL.lastPathComponent != "xmlrpc.php" && addXMLRPC {
// Assume the given url is the home page and XML-RPC sits at /xmlrpc.php
WPKitLogInfo("Assume the given url is the home page and XML-RPC sits at /xmlrpc.php")
// WPKitLogInfo("Assume the given url is the home page and XML-RPC sits at /xmlrpc.php")
resultURLString = "\(resultURLString)/xmlrpc.php"
}

Expand Down Expand Up @@ -263,7 +263,7 @@ open class WordPressOrgXMLRPCValidator: NSObject {
private func guessXMLRPCURLFromHTMLURL(_ htmlURL: URL,
success: @escaping (_ xmlrpcURL: URL) -> Void,
failure: @escaping (_ error: NSError) -> Void) {
WPKitLogInfo("Fetch the original url and look for the RSD link by using RegExp")
// WPKitLogInfo("Fetch the original url and look for the RSD link by using RegExp")

var isWpSite = false
let session = URLSession(configuration: URLSessionConfiguration.ephemeral)
Expand Down Expand Up @@ -338,7 +338,7 @@ open class WordPressOrgXMLRPCValidator: NSObject {
private func guessXMLRPCURLFromRSD(_ rsd: String,
success: @escaping (_ xmlrpcURL: URL) -> Void,
failure: @escaping (_ error: NSError) -> Void) {
WPKitLogInfo("Parse the RSD document at the following URL: \(rsd)")
// WPKitLogInfo("Parse the RSD document at the following URL: \(rsd)")
guard let rsdURL = URL(string: rsd) else {
failure(WordPressOrgXMLRPCValidatorError.invalid as NSError)
return
Expand All @@ -358,7 +358,7 @@ open class WordPressOrgXMLRPCValidator: NSObject {
failure(WordPressOrgXMLRPCValidatorError.invalid as NSError)
return
}
WPKitLogInfo("Bingo! We found the WordPress XML-RPC element: \(xmlrpcURL)")
// WPKitLogInfo("Bingo! We found the WordPress XML-RPC element: \(xmlrpcURL)")
self.validateXMLRPCURL(xmlrpcURL, success: success, failure: failure)
})
dataTask.resume()
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreAPI/WordPressRSDParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ open class WordPressRSDParser: NSObject, XMLParserDelegate {
}

open func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) {
WPKitLogInfo("Error parsing RSD: \(parseError)")
// WPKitLogInfo("Error parsing RSD: \(parseError)")
}

}

0 comments on commit dc583ad

Please sign in to comment.