Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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 WordPressKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressKit"
s.version = "2.1.0"
s.version = "2.1.1-beta.1"
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."

s.description = <<-DESC
Expand Down
8 changes: 0 additions & 8 deletions WordPressKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -2689,7 +2688,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKit;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -2710,7 +2708,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressKitTests/WordPressKitTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -2730,7 +2727,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressKitTests/WordPressKitTests-Bridging-Header.h";
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -2812,7 +2808,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKit;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = "Release-Internal";
};
Expand All @@ -2832,7 +2827,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressKitTests/WordPressKitTests-Bridging-Header.h";
SWIFT_VERSION = 4.2;
};
name = "Release-Internal";
};
Expand Down Expand Up @@ -2914,7 +2908,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKit;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = "Release-Alpha";
};
Expand All @@ -2934,7 +2927,6 @@
PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "WordPressKitTests/WordPressKitTests-Bridging-Header.h";
SWIFT_VERSION = 4.2;
};
name = "Release-Alpha";
};
Expand Down
4 changes: 2 additions & 2 deletions WordPressKit/AccountSettingsRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class AccountSettingsRemote: ServiceRemoteWordPressComREST {
})
}

fileprivate func settingsFromResponse(_ responseObject: AnyObject) throws -> AccountSettings {
private func settingsFromResponse(_ responseObject: AnyObject) throws -> AccountSettings {
guard let
response = responseObject as? [String: AnyObject],
let firstName = response["first_name"] as? String,
Expand Down Expand Up @@ -158,7 +158,7 @@ public class AccountSettingsRemote: ServiceRemoteWordPressComREST {
tracksOptOut: tracksOptOut)
}

fileprivate func fieldNameForChange(_ change: AccountSettingsChange) -> String {
private func fieldNameForChange(_ change: AccountSettingsChange) -> String {
switch change {
case .firstName:
return "first_name"
Expand Down
6 changes: 3 additions & 3 deletions WordPressKit/GravatarServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ open class GravatarServiceRemote {

/// Returns a new (randomized) Boundary String
///
fileprivate func boundaryForRequest() -> String {
private func boundaryForRequest() -> String {
return "Boundary-" + UUID().uuidString
}

Expand All @@ -107,7 +107,7 @@ open class GravatarServiceRemote {
///
/// - Returns: A NSData instance, containing the Request's Payload.
///
fileprivate func bodyWithGravatarData(_ gravatarData: Data, account: String, boundary: String) -> Data {
private func bodyWithGravatarData(_ gravatarData: Data, account: String, boundary: String) -> Data {
let body = NSMutableData()

// Image Payload
Expand All @@ -131,7 +131,7 @@ open class GravatarServiceRemote {


// MARK: - Private Structs
fileprivate struct UploadParameters {
private struct UploadParameters {
static let endpointURL = "https://api.gravatar.com/v1/upload-image"
static let HTTPMethod = "POST"
static let contentType = "application/octet-stream"
Expand Down
6 changes: 3 additions & 3 deletions WordPressKit/HTTPAuthenticationAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open class HTTPAuthenticationAlertController {

public typealias AuthenticationHandler = (URLSession.AuthChallengeDisposition, URLCredential?) -> Void

fileprivate static var onGoingChallenges = [URLProtectionSpace: [AuthenticationHandler]]()
private static var onGoingChallenges = [URLProtectionSpace: [AuthenticationHandler]]()

static public func controller(for challenge: URLAuthenticationChallenge, handler: @escaping AuthenticationHandler) -> UIAlertController? {
if var handlers = onGoingChallenges[challenge.protectionSpace] {
Expand Down Expand Up @@ -35,7 +35,7 @@ open class HTTPAuthenticationAlertController {
onGoingChallenges.removeValue(forKey: challenge.protectionSpace)
}

static fileprivate func controllerForServerTrustChallenge(_ challenge: URLAuthenticationChallenge) -> UIAlertController {
private static func controllerForServerTrustChallenge(_ challenge: URLAuthenticationChallenge) -> UIAlertController {
let title = NSLocalizedString("Certificate error", comment: "Popup title for wrong SSL certificate.")
let message = String(format: NSLocalizedString("The certificate for this server is invalid. You might be connecting to a server that is pretending to be “%@” which could put your confidential information at risk.\n\nWould you like to trust the certificate anyway?", comment: ""), challenge.protectionSpace.host)
let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)
Expand All @@ -58,7 +58,7 @@ open class HTTPAuthenticationAlertController {
return controller
}

static fileprivate func controllerForUserAuthenticationChallenge(_ challenge: URLAuthenticationChallenge) -> UIAlertController {
private static func controllerForUserAuthenticationChallenge(_ challenge: URLAuthenticationChallenge) -> UIAlertController {
let title = String(format: NSLocalizedString("Authentication required for host: %@", comment: "Popup title to ask for user credentials."), challenge.protectionSpace.host)
let message = NSLocalizedString("Please enter your credentials", comment: "Popup message to ask for user credentials (fields shown below).")
let controller = UIAlertController(title: title,
Expand Down
2 changes: 1 addition & 1 deletion WordPressKit/NotificationSyncServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
public class NotificationSyncServiceRemote: ServiceRemoteWordPressComREST {
// MARK: - Constants
//
fileprivate let defaultPageSize = 100
private let defaultPageSize = 100


// MARK: - Errors
Expand Down
2 changes: 1 addition & 1 deletion WordPressKit/PluginServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public class PluginServiceRemote: ServiceRemoteWordPressComREST {
}
}

fileprivate extension PluginServiceRemote {
private extension PluginServiceRemote {
func encoded(pluginID: String) -> String? {
let allowedCharacters = CharacterSet.urlPathAllowed.subtracting(CharacterSet(charactersIn: "/"))
guard let escapedPluginID = pluginID.addingPercentEncoding(withAllowedCharacters: allowedCharacters) else {
Expand Down
4 changes: 2 additions & 2 deletions WordPressKit/RemoteBlogSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,6 @@ public class RemoteBlogSettings: NSObject {

// MARK: - Private

fileprivate static let AscendingStringValue = "asc"
fileprivate static let DescendingStringValue = "desc"
private static let AscendingStringValue = "asc"
private static let DescendingStringValue = "desc"
}
10 changes: 5 additions & 5 deletions WordPressKit/RemoteNotificationSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ open class RemoteNotificationSettings {
///
/// - Returns: A native Swift dictionary, containing only the Boolean entries
///
fileprivate func filterNonBooleanEntries(_ dictionary: NSDictionary?) -> [String : Bool] {
private func filterNonBooleanEntries(_ dictionary: NSDictionary?) -> [String : Bool] {
var filtered = [String: Bool]()
if dictionary == nil {
return filtered
Expand Down Expand Up @@ -114,7 +114,7 @@ open class RemoteNotificationSettings {
/// - channel: The communications channel that uses the current settings
/// - settings: Raw dictionary containing the remote settings response
///
fileprivate init(channel: Channel, settings: NSDictionary?) {
private init(channel: Channel, settings: NSDictionary?) {
self.channel = channel
self.streams = Stream.fromDictionary(settings)
}
Expand All @@ -124,7 +124,7 @@ open class RemoteNotificationSettings {
///
/// - Parameter wpcomSettings: Dictionary containing the collection of WordPress.com Settings
///
fileprivate init(wpcomSettings: NSDictionary?) {
private init(wpcomSettings: NSDictionary?) {
// WordPress.com is a special scenario: It contains just one (unspecified) stream: Email
self.channel = Channel.wordPressCom
self.streams = [ Stream(kind: .Email, preferences: wpcomSettings) ]
Expand All @@ -135,7 +135,7 @@ open class RemoteNotificationSettings {
///
/// - Parameter blogSettings: Dictionary containing the collection of settings for a single blog
///
fileprivate convenience init(blogSettings: NSDictionary?) {
private convenience init(blogSettings: NSDictionary?) {
let blogId = blogSettings?["blog_id"] as? Int ?? Int.max
self.init(channel: Channel.blog(blogId: blogId), settings: blogSettings)
}
Expand All @@ -145,7 +145,7 @@ open class RemoteNotificationSettings {
///
/// - Parameter otherSettings: Dictionary containing the collection of "Other Settings"
///
fileprivate convenience init(otherSettings: NSDictionary?) {
private convenience init(otherSettings: NSDictionary?) {
self.init(channel: Channel.other, settings: otherSettings)
}

Expand Down
8 changes: 4 additions & 4 deletions WordPressKit/SharingServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
///
/// - Returns: An array of KeyringConnectionExternalUser instances.
///
fileprivate func externalUsersForKeyringConnection(_ externalUsers: NSArray) -> [KeyringConnectionExternalUser] {
private func externalUsersForKeyringConnection(_ externalUsers: NSArray) -> [KeyringConnectionExternalUser] {
let arr: [KeyringConnectionExternalUser] = externalUsers.map { (dict) -> KeyringConnectionExternalUser in
let externalUser = KeyringConnectionExternalUser()
externalUser.externalID = (dict as AnyObject).string(forKey: ConnectionDictionaryKeys.externalID) ?? externalUser.externalID
Expand Down Expand Up @@ -364,7 +364,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
///
/// - Returns: A `RemotePublicizeConnection` object.
///
fileprivate func remotePublicizeConnectionFromDictionary(_ dict: NSDictionary) -> RemotePublicizeConnection? {
private func remotePublicizeConnectionFromDictionary(_ dict: NSDictionary) -> RemotePublicizeConnection? {
guard let connectionID = dict.number(forKey: ConnectionDictionaryKeys.ID) else {
return nil
}
Expand Down Expand Up @@ -486,7 +486,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
///
/// - Returns: An array of `RemoteSharingButton` objects.
///
fileprivate func remoteSharingButtonsFromDictionary(_ buttons: NSArray) -> [RemoteSharingButton] {
private func remoteSharingButtonsFromDictionary(_ buttons: NSArray) -> [RemoteSharingButton] {
var order = 0
let sharingButtons: [RemoteSharingButton] = buttons.map { (dict) -> RemoteSharingButton in
let btn = RemoteSharingButton()
Expand All @@ -510,7 +510,7 @@ open class SharingServiceRemote: ServiceRemoteWordPressComREST {
}


fileprivate func dictionariesFromRemoteSharingButtons(_ buttons: [RemoteSharingButton]) -> [NSDictionary] {
private func dictionariesFromRemoteSharingButtons(_ buttons: [RemoteSharingButton]) -> [NSDictionary] {
return buttons.map({ (btn) -> NSDictionary in

let dict = NSMutableDictionary()
Expand Down
4 changes: 2 additions & 2 deletions WordPressKit/SiteManagementServiceRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ open class SiteManagementServiceRemote: ServiceRemoteWordPressComREST {

/// Keys found in API results
///
fileprivate struct ResultKey {
private struct ResultKey {
static let Status = "status"
static let Active = "active"
}

/// Values found in API results
///
fileprivate struct ResultValue {
private struct ResultValue {
static let Deleted = "deleted"
static let Running = "running"
}
Expand Down
16 changes: 8 additions & 8 deletions WordPressKit/WordPressComOAuthClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@ public final class WordPressComOAuthClient: NSObject {

@objc public static let WordPressComSocialLoginEndpointVersion = 1.0

fileprivate let clientID: String
fileprivate let secret: String
private let clientID: String
private let secret: String

fileprivate let oauth2SessionManager: SessionManager = {
private let oauth2SessionManager: SessionManager = {
return WordPressComOAuthClient.sessionManager()
}()

fileprivate let socialSessionManager: SessionManager = {
private let socialSessionManager: SessionManager = {
return WordPressComOAuthClient.sessionManager()
}()

fileprivate let social2FASessionManager: SessionManager = {
private let social2FASessionManager: SessionManager = {
return WordPressComOAuthClient.sessionManager()
}()

fileprivate let socialNewSMS2FASessionManager: SessionManager = {
private let socialNewSMS2FASessionManager: SessionManager = {
return WordPressComOAuthClient.sessionManager()
}()

fileprivate class func sessionManager() -> SessionManager {
private class func sessionManager() -> SessionManager {
let configuration = URLSessionConfiguration.ephemeral
configuration.httpAdditionalHeaders = ["Accept": "application/json"]
let sessionManager = SessionManager(configuration: .ephemeral)
Expand Down Expand Up @@ -391,7 +391,7 @@ public final class WordPressComOAuthClient: NSObject {
})
}

fileprivate func cleanedUpResponseForLogging(_ response: AnyObject) -> AnyObject {
private func cleanedUpResponseForLogging(_ response: AnyObject) -> AnyObject {
guard var responseDictionary = response as? [String: AnyObject],
let _ = responseDictionary["access_token"]
else {
Expand Down
Loading