Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 7c2c126

Browse files
authored
Merge pull request #235 from wordpress-mobile/release/1.8.10
Merge Release/1.8.10 into master
2 parents 3a60d1c + bbf4c2a commit 7c2c126

File tree

10 files changed

+110
-14
lines changed

10 files changed

+110
-14
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ workflows:
99
jobs:
1010
- ios/test:
1111
name: Test
12-
xcode-version: "10.2.0"
12+
xcode-version: "11.2.1"
1313
workspace: WordPressShared.xcworkspace
1414
scheme: WordPressShared
15-
device: iPhone XS
16-
ios-version: "12.2"
15+
device: iPhone 11
16+
ios-version: "13.2.2"
1717
bundle-install: true
1818
pod-install: true
1919
- ios/validate-podspec:
2020
name: Validate Podspec
21-
xcode-version: "10.2.0"
21+
xcode-version: "11.2.1"
2222
podspec-path: WordPressShared.podspec
2323
bundle-install: true
2424
- ios/publish-podspec:
2525
name: Publish to Trunk
26-
xcode-version: "10.2.0"
26+
xcode-version: "11.2.1"
2727
podspec-path: WordPressShared.podspec
2828
bundle-install: true
2929
post-to-slack: true

WordPressShared.podspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressShared"
3-
s.version = "1.8.9"
3+
s.version = "1.8.10"
44
s.summary = "Shared components used in building the WordPress iOS apps and other library components."
55

66
s.description = <<-DESC
@@ -27,4 +27,3 @@ Pod::Spec.new do |s|
2727
s.dependency 'CocoaLumberjack', '~> 3.4'
2828
s.dependency 'FormatterKit/TimeIntervalFormatter', '1.8.2'
2929
end
30-

WordPressShared.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
B5A7881F202B3A92007874FB /* WPTextFieldTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A7881B202B3A92007874FB /* WPTextFieldTableViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
8282
B5A78820202B3A92007874FB /* WPTextFieldTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B5A7881C202B3A92007874FB /* WPTextFieldTableViewCell.m */; };
8383
B5A78821202B3A92007874FB /* WPTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A7881D202B3A92007874FB /* WPTableViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
84+
E157E126239527700051AE41 /* Secret.swift in Sources */ = {isa = PBXBuildFile; fileRef = E157E125239527700051AE41 /* Secret.swift */; };
85+
E157E128239527AD0051AE41 /* SecretTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E157E127239527AD0051AE41 /* SecretTests.swift */; };
8486
E18EABEA1F0E2C6800BFCB0B /* TestAnalyticsTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = E18EABE81F0E2C6800BFCB0B /* TestAnalyticsTracker.m */; };
8587
E18EABEB1F0E2C6800BFCB0B /* WPAnalyticsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E18EABE91F0E2C6800BFCB0B /* WPAnalyticsTests.m */; };
8688
E1A444281F063CAB00F6AA8A /* WPAnalytics.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A444261F063CAB00F6AA8A /* WPAnalytics.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -191,6 +193,8 @@
191193
B5A78823202B3B3C007874FB /* WordPressUIKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = WordPressUIKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
192194
BAD47F9FCABF8C12D6352A20 /* Pods-WordPressSharedTests.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressSharedTests.release-internal.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests.release-internal.xcconfig"; sourceTree = "<group>"; };
193195
D62D565031D4683172615BAC /* Pods-WordPressSharedTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressSharedTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests.release.xcconfig"; sourceTree = "<group>"; };
196+
E157E125239527700051AE41 /* Secret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secret.swift; sourceTree = "<group>"; };
197+
E157E127239527AD0051AE41 /* SecretTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretTests.swift; sourceTree = "<group>"; };
194198
E18EABE71F0E2C6800BFCB0B /* TestAnalyticsTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestAnalyticsTracker.h; sourceTree = "<group>"; };
195199
E18EABE81F0E2C6800BFCB0B /* TestAnalyticsTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestAnalyticsTracker.m; sourceTree = "<group>"; };
196200
E18EABE91F0E2C6800BFCB0B /* WPAnalyticsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPAnalyticsTests.m; sourceTree = "<group>"; };
@@ -299,6 +303,7 @@
299303
7430C9D01F19302D0051B8E6 /* PhotonImageURLHelper.h */,
300304
7430C9D11F19302D0051B8E6 /* PhotonImageURLHelper.m */,
301305
7430C9DA1F1933F40051B8E6 /* RichContentFormatter.swift */,
306+
E157E125239527700051AE41 /* Secret.swift */,
302307
7414BD541F13CBE0005759F8 /* String+Helpers.swift */,
303308
F19847DB226F92420004A8BC /* String+URLValidation.swift */,
304309
7414BD5F1F13D084005759F8 /* UIDevice+Helpers.h */,
@@ -347,6 +352,7 @@
347352
93A73ABE1EE9DDB000C0F2F9 /* WPMapFilterReduceTest.m */,
348353
8270708F1ECA4E1C00155CBF /* WordPressSharedTests-Bridging-Header.h */,
349354
F19847DD226F92EA0004A8BC /* StringURLValidationTests.swift */,
355+
E157E127239527AD0051AE41 /* SecretTests.swift */,
350356
);
351357
name = Tests;
352358
sourceTree = "<group>";
@@ -653,6 +659,7 @@
653659
buildActionMask = 2147483647;
654660
files = (
655661
E1A444291F063CAB00F6AA8A /* WPAnalytics.m in Sources */,
662+
E157E126239527700051AE41 /* Secret.swift in Sources */,
656663
827070101ECA43AA00155CBF /* WPImageSource.m in Sources */,
657664
93C674F51EE83D4B00BFAF05 /* Languages.swift in Sources */,
658665
B5A787E6202B2BD3007874FB /* WPDeviceIdentification.m in Sources */,
@@ -704,6 +711,7 @@
704711
B5393FDD206D6169007BF9D4 /* EmailTypoCheckerTests.swift in Sources */,
705712
F1134A292270C19200B8F75F /* DebouncerTests.swift in Sources */,
706713
7430C9D51F1930460051B8E6 /* PhotonImageURLHelperTest.m in Sources */,
714+
E157E128239527AD0051AE41 /* SecretTests.swift in Sources */,
707715
740B23CF1F17F28E00067A2A /* DisplayableImageHelperTest.m in Sources */,
708716
E18EABEB1F0E2C6800BFCB0B /* WPAnalyticsTests.m in Sources */,
709717
7430C9DD1F1934190051B8E6 /* RichContentFormatterTests.swift in Sources */,

WordPressShared/Core/Analytics/WPAnalytics.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ typedef NS_ENUM(NSUInteger, WPAnalyticsStat) {
7777
WPAnalyticsStatEditorAddedPhotoViaGiphy,
7878
WPAnalyticsStatEditorAddedPhotoViaOtherApps,
7979
WPAnalyticsStatEditorAddedPhotoViaStockPhotos,
80+
WPAnalyticsStatEditorAddedPhotoViaMediaEditor,
8081
WPAnalyticsStatEditorAddedVideoViaOtherApps,
8182
WPAnalyticsStatEditorAztecBetaLink,
8283
WPAnalyticsStatEditorAztecPromoLink,
@@ -198,6 +199,8 @@ typedef NS_ENUM(NSUInteger, WPAnalyticsStat) {
198199
WPAnalyticsStatLoginSocialErrorUnknownUser,
199200
WPAnalyticsStatLogout,
200201
WPAnalyticsStatLowMemoryWarning,
202+
WPAnalyticsStatMediaEditorShown,
203+
WPAnalyticsStatMediaEditorUsed,
201204
WPAnalyticsStatMediaLibraryDeletedItems,
202205
WPAnalyticsStatMediaLibraryEditedItemMetadata,
203206
WPAnalyticsStatMediaLibraryPreviewedItem,
@@ -559,7 +562,18 @@ typedef NS_ENUM(NSUInteger, WPAnalyticsStat) {
559562
WPAnalyticsStatTwoFactorSentSMS,
560563
WPAnalyticsStatShareExtensionError,
561564
WPAnalyticsStatSearchAdsAttribution,
562-
WPAnalyticsStatMaxValue
565+
WPAnalyticsStatMaxValue,
566+
/// Logged when there are orphaned entities (e.g. has NULL blog values).
567+
///
568+
/// These are invalid rows in the database and will cause a crash in Core Data during saving.
569+
///
570+
/// Event Properties:
571+
///
572+
/// - entity_name: String. The Core Data entity name.
573+
/// - deleted_count: Int. The number of deleted entities.
574+
///
575+
/// This event is not logged when there are no entities to delete.
576+
WPAnalyticsStatDebugDeletedOrphanedEntities
563577
};
564578

565579
extern NSString *const WPAnalyticsStatEditorPublishedPostPropertyCategory;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
int WPSharedGetLoggingLevel(void);
2-
void WPSharedSetLoggingLevel(int level);
1+
@import CocoaLumberjack;
2+
3+
DDLogLevel WPSharedGetLoggingLevel(void);
4+
void WPSharedSetLoggingLevel(DDLogLevel level);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#import "WPSharedLogging.h"
22
#import "WPSharedLoggingPrivate.h"
33

4-
int WPSharedGetLoggingLevel() {
4+
DDLogLevel WPSharedGetLoggingLevel() {
55
return ddLogLevel;
66
}
77

8-
void WPSharedSetLoggingLevel(int level) {
8+
void WPSharedSetLoggingLevel(DDLogLevel level) {
99
ddLogLevel = level;
1010
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import Foundation
2+
3+
/// Wraps a value that contains sensitive information to prevent accidental logging
4+
///
5+
/// Usage example
6+
///
7+
/// ```
8+
/// let password = Secret("my secret password")
9+
/// print(password) // Prints "--redacted--"
10+
/// print(password.secretValue) // Prints "my secret password"
11+
/// ```
12+
///
13+
public struct Secret<T> {
14+
public let secretValue: T
15+
16+
public init(_ secretValue: T) {
17+
self.secretValue = secretValue
18+
}
19+
}
20+
21+
extension Secret: RawRepresentable {
22+
public typealias RawValue = T
23+
24+
public init?(rawValue: Self.RawValue) {
25+
self.init(rawValue)
26+
}
27+
28+
public var rawValue: T {
29+
return secretValue
30+
}
31+
}
32+
33+
extension Secret: CustomStringConvertible, CustomDebugStringConvertible, CustomReflectable {
34+
private static var redacted: String {
35+
return "--redacted--"
36+
}
37+
38+
public var description: String {
39+
return Secret.redacted
40+
}
41+
42+
public var debugDescription: String {
43+
return Secret.redacted
44+
}
45+
46+
public var customMirror: Mirror {
47+
return Mirror(reflecting: Secret.redacted)
48+
}
49+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@import CocoaLumberjack;
2-
extern int ddLogLevel;
2+
extern DDLogLevel ddLogLevel;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#import "WPSharedLoggingPrivate.h"
2-
int ddLogLevel = DDLogLevelWarning;
2+
DDLogLevel ddLogLevel = DDLogLevelWarning;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import WordPressShared
2+
import XCTest
3+
4+
class SecretTests: XCTestCase {
5+
func testSecretDescription() {
6+
let secret = Secret("my secret")
7+
XCTAssertEqual("--redacted--", secret.description, "Description should be redacted")
8+
}
9+
10+
func testSecretDebugDescription() {
11+
let secret = Secret("my secret")
12+
XCTAssertEqual("--redacted--", secret.debugDescription, "Debug description should be redacted")
13+
}
14+
15+
func testSecretMirror() {
16+
let secret = Secret("my secret")
17+
XCTAssertEqual("--redacted--", String(reflecting: secret), "Mirror should be redacted")
18+
}
19+
20+
func testSecretUnwrapsValue() {
21+
let secret = Secret("my secret")
22+
XCTAssertEqual("my secret", secret.secretValue, "secretValue should not be redacted")
23+
}
24+
}

0 commit comments

Comments
 (0)