Completed
Push — master ( f3a6aa...8848c4 )
by Naveen
01:08
created
src/vendor/composer/autoload_namespaces.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 // autoload_namespaces.php @generated by Composer
4 4
 
5
-$vendorDir = dirname( ( __DIR__ ) );
6
-$baseDir   = dirname( $vendorDir );
5
+$vendorDir = dirname((__DIR__));
6
+$baseDir   = dirname($vendorDir);
7 7
 
8 8
 return array();
Please login to merge, or discard this patch.
src/vendor/composer/installed.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@
 block discarded – undo
1 1
 <?php return array(
2
-	'root'     =>
3
-	array(
4
-		'pretty_version' => 'dev-develop',
5
-		'version'        => 'dev-develop',
6
-		'aliases'        =>
7
-		array(),
8
-		'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
9
-		'name'           => '__root__',
10
-	),
11
-	'versions' =>
12
-	array(
13
-		'__root__'                                 =>
14
-		array(
15
-			'pretty_version' => 'dev-develop',
16
-			'version'        => 'dev-develop',
17
-			'aliases'        =>
18
-			array(),
19
-			'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
20
-		),
21
-		'deliciousbrains/wp-background-processing' =>
22
-		array(
23
-			'pretty_version' => '1.0.2',
24
-			'version'        => '1.0.2.0',
25
-			'aliases'        =>
26
-			array(),
27
-			'reference'      => '2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800',
28
-		),
29
-	),
2
+    'root'     =>
3
+    array(
4
+        'pretty_version' => 'dev-develop',
5
+        'version'        => 'dev-develop',
6
+        'aliases'        =>
7
+        array(),
8
+        'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
9
+        'name'           => '__root__',
10
+    ),
11
+    'versions' =>
12
+    array(
13
+        '__root__'                                 =>
14
+        array(
15
+            'pretty_version' => 'dev-develop',
16
+            'version'        => 'dev-develop',
17
+            'aliases'        =>
18
+            array(),
19
+            'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
20
+        ),
21
+        'deliciousbrains/wp-background-processing' =>
22
+        array(
23
+            'pretty_version' => '1.0.2',
24
+            'version'        => '1.0.2.0',
25
+            'aliases'        =>
26
+            array(),
27
+            'reference'      => '2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800',
28
+        ),
29
+    ),
30 30
 );
Please login to merge, or discard this patch.
src/vendor/composer/InstalledVersions.php 2 patches
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -6,119 +6,119 @@
 block discarded – undo
6 6
 
7 7
 class InstalledVersions {
8 8
 
9
-	private static $installed = array(
10
-		'root'     =>
11
-		array(
12
-			'pretty_version' => 'dev-develop',
13
-			'version'        => 'dev-develop',
14
-			'aliases'        =>
15
-			array(),
16
-			'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
17
-			'name'           => '__root__',
18
-		),
19
-		'versions' =>
20
-		array(
21
-			'__root__'                                 =>
22
-			array(
23
-				'pretty_version' => 'dev-develop',
24
-				'version'        => 'dev-develop',
25
-				'aliases'        =>
26
-				array(),
27
-				'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
28
-			),
29
-			'deliciousbrains/wp-background-processing' =>
30
-			array(
31
-				'pretty_version' => '1.0.2',
32
-				'version'        => '1.0.2.0',
33
-				'aliases'        =>
34
-				array(),
35
-				'reference'      => '2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800',
36
-			),
37
-		),
38
-	);
39
-
40
-	public static function getInstalledPackages() {
41
-		return array_keys( self::$installed['versions'] );
42
-	}
43
-
44
-	public static function isInstalled( $packageName ) {
45
-		return isset( self::$installed['versions'][ $packageName ] );
46
-	}
47
-
48
-	public static function satisfies( VersionParser $parser, $packageName, $constraint ) {
49
-		$constraint = $parser->parseConstraints( $constraint );
50
-		$provided   = $parser->parseConstraints( self::getVersionRanges( $packageName ) );
51
-
52
-		return $provided->matches( $constraint );
53
-	}
54
-
55
-	public static function getVersionRanges( $packageName ) {
56
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
57
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
58
-		}
59
-
60
-		$ranges = array();
61
-		if ( isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
62
-			$ranges[] = self::$installed['versions'][ $packageName ]['pretty_version'];
63
-		}
64
-		if ( array_key_exists( 'aliases', self::$installed['versions'][ $packageName ] ) ) {
65
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['aliases'] );
66
-		}
67
-		if ( array_key_exists( 'replaced', self::$installed['versions'][ $packageName ] ) ) {
68
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['replaced'] );
69
-		}
70
-		if ( array_key_exists( 'provided', self::$installed['versions'][ $packageName ] ) ) {
71
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['provided'] );
72
-		}
73
-
74
-		return implode( ' || ', $ranges );
75
-	}
76
-
77
-	public static function getVersion( $packageName ) {
78
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
79
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
80
-		}
81
-
82
-		if ( ! isset( self::$installed['versions'][ $packageName ]['version'] ) ) {
83
-			return null;
84
-		}
85
-
86
-		return self::$installed['versions'][ $packageName ]['version'];
87
-	}
88
-
89
-	public static function getPrettyVersion( $packageName ) {
90
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
91
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
92
-		}
93
-
94
-		if ( ! isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
95
-			return null;
96
-		}
97
-
98
-		return self::$installed['versions'][ $packageName ]['pretty_version'];
99
-	}
100
-
101
-	public static function getReference( $packageName ) {
102
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
103
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
104
-		}
105
-
106
-		if ( ! isset( self::$installed['versions'][ $packageName ]['reference'] ) ) {
107
-			return null;
108
-		}
109
-
110
-		return self::$installed['versions'][ $packageName ]['reference'];
111
-	}
112
-
113
-	public static function getRootPackage() {
114
-		return self::$installed['root'];
115
-	}
116
-
117
-	public static function getRawData() {
118
-		return self::$installed;
119
-	}
120
-
121
-	public static function reload( $data ) {
122
-		self::$installed = $data;
123
-	}
9
+    private static $installed = array(
10
+        'root'     =>
11
+        array(
12
+            'pretty_version' => 'dev-develop',
13
+            'version'        => 'dev-develop',
14
+            'aliases'        =>
15
+            array(),
16
+            'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
17
+            'name'           => '__root__',
18
+        ),
19
+        'versions' =>
20
+        array(
21
+            '__root__'                                 =>
22
+            array(
23
+                'pretty_version' => 'dev-develop',
24
+                'version'        => 'dev-develop',
25
+                'aliases'        =>
26
+                array(),
27
+                'reference'      => '2b5035defcc45dcd4370a5865ba4fe5e91035435',
28
+            ),
29
+            'deliciousbrains/wp-background-processing' =>
30
+            array(
31
+                'pretty_version' => '1.0.2',
32
+                'version'        => '1.0.2.0',
33
+                'aliases'        =>
34
+                array(),
35
+                'reference'      => '2cbee1abd1b49e1133cd8f611df4d4fc5a8b9800',
36
+            ),
37
+        ),
38
+    );
39
+
40
+    public static function getInstalledPackages() {
41
+        return array_keys( self::$installed['versions'] );
42
+    }
43
+
44
+    public static function isInstalled( $packageName ) {
45
+        return isset( self::$installed['versions'][ $packageName ] );
46
+    }
47
+
48
+    public static function satisfies( VersionParser $parser, $packageName, $constraint ) {
49
+        $constraint = $parser->parseConstraints( $constraint );
50
+        $provided   = $parser->parseConstraints( self::getVersionRanges( $packageName ) );
51
+
52
+        return $provided->matches( $constraint );
53
+    }
54
+
55
+    public static function getVersionRanges( $packageName ) {
56
+        if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
57
+            throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
58
+        }
59
+
60
+        $ranges = array();
61
+        if ( isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
62
+            $ranges[] = self::$installed['versions'][ $packageName ]['pretty_version'];
63
+        }
64
+        if ( array_key_exists( 'aliases', self::$installed['versions'][ $packageName ] ) ) {
65
+            $ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['aliases'] );
66
+        }
67
+        if ( array_key_exists( 'replaced', self::$installed['versions'][ $packageName ] ) ) {
68
+            $ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['replaced'] );
69
+        }
70
+        if ( array_key_exists( 'provided', self::$installed['versions'][ $packageName ] ) ) {
71
+            $ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['provided'] );
72
+        }
73
+
74
+        return implode( ' || ', $ranges );
75
+    }
76
+
77
+    public static function getVersion( $packageName ) {
78
+        if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
79
+            throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
80
+        }
81
+
82
+        if ( ! isset( self::$installed['versions'][ $packageName ]['version'] ) ) {
83
+            return null;
84
+        }
85
+
86
+        return self::$installed['versions'][ $packageName ]['version'];
87
+    }
88
+
89
+    public static function getPrettyVersion( $packageName ) {
90
+        if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
91
+            throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
92
+        }
93
+
94
+        if ( ! isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
95
+            return null;
96
+        }
97
+
98
+        return self::$installed['versions'][ $packageName ]['pretty_version'];
99
+    }
100
+
101
+    public static function getReference( $packageName ) {
102
+        if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
103
+            throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
104
+        }
105
+
106
+        if ( ! isset( self::$installed['versions'][ $packageName ]['reference'] ) ) {
107
+            return null;
108
+        }
109
+
110
+        return self::$installed['versions'][ $packageName ]['reference'];
111
+    }
112
+
113
+    public static function getRootPackage() {
114
+        return self::$installed['root'];
115
+    }
116
+
117
+    public static function getRawData() {
118
+        return self::$installed;
119
+    }
120
+
121
+    public static function reload( $data ) {
122
+        self::$installed = $data;
123
+    }
124 124
 }
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -38,76 +38,76 @@  discard block
 block discarded – undo
38 38
 	);
39 39
 
40 40
 	public static function getInstalledPackages() {
41
-		return array_keys( self::$installed['versions'] );
41
+		return array_keys(self::$installed['versions']);
42 42
 	}
43 43
 
44
-	public static function isInstalled( $packageName ) {
45
-		return isset( self::$installed['versions'][ $packageName ] );
44
+	public static function isInstalled($packageName) {
45
+		return isset(self::$installed['versions'][$packageName]);
46 46
 	}
47 47
 
48
-	public static function satisfies( VersionParser $parser, $packageName, $constraint ) {
49
-		$constraint = $parser->parseConstraints( $constraint );
50
-		$provided   = $parser->parseConstraints( self::getVersionRanges( $packageName ) );
48
+	public static function satisfies(VersionParser $parser, $packageName, $constraint) {
49
+		$constraint = $parser->parseConstraints($constraint);
50
+		$provided   = $parser->parseConstraints(self::getVersionRanges($packageName));
51 51
 
52
-		return $provided->matches( $constraint );
52
+		return $provided->matches($constraint);
53 53
 	}
54 54
 
55
-	public static function getVersionRanges( $packageName ) {
56
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
57
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
55
+	public static function getVersionRanges($packageName) {
56
+		if ( ! isset(self::$installed['versions'][$packageName])) {
57
+			throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
58 58
 		}
59 59
 
60 60
 		$ranges = array();
61
-		if ( isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
62
-			$ranges[] = self::$installed['versions'][ $packageName ]['pretty_version'];
61
+		if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
62
+			$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
63 63
 		}
64
-		if ( array_key_exists( 'aliases', self::$installed['versions'][ $packageName ] ) ) {
65
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['aliases'] );
64
+		if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
65
+			$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
66 66
 		}
67
-		if ( array_key_exists( 'replaced', self::$installed['versions'][ $packageName ] ) ) {
68
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['replaced'] );
67
+		if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
68
+			$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
69 69
 		}
70
-		if ( array_key_exists( 'provided', self::$installed['versions'][ $packageName ] ) ) {
71
-			$ranges = array_merge( $ranges, self::$installed['versions'][ $packageName ]['provided'] );
70
+		if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
71
+			$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
72 72
 		}
73 73
 
74
-		return implode( ' || ', $ranges );
74
+		return implode(' || ', $ranges);
75 75
 	}
76 76
 
77
-	public static function getVersion( $packageName ) {
78
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
79
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
77
+	public static function getVersion($packageName) {
78
+		if ( ! isset(self::$installed['versions'][$packageName])) {
79
+			throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
80 80
 		}
81 81
 
82
-		if ( ! isset( self::$installed['versions'][ $packageName ]['version'] ) ) {
82
+		if ( ! isset(self::$installed['versions'][$packageName]['version'])) {
83 83
 			return null;
84 84
 		}
85 85
 
86
-		return self::$installed['versions'][ $packageName ]['version'];
86
+		return self::$installed['versions'][$packageName]['version'];
87 87
 	}
88 88
 
89
-	public static function getPrettyVersion( $packageName ) {
90
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
91
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
89
+	public static function getPrettyVersion($packageName) {
90
+		if ( ! isset(self::$installed['versions'][$packageName])) {
91
+			throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
92 92
 		}
93 93
 
94
-		if ( ! isset( self::$installed['versions'][ $packageName ]['pretty_version'] ) ) {
94
+		if ( ! isset(self::$installed['versions'][$packageName]['pretty_version'])) {
95 95
 			return null;
96 96
 		}
97 97
 
98
-		return self::$installed['versions'][ $packageName ]['pretty_version'];
98
+		return self::$installed['versions'][$packageName]['pretty_version'];
99 99
 	}
100 100
 
101
-	public static function getReference( $packageName ) {
102
-		if ( ! isset( self::$installed['versions'][ $packageName ] ) ) {
103
-			throw new \OutOfBoundsException( 'Package "' . $packageName . '" is not installed' );
101
+	public static function getReference($packageName) {
102
+		if ( ! isset(self::$installed['versions'][$packageName])) {
103
+			throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed');
104 104
 		}
105 105
 
106
-		if ( ! isset( self::$installed['versions'][ $packageName ]['reference'] ) ) {
106
+		if ( ! isset(self::$installed['versions'][$packageName]['reference'])) {
107 107
 			return null;
108 108
 		}
109 109
 
110
-		return self::$installed['versions'][ $packageName ]['reference'];
110
+		return self::$installed['versions'][$packageName]['reference'];
111 111
 	}
112 112
 
113 113
 	public static function getRootPackage() {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		return self::$installed;
119 119
 	}
120 120
 
121
-	public static function reload( $data ) {
121
+	public static function reload($data) {
122 122
 		self::$installed = $data;
123 123
 	}
124 124
 }
Please login to merge, or discard this patch.
src/vendor/composer/autoload_classmap.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
 $baseDir   = dirname( $vendorDir );
7 7
 
8 8
 return array(
9
-	'Composer\\InstalledVersions'           => $vendorDir . '/composer/InstalledVersions.php',
10
-	'WP_Async_Request'                      => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
11
-	'WP_Background_Process'                 => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
12
-	'Wordlift_Plugin_WP_Async_Request'      => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
13
-	'Wordlift_Plugin_WP_Background_Process' => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
9
+    'Composer\\InstalledVersions'           => $vendorDir . '/composer/InstalledVersions.php',
10
+    'WP_Async_Request'                      => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
11
+    'WP_Background_Process'                 => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
12
+    'Wordlift_Plugin_WP_Async_Request'      => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
13
+    'Wordlift_Plugin_WP_Background_Process' => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
14 14
 );
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 
3 3
 // autoload_classmap.php @generated by Composer
4 4
 
5
-$vendorDir = dirname( ( __DIR__ ) );
6
-$baseDir   = dirname( $vendorDir );
5
+$vendorDir = dirname((__DIR__));
6
+$baseDir   = dirname($vendorDir);
7 7
 
8 8
 return array(
9
-	'Composer\\InstalledVersions'           => $vendorDir . '/composer/InstalledVersions.php',
10
-	'WP_Async_Request'                      => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
11
-	'WP_Background_Process'                 => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
12
-	'Wordlift_Plugin_WP_Async_Request'      => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
13
-	'Wordlift_Plugin_WP_Background_Process' => $baseDir . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
9
+	'Composer\\InstalledVersions'           => $vendorDir.'/composer/InstalledVersions.php',
10
+	'WP_Async_Request'                      => $vendorDir.'/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
11
+	'WP_Background_Process'                 => $vendorDir.'/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
12
+	'Wordlift_Plugin_WP_Async_Request'      => $baseDir.'/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
13
+	'Wordlift_Plugin_WP_Background_Process' => $baseDir.'/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
14 14
 );
Please login to merge, or discard this patch.
src/vendor/composer/autoload_static.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b {
8 8
 
9
-	public static $classMap = array(
10
-		'Composer\\InstalledVersions'           => __DIR__ . '/..' . '/composer/InstalledVersions.php',
11
-		'WP_Async_Request'                      => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
12
-		'WP_Background_Process'                 => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
13
-		'Wordlift_Plugin_WP_Async_Request'      => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
14
-		'Wordlift_Plugin_WP_Background_Process' => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
15
-	);
9
+    public static $classMap = array(
10
+        'Composer\\InstalledVersions'           => __DIR__ . '/..' . '/composer/InstalledVersions.php',
11
+        'WP_Async_Request'                      => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
12
+        'WP_Background_Process'                 => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
13
+        'Wordlift_Plugin_WP_Async_Request'      => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
14
+        'Wordlift_Plugin_WP_Background_Process' => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
15
+    );
16 16
 
17
-	public static function getInitializer( ClassLoader $loader ) {
18
-		return \Closure::bind(
19
-			function () use ( $loader ) {
20
-				$loader->classMap = ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::$classMap;
17
+    public static function getInitializer( ClassLoader $loader ) {
18
+        return \Closure::bind(
19
+            function () use ( $loader ) {
20
+                $loader->classMap = ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::$classMap;
21 21
 
22
-			},
23
-			null,
24
-			ClassLoader::class
25
-		);
26
-	}
22
+            },
23
+            null,
24
+            ClassLoader::class
25
+        );
26
+    }
27 27
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 block discarded – undo
7 7
 class ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b {
8 8
 
9 9
 	public static $classMap = array(
10
-		'Composer\\InstalledVersions'           => __DIR__ . '/..' . '/composer/InstalledVersions.php',
11
-		'WP_Async_Request'                      => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
12
-		'WP_Background_Process'                 => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
13
-		'Wordlift_Plugin_WP_Async_Request'      => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
14
-		'Wordlift_Plugin_WP_Background_Process' => __DIR__ . '/../..' . '/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
10
+		'Composer\\InstalledVersions'           => __DIR__.'/..'.'/composer/InstalledVersions.php',
11
+		'WP_Async_Request'                      => __DIR__.'/..'.'/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
12
+		'WP_Background_Process'                 => __DIR__.'/..'.'/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
13
+		'Wordlift_Plugin_WP_Async_Request'      => __DIR__.'/../..'.'/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-async-request.php',
14
+		'Wordlift_Plugin_WP_Background_Process' => __DIR__.'/../..'.'/ext/dependencies/deliciousbrains/wp-background-processing/classes/wp-background-process.php',
15 15
 	);
16 16
 
17
-	public static function getInitializer( ClassLoader $loader ) {
17
+	public static function getInitializer(ClassLoader $loader) {
18 18
 		return \Closure::bind(
19
-			function () use ( $loader ) {
19
+			function() use ($loader) {
20 20
 				$loader->classMap = ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::$classMap;
21 21
 
22 22
 			},
Please login to merge, or discard this patch.
src/vendor/composer/autoload_psr4.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 // autoload_psr4.php @generated by Composer
4 4
 
5
-$vendorDir = dirname( ( __DIR__ ) );
6
-$baseDir   = dirname( $vendorDir );
5
+$vendorDir = dirname((__DIR__));
6
+$baseDir   = dirname($vendorDir);
7 7
 
8 8
 return array();
Please login to merge, or discard this patch.
src/vendor/composer/autoload_real.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -4,52 +4,52 @@
 block discarded – undo
4 4
 
5 5
 class ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b {
6 6
 
7
-	private static $loader;
8
-
9
-	public static function loadClassLoader( $class ) {
10
-		if ( 'Composer\Autoload\ClassLoader' === $class ) {
11
-			require __DIR__ . '/ClassLoader.php';
12
-		}
13
-	}
14
-
15
-	/**
16
-	 * @return \Composer\Autoload\ClassLoader
17
-	 */
18
-	public static function getLoader() {
19
-		if ( null !== self::$loader ) {
20
-			return self::$loader;
21
-		}
22
-
23
-		require __DIR__ . '/platform_check.php';
24
-
25
-		spl_autoload_register( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ), true, true );
26
-		self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
-		spl_autoload_unregister( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ) );
28
-
29
-		$useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() );
30
-		if ( $useStaticLoader ) {
31
-			require __DIR__ . '/autoload_static.php';
32
-
33
-			call_user_func( \Composer\Autoload\ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::getInitializer( $loader ) );
34
-		} else {
35
-			$map = require __DIR__ . '/autoload_namespaces.php';
36
-			foreach ( $map as $namespace => $path ) {
37
-				$loader->set( $namespace, $path );
38
-			}
39
-
40
-			$map = require __DIR__ . '/autoload_psr4.php';
41
-			foreach ( $map as $namespace => $path ) {
42
-				$loader->setPsr4( $namespace, $path );
43
-			}
44
-
45
-			$classMap = require __DIR__ . '/autoload_classmap.php';
46
-			if ( $classMap ) {
47
-				$loader->addClassMap( $classMap );
48
-			}
49
-		}
50
-
51
-		$loader->register( true );
52
-
53
-		return $loader;
54
-	}
7
+    private static $loader;
8
+
9
+    public static function loadClassLoader( $class ) {
10
+        if ( 'Composer\Autoload\ClassLoader' === $class ) {
11
+            require __DIR__ . '/ClassLoader.php';
12
+        }
13
+    }
14
+
15
+    /**
16
+     * @return \Composer\Autoload\ClassLoader
17
+     */
18
+    public static function getLoader() {
19
+        if ( null !== self::$loader ) {
20
+            return self::$loader;
21
+        }
22
+
23
+        require __DIR__ . '/platform_check.php';
24
+
25
+        spl_autoload_register( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ), true, true );
26
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+        spl_autoload_unregister( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ) );
28
+
29
+        $useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() );
30
+        if ( $useStaticLoader ) {
31
+            require __DIR__ . '/autoload_static.php';
32
+
33
+            call_user_func( \Composer\Autoload\ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::getInitializer( $loader ) );
34
+        } else {
35
+            $map = require __DIR__ . '/autoload_namespaces.php';
36
+            foreach ( $map as $namespace => $path ) {
37
+                $loader->set( $namespace, $path );
38
+            }
39
+
40
+            $map = require __DIR__ . '/autoload_psr4.php';
41
+            foreach ( $map as $namespace => $path ) {
42
+                $loader->setPsr4( $namespace, $path );
43
+            }
44
+
45
+            $classMap = require __DIR__ . '/autoload_classmap.php';
46
+            if ( $classMap ) {
47
+                $loader->addClassMap( $classMap );
48
+            }
49
+        }
50
+
51
+        $loader->register( true );
52
+
53
+        return $loader;
54
+    }
55 55
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
 
7 7
 	private static $loader;
8 8
 
9
-	public static function loadClassLoader( $class ) {
10
-		if ( 'Composer\Autoload\ClassLoader' === $class ) {
11
-			require __DIR__ . '/ClassLoader.php';
9
+	public static function loadClassLoader($class) {
10
+		if ('Composer\Autoload\ClassLoader' === $class) {
11
+			require __DIR__.'/ClassLoader.php';
12 12
 		}
13 13
 	}
14 14
 
@@ -16,39 +16,39 @@  discard block
 block discarded – undo
16 16
 	 * @return \Composer\Autoload\ClassLoader
17 17
 	 */
18 18
 	public static function getLoader() {
19
-		if ( null !== self::$loader ) {
19
+		if (null !== self::$loader) {
20 20
 			return self::$loader;
21 21
 		}
22 22
 
23
-		require __DIR__ . '/platform_check.php';
23
+		require __DIR__.'/platform_check.php';
24 24
 
25
-		spl_autoload_register( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ), true, true );
25
+		spl_autoload_register(array('ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader'), true, true);
26 26
 		self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
-		spl_autoload_unregister( array( 'ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader' ) );
27
+		spl_autoload_unregister(array('ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b', 'loadClassLoader'));
28 28
 
29
-		$useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined( 'HHVM_VERSION' ) && ( ! function_exists( 'zend_loader_file_encoded' ) || ! zend_loader_file_encoded() );
30
-		if ( $useStaticLoader ) {
31
-			require __DIR__ . '/autoload_static.php';
29
+		$useStaticLoader = PHP_VERSION_ID >= 50600 && ! defined('HHVM_VERSION') && ( ! function_exists('zend_loader_file_encoded') || ! zend_loader_file_encoded());
30
+		if ($useStaticLoader) {
31
+			require __DIR__.'/autoload_static.php';
32 32
 
33
-			call_user_func( \Composer\Autoload\ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::getInitializer( $loader ) );
33
+			call_user_func(\Composer\Autoload\ComposerStaticInit30c84c47a44576eaa4b38cc478d5e11b::getInitializer($loader));
34 34
 		} else {
35
-			$map = require __DIR__ . '/autoload_namespaces.php';
36
-			foreach ( $map as $namespace => $path ) {
37
-				$loader->set( $namespace, $path );
35
+			$map = require __DIR__.'/autoload_namespaces.php';
36
+			foreach ($map as $namespace => $path) {
37
+				$loader->set($namespace, $path);
38 38
 			}
39 39
 
40
-			$map = require __DIR__ . '/autoload_psr4.php';
41
-			foreach ( $map as $namespace => $path ) {
42
-				$loader->setPsr4( $namespace, $path );
40
+			$map = require __DIR__.'/autoload_psr4.php';
41
+			foreach ($map as $namespace => $path) {
42
+				$loader->setPsr4($namespace, $path);
43 43
 			}
44 44
 
45
-			$classMap = require __DIR__ . '/autoload_classmap.php';
46
-			if ( $classMap ) {
47
-				$loader->addClassMap( $classMap );
45
+			$classMap = require __DIR__.'/autoload_classmap.php';
46
+			if ($classMap) {
47
+				$loader->addClassMap($classMap);
48 48
 			}
49 49
 		}
50 50
 
51
-		$loader->register( true );
51
+		$loader->register(true);
52 52
 
53 53
 		return $loader;
54 54
 	}
Please login to merge, or discard this patch.
src/wordlift-entity-type.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  */
11 11
 function wl_set_entity_main_type( $post_id, $type_uri ) {
12 12
 
13
-	Wordlift_Entity_Type_Service::get_instance()
14
-								->set( $post_id, $type_uri );
13
+    Wordlift_Entity_Type_Service::get_instance()
14
+                                ->set( $post_id, $type_uri );
15 15
 
16 16
 }
17 17
 
@@ -20,39 +20,39 @@  discard block
 block discarded – undo
20 20
  */
21 21
 function wl_print_entity_type_inline_js() {
22 22
 
23
-	$terms = get_terms( Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, array( 'get' => 'all' ) );
24
-
25
-	// Load the type data.
26
-	$schema_service = Wordlift_Schema_Service::get_instance();
27
-	$entity_types   = array_reduce(
28
-		$terms,
29
-		function ( $carry, $term ) use ( $schema_service ) {
30
-			$type = $schema_service->get_schema( $term->slug );
31
-
32
-			// Skip if no `uri`.
33
-			if ( empty( $type['uri'] ) ) {
34
-				return $carry;
35
-			}
36
-
37
-			$carry[] = array(
38
-				'label'     => $term->name,
39
-				'uri'       => $type['uri'],
40
-				'css'       => $type['css_class'],
41
-				'sameAs'    => isset( $type['same_as'] ) ? $type['same_as'] : array(),
42
-				'slug'      => $term->slug,
43
-				'templates' => ( isset( $type['templates'] ) ? $type['templates'] : array() ),
44
-			);
45
-
46
-			return $carry;
47
-		},
48
-		array()
49
-	);
50
-
51
-	// Hook to the Block Editor script.
52
-	wp_localize_script( 'wl-block-editor', '_wlEntityTypes', $entity_types );
53
-
54
-	// Hook to the Classic Editor script, see Wordlift_Admin_Post_Edit_Page.
55
-	wp_localize_script( 'wl-classic-editor', '_wlEntityTypes', $entity_types );
23
+    $terms = get_terms( Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, array( 'get' => 'all' ) );
24
+
25
+    // Load the type data.
26
+    $schema_service = Wordlift_Schema_Service::get_instance();
27
+    $entity_types   = array_reduce(
28
+        $terms,
29
+        function ( $carry, $term ) use ( $schema_service ) {
30
+            $type = $schema_service->get_schema( $term->slug );
31
+
32
+            // Skip if no `uri`.
33
+            if ( empty( $type['uri'] ) ) {
34
+                return $carry;
35
+            }
36
+
37
+            $carry[] = array(
38
+                'label'     => $term->name,
39
+                'uri'       => $type['uri'],
40
+                'css'       => $type['css_class'],
41
+                'sameAs'    => isset( $type['same_as'] ) ? $type['same_as'] : array(),
42
+                'slug'      => $term->slug,
43
+                'templates' => ( isset( $type['templates'] ) ? $type['templates'] : array() ),
44
+            );
45
+
46
+            return $carry;
47
+        },
48
+        array()
49
+    );
50
+
51
+    // Hook to the Block Editor script.
52
+    wp_localize_script( 'wl-block-editor', '_wlEntityTypes', $entity_types );
53
+
54
+    // Hook to the Classic Editor script, see Wordlift_Admin_Post_Edit_Page.
55
+    wp_localize_script( 'wl-classic-editor', '_wlEntityTypes', $entity_types );
56 56
 
57 57
 }
58 58
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
  *
9 9
  * @deprecated use Wordlift_Entity_Type_Service::get_instance()->set( $post_id, $type_uri )
10 10
  */
11
-function wl_set_entity_main_type( $post_id, $type_uri ) {
11
+function wl_set_entity_main_type($post_id, $type_uri) {
12 12
 
13 13
 	Wordlift_Entity_Type_Service::get_instance()
14
-								->set( $post_id, $type_uri );
14
+								->set($post_id, $type_uri);
15 15
 
16 16
 }
17 17
 
@@ -20,17 +20,17 @@  discard block
 block discarded – undo
20 20
  */
21 21
 function wl_print_entity_type_inline_js() {
22 22
 
23
-	$terms = get_terms( Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, array( 'get' => 'all' ) );
23
+	$terms = get_terms(Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, array('get' => 'all'));
24 24
 
25 25
 	// Load the type data.
26 26
 	$schema_service = Wordlift_Schema_Service::get_instance();
27 27
 	$entity_types   = array_reduce(
28 28
 		$terms,
29
-		function ( $carry, $term ) use ( $schema_service ) {
30
-			$type = $schema_service->get_schema( $term->slug );
29
+		function($carry, $term) use ($schema_service) {
30
+			$type = $schema_service->get_schema($term->slug);
31 31
 
32 32
 			// Skip if no `uri`.
33
-			if ( empty( $type['uri'] ) ) {
33
+			if (empty($type['uri'])) {
34 34
 				return $carry;
35 35
 			}
36 36
 
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 				'label'     => $term->name,
39 39
 				'uri'       => $type['uri'],
40 40
 				'css'       => $type['css_class'],
41
-				'sameAs'    => isset( $type['same_as'] ) ? $type['same_as'] : array(),
41
+				'sameAs'    => isset($type['same_as']) ? $type['same_as'] : array(),
42 42
 				'slug'      => $term->slug,
43
-				'templates' => ( isset( $type['templates'] ) ? $type['templates'] : array() ),
43
+				'templates' => (isset($type['templates']) ? $type['templates'] : array()),
44 44
 			);
45 45
 
46 46
 			return $carry;
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 	);
50 50
 
51 51
 	// Hook to the Block Editor script.
52
-	wp_localize_script( 'wl-block-editor', '_wlEntityTypes', $entity_types );
52
+	wp_localize_script('wl-block-editor', '_wlEntityTypes', $entity_types);
53 53
 
54 54
 	// Hook to the Classic Editor script, see Wordlift_Admin_Post_Edit_Page.
55
-	wp_localize_script( 'wl-classic-editor', '_wlEntityTypes', $entity_types );
55
+	wp_localize_script('wl-classic-editor', '_wlEntityTypes', $entity_types);
56 56
 
57 57
 }
58 58
 
59 59
 // Allow Classic and Block Editor scripts to register first.
60
-add_action( 'admin_print_scripts-post.php', 'wl_print_entity_type_inline_js', 11 );
61
-add_action( 'admin_print_scripts-post-new.php', 'wl_print_entity_type_inline_js', 11 );
60
+add_action('admin_print_scripts-post.php', 'wl_print_entity_type_inline_js', 11);
61
+add_action('admin_print_scripts-post-new.php', 'wl_print_entity_type_inline_js', 11);
Please login to merge, or discard this patch.
src/includes/class-wordlift-countries.php 2 patches
Indentation   +516 added lines, -516 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 if ( ! defined( 'ABSPATH' ) ) {
14
-	exit;
14
+    exit;
15 15
 }
16 16
 
17 17
 /**
@@ -21,520 +21,520 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class Wordlift_Countries {
23 23
 
24
-	/**
25
-	 * An array that will contain country codes => country names pairs. It gets lazily loaded the first time by the
26
-	 * `get_countries` function.
27
-	 *
28
-	 * @since 3.18.0
29
-	 * @var array An array of country codes => country names pairs or NULL if not initialized yet.
30
-	 */
31
-	private static $countries = array();
32
-
33
-	/**
34
-	 * The list of supported country codes, this is populated by self::lazy_populate_codes_and_country_codes_array.
35
-	 *
36
-	 * WARNING! If you change the list of supported countries, *you have* to add the related flag
37
-	 * in the images/flags folder.
38
-	 *
39
-	 * @since 3.18.0
40
-	 *
41
-	 * @var array An array of country codes => supported_languages_array
42
-	 */
43
-	public static $codes = array();
44
-
45
-	/**
46
-	 * The list of country codes, this is populated by self::lazy_populate_codes_and_country_codes_array.
47
-	 *
48
-	 * WARNING! If you change the list of supported countries, *you have* to add the related flag
49
-	 * in the images/flags folder.
50
-	 *
51
-	 * @since 3.18.0
52
-	 *
53
-	 * @var array An array of country codes => country names.
54
-	 */
55
-	private static $country_codes = array();
56
-
57
-	/**
58
-	 * An array of flag filenames.
59
-	 *
60
-	 * @since 3.20.0
61
-	 *
62
-	 * @var array An array of flag filenames.
63
-	 */
64
-	private static $country_flags = array(
65
-		'af' => 'Afghanistan',
66
-		'ax' => 'Aland',
67
-		'al' => 'Albania',
68
-		'dz' => 'Algeria',
69
-		'as' => 'American-Samoa',
70
-		'ad' => 'Andorra',
71
-		'ao' => 'Angola',
72
-		'ai' => 'Anguilla',
73
-		'aq' => 'Antarctica',
74
-		'ag' => 'Antigua-and-Barbuda',
75
-		'ar' => 'Argentina',
76
-		'am' => 'Armenia',
77
-		'aw' => 'Aruba',
78
-		'au' => 'Australia',
79
-		'at' => 'Austria',
80
-		'az' => 'Azerbaijan',
81
-		'bs' => 'Bahamas',
82
-		'bh' => 'Bahrain',
83
-		'bd' => 'Bangladesh',
84
-		'bb' => 'Barbados',
85
-		'by' => 'Belarus',
86
-		'be' => 'Belgium',
87
-		'bz' => 'Belize',
88
-		'bj' => 'Benin',
89
-		'bm' => 'Bermuda',
90
-		'bt' => 'Bhutan',
91
-		'bo' => 'Bolivia',
92
-		// Uses Netherlands' flag, see https://en.wikipedia.org/wiki/Caribbean_Netherlands.
93
-		'bq' => 'Netherlands',
94
-		'ba' => 'Bosnia-and-Herzegovina',
95
-		'bw' => 'Botswana',
96
-		'bv' => 'Bouvet Island',
97
-		'br' => 'Brazil',
98
-		'io' => null,
99
-		'bn' => 'Brunei',
100
-		'bg' => 'Bulgaria',
101
-		'bf' => 'Burkina-Faso',
102
-		'bi' => 'Burundi',
103
-		'kh' => 'Cambodia',
104
-		'cm' => 'Cameroon',
105
-		'ca' => 'Canada',
106
-		'cv' => 'Cape-Verde',
107
-		'ky' => 'Cayman-Islands',
108
-		'cf' => 'Central-African-Republic',
109
-		'td' => 'Chad',
110
-		'cl' => 'Chile',
111
-		'cn' => 'China',
112
-		'cx' => 'Christmas-Island',
113
-		'cc' => 'Cocos-Keeling-Islands',
114
-		'co' => 'Colombia',
115
-		'km' => 'Comoros',
116
-		'cg' => 'Republic-of-the-Congo',
117
-		'cd' => 'Democratic-Republic-of-the-Congo',
118
-		'ck' => 'Cook-Islands',
119
-		'cr' => 'Costa-Rica',
120
-		'ci' => 'Cote-dIvoire',
121
-		'hr' => 'Croatia',
122
-		'cu' => 'Cuba',
123
-		'cw' => 'Curacao',
124
-		'cy' => 'Cyprus',
125
-		'cz' => 'Czech-Republic',
126
-		'dk' => 'Denmark',
127
-		'dj' => 'Djibouti',
128
-		'dm' => 'Dominica',
129
-		'do' => 'Dominican-Republic',
130
-		'ec' => 'Ecuador',
131
-		'eg' => 'Egypt',
132
-		'sv' => 'El-Salvador',
133
-		'gq' => 'Equatorial-Guinea',
134
-		'er' => 'Eritrea',
135
-		'ee' => 'Estonia',
136
-		'et' => 'Ethiopia',
137
-		'fk' => 'Falkland-Islands',
138
-		'fo' => 'Faroes',
139
-		'fj' => 'Fiji',
140
-		'fi' => 'Finland',
141
-		'fr' => 'France',
142
-		// Uses France's flag, see https://en.wikipedia.org/wiki/French_Guiana.
143
-		'gf' => 'France',
144
-		'pf' => 'French-Polynesia',
145
-		'tf' => 'French-Southern-Territories',
146
-		'ga' => 'Gabon',
147
-		'gm' => 'Gambia',
148
-		'ge' => 'Georgia',
149
-		'de' => 'Germany',
150
-		'gh' => 'Ghana',
151
-		'gi' => 'Gibraltar',
152
-		'gr' => 'Greece',
153
-		'gl' => 'Greenland',
154
-		'gd' => 'Grenada',
155
-		// Uses France's flag, see https://en.wikipedia.org/wiki/Guadeloupe.
156
-		'gp' => 'France',
157
-		'gu' => 'Guam',
158
-		'gt' => 'Guatemala',
159
-		'gg' => 'Guernsey',
160
-		'gn' => 'Guinea',
161
-		'gw' => 'Guinea-Bissau',
162
-		'gy' => 'Guyana',
163
-		'ht' => 'Haiti',
164
-		// Uses Australia's flag, see https://en.wikipedia.org/wiki/Heard_Island_and_McDonald_Islands.
165
-		'hm' => 'Australia',
166
-		'va' => 'Vatican-City',
167
-		'hn' => 'Honduras',
168
-		'hk' => 'Hong-Kong',
169
-		'hu' => 'Hungary',
170
-		'is' => 'Iceland',
171
-		'in' => 'India',
172
-		'id' => 'Indonesia',
173
-		'ir' => 'Iran',
174
-		'iq' => 'Iraq',
175
-		'ie' => 'Ireland',
176
-		'im' => 'Isle-of-Man',
177
-		'il' => 'Israel',
178
-		'it' => 'Italy',
179
-		'jm' => 'Jamaica',
180
-		'jp' => 'Japan',
181
-		'je' => 'Jersey',
182
-		'jo' => 'Jordan',
183
-		'kz' => 'Kazakhstan',
184
-		'ke' => 'Kenya',
185
-		'ki' => 'Kiribati',
186
-		'kp' => 'North-Korea',
187
-		'kr' => 'South-Korea',
188
-		'kw' => 'Kuwait',
189
-		'kg' => 'Kyrgyzstan',
190
-		'la' => 'Laos',
191
-		'lv' => 'Latvia',
192
-		'lb' => 'Lebanon',
193
-		'ls' => 'Lesotho',
194
-		'lr' => 'Liberia',
195
-		'ly' => 'Libya',
196
-		'li' => 'Liechtenstein',
197
-		'lt' => 'Lithuania',
198
-		'lu' => 'Luxembourg',
199
-		'mo' => 'Macau',
200
-		'mk' => 'Macedonia',
201
-		'mg' => 'Madagascar',
202
-		'mw' => 'Malawi',
203
-		'my' => 'Malaysia',
204
-		'mv' => 'Maldives',
205
-		'ml' => 'Mali',
206
-		'mt' => 'Malta',
207
-		'mh' => 'Marshall-Islands',
208
-		'mq' => 'Martinique',
209
-		'mr' => 'Mauritania',
210
-		'mu' => 'Mauritius',
211
-		'yt' => 'Mayotte',
212
-		'mx' => 'Mexico',
213
-		'fm' => 'Micronesia',
214
-		'md' => 'Moldova',
215
-		'mc' => 'Monaco',
216
-		'mn' => 'Mongolia',
217
-		'me' => 'Montenegro',
218
-		'ms' => 'Montserrat',
219
-		'ma' => 'Morocco',
220
-		'mz' => 'Mozambique',
221
-		'mm' => 'Myanmar',
222
-		'na' => 'Namibia',
223
-		'nr' => 'Nauru',
224
-		'np' => 'Nepal',
225
-		'nl' => 'Netherlands',
226
-		'nc' => 'New-Caledonia',
227
-		'nz' => 'New-Zealand',
228
-		'ni' => 'Nicaragua',
229
-		'ne' => 'Niger',
230
-		'ng' => 'Nigeria',
231
-		'nu' => 'Niue',
232
-		'nf' => 'Norfolk-Island',
233
-		'mp' => 'Northern-Mariana-Islands',
234
-		'no' => 'Norway',
235
-		'om' => 'Oman',
236
-		'pk' => 'Pakistan',
237
-		'pw' => 'Palau',
238
-		'ps' => 'Palestine',
239
-		'pa' => 'Panama',
240
-		'pg' => 'Papua-New-Guinea',
241
-		'py' => 'Paraguay',
242
-		'pe' => 'Peru',
243
-		'ph' => 'Philippines',
244
-		'pn' => 'Pitcairn-Islands',
245
-		'pl' => 'Poland',
246
-		'pt' => 'Portugal',
247
-		'pr' => 'Puerto Rico',
248
-		'qa' => 'Qatar',
249
-		// Uses France's flag, see https://en.wikipedia.org/wiki/R%C3%A9union.
250
-		're' => 'France',
251
-		'ro' => 'Romania',
252
-		'ru' => 'Russia',
253
-		'rw' => 'Rwanda',
254
-		'bl' => 'Saint-Barthelemy',
255
-		'sh' => 'Saint-Helena',
256
-		'kn' => 'Saint-Kitts-and-Nevis',
257
-		'lc' => 'Saint-Lucia',
258
-		'mf' => 'Saint-Martin',
259
-		// Uses France's flag, see https://en.wikipedia.org/wiki/Saint_Pierre_and_Miquelon.
260
-		'pm' => 'France',
261
-		'vc' => 'Saint-Vincent-and-the-Grenadines',
262
-		'ws' => 'Samoa',
263
-		'sm' => 'San-Marino',
264
-		'st' => 'Sao-Tome-and-Principe',
265
-		'sa' => 'Saudi-Arabia',
266
-		'sn' => 'Senegal',
267
-		'rs' => 'Serbia',
268
-		'sc' => 'Seychelles',
269
-		'sl' => 'Sierra-Leone',
270
-		'sg' => 'Singapore',
271
-		'sx' => null,
272
-		'sk' => 'Slovakia',
273
-		'si' => 'Slovenia',
274
-		'sb' => 'Solomon-Islands',
275
-		'so' => 'Somalia',
276
-		'za' => 'South-Africa',
277
-		'gs' => 'South-Georgia-and-the-South-Sandwich-Islands',
278
-		'ss' => 'South-Sudan',
279
-		'es' => 'Spain',
280
-		'lk' => 'Sri-Lanka',
281
-		'sd' => 'Sudan',
282
-		'sr' => 'Suriname',
283
-		// Uses Norway's flag, see https://en.wikipedia.org/wiki/Svalbard_and_Jan_Mayen.
284
-		'sj' => 'Norway',
285
-		'sz' => 'Swaziland',
286
-		'se' => 'Sweden',
287
-		'ch' => 'Switzerland',
288
-		'sy' => 'Syria',
289
-		'tw' => 'Taiwan',
290
-		'tj' => 'Tajikistan',
291
-		'tz' => 'Tanzania',
292
-		'th' => 'Thailand',
293
-		'tl' => 'East-Timor',
294
-		'tg' => 'Togo',
295
-		'tk' => 'Tokelau',
296
-		'to' => 'Tonga',
297
-		'tt' => 'Trinidad-and-Tobago',
298
-		'tn' => 'Tunisia',
299
-		'tr' => 'Turkey',
300
-		'tm' => 'Turkmenistan',
301
-		'tc' => 'Turks-and-Caicos-Islands',
302
-		'tv' => 'Tuvalu',
303
-		'ug' => 'Uganda',
304
-		'ua' => 'Ukraine',
305
-		'ae' => 'United-Arab-Emirates',
306
-		'gb' => 'United-Kingdom',
307
-		'uk' => 'United-Kingdom',
308
-		'us' => 'United-States',
309
-		'um' => 'United-States',
310
-		'uy' => 'Uruguay',
311
-		'uz' => 'Uzbekistan',
312
-		'vu' => 'Vanuatu',
313
-		've' => 'Venezuela',
314
-		'vn' => 'Vietnam',
315
-		'vg' => 'British-Virgin-Islands',
316
-		'vi' => 'US-Virgin-Islands',
317
-		'wf' => 'Wallis-And-Futuna',
318
-		'eh' => 'Western-Sahara',
319
-		'ye' => 'Yemen',
320
-		'zm' => 'Zambia',
321
-		'zw' => 'Zimbabwe',
322
-	);
323
-
324
-	/**
325
-	 * Parse_country_code_json_file_to_array.
326
-	 *
327
-	 * @param string $file_name The json file name where the supported country
328
-	 * and languages are present.
329
-	 *
330
-	 * @return array An Array having two maps, country_code_language_map and country_code_name_map.
331
-	 */
332
-	public static function parse_country_code_json_file_to_array( $file_name ) {
333
-		// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
334
-		$json_file_contents = file_get_contents( $file_name );
335
-		$decoded_array      = json_decode( $json_file_contents, true );
336
-		// decoded array would be null if the json_decode parses
337
-		// invalid content.
338
-		if ( null === $decoded_array ) {
339
-			return array(
340
-				'country_code_name_map'     => array(),
341
-				'country_code_language_map' => array(),
342
-			);
343
-		}
344
-		$result = array();
345
-		// country_code => country_language map.
346
-		$country_code_language_map = array();
347
-		// country_code => country_name map.
348
-		$country_code_name_map = array();
349
-		foreach ( $decoded_array as $key => $value ) {
350
-			$country_code_language_map[ $key ] = $value['supportedLang'];
351
-			$country_code_name_map [ $key ]    = $value['defaultLoc']['loc_name'];
352
-		}
353
-		$result['country_code_language_map'] = $country_code_language_map;
354
-		$result['country_code_name_map']     = $country_code_name_map;
355
-
356
-		return $result;
357
-	}
358
-
359
-	/**
360
-	 * Get the list of WordLift's supported country codes from json file mapping country_code => languages.
361
-	 *
362
-	 * @param string $file_name The json file where the supported country codes and language_codes are stored.
363
-	 *
364
-	 * @return array An Array having two maps, country_code_language_map and country_code_name_map.
365
-	 * @since 3.22.5.1
366
-	 */
367
-	public static function get_codes_from_json_file( $file_name ) {
368
-		if ( file_exists( $file_name ) ) {
369
-			return self::parse_country_code_json_file_to_array( $file_name );
370
-		}
371
-
372
-		return array(
373
-			'country_code_name_map'     => array(),
374
-			'country_code_language_map' => array(),
375
-		);
376
-	}
377
-
378
-	/**
379
-	 * Returns the country language pairs.
380
-	 *
381
-	 * @return array The country language pairs.
382
-	 * @since 3.18.0
383
-	 */
384
-	public static function get_codes() {
385
-		return self::$codes;
386
-	}
387
-
388
-	/**
389
-	 * Populate self::codes and self::country_codes if not done before.
390
-	 *
391
-	 * @param string $file_name The json file where the supported country codes and language_codes are stored.
392
-	 *
393
-	 * @return void
394
-	 * @since 3.22.5.1
395
-	 */
396
-	private static function lazy_populate_codes_and_country_codes_array( $file_name ) {
397
-		if ( null === $file_name ) {
398
-			$file_name = __DIR__ . '/supported-countries.json';
399
-		}
400
-		if ( 0 === count( self::$codes ) || 0 === count( self::$country_codes ) ) {
401
-			// populate the two arrays.
402
-			$result_array        = self::get_codes_from_json_file( $file_name );
403
-			self::$codes         = $result_array['country_code_language_map'];
404
-			self::$country_codes = $result_array['country_code_name_map'];
405
-		}
406
-
407
-	}
408
-
409
-	/**
410
-	 * Reset codes_and_country_codes static variable, used for testing
411
-	 *
412
-	 * @return void
413
-	 * @since 3.22.5.1
414
-	 */
415
-	public static function reset_codes_and_country_codes() {
416
-		self::$codes         = array();
417
-		self::$country_codes = array();
418
-	}
419
-
420
-	/**
421
-	 * Get the list of WordLift's supported countries in an array with country code => country name pairs.
422
-	 *
423
-	 * @param string|false $lang Optional. The language code we are looking for. Default `any`.
424
-	 *
425
-	 * @param string|null  $file_name Optional. The json file containing country codes
426
-	 *   and language data.
427
-	 *
428
-	 * @return array An array with country code => country name pairs.
429
-	 * @since 3.18.0
430
-	 */
431
-	public static function get_countries( $lang = false, $file_name = null ) {
432
-
433
-		// populate the codes and countries array if it is not done before.
434
-		self::lazy_populate_codes_and_country_codes_array( $file_name );
435
-
436
-		// Lazily load the countries.
437
-		// $lang_key = false === $lang ? 'any' : $lang;
438
-		$lang_key = 'any';
439
-		$lang     = '';
440
-
441
-		if ( isset( self::$countries[ $lang_key ] ) ) {
442
-			return self::$countries[ $lang_key ];
443
-		}
444
-
445
-		// Prepare the array.
446
-		self::$countries[ $lang ] = array();
447
-
448
-		// Get the country names from WP's own (multisite) function.
449
-		foreach ( self::$codes as $key => $languages ) {
450
-			if (
451
-				// Process all countries if there is no language specified.
452
-				empty( $lang ) ||
453
-
454
-				// Or if there are no language limitations for current country.
455
-				empty( self::$codes[ $key ] ) ||
456
-
457
-				// Or if the language code exists for current country.
458
-				! empty( $lang ) && in_array( $lang, self::$codes[ $key ], true )
459
-			) {
460
-				self::$countries[ $lang_key ][ $key ] = self::format_country_code( $key );
461
-			}
462
-		}
463
-
464
-		// Sort by country name.
465
-		asort( self::$countries[ $lang_key ] );
466
-
467
-		// We don't sort here because `asort` returns bool instead of sorted array.
468
-		return self::$countries[ $lang_key ];
469
-	}
470
-
471
-	/**
472
-	 * Returns the country for a country code. This function is a clone of WP's function provided in `ms.php`.
473
-	 *
474
-	 * @param string $code Optional. The two-letter country code. Default empty.
475
-	 *
476
-	 * @return string The country corresponding to $code if it exists. If it does not exist,
477
-	 *                then the first two letters of $code is returned.
478
-	 * @since 3.18.0
479
-	 */
480
-	private static function format_country_code( $code = '' ) {
481
-
482
-		$code = strtolower( substr( $code, 0, 2 ) );
483
-		/**
484
-		 * Filters the country codes.
485
-		 *
486
-		 * @param array $country_codes Key/value pair of country codes where key is the short version.
487
-		 * @param string $code A two-letter designation of the country.
488
-		 *
489
-		 * @since 3.18.0
490
-		 */
491
-		$country_codes = apply_filters( 'country_code', self::$country_codes, $code );
492
-
493
-		return strtr( $code, $country_codes );
494
-	}
495
-
496
-	/**
497
-	 * Get a flag URL.
498
-	 *
499
-	 * @param string $country_code The country code.
500
-	 *
501
-	 * @return string|null The flag url or null if not available.
502
-	 * @since 3.20.0
503
-	 */
504
-	public static function get_flag_url( $country_code ) {
505
-
506
-		// Bail out if we don't have the flag.
507
-		if ( ! isset( self::$country_flags[ $country_code ] )
508
-			 || ( self::$country_flags[ $country_code ] ) === null ) {
509
-			return null;
510
-		}
511
-
512
-		return plugin_dir_url( __DIR__ )
513
-			   . 'images/flags/16/'
514
-			   . self::$country_flags[ $country_code ]
515
-			   . '.png';
516
-	}
517
-
518
-	/**
519
-	 * Get a country name given a country code.
520
-	 *
521
-	 * @param string $country_code The 2-letters country code.
522
-	 *
523
-	 * @return null|string The country name (in English) or null if not found.
524
-	 * @since 3.20.0
525
-	 */
526
-	public static function get_country_name( $country_code ) {
527
-
528
-		/**
529
-		 * @since 3.27.6
530
-		 *
531
-		 * @see https://github.com/insideout10/wordlift-plugin/issues/1188
532
-		 */
533
-		if ( ! isset( self::$country_codes[ $country_code ] ) ) {
534
-			return '';
535
-		}
536
-
537
-		return self::$country_codes[ $country_code ];
538
-	}
24
+    /**
25
+     * An array that will contain country codes => country names pairs. It gets lazily loaded the first time by the
26
+     * `get_countries` function.
27
+     *
28
+     * @since 3.18.0
29
+     * @var array An array of country codes => country names pairs or NULL if not initialized yet.
30
+     */
31
+    private static $countries = array();
32
+
33
+    /**
34
+     * The list of supported country codes, this is populated by self::lazy_populate_codes_and_country_codes_array.
35
+     *
36
+     * WARNING! If you change the list of supported countries, *you have* to add the related flag
37
+     * in the images/flags folder.
38
+     *
39
+     * @since 3.18.0
40
+     *
41
+     * @var array An array of country codes => supported_languages_array
42
+     */
43
+    public static $codes = array();
44
+
45
+    /**
46
+     * The list of country codes, this is populated by self::lazy_populate_codes_and_country_codes_array.
47
+     *
48
+     * WARNING! If you change the list of supported countries, *you have* to add the related flag
49
+     * in the images/flags folder.
50
+     *
51
+     * @since 3.18.0
52
+     *
53
+     * @var array An array of country codes => country names.
54
+     */
55
+    private static $country_codes = array();
56
+
57
+    /**
58
+     * An array of flag filenames.
59
+     *
60
+     * @since 3.20.0
61
+     *
62
+     * @var array An array of flag filenames.
63
+     */
64
+    private static $country_flags = array(
65
+        'af' => 'Afghanistan',
66
+        'ax' => 'Aland',
67
+        'al' => 'Albania',
68
+        'dz' => 'Algeria',
69
+        'as' => 'American-Samoa',
70
+        'ad' => 'Andorra',
71
+        'ao' => 'Angola',
72
+        'ai' => 'Anguilla',
73
+        'aq' => 'Antarctica',
74
+        'ag' => 'Antigua-and-Barbuda',
75
+        'ar' => 'Argentina',
76
+        'am' => 'Armenia',
77
+        'aw' => 'Aruba',
78
+        'au' => 'Australia',
79
+        'at' => 'Austria',
80
+        'az' => 'Azerbaijan',
81
+        'bs' => 'Bahamas',
82
+        'bh' => 'Bahrain',
83
+        'bd' => 'Bangladesh',
84
+        'bb' => 'Barbados',
85
+        'by' => 'Belarus',
86
+        'be' => 'Belgium',
87
+        'bz' => 'Belize',
88
+        'bj' => 'Benin',
89
+        'bm' => 'Bermuda',
90
+        'bt' => 'Bhutan',
91
+        'bo' => 'Bolivia',
92
+        // Uses Netherlands' flag, see https://en.wikipedia.org/wiki/Caribbean_Netherlands.
93
+        'bq' => 'Netherlands',
94
+        'ba' => 'Bosnia-and-Herzegovina',
95
+        'bw' => 'Botswana',
96
+        'bv' => 'Bouvet Island',
97
+        'br' => 'Brazil',
98
+        'io' => null,
99
+        'bn' => 'Brunei',
100
+        'bg' => 'Bulgaria',
101
+        'bf' => 'Burkina-Faso',
102
+        'bi' => 'Burundi',
103
+        'kh' => 'Cambodia',
104
+        'cm' => 'Cameroon',
105
+        'ca' => 'Canada',
106
+        'cv' => 'Cape-Verde',
107
+        'ky' => 'Cayman-Islands',
108
+        'cf' => 'Central-African-Republic',
109
+        'td' => 'Chad',
110
+        'cl' => 'Chile',
111
+        'cn' => 'China',
112
+        'cx' => 'Christmas-Island',
113
+        'cc' => 'Cocos-Keeling-Islands',
114
+        'co' => 'Colombia',
115
+        'km' => 'Comoros',
116
+        'cg' => 'Republic-of-the-Congo',
117
+        'cd' => 'Democratic-Republic-of-the-Congo',
118
+        'ck' => 'Cook-Islands',
119
+        'cr' => 'Costa-Rica',
120
+        'ci' => 'Cote-dIvoire',
121
+        'hr' => 'Croatia',
122
+        'cu' => 'Cuba',
123
+        'cw' => 'Curacao',
124
+        'cy' => 'Cyprus',
125
+        'cz' => 'Czech-Republic',
126
+        'dk' => 'Denmark',
127
+        'dj' => 'Djibouti',
128
+        'dm' => 'Dominica',
129
+        'do' => 'Dominican-Republic',
130
+        'ec' => 'Ecuador',
131
+        'eg' => 'Egypt',
132
+        'sv' => 'El-Salvador',
133
+        'gq' => 'Equatorial-Guinea',
134
+        'er' => 'Eritrea',
135
+        'ee' => 'Estonia',
136
+        'et' => 'Ethiopia',
137
+        'fk' => 'Falkland-Islands',
138
+        'fo' => 'Faroes',
139
+        'fj' => 'Fiji',
140
+        'fi' => 'Finland',
141
+        'fr' => 'France',
142
+        // Uses France's flag, see https://en.wikipedia.org/wiki/French_Guiana.
143
+        'gf' => 'France',
144
+        'pf' => 'French-Polynesia',
145
+        'tf' => 'French-Southern-Territories',
146
+        'ga' => 'Gabon',
147
+        'gm' => 'Gambia',
148
+        'ge' => 'Georgia',
149
+        'de' => 'Germany',
150
+        'gh' => 'Ghana',
151
+        'gi' => 'Gibraltar',
152
+        'gr' => 'Greece',
153
+        'gl' => 'Greenland',
154
+        'gd' => 'Grenada',
155
+        // Uses France's flag, see https://en.wikipedia.org/wiki/Guadeloupe.
156
+        'gp' => 'France',
157
+        'gu' => 'Guam',
158
+        'gt' => 'Guatemala',
159
+        'gg' => 'Guernsey',
160
+        'gn' => 'Guinea',
161
+        'gw' => 'Guinea-Bissau',
162
+        'gy' => 'Guyana',
163
+        'ht' => 'Haiti',
164
+        // Uses Australia's flag, see https://en.wikipedia.org/wiki/Heard_Island_and_McDonald_Islands.
165
+        'hm' => 'Australia',
166
+        'va' => 'Vatican-City',
167
+        'hn' => 'Honduras',
168
+        'hk' => 'Hong-Kong',
169
+        'hu' => 'Hungary',
170
+        'is' => 'Iceland',
171
+        'in' => 'India',
172
+        'id' => 'Indonesia',
173
+        'ir' => 'Iran',
174
+        'iq' => 'Iraq',
175
+        'ie' => 'Ireland',
176
+        'im' => 'Isle-of-Man',
177
+        'il' => 'Israel',
178
+        'it' => 'Italy',
179
+        'jm' => 'Jamaica',
180
+        'jp' => 'Japan',
181
+        'je' => 'Jersey',
182
+        'jo' => 'Jordan',
183
+        'kz' => 'Kazakhstan',
184
+        'ke' => 'Kenya',
185
+        'ki' => 'Kiribati',
186
+        'kp' => 'North-Korea',
187
+        'kr' => 'South-Korea',
188
+        'kw' => 'Kuwait',
189
+        'kg' => 'Kyrgyzstan',
190
+        'la' => 'Laos',
191
+        'lv' => 'Latvia',
192
+        'lb' => 'Lebanon',
193
+        'ls' => 'Lesotho',
194
+        'lr' => 'Liberia',
195
+        'ly' => 'Libya',
196
+        'li' => 'Liechtenstein',
197
+        'lt' => 'Lithuania',
198
+        'lu' => 'Luxembourg',
199
+        'mo' => 'Macau',
200
+        'mk' => 'Macedonia',
201
+        'mg' => 'Madagascar',
202
+        'mw' => 'Malawi',
203
+        'my' => 'Malaysia',
204
+        'mv' => 'Maldives',
205
+        'ml' => 'Mali',
206
+        'mt' => 'Malta',
207
+        'mh' => 'Marshall-Islands',
208
+        'mq' => 'Martinique',
209
+        'mr' => 'Mauritania',
210
+        'mu' => 'Mauritius',
211
+        'yt' => 'Mayotte',
212
+        'mx' => 'Mexico',
213
+        'fm' => 'Micronesia',
214
+        'md' => 'Moldova',
215
+        'mc' => 'Monaco',
216
+        'mn' => 'Mongolia',
217
+        'me' => 'Montenegro',
218
+        'ms' => 'Montserrat',
219
+        'ma' => 'Morocco',
220
+        'mz' => 'Mozambique',
221
+        'mm' => 'Myanmar',
222
+        'na' => 'Namibia',
223
+        'nr' => 'Nauru',
224
+        'np' => 'Nepal',
225
+        'nl' => 'Netherlands',
226
+        'nc' => 'New-Caledonia',
227
+        'nz' => 'New-Zealand',
228
+        'ni' => 'Nicaragua',
229
+        'ne' => 'Niger',
230
+        'ng' => 'Nigeria',
231
+        'nu' => 'Niue',
232
+        'nf' => 'Norfolk-Island',
233
+        'mp' => 'Northern-Mariana-Islands',
234
+        'no' => 'Norway',
235
+        'om' => 'Oman',
236
+        'pk' => 'Pakistan',
237
+        'pw' => 'Palau',
238
+        'ps' => 'Palestine',
239
+        'pa' => 'Panama',
240
+        'pg' => 'Papua-New-Guinea',
241
+        'py' => 'Paraguay',
242
+        'pe' => 'Peru',
243
+        'ph' => 'Philippines',
244
+        'pn' => 'Pitcairn-Islands',
245
+        'pl' => 'Poland',
246
+        'pt' => 'Portugal',
247
+        'pr' => 'Puerto Rico',
248
+        'qa' => 'Qatar',
249
+        // Uses France's flag, see https://en.wikipedia.org/wiki/R%C3%A9union.
250
+        're' => 'France',
251
+        'ro' => 'Romania',
252
+        'ru' => 'Russia',
253
+        'rw' => 'Rwanda',
254
+        'bl' => 'Saint-Barthelemy',
255
+        'sh' => 'Saint-Helena',
256
+        'kn' => 'Saint-Kitts-and-Nevis',
257
+        'lc' => 'Saint-Lucia',
258
+        'mf' => 'Saint-Martin',
259
+        // Uses France's flag, see https://en.wikipedia.org/wiki/Saint_Pierre_and_Miquelon.
260
+        'pm' => 'France',
261
+        'vc' => 'Saint-Vincent-and-the-Grenadines',
262
+        'ws' => 'Samoa',
263
+        'sm' => 'San-Marino',
264
+        'st' => 'Sao-Tome-and-Principe',
265
+        'sa' => 'Saudi-Arabia',
266
+        'sn' => 'Senegal',
267
+        'rs' => 'Serbia',
268
+        'sc' => 'Seychelles',
269
+        'sl' => 'Sierra-Leone',
270
+        'sg' => 'Singapore',
271
+        'sx' => null,
272
+        'sk' => 'Slovakia',
273
+        'si' => 'Slovenia',
274
+        'sb' => 'Solomon-Islands',
275
+        'so' => 'Somalia',
276
+        'za' => 'South-Africa',
277
+        'gs' => 'South-Georgia-and-the-South-Sandwich-Islands',
278
+        'ss' => 'South-Sudan',
279
+        'es' => 'Spain',
280
+        'lk' => 'Sri-Lanka',
281
+        'sd' => 'Sudan',
282
+        'sr' => 'Suriname',
283
+        // Uses Norway's flag, see https://en.wikipedia.org/wiki/Svalbard_and_Jan_Mayen.
284
+        'sj' => 'Norway',
285
+        'sz' => 'Swaziland',
286
+        'se' => 'Sweden',
287
+        'ch' => 'Switzerland',
288
+        'sy' => 'Syria',
289
+        'tw' => 'Taiwan',
290
+        'tj' => 'Tajikistan',
291
+        'tz' => 'Tanzania',
292
+        'th' => 'Thailand',
293
+        'tl' => 'East-Timor',
294
+        'tg' => 'Togo',
295
+        'tk' => 'Tokelau',
296
+        'to' => 'Tonga',
297
+        'tt' => 'Trinidad-and-Tobago',
298
+        'tn' => 'Tunisia',
299
+        'tr' => 'Turkey',
300
+        'tm' => 'Turkmenistan',
301
+        'tc' => 'Turks-and-Caicos-Islands',
302
+        'tv' => 'Tuvalu',
303
+        'ug' => 'Uganda',
304
+        'ua' => 'Ukraine',
305
+        'ae' => 'United-Arab-Emirates',
306
+        'gb' => 'United-Kingdom',
307
+        'uk' => 'United-Kingdom',
308
+        'us' => 'United-States',
309
+        'um' => 'United-States',
310
+        'uy' => 'Uruguay',
311
+        'uz' => 'Uzbekistan',
312
+        'vu' => 'Vanuatu',
313
+        've' => 'Venezuela',
314
+        'vn' => 'Vietnam',
315
+        'vg' => 'British-Virgin-Islands',
316
+        'vi' => 'US-Virgin-Islands',
317
+        'wf' => 'Wallis-And-Futuna',
318
+        'eh' => 'Western-Sahara',
319
+        'ye' => 'Yemen',
320
+        'zm' => 'Zambia',
321
+        'zw' => 'Zimbabwe',
322
+    );
323
+
324
+    /**
325
+     * Parse_country_code_json_file_to_array.
326
+     *
327
+     * @param string $file_name The json file name where the supported country
328
+     * and languages are present.
329
+     *
330
+     * @return array An Array having two maps, country_code_language_map and country_code_name_map.
331
+     */
332
+    public static function parse_country_code_json_file_to_array( $file_name ) {
333
+        // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
334
+        $json_file_contents = file_get_contents( $file_name );
335
+        $decoded_array      = json_decode( $json_file_contents, true );
336
+        // decoded array would be null if the json_decode parses
337
+        // invalid content.
338
+        if ( null === $decoded_array ) {
339
+            return array(
340
+                'country_code_name_map'     => array(),
341
+                'country_code_language_map' => array(),
342
+            );
343
+        }
344
+        $result = array();
345
+        // country_code => country_language map.
346
+        $country_code_language_map = array();
347
+        // country_code => country_name map.
348
+        $country_code_name_map = array();
349
+        foreach ( $decoded_array as $key => $value ) {
350
+            $country_code_language_map[ $key ] = $value['supportedLang'];
351
+            $country_code_name_map [ $key ]    = $value['defaultLoc']['loc_name'];
352
+        }
353
+        $result['country_code_language_map'] = $country_code_language_map;
354
+        $result['country_code_name_map']     = $country_code_name_map;
355
+
356
+        return $result;
357
+    }
358
+
359
+    /**
360
+     * Get the list of WordLift's supported country codes from json file mapping country_code => languages.
361
+     *
362
+     * @param string $file_name The json file where the supported country codes and language_codes are stored.
363
+     *
364
+     * @return array An Array having two maps, country_code_language_map and country_code_name_map.
365
+     * @since 3.22.5.1
366
+     */
367
+    public static function get_codes_from_json_file( $file_name ) {
368
+        if ( file_exists( $file_name ) ) {
369
+            return self::parse_country_code_json_file_to_array( $file_name );
370
+        }
371
+
372
+        return array(
373
+            'country_code_name_map'     => array(),
374
+            'country_code_language_map' => array(),
375
+        );
376
+    }
377
+
378
+    /**
379
+     * Returns the country language pairs.
380
+     *
381
+     * @return array The country language pairs.
382
+     * @since 3.18.0
383
+     */
384
+    public static function get_codes() {
385
+        return self::$codes;
386
+    }
387
+
388
+    /**
389
+     * Populate self::codes and self::country_codes if not done before.
390
+     *
391
+     * @param string $file_name The json file where the supported country codes and language_codes are stored.
392
+     *
393
+     * @return void
394
+     * @since 3.22.5.1
395
+     */
396
+    private static function lazy_populate_codes_and_country_codes_array( $file_name ) {
397
+        if ( null === $file_name ) {
398
+            $file_name = __DIR__ . '/supported-countries.json';
399
+        }
400
+        if ( 0 === count( self::$codes ) || 0 === count( self::$country_codes ) ) {
401
+            // populate the two arrays.
402
+            $result_array        = self::get_codes_from_json_file( $file_name );
403
+            self::$codes         = $result_array['country_code_language_map'];
404
+            self::$country_codes = $result_array['country_code_name_map'];
405
+        }
406
+
407
+    }
408
+
409
+    /**
410
+     * Reset codes_and_country_codes static variable, used for testing
411
+     *
412
+     * @return void
413
+     * @since 3.22.5.1
414
+     */
415
+    public static function reset_codes_and_country_codes() {
416
+        self::$codes         = array();
417
+        self::$country_codes = array();
418
+    }
419
+
420
+    /**
421
+     * Get the list of WordLift's supported countries in an array with country code => country name pairs.
422
+     *
423
+     * @param string|false $lang Optional. The language code we are looking for. Default `any`.
424
+     *
425
+     * @param string|null  $file_name Optional. The json file containing country codes
426
+     *   and language data.
427
+     *
428
+     * @return array An array with country code => country name pairs.
429
+     * @since 3.18.0
430
+     */
431
+    public static function get_countries( $lang = false, $file_name = null ) {
432
+
433
+        // populate the codes and countries array if it is not done before.
434
+        self::lazy_populate_codes_and_country_codes_array( $file_name );
435
+
436
+        // Lazily load the countries.
437
+        // $lang_key = false === $lang ? 'any' : $lang;
438
+        $lang_key = 'any';
439
+        $lang     = '';
440
+
441
+        if ( isset( self::$countries[ $lang_key ] ) ) {
442
+            return self::$countries[ $lang_key ];
443
+        }
444
+
445
+        // Prepare the array.
446
+        self::$countries[ $lang ] = array();
447
+
448
+        // Get the country names from WP's own (multisite) function.
449
+        foreach ( self::$codes as $key => $languages ) {
450
+            if (
451
+                // Process all countries if there is no language specified.
452
+                empty( $lang ) ||
453
+
454
+                // Or if there are no language limitations for current country.
455
+                empty( self::$codes[ $key ] ) ||
456
+
457
+                // Or if the language code exists for current country.
458
+                ! empty( $lang ) && in_array( $lang, self::$codes[ $key ], true )
459
+            ) {
460
+                self::$countries[ $lang_key ][ $key ] = self::format_country_code( $key );
461
+            }
462
+        }
463
+
464
+        // Sort by country name.
465
+        asort( self::$countries[ $lang_key ] );
466
+
467
+        // We don't sort here because `asort` returns bool instead of sorted array.
468
+        return self::$countries[ $lang_key ];
469
+    }
470
+
471
+    /**
472
+     * Returns the country for a country code. This function is a clone of WP's function provided in `ms.php`.
473
+     *
474
+     * @param string $code Optional. The two-letter country code. Default empty.
475
+     *
476
+     * @return string The country corresponding to $code if it exists. If it does not exist,
477
+     *                then the first two letters of $code is returned.
478
+     * @since 3.18.0
479
+     */
480
+    private static function format_country_code( $code = '' ) {
481
+
482
+        $code = strtolower( substr( $code, 0, 2 ) );
483
+        /**
484
+         * Filters the country codes.
485
+         *
486
+         * @param array $country_codes Key/value pair of country codes where key is the short version.
487
+         * @param string $code A two-letter designation of the country.
488
+         *
489
+         * @since 3.18.0
490
+         */
491
+        $country_codes = apply_filters( 'country_code', self::$country_codes, $code );
492
+
493
+        return strtr( $code, $country_codes );
494
+    }
495
+
496
+    /**
497
+     * Get a flag URL.
498
+     *
499
+     * @param string $country_code The country code.
500
+     *
501
+     * @return string|null The flag url or null if not available.
502
+     * @since 3.20.0
503
+     */
504
+    public static function get_flag_url( $country_code ) {
505
+
506
+        // Bail out if we don't have the flag.
507
+        if ( ! isset( self::$country_flags[ $country_code ] )
508
+             || ( self::$country_flags[ $country_code ] ) === null ) {
509
+            return null;
510
+        }
511
+
512
+        return plugin_dir_url( __DIR__ )
513
+                . 'images/flags/16/'
514
+                . self::$country_flags[ $country_code ]
515
+                . '.png';
516
+    }
517
+
518
+    /**
519
+     * Get a country name given a country code.
520
+     *
521
+     * @param string $country_code The 2-letters country code.
522
+     *
523
+     * @return null|string The country name (in English) or null if not found.
524
+     * @since 3.20.0
525
+     */
526
+    public static function get_country_name( $country_code ) {
527
+
528
+        /**
529
+         * @since 3.27.6
530
+         *
531
+         * @see https://github.com/insideout10/wordlift-plugin/issues/1188
532
+         */
533
+        if ( ! isset( self::$country_codes[ $country_code ] ) ) {
534
+            return '';
535
+        }
536
+
537
+        return self::$country_codes[ $country_code ];
538
+    }
539 539
 
540 540
 }
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @since   3.18.0
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -329,13 +329,13 @@  discard block
 block discarded – undo
329 329
 	 *
330 330
 	 * @return array An Array having two maps, country_code_language_map and country_code_name_map.
331 331
 	 */
332
-	public static function parse_country_code_json_file_to_array( $file_name ) {
332
+	public static function parse_country_code_json_file_to_array($file_name) {
333 333
 		// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
334
-		$json_file_contents = file_get_contents( $file_name );
335
-		$decoded_array      = json_decode( $json_file_contents, true );
334
+		$json_file_contents = file_get_contents($file_name);
335
+		$decoded_array      = json_decode($json_file_contents, true);
336 336
 		// decoded array would be null if the json_decode parses
337 337
 		// invalid content.
338
-		if ( null === $decoded_array ) {
338
+		if (null === $decoded_array) {
339 339
 			return array(
340 340
 				'country_code_name_map'     => array(),
341 341
 				'country_code_language_map' => array(),
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 		$country_code_language_map = array();
347 347
 		// country_code => country_name map.
348 348
 		$country_code_name_map = array();
349
-		foreach ( $decoded_array as $key => $value ) {
350
-			$country_code_language_map[ $key ] = $value['supportedLang'];
351
-			$country_code_name_map [ $key ]    = $value['defaultLoc']['loc_name'];
349
+		foreach ($decoded_array as $key => $value) {
350
+			$country_code_language_map[$key] = $value['supportedLang'];
351
+			$country_code_name_map [$key]    = $value['defaultLoc']['loc_name'];
352 352
 		}
353 353
 		$result['country_code_language_map'] = $country_code_language_map;
354 354
 		$result['country_code_name_map']     = $country_code_name_map;
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
 	 * @return array An Array having two maps, country_code_language_map and country_code_name_map.
365 365
 	 * @since 3.22.5.1
366 366
 	 */
367
-	public static function get_codes_from_json_file( $file_name ) {
368
-		if ( file_exists( $file_name ) ) {
369
-			return self::parse_country_code_json_file_to_array( $file_name );
367
+	public static function get_codes_from_json_file($file_name) {
368
+		if (file_exists($file_name)) {
369
+			return self::parse_country_code_json_file_to_array($file_name);
370 370
 		}
371 371
 
372 372
 		return array(
@@ -393,13 +393,13 @@  discard block
 block discarded – undo
393 393
 	 * @return void
394 394
 	 * @since 3.22.5.1
395 395
 	 */
396
-	private static function lazy_populate_codes_and_country_codes_array( $file_name ) {
397
-		if ( null === $file_name ) {
398
-			$file_name = __DIR__ . '/supported-countries.json';
396
+	private static function lazy_populate_codes_and_country_codes_array($file_name) {
397
+		if (null === $file_name) {
398
+			$file_name = __DIR__.'/supported-countries.json';
399 399
 		}
400
-		if ( 0 === count( self::$codes ) || 0 === count( self::$country_codes ) ) {
400
+		if (0 === count(self::$codes) || 0 === count(self::$country_codes)) {
401 401
 			// populate the two arrays.
402
-			$result_array        = self::get_codes_from_json_file( $file_name );
402
+			$result_array        = self::get_codes_from_json_file($file_name);
403 403
 			self::$codes         = $result_array['country_code_language_map'];
404 404
 			self::$country_codes = $result_array['country_code_name_map'];
405 405
 		}
@@ -428,44 +428,44 @@  discard block
 block discarded – undo
428 428
 	 * @return array An array with country code => country name pairs.
429 429
 	 * @since 3.18.0
430 430
 	 */
431
-	public static function get_countries( $lang = false, $file_name = null ) {
431
+	public static function get_countries($lang = false, $file_name = null) {
432 432
 
433 433
 		// populate the codes and countries array if it is not done before.
434
-		self::lazy_populate_codes_and_country_codes_array( $file_name );
434
+		self::lazy_populate_codes_and_country_codes_array($file_name);
435 435
 
436 436
 		// Lazily load the countries.
437 437
 		// $lang_key = false === $lang ? 'any' : $lang;
438 438
 		$lang_key = 'any';
439 439
 		$lang     = '';
440 440
 
441
-		if ( isset( self::$countries[ $lang_key ] ) ) {
442
-			return self::$countries[ $lang_key ];
441
+		if (isset(self::$countries[$lang_key])) {
442
+			return self::$countries[$lang_key];
443 443
 		}
444 444
 
445 445
 		// Prepare the array.
446
-		self::$countries[ $lang ] = array();
446
+		self::$countries[$lang] = array();
447 447
 
448 448
 		// Get the country names from WP's own (multisite) function.
449
-		foreach ( self::$codes as $key => $languages ) {
449
+		foreach (self::$codes as $key => $languages) {
450 450
 			if (
451 451
 				// Process all countries if there is no language specified.
452
-				empty( $lang ) ||
452
+				empty($lang) ||
453 453
 
454 454
 				// Or if there are no language limitations for current country.
455
-				empty( self::$codes[ $key ] ) ||
455
+				empty(self::$codes[$key]) ||
456 456
 
457 457
 				// Or if the language code exists for current country.
458
-				! empty( $lang ) && in_array( $lang, self::$codes[ $key ], true )
458
+				! empty($lang) && in_array($lang, self::$codes[$key], true)
459 459
 			) {
460
-				self::$countries[ $lang_key ][ $key ] = self::format_country_code( $key );
460
+				self::$countries[$lang_key][$key] = self::format_country_code($key);
461 461
 			}
462 462
 		}
463 463
 
464 464
 		// Sort by country name.
465
-		asort( self::$countries[ $lang_key ] );
465
+		asort(self::$countries[$lang_key]);
466 466
 
467 467
 		// We don't sort here because `asort` returns bool instead of sorted array.
468
-		return self::$countries[ $lang_key ];
468
+		return self::$countries[$lang_key];
469 469
 	}
470 470
 
471 471
 	/**
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 	 *                then the first two letters of $code is returned.
478 478
 	 * @since 3.18.0
479 479
 	 */
480
-	private static function format_country_code( $code = '' ) {
480
+	private static function format_country_code($code = '') {
481 481
 
482
-		$code = strtolower( substr( $code, 0, 2 ) );
482
+		$code = strtolower(substr($code, 0, 2));
483 483
 		/**
484 484
 		 * Filters the country codes.
485 485
 		 *
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
 		 *
489 489
 		 * @since 3.18.0
490 490
 		 */
491
-		$country_codes = apply_filters( 'country_code', self::$country_codes, $code );
491
+		$country_codes = apply_filters('country_code', self::$country_codes, $code);
492 492
 
493
-		return strtr( $code, $country_codes );
493
+		return strtr($code, $country_codes);
494 494
 	}
495 495
 
496 496
 	/**
@@ -501,17 +501,17 @@  discard block
 block discarded – undo
501 501
 	 * @return string|null The flag url or null if not available.
502 502
 	 * @since 3.20.0
503 503
 	 */
504
-	public static function get_flag_url( $country_code ) {
504
+	public static function get_flag_url($country_code) {
505 505
 
506 506
 		// Bail out if we don't have the flag.
507
-		if ( ! isset( self::$country_flags[ $country_code ] )
508
-			 || ( self::$country_flags[ $country_code ] ) === null ) {
507
+		if ( ! isset(self::$country_flags[$country_code])
508
+			 || (self::$country_flags[$country_code]) === null) {
509 509
 			return null;
510 510
 		}
511 511
 
512
-		return plugin_dir_url( __DIR__ )
512
+		return plugin_dir_url(__DIR__)
513 513
 			   . 'images/flags/16/'
514
-			   . self::$country_flags[ $country_code ]
514
+			   . self::$country_flags[$country_code]
515 515
 			   . '.png';
516 516
 	}
517 517
 
@@ -523,18 +523,18 @@  discard block
 block discarded – undo
523 523
 	 * @return null|string The country name (in English) or null if not found.
524 524
 	 * @since 3.20.0
525 525
 	 */
526
-	public static function get_country_name( $country_code ) {
526
+	public static function get_country_name($country_code) {
527 527
 
528 528
 		/**
529 529
 		 * @since 3.27.6
530 530
 		 *
531 531
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/1188
532 532
 		 */
533
-		if ( ! isset( self::$country_codes[ $country_code ] ) ) {
533
+		if ( ! isset(self::$country_codes[$country_code])) {
534 534
 			return '';
535 535
 		}
536 536
 
537
-		return self::$country_codes[ $country_code ];
537
+		return self::$country_codes[$country_code];
538 538
 	}
539 539
 
540 540
 }
Please login to merge, or discard this patch.