1: <?php
2: function __( $name, $text_domain ) {
3: return $name;
4: }
5:
6: function get_woocommerce_country_list() {
7:
8:
9: return array(
10: 'AF' => __( 'Afghanistan', 'woocommerce' ),
11: 'AX' => __( 'Åland Islands', 'woocommerce' ),
12: 'AL' => __( 'Albania', 'woocommerce' ),
13: 'DZ' => __( 'Algeria', 'woocommerce' ),
14: 'AS' => __( 'American Samoa', 'woocommerce' ),
15: 'AD' => __( 'Andorra', 'woocommerce' ),
16: 'AO' => __( 'Angola', 'woocommerce' ),
17: 'AI' => __( 'Anguilla', 'woocommerce' ),
18: 'AQ' => __( 'Antarctica', 'woocommerce' ),
19: 'AG' => __( 'Antigua and Barbuda', 'woocommerce' ),
20: 'AR' => __( 'Argentina', 'woocommerce' ),
21: 'AM' => __( 'Armenia', 'woocommerce' ),
22: 'AW' => __( 'Aruba', 'woocommerce' ),
23: 'AU' => __( 'Australia', 'woocommerce' ),
24: 'AT' => __( 'Austria', 'woocommerce' ),
25: 'AZ' => __( 'Azerbaijan', 'woocommerce' ),
26: 'BS' => __( 'Bahamas', 'woocommerce' ),
27: 'BH' => __( 'Bahrain', 'woocommerce' ),
28: 'BD' => __( 'Bangladesh', 'woocommerce' ),
29: 'BB' => __( 'Barbados', 'woocommerce' ),
30: 'BY' => __( 'Belarus', 'woocommerce' ),
31: 'BE' => __( 'Belgium', 'woocommerce' ),
32: 'PW' => __( 'Belau', 'woocommerce' ),
33: 'BZ' => __( 'Belize', 'woocommerce' ),
34: 'BJ' => __( 'Benin', 'woocommerce' ),
35: 'BM' => __( 'Bermuda', 'woocommerce' ),
36: 'BT' => __( 'Bhutan', 'woocommerce' ),
37: 'BO' => __( 'Bolivia', 'woocommerce' ),
38: 'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'woocommerce' ),
39: 'BA' => __( 'Bosnia and Herzegovina', 'woocommerce' ),
40: 'BW' => __( 'Botswana', 'woocommerce' ),
41: 'BV' => __( 'Bouvet Island', 'woocommerce' ),
42: 'BR' => __( 'Brazil', 'woocommerce' ),
43: 'IO' => __( 'British Indian Ocean Territory', 'woocommerce' ),
44: 'VG' => __( 'British Virgin Islands', 'woocommerce' ),
45: 'BN' => __( 'Brunei', 'woocommerce' ),
46: 'BG' => __( 'Bulgaria', 'woocommerce' ),
47: 'BF' => __( 'Burkina Faso', 'woocommerce' ),
48: 'BI' => __( 'Burundi', 'woocommerce' ),
49: 'KH' => __( 'Cambodia', 'woocommerce' ),
50: 'CM' => __( 'Cameroon', 'woocommerce' ),
51: 'CA' => __( 'Canada', 'woocommerce' ),
52: 'CV' => __( 'Cape Verde', 'woocommerce' ),
53: 'KY' => __( 'Cayman Islands', 'woocommerce' ),
54: 'CF' => __( 'Central African Republic', 'woocommerce' ),
55: 'TD' => __( 'Chad', 'woocommerce' ),
56: 'CL' => __( 'Chile', 'woocommerce' ),
57: 'CN' => __( 'China', 'woocommerce' ),
58: 'CX' => __( 'Christmas Island', 'woocommerce' ),
59: 'CC' => __( 'Cocos (Keeling) Islands', 'woocommerce' ),
60: 'CO' => __( 'Colombia', 'woocommerce' ),
61: 'KM' => __( 'Comoros', 'woocommerce' ),
62: 'CG' => __( 'Congo (Brazzaville)', 'woocommerce' ),
63: 'CD' => __( 'Congo (Kinshasa)', 'woocommerce' ),
64: 'CK' => __( 'Cook Islands', 'woocommerce' ),
65: 'CR' => __( 'Costa Rica', 'woocommerce' ),
66: 'HR' => __( 'Croatia', 'woocommerce' ),
67: 'CU' => __( 'Cuba', 'woocommerce' ),
68: 'CW' => __( 'Curaçao', 'woocommerce' ),
69: 'CY' => __( 'Cyprus', 'woocommerce' ),
70: 'CZ' => __( 'Czech Republic', 'woocommerce' ),
71: 'DK' => __( 'Denmark', 'woocommerce' ),
72: 'DJ' => __( 'Djibouti', 'woocommerce' ),
73: 'DM' => __( 'Dominica', 'woocommerce' ),
74: 'DO' => __( 'Dominican Republic', 'woocommerce' ),
75: 'EC' => __( 'Ecuador', 'woocommerce' ),
76: 'EG' => __( 'Egypt', 'woocommerce' ),
77: 'SV' => __( 'El Salvador', 'woocommerce' ),
78: 'GQ' => __( 'Equatorial Guinea', 'woocommerce' ),
79: 'ER' => __( 'Eritrea', 'woocommerce' ),
80: 'EE' => __( 'Estonia', 'woocommerce' ),
81: 'ET' => __( 'Ethiopia', 'woocommerce' ),
82: 'FK' => __( 'Falkland Islands', 'woocommerce' ),
83: 'FO' => __( 'Faroe Islands', 'woocommerce' ),
84: 'FJ' => __( 'Fiji', 'woocommerce' ),
85: 'FI' => __( 'Finland', 'woocommerce' ),
86: 'FR' => __( 'France', 'woocommerce' ),
87: 'GF' => __( 'French Guiana', 'woocommerce' ),
88: 'PF' => __( 'French Polynesia', 'woocommerce' ),
89: 'TF' => __( 'French Southern Territories', 'woocommerce' ),
90: 'GA' => __( 'Gabon', 'woocommerce' ),
91: 'GM' => __( 'Gambia', 'woocommerce' ),
92: 'GE' => __( 'Georgia', 'woocommerce' ),
93: 'DE' => __( 'Germany', 'woocommerce' ),
94: 'GH' => __( 'Ghana', 'woocommerce' ),
95: 'GI' => __( 'Gibraltar', 'woocommerce' ),
96: 'GR' => __( 'Greece', 'woocommerce' ),
97: 'GL' => __( 'Greenland', 'woocommerce' ),
98: 'GD' => __( 'Grenada', 'woocommerce' ),
99: 'GP' => __( 'Guadeloupe', 'woocommerce' ),
100: 'GU' => __( 'Guam', 'woocommerce' ),
101: 'GT' => __( 'Guatemala', 'woocommerce' ),
102: 'GG' => __( 'Guernsey', 'woocommerce' ),
103: 'GN' => __( 'Guinea', 'woocommerce' ),
104: 'GW' => __( 'Guinea-Bissau', 'woocommerce' ),
105: 'GY' => __( 'Guyana', 'woocommerce' ),
106: 'HT' => __( 'Haiti', 'woocommerce' ),
107: 'HM' => __( 'Heard Island and McDonald Islands', 'woocommerce' ),
108: 'HN' => __( 'Honduras', 'woocommerce' ),
109: 'HK' => __( 'Hong Kong', 'woocommerce' ),
110: 'HU' => __( 'Hungary', 'woocommerce' ),
111: 'IS' => __( 'Iceland', 'woocommerce' ),
112: 'IN' => __( 'India', 'woocommerce' ),
113: 'ID' => __( 'Indonesia', 'woocommerce' ),
114: 'IR' => __( 'Iran', 'woocommerce' ),
115: 'IQ' => __( 'Iraq', 'woocommerce' ),
116: 'IE' => __( 'Republic of Ireland', 'woocommerce' ),
117: 'IM' => __( 'Isle of Man', 'woocommerce' ),
118: 'IL' => __( 'Israel', 'woocommerce' ),
119: 'IT' => __( 'Italy', 'woocommerce' ),
120: 'CI' => __( 'Ivory Coast', 'woocommerce' ),
121: 'JM' => __( 'Jamaica', 'woocommerce' ),
122: 'JP' => __( 'Japan', 'woocommerce' ),
123: 'JE' => __( 'Jersey', 'woocommerce' ),
124: 'JO' => __( 'Jordan', 'woocommerce' ),
125: 'KZ' => __( 'Kazakhstan', 'woocommerce' ),
126: 'KE' => __( 'Kenya', 'woocommerce' ),
127: 'KI' => __( 'Kiribati', 'woocommerce' ),
128: 'KW' => __( 'Kuwait', 'woocommerce' ),
129: 'KG' => __( 'Kyrgyzstan', 'woocommerce' ),
130: 'LA' => __( 'Laos', 'woocommerce' ),
131: 'LV' => __( 'Latvia', 'woocommerce' ),
132: 'LB' => __( 'Lebanon', 'woocommerce' ),
133: 'LS' => __( 'Lesotho', 'woocommerce' ),
134: 'LR' => __( 'Liberia', 'woocommerce' ),
135: 'LY' => __( 'Libya', 'woocommerce' ),
136: 'LI' => __( 'Liechtenstein', 'woocommerce' ),
137: 'LT' => __( 'Lithuania', 'woocommerce' ),
138: 'LU' => __( 'Luxembourg', 'woocommerce' ),
139: 'MO' => __( 'Macao S.A.R., China', 'woocommerce' ),
140: 'MK' => __( 'Macedonia', 'woocommerce' ),
141: 'MG' => __( 'Madagascar', 'woocommerce' ),
142: 'MW' => __( 'Malawi', 'woocommerce' ),
143: 'MY' => __( 'Malaysia', 'woocommerce' ),
144: 'MV' => __( 'Maldives', 'woocommerce' ),
145: 'ML' => __( 'Mali', 'woocommerce' ),
146: 'MT' => __( 'Malta', 'woocommerce' ),
147: 'MH' => __( 'Marshall Islands', 'woocommerce' ),
148: 'MQ' => __( 'Martinique', 'woocommerce' ),
149: 'MR' => __( 'Mauritania', 'woocommerce' ),
150: 'MU' => __( 'Mauritius', 'woocommerce' ),
151: 'YT' => __( 'Mayotte', 'woocommerce' ),
152: 'MX' => __( 'Mexico', 'woocommerce' ),
153: 'FM' => __( 'Micronesia', 'woocommerce' ),
154: 'MD' => __( 'Moldova', 'woocommerce' ),
155: 'MC' => __( 'Monaco', 'woocommerce' ),
156: 'MN' => __( 'Mongolia', 'woocommerce' ),
157: 'ME' => __( 'Montenegro', 'woocommerce' ),
158: 'MS' => __( 'Montserrat', 'woocommerce' ),
159: 'MA' => __( 'Morocco', 'woocommerce' ),
160: 'MZ' => __( 'Mozambique', 'woocommerce' ),
161: 'MM' => __( 'Myanmar', 'woocommerce' ),
162: 'NA' => __( 'Namibia', 'woocommerce' ),
163: 'NR' => __( 'Nauru', 'woocommerce' ),
164: 'NP' => __( 'Nepal', 'woocommerce' ),
165: 'NL' => __( 'Netherlands', 'woocommerce' ),
166: 'AN' => __( 'Netherlands Antilles', 'woocommerce' ),
167: 'NC' => __( 'New Caledonia', 'woocommerce' ),
168: 'NZ' => __( 'New Zealand', 'woocommerce' ),
169: 'NI' => __( 'Nicaragua', 'woocommerce' ),
170: 'NE' => __( 'Niger', 'woocommerce' ),
171: 'NG' => __( 'Nigeria', 'woocommerce' ),
172: 'NU' => __( 'Niue', 'woocommerce' ),
173: 'NF' => __( 'Norfolk Island', 'woocommerce' ),
174: 'MP' => __( 'Northern Mariana Islands', 'woocommerce' ),
175: 'KP' => __( 'North Korea', 'woocommerce' ),
176: 'NO' => __( 'Norway', 'woocommerce' ),
177: 'OM' => __( 'Oman', 'woocommerce' ),
178: 'PK' => __( 'Pakistan', 'woocommerce' ),
179: 'PS' => __( 'Palestinian Territory', 'woocommerce' ),
180: 'PA' => __( 'Panama', 'woocommerce' ),
181: 'PG' => __( 'Papua New Guinea', 'woocommerce' ),
182: 'PY' => __( 'Paraguay', 'woocommerce' ),
183: 'PE' => __( 'Peru', 'woocommerce' ),
184: 'PH' => __( 'Philippines', 'woocommerce' ),
185: 'PN' => __( 'Pitcairn', 'woocommerce' ),
186: 'PL' => __( 'Poland', 'woocommerce' ),
187: 'PT' => __( 'Portugal', 'woocommerce' ),
188: 'PR' => __( 'Puerto Rico', 'woocommerce' ),
189: 'QA' => __( 'Qatar', 'woocommerce' ),
190: 'RE' => __( 'Reunion', 'woocommerce' ),
191: 'RO' => __( 'Romania', 'woocommerce' ),
192: 'RU' => __( 'Russia', 'woocommerce' ),
193: 'RW' => __( 'Rwanda', 'woocommerce' ),
194: 'BL' => __( 'Saint Barthélemy', 'woocommerce' ),
195: 'SH' => __( 'Saint Helena', 'woocommerce' ),
196: 'KN' => __( 'Saint Kitts and Nevis', 'woocommerce' ),
197: 'LC' => __( 'Saint Lucia', 'woocommerce' ),
198: 'MF' => __( 'Saint Martin (French part)', 'woocommerce' ),
199: 'SX' => __( 'Saint Martin (Dutch part)', 'woocommerce' ),
200: 'PM' => __( 'Saint Pierre and Miquelon', 'woocommerce' ),
201: 'VC' => __( 'Saint Vincent and the Grenadines', 'woocommerce' ),
202: 'SM' => __( 'San Marino', 'woocommerce' ),
203: 'ST' => __( 'São Tomé and Príncipe', 'woocommerce' ),
204: 'SA' => __( 'Saudi Arabia', 'woocommerce' ),
205: 'SN' => __( 'Senegal', 'woocommerce' ),
206: 'RS' => __( 'Serbia', 'woocommerce' ),
207: 'SC' => __( 'Seychelles', 'woocommerce' ),
208: 'SL' => __( 'Sierra Leone', 'woocommerce' ),
209: 'SG' => __( 'Singapore', 'woocommerce' ),
210: 'SK' => __( 'Slovakia', 'woocommerce' ),
211: 'SI' => __( 'Slovenia', 'woocommerce' ),
212: 'SB' => __( 'Solomon Islands', 'woocommerce' ),
213: 'SO' => __( 'Somalia', 'woocommerce' ),
214: 'ZA' => __( 'South Africa', 'woocommerce' ),
215: 'GS' => __( 'South Georgia/Sandwich Islands', 'woocommerce' ),
216: 'KR' => __( 'South Korea', 'woocommerce' ),
217: 'SS' => __( 'South Sudan', 'woocommerce' ),
218: 'ES' => __( 'Spain', 'woocommerce' ),
219: 'LK' => __( 'Sri Lanka', 'woocommerce' ),
220: 'SD' => __( 'Sudan', 'woocommerce' ),
221: 'SR' => __( 'Suriname', 'woocommerce' ),
222: 'SJ' => __( 'Svalbard and Jan Mayen', 'woocommerce' ),
223: 'SZ' => __( 'Swaziland', 'woocommerce' ),
224: 'SE' => __( 'Sweden', 'woocommerce' ),
225: 'CH' => __( 'Switzerland', 'woocommerce' ),
226: 'SY' => __( 'Syria', 'woocommerce' ),
227: 'TW' => __( 'Taiwan', 'woocommerce' ),
228: 'TJ' => __( 'Tajikistan', 'woocommerce' ),
229: 'TZ' => __( 'Tanzania', 'woocommerce' ),
230: 'TH' => __( 'Thailand', 'woocommerce' ),
231: 'TL' => __( 'Timor-Leste', 'woocommerce' ),
232: 'TG' => __( 'Togo', 'woocommerce' ),
233: 'TK' => __( 'Tokelau', 'woocommerce' ),
234: 'TO' => __( 'Tonga', 'woocommerce' ),
235: 'TT' => __( 'Trinidad and Tobago', 'woocommerce' ),
236: 'TN' => __( 'Tunisia', 'woocommerce' ),
237: 'TR' => __( 'Turkey', 'woocommerce' ),
238: 'TM' => __( 'Turkmenistan', 'woocommerce' ),
239: 'TC' => __( 'Turks and Caicos Islands', 'woocommerce' ),
240: 'TV' => __( 'Tuvalu', 'woocommerce' ),
241: 'UG' => __( 'Uganda', 'woocommerce' ),
242: 'UA' => __( 'Ukraine', 'woocommerce' ),
243: 'AE' => __( 'United Arab Emirates', 'woocommerce' ),
244: 'GB' => __( 'United Kingdom (UK)', 'woocommerce' ),
245: 'US' => __( 'United States (US)', 'woocommerce' ),
246: 'UM' => __( 'United States (US) Minor Outlying Islands', 'woocommerce' ),
247: 'VI' => __( 'United States (US) Virgin Islands', 'woocommerce' ),
248: 'UY' => __( 'Uruguay', 'woocommerce' ),
249: 'UZ' => __( 'Uzbekistan', 'woocommerce' ),
250: 'VU' => __( 'Vanuatu', 'woocommerce' ),
251: 'VA' => __( 'Vatican', 'woocommerce' ),
252: 'VE' => __( 'Venezuela', 'woocommerce' ),
253: 'VN' => __( 'Vietnam', 'woocommerce' ),
254: 'WF' => __( 'Wallis and Futuna', 'woocommerce' ),
255: 'EH' => __( 'Western Sahara', 'woocommerce' ),
256: 'WS' => __( 'Western Samoa', 'woocommerce' ),
257: 'YE' => __( 'Yemen', 'woocommerce' ),
258: 'ZM' => __( 'Zambia', 'woocommerce' ),
259: 'ZW' => __( 'Zimbabwe', 'woocommerce' )
260: );
261: }
262:
263: function get_mautic_country_list() {
264: $json = file_get_contents( 'https://raw.githubusercontent.com/mautic/mautic/e146b2eb2a2a153c0097e7ab8bdce201fb5f24ce/app/bundles/CoreBundle/Assets/json/countries.json' );
265: $array = json_decode($json);
266: return $array;
267: }
268:
269: $wc_country_list = get_woocommerce_country_list();
270: $mautic_country_list = get_mautic_country_list();
271:
272: $null = array();
273: foreach($wc_country_list as $key => $value ) {
274: if( ! in_array( $value,$mautic_country_list ) ) {
275: unset($wc_country_list[$key]);
276: $null[$key] = $value;
277: }
278: }
279:
280: echo "mapped_countries\n";
281: echo json_encode($wc_country_list). "\n";
282: echo "\n";
283: echo "unfined countries\n";
284: echo json_encode($null). "\n";
285: