Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _None._

_None._

### New Features
- New tracking event for XMLRPC related failure. by @selanthiraiyan [#701]

_None._

Expand Down
2 changes: 1 addition & 1 deletion WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'WordPressAuthenticator'
s.version = '4.1.1'
s.version = '4.2.0-beta.1'

s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.'
s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ public class AuthenticatorAnalyticsTracker {
case loginWithAccountPassword = "login_with_password"
}

public enum Failure: String {
/// Failure to guess XMLRPC URL
///
case loginFailedToGuessXMLRPC = "login_failed_to_guess_xmlrpc_url"
}

/// Shared Instance.
///
public static var shared: AuthenticatorAnalyticsTracker = {
Expand Down Expand Up @@ -354,6 +360,12 @@ public class AuthenticatorAnalyticsTracker {
track(event(click: click))
}

/// Track a predefined failure enum.
///
public func track(failure: Failure) {
track(failure: failure.rawValue)
}

/// Track a failure.
///
public func track(failure: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ private extension SiteAddressViewController {
// It's not guaranteed to be included in the error object depending on the error.
DDLogInfo("Error attempting to connect to site address: \(self.loginFields.siteAddress)")
DDLogError(error.localizedDescription)
// TODO: - Tracks.
// WordPressAuthenticator.track(.loginFailedToGuessXMLRPC, error: error)
// WordPressAuthenticator.track(.loginFailed, error: error)

self.tracker.track(failure: .loginFailedToGuessXMLRPC)

self.configureViewLoading(false)

guard self.isSiteDiscovery == false else {
Expand Down