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 = "3.2.1"
s.version = "3.2.2.beta-1"
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."

s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ extension StatsTopClicksTimeIntervalData: StatsTimeIntervalData {
public init?(date: Date, period: StatsPeriodUnit, jsonDictionary: [String : AnyObject]) {
guard
let unwrappedDays = type(of: self).unwrapDaysDictionary(jsonDictionary: jsonDictionary),
let totalClicks = unwrappedDays["total_clicks"] as? Int,
let otherClicks = unwrappedDays["other_clicks"] as? Int,
let clicks = unwrappedDays["clicks"] as? [[String: AnyObject]]
else {
return nil
}


let totalClicks = unwrappedDays["total_clicks"] as? Int ?? 0
let otherClicks = unwrappedDays["other_clicks"] as? Int ?? 0

self.period = period
self.periodEndDate = date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ extension StatsTopCountryTimeIntervalData: StatsTimeIntervalData {

public init?(date: Date, period: StatsPeriodUnit, jsonDictionary: [String : AnyObject]) {
guard
let countryInfo = jsonDictionary["country-info"] as? [String: AnyObject],
let unwrappedDays = type(of: self).unwrapDaysDictionary(jsonDictionary: jsonDictionary),
let totalViews = unwrappedDays["total_views"] as? Int,
let otherViews = unwrappedDays["other_views"] as? Int,
let countriesViews = unwrappedDays["views"] as? [[String: AnyObject]]
else {
return nil
}

let countryInfo = jsonDictionary["country-info"] as? [String: AnyObject] ?? [:]
let totalViews = unwrappedDays["total_views"] as? Int ?? 0
let otherViews = unwrappedDays["other_views"] as? Int ?? 0

self.periodEndDate = date
self.period = period

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ extension StatsTopPostsTimeIntervalData: StatsTimeIntervalData {
public init?(date: Date, period: StatsPeriodUnit, jsonDictionary: [String : AnyObject]) {
guard
let unwrappedDays = type(of: self).unwrapDaysDictionary(jsonDictionary: jsonDictionary),
let posts = unwrappedDays["postviews"] as? [[String: AnyObject]],
let totalViews = unwrappedDays["total_views"] as? Int,
let otherViews = unwrappedDays["other_views"] as? Int
let posts = unwrappedDays["postviews"] as? [[String: AnyObject]]
else {
return nil
}

let totalViews = unwrappedDays["total_views"] as? Int ?? 0
let otherViews = unwrappedDays["other_views"] as? Int ?? 0

self.periodEndDate = date
self.period = period
self.totalViewsCount = totalViews
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ extension StatsTopReferrersTimeIntervalData: StatsTimeIntervalData {
public init?(date: Date, period: StatsPeriodUnit, jsonDictionary: [String : AnyObject]) {
guard
let unwrappedDays = type(of: self).unwrapDaysDictionary(jsonDictionary: jsonDictionary),
let totalClicks = unwrappedDays["total_views"] as? Int,
let otherClicks = unwrappedDays["other_views"] as? Int,
let referrers = unwrappedDays["groups"] as? [[String: AnyObject]]
else {
return nil
}

let totalClicks = unwrappedDays["total_views"] as? Int ?? 0
let otherClicks = unwrappedDays["other_views"] as? Int ?? 0

self.period = period
self.periodEndDate = date
self.totalReferrerViewsCount = totalClicks
Expand Down