Test Failed
Pull Request — master (#2199)
by Ravinder
04:54
created
includes/country-functions.php 1 patch
Spacing   +1066 added lines, -1066 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_get_country() {
24 24
 	$give_options = give_get_settings();
25
-	$country      = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
25
+	$country      = isset($give_options['base_country']) ? $give_options['base_country'] : 'US';
26 26
 
27
-	return apply_filters( 'give_give_country', $country );
27
+	return apply_filters('give_give_country', $country);
28 28
 }
29 29
 
30 30
 /**
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function give_get_state() {
37 37
 	$give_options = give_get_settings();
38
-	$state        = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
38
+	$state        = isset($give_options['base_state']) ? $give_options['base_state'] : false;
39 39
 
40
-	return apply_filters( 'give_give_state', $state );
40
+	return apply_filters('give_give_state', $state);
41 41
 }
42 42
 
43 43
 /**
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
  *
50 50
  * @return mixed  A list of states for the site's base country.
51 51
  */
52
-function give_get_states( $country = null ) {
52
+function give_get_states($country = null) {
53 53
 	// If Country have no states return empty array.
54 54
 	$states = array();
55 55
 
56 56
 	// Check if Country Code is empty or not.
57
-	if ( empty( $country ) ) {
57
+	if (empty($country)) {
58 58
 		// Get defalut country code that is being set by the admin.
59 59
 		$country = give_get_country();
60 60
 	}
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	$states_list = give_states_list();
64 64
 
65 65
 	// Check if $country code exists in the array key.
66
-	if ( array_key_exists( $country, $states_list ) ) {
67
-		$states = $states_list[ $country ];
66
+	if (array_key_exists($country, $states_list)) {
67
+		$states = $states_list[$country];
68 68
 	}
69 69
 
70 70
 	/**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param string $query Database count query
74 74
 	 */
75
-	return (array) apply_filters( 'give_give_states', $states );
75
+	return (array) apply_filters('give_give_states', $states);
76 76
 }
77 77
 
78 78
 /**
@@ -84,253 +84,253 @@  discard block
 block discarded – undo
84 84
 function give_get_country_list() {
85 85
 	$countries = array(
86 86
 		''   => '',
87
-		'US' => esc_html__( 'United States', 'give' ),
88
-		'CA' => esc_html__( 'Canada', 'give' ),
89
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
90
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
91
-		'AL' => esc_html__( 'Albania', 'give' ),
92
-		'DZ' => esc_html__( 'Algeria', 'give' ),
93
-		'AS' => esc_html__( 'American Samoa', 'give' ),
94
-		'AD' => esc_html__( 'Andorra', 'give' ),
95
-		'AO' => esc_html__( 'Angola', 'give' ),
96
-		'AI' => esc_html__( 'Anguilla', 'give' ),
97
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
98
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
99
-		'AR' => esc_html__( 'Argentina', 'give' ),
100
-		'AM' => esc_html__( 'Armenia', 'give' ),
101
-		'AW' => esc_html__( 'Aruba', 'give' ),
102
-		'AU' => esc_html__( 'Australia', 'give' ),
103
-		'AT' => esc_html__( 'Austria', 'give' ),
104
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
105
-		'BS' => esc_html__( 'Bahamas', 'give' ),
106
-		'BH' => esc_html__( 'Bahrain', 'give' ),
107
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
108
-		'BB' => esc_html__( 'Barbados', 'give' ),
109
-		'BY' => esc_html__( 'Belarus', 'give' ),
110
-		'BE' => esc_html__( 'Belgium', 'give' ),
111
-		'BZ' => esc_html__( 'Belize', 'give' ),
112
-		'BJ' => esc_html__( 'Benin', 'give' ),
113
-		'BM' => esc_html__( 'Bermuda', 'give' ),
114
-		'BT' => esc_html__( 'Bhutan', 'give' ),
115
-		'BO' => esc_html__( 'Bolivia', 'give' ),
116
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
117
-		'BW' => esc_html__( 'Botswana', 'give' ),
118
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
119
-		'BR' => esc_html__( 'Brazil', 'give' ),
120
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
121
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
122
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
123
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
124
-		'BI' => esc_html__( 'Burundi', 'give' ),
125
-		'KH' => esc_html__( 'Cambodia', 'give' ),
126
-		'CM' => esc_html__( 'Cameroon', 'give' ),
127
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
128
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
129
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
130
-		'TD' => esc_html__( 'Chad', 'give' ),
131
-		'CL' => esc_html__( 'Chile', 'give' ),
132
-		'CN' => esc_html__( 'China', 'give' ),
133
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
134
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
135
-		'CO' => esc_html__( 'Colombia', 'give' ),
136
-		'KM' => esc_html__( 'Comoros', 'give' ),
137
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
138
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
139
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
140
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
141
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
142
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
143
-		'CU' => esc_html__( 'Cuba', 'give' ),
144
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
145
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
146
-		'DK' => esc_html__( 'Denmark', 'give' ),
147
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
148
-		'DM' => esc_html__( 'Dominica', 'give' ),
149
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
150
-		'TP' => esc_html__( 'East Timor', 'give' ),
151
-		'EC' => esc_html__( 'Ecuador', 'give' ),
152
-		'EG' => esc_html__( 'Egypt', 'give' ),
153
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
154
-		'SV' => esc_html__( 'El Salvador', 'give' ),
155
-		'ER' => esc_html__( 'Eritrea', 'give' ),
156
-		'EE' => esc_html__( 'Estonia', 'give' ),
157
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
158
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
159
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
160
-		'FJ' => esc_html__( 'Fiji', 'give' ),
161
-		'FI' => esc_html__( 'Finland', 'give' ),
162
-		'FR' => esc_html__( 'France', 'give' ),
163
-		'GF' => esc_html__( 'French Guiana', 'give' ),
164
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
165
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
166
-		'GA' => esc_html__( 'Gabon', 'give' ),
167
-		'GM' => esc_html__( 'Gambia', 'give' ),
168
-		'GE' => esc_html__( 'Georgia', 'give' ),
169
-		'DE' => esc_html__( 'Germany', 'give' ),
170
-		'GR' => esc_html__( 'Greece', 'give' ),
171
-		'GH' => esc_html__( 'Ghana', 'give' ),
172
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
173
-		'GL' => esc_html__( 'Greenland', 'give' ),
174
-		'GD' => esc_html__( 'Grenada', 'give' ),
175
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
176
-		'GU' => esc_html__( 'Guam', 'give' ),
177
-		'GT' => esc_html__( 'Guatemala', 'give' ),
178
-		'GG' => esc_html__( 'Guernsey', 'give' ),
179
-		'GN' => esc_html__( 'Guinea', 'give' ),
180
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
181
-		'GY' => esc_html__( 'Guyana', 'give' ),
182
-		'HT' => esc_html__( 'Haiti', 'give' ),
183
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
184
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
185
-		'HN' => esc_html__( 'Honduras', 'give' ),
186
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
187
-		'HU' => esc_html__( 'Hungary', 'give' ),
188
-		'IS' => esc_html__( 'Iceland', 'give' ),
189
-		'IN' => esc_html__( 'India', 'give' ),
190
-		'ID' => esc_html__( 'Indonesia', 'give' ),
191
-		'IR' => esc_html__( 'Iran', 'give' ),
192
-		'IQ' => esc_html__( 'Iraq', 'give' ),
193
-		'IE' => esc_html__( 'Ireland', 'give' ),
194
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
195
-		'IL' => esc_html__( 'Israel', 'give' ),
196
-		'IT' => esc_html__( 'Italy', 'give' ),
197
-		'JM' => esc_html__( 'Jamaica', 'give' ),
198
-		'JP' => esc_html__( 'Japan', 'give' ),
199
-		'JE' => esc_html__( 'Jersey', 'give' ),
200
-		'JO' => esc_html__( 'Jordan', 'give' ),
201
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
202
-		'KE' => esc_html__( 'Kenya', 'give' ),
203
-		'KI' => esc_html__( 'Kiribati', 'give' ),
204
-		'KW' => esc_html__( 'Kuwait', 'give' ),
205
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
206
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
207
-		'LV' => esc_html__( 'Latvia', 'give' ),
208
-		'LB' => esc_html__( 'Lebanon', 'give' ),
209
-		'LS' => esc_html__( 'Lesotho', 'give' ),
210
-		'LR' => esc_html__( 'Liberia', 'give' ),
211
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
212
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
213
-		'LT' => esc_html__( 'Lithuania', 'give' ),
214
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
215
-		'MO' => esc_html__( 'Macau', 'give' ),
216
-		'MK' => esc_html__( 'Macedonia', 'give' ),
217
-		'MG' => esc_html__( 'Madagascar', 'give' ),
218
-		'MW' => esc_html__( 'Malawi', 'give' ),
219
-		'MY' => esc_html__( 'Malaysia', 'give' ),
220
-		'MV' => esc_html__( 'Maldives', 'give' ),
221
-		'ML' => esc_html__( 'Mali', 'give' ),
222
-		'MT' => esc_html__( 'Malta', 'give' ),
223
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
224
-		'MQ' => esc_html__( 'Martinique', 'give' ),
225
-		'MR' => esc_html__( 'Mauritania', 'give' ),
226
-		'MU' => esc_html__( 'Mauritius', 'give' ),
227
-		'YT' => esc_html__( 'Mayotte', 'give' ),
228
-		'MX' => esc_html__( 'Mexico', 'give' ),
229
-		'FM' => esc_html__( 'Micronesia', 'give' ),
230
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
231
-		'MC' => esc_html__( 'Monaco', 'give' ),
232
-		'MN' => esc_html__( 'Mongolia', 'give' ),
233
-		'ME' => esc_html__( 'Montenegro', 'give' ),
234
-		'MS' => esc_html__( 'Montserrat', 'give' ),
235
-		'MA' => esc_html__( 'Morocco', 'give' ),
236
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
237
-		'MM' => esc_html__( 'Myanmar', 'give' ),
238
-		'NA' => esc_html__( 'Namibia', 'give' ),
239
-		'NR' => esc_html__( 'Nauru', 'give' ),
240
-		'NP' => esc_html__( 'Nepal', 'give' ),
241
-		'NL' => esc_html__( 'Netherlands', 'give' ),
242
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
243
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
244
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
245
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
246
-		'NE' => esc_html__( 'Niger', 'give' ),
247
-		'NG' => esc_html__( 'Nigeria', 'give' ),
248
-		'NU' => esc_html__( 'Niue', 'give' ),
249
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
250
-		'KP' => esc_html__( 'North Korea', 'give' ),
251
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
252
-		'NO' => esc_html__( 'Norway', 'give' ),
253
-		'OM' => esc_html__( 'Oman', 'give' ),
254
-		'PK' => esc_html__( 'Pakistan', 'give' ),
255
-		'PW' => esc_html__( 'Palau', 'give' ),
256
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
257
-		'PA' => esc_html__( 'Panama', 'give' ),
258
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
259
-		'PY' => esc_html__( 'Paraguay', 'give' ),
260
-		'PE' => esc_html__( 'Peru', 'give' ),
261
-		'PH' => esc_html__( 'Phillipines', 'give' ),
262
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
263
-		'PL' => esc_html__( 'Poland', 'give' ),
264
-		'PT' => esc_html__( 'Portugal', 'give' ),
265
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
266
-		'QA' => esc_html__( 'Qatar', 'give' ),
267
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
268
-		'RO' => esc_html__( 'Romania', 'give' ),
269
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
270
-		'RW' => esc_html__( 'Rwanda', 'give' ),
271
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
272
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
273
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
274
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
275
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
276
-		'SM' => esc_html__( 'San Marino', 'give' ),
277
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
278
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
279
-		'SN' => esc_html__( 'Senegal', 'give' ),
280
-		'RS' => esc_html__( 'Serbia', 'give' ),
281
-		'SC' => esc_html__( 'Seychelles', 'give' ),
282
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
283
-		'SG' => esc_html__( 'Singapore', 'give' ),
284
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
285
-		'SI' => esc_html__( 'Slovenia', 'give' ),
286
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
287
-		'SO' => esc_html__( 'Somalia', 'give' ),
288
-		'ZA' => esc_html__( 'South Africa', 'give' ),
289
-		'GS' => esc_html__( 'South Georgia', 'give' ),
290
-		'KR' => esc_html__( 'South Korea', 'give' ),
291
-		'ES' => esc_html__( 'Spain', 'give' ),
292
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
293
-		'SD' => esc_html__( 'Sudan', 'give' ),
294
-		'SR' => esc_html__( 'Suriname', 'give' ),
295
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
296
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
297
-		'SE' => esc_html__( 'Sweden', 'give' ),
298
-		'CH' => esc_html__( 'Switzerland', 'give' ),
299
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
300
-		'TW' => esc_html__( 'Taiwan', 'give' ),
301
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
302
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
303
-		'TG' => esc_html__( 'Togo', 'give' ),
304
-		'TK' => esc_html__( 'Tokelau', 'give' ),
305
-		'TO' => esc_html__( 'Tonga', 'give' ),
306
-		'TH' => esc_html__( 'Thailand', 'give' ),
307
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
308
-		'TN' => esc_html__( 'Tunisia', 'give' ),
309
-		'TR' => esc_html__( 'Turkey', 'give' ),
310
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
311
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
312
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
313
-		'UG' => esc_html__( 'Uganda', 'give' ),
314
-		'UA' => esc_html__( 'Ukraine', 'give' ),
315
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
316
-		'UY' => esc_html__( 'Uruguay', 'give' ),
317
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
318
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
319
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
320
-		'VE' => esc_html__( 'Venezuela', 'give' ),
321
-		'VN' => esc_html__( 'Vietnam', 'give' ),
322
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
323
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
324
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
325
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
326
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
327
-		'YE' => esc_html__( 'Yemen', 'give' ),
328
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
329
-		'ZM' => esc_html__( 'Zambia', 'give' ),
330
-		'ZW' => esc_html__( 'Zimbabwe', 'give' ),
87
+		'US' => esc_html__('United States', 'give'),
88
+		'CA' => esc_html__('Canada', 'give'),
89
+		'GB' => esc_html__('United Kingdom', 'give'),
90
+		'AF' => esc_html__('Afghanistan', 'give'),
91
+		'AL' => esc_html__('Albania', 'give'),
92
+		'DZ' => esc_html__('Algeria', 'give'),
93
+		'AS' => esc_html__('American Samoa', 'give'),
94
+		'AD' => esc_html__('Andorra', 'give'),
95
+		'AO' => esc_html__('Angola', 'give'),
96
+		'AI' => esc_html__('Anguilla', 'give'),
97
+		'AQ' => esc_html__('Antarctica', 'give'),
98
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
99
+		'AR' => esc_html__('Argentina', 'give'),
100
+		'AM' => esc_html__('Armenia', 'give'),
101
+		'AW' => esc_html__('Aruba', 'give'),
102
+		'AU' => esc_html__('Australia', 'give'),
103
+		'AT' => esc_html__('Austria', 'give'),
104
+		'AZ' => esc_html__('Azerbaijan', 'give'),
105
+		'BS' => esc_html__('Bahamas', 'give'),
106
+		'BH' => esc_html__('Bahrain', 'give'),
107
+		'BD' => esc_html__('Bangladesh', 'give'),
108
+		'BB' => esc_html__('Barbados', 'give'),
109
+		'BY' => esc_html__('Belarus', 'give'),
110
+		'BE' => esc_html__('Belgium', 'give'),
111
+		'BZ' => esc_html__('Belize', 'give'),
112
+		'BJ' => esc_html__('Benin', 'give'),
113
+		'BM' => esc_html__('Bermuda', 'give'),
114
+		'BT' => esc_html__('Bhutan', 'give'),
115
+		'BO' => esc_html__('Bolivia', 'give'),
116
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
117
+		'BW' => esc_html__('Botswana', 'give'),
118
+		'BV' => esc_html__('Bouvet Island', 'give'),
119
+		'BR' => esc_html__('Brazil', 'give'),
120
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
121
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
122
+		'BG' => esc_html__('Bulgaria', 'give'),
123
+		'BF' => esc_html__('Burkina Faso', 'give'),
124
+		'BI' => esc_html__('Burundi', 'give'),
125
+		'KH' => esc_html__('Cambodia', 'give'),
126
+		'CM' => esc_html__('Cameroon', 'give'),
127
+		'CV' => esc_html__('Cape Verde', 'give'),
128
+		'KY' => esc_html__('Cayman Islands', 'give'),
129
+		'CF' => esc_html__('Central African Republic', 'give'),
130
+		'TD' => esc_html__('Chad', 'give'),
131
+		'CL' => esc_html__('Chile', 'give'),
132
+		'CN' => esc_html__('China', 'give'),
133
+		'CX' => esc_html__('Christmas Island', 'give'),
134
+		'CC' => esc_html__('Cocos Islands', 'give'),
135
+		'CO' => esc_html__('Colombia', 'give'),
136
+		'KM' => esc_html__('Comoros', 'give'),
137
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
138
+		'CG' => esc_html__('Congo, Republic of', 'give'),
139
+		'CK' => esc_html__('Cook Islands', 'give'),
140
+		'CR' => esc_html__('Costa Rica', 'give'),
141
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
142
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
143
+		'CU' => esc_html__('Cuba', 'give'),
144
+		'CY' => esc_html__('Cyprus Island', 'give'),
145
+		'CZ' => esc_html__('Czech Republic', 'give'),
146
+		'DK' => esc_html__('Denmark', 'give'),
147
+		'DJ' => esc_html__('Djibouti', 'give'),
148
+		'DM' => esc_html__('Dominica', 'give'),
149
+		'DO' => esc_html__('Dominican Republic', 'give'),
150
+		'TP' => esc_html__('East Timor', 'give'),
151
+		'EC' => esc_html__('Ecuador', 'give'),
152
+		'EG' => esc_html__('Egypt', 'give'),
153
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
154
+		'SV' => esc_html__('El Salvador', 'give'),
155
+		'ER' => esc_html__('Eritrea', 'give'),
156
+		'EE' => esc_html__('Estonia', 'give'),
157
+		'ET' => esc_html__('Ethiopia', 'give'),
158
+		'FK' => esc_html__('Falkland Islands', 'give'),
159
+		'FO' => esc_html__('Faroe Islands', 'give'),
160
+		'FJ' => esc_html__('Fiji', 'give'),
161
+		'FI' => esc_html__('Finland', 'give'),
162
+		'FR' => esc_html__('France', 'give'),
163
+		'GF' => esc_html__('French Guiana', 'give'),
164
+		'PF' => esc_html__('French Polynesia', 'give'),
165
+		'TF' => esc_html__('French Southern Territories', 'give'),
166
+		'GA' => esc_html__('Gabon', 'give'),
167
+		'GM' => esc_html__('Gambia', 'give'),
168
+		'GE' => esc_html__('Georgia', 'give'),
169
+		'DE' => esc_html__('Germany', 'give'),
170
+		'GR' => esc_html__('Greece', 'give'),
171
+		'GH' => esc_html__('Ghana', 'give'),
172
+		'GI' => esc_html__('Gibraltar', 'give'),
173
+		'GL' => esc_html__('Greenland', 'give'),
174
+		'GD' => esc_html__('Grenada', 'give'),
175
+		'GP' => esc_html__('Guadeloupe', 'give'),
176
+		'GU' => esc_html__('Guam', 'give'),
177
+		'GT' => esc_html__('Guatemala', 'give'),
178
+		'GG' => esc_html__('Guernsey', 'give'),
179
+		'GN' => esc_html__('Guinea', 'give'),
180
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
181
+		'GY' => esc_html__('Guyana', 'give'),
182
+		'HT' => esc_html__('Haiti', 'give'),
183
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
184
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
185
+		'HN' => esc_html__('Honduras', 'give'),
186
+		'HK' => esc_html__('Hong Kong', 'give'),
187
+		'HU' => esc_html__('Hungary', 'give'),
188
+		'IS' => esc_html__('Iceland', 'give'),
189
+		'IN' => esc_html__('India', 'give'),
190
+		'ID' => esc_html__('Indonesia', 'give'),
191
+		'IR' => esc_html__('Iran', 'give'),
192
+		'IQ' => esc_html__('Iraq', 'give'),
193
+		'IE' => esc_html__('Ireland', 'give'),
194
+		'IM' => esc_html__('Isle of Man', 'give'),
195
+		'IL' => esc_html__('Israel', 'give'),
196
+		'IT' => esc_html__('Italy', 'give'),
197
+		'JM' => esc_html__('Jamaica', 'give'),
198
+		'JP' => esc_html__('Japan', 'give'),
199
+		'JE' => esc_html__('Jersey', 'give'),
200
+		'JO' => esc_html__('Jordan', 'give'),
201
+		'KZ' => esc_html__('Kazakhstan', 'give'),
202
+		'KE' => esc_html__('Kenya', 'give'),
203
+		'KI' => esc_html__('Kiribati', 'give'),
204
+		'KW' => esc_html__('Kuwait', 'give'),
205
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
206
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
207
+		'LV' => esc_html__('Latvia', 'give'),
208
+		'LB' => esc_html__('Lebanon', 'give'),
209
+		'LS' => esc_html__('Lesotho', 'give'),
210
+		'LR' => esc_html__('Liberia', 'give'),
211
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
212
+		'LI' => esc_html__('Liechtenstein', 'give'),
213
+		'LT' => esc_html__('Lithuania', 'give'),
214
+		'LU' => esc_html__('Luxembourg', 'give'),
215
+		'MO' => esc_html__('Macau', 'give'),
216
+		'MK' => esc_html__('Macedonia', 'give'),
217
+		'MG' => esc_html__('Madagascar', 'give'),
218
+		'MW' => esc_html__('Malawi', 'give'),
219
+		'MY' => esc_html__('Malaysia', 'give'),
220
+		'MV' => esc_html__('Maldives', 'give'),
221
+		'ML' => esc_html__('Mali', 'give'),
222
+		'MT' => esc_html__('Malta', 'give'),
223
+		'MH' => esc_html__('Marshall Islands', 'give'),
224
+		'MQ' => esc_html__('Martinique', 'give'),
225
+		'MR' => esc_html__('Mauritania', 'give'),
226
+		'MU' => esc_html__('Mauritius', 'give'),
227
+		'YT' => esc_html__('Mayotte', 'give'),
228
+		'MX' => esc_html__('Mexico', 'give'),
229
+		'FM' => esc_html__('Micronesia', 'give'),
230
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
231
+		'MC' => esc_html__('Monaco', 'give'),
232
+		'MN' => esc_html__('Mongolia', 'give'),
233
+		'ME' => esc_html__('Montenegro', 'give'),
234
+		'MS' => esc_html__('Montserrat', 'give'),
235
+		'MA' => esc_html__('Morocco', 'give'),
236
+		'MZ' => esc_html__('Mozambique', 'give'),
237
+		'MM' => esc_html__('Myanmar', 'give'),
238
+		'NA' => esc_html__('Namibia', 'give'),
239
+		'NR' => esc_html__('Nauru', 'give'),
240
+		'NP' => esc_html__('Nepal', 'give'),
241
+		'NL' => esc_html__('Netherlands', 'give'),
242
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
243
+		'NC' => esc_html__('New Caledonia', 'give'),
244
+		'NZ' => esc_html__('New Zealand', 'give'),
245
+		'NI' => esc_html__('Nicaragua', 'give'),
246
+		'NE' => esc_html__('Niger', 'give'),
247
+		'NG' => esc_html__('Nigeria', 'give'),
248
+		'NU' => esc_html__('Niue', 'give'),
249
+		'NF' => esc_html__('Norfolk Island', 'give'),
250
+		'KP' => esc_html__('North Korea', 'give'),
251
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
252
+		'NO' => esc_html__('Norway', 'give'),
253
+		'OM' => esc_html__('Oman', 'give'),
254
+		'PK' => esc_html__('Pakistan', 'give'),
255
+		'PW' => esc_html__('Palau', 'give'),
256
+		'PS' => esc_html__('Palestinian Territories', 'give'),
257
+		'PA' => esc_html__('Panama', 'give'),
258
+		'PG' => esc_html__('Papua New Guinea', 'give'),
259
+		'PY' => esc_html__('Paraguay', 'give'),
260
+		'PE' => esc_html__('Peru', 'give'),
261
+		'PH' => esc_html__('Phillipines', 'give'),
262
+		'PN' => esc_html__('Pitcairn Island', 'give'),
263
+		'PL' => esc_html__('Poland', 'give'),
264
+		'PT' => esc_html__('Portugal', 'give'),
265
+		'PR' => esc_html__('Puerto Rico', 'give'),
266
+		'QA' => esc_html__('Qatar', 'give'),
267
+		'RE' => esc_html__('Reunion Island', 'give'),
268
+		'RO' => esc_html__('Romania', 'give'),
269
+		'RU' => esc_html__('Russian Federation', 'give'),
270
+		'RW' => esc_html__('Rwanda', 'give'),
271
+		'SH' => esc_html__('Saint Helena', 'give'),
272
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
273
+		'LC' => esc_html__('Saint Lucia', 'give'),
274
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
275
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
276
+		'SM' => esc_html__('San Marino', 'give'),
277
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
278
+		'SA' => esc_html__('Saudi Arabia', 'give'),
279
+		'SN' => esc_html__('Senegal', 'give'),
280
+		'RS' => esc_html__('Serbia', 'give'),
281
+		'SC' => esc_html__('Seychelles', 'give'),
282
+		'SL' => esc_html__('Sierra Leone', 'give'),
283
+		'SG' => esc_html__('Singapore', 'give'),
284
+		'SK' => esc_html__('Slovak Republic', 'give'),
285
+		'SI' => esc_html__('Slovenia', 'give'),
286
+		'SB' => esc_html__('Solomon Islands', 'give'),
287
+		'SO' => esc_html__('Somalia', 'give'),
288
+		'ZA' => esc_html__('South Africa', 'give'),
289
+		'GS' => esc_html__('South Georgia', 'give'),
290
+		'KR' => esc_html__('South Korea', 'give'),
291
+		'ES' => esc_html__('Spain', 'give'),
292
+		'LK' => esc_html__('Sri Lanka', 'give'),
293
+		'SD' => esc_html__('Sudan', 'give'),
294
+		'SR' => esc_html__('Suriname', 'give'),
295
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
296
+		'SZ' => esc_html__('Swaziland', 'give'),
297
+		'SE' => esc_html__('Sweden', 'give'),
298
+		'CH' => esc_html__('Switzerland', 'give'),
299
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
300
+		'TW' => esc_html__('Taiwan', 'give'),
301
+		'TJ' => esc_html__('Tajikistan', 'give'),
302
+		'TZ' => esc_html__('Tanzania', 'give'),
303
+		'TG' => esc_html__('Togo', 'give'),
304
+		'TK' => esc_html__('Tokelau', 'give'),
305
+		'TO' => esc_html__('Tonga', 'give'),
306
+		'TH' => esc_html__('Thailand', 'give'),
307
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
308
+		'TN' => esc_html__('Tunisia', 'give'),
309
+		'TR' => esc_html__('Turkey', 'give'),
310
+		'TM' => esc_html__('Turkmenistan', 'give'),
311
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
312
+		'TV' => esc_html__('Tuvalu', 'give'),
313
+		'UG' => esc_html__('Uganda', 'give'),
314
+		'UA' => esc_html__('Ukraine', 'give'),
315
+		'AE' => esc_html__('United Arab Emirates', 'give'),
316
+		'UY' => esc_html__('Uruguay', 'give'),
317
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
318
+		'UZ' => esc_html__('Uzbekistan', 'give'),
319
+		'VU' => esc_html__('Vanuatu', 'give'),
320
+		'VE' => esc_html__('Venezuela', 'give'),
321
+		'VN' => esc_html__('Vietnam', 'give'),
322
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
323
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
324
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
325
+		'EH' => esc_html__('Western Sahara', 'give'),
326
+		'WS' => esc_html__('Western Samoa', 'give'),
327
+		'YE' => esc_html__('Yemen', 'give'),
328
+		'YU' => esc_html__('Yugoslavia', 'give'),
329
+		'ZM' => esc_html__('Zambia', 'give'),
330
+		'ZW' => esc_html__('Zimbabwe', 'give'),
331 331
 	);
332 332
 
333
-	return (array) apply_filters( 'give_countries', $countries );
333
+	return (array) apply_filters('give_countries', $countries);
334 334
 }
335 335
 
336 336
 /**
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 	 *
385 385
 	 * @param array $states Contain the list of states in array key format where key of the array is there respected country code.
386 386
 	 */
387
-	return (array) apply_filters( 'give_states_list', $states );
387
+	return (array) apply_filters('give_states_list', $states);
388 388
 }
389 389
 
390 390
 /**
@@ -399,9 +399,9 @@  discard block
 block discarded – undo
399 399
 function give_no_states_country_list() {
400 400
 	$country_list = array();
401 401
 	$locale       = give_get_country_locale();
402
-	foreach ( $locale as $key => $value ) {
403
-		if ( ! empty( $value['state'] ) && isset( $value['state']['hidden'] ) && true === $value['state']['hidden'] ) {
404
-			$country_list[ $key ] = $value['state'];
402
+	foreach ($locale as $key => $value) {
403
+		if ( ! empty($value['state']) && isset($value['state']['hidden']) && true === $value['state']['hidden']) {
404
+			$country_list[$key] = $value['state'];
405 405
 		}
406 406
 	}
407 407
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 *
413 413
 	 * @param array $country Contain key as there country code & value as there country name.
414 414
 	 */
415
-	return (array) apply_filters( 'give_no_states_country_list', $country_list );
415
+	return (array) apply_filters('give_no_states_country_list', $country_list);
416 416
 }
417 417
 
418 418
 /**
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 function give_states_not_required_country_list() {
428 428
 	$country_list = array();
429 429
 	$locale       = give_get_country_locale();
430
-	foreach ( $locale as $key => $value ) {
431
-		if ( ! empty( $value['state'] ) && isset( $value['state']['required'] ) && false === $value['state']['required'] ) {
432
-			$country_list[ $key ] = $value['state'];
430
+	foreach ($locale as $key => $value) {
431
+		if ( ! empty($value['state']) && isset($value['state']['required']) && false === $value['state']['required']) {
432
+			$country_list[$key] = $value['state'];
433 433
 		}
434 434
 	}
435 435
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 *
441 441
 	 * @param array $country Contain key as there country code & value as there country name.
442 442
 	 */
443
-	return (array) apply_filters( 'give_states_not_required_country_list', $country_list );
443
+	return (array) apply_filters('give_states_not_required_country_list', $country_list);
444 444
 }
445 445
 
446 446
 /**
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
  *
453 453
  * @return string|bool
454 454
  */
455
-function give_get_country_name_by_key( $key ) {
455
+function give_get_country_name_by_key($key) {
456 456
 	$country_list = give_get_country_list();
457 457
 
458
-	if ( array_key_exists( $key, $country_list ) ) {
459
-		return $country_list[ $key ];
458
+	if (array_key_exists($key, $country_list)) {
459
+		return $country_list[$key];
460 460
 	}
461 461
 
462 462
 	return false;
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
  */
472 472
 function give_get_states_label() {
473 473
 	$country_states_label = array();
474
-	$default_label        = __( 'State', 'give' );
474
+	$default_label        = __('State', 'give');
475 475
 	$locale               = give_get_country_locale();
476
-	foreach ( $locale as $key => $value ) {
476
+	foreach ($locale as $key => $value) {
477 477
 		$label = $default_label;
478
-		if ( ! empty( $value['state'] ) && ! empty( $value['state']['label'] ) ) {
478
+		if ( ! empty($value['state']) && ! empty($value['state']['label'])) {
479 479
 			$label = $value['state']['label'];
480 480
 		}
481
-		$country_states_label[ $key ] = $label;
481
+		$country_states_label[$key] = $label;
482 482
 	}
483 483
 
484 484
 	/**
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 	 *
489 489
 	 * @param array $country Contain key as there country code & value as there country name.
490 490
 	 */
491
-	return (array) apply_filters( 'give_get_states_label', $country_states_label );
491
+	return (array) apply_filters('give_get_states_label', $country_states_label);
492 492
 }
493 493
 
494 494
 /**
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
  * @return array
500 500
  */
501 501
 function give_get_country_locale() {
502
-	return (array) apply_filters( 'give_get_country_locale', array(
502
+	return (array) apply_filters('give_get_country_locale', array(
503 503
 		'AE' => array(
504 504
 			'state' => array(
505 505
 				'required' => false,
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 		),
520 520
 		'AU' => array(
521 521
 			'state' => array(
522
-				'label' => __( 'State', 'give' ),
522
+				'label' => __('State', 'give'),
523 523
 			),
524 524
 		),
525 525
 		'AX' => array(
@@ -529,13 +529,13 @@  discard block
 block discarded – undo
529 529
 		),
530 530
 		'BD' => array(
531 531
 			'state' => array(
532
-				'label' => __( 'District', 'give' ),
532
+				'label' => __('District', 'give'),
533 533
 			),
534 534
 		),
535 535
 		'BE' => array(
536 536
 			'state' => array(
537 537
 				'required' => false,
538
-				'label'    => __( 'Province', 'give' ),
538
+				'label'    => __('Province', 'give'),
539 539
 				'hidden'   => true,
540 540
 			),
541 541
 		),
@@ -546,24 +546,24 @@  discard block
 block discarded – undo
546 546
 		),
547 547
 		'CA' => array(
548 548
 			'state' => array(
549
-				'label' => __( 'Province', 'give' ),
549
+				'label' => __('Province', 'give'),
550 550
 			),
551 551
 		),
552 552
 		'CH' => array(
553 553
 			'state' => array(
554
-				'label'    => __( 'Canton', 'give' ),
554
+				'label'    => __('Canton', 'give'),
555 555
 				'required' => false,
556 556
 				'hidden'   => true,
557 557
 			),
558 558
 		),
559 559
 		'CL' => array(
560 560
 			'state' => array(
561
-				'label' => __( 'Region', 'give' ),
561
+				'label' => __('Region', 'give'),
562 562
 			),
563 563
 		),
564 564
 		'CN' => array(
565 565
 			'state' => array(
566
-				'label' => __( 'Province', 'give' ),
566
+				'label' => __('Province', 'give'),
567 567
 			),
568 568
 		),
569 569
 		'CZ' => array(
@@ -614,23 +614,23 @@  discard block
 block discarded – undo
614 614
 		),
615 615
 		'HK' => array(
616 616
 			'state' => array(
617
-				'label' => __( 'Region', 'give' ),
617
+				'label' => __('Region', 'give'),
618 618
 			),
619 619
 		),
620 620
 		'HU' => array(
621 621
 			'state' => array(
622
-				'label'  => __( 'County', 'give' ),
622
+				'label'  => __('County', 'give'),
623 623
 				'hidden' => true,
624 624
 			),
625 625
 		),
626 626
 		'ID' => array(
627 627
 			'state' => array(
628
-				'label' => __( 'Province', 'give' ),
628
+				'label' => __('Province', 'give'),
629 629
 			),
630 630
 		),
631 631
 		'IE' => array(
632 632
 			'state' => array(
633
-				'label' => __( 'County', 'give' ),
633
+				'label' => __('County', 'give'),
634 634
 			),
635 635
 		),
636 636
 		'IS' => array(
@@ -647,12 +647,12 @@  discard block
 block discarded – undo
647 647
 		'IT' => array(
648 648
 			'state' => array(
649 649
 				'required' => true,
650
-				'label'    => __( 'Province', 'give' ),
650
+				'label'    => __('Province', 'give'),
651 651
 			),
652 652
 		),
653 653
 		'JP' => array(
654 654
 			'state' => array(
655
-				'label' => __( 'Prefecture', 'give' ),
655
+				'label' => __('Prefecture', 'give'),
656 656
 			),
657 657
 		),
658 658
 		'KR' => array(
@@ -678,13 +678,13 @@  discard block
 block discarded – undo
678 678
 		'NL' => array(
679 679
 			'state' => array(
680 680
 				'required' => false,
681
-				'label'    => __( 'Province', 'give' ),
681
+				'label'    => __('Province', 'give'),
682 682
 				'hidden'   => true,
683 683
 			),
684 684
 		),
685 685
 		'NZ' => array(
686 686
 			'state' => array(
687
-				'label'    => __( 'Region', 'give' ),
687
+				'label'    => __('Region', 'give'),
688 688
 			),
689 689
 		),
690 690
 		'NO' => array(
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 		),
696 696
 		'NP' => array(
697 697
 			'state' => array(
698
-				'label' => __( 'State / Zone', 'give' ),
698
+				'label' => __('State / Zone', 'give'),
699 699
 			),
700 700
 		),
701 701
 		'PL' => array(
@@ -739,12 +739,12 @@  discard block
 block discarded – undo
739 739
 		),
740 740
 		'ES' => array(
741 741
 			'state' => array(
742
-				'label' => __( 'Province', 'give' ),
742
+				'label' => __('Province', 'give'),
743 743
 			),
744 744
 		),
745 745
 		'LI' => array(
746 746
 			'state' => array(
747
-				'label'    => __( 'Municipality', 'give' ),
747
+				'label'    => __('Municipality', 'give'),
748 748
 				'required' => false,
749 749
 				'hidden'   => true,
750 750
 			),
@@ -762,17 +762,17 @@  discard block
 block discarded – undo
762 762
 		),
763 763
 		'TR' => array(
764 764
 			'state' => array(
765
-				'label' => __( 'Province', 'give' ),
765
+				'label' => __('Province', 'give'),
766 766
 			),
767 767
 		),
768 768
 		'US' => array(
769 769
 			'state' => array(
770
-				'label' => __( 'State', 'give' ),
770
+				'label' => __('State', 'give'),
771 771
 			),
772 772
 		),
773 773
 		'GB' => array(
774 774
 			'state' => array(
775
-				'label'    => __( 'County', 'give' ),
775
+				'label'    => __('County', 'give'),
776 776
 				'required' => false,
777 777
 			),
778 778
 		),
@@ -789,10 +789,10 @@  discard block
 block discarded – undo
789 789
 		),
790 790
 		'ZA' => array(
791 791
 			'state' => array(
792
-				'label' => __( 'Province', 'give' ),
792
+				'label' => __('Province', 'give'),
793 793
 			),
794 794
 		),
795
-	) );
795
+	));
796 796
 }
797 797
 
798 798
 /**
@@ -804,90 +804,90 @@  discard block
 block discarded – undo
804 804
 function give_get_turkey_states_list() {
805 805
 	$states = array(
806 806
 		''     => '',
807
-		'TR01' => __( 'Adana', 'give' ),
808
-		'TR02' => __( 'Adıyaman', 'give' ),
809
-		'TR03' => __( 'Afyon', 'give' ),
810
-		'TR04' => __( 'Ağrı', 'give' ),
811
-		'TR05' => __( 'Amasya', 'give' ),
812
-		'TR06' => __( 'Ankara', 'give' ),
813
-		'TR07' => __( 'Antalya', 'give' ),
814
-		'TR08' => __( 'Artvin', 'give' ),
815
-		'TR09' => __( 'Aydın', 'give' ),
816
-		'TR10' => __( 'Balıkesir', 'give' ),
817
-		'TR11' => __( 'Bilecik', 'give' ),
818
-		'TR12' => __( 'Bingöl', 'give' ),
819
-		'TR13' => __( 'Bitlis', 'give' ),
820
-		'TR14' => __( 'Bolu', 'give' ),
821
-		'TR15' => __( 'Burdur', 'give' ),
822
-		'TR16' => __( 'Bursa', 'give' ),
823
-		'TR17' => __( 'Çanakkale', 'give' ),
824
-		'TR18' => __( 'Çankırı', 'give' ),
825
-		'TR19' => __( 'Çorum', 'give' ),
826
-		'TR20' => __( 'Denizli', 'give' ),
827
-		'TR21' => __( 'Diyarbakır', 'give' ),
828
-		'TR22' => __( 'Edirne', 'give' ),
829
-		'TR23' => __( 'Elazığ', 'give' ),
830
-		'TR24' => __( 'Erzincan', 'give' ),
831
-		'TR25' => __( 'Erzurum', 'give' ),
832
-		'TR26' => __( 'Eskişehir', 'give' ),
833
-		'TR27' => __( 'Gaziantep', 'give' ),
834
-		'TR28' => __( 'Giresun', 'give' ),
835
-		'TR29' => __( 'Gümüşhane', 'give' ),
836
-		'TR30' => __( 'Hakkari', 'give' ),
837
-		'TR31' => __( 'Hatay', 'give' ),
838
-		'TR32' => __( 'Isparta', 'give' ),
839
-		'TR33' => __( 'İçel', 'give' ),
840
-		'TR34' => __( 'İstanbul', 'give' ),
841
-		'TR35' => __( 'İzmir', 'give' ),
842
-		'TR36' => __( 'Kars', 'give' ),
843
-		'TR37' => __( 'Kastamonu', 'give' ),
844
-		'TR38' => __( 'Kayseri', 'give' ),
845
-		'TR39' => __( 'Kırklareli', 'give' ),
846
-		'TR40' => __( 'Kırşehir', 'give' ),
847
-		'TR41' => __( 'Kocaeli', 'give' ),
848
-		'TR42' => __( 'Konya', 'give' ),
849
-		'TR43' => __( 'Kütahya', 'give' ),
850
-		'TR44' => __( 'Malatya', 'give' ),
851
-		'TR45' => __( 'Manisa', 'give' ),
852
-		'TR46' => __( 'Kahramanmaraş', 'give' ),
853
-		'TR47' => __( 'Mardin', 'give' ),
854
-		'TR48' => __( 'Muğla', 'give' ),
855
-		'TR49' => __( 'Muş', 'give' ),
856
-		'TR50' => __( 'Nevşehir', 'give' ),
857
-		'TR51' => __( 'Niğde', 'give' ),
858
-		'TR52' => __( 'Ordu', 'give' ),
859
-		'TR53' => __( 'Rize', 'give' ),
860
-		'TR54' => __( 'Sakarya', 'give' ),
861
-		'TR55' => __( 'Samsun', 'give' ),
862
-		'TR56' => __( 'Siirt', 'give' ),
863
-		'TR57' => __( 'Sinop', 'give' ),
864
-		'TR58' => __( 'Sivas', 'give' ),
865
-		'TR59' => __( 'Tekirdağ', 'give' ),
866
-		'TR60' => __( 'Tokat', 'give' ),
867
-		'TR61' => __( 'Trabzon', 'give' ),
868
-		'TR62' => __( 'Tunceli', 'give' ),
869
-		'TR63' => __( 'Şanlıurfa', 'give' ),
870
-		'TR64' => __( 'Uşak', 'give' ),
871
-		'TR65' => __( 'Van', 'give' ),
872
-		'TR66' => __( 'Yozgat', 'give' ),
873
-		'TR67' => __( 'Zonguldak', 'give' ),
874
-		'TR68' => __( 'Aksaray', 'give' ),
875
-		'TR69' => __( 'Bayburt', 'give' ),
876
-		'TR70' => __( 'Karaman', 'give' ),
877
-		'TR71' => __( 'Kırıkkale', 'give' ),
878
-		'TR72' => __( 'Batman', 'give' ),
879
-		'TR73' => __( 'Şırnak', 'give' ),
880
-		'TR74' => __( 'Bartın', 'give' ),
881
-		'TR75' => __( 'Ardahan', 'give' ),
882
-		'TR76' => __( 'Iğdır', 'give' ),
883
-		'TR77' => __( 'Yalova', 'give' ),
884
-		'TR78' => __( 'Karabük', 'give' ),
885
-		'TR79' => __( 'Kilis', 'give' ),
886
-		'TR80' => __( 'Osmaniye', 'give' ),
887
-		'TR81' => __( 'Düzce', 'give' ),
807
+		'TR01' => __('Adana', 'give'),
808
+		'TR02' => __('Adıyaman', 'give'),
809
+		'TR03' => __('Afyon', 'give'),
810
+		'TR04' => __('Ağrı', 'give'),
811
+		'TR05' => __('Amasya', 'give'),
812
+		'TR06' => __('Ankara', 'give'),
813
+		'TR07' => __('Antalya', 'give'),
814
+		'TR08' => __('Artvin', 'give'),
815
+		'TR09' => __('Aydın', 'give'),
816
+		'TR10' => __('Balıkesir', 'give'),
817
+		'TR11' => __('Bilecik', 'give'),
818
+		'TR12' => __('Bingöl', 'give'),
819
+		'TR13' => __('Bitlis', 'give'),
820
+		'TR14' => __('Bolu', 'give'),
821
+		'TR15' => __('Burdur', 'give'),
822
+		'TR16' => __('Bursa', 'give'),
823
+		'TR17' => __('Çanakkale', 'give'),
824
+		'TR18' => __('Çankırı', 'give'),
825
+		'TR19' => __('Çorum', 'give'),
826
+		'TR20' => __('Denizli', 'give'),
827
+		'TR21' => __('Diyarbakır', 'give'),
828
+		'TR22' => __('Edirne', 'give'),
829
+		'TR23' => __('Elazığ', 'give'),
830
+		'TR24' => __('Erzincan', 'give'),
831
+		'TR25' => __('Erzurum', 'give'),
832
+		'TR26' => __('Eskişehir', 'give'),
833
+		'TR27' => __('Gaziantep', 'give'),
834
+		'TR28' => __('Giresun', 'give'),
835
+		'TR29' => __('Gümüşhane', 'give'),
836
+		'TR30' => __('Hakkari', 'give'),
837
+		'TR31' => __('Hatay', 'give'),
838
+		'TR32' => __('Isparta', 'give'),
839
+		'TR33' => __('İçel', 'give'),
840
+		'TR34' => __('İstanbul', 'give'),
841
+		'TR35' => __('İzmir', 'give'),
842
+		'TR36' => __('Kars', 'give'),
843
+		'TR37' => __('Kastamonu', 'give'),
844
+		'TR38' => __('Kayseri', 'give'),
845
+		'TR39' => __('Kırklareli', 'give'),
846
+		'TR40' => __('Kırşehir', 'give'),
847
+		'TR41' => __('Kocaeli', 'give'),
848
+		'TR42' => __('Konya', 'give'),
849
+		'TR43' => __('Kütahya', 'give'),
850
+		'TR44' => __('Malatya', 'give'),
851
+		'TR45' => __('Manisa', 'give'),
852
+		'TR46' => __('Kahramanmaraş', 'give'),
853
+		'TR47' => __('Mardin', 'give'),
854
+		'TR48' => __('Muğla', 'give'),
855
+		'TR49' => __('Muş', 'give'),
856
+		'TR50' => __('Nevşehir', 'give'),
857
+		'TR51' => __('Niğde', 'give'),
858
+		'TR52' => __('Ordu', 'give'),
859
+		'TR53' => __('Rize', 'give'),
860
+		'TR54' => __('Sakarya', 'give'),
861
+		'TR55' => __('Samsun', 'give'),
862
+		'TR56' => __('Siirt', 'give'),
863
+		'TR57' => __('Sinop', 'give'),
864
+		'TR58' => __('Sivas', 'give'),
865
+		'TR59' => __('Tekirdağ', 'give'),
866
+		'TR60' => __('Tokat', 'give'),
867
+		'TR61' => __('Trabzon', 'give'),
868
+		'TR62' => __('Tunceli', 'give'),
869
+		'TR63' => __('Şanlıurfa', 'give'),
870
+		'TR64' => __('Uşak', 'give'),
871
+		'TR65' => __('Van', 'give'),
872
+		'TR66' => __('Yozgat', 'give'),
873
+		'TR67' => __('Zonguldak', 'give'),
874
+		'TR68' => __('Aksaray', 'give'),
875
+		'TR69' => __('Bayburt', 'give'),
876
+		'TR70' => __('Karaman', 'give'),
877
+		'TR71' => __('Kırıkkale', 'give'),
878
+		'TR72' => __('Batman', 'give'),
879
+		'TR73' => __('Şırnak', 'give'),
880
+		'TR74' => __('Bartın', 'give'),
881
+		'TR75' => __('Ardahan', 'give'),
882
+		'TR76' => __('Iğdır', 'give'),
883
+		'TR77' => __('Yalova', 'give'),
884
+		'TR78' => __('Karabük', 'give'),
885
+		'TR79' => __('Kilis', 'give'),
886
+		'TR80' => __('Osmaniye', 'give'),
887
+		'TR81' => __('Düzce', 'give'),
888 888
 	);
889 889
 
890
-	return apply_filters( 'give_turkey_states', $states );
890
+	return apply_filters('give_turkey_states', $states);
891 891
 }
892 892
 
893 893
 /**
@@ -899,51 +899,51 @@  discard block
 block discarded – undo
899 899
 function give_get_romania_states_list() {
900 900
 	$states = array(
901 901
 		''   => '',
902
-		'AB' => __( 'Alba', 'give' ),
903
-		'AR' => __( 'Arad', 'give' ),
904
-		'AG' => __( 'Arges', 'give' ),
905
-		'BC' => __( 'Bacau', 'give' ),
906
-		'BH' => __( 'Bihor', 'give' ),
907
-		'BN' => __( 'Bistrita-Nasaud', 'give' ),
908
-		'BT' => __( 'Botosani', 'give' ),
909
-		'BR' => __( 'Braila', 'give' ),
910
-		'BV' => __( 'Brasov', 'give' ),
911
-		'B'  => __( 'Bucuresti', 'give' ),
912
-		'BZ' => __( 'Buzau', 'give' ),
913
-		'CL' => __( 'Calarasi', 'give' ),
914
-		'CS' => __( 'Caras-Severin', 'give' ),
915
-		'CJ' => __( 'Cluj', 'give' ),
916
-		'CT' => __( 'Constanta', 'give' ),
917
-		'CV' => __( 'Covasna', 'give' ),
918
-		'DB' => __( 'Dambovita', 'give' ),
919
-		'DJ' => __( 'Dolj', 'give' ),
920
-		'GL' => __( 'Galati', 'give' ),
921
-		'GR' => __( 'Giurgiu', 'give' ),
922
-		'GJ' => __( 'Gorj', 'give' ),
923
-		'HR' => __( 'Harghita', 'give' ),
924
-		'HD' => __( 'Hunedoara', 'give' ),
925
-		'IL' => __( 'Ialomita', 'give' ),
926
-		'IS' => __( 'Iasi', 'give' ),
927
-		'IF' => __( 'Ilfov', 'give' ),
928
-		'MM' => __( 'Maramures', 'give' ),
929
-		'MH' => __( 'Mehedinti', 'give' ),
930
-		'MS' => __( 'Mures', 'give' ),
931
-		'NT' => __( 'Neamt', 'give' ),
932
-		'OT' => __( 'Olt', 'give' ),
933
-		'PH' => __( 'Prahova', 'give' ),
934
-		'SJ' => __( 'Salaj', 'give' ),
935
-		'SM' => __( 'Satu Mare', 'give' ),
936
-		'SB' => __( 'Sibiu', 'give' ),
937
-		'SV' => __( 'Suceava', 'give' ),
938
-		'TR' => __( 'Teleorman', 'give' ),
939
-		'TM' => __( 'Timis', 'give' ),
940
-		'TL' => __( 'Tulcea', 'give' ),
941
-		'VL' => __( 'Valcea', 'give' ),
942
-		'VS' => __( 'Vaslui', 'give' ),
943
-		'VN' => __( 'Vrancea', 'give' ),
902
+		'AB' => __('Alba', 'give'),
903
+		'AR' => __('Arad', 'give'),
904
+		'AG' => __('Arges', 'give'),
905
+		'BC' => __('Bacau', 'give'),
906
+		'BH' => __('Bihor', 'give'),
907
+		'BN' => __('Bistrita-Nasaud', 'give'),
908
+		'BT' => __('Botosani', 'give'),
909
+		'BR' => __('Braila', 'give'),
910
+		'BV' => __('Brasov', 'give'),
911
+		'B'  => __('Bucuresti', 'give'),
912
+		'BZ' => __('Buzau', 'give'),
913
+		'CL' => __('Calarasi', 'give'),
914
+		'CS' => __('Caras-Severin', 'give'),
915
+		'CJ' => __('Cluj', 'give'),
916
+		'CT' => __('Constanta', 'give'),
917
+		'CV' => __('Covasna', 'give'),
918
+		'DB' => __('Dambovita', 'give'),
919
+		'DJ' => __('Dolj', 'give'),
920
+		'GL' => __('Galati', 'give'),
921
+		'GR' => __('Giurgiu', 'give'),
922
+		'GJ' => __('Gorj', 'give'),
923
+		'HR' => __('Harghita', 'give'),
924
+		'HD' => __('Hunedoara', 'give'),
925
+		'IL' => __('Ialomita', 'give'),
926
+		'IS' => __('Iasi', 'give'),
927
+		'IF' => __('Ilfov', 'give'),
928
+		'MM' => __('Maramures', 'give'),
929
+		'MH' => __('Mehedinti', 'give'),
930
+		'MS' => __('Mures', 'give'),
931
+		'NT' => __('Neamt', 'give'),
932
+		'OT' => __('Olt', 'give'),
933
+		'PH' => __('Prahova', 'give'),
934
+		'SJ' => __('Salaj', 'give'),
935
+		'SM' => __('Satu Mare', 'give'),
936
+		'SB' => __('Sibiu', 'give'),
937
+		'SV' => __('Suceava', 'give'),
938
+		'TR' => __('Teleorman', 'give'),
939
+		'TM' => __('Timis', 'give'),
940
+		'TL' => __('Tulcea', 'give'),
941
+		'VL' => __('Valcea', 'give'),
942
+		'VS' => __('Vaslui', 'give'),
943
+		'VN' => __('Vrancea', 'give'),
944 944
 	);
945 945
 
946
-	return apply_filters( 'give_romania_states', $states );
946
+	return apply_filters('give_romania_states', $states);
947 947
 }
948 948
 
949 949
 /**
@@ -955,17 +955,17 @@  discard block
 block discarded – undo
955 955
 function give_get_pakistan_states_list() {
956 956
 	$states = array(
957 957
 		''   => '',
958
-		'JK' => __( 'Azad Kashmir', 'give' ),
959
-		'BA' => __( 'Balochistan', 'give' ),
960
-		'TA' => __( 'FATA', 'give' ),
961
-		'GB' => __( 'Gilgit Baltistan', 'give' ),
962
-		'IS' => __( 'Islamabad Capital Territory', 'give' ),
963
-		'KP' => __( 'Khyber Pakhtunkhwa', 'give' ),
964
-		'PB' => __( 'Punjab', 'give' ),
965
-		'SD' => __( 'Sindh', 'give' ),
958
+		'JK' => __('Azad Kashmir', 'give'),
959
+		'BA' => __('Balochistan', 'give'),
960
+		'TA' => __('FATA', 'give'),
961
+		'GB' => __('Gilgit Baltistan', 'give'),
962
+		'IS' => __('Islamabad Capital Territory', 'give'),
963
+		'KP' => __('Khyber Pakhtunkhwa', 'give'),
964
+		'PB' => __('Punjab', 'give'),
965
+		'SD' => __('Sindh', 'give'),
966 966
 	);
967 967
 
968
-	return apply_filters( 'give_pakistan_states', $states );
968
+	return apply_filters('give_pakistan_states', $states);
969 969
 }
970 970
 
971 971
 /**
@@ -977,91 +977,91 @@  discard block
 block discarded – undo
977 977
 function give_get_philippines_states_list() {
978 978
 	$states = array(
979 979
 		''    => '',
980
-		'ABR' => __( 'Abra', 'give' ),
981
-		'AGN' => __( 'Agusan del Norte', 'give' ),
982
-		'AGS' => __( 'Agusan del Sur', 'give' ),
983
-		'AKL' => __( 'Aklan', 'give' ),
984
-		'ALB' => __( 'Albay', 'give' ),
985
-		'ANT' => __( 'Antique', 'give' ),
986
-		'APA' => __( 'Apayao', 'give' ),
987
-		'AUR' => __( 'Aurora', 'give' ),
988
-		'BAS' => __( 'Basilan', 'give' ),
989
-		'BAN' => __( 'Bataan', 'give' ),
990
-		'BTN' => __( 'Batanes', 'give' ),
991
-		'BTG' => __( 'Batangas', 'give' ),
992
-		'BEN' => __( 'Benguet', 'give' ),
993
-		'BIL' => __( 'Biliran', 'give' ),
994
-		'BOH' => __( 'Bohol', 'give' ),
995
-		'BUK' => __( 'Bukidnon', 'give' ),
996
-		'BUL' => __( 'Bulacan', 'give' ),
997
-		'CAG' => __( 'Cagayan', 'give' ),
998
-		'CAN' => __( 'Camarines Norte', 'give' ),
999
-		'CAS' => __( 'Camarines Sur', 'give' ),
1000
-		'CAM' => __( 'Camiguin', 'give' ),
1001
-		'CAP' => __( 'Capiz', 'give' ),
1002
-		'CAT' => __( 'Catanduanes', 'give' ),
1003
-		'CAV' => __( 'Cavite', 'give' ),
1004
-		'CEB' => __( 'Cebu', 'give' ),
1005
-		'COM' => __( 'Compostela Valley', 'give' ),
1006
-		'NCO' => __( 'Cotabato', 'give' ),
1007
-		'DAV' => __( 'Davao del Norte', 'give' ),
1008
-		'DAS' => __( 'Davao del Sur', 'give' ),
1009
-		'DAC' => __( 'Davao Occidental', 'give' ), // TODO: Needs to be updated when ISO code is assigned
1010
-		'DAO' => __( 'Davao Oriental', 'give' ),
1011
-		'DIN' => __( 'Dinagat Islands', 'give' ),
1012
-		'EAS' => __( 'Eastern Samar', 'give' ),
1013
-		'GUI' => __( 'Guimaras', 'give' ),
1014
-		'IFU' => __( 'Ifugao', 'give' ),
1015
-		'ILN' => __( 'Ilocos Norte', 'give' ),
1016
-		'ILS' => __( 'Ilocos Sur', 'give' ),
1017
-		'ILI' => __( 'Iloilo', 'give' ),
1018
-		'ISA' => __( 'Isabela', 'give' ),
1019
-		'KAL' => __( 'Kalinga', 'give' ),
1020
-		'LUN' => __( 'La Union', 'give' ),
1021
-		'LAG' => __( 'Laguna', 'give' ),
1022
-		'LAN' => __( 'Lanao del Norte', 'give' ),
1023
-		'LAS' => __( 'Lanao del Sur', 'give' ),
1024
-		'LEY' => __( 'Leyte', 'give' ),
1025
-		'MAG' => __( 'Maguindanao', 'give' ),
1026
-		'MAD' => __( 'Marinduque', 'give' ),
1027
-		'MAS' => __( 'Masbate', 'give' ),
1028
-		'MSC' => __( 'Misamis Occidental', 'give' ),
1029
-		'MSR' => __( 'Misamis Oriental', 'give' ),
1030
-		'MOU' => __( 'Mountain Province', 'give' ),
1031
-		'NEC' => __( 'Negros Occidental', 'give' ),
1032
-		'NER' => __( 'Negros Oriental', 'give' ),
1033
-		'NSA' => __( 'Northern Samar', 'give' ),
1034
-		'NUE' => __( 'Nueva Ecija', 'give' ),
1035
-		'NUV' => __( 'Nueva Vizcaya', 'give' ),
1036
-		'MDC' => __( 'Occidental Mindoro', 'give' ),
1037
-		'MDR' => __( 'Oriental Mindoro', 'give' ),
1038
-		'PLW' => __( 'Palawan', 'give' ),
1039
-		'PAM' => __( 'Pampanga', 'give' ),
1040
-		'PAN' => __( 'Pangasinan', 'give' ),
1041
-		'QUE' => __( 'Quezon', 'give' ),
1042
-		'QUI' => __( 'Quirino', 'give' ),
1043
-		'RIZ' => __( 'Rizal', 'give' ),
1044
-		'ROM' => __( 'Romblon', 'give' ),
1045
-		'WSA' => __( 'Samar', 'give' ),
1046
-		'SAR' => __( 'Sarangani', 'give' ),
1047
-		'SIQ' => __( 'Siquijor', 'give' ),
1048
-		'SOR' => __( 'Sorsogon', 'give' ),
1049
-		'SCO' => __( 'South Cotabato', 'give' ),
1050
-		'SLE' => __( 'Southern Leyte', 'give' ),
1051
-		'SUK' => __( 'Sultan Kudarat', 'give' ),
1052
-		'SLU' => __( 'Sulu', 'give' ),
1053
-		'SUN' => __( 'Surigao del Norte', 'give' ),
1054
-		'SUR' => __( 'Surigao del Sur', 'give' ),
1055
-		'TAR' => __( 'Tarlac', 'give' ),
1056
-		'TAW' => __( 'Tawi-Tawi', 'give' ),
1057
-		'ZMB' => __( 'Zambales', 'give' ),
1058
-		'ZAN' => __( 'Zamboanga del Norte', 'give' ),
1059
-		'ZAS' => __( 'Zamboanga del Sur', 'give' ),
1060
-		'ZSI' => __( 'Zamboanga Sibugay', 'give' ),
1061
-		'00'  => __( 'Metro Manila', 'give' ),
980
+		'ABR' => __('Abra', 'give'),
981
+		'AGN' => __('Agusan del Norte', 'give'),
982
+		'AGS' => __('Agusan del Sur', 'give'),
983
+		'AKL' => __('Aklan', 'give'),
984
+		'ALB' => __('Albay', 'give'),
985
+		'ANT' => __('Antique', 'give'),
986
+		'APA' => __('Apayao', 'give'),
987
+		'AUR' => __('Aurora', 'give'),
988
+		'BAS' => __('Basilan', 'give'),
989
+		'BAN' => __('Bataan', 'give'),
990
+		'BTN' => __('Batanes', 'give'),
991
+		'BTG' => __('Batangas', 'give'),
992
+		'BEN' => __('Benguet', 'give'),
993
+		'BIL' => __('Biliran', 'give'),
994
+		'BOH' => __('Bohol', 'give'),
995
+		'BUK' => __('Bukidnon', 'give'),
996
+		'BUL' => __('Bulacan', 'give'),
997
+		'CAG' => __('Cagayan', 'give'),
998
+		'CAN' => __('Camarines Norte', 'give'),
999
+		'CAS' => __('Camarines Sur', 'give'),
1000
+		'CAM' => __('Camiguin', 'give'),
1001
+		'CAP' => __('Capiz', 'give'),
1002
+		'CAT' => __('Catanduanes', 'give'),
1003
+		'CAV' => __('Cavite', 'give'),
1004
+		'CEB' => __('Cebu', 'give'),
1005
+		'COM' => __('Compostela Valley', 'give'),
1006
+		'NCO' => __('Cotabato', 'give'),
1007
+		'DAV' => __('Davao del Norte', 'give'),
1008
+		'DAS' => __('Davao del Sur', 'give'),
1009
+		'DAC' => __('Davao Occidental', 'give'), // TODO: Needs to be updated when ISO code is assigned
1010
+		'DAO' => __('Davao Oriental', 'give'),
1011
+		'DIN' => __('Dinagat Islands', 'give'),
1012
+		'EAS' => __('Eastern Samar', 'give'),
1013
+		'GUI' => __('Guimaras', 'give'),
1014
+		'IFU' => __('Ifugao', 'give'),
1015
+		'ILN' => __('Ilocos Norte', 'give'),
1016
+		'ILS' => __('Ilocos Sur', 'give'),
1017
+		'ILI' => __('Iloilo', 'give'),
1018
+		'ISA' => __('Isabela', 'give'),
1019
+		'KAL' => __('Kalinga', 'give'),
1020
+		'LUN' => __('La Union', 'give'),
1021
+		'LAG' => __('Laguna', 'give'),
1022
+		'LAN' => __('Lanao del Norte', 'give'),
1023
+		'LAS' => __('Lanao del Sur', 'give'),
1024
+		'LEY' => __('Leyte', 'give'),
1025
+		'MAG' => __('Maguindanao', 'give'),
1026
+		'MAD' => __('Marinduque', 'give'),
1027
+		'MAS' => __('Masbate', 'give'),
1028
+		'MSC' => __('Misamis Occidental', 'give'),
1029
+		'MSR' => __('Misamis Oriental', 'give'),
1030
+		'MOU' => __('Mountain Province', 'give'),
1031
+		'NEC' => __('Negros Occidental', 'give'),
1032
+		'NER' => __('Negros Oriental', 'give'),
1033
+		'NSA' => __('Northern Samar', 'give'),
1034
+		'NUE' => __('Nueva Ecija', 'give'),
1035
+		'NUV' => __('Nueva Vizcaya', 'give'),
1036
+		'MDC' => __('Occidental Mindoro', 'give'),
1037
+		'MDR' => __('Oriental Mindoro', 'give'),
1038
+		'PLW' => __('Palawan', 'give'),
1039
+		'PAM' => __('Pampanga', 'give'),
1040
+		'PAN' => __('Pangasinan', 'give'),
1041
+		'QUE' => __('Quezon', 'give'),
1042
+		'QUI' => __('Quirino', 'give'),
1043
+		'RIZ' => __('Rizal', 'give'),
1044
+		'ROM' => __('Romblon', 'give'),
1045
+		'WSA' => __('Samar', 'give'),
1046
+		'SAR' => __('Sarangani', 'give'),
1047
+		'SIQ' => __('Siquijor', 'give'),
1048
+		'SOR' => __('Sorsogon', 'give'),
1049
+		'SCO' => __('South Cotabato', 'give'),
1050
+		'SLE' => __('Southern Leyte', 'give'),
1051
+		'SUK' => __('Sultan Kudarat', 'give'),
1052
+		'SLU' => __('Sulu', 'give'),
1053
+		'SUN' => __('Surigao del Norte', 'give'),
1054
+		'SUR' => __('Surigao del Sur', 'give'),
1055
+		'TAR' => __('Tarlac', 'give'),
1056
+		'TAW' => __('Tawi-Tawi', 'give'),
1057
+		'ZMB' => __('Zambales', 'give'),
1058
+		'ZAN' => __('Zamboanga del Norte', 'give'),
1059
+		'ZAS' => __('Zamboanga del Sur', 'give'),
1060
+		'ZSI' => __('Zamboanga Sibugay', 'give'),
1061
+		'00'  => __('Metro Manila', 'give'),
1062 1062
 	);
1063 1063
 
1064
-	return apply_filters( 'give_philippines_states', $states );
1064
+	return apply_filters('give_philippines_states', $states);
1065 1065
 }
1066 1066
 
1067 1067
 /**
@@ -1073,35 +1073,35 @@  discard block
 block discarded – undo
1073 1073
 function give_get_peru_states_list() {
1074 1074
 	$states = array(
1075 1075
 		''    => '',
1076
-		'CAL' => __( 'El Callao', 'give' ),
1077
-		'LMA' => __( 'Municipalidad Metropolitana de Lima', 'give' ),
1078
-		'AMA' => __( 'Amazonas', 'give' ),
1079
-		'ANC' => __( 'Ancash', 'give' ),
1080
-		'APU' => __( 'Apurímac', 'give' ),
1081
-		'ARE' => __( 'Arequipa', 'give' ),
1082
-		'AYA' => __( 'Ayacucho', 'give' ),
1083
-		'CAJ' => __( 'Cajamarca', 'give' ),
1084
-		'CUS' => __( 'Cusco', 'give' ),
1085
-		'HUV' => __( 'Huancavelica', 'give' ),
1086
-		'HUC' => __( 'Huánuco', 'give' ),
1087
-		'ICA' => __( 'Ica', 'give' ),
1088
-		'JUN' => __( 'Junín', 'give' ),
1089
-		'LAL' => __( 'La Libertad', 'give' ),
1090
-		'LAM' => __( 'Lambayeque', 'give' ),
1091
-		'LIM' => __( 'Lima', 'give' ),
1092
-		'LOR' => __( 'Loreto', 'give' ),
1093
-		'MDD' => __( 'Madre de Dios', 'give' ),
1094
-		'MOQ' => __( 'Moquegua', 'give' ),
1095
-		'PAS' => __( 'Pasco', 'give' ),
1096
-		'PIU' => __( 'Piura', 'give' ),
1097
-		'PUN' => __( 'Puno', 'give' ),
1098
-		'SAM' => __( 'San Martín', 'give' ),
1099
-		'TAC' => __( 'Tacna', 'give' ),
1100
-		'TUM' => __( 'Tumbes', 'give' ),
1101
-		'UCA' => __( 'Ucayali', 'give' ),
1076
+		'CAL' => __('El Callao', 'give'),
1077
+		'LMA' => __('Municipalidad Metropolitana de Lima', 'give'),
1078
+		'AMA' => __('Amazonas', 'give'),
1079
+		'ANC' => __('Ancash', 'give'),
1080
+		'APU' => __('Apurímac', 'give'),
1081
+		'ARE' => __('Arequipa', 'give'),
1082
+		'AYA' => __('Ayacucho', 'give'),
1083
+		'CAJ' => __('Cajamarca', 'give'),
1084
+		'CUS' => __('Cusco', 'give'),
1085
+		'HUV' => __('Huancavelica', 'give'),
1086
+		'HUC' => __('Huánuco', 'give'),
1087
+		'ICA' => __('Ica', 'give'),
1088
+		'JUN' => __('Junín', 'give'),
1089
+		'LAL' => __('La Libertad', 'give'),
1090
+		'LAM' => __('Lambayeque', 'give'),
1091
+		'LIM' => __('Lima', 'give'),
1092
+		'LOR' => __('Loreto', 'give'),
1093
+		'MDD' => __('Madre de Dios', 'give'),
1094
+		'MOQ' => __('Moquegua', 'give'),
1095
+		'PAS' => __('Pasco', 'give'),
1096
+		'PIU' => __('Piura', 'give'),
1097
+		'PUN' => __('Puno', 'give'),
1098
+		'SAM' => __('San Martín', 'give'),
1099
+		'TAC' => __('Tacna', 'give'),
1100
+		'TUM' => __('Tumbes', 'give'),
1101
+		'UCA' => __('Ucayali', 'give'),
1102 1102
 	);
1103 1103
 
1104
-	return apply_filters( 'give_peru_states', $states );
1104
+	return apply_filters('give_peru_states', $states);
1105 1105
 }
1106 1106
 
1107 1107
 /**
@@ -1113,23 +1113,23 @@  discard block
 block discarded – undo
1113 1113
 function give_get_nepal_states_list() {
1114 1114
 	$states = array(
1115 1115
 		''    => '',
1116
-		'BAG' => __( 'Bagmati', 'give' ),
1117
-		'BHE' => __( 'Bheri', 'give' ),
1118
-		'DHA' => __( 'Dhaulagiri', 'give' ),
1119
-		'GAN' => __( 'Gandaki', 'give' ),
1120
-		'JAN' => __( 'Janakpur', 'give' ),
1121
-		'KAR' => __( 'Karnali', 'give' ),
1122
-		'KOS' => __( 'Koshi', 'give' ),
1123
-		'LUM' => __( 'Lumbini', 'give' ),
1124
-		'MAH' => __( 'Mahakali', 'give' ),
1125
-		'MEC' => __( 'Mechi', 'give' ),
1126
-		'NAR' => __( 'Narayani', 'give' ),
1127
-		'RAP' => __( 'Rapti', 'give' ),
1128
-		'SAG' => __( 'Sagarmatha', 'give' ),
1129
-		'SET' => __( 'Seti', 'give' ),
1116
+		'BAG' => __('Bagmati', 'give'),
1117
+		'BHE' => __('Bheri', 'give'),
1118
+		'DHA' => __('Dhaulagiri', 'give'),
1119
+		'GAN' => __('Gandaki', 'give'),
1120
+		'JAN' => __('Janakpur', 'give'),
1121
+		'KAR' => __('Karnali', 'give'),
1122
+		'KOS' => __('Koshi', 'give'),
1123
+		'LUM' => __('Lumbini', 'give'),
1124
+		'MAH' => __('Mahakali', 'give'),
1125
+		'MEC' => __('Mechi', 'give'),
1126
+		'NAR' => __('Narayani', 'give'),
1127
+		'RAP' => __('Rapti', 'give'),
1128
+		'SAG' => __('Sagarmatha', 'give'),
1129
+		'SET' => __('Seti', 'give'),
1130 1130
 	);
1131 1131
 
1132
-	return apply_filters( 'give_nepal_states', $states );
1132
+	return apply_filters('give_nepal_states', $states);
1133 1133
 }
1134 1134
 
1135 1135
 /**
@@ -1141,46 +1141,46 @@  discard block
 block discarded – undo
1141 1141
 function give_get_nigerian_states_list() {
1142 1142
 	$states = array(
1143 1143
 		''   => '',
1144
-		'AB' => __( 'Abia', 'give' ),
1145
-		'FC' => __( 'Abuja', 'give' ),
1146
-		'AD' => __( 'Adamawa', 'give' ),
1147
-		'AK' => __( 'Akwa Ibom', 'give' ),
1148
-		'AN' => __( 'Anambra', 'give' ),
1149
-		'BA' => __( 'Bauchi', 'give' ),
1150
-		'BY' => __( 'Bayelsa', 'give' ),
1151
-		'BE' => __( 'Benue', 'give' ),
1152
-		'BO' => __( 'Borno', 'give' ),
1153
-		'CR' => __( 'Cross River', 'give' ),
1154
-		'DE' => __( 'Delta', 'give' ),
1155
-		'EB' => __( 'Ebonyi', 'give' ),
1156
-		'ED' => __( 'Edo', 'give' ),
1157
-		'EK' => __( 'Ekiti', 'give' ),
1158
-		'EN' => __( 'Enugu', 'give' ),
1159
-		'GO' => __( 'Gombe', 'give' ),
1160
-		'IM' => __( 'Imo', 'give' ),
1161
-		'JI' => __( 'Jigawa', 'give' ),
1162
-		'KD' => __( 'Kaduna', 'give' ),
1163
-		'KN' => __( 'Kano', 'give' ),
1164
-		'KT' => __( 'Katsina', 'give' ),
1165
-		'KE' => __( 'Kebbi', 'give' ),
1166
-		'KO' => __( 'Kogi', 'give' ),
1167
-		'KW' => __( 'Kwara', 'give' ),
1168
-		'LA' => __( 'Lagos', 'give' ),
1169
-		'NA' => __( 'Nasarawa', 'give' ),
1170
-		'NI' => __( 'Niger', 'give' ),
1171
-		'OG' => __( 'Ogun', 'give' ),
1172
-		'ON' => __( 'Ondo', 'give' ),
1173
-		'OS' => __( 'Osun', 'give' ),
1174
-		'OY' => __( 'Oyo', 'give' ),
1175
-		'PL' => __( 'Plateau', 'give' ),
1176
-		'RI' => __( 'Rivers', 'give' ),
1177
-		'SO' => __( 'Sokoto', 'give' ),
1178
-		'TA' => __( 'Taraba', 'give' ),
1179
-		'YO' => __( 'Yobe', 'give' ),
1180
-		'ZA' => __( 'Zamfara', 'give' ),
1144
+		'AB' => __('Abia', 'give'),
1145
+		'FC' => __('Abuja', 'give'),
1146
+		'AD' => __('Adamawa', 'give'),
1147
+		'AK' => __('Akwa Ibom', 'give'),
1148
+		'AN' => __('Anambra', 'give'),
1149
+		'BA' => __('Bauchi', 'give'),
1150
+		'BY' => __('Bayelsa', 'give'),
1151
+		'BE' => __('Benue', 'give'),
1152
+		'BO' => __('Borno', 'give'),
1153
+		'CR' => __('Cross River', 'give'),
1154
+		'DE' => __('Delta', 'give'),
1155
+		'EB' => __('Ebonyi', 'give'),
1156
+		'ED' => __('Edo', 'give'),
1157
+		'EK' => __('Ekiti', 'give'),
1158
+		'EN' => __('Enugu', 'give'),
1159
+		'GO' => __('Gombe', 'give'),
1160
+		'IM' => __('Imo', 'give'),
1161
+		'JI' => __('Jigawa', 'give'),
1162
+		'KD' => __('Kaduna', 'give'),
1163
+		'KN' => __('Kano', 'give'),
1164
+		'KT' => __('Katsina', 'give'),
1165
+		'KE' => __('Kebbi', 'give'),
1166
+		'KO' => __('Kogi', 'give'),
1167
+		'KW' => __('Kwara', 'give'),
1168
+		'LA' => __('Lagos', 'give'),
1169
+		'NA' => __('Nasarawa', 'give'),
1170
+		'NI' => __('Niger', 'give'),
1171
+		'OG' => __('Ogun', 'give'),
1172
+		'ON' => __('Ondo', 'give'),
1173
+		'OS' => __('Osun', 'give'),
1174
+		'OY' => __('Oyo', 'give'),
1175
+		'PL' => __('Plateau', 'give'),
1176
+		'RI' => __('Rivers', 'give'),
1177
+		'SO' => __('Sokoto', 'give'),
1178
+		'TA' => __('Taraba', 'give'),
1179
+		'YO' => __('Yobe', 'give'),
1180
+		'ZA' => __('Zamfara', 'give'),
1181 1181
 	);
1182 1182
 
1183
-	return apply_filters( 'give_nigerian_states', $states );
1183
+	return apply_filters('give_nigerian_states', $states);
1184 1184
 }
1185 1185
 
1186 1186
 /**
@@ -1192,41 +1192,41 @@  discard block
 block discarded – undo
1192 1192
 function give_get_mexico_states_list() {
1193 1193
 	$states = array(
1194 1194
 		''                    => '',
1195
-		'Distrito Federal'    => __( 'Distrito Federal', 'give' ),
1196
-		'Jalisco'             => __( 'Jalisco', 'give' ),
1197
-		'Nuevo Leon'          => __( 'Nuevo León', 'give' ),
1198
-		'Aguascalientes'      => __( 'Aguascalientes', 'give' ),
1199
-		'Baja California'     => __( 'Baja California', 'give' ),
1200
-		'Baja California Sur' => __( 'Baja California Sur', 'give' ),
1201
-		'Campeche'            => __( 'Campeche', 'give' ),
1202
-		'Chiapas'             => __( 'Chiapas', 'give' ),
1203
-		'Chihuahua'           => __( 'Chihuahua', 'give' ),
1204
-		'Coahuila'            => __( 'Coahuila', 'give' ),
1205
-		'Colima'              => __( 'Colima', 'give' ),
1206
-		'Durango'             => __( 'Durango', 'give' ),
1207
-		'Guanajuato'          => __( 'Guanajuato', 'give' ),
1208
-		'Guerrero'            => __( 'Guerrero', 'give' ),
1209
-		'Hidalgo'             => __( 'Hidalgo', 'give' ),
1210
-		'Estado de Mexico'    => __( 'Edo. de México', 'give' ),
1211
-		'Michoacan'           => __( 'Michoacán', 'give' ),
1212
-		'Morelos'             => __( 'Morelos', 'give' ),
1213
-		'Nayarit'             => __( 'Nayarit', 'give' ),
1214
-		'Oaxaca'              => __( 'Oaxaca', 'give' ),
1215
-		'Puebla'              => __( 'Puebla', 'give' ),
1216
-		'Queretaro'           => __( 'Querétaro', 'give' ),
1217
-		'Quintana Roo'        => __( 'Quintana Roo', 'give' ),
1218
-		'San Luis Potosi'     => __( 'San Luis Potosí', 'give' ),
1219
-		'Sinaloa'             => __( 'Sinaloa', 'give' ),
1220
-		'Sonora'              => __( 'Sonora', 'give' ),
1221
-		'Tabasco'             => __( 'Tabasco', 'give' ),
1222
-		'Tamaulipas'          => __( 'Tamaulipas', 'give' ),
1223
-		'Tlaxcala'            => __( 'Tlaxcala', 'give' ),
1224
-		'Veracruz'            => __( 'Veracruz', 'give' ),
1225
-		'Yucatan'             => __( 'Yucatán', 'give' ),
1226
-		'Zacatecas'           => __( 'Zacatecas', 'give' ),
1195
+		'Distrito Federal'    => __('Distrito Federal', 'give'),
1196
+		'Jalisco'             => __('Jalisco', 'give'),
1197
+		'Nuevo Leon'          => __('Nuevo León', 'give'),
1198
+		'Aguascalientes'      => __('Aguascalientes', 'give'),
1199
+		'Baja California'     => __('Baja California', 'give'),
1200
+		'Baja California Sur' => __('Baja California Sur', 'give'),
1201
+		'Campeche'            => __('Campeche', 'give'),
1202
+		'Chiapas'             => __('Chiapas', 'give'),
1203
+		'Chihuahua'           => __('Chihuahua', 'give'),
1204
+		'Coahuila'            => __('Coahuila', 'give'),
1205
+		'Colima'              => __('Colima', 'give'),
1206
+		'Durango'             => __('Durango', 'give'),
1207
+		'Guanajuato'          => __('Guanajuato', 'give'),
1208
+		'Guerrero'            => __('Guerrero', 'give'),
1209
+		'Hidalgo'             => __('Hidalgo', 'give'),
1210
+		'Estado de Mexico'    => __('Edo. de México', 'give'),
1211
+		'Michoacan'           => __('Michoacán', 'give'),
1212
+		'Morelos'             => __('Morelos', 'give'),
1213
+		'Nayarit'             => __('Nayarit', 'give'),
1214
+		'Oaxaca'              => __('Oaxaca', 'give'),
1215
+		'Puebla'              => __('Puebla', 'give'),
1216
+		'Queretaro'           => __('Querétaro', 'give'),
1217
+		'Quintana Roo'        => __('Quintana Roo', 'give'),
1218
+		'San Luis Potosi'     => __('San Luis Potosí', 'give'),
1219
+		'Sinaloa'             => __('Sinaloa', 'give'),
1220
+		'Sonora'              => __('Sonora', 'give'),
1221
+		'Tabasco'             => __('Tabasco', 'give'),
1222
+		'Tamaulipas'          => __('Tamaulipas', 'give'),
1223
+		'Tlaxcala'            => __('Tlaxcala', 'give'),
1224
+		'Veracruz'            => __('Veracruz', 'give'),
1225
+		'Yucatan'             => __('Yucatán', 'give'),
1226
+		'Zacatecas'           => __('Zacatecas', 'give'),
1227 1227
 	);
1228 1228
 
1229
-	return apply_filters( 'give_mexico_states', $states );
1229
+	return apply_filters('give_mexico_states', $states);
1230 1230
 }
1231 1231
 
1232 1232
 /**
@@ -1238,56 +1238,56 @@  discard block
 block discarded – undo
1238 1238
 function give_get_japan_states_list() {
1239 1239
 	$states = array(
1240 1240
 		''     => '',
1241
-		'JP01' => __( 'Hokkaido', 'give' ),
1242
-		'JP02' => __( 'Aomori', 'give' ),
1243
-		'JP03' => __( 'Iwate', 'give' ),
1244
-		'JP04' => __( 'Miyagi', 'give' ),
1245
-		'JP05' => __( 'Akita', 'give' ),
1246
-		'JP06' => __( 'Yamagata', 'give' ),
1247
-		'JP07' => __( 'Fukushima', 'give' ),
1248
-		'JP08' => __( 'Ibaraki', 'give' ),
1249
-		'JP09' => __( 'Tochigi', 'give' ),
1250
-		'JP10' => __( 'Gunma', 'give' ),
1251
-		'JP11' => __( 'Saitama', 'give' ),
1252
-		'JP12' => __( 'Chiba', 'give' ),
1253
-		'JP13' => __( 'Tokyo', 'give' ),
1254
-		'JP14' => __( 'Kanagawa', 'give' ),
1255
-		'JP15' => __( 'Niigata', 'give' ),
1256
-		'JP16' => __( 'Toyama', 'give' ),
1257
-		'JP17' => __( 'Ishikawa', 'give' ),
1258
-		'JP18' => __( 'Fukui', 'give' ),
1259
-		'JP19' => __( 'Yamanashi', 'give' ),
1260
-		'JP20' => __( 'Nagano', 'give' ),
1261
-		'JP21' => __( 'Gifu', 'give' ),
1262
-		'JP22' => __( 'Shizuoka', 'give' ),
1263
-		'JP23' => __( 'Aichi', 'give' ),
1264
-		'JP24' => __( 'Mie', 'give' ),
1265
-		'JP25' => __( 'Shiga', 'give' ),
1266
-		'JP26' => __( 'Kyoto', 'give' ),
1267
-		'JP27' => __( 'Osaka', 'give' ),
1268
-		'JP28' => __( 'Hyogo', 'give' ),
1269
-		'JP29' => __( 'Nara', 'give' ),
1270
-		'JP30' => __( 'Wakayama', 'give' ),
1271
-		'JP31' => __( 'Tottori', 'give' ),
1272
-		'JP32' => __( 'Shimane', 'give' ),
1273
-		'JP33' => __( 'Okayama', 'give' ),
1274
-		'JP34' => __( 'Hiroshima', 'give' ),
1275
-		'JP35' => __( 'Yamaguchi', 'give' ),
1276
-		'JP36' => __( 'Tokushima', 'give' ),
1277
-		'JP37' => __( 'Kagawa', 'give' ),
1278
-		'JP38' => __( 'Ehime', 'give' ),
1279
-		'JP39' => __( 'Kochi', 'give' ),
1280
-		'JP40' => __( 'Fukuoka', 'give' ),
1281
-		'JP41' => __( 'Saga', 'give' ),
1282
-		'JP42' => __( 'Nagasaki', 'give' ),
1283
-		'JP43' => __( 'Kumamoto', 'give' ),
1284
-		'JP44' => __( 'Oita', 'give' ),
1285
-		'JP45' => __( 'Miyazaki', 'give' ),
1286
-		'JP46' => __( 'Kagoshima', 'give' ),
1287
-		'JP47' => __( 'Okinawa', 'give' ),
1241
+		'JP01' => __('Hokkaido', 'give'),
1242
+		'JP02' => __('Aomori', 'give'),
1243
+		'JP03' => __('Iwate', 'give'),
1244
+		'JP04' => __('Miyagi', 'give'),
1245
+		'JP05' => __('Akita', 'give'),
1246
+		'JP06' => __('Yamagata', 'give'),
1247
+		'JP07' => __('Fukushima', 'give'),
1248
+		'JP08' => __('Ibaraki', 'give'),
1249
+		'JP09' => __('Tochigi', 'give'),
1250
+		'JP10' => __('Gunma', 'give'),
1251
+		'JP11' => __('Saitama', 'give'),
1252
+		'JP12' => __('Chiba', 'give'),
1253
+		'JP13' => __('Tokyo', 'give'),
1254
+		'JP14' => __('Kanagawa', 'give'),
1255
+		'JP15' => __('Niigata', 'give'),
1256
+		'JP16' => __('Toyama', 'give'),
1257
+		'JP17' => __('Ishikawa', 'give'),
1258
+		'JP18' => __('Fukui', 'give'),
1259
+		'JP19' => __('Yamanashi', 'give'),
1260
+		'JP20' => __('Nagano', 'give'),
1261
+		'JP21' => __('Gifu', 'give'),
1262
+		'JP22' => __('Shizuoka', 'give'),
1263
+		'JP23' => __('Aichi', 'give'),
1264
+		'JP24' => __('Mie', 'give'),
1265
+		'JP25' => __('Shiga', 'give'),
1266
+		'JP26' => __('Kyoto', 'give'),
1267
+		'JP27' => __('Osaka', 'give'),
1268
+		'JP28' => __('Hyogo', 'give'),
1269
+		'JP29' => __('Nara', 'give'),
1270
+		'JP30' => __('Wakayama', 'give'),
1271
+		'JP31' => __('Tottori', 'give'),
1272
+		'JP32' => __('Shimane', 'give'),
1273
+		'JP33' => __('Okayama', 'give'),
1274
+		'JP34' => __('Hiroshima', 'give'),
1275
+		'JP35' => __('Yamaguchi', 'give'),
1276
+		'JP36' => __('Tokushima', 'give'),
1277
+		'JP37' => __('Kagawa', 'give'),
1278
+		'JP38' => __('Ehime', 'give'),
1279
+		'JP39' => __('Kochi', 'give'),
1280
+		'JP40' => __('Fukuoka', 'give'),
1281
+		'JP41' => __('Saga', 'give'),
1282
+		'JP42' => __('Nagasaki', 'give'),
1283
+		'JP43' => __('Kumamoto', 'give'),
1284
+		'JP44' => __('Oita', 'give'),
1285
+		'JP45' => __('Miyazaki', 'give'),
1286
+		'JP46' => __('Kagoshima', 'give'),
1287
+		'JP47' => __('Okinawa', 'give'),
1288 1288
 	);
1289 1289
 
1290
-	return apply_filters( 'give_japan_states', $states );
1290
+	return apply_filters('give_japan_states', $states);
1291 1291
 }
1292 1292
 
1293 1293
 /**
@@ -1299,119 +1299,119 @@  discard block
 block discarded – undo
1299 1299
 function give_get_italy_states_list() {
1300 1300
 	$states = array(
1301 1301
 		''   => '',
1302
-		'AG' => __( 'Agrigento', 'give' ),
1303
-		'AL' => __( 'Alessandria', 'give' ),
1304
-		'AN' => __( 'Ancona', 'give' ),
1305
-		'AO' => __( 'Aosta', 'give' ),
1306
-		'AR' => __( 'Arezzo', 'give' ),
1307
-		'AP' => __( 'Ascoli Piceno', 'give' ),
1308
-		'AT' => __( 'Asti', 'give' ),
1309
-		'AV' => __( 'Avellino', 'give' ),
1310
-		'BA' => __( 'Bari', 'give' ),
1311
-		'BT' => __( 'Barletta-Andria-Trani', 'give' ),
1312
-		'BL' => __( 'Belluno', 'give' ),
1313
-		'BN' => __( 'Benevento', 'give' ),
1314
-		'BG' => __( 'Bergamo', 'give' ),
1315
-		'BI' => __( 'Biella', 'give' ),
1316
-		'BO' => __( 'Bologna', 'give' ),
1317
-		'BZ' => __( 'Bolzano', 'give' ),
1318
-		'BS' => __( 'Brescia', 'give' ),
1319
-		'BR' => __( 'Brindisi', 'give' ),
1320
-		'CA' => __( 'Cagliari', 'give' ),
1321
-		'CL' => __( 'Caltanissetta', 'give' ),
1322
-		'CB' => __( 'Campobasso', 'give' ),
1323
-		'CI' => __( 'Carbonia-Iglesias', 'give' ),
1324
-		'CE' => __( 'Caserta', 'give' ),
1325
-		'CT' => __( 'Catania', 'give' ),
1326
-		'CZ' => __( 'Catanzaro', 'give' ),
1327
-		'CH' => __( 'Chieti', 'give' ),
1328
-		'CO' => __( 'Como', 'give' ),
1329
-		'CS' => __( 'Cosenza', 'give' ),
1330
-		'CR' => __( 'Cremona', 'give' ),
1331
-		'KR' => __( 'Crotone', 'give' ),
1332
-		'CN' => __( 'Cuneo', 'give' ),
1333
-		'EN' => __( 'Enna', 'give' ),
1334
-		'FM' => __( 'Fermo', 'give' ),
1335
-		'FE' => __( 'Ferrara', 'give' ),
1336
-		'FI' => __( 'Firenze', 'give' ),
1337
-		'FG' => __( 'Foggia', 'give' ),
1338
-		'FC' => __( 'Forlì-Cesena', 'give' ),
1339
-		'FR' => __( 'Frosinone', 'give' ),
1340
-		'GE' => __( 'Genova', 'give' ),
1341
-		'GO' => __( 'Gorizia', 'give' ),
1342
-		'GR' => __( 'Grosseto', 'give' ),
1343
-		'IM' => __( 'Imperia', 'give' ),
1344
-		'IS' => __( 'Isernia', 'give' ),
1345
-		'SP' => __( 'La Spezia', 'give' ),
1346
-		'AQ' => __( "L'Aquila", 'give' ),
1347
-		'LT' => __( 'Latina', 'give' ),
1348
-		'LE' => __( 'Lecce', 'give' ),
1349
-		'LC' => __( 'Lecco', 'give' ),
1350
-		'LI' => __( 'Livorno', 'give' ),
1351
-		'LO' => __( 'Lodi', 'give' ),
1352
-		'LU' => __( 'Lucca', 'give' ),
1353
-		'MC' => __( 'Macerata', 'give' ),
1354
-		'MN' => __( 'Mantova', 'give' ),
1355
-		'MS' => __( 'Massa-Carrara', 'give' ),
1356
-		'MT' => __( 'Matera', 'give' ),
1357
-		'ME' => __( 'Messina', 'give' ),
1358
-		'MI' => __( 'Milano', 'give' ),
1359
-		'MO' => __( 'Modena', 'give' ),
1360
-		'MB' => __( 'Monza e della Brianza', 'give' ),
1361
-		'NA' => __( 'Napoli', 'give' ),
1362
-		'NO' => __( 'Novara', 'give' ),
1363
-		'NU' => __( 'Nuoro', 'give' ),
1364
-		'OT' => __( 'Olbia-Tempio', 'give' ),
1365
-		'OR' => __( 'Oristano', 'give' ),
1366
-		'PD' => __( 'Padova', 'give' ),
1367
-		'PA' => __( 'Palermo', 'give' ),
1368
-		'PR' => __( 'Parma', 'give' ),
1369
-		'PV' => __( 'Pavia', 'give' ),
1370
-		'PG' => __( 'Perugia', 'give' ),
1371
-		'PU' => __( 'Pesaro e Urbino', 'give' ),
1372
-		'PE' => __( 'Pescara', 'give' ),
1373
-		'PC' => __( 'Piacenza', 'give' ),
1374
-		'PI' => __( 'Pisa', 'give' ),
1375
-		'PT' => __( 'Pistoia', 'give' ),
1376
-		'PN' => __( 'Pordenone', 'give' ),
1377
-		'PZ' => __( 'Potenza', 'give' ),
1378
-		'PO' => __( 'Prato', 'give' ),
1379
-		'RG' => __( 'Ragusa', 'give' ),
1380
-		'RA' => __( 'Ravenna', 'give' ),
1381
-		'RC' => __( 'Reggio Calabria', 'give' ),
1382
-		'RE' => __( 'Reggio Emilia', 'give' ),
1383
-		'RI' => __( 'Rieti', 'give' ),
1384
-		'RN' => __( 'Rimini', 'give' ),
1385
-		'RM' => __( 'Roma', 'give' ),
1386
-		'RO' => __( 'Rovigo', 'give' ),
1387
-		'SA' => __( 'Salerno', 'give' ),
1388
-		'VS' => __( 'Medio Campidano', 'give' ),
1389
-		'SS' => __( 'Sassari', 'give' ),
1390
-		'SV' => __( 'Savona', 'give' ),
1391
-		'SI' => __( 'Siena', 'give' ),
1392
-		'SR' => __( 'Siracusa', 'give' ),
1393
-		'SO' => __( 'Sondrio', 'give' ),
1394
-		'TA' => __( 'Taranto', 'give' ),
1395
-		'TE' => __( 'Teramo', 'give' ),
1396
-		'TR' => __( 'Terni', 'give' ),
1397
-		'TO' => __( 'Torino', 'give' ),
1398
-		'OG' => __( 'Ogliastra', 'give' ),
1399
-		'TP' => __( 'Trapani', 'give' ),
1400
-		'TN' => __( 'Trento', 'give' ),
1401
-		'TV' => __( 'Treviso', 'give' ),
1402
-		'TS' => __( 'Trieste', 'give' ),
1403
-		'UD' => __( 'Udine', 'give' ),
1404
-		'VA' => __( 'Varese', 'give' ),
1405
-		'VE' => __( 'Venezia', 'give' ),
1406
-		'VB' => __( 'Verbano-Cusio-Ossola', 'give' ),
1407
-		'VC' => __( 'Vercelli', 'give' ),
1408
-		'VR' => __( 'Verona', 'give' ),
1409
-		'VV' => __( 'Vibo Valentia', 'give' ),
1410
-		'VI' => __( 'Vicenza', 'give' ),
1411
-		'VT' => __( 'Viterbo', 'give' ),
1302
+		'AG' => __('Agrigento', 'give'),
1303
+		'AL' => __('Alessandria', 'give'),
1304
+		'AN' => __('Ancona', 'give'),
1305
+		'AO' => __('Aosta', 'give'),
1306
+		'AR' => __('Arezzo', 'give'),
1307
+		'AP' => __('Ascoli Piceno', 'give'),
1308
+		'AT' => __('Asti', 'give'),
1309
+		'AV' => __('Avellino', 'give'),
1310
+		'BA' => __('Bari', 'give'),
1311
+		'BT' => __('Barletta-Andria-Trani', 'give'),
1312
+		'BL' => __('Belluno', 'give'),
1313
+		'BN' => __('Benevento', 'give'),
1314
+		'BG' => __('Bergamo', 'give'),
1315
+		'BI' => __('Biella', 'give'),
1316
+		'BO' => __('Bologna', 'give'),
1317
+		'BZ' => __('Bolzano', 'give'),
1318
+		'BS' => __('Brescia', 'give'),
1319
+		'BR' => __('Brindisi', 'give'),
1320
+		'CA' => __('Cagliari', 'give'),
1321
+		'CL' => __('Caltanissetta', 'give'),
1322
+		'CB' => __('Campobasso', 'give'),
1323
+		'CI' => __('Carbonia-Iglesias', 'give'),
1324
+		'CE' => __('Caserta', 'give'),
1325
+		'CT' => __('Catania', 'give'),
1326
+		'CZ' => __('Catanzaro', 'give'),
1327
+		'CH' => __('Chieti', 'give'),
1328
+		'CO' => __('Como', 'give'),
1329
+		'CS' => __('Cosenza', 'give'),
1330
+		'CR' => __('Cremona', 'give'),
1331
+		'KR' => __('Crotone', 'give'),
1332
+		'CN' => __('Cuneo', 'give'),
1333
+		'EN' => __('Enna', 'give'),
1334
+		'FM' => __('Fermo', 'give'),
1335
+		'FE' => __('Ferrara', 'give'),
1336
+		'FI' => __('Firenze', 'give'),
1337
+		'FG' => __('Foggia', 'give'),
1338
+		'FC' => __('Forlì-Cesena', 'give'),
1339
+		'FR' => __('Frosinone', 'give'),
1340
+		'GE' => __('Genova', 'give'),
1341
+		'GO' => __('Gorizia', 'give'),
1342
+		'GR' => __('Grosseto', 'give'),
1343
+		'IM' => __('Imperia', 'give'),
1344
+		'IS' => __('Isernia', 'give'),
1345
+		'SP' => __('La Spezia', 'give'),
1346
+		'AQ' => __("L'Aquila", 'give'),
1347
+		'LT' => __('Latina', 'give'),
1348
+		'LE' => __('Lecce', 'give'),
1349
+		'LC' => __('Lecco', 'give'),
1350
+		'LI' => __('Livorno', 'give'),
1351
+		'LO' => __('Lodi', 'give'),
1352
+		'LU' => __('Lucca', 'give'),
1353
+		'MC' => __('Macerata', 'give'),
1354
+		'MN' => __('Mantova', 'give'),
1355
+		'MS' => __('Massa-Carrara', 'give'),
1356
+		'MT' => __('Matera', 'give'),
1357
+		'ME' => __('Messina', 'give'),
1358
+		'MI' => __('Milano', 'give'),
1359
+		'MO' => __('Modena', 'give'),
1360
+		'MB' => __('Monza e della Brianza', 'give'),
1361
+		'NA' => __('Napoli', 'give'),
1362
+		'NO' => __('Novara', 'give'),
1363
+		'NU' => __('Nuoro', 'give'),
1364
+		'OT' => __('Olbia-Tempio', 'give'),
1365
+		'OR' => __('Oristano', 'give'),
1366
+		'PD' => __('Padova', 'give'),
1367
+		'PA' => __('Palermo', 'give'),
1368
+		'PR' => __('Parma', 'give'),
1369
+		'PV' => __('Pavia', 'give'),
1370
+		'PG' => __('Perugia', 'give'),
1371
+		'PU' => __('Pesaro e Urbino', 'give'),
1372
+		'PE' => __('Pescara', 'give'),
1373
+		'PC' => __('Piacenza', 'give'),
1374
+		'PI' => __('Pisa', 'give'),
1375
+		'PT' => __('Pistoia', 'give'),
1376
+		'PN' => __('Pordenone', 'give'),
1377
+		'PZ' => __('Potenza', 'give'),
1378
+		'PO' => __('Prato', 'give'),
1379
+		'RG' => __('Ragusa', 'give'),
1380
+		'RA' => __('Ravenna', 'give'),
1381
+		'RC' => __('Reggio Calabria', 'give'),
1382
+		'RE' => __('Reggio Emilia', 'give'),
1383
+		'RI' => __('Rieti', 'give'),
1384
+		'RN' => __('Rimini', 'give'),
1385
+		'RM' => __('Roma', 'give'),
1386
+		'RO' => __('Rovigo', 'give'),
1387
+		'SA' => __('Salerno', 'give'),
1388
+		'VS' => __('Medio Campidano', 'give'),
1389
+		'SS' => __('Sassari', 'give'),
1390
+		'SV' => __('Savona', 'give'),
1391
+		'SI' => __('Siena', 'give'),
1392
+		'SR' => __('Siracusa', 'give'),
1393
+		'SO' => __('Sondrio', 'give'),
1394
+		'TA' => __('Taranto', 'give'),
1395
+		'TE' => __('Teramo', 'give'),
1396
+		'TR' => __('Terni', 'give'),
1397
+		'TO' => __('Torino', 'give'),
1398
+		'OG' => __('Ogliastra', 'give'),
1399
+		'TP' => __('Trapani', 'give'),
1400
+		'TN' => __('Trento', 'give'),
1401
+		'TV' => __('Treviso', 'give'),
1402
+		'TS' => __('Trieste', 'give'),
1403
+		'UD' => __('Udine', 'give'),
1404
+		'VA' => __('Varese', 'give'),
1405
+		'VE' => __('Venezia', 'give'),
1406
+		'VB' => __('Verbano-Cusio-Ossola', 'give'),
1407
+		'VC' => __('Vercelli', 'give'),
1408
+		'VR' => __('Verona', 'give'),
1409
+		'VV' => __('Vibo Valentia', 'give'),
1410
+		'VI' => __('Vicenza', 'give'),
1411
+		'VT' => __('Viterbo', 'give'),
1412 1412
 	);
1413 1413
 
1414
-	return apply_filters( 'give_italy_states', $states );
1414
+	return apply_filters('give_italy_states', $states);
1415 1415
 }
1416 1416
 
1417 1417
 /**
@@ -1423,40 +1423,40 @@  discard block
 block discarded – undo
1423 1423
 function give_get_iran_states_list() {
1424 1424
 	$states = array(
1425 1425
 		''    => '',
1426
-		'KHZ' => __( 'Khuzestan  (خوزستان)', 'give' ),
1427
-		'THR' => __( 'Tehran  (تهران)', 'give' ),
1428
-		'ILM' => __( 'Ilaam (ایلام)', 'give' ),
1429
-		'BHR' => __( 'Bushehr (بوشهر)', 'give' ),
1430
-		'ADL' => __( 'Ardabil (اردبیل)', 'give' ),
1431
-		'ESF' => __( 'Isfahan (اصفهان)', 'give' ),
1432
-		'YZD' => __( 'Yazd (یزد)', 'give' ),
1433
-		'KRH' => __( 'Kermanshah (کرمانشاه)', 'give' ),
1434
-		'KRN' => __( 'Kerman (کرمان)', 'give' ),
1435
-		'HDN' => __( 'Hamadan (همدان)', 'give' ),
1436
-		'GZN' => __( 'Ghazvin (قزوین)', 'give' ),
1437
-		'ZJN' => __( 'Zanjan (زنجان)', 'give' ),
1438
-		'LRS' => __( 'Luristan (لرستان)', 'give' ),
1439
-		'ABZ' => __( 'Alborz (البرز)', 'give' ),
1440
-		'EAZ' => __( 'East Azarbaijan (آذربایجان شرقی)', 'give' ),
1441
-		'WAZ' => __( 'West Azarbaijan (آذربایجان غربی)', 'give' ),
1442
-		'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give' ),
1443
-		'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'give' ),
1444
-		'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'give' ),
1445
-		'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'give' ),
1446
-		'SMN' => __( 'Semnan (سمنان)', 'give' ),
1447
-		'FRS' => __( 'Fars (فارس)', 'give' ),
1448
-		'QHM' => __( 'Qom (قم)', 'give' ),
1449
-		'KRD' => __( 'Kurdistan / کردستان)', 'give' ),
1450
-		'KBD' => __( 'Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give' ),
1451
-		'GLS' => __( 'Golestan (گلستان)', 'give' ),
1452
-		'GIL' => __( 'Gilan (گیلان)', 'give' ),
1453
-		'MZN' => __( 'Mazandaran (مازندران)', 'give' ),
1454
-		'MKZ' => __( 'Markazi (مرکزی)', 'give' ),
1455
-		'HRZ' => __( 'Hormozgan (هرمزگان)', 'give' ),
1456
-		'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'give' ),
1426
+		'KHZ' => __('Khuzestan  (خوزستان)', 'give'),
1427
+		'THR' => __('Tehran  (تهران)', 'give'),
1428
+		'ILM' => __('Ilaam (ایلام)', 'give'),
1429
+		'BHR' => __('Bushehr (بوشهر)', 'give'),
1430
+		'ADL' => __('Ardabil (اردبیل)', 'give'),
1431
+		'ESF' => __('Isfahan (اصفهان)', 'give'),
1432
+		'YZD' => __('Yazd (یزد)', 'give'),
1433
+		'KRH' => __('Kermanshah (کرمانشاه)', 'give'),
1434
+		'KRN' => __('Kerman (کرمان)', 'give'),
1435
+		'HDN' => __('Hamadan (همدان)', 'give'),
1436
+		'GZN' => __('Ghazvin (قزوین)', 'give'),
1437
+		'ZJN' => __('Zanjan (زنجان)', 'give'),
1438
+		'LRS' => __('Luristan (لرستان)', 'give'),
1439
+		'ABZ' => __('Alborz (البرز)', 'give'),
1440
+		'EAZ' => __('East Azarbaijan (آذربایجان شرقی)', 'give'),
1441
+		'WAZ' => __('West Azarbaijan (آذربایجان غربی)', 'give'),
1442
+		'CHB' => __('Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'give'),
1443
+		'SKH' => __('South Khorasan (خراسان جنوبی)', 'give'),
1444
+		'RKH' => __('Razavi Khorasan (خراسان رضوی)', 'give'),
1445
+		'NKH' => __('North Khorasan (خراسان جنوبی)', 'give'),
1446
+		'SMN' => __('Semnan (سمنان)', 'give'),
1447
+		'FRS' => __('Fars (فارس)', 'give'),
1448
+		'QHM' => __('Qom (قم)', 'give'),
1449
+		'KRD' => __('Kurdistan / کردستان)', 'give'),
1450
+		'KBD' => __('Kohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)', 'give'),
1451
+		'GLS' => __('Golestan (گلستان)', 'give'),
1452
+		'GIL' => __('Gilan (گیلان)', 'give'),
1453
+		'MZN' => __('Mazandaran (مازندران)', 'give'),
1454
+		'MKZ' => __('Markazi (مرکزی)', 'give'),
1455
+		'HRZ' => __('Hormozgan (هرمزگان)', 'give'),
1456
+		'SBN' => __('Sistan and Baluchestan (سیستان و بلوچستان)', 'give'),
1457 1457
 	);
1458 1458
 
1459
-	return apply_filters( 'give_iran_states', $states );
1459
+	return apply_filters('give_iran_states', $states);
1460 1460
 }
1461 1461
 
1462 1462
 /**
@@ -1468,35 +1468,35 @@  discard block
 block discarded – undo
1468 1468
 function give_get_ireland_states_list() {
1469 1469
 	$states = array(
1470 1470
 		''   => '',
1471
-		'CE' => __( 'Clare', 'give' ),
1472
-		'CK' => __( 'Cork', 'give' ),
1473
-		'CN' => __( 'Cavan', 'give' ),
1474
-		'CW' => __( 'Carlow', 'give' ),
1475
-		'DL' => __( 'Donegal', 'give' ),
1476
-		'DN' => __( 'Dublin', 'give' ),
1477
-		'GY' => __( 'Galway', 'give' ),
1478
-		'KE' => __( 'Kildare', 'give' ),
1479
-		'KK' => __( 'Kilkenny', 'give' ),
1480
-		'KY' => __( 'Kerry', 'give' ),
1481
-		'LD' => __( 'Longford', 'give' ),
1482
-		'LH' => __( 'Louth', 'give' ),
1483
-		'LK' => __( 'Limerick', 'give' ),
1484
-		'LM' => __( 'Leitrim', 'give' ),
1485
-		'LS' => __( 'Laois', 'give' ),
1486
-		'MH' => __( 'Meath', 'give' ),
1487
-		'MN' => __( 'Monaghan', 'give' ),
1488
-		'MO' => __( 'Mayo', 'give' ),
1489
-		'OY' => __( 'Offaly', 'give' ),
1490
-		'RN' => __( 'Roscommon', 'give' ),
1491
-		'SO' => __( 'Sligo', 'give' ),
1492
-		'TY' => __( 'Tipperary', 'give' ),
1493
-		'WD' => __( 'Waterford', 'give' ),
1494
-		'WH' => __( 'Westmeath', 'give' ),
1495
-		'WW' => __( 'Wicklow', 'give' ),
1496
-		'WX' => __( 'Wexford', 'give' ),
1471
+		'CE' => __('Clare', 'give'),
1472
+		'CK' => __('Cork', 'give'),
1473
+		'CN' => __('Cavan', 'give'),
1474
+		'CW' => __('Carlow', 'give'),
1475
+		'DL' => __('Donegal', 'give'),
1476
+		'DN' => __('Dublin', 'give'),
1477
+		'GY' => __('Galway', 'give'),
1478
+		'KE' => __('Kildare', 'give'),
1479
+		'KK' => __('Kilkenny', 'give'),
1480
+		'KY' => __('Kerry', 'give'),
1481
+		'LD' => __('Longford', 'give'),
1482
+		'LH' => __('Louth', 'give'),
1483
+		'LK' => __('Limerick', 'give'),
1484
+		'LM' => __('Leitrim', 'give'),
1485
+		'LS' => __('Laois', 'give'),
1486
+		'MH' => __('Meath', 'give'),
1487
+		'MN' => __('Monaghan', 'give'),
1488
+		'MO' => __('Mayo', 'give'),
1489
+		'OY' => __('Offaly', 'give'),
1490
+		'RN' => __('Roscommon', 'give'),
1491
+		'SO' => __('Sligo', 'give'),
1492
+		'TY' => __('Tipperary', 'give'),
1493
+		'WD' => __('Waterford', 'give'),
1494
+		'WH' => __('Westmeath', 'give'),
1495
+		'WW' => __('Wicklow', 'give'),
1496
+		'WX' => __('Wexford', 'give'),
1497 1497
 	);
1498 1498
 
1499
-	return apply_filters( 'give_ireland_states', $states );
1499
+	return apply_filters('give_ireland_states', $states);
1500 1500
 }
1501 1501
 
1502 1502
 /**
@@ -1508,22 +1508,22 @@  discard block
 block discarded – undo
1508 1508
 function give_get_greek_states_list() {
1509 1509
 	$states = array(
1510 1510
 		''  => '',
1511
-		'I' => __( 'Αττική', 'give' ),
1512
-		'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'give' ),
1513
-		'B' => __( 'Κεντρική Μακεδονία', 'give' ),
1514
-		'C' => __( 'Δυτική Μακεδονία', 'give' ),
1515
-		'D' => __( 'Ήπειρος', 'give' ),
1516
-		'E' => __( 'Θεσσαλία', 'give' ),
1517
-		'F' => __( 'Ιόνιοι Νήσοι', 'give' ),
1518
-		'G' => __( 'Δυτική Ελλάδα', 'give' ),
1519
-		'H' => __( 'Στερεά Ελλάδα', 'give' ),
1520
-		'J' => __( 'Πελοπόννησος', 'give' ),
1521
-		'K' => __( 'Βόρειο Αιγαίο', 'give' ),
1522
-		'L' => __( 'Νότιο Αιγαίο', 'give' ),
1523
-		'M' => __( 'Κρήτη', 'give' ),
1511
+		'I' => __('Αττική', 'give'),
1512
+		'A' => __('Ανατολική Μακεδονία και Θράκη', 'give'),
1513
+		'B' => __('Κεντρική Μακεδονία', 'give'),
1514
+		'C' => __('Δυτική Μακεδονία', 'give'),
1515
+		'D' => __('Ήπειρος', 'give'),
1516
+		'E' => __('Θεσσαλία', 'give'),
1517
+		'F' => __('Ιόνιοι Νήσοι', 'give'),
1518
+		'G' => __('Δυτική Ελλάδα', 'give'),
1519
+		'H' => __('Στερεά Ελλάδα', 'give'),
1520
+		'J' => __('Πελοπόννησος', 'give'),
1521
+		'K' => __('Βόρειο Αιγαίο', 'give'),
1522
+		'L' => __('Νότιο Αιγαίο', 'give'),
1523
+		'M' => __('Κρήτη', 'give'),
1524 1524
 	);
1525 1525
 
1526
-	return apply_filters( 'give_greek_states', $states );
1526
+	return apply_filters('give_greek_states', $states);
1527 1527
 }
1528 1528
 
1529 1529
 /**
@@ -1535,18 +1535,18 @@  discard block
 block discarded – undo
1535 1535
 function give_get_bolivian_states_list() {
1536 1536
 	$states = array(
1537 1537
 		''  => '',
1538
-		'B' => __( 'Chuquisaca', 'give' ),
1539
-		'H' => __( 'Beni', 'give' ),
1540
-		'C' => __( 'Cochabamba', 'give' ),
1541
-		'L' => __( 'La Paz', 'give' ),
1542
-		'O' => __( 'Oruro', 'give' ),
1543
-		'N' => __( 'Pando', 'give' ),
1544
-		'P' => __( 'Potosí', 'give' ),
1545
-		'S' => __( 'Santa Cruz', 'give' ),
1546
-		'T' => __( 'Tarija', 'give' ),
1538
+		'B' => __('Chuquisaca', 'give'),
1539
+		'H' => __('Beni', 'give'),
1540
+		'C' => __('Cochabamba', 'give'),
1541
+		'L' => __('La Paz', 'give'),
1542
+		'O' => __('Oruro', 'give'),
1543
+		'N' => __('Pando', 'give'),
1544
+		'P' => __('Potosí', 'give'),
1545
+		'S' => __('Santa Cruz', 'give'),
1546
+		'T' => __('Tarija', 'give'),
1547 1547
 	);
1548 1548
 
1549
-	return apply_filters( 'give_bolivian_states', $states );
1549
+	return apply_filters('give_bolivian_states', $states);
1550 1550
 }
1551 1551
 
1552 1552
 /**
@@ -1558,37 +1558,37 @@  discard block
 block discarded – undo
1558 1558
 function give_get_bulgarian_states_list() {
1559 1559
 	$states = array(
1560 1560
 		''      => '',
1561
-		'BG-01' => __( 'Blagoevgrad', 'give' ),
1562
-		'BG-02' => __( 'Burgas', 'give' ),
1563
-		'BG-08' => __( 'Dobrich', 'give' ),
1564
-		'BG-07' => __( 'Gabrovo', 'give' ),
1565
-		'BG-26' => __( 'Haskovo', 'give' ),
1566
-		'BG-09' => __( 'Kardzhali', 'give' ),
1567
-		'BG-10' => __( 'Kyustendil', 'give' ),
1568
-		'BG-11' => __( 'Lovech', 'give' ),
1569
-		'BG-12' => __( 'Montana', 'give' ),
1570
-		'BG-13' => __( 'Pazardzhik', 'give' ),
1571
-		'BG-14' => __( 'Pernik', 'give' ),
1572
-		'BG-15' => __( 'Pleven', 'give' ),
1573
-		'BG-16' => __( 'Plovdiv', 'give' ),
1574
-		'BG-17' => __( 'Razgrad', 'give' ),
1575
-		'BG-18' => __( 'Ruse', 'give' ),
1576
-		'BG-27' => __( 'Shumen', 'give' ),
1577
-		'BG-19' => __( 'Silistra', 'give' ),
1578
-		'BG-20' => __( 'Sliven', 'give' ),
1579
-		'BG-21' => __( 'Smolyan', 'give' ),
1580
-		'BG-23' => __( 'Sofia', 'give' ),
1581
-		'BG-22' => __( 'Sofia-Grad', 'give' ),
1582
-		'BG-24' => __( 'Stara Zagora', 'give' ),
1583
-		'BG-25' => __( 'Targovishte', 'give' ),
1584
-		'BG-03' => __( 'Varna', 'give' ),
1585
-		'BG-04' => __( 'Veliko Tarnovo', 'give' ),
1586
-		'BG-05' => __( 'Vidin', 'give' ),
1587
-		'BG-06' => __( 'Vratsa', 'give' ),
1588
-		'BG-28' => __( 'Yambol', 'give' ),
1561
+		'BG-01' => __('Blagoevgrad', 'give'),
1562
+		'BG-02' => __('Burgas', 'give'),
1563
+		'BG-08' => __('Dobrich', 'give'),
1564
+		'BG-07' => __('Gabrovo', 'give'),
1565
+		'BG-26' => __('Haskovo', 'give'),
1566
+		'BG-09' => __('Kardzhali', 'give'),
1567
+		'BG-10' => __('Kyustendil', 'give'),
1568
+		'BG-11' => __('Lovech', 'give'),
1569
+		'BG-12' => __('Montana', 'give'),
1570
+		'BG-13' => __('Pazardzhik', 'give'),
1571
+		'BG-14' => __('Pernik', 'give'),
1572
+		'BG-15' => __('Pleven', 'give'),
1573
+		'BG-16' => __('Plovdiv', 'give'),
1574
+		'BG-17' => __('Razgrad', 'give'),
1575
+		'BG-18' => __('Ruse', 'give'),
1576
+		'BG-27' => __('Shumen', 'give'),
1577
+		'BG-19' => __('Silistra', 'give'),
1578
+		'BG-20' => __('Sliven', 'give'),
1579
+		'BG-21' => __('Smolyan', 'give'),
1580
+		'BG-23' => __('Sofia', 'give'),
1581
+		'BG-22' => __('Sofia-Grad', 'give'),
1582
+		'BG-24' => __('Stara Zagora', 'give'),
1583
+		'BG-25' => __('Targovishte', 'give'),
1584
+		'BG-03' => __('Varna', 'give'),
1585
+		'BG-04' => __('Veliko Tarnovo', 'give'),
1586
+		'BG-05' => __('Vidin', 'give'),
1587
+		'BG-06' => __('Vratsa', 'give'),
1588
+		'BG-28' => __('Yambol', 'give'),
1589 1589
 	);
1590 1590
 
1591
-	return apply_filters( 'give_bulgarian_states', $states );
1591
+	return apply_filters('give_bulgarian_states', $states);
1592 1592
 }
1593 1593
 
1594 1594
 /**
@@ -1600,73 +1600,73 @@  discard block
 block discarded – undo
1600 1600
 function give_get_bangladeshi_states_list() {
1601 1601
 	$states = array(
1602 1602
 		''     => '',
1603
-		'BAG'  => __( 'Bagerhat', 'give' ),
1604
-		'BAN'  => __( 'Bandarban', 'give' ),
1605
-		'BAR'  => __( 'Barguna', 'give' ),
1606
-		'BARI' => __( 'Barisal', 'give' ),
1607
-		'BHO'  => __( 'Bhola', 'give' ),
1608
-		'BOG'  => __( 'Bogra', 'give' ),
1609
-		'BRA'  => __( 'Brahmanbaria', 'give' ),
1610
-		'CHA'  => __( 'Chandpur', 'give' ),
1611
-		'CHI'  => __( 'Chittagong', 'give' ),
1612
-		'CHU'  => __( 'Chuadanga', 'give' ),
1613
-		'COM'  => __( 'Comilla', 'give' ),
1614
-		'COX'  => __( "Cox's Bazar", 'give' ),
1615
-		'DHA'  => __( 'Dhaka', 'give' ),
1616
-		'DIN'  => __( 'Dinajpur', 'give' ),
1617
-		'FAR'  => __( 'Faridpur ', 'give' ),
1618
-		'FEN'  => __( 'Feni', 'give' ),
1619
-		'GAI'  => __( 'Gaibandha', 'give' ),
1620
-		'GAZI' => __( 'Gazipur', 'give' ),
1621
-		'GOP'  => __( 'Gopalganj', 'give' ),
1622
-		'HAB'  => __( 'Habiganj', 'give' ),
1623
-		'JAM'  => __( 'Jamalpur', 'give' ),
1624
-		'JES'  => __( 'Jessore', 'give' ),
1625
-		'JHA'  => __( 'Jhalokati', 'give' ),
1626
-		'JHE'  => __( 'Jhenaidah', 'give' ),
1627
-		'JOY'  => __( 'Joypurhat', 'give' ),
1628
-		'KHA'  => __( 'Khagrachhari', 'give' ),
1629
-		'KHU'  => __( 'Khulna', 'give' ),
1630
-		'KIS'  => __( 'Kishoreganj', 'give' ),
1631
-		'KUR'  => __( 'Kurigram', 'give' ),
1632
-		'KUS'  => __( 'Kushtia', 'give' ),
1633
-		'LAK'  => __( 'Lakshmipur', 'give' ),
1634
-		'LAL'  => __( 'Lalmonirhat', 'give' ),
1635
-		'MAD'  => __( 'Madaripur', 'give' ),
1636
-		'MAG'  => __( 'Magura', 'give' ),
1637
-		'MAN'  => __( 'Manikganj ', 'give' ),
1638
-		'MEH'  => __( 'Meherpur', 'give' ),
1639
-		'MOU'  => __( 'Moulvibazar', 'give' ),
1640
-		'MUN'  => __( 'Munshiganj', 'give' ),
1641
-		'MYM'  => __( 'Mymensingh', 'give' ),
1642
-		'NAO'  => __( 'Naogaon', 'give' ),
1643
-		'NAR'  => __( 'Narail', 'give' ),
1644
-		'NARG' => __( 'Narayanganj', 'give' ),
1645
-		'NARD' => __( 'Narsingdi', 'give' ),
1646
-		'NAT'  => __( 'Natore', 'give' ),
1647
-		'NAW'  => __( 'Nawabganj', 'give' ),
1648
-		'NET'  => __( 'Netrakona', 'give' ),
1649
-		'NIL'  => __( 'Nilphamari', 'give' ),
1650
-		'NOA'  => __( 'Noakhali', 'give' ),
1651
-		'PAB'  => __( 'Pabna', 'give' ),
1652
-		'PAN'  => __( 'Panchagarh', 'give' ),
1653
-		'PAT'  => __( 'Patuakhali', 'give' ),
1654
-		'PIR'  => __( 'Pirojpur', 'give' ),
1655
-		'RAJB' => __( 'Rajbari', 'give' ),
1656
-		'RAJ'  => __( 'Rajshahi', 'give' ),
1657
-		'RAN'  => __( 'Rangamati', 'give' ),
1658
-		'RANP' => __( 'Rangpur', 'give' ),
1659
-		'SAT'  => __( 'Satkhira', 'give' ),
1660
-		'SHA'  => __( 'Shariatpur', 'give' ),
1661
-		'SHE'  => __( 'Sherpur', 'give' ),
1662
-		'SIR'  => __( 'Sirajganj', 'give' ),
1663
-		'SUN'  => __( 'Sunamganj', 'give' ),
1664
-		'SYL'  => __( 'Sylhet', 'give' ),
1665
-		'TAN'  => __( 'Tangail', 'give' ),
1666
-		'THA'  => __( 'Thakurgaon', 'give' ),
1603
+		'BAG'  => __('Bagerhat', 'give'),
1604
+		'BAN'  => __('Bandarban', 'give'),
1605
+		'BAR'  => __('Barguna', 'give'),
1606
+		'BARI' => __('Barisal', 'give'),
1607
+		'BHO'  => __('Bhola', 'give'),
1608
+		'BOG'  => __('Bogra', 'give'),
1609
+		'BRA'  => __('Brahmanbaria', 'give'),
1610
+		'CHA'  => __('Chandpur', 'give'),
1611
+		'CHI'  => __('Chittagong', 'give'),
1612
+		'CHU'  => __('Chuadanga', 'give'),
1613
+		'COM'  => __('Comilla', 'give'),
1614
+		'COX'  => __("Cox's Bazar", 'give'),
1615
+		'DHA'  => __('Dhaka', 'give'),
1616
+		'DIN'  => __('Dinajpur', 'give'),
1617
+		'FAR'  => __('Faridpur ', 'give'),
1618
+		'FEN'  => __('Feni', 'give'),
1619
+		'GAI'  => __('Gaibandha', 'give'),
1620
+		'GAZI' => __('Gazipur', 'give'),
1621
+		'GOP'  => __('Gopalganj', 'give'),
1622
+		'HAB'  => __('Habiganj', 'give'),
1623
+		'JAM'  => __('Jamalpur', 'give'),
1624
+		'JES'  => __('Jessore', 'give'),
1625
+		'JHA'  => __('Jhalokati', 'give'),
1626
+		'JHE'  => __('Jhenaidah', 'give'),
1627
+		'JOY'  => __('Joypurhat', 'give'),
1628
+		'KHA'  => __('Khagrachhari', 'give'),
1629
+		'KHU'  => __('Khulna', 'give'),
1630
+		'KIS'  => __('Kishoreganj', 'give'),
1631
+		'KUR'  => __('Kurigram', 'give'),
1632
+		'KUS'  => __('Kushtia', 'give'),
1633
+		'LAK'  => __('Lakshmipur', 'give'),
1634
+		'LAL'  => __('Lalmonirhat', 'give'),
1635
+		'MAD'  => __('Madaripur', 'give'),
1636
+		'MAG'  => __('Magura', 'give'),
1637
+		'MAN'  => __('Manikganj ', 'give'),
1638
+		'MEH'  => __('Meherpur', 'give'),
1639
+		'MOU'  => __('Moulvibazar', 'give'),
1640
+		'MUN'  => __('Munshiganj', 'give'),
1641
+		'MYM'  => __('Mymensingh', 'give'),
1642
+		'NAO'  => __('Naogaon', 'give'),
1643
+		'NAR'  => __('Narail', 'give'),
1644
+		'NARG' => __('Narayanganj', 'give'),
1645
+		'NARD' => __('Narsingdi', 'give'),
1646
+		'NAT'  => __('Natore', 'give'),
1647
+		'NAW'  => __('Nawabganj', 'give'),
1648
+		'NET'  => __('Netrakona', 'give'),
1649
+		'NIL'  => __('Nilphamari', 'give'),
1650
+		'NOA'  => __('Noakhali', 'give'),
1651
+		'PAB'  => __('Pabna', 'give'),
1652
+		'PAN'  => __('Panchagarh', 'give'),
1653
+		'PAT'  => __('Patuakhali', 'give'),
1654
+		'PIR'  => __('Pirojpur', 'give'),
1655
+		'RAJB' => __('Rajbari', 'give'),
1656
+		'RAJ'  => __('Rajshahi', 'give'),
1657
+		'RAN'  => __('Rangamati', 'give'),
1658
+		'RANP' => __('Rangpur', 'give'),
1659
+		'SAT'  => __('Satkhira', 'give'),
1660
+		'SHA'  => __('Shariatpur', 'give'),
1661
+		'SHE'  => __('Sherpur', 'give'),
1662
+		'SIR'  => __('Sirajganj', 'give'),
1663
+		'SUN'  => __('Sunamganj', 'give'),
1664
+		'SYL'  => __('Sylhet', 'give'),
1665
+		'TAN'  => __('Tangail', 'give'),
1666
+		'THA'  => __('Thakurgaon', 'give'),
1667 1667
 	);
1668 1668
 
1669
-	return apply_filters( 'give_bangladeshi_states', $states );
1669
+	return apply_filters('give_bangladeshi_states', $states);
1670 1670
 }
1671 1671
 
1672 1672
 /**
@@ -1678,33 +1678,33 @@  discard block
 block discarded – undo
1678 1678
 function give_get_argentina_states_list() {
1679 1679
 	$states = array(
1680 1680
 		''  => '',
1681
-		'C' => __( 'Ciudad Autónoma de Buenos Aires', 'give' ),
1682
-		'B' => __( 'Buenos Aires', 'give' ),
1683
-		'K' => __( 'Catamarca', 'give' ),
1684
-		'H' => __( 'Chaco', 'give' ),
1685
-		'U' => __( 'Chubut', 'give' ),
1686
-		'X' => __( 'Córdoba', 'give' ),
1687
-		'W' => __( 'Corrientes', 'give' ),
1688
-		'E' => __( 'Entre Ríos', 'give' ),
1689
-		'P' => __( 'Formosa', 'give' ),
1690
-		'Y' => __( 'Jujuy', 'give' ),
1691
-		'L' => __( 'La Pampa', 'give' ),
1692
-		'F' => __( 'La Rioja', 'give' ),
1693
-		'M' => __( 'Mendoza', 'give' ),
1694
-		'N' => __( 'Misiones', 'give' ),
1695
-		'Q' => __( 'Neuquén', 'give' ),
1696
-		'R' => __( 'Río Negro', 'give' ),
1697
-		'A' => __( 'Salta', 'give' ),
1698
-		'J' => __( 'San Juan', 'give' ),
1699
-		'D' => __( 'San Luis', 'give' ),
1700
-		'Z' => __( 'Santa Cruz', 'give' ),
1701
-		'S' => __( 'Santa Fe', 'give' ),
1702
-		'G' => __( 'Santiago del Estero', 'give' ),
1703
-		'V' => __( 'Tierra del Fuego', 'give' ),
1704
-		'T' => __( 'Tucumán', 'give' ),
1681
+		'C' => __('Ciudad Autónoma de Buenos Aires', 'give'),
1682
+		'B' => __('Buenos Aires', 'give'),
1683
+		'K' => __('Catamarca', 'give'),
1684
+		'H' => __('Chaco', 'give'),
1685
+		'U' => __('Chubut', 'give'),
1686
+		'X' => __('Córdoba', 'give'),
1687
+		'W' => __('Corrientes', 'give'),
1688
+		'E' => __('Entre Ríos', 'give'),
1689
+		'P' => __('Formosa', 'give'),
1690
+		'Y' => __('Jujuy', 'give'),
1691
+		'L' => __('La Pampa', 'give'),
1692
+		'F' => __('La Rioja', 'give'),
1693
+		'M' => __('Mendoza', 'give'),
1694
+		'N' => __('Misiones', 'give'),
1695
+		'Q' => __('Neuquén', 'give'),
1696
+		'R' => __('Río Negro', 'give'),
1697
+		'A' => __('Salta', 'give'),
1698
+		'J' => __('San Juan', 'give'),
1699
+		'D' => __('San Luis', 'give'),
1700
+		'Z' => __('Santa Cruz', 'give'),
1701
+		'S' => __('Santa Fe', 'give'),
1702
+		'G' => __('Santiago del Estero', 'give'),
1703
+		'V' => __('Tierra del Fuego', 'give'),
1704
+		'T' => __('Tucumán', 'give'),
1705 1705
 	);
1706 1706
 
1707
-	return apply_filters( 'give_argentina_states', $states );
1707
+	return apply_filters('give_argentina_states', $states);
1708 1708
 }
1709 1709
 
1710 1710
 /**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
 		'AP' => 'Armed Forces - Pacific',
1786 1786
 	);
1787 1787
 
1788
-	return apply_filters( 'give_us_states', $states );
1788
+	return apply_filters('give_us_states', $states);
1789 1789
 }
1790 1790
 
1791 1791
 /**
@@ -1798,22 +1798,22 @@  discard block
 block discarded – undo
1798 1798
 function give_get_provinces_list() {
1799 1799
 	$provinces = array(
1800 1800
 		''   => '',
1801
-		'AB' => esc_html__( 'Alberta', 'give' ),
1802
-		'BC' => esc_html__( 'British Columbia', 'give' ),
1803
-		'MB' => esc_html__( 'Manitoba', 'give' ),
1804
-		'NB' => esc_html__( 'New Brunswick', 'give' ),
1805
-		'NL' => esc_html__( 'Newfoundland and Labrador', 'give' ),
1806
-		'NS' => esc_html__( 'Nova Scotia', 'give' ),
1807
-		'NT' => esc_html__( 'Northwest Territories', 'give' ),
1808
-		'NU' => esc_html__( 'Nunavut', 'give' ),
1809
-		'ON' => esc_html__( 'Ontario', 'give' ),
1810
-		'PE' => esc_html__( 'Prince Edward Island', 'give' ),
1811
-		'QC' => esc_html__( 'Quebec', 'give' ),
1812
-		'SK' => esc_html__( 'Saskatchewan', 'give' ),
1813
-		'YT' => esc_html__( 'Yukon', 'give' ),
1801
+		'AB' => esc_html__('Alberta', 'give'),
1802
+		'BC' => esc_html__('British Columbia', 'give'),
1803
+		'MB' => esc_html__('Manitoba', 'give'),
1804
+		'NB' => esc_html__('New Brunswick', 'give'),
1805
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
1806
+		'NS' => esc_html__('Nova Scotia', 'give'),
1807
+		'NT' => esc_html__('Northwest Territories', 'give'),
1808
+		'NU' => esc_html__('Nunavut', 'give'),
1809
+		'ON' => esc_html__('Ontario', 'give'),
1810
+		'PE' => esc_html__('Prince Edward Island', 'give'),
1811
+		'QC' => esc_html__('Quebec', 'give'),
1812
+		'SK' => esc_html__('Saskatchewan', 'give'),
1813
+		'YT' => esc_html__('Yukon', 'give'),
1814 1814
 	);
1815 1815
 
1816
-	return apply_filters( 'give_canada_provinces', $provinces );
1816
+	return apply_filters('give_canada_provinces', $provinces);
1817 1817
 }
1818 1818
 
1819 1819
 /**
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
 		'WA'  => 'Western Australia',
1836 1836
 	);
1837 1837
 
1838
-	return apply_filters( 'give_australian_states', $states );
1838
+	return apply_filters('give_australian_states', $states);
1839 1839
 }
1840 1840
 
1841 1841
 /**
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
 		'TO' => 'Tocantins',
1877 1877
 	);
1878 1878
 
1879
-	return apply_filters( 'give_brazil_states', $states );
1879
+	return apply_filters('give_brazil_states', $states);
1880 1880
 }
1881 1881
 
1882 1882
 /**
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 		'NEW TERRITORIES' => 'New Territories',
1894 1894
 	);
1895 1895
 
1896
-	return apply_filters( 'give_hong_kong_states', $states );
1896
+	return apply_filters('give_hong_kong_states', $states);
1897 1897
 }
1898 1898
 
1899 1899
 /**
@@ -1927,7 +1927,7 @@  discard block
 block discarded – undo
1927 1927
 		'ZA' => 'Zala',
1928 1928
 	);
1929 1929
 
1930
-	return apply_filters( 'give_hungary_states', $states );
1930
+	return apply_filters('give_hungary_states', $states);
1931 1931
 }
1932 1932
 
1933 1933
 /**
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 		'CN32' => 'Xinjiang / 新疆',
1974 1974
 	);
1975 1975
 
1976
-	return apply_filters( 'give_chinese_states', $states );
1976
+	return apply_filters('give_chinese_states', $states);
1977 1977
 }
1978 1978
 
1979 1979
 /**
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 		'WC' => 'West Coast',
2003 2003
 	);
2004 2004
 
2005
-	return apply_filters( 'give_new_zealand_states', $states );
2005
+	return apply_filters('give_new_zealand_states', $states);
2006 2006
 }
2007 2007
 
2008 2008
 /**
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 		'PB' => 'Papua Barat',
2051 2051
 	);
2052 2052
 
2053
-	return apply_filters( 'give_indonesia_states', $states );
2053
+	return apply_filters('give_indonesia_states', $states);
2054 2054
 }
2055 2055
 
2056 2056
 /**
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
 		'PY' => 'Pondicherry (Puducherry)',
2101 2101
 	);
2102 2102
 
2103
-	return apply_filters( 'give_indian_states', $states );
2103
+	return apply_filters('give_indian_states', $states);
2104 2104
 }
2105 2105
 
2106 2106
 /**
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 		'PJY' => 'W.P. Putrajaya',
2131 2131
 	);
2132 2132
 
2133
-	return apply_filters( 'give_malaysian_states', $states );
2133
+	return apply_filters('give_malaysian_states', $states);
2134 2134
 }
2135 2135
 
2136 2136
 /**
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
 		'WC'  => 'Western Cape',
2154 2154
 	);
2155 2155
 
2156
-	return apply_filters( 'give_south_african_states', $states );
2156
+	return apply_filters('give_south_african_states', $states);
2157 2157
 }
2158 2158
 
2159 2159
 /**
@@ -2244,7 +2244,7 @@  discard block
 block discarded – undo
2244 2244
 		'TH-35' => 'Yasothon (ยโสธร)',
2245 2245
 	);
2246 2246
 
2247
-	return apply_filters( 'give_thailand_states', $states );
2247
+	return apply_filters('give_thailand_states', $states);
2248 2248
 }
2249 2249
 
2250 2250
 /**
@@ -2256,59 +2256,59 @@  discard block
 block discarded – undo
2256 2256
 function give_get_spain_states_list() {
2257 2257
 	$states = array(
2258 2258
 		''   => '',
2259
-		'C'  => esc_html__( 'A Coruña', 'give' ),
2260
-		'VI' => esc_html__( 'Álava', 'give' ),
2261
-		'AB' => esc_html__( 'Albacete', 'give' ),
2262
-		'A'  => esc_html__( 'Alicante', 'give' ),
2263
-		'AL' => esc_html__( 'Almería', 'give' ),
2264
-		'O'  => esc_html__( 'Asturias', 'give' ),
2265
-		'AV' => esc_html__( 'Ávila', 'give' ),
2266
-		'BA' => esc_html__( 'Badajoz', 'give' ),
2267
-		'PM' => esc_html__( 'Baleares', 'give' ),
2268
-		'B'  => esc_html__( 'Barcelona', 'give' ),
2269
-		'BU' => esc_html__( 'Burgos', 'give' ),
2270
-		'CC' => esc_html__( 'Cáceres', 'give' ),
2271
-		'CA' => esc_html__( 'Cádiz', 'give' ),
2272
-		'S'  => esc_html__( 'Cantabria', 'give' ),
2273
-		'CS' => esc_html__( 'Castellón', 'give' ),
2274
-		'CE' => esc_html__( 'Ceuta', 'give' ),
2275
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
2276
-		'CO' => esc_html__( 'Córdoba', 'give' ),
2277
-		'CU' => esc_html__( 'Cuenca', 'give' ),
2278
-		'GI' => esc_html__( 'Girona', 'give' ),
2279
-		'GR' => esc_html__( 'Granada', 'give' ),
2280
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
2281
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
2282
-		'H'  => esc_html__( 'Huelva', 'give' ),
2283
-		'HU' => esc_html__( 'Huesca', 'give' ),
2284
-		'J'  => esc_html__( 'Jaén', 'give' ),
2285
-		'LO' => esc_html__( 'La Rioja', 'give' ),
2286
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
2287
-		'LE' => esc_html__( 'León', 'give' ),
2288
-		'L'  => esc_html__( 'Lleida', 'give' ),
2289
-		'LU' => esc_html__( 'Lugo', 'give' ),
2290
-		'M'  => esc_html__( 'Madrid', 'give' ),
2291
-		'MA' => esc_html__( 'Málaga', 'give' ),
2292
-		'ML' => esc_html__( 'Melilla', 'give' ),
2293
-		'MU' => esc_html__( 'Murcia', 'give' ),
2294
-		'NA' => esc_html__( 'Navarra', 'give' ),
2295
-		'OR' => esc_html__( 'Ourense', 'give' ),
2296
-		'P'  => esc_html__( 'Palencia', 'give' ),
2297
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
2298
-		'SA' => esc_html__( 'Salamanca', 'give' ),
2299
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
2300
-		'SG' => esc_html__( 'Segovia', 'give' ),
2301
-		'SE' => esc_html__( 'Sevilla', 'give' ),
2302
-		'SO' => esc_html__( 'Soria', 'give' ),
2303
-		'T'  => esc_html__( 'Tarragona', 'give' ),
2304
-		'TE' => esc_html__( 'Teruel', 'give' ),
2305
-		'TO' => esc_html__( 'Toledo', 'give' ),
2306
-		'V'  => esc_html__( 'Valencia', 'give' ),
2307
-		'VA' => esc_html__( 'Valladolid', 'give' ),
2308
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
2309
-		'ZA' => esc_html__( 'Zamora', 'give' ),
2310
-		'Z'  => esc_html__( 'Zaragoza', 'give' ),
2259
+		'C'  => esc_html__('A Coruña', 'give'),
2260
+		'VI' => esc_html__('Álava', 'give'),
2261
+		'AB' => esc_html__('Albacete', 'give'),
2262
+		'A'  => esc_html__('Alicante', 'give'),
2263
+		'AL' => esc_html__('Almería', 'give'),
2264
+		'O'  => esc_html__('Asturias', 'give'),
2265
+		'AV' => esc_html__('Ávila', 'give'),
2266
+		'BA' => esc_html__('Badajoz', 'give'),
2267
+		'PM' => esc_html__('Baleares', 'give'),
2268
+		'B'  => esc_html__('Barcelona', 'give'),
2269
+		'BU' => esc_html__('Burgos', 'give'),
2270
+		'CC' => esc_html__('Cáceres', 'give'),
2271
+		'CA' => esc_html__('Cádiz', 'give'),
2272
+		'S'  => esc_html__('Cantabria', 'give'),
2273
+		'CS' => esc_html__('Castellón', 'give'),
2274
+		'CE' => esc_html__('Ceuta', 'give'),
2275
+		'CR' => esc_html__('Ciudad Real', 'give'),
2276
+		'CO' => esc_html__('Córdoba', 'give'),
2277
+		'CU' => esc_html__('Cuenca', 'give'),
2278
+		'GI' => esc_html__('Girona', 'give'),
2279
+		'GR' => esc_html__('Granada', 'give'),
2280
+		'GU' => esc_html__('Guadalajara', 'give'),
2281
+		'SS' => esc_html__('Gipuzkoa', 'give'),
2282
+		'H'  => esc_html__('Huelva', 'give'),
2283
+		'HU' => esc_html__('Huesca', 'give'),
2284
+		'J'  => esc_html__('Jaén', 'give'),
2285
+		'LO' => esc_html__('La Rioja', 'give'),
2286
+		'GC' => esc_html__('Las Palmas', 'give'),
2287
+		'LE' => esc_html__('León', 'give'),
2288
+		'L'  => esc_html__('Lleida', 'give'),
2289
+		'LU' => esc_html__('Lugo', 'give'),
2290
+		'M'  => esc_html__('Madrid', 'give'),
2291
+		'MA' => esc_html__('Málaga', 'give'),
2292
+		'ML' => esc_html__('Melilla', 'give'),
2293
+		'MU' => esc_html__('Murcia', 'give'),
2294
+		'NA' => esc_html__('Navarra', 'give'),
2295
+		'OR' => esc_html__('Ourense', 'give'),
2296
+		'P'  => esc_html__('Palencia', 'give'),
2297
+		'PO' => esc_html__('Pontevedra', 'give'),
2298
+		'SA' => esc_html__('Salamanca', 'give'),
2299
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
2300
+		'SG' => esc_html__('Segovia', 'give'),
2301
+		'SE' => esc_html__('Sevilla', 'give'),
2302
+		'SO' => esc_html__('Soria', 'give'),
2303
+		'T'  => esc_html__('Tarragona', 'give'),
2304
+		'TE' => esc_html__('Teruel', 'give'),
2305
+		'TO' => esc_html__('Toledo', 'give'),
2306
+		'V'  => esc_html__('Valencia', 'give'),
2307
+		'VA' => esc_html__('Valladolid', 'give'),
2308
+		'BI' => esc_html__('Bizkaia', 'give'),
2309
+		'ZA' => esc_html__('Zamora', 'give'),
2310
+		'Z'  => esc_html__('Zaragoza', 'give'),
2311 2311
 	);
2312 2312
 
2313
-	return apply_filters( 'give_spain_states', $states );
2313
+	return apply_filters('give_spain_states', $states);
2314 2314
 }
Please login to merge, or discard this patch.
includes/ajax-functions.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed.
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 		} else {
39 39
 
40
-			if ( 'on' === $airplane->check_status()  ) {
40
+			if ('on' === $airplane->check_status()) {
41 41
 				return true;
42 42
 			}
43 43
 		}
44 44
 	}
45 45
 
46
-	add_filter( 'block_local_requests', '__return_false' );
46
+	add_filter('block_local_requests', '__return_false');
47 47
 
48
-	if ( Give_Cache::get( '_give_ajax_works', true ) ) {
48
+	if (Give_Cache::get('_give_ajax_works', true)) {
49 49
 		return true;
50 50
 	}
51 51
 
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
 		),
58 58
 	);
59 59
 
60
-	$ajax = wp_remote_post( give_get_ajax_url(), $params );
60
+	$ajax = wp_remote_post(give_get_ajax_url(), $params);
61 61
 
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 	}
86 86
 
87
-	if ( $works ) {
88
-		Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true );
87
+	if ($works) {
88
+		Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true);
89 89
 	}
90 90
 
91 91
 	return $works;
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
  * @return string
101 101
  */
102 102
 function give_get_ajax_url() {
103
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
103
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
104 104
 
105 105
 	$current_url = give_get_current_page_url();
106
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
106
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
107 107
 
108
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
109
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
108
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
109
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
110 110
 	}
111 111
 
112
-	return apply_filters( 'give_ajax_url', $ajax_url );
112
+	return apply_filters('give_ajax_url', $ajax_url);
113 113
 }
114 114
 
115 115
 /**
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.7
127 127
 	 */
128
-	do_action( 'give_donation_form_login_fields' );
128
+	do_action('give_donation_form_login_fields');
129 129
 
130 130
 	give_die();
131 131
 }
132 132
 
133
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
133
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
134 134
 
135 135
 /**
136 136
  * Load Checkout Fields
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * @return void
141 141
  */
142 142
 function give_load_checkout_fields() {
143
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
143
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
144 144
 
145 145
 	ob_start();
146 146
 
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @since 1.7
151 151
 	 */
152
-	do_action( 'give_donation_form_register_login_fields', $form_id );
152
+	do_action('give_donation_form_register_login_fields', $form_id);
153 153
 
154 154
 	$fields = ob_get_clean();
155 155
 
156
-	wp_send_json( array(
157
-		'fields' => wp_json_encode( $fields ),
158
-		'submit' => wp_json_encode( give_get_donation_form_submit_button( $form_id ) ),
159
-	) );
156
+	wp_send_json(array(
157
+		'fields' => wp_json_encode($fields),
158
+		'submit' => wp_json_encode(give_get_donation_form_submit_button($form_id)),
159
+	));
160 160
 }
161 161
 
162
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
163
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
162
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
163
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
164 164
 
165 165
 /**
166 166
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
  * @return void
171 171
  */
172 172
 function give_ajax_get_form_title() {
173
-	if ( isset( $_POST['form_id'] ) ) {
174
-		$title = get_the_title( $_POST['form_id'] );
175
-		if ( $title ) {
173
+	if (isset($_POST['form_id'])) {
174
+		$title = get_the_title($_POST['form_id']);
175
+		if ($title) {
176 176
 			echo $title;
177 177
 		} else {
178 178
 			echo 'fail';
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	give_die();
182 182
 }
183 183
 
184
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
185
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
184
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
185
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
186 186
 
187 187
 /**
188 188
  * Retrieve a states drop down
@@ -196,41 +196,41 @@  discard block
 block discarded – undo
196 196
 	$show_field = true;
197 197
 	$states_require = true;
198 198
 	// Get the Country code from the $_POST.
199
-	$country = sanitize_text_field( $_POST['country'] );
199
+	$country = sanitize_text_field($_POST['country']);
200 200
 
201 201
 	// Get the field name from the $_POST.
202
-	$field_name = sanitize_text_field( $_POST['field_name'] );
202
+	$field_name = sanitize_text_field($_POST['field_name']);
203 203
 
204
-	$label = __( 'State', 'give' );
204
+	$label = __('State', 'give');
205 205
 	$states_label = give_get_states_label();
206 206
 
207 207
 	$default_state = '';
208
-	if ( $country === give_get_country() ) {
208
+	if ($country === give_get_country()) {
209 209
 		$default_state = give_get_state();
210 210
 	}
211 211
 
212 212
 	// Check if $country code exists in the array key for states label.
213
-	if ( array_key_exists( $country, $states_label ) ) {
214
-		$label = $states_label[ $country ];
213
+	if (array_key_exists($country, $states_label)) {
214
+		$label = $states_label[$country];
215 215
 	}
216 216
 
217
-	if ( empty( $country ) ) {
217
+	if (empty($country)) {
218 218
 		$country = give_get_country();
219 219
 	}
220 220
 
221
-	$states = give_get_states( $country );
222
-	if ( ! empty( $states ) ) {
221
+	$states = give_get_states($country);
222
+	if ( ! empty($states)) {
223 223
 		$args = array(
224 224
 			'name'             => $field_name,
225 225
 			'id'               => $field_name,
226
-			'class'            => $field_name . '  give-select',
226
+			'class'            => $field_name.'  give-select',
227 227
 			'options'          => $states,
228 228
 			'show_option_all'  => false,
229 229
 			'show_option_none' => false,
230 230
 			'placeholder'      => $label,
231 231
 			'selected'         => $default_state,
232 232
 		);
233
-		$data = Give()->html->select( $args );
233
+		$data = Give()->html->select($args);
234 234
 		$states_found = true;
235 235
 	} else {
236 236
 		$data = 'nostates';
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$no_states_country = give_no_states_country_list();
240 240
 
241 241
 		// Check if $country code exists in the array key.
242
-		if ( array_key_exists( $country, $no_states_country ) ) {
242
+		if (array_key_exists($country, $no_states_country)) {
243 243
 			$show_field = false;
244 244
 		}
245 245
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$states_not_required_country_list = give_states_not_required_country_list();
248 248
 
249 249
 		// Check if $country code exists in the array key.
250
-		if ( array_key_exists( $country, $states_not_required_country_list ) ) {
250
+		if (array_key_exists($country, $states_not_required_country_list)) {
251 251
 			$states_require = false;
252 252
 		}
253 253
 	}
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 		'data'           => $data,
261 261
 		'default_state'  => $default_state,
262 262
 	);
263
-	wp_send_json( $response );
263
+	wp_send_json($response);
264 264
 }
265
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
266
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
265
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
266
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
267 267
 
268 268
 /**
269 269
  * Retrieve donation forms via AJAX for chosen dropdown search field.
@@ -275,19 +275,19 @@  discard block
 block discarded – undo
275 275
 function give_ajax_form_search() {
276 276
 	global $wpdb;
277 277
 
278
-	$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
279
-	$excludes = ( isset( $_GET['current_id'] ) ? (array) $_GET['current_id'] : array() );
278
+	$search   = esc_sql(sanitize_text_field($_GET['s']));
279
+	$excludes = (isset($_GET['current_id']) ? (array) $_GET['current_id'] : array());
280 280
 
281 281
 	$results = array();
282
-	if ( current_user_can( 'edit_give_forms' ) ) {
283
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
282
+	if (current_user_can('edit_give_forms')) {
283
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
284 284
 	} else {
285
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
285
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
286 286
 	}
287 287
 
288
-	if ( $items ) {
288
+	if ($items) {
289 289
 
290
-		foreach ( $items as $item ) {
290
+		foreach ($items as $item) {
291 291
 
292 292
 			$results[] = array(
293 293
 				'id'   => $item->ID,
@@ -298,18 +298,18 @@  discard block
 block discarded – undo
298 298
 
299 299
 		$items[] = array(
300 300
 			'id'   => 0,
301
-			'name' => __( 'No forms found.', 'give' ),
301
+			'name' => __('No forms found.', 'give'),
302 302
 		);
303 303
 
304 304
 	}
305 305
 
306
-	echo json_encode( $results );
306
+	echo json_encode($results);
307 307
 
308 308
 	give_die();
309 309
 }
310 310
 
311
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
312
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
311
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
312
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
313 313
 
314 314
 /**
315 315
  * Search the donors database via Ajax
@@ -321,38 +321,38 @@  discard block
 block discarded – undo
321 321
 function give_ajax_donor_search() {
322 322
 	global $wpdb;
323 323
 
324
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
324
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
325 325
 	$results = array();
326
-	if ( ! current_user_can( 'view_give_reports' ) ) {
326
+	if ( ! current_user_can('view_give_reports')) {
327 327
 		$donors = array();
328 328
 	} else {
329
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
329
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_customers WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
330 330
 	}
331 331
 
332
-	if ( $donors ) {
332
+	if ($donors) {
333 333
 
334
-		foreach ( $donors as $donor ) {
334
+		foreach ($donors as $donor) {
335 335
 
336 336
 			$results[] = array(
337 337
 				'id'   => $donor->id,
338
-				'name' => $donor->name . ' (' . $donor->email . ')',
338
+				'name' => $donor->name.' ('.$donor->email.')',
339 339
 			);
340 340
 		}
341 341
 	} else {
342 342
 
343 343
 		$donors[] = array(
344 344
 			'id'   => 0,
345
-			'name' => __( 'No donors found.', 'give' ),
345
+			'name' => __('No donors found.', 'give'),
346 346
 		);
347 347
 
348 348
 	}
349 349
 
350
-	echo json_encode( $results );
350
+	echo json_encode($results);
351 351
 
352 352
 	give_die();
353 353
 }
354 354
 
355
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
355
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
356 356
 
357 357
 
358 358
 /**
@@ -364,39 +364,39 @@  discard block
 block discarded – undo
364 364
  */
365 365
 function give_ajax_search_users() {
366 366
 
367
-	if ( current_user_can( 'manage_give_settings' ) ) {
367
+	if (current_user_can('manage_give_settings')) {
368 368
 
369
-		$search   = esc_sql( sanitize_text_field( $_GET['s'] ) );
369
+		$search = esc_sql(sanitize_text_field($_GET['s']));
370 370
 
371 371
 		$get_users_args = array(
372 372
 			'number' => 9999,
373
-			'search' => $search . '*',
373
+			'search' => $search.'*',
374 374
 		);
375 375
 
376
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
376
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
377 377
 
378
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search );
378
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search);
379 379
 		$results     = array();
380 380
 
381
-		if ( $found_users ) {
381
+		if ($found_users) {
382 382
 
383
-			foreach ( $found_users as $user ) {
383
+			foreach ($found_users as $user) {
384 384
 
385 385
 				$results[] = array(
386 386
 					'id'   => $user->ID,
387
-					'name' => esc_html( $user->user_login . ' (' . $user->user_email . ')' ),
387
+					'name' => esc_html($user->user_login.' ('.$user->user_email.')'),
388 388
 				);
389 389
 			}
390 390
 		} else {
391 391
 
392 392
 			$results[] = array(
393 393
 				'id'   => 0,
394
-				'name' => __( 'No users found.', 'give' ),
394
+				'name' => __('No users found.', 'give'),
395 395
 			);
396 396
 
397 397
 		}
398 398
 
399
-		echo json_encode( $results );
399
+		echo json_encode($results);
400 400
 
401 401
 	}// End if().
402 402
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 
405 405
 }
406 406
 
407
-add_action( 'wp_ajax_give_user_search', 'give_ajax_search_users' );
407
+add_action('wp_ajax_give_user_search', 'give_ajax_search_users');
408 408
 
409 409
 
410 410
 /**
@@ -416,32 +416,32 @@  discard block
 block discarded – undo
416 416
  */
417 417
 function give_check_for_form_price_variations() {
418 418
 
419
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
420
-		die( '-1' );
419
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
420
+		die('-1');
421 421
 	}
422 422
 
423
-	$form_id = intval( $_POST['form_id'] );
424
-	$form    = get_post( $form_id );
423
+	$form_id = intval($_POST['form_id']);
424
+	$form    = get_post($form_id);
425 425
 
426
-	if ( 'give_forms' != $form->post_type ) {
427
-		die( '-2' );
426
+	if ('give_forms' != $form->post_type) {
427
+		die('-2');
428 428
 	}
429 429
 
430
-	if ( give_has_variable_prices( $form_id ) ) {
431
-		$variable_prices = give_get_variable_prices( $form_id );
430
+	if (give_has_variable_prices($form_id)) {
431
+		$variable_prices = give_get_variable_prices($form_id);
432 432
 
433
-		if ( $variable_prices ) {
433
+		if ($variable_prices) {
434 434
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
435 435
 
436
-			if ( isset( $_POST['all_prices'] ) ) {
437
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
436
+			if (isset($_POST['all_prices'])) {
437
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
438 438
 			}
439 439
 
440
-			foreach ( $variable_prices as $key => $price ) {
440
+			foreach ($variable_prices as $key => $price) {
441 441
 
442
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'], array( 'sanitize' => false ) ) );
442
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount'], array('sanitize' => false)));
443 443
 
444
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
444
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
445 445
 			}
446 446
 			$ajax_response .= '</select>';
447 447
 			echo $ajax_response;
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	give_die();
452 452
 }
453 453
 
454
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
454
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
455 455
 
456 456
 
457 457
 /**
@@ -462,25 +462,25 @@  discard block
 block discarded – undo
462 462
  * @return void
463 463
  */
464 464
 function give_check_for_form_price_variations_html() {
465
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
465
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
466 466
 		wp_die();
467 467
 	}
468 468
 
469
-	$form_id    = ! empty( $_POST['form_id'] ) ? intval( $_POST['form_id'] ) : 0;
470
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0;
471
-	$form       = get_post( $form_id );
469
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0;
470
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0;
471
+	$form       = get_post($form_id);
472 472
 
473
-	if ( 'give_forms' != $form->post_type ) {
473
+	if ('give_forms' != $form->post_type) {
474 474
 		wp_die();
475 475
 	}
476 476
 
477
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
478
-		esc_html_e( 'n/a', 'give' );
477
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
478
+		esc_html_e('n/a', 'give');
479 479
 	} else {
480 480
 		$prices_atts = '';
481
-		if ( $variable_prices = give_get_variable_prices( $form_id ) ) {
482
-			foreach ( $variable_prices as $variable_price ) {
483
-				$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
481
+		if ($variable_prices = give_get_variable_prices($form_id)) {
482
+			foreach ($variable_prices as $variable_price) {
483
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
484 484
 			}
485 485
 		}
486 486
 
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
 			'chosen'           => true,
492 492
 			'show_option_all'  => '',
493 493
 			'show_option_none' => '',
494
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
494
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
495 495
 		);
496 496
 
497
-		if ( $payment_id ) {
497
+		if ($payment_id) {
498 498
 			// Payment object.
499
-			$payment = new Give_Payment( $payment_id );
499
+			$payment = new Give_Payment($payment_id);
500 500
 
501 501
 			// Payment meta.
502 502
 			$payment_meta                               = $payment->get_meta();
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
 		}
505 505
 
506 506
 		// Render variable prices select tag html.
507
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
507
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
508 508
 	}
509 509
 
510 510
 	give_die();
511 511
 }
512 512
 
513
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
513
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.
includes/admin/admin-pages.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
 	global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_donors_page, $give_tools_page;
33 33
 
34 34
 	//Payments
35
-	$give_payment       = get_post_type_object( 'give_payment' );
36
-	$give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' );
35
+	$give_payment       = get_post_type_object('give_payment');
36
+	$give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page');
37 37
 
38 38
 	//Donors
39
-	$give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_donors_page' );
39
+	$give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_donors_page');
40 40
 
41 41
 	//Reports`
42 42
 	$give_reports_page = add_submenu_page(
43 43
 		'edit.php?post_type=give_forms',
44
-		esc_html__( 'Donation Reports', 'give' ),
45
-		esc_html__( 'Reports', 'give' ),
44
+		esc_html__('Donation Reports', 'give'),
45
+		esc_html__('Reports', 'give'),
46 46
 		'view_give_reports',
47 47
 		'give-reports',
48 48
 		array(
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	//Settings
55 55
 	$give_settings_page = add_submenu_page(
56 56
 		'edit.php?post_type=give_forms',
57
-		esc_html__( 'Give Settings', 'give' ),
58
-		esc_html__( 'Settings', 'give' ),
57
+		esc_html__('Give Settings', 'give'),
58
+		esc_html__('Settings', 'give'),
59 59
 		'manage_give_settings',
60 60
 		'give-settings',
61 61
 		array(
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 	);
66 66
 
67 67
 	//Tools.
68
-	$give_tools_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Tools', 'give' ), esc_html__( 'Tools', 'give' ), 'manage_give_settings', 'give-tools', array(
68
+	$give_tools_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Tools', 'give'), esc_html__('Tools', 'give'), 'manage_give_settings', 'give-tools', array(
69 69
 		Give()->give_settings,
70 70
 		'output'
71
-	) );
71
+	));
72 72
 
73 73
 	//Add-ons
74
-	$give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' );
74
+	$give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page');
75 75
 }
76 76
 
77
-add_action( 'admin_menu', 'give_add_options_links', 10 );
77
+add_action('admin_menu', 'give_add_options_links', 10);
78 78
 
79 79
 /**
80 80
  *  Determines whether the current admin page is a Give admin page.
@@ -89,224 +89,224 @@  discard block
 block discarded – undo
89 89
  *
90 90
  * @return bool True if Give admin page.
91 91
  */
92
-function give_is_admin_page( $passed_page = '', $passed_view = '' ) {
92
+function give_is_admin_page($passed_page = '', $passed_view = '') {
93 93
 
94 94
 	global $pagenow, $typenow;
95 95
 
96 96
 	$found     = false;
97
-	$post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false;
98
-	$action    = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false;
99
-	$taxonomy  = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false;
100
-	$page      = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false;
101
-	$view      = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false;
102
-	$tab       = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false;
103
-
104
-	switch ( $passed_page ) {
97
+	$post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false;
98
+	$action    = isset($_GET['action']) ? strtolower($_GET['action']) : false;
99
+	$taxonomy  = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false;
100
+	$page      = isset($_GET['page']) ? strtolower($_GET['page']) : false;
101
+	$view      = isset($_GET['view']) ? strtolower($_GET['view']) : false;
102
+	$tab       = isset($_GET['tab']) ? strtolower($_GET['tab']) : false;
103
+
104
+	switch ($passed_page) {
105 105
 		case 'give_forms':
106
-			switch ( $passed_view ) {
106
+			switch ($passed_view) {
107 107
 				case 'list-table':
108
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) {
108
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') {
109 109
 						$found = true;
110 110
 					}
111 111
 					break;
112 112
 				case 'edit':
113
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) {
113
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') {
114 114
 						$found = true;
115 115
 					}
116 116
 					break;
117 117
 				case 'new':
118
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) {
118
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') {
119 119
 						$found = true;
120 120
 					}
121 121
 					break;
122 122
 				default:
123
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) {
123
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) {
124 124
 						$found = true;
125 125
 					}
126 126
 					break;
127 127
 			}
128 128
 			break;
129 129
 		case 'categories':
130
-			switch ( $passed_view ) {
130
+			switch ($passed_view) {
131 131
 				case 'list-table':
132 132
 				case 'new':
133
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) {
133
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) {
134 134
 						$found = true;
135 135
 					}
136 136
 					break;
137 137
 				case 'edit':
138
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) {
138
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) {
139 139
 						$found = true;
140 140
 					}
141 141
 					break;
142 142
 				default:
143
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) {
143
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) {
144 144
 						$found = true;
145 145
 					}
146 146
 					break;
147 147
 			}
148 148
 			break;
149 149
 		case 'tags':
150
-			switch ( $passed_view ) {
150
+			switch ($passed_view) {
151 151
 				case 'list-table':
152 152
 				case 'new':
153
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) {
153
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) {
154 154
 						$found = true;
155 155
 					}
156 156
 					break;
157 157
 				case 'edit':
158
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) {
158
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) {
159 159
 						$found = true;
160 160
 					}
161 161
 					break;
162 162
 				default:
163
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) {
163
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) {
164 164
 						$found = true;
165 165
 					}
166 166
 					break;
167 167
 			}
168 168
 			break;
169 169
 		case 'payments':
170
-			switch ( $passed_view ) {
170
+			switch ($passed_view) {
171 171
 				case 'list-table':
172
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) {
172
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) {
173 173
 						$found = true;
174 174
 					}
175 175
 					break;
176 176
 				case 'edit':
177
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-payment-details' === $view ) {
177
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-payment-details' === $view) {
178 178
 						$found = true;
179 179
 					}
180 180
 					break;
181 181
 				default:
182
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) {
182
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) {
183 183
 						$found = true;
184 184
 					}
185 185
 					break;
186 186
 			}
187 187
 			break;
188 188
 		case 'reports':
189
-			switch ( $passed_view ) {
189
+			switch ($passed_view) {
190 190
 				// If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ]
191 191
 				case 'earnings':
192
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) {
192
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) {
193 193
 						$found = true;
194 194
 					}
195 195
 					break;
196 196
 				case 'donors':
197
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) {
197
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) {
198 198
 						$found = true;
199 199
 					}
200 200
 					break;
201 201
 				case 'gateways':
202
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) {
202
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) {
203 203
 						$found = true;
204 204
 					}
205 205
 					break;
206 206
 				case 'export':
207
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) {
207
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) {
208 208
 						$found = true;
209 209
 					}
210 210
 					break;
211 211
 				case 'logs':
212
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) {
212
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) {
213 213
 						$found = true;
214 214
 					}
215 215
 					break;
216 216
 				default:
217
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
217
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
218 218
 						$found = true;
219 219
 					}
220 220
 					break;
221 221
 			}
222 222
 			break;
223 223
 		case 'settings':
224
-			switch ( $passed_view ) {
224
+			switch ($passed_view) {
225 225
 				case 'general':
226
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) {
226
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) {
227 227
 						$found = true;
228 228
 					}
229 229
 					break;
230 230
 				case 'gateways':
231
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) {
231
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) {
232 232
 						$found = true;
233 233
 					}
234 234
 					break;
235 235
 				case 'emails':
236
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) {
236
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) {
237 237
 						$found = true;
238 238
 					}
239 239
 					break;
240 240
 				case 'display':
241
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) {
241
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) {
242 242
 						$found = true;
243 243
 					}
244 244
 					break;
245 245
 				case 'licenses':
246
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) {
246
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) {
247 247
 						$found = true;
248 248
 					}
249 249
 					break;
250 250
 				case 'api':
251
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) {
251
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) {
252 252
 						$found = true;
253 253
 					}
254 254
 					break;
255 255
 				case 'advanced':
256
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) {
256
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) {
257 257
 						$found = true;
258 258
 					}
259 259
 					break;
260 260
 				case 'system_info':
261
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) {
261
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) {
262 262
 						$found = true;
263 263
 					}
264 264
 					break;
265 265
 				default:
266
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) {
266
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) {
267 267
 						$found = true;
268 268
 					}
269 269
 					break;
270 270
 			}
271 271
 			break;
272 272
 		case 'addons':
273
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) {
273
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) {
274 274
 				$found = true;
275 275
 			}
276 276
 			break;
277 277
 		case 'donors':
278
-			switch ( $passed_view ) {
278
+			switch ($passed_view) {
279 279
 				case 'list-table':
280
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) {
280
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) {
281 281
 						$found = true;
282 282
 					}
283 283
 					break;
284 284
 				case 'overview':
285
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) {
285
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) {
286 286
 						$found = true;
287 287
 					}
288 288
 					break;
289 289
 				case 'notes':
290
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) {
290
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) {
291 291
 						$found = true;
292 292
 					}
293 293
 					break;
294 294
 				default:
295
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) {
295
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) {
296 296
 						$found = true;
297 297
 					}
298 298
 					break;
299 299
 			}
300 300
 			break;
301 301
 		case 'reports':
302
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
302
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
303 303
 				$found = true;
304 304
 			}
305 305
 			break;
306 306
 		default:
307 307
 			global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_donors_page, $give_tools_page;
308 308
 
309
-			$admin_pages = apply_filters( 'give_admin_pages', array(
309
+			$admin_pages = apply_filters('give_admin_pages', array(
310 310
 				$give_payments_page,
311 311
 				$give_settings_page,
312 312
 				$give_reports_page,
@@ -316,16 +316,16 @@  discard block
 block discarded – undo
316 316
 				$give_donors_page,
317 317
 				$give_tools_page,
318 318
 				'widgets.php'
319
-		) );
320
-			if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) {
319
+		));
320
+			if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) {
321 321
 				$found = true;
322
-			} elseif ( in_array( $pagenow, $admin_pages ) ) {
322
+			} elseif (in_array($pagenow, $admin_pages)) {
323 323
 				$found = true;
324 324
 			}
325 325
 			break;
326 326
 	}
327 327
 
328
-	return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view );
328
+	return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view);
329 329
 
330 330
 }
331 331
 
@@ -337,37 +337,37 @@  discard block
 block discarded – undo
337 337
  * @param  array $settings
338 338
  * @return array
339 339
  */
340
-function give_settings_page_pages( $settings ) {
341
-	include( 'abstract-admin-settings-page.php' );
342
-	include( 'settings/class-settings-cmb2-backward-compatibility.php' );
340
+function give_settings_page_pages($settings) {
341
+	include('abstract-admin-settings-page.php');
342
+	include('settings/class-settings-cmb2-backward-compatibility.php');
343 343
 
344 344
 	$settings = array(
345 345
 		// General settings.
346
-		include( 'settings/class-settings-general.php' ),
346
+		include('settings/class-settings-general.php'),
347 347
 
348 348
 		// Payment Gateways Settings.
349
-		include( 'settings/class-settings-gateways.php' ),
349
+		include('settings/class-settings-gateways.php'),
350 350
 
351 351
 		// Display settings.
352
-		include( 'settings/class-settings-display.php' ),
352
+		include('settings/class-settings-display.php'),
353 353
 
354 354
 		// Emails settings.
355
-		include( 'settings/class-settings-email.php' ),
355
+		include('settings/class-settings-email.php'),
356 356
 
357 357
 		// Addons settings.
358
-		include( 'settings/class-settings-addon.php' ),
358
+		include('settings/class-settings-addon.php'),
359 359
 
360 360
 		// License settings.
361
-		include( 'settings/class-settings-license.php' ),
361
+		include('settings/class-settings-license.php'),
362 362
 
363 363
 		// Advanced settings.
364
-		include( 'settings/class-settings-advanced.php' )
364
+		include('settings/class-settings-advanced.php')
365 365
 	);
366 366
 
367 367
 	// Output.
368 368
 	return $settings;
369 369
 }
370
-add_filter( 'give-settings_get_settings_pages', 'give_settings_page_pages', 0, 1 );
370
+add_filter('give-settings_get_settings_pages', 'give_settings_page_pages', 0, 1);
371 371
 
372 372
 
373 373
 /**
@@ -377,25 +377,25 @@  discard block
 block discarded – undo
377 377
  * @param  array $settings
378 378
  * @return array
379 379
  */
380
-function give_reports_page_pages( $settings ) {
381
-	include( 'abstract-admin-settings-page.php' );
380
+function give_reports_page_pages($settings) {
381
+	include('abstract-admin-settings-page.php');
382 382
 
383 383
 	$settings = array(
384 384
 		// Earnings.
385
-		include( 'reports/class-earnings-report.php' ),
385
+		include('reports/class-earnings-report.php'),
386 386
 
387 387
 		// Forms.
388
-		include( 'reports/class-forms-report.php' ),
388
+		include('reports/class-forms-report.php'),
389 389
 
390 390
 		// Gateways.
391
-		include( 'reports/class-gateways-report.php' ),
391
+		include('reports/class-gateways-report.php'),
392 392
 
393 393
 	);
394 394
 
395 395
 	// Output.
396 396
 	return $settings;
397 397
 }
398
-add_filter( 'give-reports_get_settings_pages', 'give_reports_page_pages', 0, 1 );
398
+add_filter('give-reports_get_settings_pages', 'give_reports_page_pages', 0, 1);
399 399
 
400 400
 /**
401 401
  * Add setting tab to give-settings page
@@ -404,34 +404,34 @@  discard block
 block discarded – undo
404 404
  * @param  array $settings
405 405
  * @return array
406 406
  */
407
-function give_tools_page_pages( $settings ) {
408
-	include( 'abstract-admin-settings-page.php' );
407
+function give_tools_page_pages($settings) {
408
+	include('abstract-admin-settings-page.php');
409 409
 
410 410
 	$settings = array(
411 411
 		// System Info.
412
-		include( 'tools/class-settings-system-info.php' ),
412
+		include('tools/class-settings-system-info.php'),
413 413
 
414 414
 		// Logs.
415
-		include( 'tools/class-settings-logs.php' ),
415
+		include('tools/class-settings-logs.php'),
416 416
 
417 417
 		// API.
418
-		include( 'tools/class-settings-api.php' ),
418
+		include('tools/class-settings-api.php'),
419 419
 
420 420
 		// Data.
421
-		include( 'tools/class-settings-data.php' ),
421
+		include('tools/class-settings-data.php'),
422 422
 
423 423
 		// Export.
424
-		include( 'tools/class-settings-export.php' ),
424
+		include('tools/class-settings-export.php'),
425 425
 
426 426
 		// Import
427
-		include_once( 'tools/class-settings-import.php' ),
427
+		include_once('tools/class-settings-import.php'),
428 428
 
429 429
 	);
430 430
 
431 431
 	// Output.
432 432
 	return $settings;
433 433
 }
434
-add_filter( 'give-tools_get_settings_pages', 'give_tools_page_pages', 0, 1 );
434
+add_filter('give-tools_get_settings_pages', 'give_tools_page_pages', 0, 1);
435 435
 
436 436
 /**
437 437
  * Set default tools page tab.
@@ -440,10 +440,10 @@  discard block
 block discarded – undo
440 440
  * @param  string $default_tab Default tab name.
441 441
  * @return string
442 442
  */
443
-function give_set_default_tab_form_tools_page( $default_tab ) {
443
+function give_set_default_tab_form_tools_page($default_tab) {
444 444
 	return 'system-info';
445 445
 }
446
-add_filter( 'give_default_setting_tab_give-tools', 'give_set_default_tab_form_tools_page', 10, 1 );
446
+add_filter('give_default_setting_tab_give-tools', 'give_set_default_tab_form_tools_page', 10, 1);
447 447
 
448 448
 
449 449
 /**
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
  * @param  string $default_tab Default tab name.
454 454
  * @return string
455 455
  */
456
-function give_set_default_tab_form_reports_page( $default_tab ) {
456
+function give_set_default_tab_form_reports_page($default_tab) {
457 457
 	return 'earnings';
458 458
 }
459
-add_filter( 'give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1 );
460 459
\ No newline at end of file
460
+add_filter('give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1);
461 461
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/admin-filters.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
  *
65 65
  * @param   string $value
66 66
  *
67
- * @return  mixed
67
+ * @return  string
68 68
  */
69 69
 function __give_validate_decimal_separator_setting_field( $value ) {
70 70
 	$thousand_separator = give_clean( $_POST['thousands_separator'] );
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -27,30 +27,30 @@  discard block
 block discarded – undo
27 27
  *
28 28
  * @return  mixed
29 29
  */
30
-function __give_sanitize_number_decimals_setting_field( $value ) {
30
+function __give_sanitize_number_decimals_setting_field($value) {
31 31
 	$value_changed = false;
32 32
 	$old_value     = $value;
33 33
 
34
-	if ( isset( $_POST['decimal_separator'] ) ) {
35
-		$value         = ! empty( $_POST['decimal_separator'] ) ? $value : 0;
34
+	if (isset($_POST['decimal_separator'])) {
35
+		$value         = ! empty($_POST['decimal_separator']) ? $value : 0;
36 36
 		$value_changed = true;
37 37
 	}
38 38
 
39
-	if ( $value_changed && ( $old_value != $value ) ) {
40
-		Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give' ) );
39
+	if ($value_changed && ($old_value != $value)) {
40
+		Give_Admin_Settings::add_error('give-number-decimal', __('The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give'));
41 41
 	}
42 42
 
43
-	$value = absint( $value );
43
+	$value = absint($value);
44 44
 
45
-	if( 6 <= $value ) {
45
+	if (6 <= $value) {
46 46
 		$value = 5;
47
-		Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to 5 because you entered a number higher than the maximum allowed.', 'give' ) );
47
+		Give_Admin_Settings::add_error('give-number-decimal', __('The \'Number of Decimals\' option has been automatically set to 5 because you entered a number higher than the maximum allowed.', 'give'));
48 48
 	}
49 49
 
50
-	return absint( $value );
50
+	return absint($value);
51 51
 }
52 52
 
53
-add_filter( 'give_admin_settings_sanitize_option_number_decimals', '__give_sanitize_number_decimals_setting_field', 10 );
53
+add_filter('give_admin_settings_sanitize_option_number_decimals', '__give_sanitize_number_decimals_setting_field', 10);
54 54
 
55 55
 
56 56
 /**
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return  mixed
68 68
  */
69
-function __give_validate_decimal_separator_setting_field( $value ) {
70
-	$thousand_separator = give_clean( $_POST['thousands_separator'] );
71
-	$decimal_separator  = give_clean( $_POST['decimal_separator'] );
69
+function __give_validate_decimal_separator_setting_field($value) {
70
+	$thousand_separator = give_clean($_POST['thousands_separator']);
71
+	$decimal_separator  = give_clean($_POST['decimal_separator']);
72 72
 
73
-	if ( $decimal_separator === $thousand_separator ) {
73
+	if ($decimal_separator === $thousand_separator) {
74 74
 		$value                    = '';
75 75
 		$_POST['number_decimals'] = 0;
76
-		Give_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give' ) );
76
+		Give_Admin_Settings::add_error('give-decimal-separator', __('The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give'));
77 77
 	}
78 78
 
79 79
 	return $value;
80 80
 }
81 81
 
82
-add_filter( 'give_admin_settings_sanitize_option_decimal_separator', '__give_validate_decimal_separator_setting_field', 10 );
82
+add_filter('give_admin_settings_sanitize_option_decimal_separator', '__give_validate_decimal_separator_setting_field', 10);
83 83
 
84 84
 /**
85 85
  * Change $delimiter text to symbol.
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
  *
91 91
  * @return string $delimiter.
92 92
  */
93
-function __give_import_delimiter_set_callback( $delimiter ) {
93
+function __give_import_delimiter_set_callback($delimiter) {
94 94
 	$delimite_type = array(
95 95
 		'csv'                  => ",",
96 96
 		'tab-separated-values' => "\t",
97 97
 	);
98 98
 
99
-	return ( array_key_exists( $delimiter, $delimite_type ) ? $delimite_type[ $delimiter ] : "," );
99
+	return (array_key_exists($delimiter, $delimite_type) ? $delimite_type[$delimiter] : ",");
100 100
 }
101 101
 
102
-add_filter( 'give_import_delimiter_set', '__give_import_delimiter_set_callback', 10 );
103 102
\ No newline at end of file
103
+add_filter('give_import_delimiter_set', '__give_import_delimiter_set_callback', 10);
104 104
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/tools/import/class-give-import-donations.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
 		/**
456 456
 		 * @param $option_value
457
-		 * @param $value
457
+		 * @param boolean $value
458 458
 		 *
459 459
 		 * @return string
460 460
 		 */
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 		 *
545 545
 		 * @since 1.8.14
546 546
 		 *
547
-		 * @param $file_id
547
+		 * @param integer $file_id
548 548
 		 *
549 549
 		 * @return bool|int
550 550
 		 */
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -871,8 +871,8 @@
 block discarded – undo
871 871
 		 */
872 872
 		private function is_donations_import_page() {
873 873
 			return 'import' === give_get_current_setting_tab() &&
874
-			       isset( $_GET['importer-type'] ) &&
875
-			       $this->importer_type === give_clean( $_GET['importer-type'] );
874
+				   isset( $_GET['importer-type'] ) &&
875
+				   $this->importer_type === give_clean( $_GET['importer-type'] );
876 876
 		}
877 877
 	}
878 878
 
Please login to merge, or discard this patch.
Spacing   +184 added lines, -190 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  * @since       1.8.14
12 12
  */
13 13
 
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit; // Exit if accessed directly
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Give_Import_Donations' ) ) {
18
+if ( ! class_exists('Give_Import_Donations')) {
19 19
 
20 20
 	/**
21 21
 	 * Give_Import_Donations.
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		 * @return static
70 70
 		 */
71 71
 		public static function get_instance() {
72
-			if ( null === static::$instance ) {
72
+			if (null === static::$instance) {
73 73
 				self::$instance = new static();
74 74
 			}
75 75
 
@@ -96,27 +96,27 @@  discard block
 block discarded – undo
96 96
 		 * @return void
97 97
 		 */
98 98
 		private function setup_hooks() {
99
-			if ( ! $this->is_donations_import_page() ) {
99
+			if ( ! $this->is_donations_import_page()) {
100 100
 				return;
101 101
 			}
102 102
 
103 103
 			// Do not render main import tools page.
104
-			remove_action( 'give_admin_field_tools_import', array( 'Give_Settings_Import', 'render_import_field', ) );
104
+			remove_action('give_admin_field_tools_import', array('Give_Settings_Import', 'render_import_field',));
105 105
 
106 106
 
107 107
 			// Render donation import page
108
-			add_action( 'give_admin_field_tools_import', array( $this, 'render_page' ) );
108
+			add_action('give_admin_field_tools_import', array($this, 'render_page'));
109 109
 
110 110
 			// Print the HTML.
111
-			add_action( 'give_tools_import_donations_form_start', array( $this, 'html' ), 10 );
111
+			add_action('give_tools_import_donations_form_start', array($this, 'html'), 10);
112 112
 
113 113
 			// Run when form submit.
114
-			add_action( 'give-tools_save_import', array( $this, 'save' ) );
114
+			add_action('give-tools_save_import', array($this, 'save'));
115 115
 
116
-			add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 );
116
+			add_action('give-tools_update_notices', array($this, 'update_notices'), 11, 1);
117 117
 
118 118
 			// Used to add submit button.
119
-			add_action( 'give_tools_import_donations_form_end', array( $this, 'submit' ), 10 );
119
+			add_action('give_tools_import_donations_form_end', array($this, 'submit'), 10);
120 120
 		}
121 121
 
122 122
 		/**
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
 		 *
129 129
 		 * @return mixed
130 130
 		 */
131
-		public function update_notices( $messages ) {
132
-			if ( ! empty( $_GET['tab'] ) && 'import' === give_clean( $_GET['tab'] ) ) {
133
-				unset( $messages['give-setting-updated'] );
131
+		public function update_notices($messages) {
132
+			if ( ! empty($_GET['tab']) && 'import' === give_clean($_GET['tab'])) {
133
+				unset($messages['give-setting-updated']);
134 134
 			}
135 135
 
136 136
 			return $messages;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		 * @since 1.8.14
143 143
 		 */
144 144
 		public function submit() {
145
-			wp_nonce_field( 'give-save-settings', '_give-save-settings' );
145
+			wp_nonce_field('give-save-settings', '_give-save-settings');
146 146
 			?>
147 147
 			<input type="hidden" class="import-step" id="import-step" name="step" value="<?php echo $this->get_step(); ?>"/>
148 148
 			<input type="hidden" class="importer-type" value="<?php echo $this->importer_type; ?>"/>
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 				<table class="widefat export-options-table give-table <?php echo "step-{$step}"; ?>" id="<?php echo "step-{$step}"; ?>">
165 165
 					<tbody>
166 166
 						<?php
167
-						switch ( $this->get_step() ) {
167
+						switch ($this->get_step()) {
168 168
 							case 1:
169 169
 								$this->render_media_csv();
170 170
 								break;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 								$this->import_success();
182 182
 						}
183 183
 
184
-						if ( false === $this->check_for_dropdown_or_import() ) {
184
+						if (false === $this->check_for_dropdown_or_import()) {
185 185
 							?>
186 186
 							<tr valign="top">
187 187
 								<th></th>
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 									<input type="submit"
190 190
 										   class="button button-primary button-large button-secondary <?php echo "step-{$step}"; ?>"
191 191
 										   id="recount-stats-submit"
192
-										   value="<?php esc_attr_e( 'Submit', 'give' ); ?>"/>
192
+										   value="<?php esc_attr_e('Submit', 'give'); ?>"/>
193 193
 								</th>
194 194
 							</tr>
195 195
 							<?php
@@ -208,56 +208,56 @@  discard block
 block discarded – undo
208 208
 		 */
209 209
 		public function import_success() {
210 210
 
211
-			$delete_csv = ( ! empty( $_GET['delete_csv'] ) ? absint( $_GET['delete_csv'] ) : false );
212
-			$csv        = ( ! empty( $_GET['csv'] ) ? absint( $_GET['csv'] ) : false );
213
-			if ( ! empty( $delete_csv ) && ! empty( $csv ) ) {
214
-				wp_delete_attachment( $csv, true );
211
+			$delete_csv = ( ! empty($_GET['delete_csv']) ? absint($_GET['delete_csv']) : false);
212
+			$csv        = ( ! empty($_GET['csv']) ? absint($_GET['csv']) : false);
213
+			if ( ! empty($delete_csv) && ! empty($csv)) {
214
+				wp_delete_attachment($csv, true);
215 215
 			}
216 216
 
217 217
 			$report      = give_import_donation_report();
218 218
 			$report_html = array(
219 219
 				'duplicate_donor'    => array(
220
-					__( '%s duplicate %s detected', 'give' ),
221
-					__( 'donor', 'give' ),
222
-					__( 'donors', 'give' ),
220
+					__('%s duplicate %s detected', 'give'),
221
+					__('donor', 'give'),
222
+					__('donors', 'give'),
223 223
 				),
224 224
 				'create_donor'       => array(
225
-					__( '%s %s created', 'give' ),
226
-					__( 'donor', 'give' ),
227
-					__( 'donors', 'give' ),
225
+					__('%s %s created', 'give'),
226
+					__('donor', 'give'),
227
+					__('donors', 'give'),
228 228
 				),
229 229
 				'create_form'        => array(
230
-					__( '%s donation %s created', 'give' ),
231
-					__( 'form', 'give' ),
232
-					__( 'forms', 'give' ),
230
+					__('%s donation %s created', 'give'),
231
+					__('form', 'give'),
232
+					__('forms', 'give'),
233 233
 				),
234 234
 				'duplicate_donation' => array(
235
-					__( '%s duplicate %s detected', 'give' ),
236
-					__( 'donation', 'give' ),
237
-					__( 'donations', 'give' ),
235
+					__('%s duplicate %s detected', 'give'),
236
+					__('donation', 'give'),
237
+					__('donations', 'give'),
238 238
 				),
239 239
 				'create_donation'    => array(
240
-					__( '%s %s imported', 'give' ),
241
-					__( 'donation', 'give' ),
242
-					__( 'donations', 'give' ),
240
+					__('%s %s imported', 'give'),
241
+					__('donation', 'give'),
242
+					__('donations', 'give'),
243 243
 				),
244 244
 			);
245
-			$total       = (int) $_GET['total'];
246
-			-- $total;
245
+			$total = (int) $_GET['total'];
246
+			--$total;
247 247
 			$success = (bool) $_GET['success'];
248 248
 			?>
249 249
 			<tr valign="top" class="give-import-dropdown">
250 250
 				<th colspan="2">
251 251
 					<h2>
252 252
 						<?php
253
-						if ( $success ) {
253
+						if ($success) {
254 254
 							echo sprintf(
255
-								__( 'Import complete! %s donations processed', 'give' ),
255
+								__('Import complete! %s donations processed', 'give'),
256 256
 								"<strong>{$total}</strong>"
257 257
 							);
258 258
 						} else {
259 259
 							echo sprintf(
260
-								__( 'Failed to import %s donations', 'give' ),
260
+								__('Failed to import %s donations', 'give'),
261 261
 								"<strong>{$total}</strong>"
262 262
 							);
263 263
 						}
@@ -265,25 +265,25 @@  discard block
 block discarded – undo
265 265
 					</h2>
266 266
 
267 267
 					<?php
268
-					$text      = __( 'Import Donation', 'give' );
268
+					$text      = __('Import Donation', 'give');
269 269
 					$query_arg = array(
270 270
 						'post_type' => 'give_forms',
271 271
 						'page'      => 'give-tools',
272 272
 						'tab'       => 'import',
273 273
 					);
274
-					if ( $success ) {
274
+					if ($success) {
275 275
 						$query_arg = array(
276 276
 							'post_type' => 'give_forms',
277 277
 							'page'      => 'give-payment-history',
278 278
 						);
279
-						$text      = __( 'View Donations', 'give' );
279
+						$text = __('View Donations', 'give');
280 280
 					}
281 281
 
282
-					foreach ( $report as $key => $value ) {
283
-						if ( array_key_exists( $key, $report_html ) && ! empty( $value ) ) {
282
+					foreach ($report as $key => $value) {
283
+						if (array_key_exists($key, $report_html) && ! empty($value)) {
284 284
 							?>
285 285
 							<p>
286
-								<?php echo esc_html( wp_sprintf( $report_html[ $key ][0], $value, _n( $report_html[ $key ][1], $report_html[ $key ][2], $value, 'give' ) ) ); ?>
286
+								<?php echo esc_html(wp_sprintf($report_html[$key][0], $value, _n($report_html[$key][1], $report_html[$key][2], $value, 'give'))); ?>
287 287
 							</p>
288 288
 							<?php
289 289
 						}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 					?>
292 292
 
293 293
 					<p>
294
-						<a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg, admin_url( 'edit.php' ) ); ?>"><?php echo $text; ?></a>
294
+						<a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg, admin_url('edit.php')); ?>"><?php echo $text; ?></a>
295 295
 					</p>
296 296
 				</th>
297 297
 			</tr>
@@ -308,26 +308,26 @@  discard block
 block discarded – undo
308 308
 			give_import_donation_report_reset();
309 309
 
310 310
 			$csv         = (int) $_REQUEST['csv'];
311
-			$delimiter   = ( ! empty( $_REQUEST['delimiter'] ) ? give_clean( $_REQUEST['delimiter'] ) : 'csv' );
311
+			$delimiter   = ( ! empty($_REQUEST['delimiter']) ? give_clean($_REQUEST['delimiter']) : 'csv');
312 312
 			$index_start = 1;
313 313
 			$index_end   = 1;
314 314
 			$next        = true;
315
-			$total       = self::get_csv_total( $csv );
316
-			if ( self::$per_page < $total ) {
317
-				$total_ajax = ceil( $total / self::$per_page );
315
+			$total       = self::get_csv_total($csv);
316
+			if (self::$per_page < $total) {
317
+				$total_ajax = ceil($total / self::$per_page);
318 318
 				$index_end  = self::$per_page;
319 319
 			} else {
320 320
 				$total_ajax = 1;
321 321
 				$index_end  = $total;
322 322
 				$next       = false;
323 323
 			}
324
-			$current_percentage = 100 / ( $total_ajax + 1 );
324
+			$current_percentage = 100 / ($total_ajax + 1);
325 325
 
326 326
 			?>
327 327
 			<tr valign="top" class="give-import-dropdown">
328 328
 				<th colspan="2">
329
-					<h2 id="give-import-title"><?php esc_html_e( 'Importing', 'give' ) ?></h2>
330
-					<p class="give-field-description"><?php esc_html_e( 'Your donations are now being imported...', 'give' ) ?></p>
329
+					<h2 id="give-import-title"><?php esc_html_e('Importing', 'give') ?></h2>
330
+					<p class="give-field-description"><?php esc_html_e('Your donations are now being imported...', 'give') ?></p>
331 331
 				</th>
332 332
 			</tr>
333 333
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 						<div style="width: <?php echo $current_percentage; ?>%"></div>
347 347
 					</div>
348 348
 					<input type="hidden" value="3" name="step">
349
-					<input type="hidden" value='<?php echo maybe_serialize( $_REQUEST['mapto'] ); ?>' name="mapto"
349
+					<input type="hidden" value='<?php echo maybe_serialize($_REQUEST['mapto']); ?>' name="mapto"
350 350
 						   class="mapto">
351 351
 					<input type="hidden" value="<?php echo $_REQUEST['csv']; ?>" name="csv" class="csv">
352 352
 					<input type="hidden" value="<?php echo $_REQUEST['mode']; ?>" name="mode" class="mode">
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 					<input type="hidden" value="<?php echo $_REQUEST['delete_csv']; ?>" name="delete_csv"
356 356
 						   class="delete_csv">
357 357
 					<input type="hidden" value="<?php echo $delimiter; ?>" name="delimiter">
358
-					<input type="hidden" value='<?php echo maybe_serialize( self::get_importer( $csv, 0, $delimiter ) ); ?>'
358
+					<input type="hidden" value='<?php echo maybe_serialize(self::get_importer($csv, 0, $delimiter)); ?>'
359 359
 						   name="main_key"
360 360
 						   class="main_key">
361 361
 				</th>
@@ -376,20 +376,20 @@  discard block
 block discarded – undo
376 376
 		 */
377 377
 		public function check_for_dropdown_or_import() {
378 378
 			$return = true;
379
-			if ( isset( $_REQUEST['mapto'] ) ) {
379
+			if (isset($_REQUEST['mapto'])) {
380 380
 				$mapto = (array) $_REQUEST['mapto'];
381
-				if ( false === in_array( 'form_title', $mapto ) && false === in_array( 'form_id', $mapto ) ) {
382
-					Give_Admin_Settings::add_error( 'give-import-csv-form', __( 'Please select Form ID or Form Name options from the dropdown.', 'give' ) );
381
+				if (false === in_array('form_title', $mapto) && false === in_array('form_id', $mapto)) {
382
+					Give_Admin_Settings::add_error('give-import-csv-form', __('Please select Form ID or Form Name options from the dropdown.', 'give'));
383 383
 					$return = false;
384 384
 				}
385 385
 
386
-				if ( false === in_array( 'amount', $mapto ) ) {
387
-					Give_Admin_Settings::add_error( 'give-import-csv-amount', __( 'Please select Amount option from the dropdown.', 'give' ) );
386
+				if (false === in_array('amount', $mapto)) {
387
+					Give_Admin_Settings::add_error('give-import-csv-amount', __('Please select Amount option from the dropdown.', 'give'));
388 388
 					$return = false;
389 389
 				}
390 390
 
391
-				if ( false === in_array( 'email', $mapto ) && false === in_array( 'donor_id', $mapto ) ) {
392
-					Give_Admin_Settings::add_error( 'give-import-csv-donor', __( 'Please select Email id or Customer ID options from the dropdown.', 'give' ) );
391
+				if (false === in_array('email', $mapto) && false === in_array('donor_id', $mapto)) {
392
+					Give_Admin_Settings::add_error('give-import-csv-donor', __('Please select Email id or Customer ID options from the dropdown.', 'give'));
393 393
 					$return = false;
394 394
 				}
395 395
 			} else {
@@ -406,10 +406,10 @@  discard block
 block discarded – undo
406 406
 		 */
407 407
 		public function render_dropdown() {
408 408
 			$csv       = (int) $_GET['csv'];
409
-			$delimiter = ( ! empty( $_GET['delimiter'] ) ? give_clean( $_GET['delimiter'] ) : 'csv' );
409
+			$delimiter = ( ! empty($_GET['delimiter']) ? give_clean($_GET['delimiter']) : 'csv');
410 410
 
411 411
 			// TO check if the CSV files that is being add is valid or not if not then redirect to first step again
412
-			if ( ! $this->is_valid_csv( $csv ) ) {
412
+			if ( ! $this->is_valid_csv($csv)) {
413 413
 				$url = give_import_page_url();
414 414
 				?>
415 415
 				<script type="text/javascript">
@@ -420,30 +420,30 @@  discard block
 block discarded – undo
420 420
 				?>
421 421
 				<tr valign="top" class="give-import-dropdown">
422 422
 					<th colspan="2">
423
-						<h2 id="give-import-title"><?php esc_html_e( 'Map CSV fields to donations', 'give' ) ?></h2>
424
-						<p class="give-field-description"><?php esc_html_e( 'Select fields from your CSV file to map against donations fields or to ignore during import.', 'give' ) ?></p>
423
+						<h2 id="give-import-title"><?php esc_html_e('Map CSV fields to donations', 'give') ?></h2>
424
+						<p class="give-field-description"><?php esc_html_e('Select fields from your CSV file to map against donations fields or to ignore during import.', 'give') ?></p>
425 425
 					</th>
426 426
 				</tr>
427 427
 
428 428
 				<tr valign="top" class="give-import-dropdown">
429
-					<th><b><?php esc_html_e( 'Column name', 'give' ); ?></b></th>
430
-					<th><b><?php esc_html_e( 'Map to field', 'give' ); ?></b></th>
429
+					<th><b><?php esc_html_e('Column name', 'give'); ?></b></th>
430
+					<th><b><?php esc_html_e('Map to field', 'give'); ?></b></th>
431 431
 				</tr>
432 432
 
433 433
 				<?php
434
-				$raw_key   = $this->get_importer( $csv, 0, $delimiter );
434
+				$raw_key   = $this->get_importer($csv, 0, $delimiter);
435 435
 				$donations = give_import_donations_options();
436 436
 				$donors    = give_import_donor_options();
437 437
 				$forms     = give_import_donation_form_options();
438
-				$mapto     = (array) ( isset( $_REQUEST['mapto'] ) ? $_REQUEST['mapto'] : array() );
438
+				$mapto     = (array) (isset($_REQUEST['mapto']) ? $_REQUEST['mapto'] : array());
439 439
 
440
-				foreach ( $raw_key as $index => $value ) {
440
+				foreach ($raw_key as $index => $value) {
441 441
 					?>
442 442
 					<tr valign="top" class="give-import-option">
443 443
 						<th><?php echo $value; ?></th>
444 444
 						<th>
445 445
 							<?php
446
-							$this->get_columns( $index, $donations, $donors, $forms, $value, $mapto );
446
+							$this->get_columns($index, $donations, $donors, $forms, $value, $mapto);
447 447
 							?>
448 448
 						</th>
449 449
 					</tr>
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
 		 *
459 459
 		 * @return string
460 460
 		 */
461
-		public function selected( $option_value, $value ) {
461
+		public function selected($option_value, $value) {
462 462
 			$selected = '';
463
-			if ( stristr( $value, $option_value ) ) {
463
+			if (stristr($value, $option_value)) {
464 464
 				$selected = 'selected';
465
-			} elseif ( strrpos( $value, '_' ) && stristr( $option_value, 'Import as Meta' ) ) {
465
+			} elseif (strrpos($value, '_') && stristr($option_value, 'Import as Meta')) {
466 466
 				$selected = 'selected';
467 467
 			}
468 468
 
@@ -474,16 +474,16 @@  discard block
 block discarded – undo
474 474
 		 *
475 475
 		 * @since 1.8.14
476 476
 		 */
477
-		public function get_columns( $index, $donations, $donors, $forms, $value = false, $mapto = array() ) {
477
+		public function get_columns($index, $donations, $donors, $forms, $value = false, $mapto = array()) {
478 478
 			$default       = give_import_default_options();
479
-			$current_mapto = (string) ( ! empty( $mapto[ $index ] ) ? $mapto[ $index ] : '' );
479
+			$current_mapto = (string) ( ! empty($mapto[$index]) ? $mapto[$index] : '');
480 480
 			?>
481 481
 			<select name="mapto[<?php echo $index; ?>]">
482 482
 				<?php
483
-				foreach ( $default as $option => $option_value ) {
484
-					$checked = ( ( $current_mapto === $option ) ? 'selected' : false );
485
-					if ( empty( $checked ) ) {
486
-						$checked = $this->selected( $option_value, $value );
483
+				foreach ($default as $option => $option_value) {
484
+					$checked = (($current_mapto === $option) ? 'selected' : false);
485
+					if (empty($checked)) {
486
+						$checked = $this->selected($option_value, $value);
487 487
 					}
488 488
 					?>
489 489
 					<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
 				?>
493 493
 				<optgroup label="Donations">
494 494
 					<?php
495
-					foreach ( $donations as $option => $option_value ) {
496
-						$checked = ( ( $current_mapto === $option ) ? 'selected' : false );
497
-						if ( empty( $checked ) ) {
498
-							$checked = $this->selected( $option_value, $value );
495
+					foreach ($donations as $option => $option_value) {
496
+						$checked = (($current_mapto === $option) ? 'selected' : false);
497
+						if (empty($checked)) {
498
+							$checked = $this->selected($option_value, $value);
499 499
 						}
500 500
 						?>
501 501
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
@@ -506,10 +506,10 @@  discard block
 block discarded – undo
506 506
 
507 507
 				<optgroup label="Donors">
508 508
 					<?php
509
-					foreach ( $donors as $option => $option_value ) {
510
-						$checked = ( ( $current_mapto === $option ) ? 'selected' : false );
511
-						if ( empty( $checked ) ) {
512
-							$checked = $this->selected( $option_value, $value );
509
+					foreach ($donors as $option => $option_value) {
510
+						$checked = (($current_mapto === $option) ? 'selected' : false);
511
+						if (empty($checked)) {
512
+							$checked = $this->selected($option_value, $value);
513 513
 						}
514 514
 						?>
515 515
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
@@ -520,10 +520,10 @@  discard block
 block discarded – undo
520 520
 
521 521
 				<optgroup label="Forms">
522 522
 					<?php
523
-					foreach ( $forms as $option => $option_value ) {
524
-						$checked = ( ( $current_mapto === $option ) ? 'selected' : false );
525
-						if ( empty( $checked ) ) {
526
-							$checked = $this->selected( $option_value, $value );
523
+					foreach ($forms as $option => $option_value) {
524
+						$checked = (($current_mapto === $option) ? 'selected' : false);
525
+						if (empty($checked)) {
526
+							$checked = $this->selected($option_value, $value);
527 527
 						}
528 528
 						?>
529 529
 						<option value="<?php echo $option; ?>" <?php echo $checked; ?> ><?php echo $option_value; ?></option>
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 				</optgroup>
534 534
 
535 535
 				<?php
536
-				do_action( 'give_import_dropdown_option', $index, $donations, $donors, $forms, $value );
536
+				do_action('give_import_dropdown_option', $index, $donations, $donors, $forms, $value);
537 537
 				?>
538 538
 			</select>
539 539
 			<?php
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
 		 *
549 549
 		 * @return bool|int
550 550
 		 */
551
-		public function get_csv_total( $file_id ) {
551
+		public function get_csv_total($file_id) {
552 552
 			$total = false;
553
-			if ( $file_id ) {
554
-				$file_dir = get_attached_file( $file_id );
555
-				if ( $file_dir ) {
556
-					$file = new SplFileObject( $file_dir, 'r' );
557
-					$file->seek( PHP_INT_MAX );
553
+			if ($file_id) {
554
+				$file_dir = get_attached_file($file_id);
555
+				if ($file_dir) {
556
+					$file = new SplFileObject($file_dir, 'r');
557
+					$file->seek(PHP_INT_MAX);
558 558
 					$total = $file->key() + 1;
559 559
 				}
560 560
 			}
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		 *
574 574
 		 * @return array|bool $raw_data title of the CSV file fields
575 575
 		 */
576
-		public function get_importer( $file_id, $index = 0, $delimiter = 'csv' ) {
576
+		public function get_importer($file_id, $index = 0, $delimiter = 'csv') {
577 577
 			/**
578 578
 			 * Filter to modify delimiter of Import.
579 579
 			 *
@@ -581,16 +581,16 @@  discard block
 block discarded – undo
581 581
 			 *
582 582
 			 * Return string $delimiter.
583 583
 			 */
584
-			$delimiter = (string) apply_filters( 'give_import_delimiter_set', $delimiter );
584
+			$delimiter = (string) apply_filters('give_import_delimiter_set', $delimiter);
585 585
 
586 586
 			$raw_data = false;
587
-			$file_dir = get_attached_file( $file_id );
588
-			if ( $file_dir ) {
589
-				if ( false !== ( $handle = fopen( $file_dir, 'r' ) ) ) {
590
-					$raw_data = fgetcsv( $handle, $index, $delimiter );
587
+			$file_dir = get_attached_file($file_id);
588
+			if ($file_dir) {
589
+				if (false !== ($handle = fopen($file_dir, 'r'))) {
590
+					$raw_data = fgetcsv($handle, $index, $delimiter);
591 591
 					// Remove BOM signature from the first item.
592
-					if ( isset( $raw_data[0] ) ) {
593
-						$raw_data[0] = $this->remove_utf8_bom( $raw_data[0] );
592
+					if (isset($raw_data[0])) {
593
+						$raw_data[0] = $this->remove_utf8_bom($raw_data[0]);
594 594
 					}
595 595
 				}
596 596
 			}
@@ -607,9 +607,9 @@  discard block
 block discarded – undo
607 607
 		 *
608 608
 		 * @return string
609 609
 		 */
610
-		public function remove_utf8_bom( $string ) {
611
-			if ( 'efbbbf' === substr( bin2hex( $string ), 0, 6 ) ) {
612
-				$string = substr( $string, 3 );
610
+		public function remove_utf8_bom($string) {
611
+			if ('efbbbf' === substr(bin2hex($string), 0, 6)) {
612
+				$string = substr($string, 3);
613 613
 			}
614 614
 
615 615
 			return $string;
@@ -625,17 +625,17 @@  discard block
 block discarded – undo
625 625
 			$step = $this->get_step();
626 626
 			?>
627 627
 			<ol class="give-progress-steps">
628
-				<li class="<?php echo( 1 === $step ? 'active' : '' ); ?>">
629
-					<?php esc_html_e( 'Upload CSV file', 'give' ); ?>
628
+				<li class="<?php echo(1 === $step ? 'active' : ''); ?>">
629
+					<?php esc_html_e('Upload CSV file', 'give'); ?>
630 630
 				</li>
631
-				<li class="<?php echo( 2 === $step ? 'active' : '' ); ?>">
632
-					<?php esc_html_e( 'Column mapping', 'give' ); ?>
631
+				<li class="<?php echo(2 === $step ? 'active' : ''); ?>">
632
+					<?php esc_html_e('Column mapping', 'give'); ?>
633 633
 				</li>
634
-				<li class="<?php echo( 3 === $step ? 'active' : '' ); ?>">
635
-					<?php esc_html_e( 'Import', 'give' ); ?>
634
+				<li class="<?php echo(3 === $step ? 'active' : ''); ?>">
635
+					<?php esc_html_e('Import', 'give'); ?>
636 636
 				</li>
637
-				<li class="<?php echo( 4 === $step ? 'active' : '' ); ?>">
638
-					<?php esc_html_e( 'Done!', 'give' ); ?>
637
+				<li class="<?php echo(4 === $step ? 'active' : ''); ?>">
638
+					<?php esc_html_e('Done!', 'give'); ?>
639 639
 				</li>
640 640
 			</ol>
641 641
 			<?php
@@ -649,16 +649,16 @@  discard block
 block discarded – undo
649 649
 		 * @return int $step on which step doest the import is on.
650 650
 		 */
651 651
 		public function get_step() {
652
-			$step    = (int) ( isset( $_REQUEST['step'] ) ? give_clean( $_REQUEST['step'] ) : 0 );
652
+			$step    = (int) (isset($_REQUEST['step']) ? give_clean($_REQUEST['step']) : 0);
653 653
 			$on_step = 1;
654 654
 
655
-			if ( empty( $step ) || 1 === $step ) {
655
+			if (empty($step) || 1 === $step) {
656 656
 				$on_step = 1;
657
-			} elseif ( $this->check_for_dropdown_or_import() ) {
657
+			} elseif ($this->check_for_dropdown_or_import()) {
658 658
 				$on_step = 3;
659
-			} elseif ( 2 === $step ) {
659
+			} elseif (2 === $step) {
660 660
 				$on_step = 2;
661
-			} elseif ( 4 === $step ) {
661
+			} elseif (4 === $step) {
662 662
 				$on_step = 4;
663 663
 			}
664 664
 
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 		 * @since 1.8.14
672 672
 		 */
673 673
 		public function render_page() {
674
-			include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-import-donations.php';
674
+			include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-import-donations.php';
675 675
 		}
676 676
 
677 677
 		/**
@@ -686,36 +686,33 @@  discard block
 block discarded – undo
686 686
 			?>
687 687
 			<tr valign="top">
688 688
 				<th colspan="2">
689
-					<h2 id="give-import-title"><?php esc_html_e( 'Import donations from a CSV file', 'give' ) ?></h2>
690
-					<p class="give-field-description"><?php esc_html_e( 'This tool allows you to import or add donation data to your give form(s) via a CSV file.', 'give' ) ?></p>
689
+					<h2 id="give-import-title"><?php esc_html_e('Import donations from a CSV file', 'give') ?></h2>
690
+					<p class="give-field-description"><?php esc_html_e('This tool allows you to import or add donation data to your give form(s) via a CSV file.', 'give') ?></p>
691 691
 				</th>
692 692
 			</tr>
693 693
 			<?php
694
-			$csv         = ( isset( $_POST['csv'] ) ? give_clean( $_POST['csv'] ) : '' );
695
-			$csv_id      = ( isset( $_POST['csv_id'] ) ? give_clean( $_POST['csv_id'] ) : '' );
696
-			$delimiter   = ( isset( $_POST['delimiter'] ) ? give_clean( $_POST['delimiter'] ) : 'csv' );
697
-			$mode        = empty( $_POST['mode'] ) ?
698
-				'disabled' :
699
-				( give_is_setting_enabled( give_clean( $_POST['mode'] ) ) ? 'enabled' : 'disabled' );
700
-			$create_user = empty( $_POST['create_user'] ) ?
701
-				'enabled' :
702
-				( give_is_setting_enabled( give_clean( $_POST['create_user'] ) ) ? 'enabled' : 'disabled' );
703
-			$delete_csv  = empty( $_POST['delete_csv'] ) ?
704
-				'enabled' :
705
-				( give_is_setting_enabled( give_clean( $_POST['delete_csv'] ) ) ? 'enabled' : 'disabled' );
694
+			$csv         = (isset($_POST['csv']) ? give_clean($_POST['csv']) : '');
695
+			$csv_id      = (isset($_POST['csv_id']) ? give_clean($_POST['csv_id']) : '');
696
+			$delimiter   = (isset($_POST['delimiter']) ? give_clean($_POST['delimiter']) : 'csv');
697
+			$mode        = empty($_POST['mode']) ?
698
+				'disabled' : (give_is_setting_enabled(give_clean($_POST['mode'])) ? 'enabled' : 'disabled');
699
+			$create_user = empty($_POST['create_user']) ?
700
+				'enabled' : (give_is_setting_enabled(give_clean($_POST['create_user'])) ? 'enabled' : 'disabled');
701
+			$delete_csv  = empty($_POST['delete_csv']) ?
702
+				'enabled' : (give_is_setting_enabled(give_clean($_POST['delete_csv'])) ? 'enabled' : 'disabled');
706 703
 
707 704
 			// Reset csv and csv_id if csv
708
-			if ( empty( $csv_id ) || ! $this->is_valid_csv( $csv_id, $csv ) ) {
705
+			if (empty($csv_id) || ! $this->is_valid_csv($csv_id, $csv)) {
709 706
 				$csv_id = $csv = '';
710 707
 			}
711 708
 
712 709
 			$settings = array(
713 710
 				array(
714 711
 					'id'          => 'csv',
715
-					'name'        => __( 'Choose a CSV file:', 'give' ),
712
+					'name'        => __('Choose a CSV file:', 'give'),
716 713
 					'type'        => 'file',
717
-					'attributes'  => array( 'editing' => 'false', 'library' => 'text' ),
718
-					'description' => __( 'The file must be a Comma Seperated Version (CSV) file type only.', 'give' ),
714
+					'attributes'  => array('editing' => 'false', 'library' => 'text'),
715
+					'description' => __('The file must be a Comma Seperated Version (CSV) file type only.', 'give'),
719 716
 					'fvalue'      => 'url',
720 717
 					'default'     => $csv,
721 718
 				),
@@ -726,53 +723,53 @@  discard block
 block discarded – undo
726 723
 				),
727 724
 				array(
728 725
 					'id'          => 'delimiter',
729
-					'name'        => __( 'CSV Delimiter:', 'give' ),
730
-					'description' => __( 'In case your CSV file supports a different type of separator (or delimiter) -- like a tab or space -- you can set that here.', 'give' ),
726
+					'name'        => __('CSV Delimiter:', 'give'),
727
+					'description' => __('In case your CSV file supports a different type of separator (or delimiter) -- like a tab or space -- you can set that here.', 'give'),
731 728
 					'default'     => $delimiter,
732 729
 					'type'        => 'select',
733 730
 					'options'     => array(
734
-						'csv'                  => esc_html__( 'Comma', 'give' ),
735
-						'tab-separated-values' => esc_html__( 'Tab', 'give' ),
731
+						'csv'                  => esc_html__('Comma', 'give'),
732
+						'tab-separated-values' => esc_html__('Tab', 'give'),
736 733
 					),
737 734
 				),
738 735
 				array(
739 736
 					'id'          => 'mode',
740
-					'name'        => __( 'Test Mode:', 'give' ),
741
-					'description' => __( 'Test mode allows you to preview what this import would look like without making any actual changes to your site or your database.', 'give' ),
737
+					'name'        => __('Test Mode:', 'give'),
738
+					'description' => __('Test mode allows you to preview what this import would look like without making any actual changes to your site or your database.', 'give'),
742 739
 					'default'     => $mode,
743 740
 					'type'        => 'radio_inline',
744 741
 					'options'     => array(
745
-						'enabled'  => __( 'Enabled', 'give' ),
746
-						'disabled' => __( 'Disabled', 'give' ),
742
+						'enabled'  => __('Enabled', 'give'),
743
+						'disabled' => __('Disabled', 'give'),
747 744
 					),
748 745
 				),
749 746
 				array(
750 747
 					'id'          => 'create_user',
751
-					'name'        => __( 'Create WP users for new donors:', 'give' ),
752
-					'description' => __( 'The importer can create WordPress user accounts based on the names and email addresses of the donations in your CSV file. Enable this option if you\'d like the importer to do that.', 'give' ),
748
+					'name'        => __('Create WP users for new donors:', 'give'),
749
+					'description' => __('The importer can create WordPress user accounts based on the names and email addresses of the donations in your CSV file. Enable this option if you\'d like the importer to do that.', 'give'),
753 750
 					'default'     => $create_user,
754 751
 					'type'        => 'radio_inline',
755 752
 					'options'     => array(
756
-						'enabled'  => __( 'Enabled', 'give' ),
757
-						'disabled' => __( 'Disabled', 'give' ),
753
+						'enabled'  => __('Enabled', 'give'),
754
+						'disabled' => __('Disabled', 'give'),
758 755
 					),
759 756
 				),
760 757
 				array(
761 758
 					'id'          => 'delete_csv',
762
-					'name'        => __( 'Delete CSV after import:', 'give' ),
763
-					'description' => __( 'Your CSV file will be uploaded via the WordPress Media Library. It\'s a good idea to delete it after the import is finished so that your sensitive data is not accessible on the web. Disable this only if you plan to delete the file manually later.', 'give' ),
759
+					'name'        => __('Delete CSV after import:', 'give'),
760
+					'description' => __('Your CSV file will be uploaded via the WordPress Media Library. It\'s a good idea to delete it after the import is finished so that your sensitive data is not accessible on the web. Disable this only if you plan to delete the file manually later.', 'give'),
764 761
 					'default'     => $delete_csv,
765 762
 					'type'        => 'radio_inline',
766 763
 					'options'     => array(
767
-						'enabled'  => __( 'Enabled', 'give' ),
768
-						'disabled' => __( 'Disabled', 'give' ),
764
+						'enabled'  => __('Enabled', 'give'),
765
+						'disabled' => __('Disabled', 'give'),
769 766
 					),
770 767
 				),
771 768
 			);
772 769
 
773
-			$settings = apply_filters( 'give_import_file_upload_html', $settings );
770
+			$settings = apply_filters('give_import_file_upload_html', $settings);
774 771
 
775
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
772
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
776 773
 		}
777 774
 
778 775
 		/**
@@ -785,26 +782,23 @@  discard block
 block discarded – undo
785 782
 			$step = $this->get_step();
786 783
 
787 784
 			// Validation for first step.
788
-			if ( 1 === $step ) {
789
-				$csv_id = absint( $_POST['csv_id'] );
785
+			if (1 === $step) {
786
+				$csv_id = absint($_POST['csv_id']);
790 787
 
791
-				if ( $this->is_valid_csv( $csv_id, esc_url( $_POST['csv'] ) ) ) {
788
+				if ($this->is_valid_csv($csv_id, esc_url($_POST['csv']))) {
792 789
 
793
-					$url = give_import_page_url( (array) apply_filters( 'give_import_step_two_url', array(
790
+					$url = give_import_page_url((array) apply_filters('give_import_step_two_url', array(
794 791
 						'step'          => '2',
795 792
 						'importer-type' => $this->importer_type,
796 793
 						'csv'           => $csv_id,
797
-						'delimiter'     => isset( $_REQUEST['delimiter'] ) ? give_clean( $_REQUEST['delimiter'] ) : 'csv',
798
-						'mode'          => empty( $_POST['mode'] ) ?
799
-							'0' :
800
-							( give_is_setting_enabled( give_clean( $_POST['mode'] ) ) ? '1' : '0' ),
801
-						'create_user'   => empty( $_POST['create_user'] ) ?
802
-							'0' :
803
-							( give_is_setting_enabled( give_clean( $_POST['create_user'] ) ) ? '1' : '0' ),
804
-						'delete_csv'    => empty( $_POST['delete_csv'] ) ?
805
-							'1' :
806
-							( give_is_setting_enabled( give_clean( $_POST['delete_csv'] ) ) ? '1' : '0' ),
807
-					) ) );
794
+						'delimiter'     => isset($_REQUEST['delimiter']) ? give_clean($_REQUEST['delimiter']) : 'csv',
795
+						'mode'          => empty($_POST['mode']) ?
796
+							'0' : (give_is_setting_enabled(give_clean($_POST['mode'])) ? '1' : '0'),
797
+						'create_user'   => empty($_POST['create_user']) ?
798
+							'0' : (give_is_setting_enabled(give_clean($_POST['create_user'])) ? '1' : '0'),
799
+						'delete_csv'    => empty($_POST['delete_csv']) ?
800
+							'1' : (give_is_setting_enabled(give_clean($_POST['delete_csv'])) ? '1' : '0'),
801
+					)));
808 802
 					?>
809 803
 					<script type="text/javascript">
810 804
 						window.location = "<?php echo $url; ?>"
@@ -825,25 +819,25 @@  discard block
 block discarded – undo
825 819
 		 *
826 820
 		 * @return bool $has_error CSV is valid or not.
827 821
 		 */
828
-		private function is_valid_csv( $csv = false, $match_url = '' ) {
822
+		private function is_valid_csv($csv = false, $match_url = '') {
829 823
 			$is_valid_csv = true;
830 824
 
831
-			if ( $csv ) {
832
-				$csv_url = wp_get_attachment_url( $csv );
825
+			if ($csv) {
826
+				$csv_url = wp_get_attachment_url($csv);
833 827
 
834
-				$delimiter = ( ! empty( $_REQUEST['delimiter'] ) ? give_clean( $_REQUEST['delimiter'] ) : 'csv' );
828
+				$delimiter = ( ! empty($_REQUEST['delimiter']) ? give_clean($_REQUEST['delimiter']) : 'csv');
835 829
 
836 830
 				if (
837 831
 					! $csv_url ||
838
-					( ! empty( $match_url ) && ( $csv_url !== $match_url ) ) ||
839
-					( ( $mime_type = get_post_mime_type( $csv ) ) && ! strpos( $mime_type, $delimiter ) )
832
+					( ! empty($match_url) && ($csv_url !== $match_url)) ||
833
+					(($mime_type = get_post_mime_type($csv)) && ! strpos($mime_type, $delimiter))
840 834
 				) {
841 835
 					$is_valid_csv = false;
842
-					Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide a valid CSV file.', 'give' ) );
836
+					Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide a valid CSV file.', 'give'));
843 837
 				}
844 838
 			} else {
845 839
 				$is_valid_csv = false;
846
-				Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide a valid CSV file.', 'give' ) );
840
+				Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide a valid CSV file.', 'give'));
847 841
 			}
848 842
 
849 843
 			return $is_valid_csv;
@@ -859,8 +853,8 @@  discard block
 block discarded – undo
859 853
 		 * @param $field
860 854
 		 * @param $option_value
861 855
 		 */
862
-		public function render_import_field( $field, $option_value ) {
863
-			include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-imports.php';
856
+		public function render_import_field($field, $option_value) {
857
+			include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-imports.php';
864 858
 		}
865 859
 
866 860
 		/**
@@ -871,8 +865,8 @@  discard block
 block discarded – undo
871 865
 		 */
872 866
 		private function is_donations_import_page() {
873 867
 			return 'import' === give_get_current_setting_tab() &&
874
-			       isset( $_GET['importer-type'] ) &&
875
-			       $this->importer_type === give_clean( $_GET['importer-type'] );
868
+			       isset($_GET['importer-type']) &&
869
+			       $this->importer_type === give_clean($_GET['importer-type']);
876 870
 		}
877 871
 	}
878 872
 
Please login to merge, or discard this patch.
includes/import-functions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -434,7 +434,6 @@  discard block
 block discarded – undo
434 434
  * Import CSV in DB
435 435
  *
436 436
  * @param int   $file_id CSV id
437
- * @param array $mapto   Map csv to meta key.
438 437
  * @param int   $start   Start from which csv line.
439 438
  * @param int   $end     End from which csv line.
440 439
  */
@@ -663,6 +662,7 @@  discard block
 block discarded – undo
663 662
  * Check if Import donation is duplicate
664 663
  *
665 664
  * @since 1.8.13
665
+ * @param Give_Donate_Form $form
666 666
  */
667 667
 function give_check_import_donation_duplicate( $payment_data, $data, $form, $donor_data ) {
668 668
 	$return = false;
Please login to merge, or discard this patch.
Spacing   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  * @since 1.8.13
21 21
  */
22 22
 function give_import_donation_report() {
23
-	return get_option( 'give_import_donation_report', array() );
23
+	return get_option('give_import_donation_report', array());
24 24
 }
25 25
 
26 26
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
  *
30 30
  * @since 1.8.13
31 31
  */
32
-function give_import_donation_report_update( $value = array() ) {
33
-	update_option( 'give_import_donation_report', $value );
32
+function give_import_donation_report_update($value = array()) {
33
+	update_option('give_import_donation_report', $value);
34 34
 }
35 35
 
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  * @since 1.8.13
41 41
  */
42 42
 function give_import_donation_report_reset() {
43
-	update_option( 'give_import_donation_report', array() );
43
+	update_option('give_import_donation_report', array());
44 44
 }
45 45
 
46 46
 /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  *
53 53
  * @return array|bool|Give_Donate_Form|int|null|WP_Post
54 54
  */
55
-function give_import_get_form_data_from_csv( $data, $import_setting = array() ) {
55
+function give_import_get_form_data_from_csv($data, $import_setting = array()) {
56 56
 	$new_form = false;
57 57
 
58 58
 	// Get the import report
@@ -61,58 +61,58 @@  discard block
 block discarded – undo
61 61
 	$form = false;
62 62
 	$meta = array();
63 63
 
64
-	if ( ! empty( $data['form_id'] ) ) {
65
-		$form = new Give_Donate_Form( $data['form_id'] );
64
+	if ( ! empty($data['form_id'])) {
65
+		$form = new Give_Donate_Form($data['form_id']);
66 66
 		// Add support to older php version.
67 67
 		$form_id = $form->get_ID();
68
-		if ( empty( $form_id ) ) {
69
-			$report['duplicate_form'] = ( ! empty( $report['duplicate_form'] ) ? ( absint( $report['duplicate_form'] ) + 1 ) : 1 );
68
+		if (empty($form_id)) {
69
+			$report['duplicate_form'] = ( ! empty($report['duplicate_form']) ? (absint($report['duplicate_form']) + 1) : 1);
70 70
 			$form                     = false;
71 71
 		}
72 72
 	}
73 73
 
74
-	if ( false === $form && ! empty( $data['form_title'] ) ) {
75
-		$form = get_page_by_title( $data['form_title'], OBJECT, 'give_forms' );
74
+	if (false === $form && ! empty($data['form_title'])) {
75
+		$form = get_page_by_title($data['form_title'], OBJECT, 'give_forms');
76 76
 
77
-		if ( ! empty( $form->ID ) ) {
77
+		if ( ! empty($form->ID)) {
78 78
 
79
-			$report['duplicate_form'] = ( ! empty( $report['duplicate_form'] ) ? ( absint( $report['duplicate_form'] ) + 1 ) : 1 );
79
+			$report['duplicate_form'] = ( ! empty($report['duplicate_form']) ? (absint($report['duplicate_form']) + 1) : 1);
80 80
 
81
-			$form = new Give_Donate_Form( $form->ID );
81
+			$form = new Give_Donate_Form($form->ID);
82 82
 		} else {
83 83
 			$form                  = new Give_Donate_Form();
84 84
 			$args                  = array(
85 85
 				'post_title'  => $data['form_title'],
86 86
 				'post_status' => 'publish',
87 87
 			);
88
-			$form                  = $form->create( $args );
89
-			$report['create_form'] = ( ! empty( $report['create_form'] ) ? ( absint( $report['create_form'] ) + 1 ) : 1 );
88
+			$form                  = $form->create($args);
89
+			$report['create_form'] = ( ! empty($report['create_form']) ? (absint($report['create_form']) + 1) : 1);
90 90
 			$new_form              = true;
91 91
 
92 92
 		}
93 93
 
94
-		$form = get_page_by_title( $data['form_title'], OBJECT, 'give_forms' );
95
-		$form = new Give_Donate_Form( $form->ID );
94
+		$form = get_page_by_title($data['form_title'], OBJECT, 'give_forms');
95
+		$form = new Give_Donate_Form($form->ID);
96 96
 	}
97 97
 
98
-	if ( ! empty( $form ) && $form->get_ID() ) {
99
-		if ( ! empty( $data['form_level'] ) && 'custom' != (string) strtolower( $data['form_level'] ) ) {
98
+	if ( ! empty($form) && $form->get_ID()) {
99
+		if ( ! empty($data['form_level']) && 'custom' != (string) strtolower($data['form_level'])) {
100 100
 			$prices     = (array) $form->get_prices();
101 101
 			$price_text = array();
102
-			foreach ( $prices as $key => $price ) {
103
-				if ( isset( $price['_give_id']['level_id'] ) ) {
104
-					$price_text[ $price['_give_id']['level_id'] ] = ( ! empty( $price['_give_text'] ) ? $price['_give_text'] : '' );
102
+			foreach ($prices as $key => $price) {
103
+				if (isset($price['_give_id']['level_id'])) {
104
+					$price_text[$price['_give_id']['level_id']] = ( ! empty($price['_give_text']) ? $price['_give_text'] : '');
105 105
 				}
106 106
 			}
107 107
 
108
-			if ( ! in_array( $data['form_level'], $price_text ) ) {
108
+			if ( ! in_array($data['form_level'], $price_text)) {
109 109
 
110 110
 				// For generating unquiet level id.
111 111
 				$count     = 1;
112
-				$new_level = count( $prices ) + $count;
113
-				while ( array_key_exists( $new_level, $price_text ) ) {
114
-					$count ++;
115
-					$new_level = count( $prices ) + $count;
112
+				$new_level = count($prices) + $count;
113
+				while (array_key_exists($new_level, $price_text)) {
114
+					$count++;
115
+					$new_level = count($prices) + $count;
116 116
 				}
117 117
 
118 118
 				$multi_level_donations = array(
@@ -120,57 +120,57 @@  discard block
 block discarded – undo
120 120
 						'_give_id'     => array(
121 121
 							'level_id' => $new_level,
122 122
 						),
123
-						'_give_amount' => give_sanitize_amount_for_db( $data['amount'] ),
123
+						'_give_amount' => give_sanitize_amount_for_db($data['amount']),
124 124
 						'_give_text'   => $data['form_level'],
125 125
 					),
126 126
 				);
127 127
 
128
-				$price_text[ $new_level ] = $data['form_level'];
128
+				$price_text[$new_level] = $data['form_level'];
129 129
 
130
-				if ( ! empty( $prices ) && is_array( $prices ) && ! empty( $prices[0] ) ) {
131
-					$prices = wp_parse_args( $multi_level_donations, $prices );
130
+				if ( ! empty($prices) && is_array($prices) && ! empty($prices[0])) {
131
+					$prices = wp_parse_args($multi_level_donations, $prices);
132 132
 
133 133
 					// Sort $prices by amount in ascending order.
134
-					$prices = wp_list_sort( $prices, '_give_amount', 'ASC' );
134
+					$prices = wp_list_sort($prices, '_give_amount', 'ASC');
135 135
 				} else {
136 136
 					$prices = $multi_level_donations;
137 137
 				}
138 138
 
139 139
 				// Unset _give_default key from $prices.
140
-				foreach ( $prices as $key => $price ) {
141
-					if ( isset( $prices[ $key ]['_give_default'] ) ) {
142
-						unset( $prices[ $key ]['_give_default'] );
140
+				foreach ($prices as $key => $price) {
141
+					if (isset($prices[$key]['_give_default'])) {
142
+						unset($prices[$key]['_give_default']);
143 143
 					}
144 144
 				}
145 145
 
146 146
 				// Set the first $price of the $prices as defalut.
147 147
 				$prices[0]['_give_default'] = 'default';
148 148
 			}
149
-			$form->price_id = array_search( $data['form_level'], $price_text );
149
+			$form->price_id = array_search($data['form_level'], $price_text);
150 150
 
151
-			$donation_levels_amounts = wp_list_pluck( $prices, '_give_amount' );
152
-			$min_amount              = min( $donation_levels_amounts );
153
-			$max_amount              = max( $donation_levels_amounts );
151
+			$donation_levels_amounts = wp_list_pluck($prices, '_give_amount');
152
+			$min_amount              = min($donation_levels_amounts);
153
+			$max_amount              = max($donation_levels_amounts);
154 154
 
155 155
 			$meta = array(
156 156
 				'_give_levels_minimum_amount' => $min_amount,
157 157
 				'_give_levels_maximum_amount' => $max_amount,
158 158
 				'_give_price_option'          => 'multi',
159
-				'_give_donation_levels'       => array_values( $prices ),
159
+				'_give_donation_levels'       => array_values($prices),
160 160
 			);
161 161
 		} else {
162 162
 			$form->price_id = 'custom';
163 163
 		}
164 164
 
165 165
 		$defaults = array(
166
-			'_give_set_price'    => give_sanitize_amount_for_db( $data['amount'] ),
166
+			'_give_set_price'    => give_sanitize_amount_for_db($data['amount']),
167 167
 			'_give_price_option' => 'set',
168 168
 		);
169 169
 
170 170
 		// If new form is created.
171
-		if ( ! empty( $new_form ) ) {
171
+		if ( ! empty($new_form)) {
172 172
 			$new_form = array(
173
-				'_give_custom_amount_text' => ( ! empty( $data['form_custom_amount_text'] ) ? $data['form_custom_amount_text'] : 'Custom' ),
173
+				'_give_custom_amount_text' => ( ! empty($data['form_custom_amount_text']) ? $data['form_custom_amount_text'] : 'Custom'),
174 174
 				'_give_logged_in_only'     => 'enabled',
175 175
 				'_give_custom_amount'      => 'enabled',
176 176
 				'_give_payment_import'     => true,
@@ -181,18 +181,18 @@  discard block
 block discarded – undo
181 181
 				'_give_default_gateway'    => 'global',
182 182
 				'_give_show_register_form' => 'both',
183 183
 			);
184
-			$defaults = wp_parse_args( $defaults, $new_form );
184
+			$defaults = wp_parse_args($defaults, $new_form);
185 185
 		}
186 186
 
187
-		$meta = wp_parse_args( $meta, $defaults );
187
+		$meta = wp_parse_args($meta, $defaults);
188 188
 
189
-		foreach ( $meta as $key => $value ) {
190
-			give_update_meta( $form->get_ID(), $key, $value );
189
+		foreach ($meta as $key => $value) {
190
+			give_update_meta($form->get_ID(), $key, $value);
191 191
 		}
192 192
 	}
193 193
 
194 194
 	// update the report
195
-	give_import_donation_report_update( $report );
195
+	give_import_donation_report_update($report);
196 196
 
197 197
 	return $form;
198 198
 }
@@ -206,30 +206,30 @@  discard block
 block discarded – undo
206 206
  *
207 207
  * @return bool|false|WP_User
208 208
  */
209
-function give_import_get_user_from_csv( $data, $import_setting = array() ) {
209
+function give_import_get_user_from_csv($data, $import_setting = array()) {
210 210
 	$report      = give_import_donation_report();
211 211
 	$donor_data  = false;
212 212
 	$customer_id = false;
213 213
 
214 214
 	// check if donor id is not empty
215
-	if ( ! empty( $data['donor_id'] ) ) {
216
-		$donor_data = new Give_Donor( (int) $data['donor_id'] );
217
-		if ( ! empty( $donor_data->id ) ) {
218
-			$report['duplicate_donor'] = ( ! empty( $report['duplicate_donor'] ) ? ( absint( $report['duplicate_donor'] ) + 1 ) : 1 );
215
+	if ( ! empty($data['donor_id'])) {
216
+		$donor_data = new Give_Donor((int) $data['donor_id']);
217
+		if ( ! empty($donor_data->id)) {
218
+			$report['duplicate_donor'] = ( ! empty($report['duplicate_donor']) ? (absint($report['duplicate_donor']) + 1) : 1);
219 219
 		}
220 220
 	}
221 221
 
222
-	if ( empty( $donor_data->id ) && ! empty( $data['user_id'] ) ) {
222
+	if (empty($donor_data->id) && ! empty($data['user_id'])) {
223 223
 		$user_id    = (int) $data['user_id'];
224
-		$donor_data = new Give_Donor( $user_id, true );
224
+		$donor_data = new Give_Donor($user_id, true);
225 225
 
226 226
 
227
-		if ( empty( $donor_data->id ) ) {
228
-			$donor_data = get_user_by( 'id', $user_id );
229
-			if ( ! empty( $donor_data->ID ) ) {
230
-				$first_name = ( ! empty( $data['first_name'] ) ? $data['first_name'] : $donor_data->user_nicename );
231
-				$last_name  = ( ! empty( $data['last_name'] ) ? $data['last_name'] : ( ( $lastname = get_user_meta( $donor_data->ID, 'last_name', true ) ) ? $lastname : '' ) );
232
-				$name       = $first_name . ' ' . $last_name;
227
+		if (empty($donor_data->id)) {
228
+			$donor_data = get_user_by('id', $user_id);
229
+			if ( ! empty($donor_data->ID)) {
230
+				$first_name = ( ! empty($data['first_name']) ? $data['first_name'] : $donor_data->user_nicename);
231
+				$last_name  = ( ! empty($data['last_name']) ? $data['last_name'] : (($lastname = get_user_meta($donor_data->ID, 'last_name', true)) ? $lastname : ''));
232
+				$name       = $first_name.' '.$last_name;
233 233
 				$user_email = $donor_data->user_email;
234 234
 				$donor_args = array(
235 235
 					'name'    => $name,
@@ -238,44 +238,44 @@  discard block
 block discarded – undo
238 238
 				);
239 239
 
240 240
 				$donor_data = new Give_Donor();
241
-				$donor_data->create( $donor_args );
241
+				$donor_data->create($donor_args);
242 242
 
243 243
 				// Adding notes that donor is being imported from CSV.
244 244
 				$current_user = wp_get_current_user();
245
-				$donor_data->add_note( esc_html( wp_sprintf( __( 'This donor was imported by %s', 'give' ), $current_user->user_email ) ) );
245
+				$donor_data->add_note(esc_html(wp_sprintf(__('This donor was imported by %s', 'give'), $current_user->user_email)));
246 246
 
247 247
 				// Add is used to ensure duplicate emails are not added
248
-				if ( $user_email != $data['email'] && ! empty( $data['email'] ) ) {
249
-					$donor_data->add_meta( 'additional_email', $data['email'] );
248
+				if ($user_email != $data['email'] && ! empty($data['email'])) {
249
+					$donor_data->add_meta('additional_email', $data['email']);
250 250
 				}
251 251
 
252
-				$report['create_donor'] = ( ! empty( $report['create_donor'] ) ? ( absint( $report['create_donor'] ) + 1 ) : 1 );
252
+				$report['create_donor'] = ( ! empty($report['create_donor']) ? (absint($report['create_donor']) + 1) : 1);
253 253
 			} else {
254 254
 			}
255 255
 		} else {
256 256
 			// Add is used to ensure duplicate emails are not added
257
-			if ( $donor_data->email != $data['email'] ) {
258
-				$donor_data->add_meta( 'additional_email', ( ! empty( $data['email'] ) ? $data['email'] : $donor_data->email ) );
257
+			if ($donor_data->email != $data['email']) {
258
+				$donor_data->add_meta('additional_email', ( ! empty($data['email']) ? $data['email'] : $donor_data->email));
259 259
 			}
260
-			$report['duplicate_donor'] = ( ! empty( $report['duplicate_donor'] ) ? ( absint( $report['duplicate_donor'] ) + 1 ) : 1 );
260
+			$report['duplicate_donor'] = ( ! empty($report['duplicate_donor']) ? (absint($report['duplicate_donor']) + 1) : 1);
261 261
 		}
262 262
 	}
263 263
 
264
-	if ( empty( $donor_data->id ) && ! empty( $data['email'] ) ) {
264
+	if (empty($donor_data->id) && ! empty($data['email'])) {
265 265
 
266
-		$donor_data = new Give_Donor( $data['email'] );
267
-		if ( empty( $donor_data->id ) ) {
268
-			$donor_data = get_user_by( 'email', $data['email'] );
266
+		$donor_data = new Give_Donor($data['email']);
267
+		if (empty($donor_data->id)) {
268
+			$donor_data = get_user_by('email', $data['email']);
269 269
 
270
-			if ( empty( $donor_data->ID ) && ! empty( $data['first_name'] ) && ! empty( $data['last_name'] ) && isset( $import_setting['create_user'] ) && 1 === absint( $import_setting['create_user'] ) ) {
271
-				$give_role  = (array) give_get_option( 'donor_default_user_role', get_option( 'default_role', ( ( $give_donor = wp_roles()->is_role( 'give_donor' ) ) && ! empty( $give_donor ) ? 'give_donor' : 'subscriber' ) ) );
270
+			if (empty($donor_data->ID) && ! empty($data['first_name']) && ! empty($data['last_name']) && isset($import_setting['create_user']) && 1 === absint($import_setting['create_user'])) {
271
+				$give_role  = (array) give_get_option('donor_default_user_role', get_option('default_role', (($give_donor = wp_roles()->is_role('give_donor')) && ! empty($give_donor) ? 'give_donor' : 'subscriber')));
272 272
 				$donor_args = array(
273 273
 					'user_login'      => $data['email'],
274 274
 					'user_email'      => $data['email'],
275
-					'user_registered' => date( 'Y-m-d H:i:s' ),
275
+					'user_registered' => date('Y-m-d H:i:s'),
276 276
 					'user_first'      => $data['first_name'],
277 277
 					'user_last'       => $data['last_name'],
278
-					'user_pass'       => wp_generate_password( 8, true ),
278
+					'user_pass'       => wp_generate_password(8, true),
279 279
 					'role'            => $give_role,
280 280
 				);
281 281
 
@@ -284,56 +284,56 @@  discard block
 block discarded – undo
284 284
 				 *
285 285
 				 * @since 1.8.13
286 286
 				 */
287
-				$donor_args = (array) apply_filters( 'give_import_insert_user_args', $donor_args, $data, $import_setting );
287
+				$donor_args = (array) apply_filters('give_import_insert_user_args', $donor_args, $data, $import_setting);
288 288
 
289 289
 				// This action was added to remove the login when using the give register function.
290
-				add_filter( 'give_log_user_in_on_register', 'give_log_user_in_on_register_callback', 11 );
291
-				$customer_id = give_register_and_login_new_user( $donor_args );
292
-				remove_filter( 'give_log_user_in_on_register', 'give_log_user_in_on_register_callback', 11 );
290
+				add_filter('give_log_user_in_on_register', 'give_log_user_in_on_register_callback', 11);
291
+				$customer_id = give_register_and_login_new_user($donor_args);
292
+				remove_filter('give_log_user_in_on_register', 'give_log_user_in_on_register_callback', 11);
293 293
 
294
-				update_user_meta( $customer_id, '_give_payment_import', true );
295
-				$donor_data = new Give_Donor( $customer_id, true );
294
+				update_user_meta($customer_id, '_give_payment_import', true);
295
+				$donor_data = new Give_Donor($customer_id, true);
296 296
 			} else {
297
-				$customer_id = ( ! empty( $donor_data->ID ) ? $donor_data->ID : false );
297
+				$customer_id = ( ! empty($donor_data->ID) ? $donor_data->ID : false);
298 298
 			}
299 299
 
300
-			if ( ! empty( $customer_id ) || ( isset( $import_setting['create_user'] ) && 0 === absint( $import_setting['create_user'] ) ) ) {
301
-				$donor_data = new Give_Donor( $customer_id, true );
300
+			if ( ! empty($customer_id) || (isset($import_setting['create_user']) && 0 === absint($import_setting['create_user']))) {
301
+				$donor_data = new Give_Donor($customer_id, true);
302 302
 
303
-				if ( empty( $donor_data->id ) ) {
303
+				if (empty($donor_data->id)) {
304 304
 
305
-					if ( ! empty( $data['form_id'] ) ) {
306
-						$form = new Give_Donate_Form( $data['form_id'] );
305
+					if ( ! empty($data['form_id'])) {
306
+						$form = new Give_Donate_Form($data['form_id']);
307 307
 					}
308 308
 
309
-					$payment_title = ( isset( $data['form_title'] ) ? $data['form_title'] : ( isset( $form ) ? $form->get_name() : esc_html__( 'New Form', 'give' ) ) );
309
+					$payment_title = (isset($data['form_title']) ? $data['form_title'] : (isset($form) ? $form->get_name() : esc_html__('New Form', 'give')));
310 310
 					$donor_args    = array(
311
-						'name'  => ! is_email( $payment_title ) ? $data['first_name'] . ' ' . $data['last_name'] : '',
311
+						'name'  => ! is_email($payment_title) ? $data['first_name'].' '.$data['last_name'] : '',
312 312
 						'email' => $data['email'],
313 313
 					);
314 314
 
315
-					if ( ! empty( $customer_id ) ) {
315
+					if ( ! empty($customer_id)) {
316 316
 						$donor_args['user_id'] = $customer_id;
317 317
 					}
318 318
 
319
-					$donor_data->create( $donor_args );
319
+					$donor_data->create($donor_args);
320 320
 
321 321
 					// Adding notes that donor is being imported from CSV.
322 322
 					$current_user = wp_get_current_user();
323
-					$donor_data->add_note( esc_html( wp_sprintf( __( 'This donor was imported by %s', 'give' ), $current_user->user_email ) ) );
323
+					$donor_data->add_note(esc_html(wp_sprintf(__('This donor was imported by %s', 'give'), $current_user->user_email)));
324 324
 
325
-					$report['create_donor'] = ( ! empty( $report['create_donor'] ) ? ( absint( $report['create_donor'] ) + 1 ) : 1 );
325
+					$report['create_donor'] = ( ! empty($report['create_donor']) ? (absint($report['create_donor']) + 1) : 1);
326 326
 				} else {
327
-					$report['duplicate_donor'] = ( ! empty( $report['duplicate_donor'] ) ? ( absint( $report['duplicate_donor'] ) + 1 ) : 1 );
327
+					$report['duplicate_donor'] = ( ! empty($report['duplicate_donor']) ? (absint($report['duplicate_donor']) + 1) : 1);
328 328
 				}
329 329
 			}
330 330
 		} else {
331
-			$report['duplicate_donor'] = ( ! empty( $report['duplicate_donor'] ) ? ( absint( $report['duplicate_donor'] ) + 1 ) : 1 );
331
+			$report['duplicate_donor'] = ( ! empty($report['duplicate_donor']) ? (absint($report['duplicate_donor']) + 1) : 1);
332 332
 		}
333 333
 	}
334 334
 
335 335
 	// update the report
336
-	give_import_donation_report_update( $report );
336
+	give_import_donation_report_update($report);
337 337
 
338 338
 	return $donor_data;
339 339
 }
@@ -351,9 +351,9 @@  discard block
 block discarded – undo
351 351
 	 *
352 352
 	 * @return array
353 353
 	 */
354
-	return (array) apply_filters( 'give_import_default_options', array(
355
-		'' => __( 'Do not import', 'give' ),
356
-	) );
354
+	return (array) apply_filters('give_import_default_options', array(
355
+		'' => __('Do not import', 'give'),
356
+	));
357 357
 }
358 358
 
359 359
 /**
@@ -369,25 +369,25 @@  discard block
 block discarded – undo
369 369
 	 *
370 370
 	 * @return array
371 371
 	 */
372
-	return (array) apply_filters( 'give_import_donations_options', array(
373
-		'id'          => __( 'Donation ID', 'give' ),
374
-		'amount'      => __( 'Donation Amount', 'give' ),
375
-		'post_date'   => __( 'Donation Date', 'give' ),
376
-		'first_name'  => __( 'Donor First Name', 'give' ),
377
-		'last_name'   => __( 'Donor Last Name', 'give' ),
378
-		'line1'       => __( 'Address 1', 'give' ),
379
-		'line2'       => __( 'Address 2', 'give' ),
380
-		'city'        => __( 'City', 'give' ),
381
-		'state'       => __( 'State', 'give' ),
382
-		'country'     => __( 'Country', 'give' ),
383
-		'zip'         => __( 'Zip', 'give' ),
384
-		'email'       => __( 'Donor Email', 'give' ),
385
-		'post_status' => __( 'Donation Status', 'give' ),
386
-		'gateway'     => __( 'Payment Method', 'give' ),
387
-		'notes'       => __( 'Notes', 'give' ),
388
-		'mode'        => __( 'Test Mode', 'give' ),
389
-		'post_meta'   => __( 'Import as Meta', 'give' ),
390
-	) );
372
+	return (array) apply_filters('give_import_donations_options', array(
373
+		'id'          => __('Donation ID', 'give'),
374
+		'amount'      => __('Donation Amount', 'give'),
375
+		'post_date'   => __('Donation Date', 'give'),
376
+		'first_name'  => __('Donor First Name', 'give'),
377
+		'last_name'   => __('Donor Last Name', 'give'),
378
+		'line1'       => __('Address 1', 'give'),
379
+		'line2'       => __('Address 2', 'give'),
380
+		'city'        => __('City', 'give'),
381
+		'state'       => __('State', 'give'),
382
+		'country'     => __('Country', 'give'),
383
+		'zip'         => __('Zip', 'give'),
384
+		'email'       => __('Donor Email', 'give'),
385
+		'post_status' => __('Donation Status', 'give'),
386
+		'gateway'     => __('Payment Method', 'give'),
387
+		'notes'       => __('Notes', 'give'),
388
+		'mode'        => __('Test Mode', 'give'),
389
+		'post_meta'   => __('Import as Meta', 'give'),
390
+	));
391 391
 }
392 392
 
393 393
 /**
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
 	 *
404 404
 	 * @return array
405 405
 	 */
406
-	return (array) apply_filters( 'give_import_donor_options', array(
407
-		'donor_id' => __( 'Donor ID', 'give' ),
408
-		'user_id'  => __( 'User ID', 'give' ),
409
-	) );
406
+	return (array) apply_filters('give_import_donor_options', array(
407
+		'donor_id' => __('Donor ID', 'give'),
408
+		'user_id'  => __('User ID', 'give'),
409
+	));
410 410
 }
411 411
 
412 412
 /**
@@ -422,12 +422,12 @@  discard block
 block discarded – undo
422 422
 	 *
423 423
 	 * @return array
424 424
 	 */
425
-	return (array) apply_filters( 'give_import_donation_form_options', array(
426
-		'form_title'              => __( 'Donation Form', 'give' ),
427
-		'form_id'                 => __( 'Donation Form ID', 'give' ),
428
-		'form_level'              => __( 'Donation Level', 'give' ),
429
-		'form_custom_amount_text' => __( 'Custom Amount Text', 'give' ),
430
-	) );
425
+	return (array) apply_filters('give_import_donation_form_options', array(
426
+		'form_title'              => __('Donation Form', 'give'),
427
+		'form_id'                 => __('Donation Form ID', 'give'),
428
+		'form_level'              => __('Donation Level', 'give'),
429
+		'form_custom_amount_text' => __('Custom Amount Text', 'give'),
430
+	));
431 431
 }
432 432
 
433 433
 /**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
  * @param int   $start   Start from which csv line.
439 439
  * @param int   $end     End from which csv line.
440 440
  */
441
-function give_get_donation_data_from_csv( $file_id, $start, $end, $delimiter = 'csv' ) {
441
+function give_get_donation_data_from_csv($file_id, $start, $end, $delimiter = 'csv') {
442 442
 	/**
443 443
 	 * Filter to modify delimiter of Import.
444 444
 	 *
@@ -446,19 +446,19 @@  discard block
 block discarded – undo
446 446
 	 *
447 447
 	 * Return string $delimiter.
448 448
 	 */
449
-	$delimiter = (string) apply_filters( 'give_import_delimiter_set', $delimiter );
449
+	$delimiter = (string) apply_filters('give_import_delimiter_set', $delimiter);
450 450
 
451 451
 	$raw_data = array();
452
-	$file_dir = get_attached_file( $file_id );
452
+	$file_dir = get_attached_file($file_id);
453 453
 	$count    = 0;
454
-	if ( false !== ( $handle = fopen( $file_dir, 'r' ) ) ) {
455
-		while ( false !== ( $row = fgetcsv( $handle, 0, $delimiter ) ) ) {
456
-			if ( $count >= $start && $count <= $end ) {
454
+	if (false !== ($handle = fopen($file_dir, 'r'))) {
455
+		while (false !== ($row = fgetcsv($handle, 0, $delimiter))) {
456
+			if ($count >= $start && $count <= $end) {
457 457
 				$raw_data[] = $row;
458 458
 			}
459
-			$count ++;
459
+			$count++;
460 460
 		}
461
-		fclose( $handle );
461
+		fclose($handle);
462 462
 	}
463 463
 
464 464
 	return $raw_data;
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
  *
475 475
  * @return bool
476 476
  */
477
-function give_log_user_in_on_register_callback( $value ) {
477
+function give_log_user_in_on_register_callback($value) {
478 478
 	return false;
479 479
 }
480 480
 
@@ -490,22 +490,22 @@  discard block
 block discarded – undo
490 490
  *
491 491
  * @return bool
492 492
  */
493
-function give_save_import_donation_to_db( $raw_key, $row_data, $main_key = array(), $import_setting = array() ) {
494
-	$data                          = array_combine( $raw_key, $row_data );
493
+function give_save_import_donation_to_db($raw_key, $row_data, $main_key = array(), $import_setting = array()) {
494
+	$data                          = array_combine($raw_key, $row_data);
495 495
 	$price_id                      = false;
496 496
 	$customer_id                   = 0;
497
-	$import_setting['create_user'] = ( isset( $import_setting['create_user'] ) ? $import_setting['create_user'] : 1 );
497
+	$import_setting['create_user'] = (isset($import_setting['create_user']) ? $import_setting['create_user'] : 1);
498 498
 
499
-	$data = (array) apply_filters( 'give_save_import_donation_to_db', $data );
499
+	$data = (array) apply_filters('give_save_import_donation_to_db', $data);
500 500
 
501
-	$data['amount'] = give_maybe_sanitize_amount(  $data['amount'] );
501
+	$data['amount'] = give_maybe_sanitize_amount($data['amount']);
502 502
 
503 503
 	// Here come the login function.
504
-	$donor_data = give_import_get_user_from_csv( $data, $import_setting );
505
-	if ( ! empty( $donor_data->id ) ) {
506
-		if ( ! empty( $donor_data->user_id ) ) {
504
+	$donor_data = give_import_get_user_from_csv($data, $import_setting);
505
+	if ( ! empty($donor_data->id)) {
506
+		if ( ! empty($donor_data->user_id)) {
507 507
 			$customer_id = $donor_data->user_id;
508
-		} elseif ( ! empty( $data['user_id'] ) ) {
508
+		} elseif ( ! empty($data['user_id'])) {
509 509
 			$customer_id = $data['user_id'];
510 510
 		}
511 511
 	} else {
@@ -513,95 +513,95 @@  discard block
 block discarded – undo
513 513
 	}
514 514
 
515 515
 	// get form data or register a form data.
516
-	$form = give_import_get_form_data_from_csv( $data, $import_setting );
517
-	if ( false == $form ) {
516
+	$form = give_import_get_form_data_from_csv($data, $import_setting);
517
+	if (false == $form) {
518 518
 		return false;
519 519
 	} else {
520
-		$price_id = ( ! empty( $form->price_id ) ) ? $form->price_id : false;
520
+		$price_id = ( ! empty($form->price_id)) ? $form->price_id : false;
521 521
 	}
522 522
 
523 523
 
524 524
 	$address = array(
525
-		'line1'   => ( ! empty( $data['line1'] ) ? give_clean( $data['line1'] ) : '' ),
526
-		'line2'   => ( ! empty( $data['line1'] ) ? give_clean( $data['line2'] ) : '' ),
527
-		'city'    => ( ! empty( $data['line1'] ) ? give_clean( $data['city'] ) : '' ),
528
-		'zip'     => ( ! empty( $data['zip'] ) ? give_clean( $data['zip'] ) : '' ),
529
-		'state'   => ( ! empty( $data['state'] ) ? give_clean( $data['state'] ) : '' ),
530
-		'country' => ( ! empty( $data['country'] ) ? ( ( $country_code = array_search( $data['country'], give_get_country_list() ) ) ? $country_code : $data['country'] ) : '' ),
525
+		'line1'   => ( ! empty($data['line1']) ? give_clean($data['line1']) : ''),
526
+		'line2'   => ( ! empty($data['line1']) ? give_clean($data['line2']) : ''),
527
+		'city'    => ( ! empty($data['line1']) ? give_clean($data['city']) : ''),
528
+		'zip'     => ( ! empty($data['zip']) ? give_clean($data['zip']) : ''),
529
+		'state'   => ( ! empty($data['state']) ? give_clean($data['state']) : ''),
530
+		'country' => ( ! empty($data['country']) ? (($country_code = array_search($data['country'], give_get_country_list())) ? $country_code : $data['country']) : ''),
531 531
 	);
532 532
 
533 533
 	//Create payment_data array
534 534
 	$payment_data = array(
535 535
 		'donor_id'        => $donor_data->id,
536 536
 		'price'           => $data['amount'],
537
-		'status'          => ( ! empty( $data['post_status'] ) ? $data['post_status'] : 'publish' ),
537
+		'status'          => ( ! empty($data['post_status']) ? $data['post_status'] : 'publish'),
538 538
 		'currency'        => give_get_currency(),
539 539
 		'user_info'       => array(
540 540
 			'id'         => $customer_id,
541
-			'email'      => ( ! empty( $data['email'] ) ? $data['email'] : ( isset( $donor_data->email ) ? $donor_data->email : false ) ),
542
-			'first_name' => ( ! empty( $data['first_name'] ) ? $data['first_name'] : ( ! empty( $customer_id ) && ( $first_name = get_user_meta( $customer_id, 'first_name', true ) ) ? $first_name : $donor_data->name ) ),
543
-			'last_name'  => ( ! empty( $data['last_name'] ) ? $data['last_name'] : ( ! empty( $customer_id ) && ( $last_name = get_user_meta( $customer_id, 'last_name', true ) ) ? $last_name : $donor_data->name ) ),
541
+			'email'      => ( ! empty($data['email']) ? $data['email'] : (isset($donor_data->email) ? $donor_data->email : false)),
542
+			'first_name' => ( ! empty($data['first_name']) ? $data['first_name'] : ( ! empty($customer_id) && ($first_name = get_user_meta($customer_id, 'first_name', true)) ? $first_name : $donor_data->name)),
543
+			'last_name'  => ( ! empty($data['last_name']) ? $data['last_name'] : ( ! empty($customer_id) && ($last_name = get_user_meta($customer_id, 'last_name', true)) ? $last_name : $donor_data->name)),
544 544
 			'address'    => $address,
545 545
 		),
546
-		'gateway'         => ( ! empty( $data['gateway'] ) && 'offline' != strtolower( $data['gateway'] ) ? strtolower( $data['gateway'] ) : 'manual' ),
547
-		'give_form_title' => ( ! empty( $data['form_title'] ) ? $data['form_title'] : $form->get_name() ),
546
+		'gateway'         => ( ! empty($data['gateway']) && 'offline' != strtolower($data['gateway']) ? strtolower($data['gateway']) : 'manual'),
547
+		'give_form_title' => ( ! empty($data['form_title']) ? $data['form_title'] : $form->get_name()),
548 548
 		'give_form_id'    => (string) $form->get_ID(),
549 549
 		'give_price_id'   => $price_id,
550
-		'purchase_key'    => strtolower( md5( uniqid() ) ),
550
+		'purchase_key'    => strtolower(md5(uniqid())),
551 551
 		'user_email'      => $data['email'],
552
-		'post_date'       => ( ! empty( $data['post_date'] ) ? mysql2date( 'Y-m-d H:i:s', $data['post_date'] ) : current_time( 'mysql' ) ),
553
-		'mode'            => ( ! empty( $data['mode'] ) ? ( 'true' == (string) $data['mode'] || 'TRUE' == (string) $data['mode'] ? 'test' : 'live' ) : ( isset( $import_setting['mode'] ) ? ( true == (bool) $import_setting['mode'] ? 'test' : 'live' ) : ( give_is_test_mode() ? 'test' : 'live' ) ) ),
552
+		'post_date'       => ( ! empty($data['post_date']) ? mysql2date('Y-m-d H:i:s', $data['post_date']) : current_time('mysql')),
553
+		'mode'            => ( ! empty($data['mode']) ? ('true' == (string) $data['mode'] || 'TRUE' == (string) $data['mode'] ? 'test' : 'live') : (isset($import_setting['mode']) ? (true == (bool) $import_setting['mode'] ? 'test' : 'live') : (give_is_test_mode() ? 'test' : 'live'))),
554 554
 	);
555 555
 
556
-	$payment_data = apply_filters( 'give_import_before_import_payment', $payment_data, $data, $donor_data, $form );
556
+	$payment_data = apply_filters('give_import_before_import_payment', $payment_data, $data, $donor_data, $form);
557 557
 
558 558
 	// Get the report
559 559
 	$report = give_import_donation_report();
560 560
 
561 561
 	// Check for duplicate code.
562
-	if ( true === give_check_import_donation_duplicate( $payment_data, $data, $form, $donor_data ) ) {
563
-		$report['duplicate_donation'] = ( ! empty( $report['duplicate_donation'] ) ? ( absint( $report['duplicate_donation'] ) + 1 ) : 1 );
562
+	if (true === give_check_import_donation_duplicate($payment_data, $data, $form, $donor_data)) {
563
+		$report['duplicate_donation'] = ( ! empty($report['duplicate_donation']) ? (absint($report['duplicate_donation']) + 1) : 1);
564 564
 	} else {
565
-		add_action( 'give_update_payment_status', 'give_donation_import_insert_default_payment_note', 1, 1 );
566
-		add_filter( 'give_insert_payment_args', 'give_donation_import_give_insert_payment_args', 11, 2 );
567
-		add_filter( 'give_update_donor_information', 'give_donation_import_update_donor_information', 11, 3 );
568
-		add_action( 'give_insert_payment', 'give_import_donation_insert_payment', 11, 2 );
569
-		$payment = give_insert_payment( $payment_data );
570
-		remove_action( 'give_update_payment_status', 'give_donation_import_insert_default_payment_note', 1 );
571
-		remove_filter( 'give_insert_payment_args', 'give_donation_import_give_insert_payment_args', 11 );
572
-		remove_filter( 'give_update_donor_information', 'give_donation_import_update_donor_information', 11 );
573
-		remove_action( 'give_insert_payment', 'give_import_donation_insert_payment', 11 );
565
+		add_action('give_update_payment_status', 'give_donation_import_insert_default_payment_note', 1, 1);
566
+		add_filter('give_insert_payment_args', 'give_donation_import_give_insert_payment_args', 11, 2);
567
+		add_filter('give_update_donor_information', 'give_donation_import_update_donor_information', 11, 3);
568
+		add_action('give_insert_payment', 'give_import_donation_insert_payment', 11, 2);
569
+		$payment = give_insert_payment($payment_data);
570
+		remove_action('give_update_payment_status', 'give_donation_import_insert_default_payment_note', 1);
571
+		remove_filter('give_insert_payment_args', 'give_donation_import_give_insert_payment_args', 11);
572
+		remove_filter('give_update_donor_information', 'give_donation_import_update_donor_information', 11);
573
+		remove_action('give_insert_payment', 'give_import_donation_insert_payment', 11);
574 574
 
575
-		if ( $payment ) {
575
+		if ($payment) {
576 576
 
577
-			$report['create_donation'] = ( ! empty( $report['create_donation'] ) ? ( absint( $report['create_donation'] ) + 1 ) : 1 );
577
+			$report['create_donation'] = ( ! empty($report['create_donation']) ? (absint($report['create_donation']) + 1) : 1);
578 578
 
579
-			update_post_meta( $payment, '_give_payment_import', true );
579
+			update_post_meta($payment, '_give_payment_import', true);
580 580
 
581
-			if ( ! empty( $import_setting['csv'] ) ) {
582
-				update_post_meta( $payment, '_give_payment_import_id', $import_setting['csv'] );
581
+			if ( ! empty($import_setting['csv'])) {
582
+				update_post_meta($payment, '_give_payment_import_id', $import_setting['csv']);
583 583
 			}
584 584
 
585 585
 			// Insert Notes.
586
-			if ( ! empty( $data['notes'] ) ) {
587
-				give_insert_payment_note( $payment, $data['notes'] );
586
+			if ( ! empty($data['notes'])) {
587
+				give_insert_payment_note($payment, $data['notes']);
588 588
 			}
589 589
 
590
-			$meta_exists = array_keys( $raw_key, 'post_meta' );
591
-			if ( ! empty( $main_key ) && ! empty( $meta_exists ) ) {
592
-				foreach ( $meta_exists as $meta_exist ) {
593
-					if ( ! empty( $main_key[ $meta_exist ] ) && ! empty( $row_data[ $meta_exist ] ) ) {
594
-						update_post_meta( $payment, $main_key[ $meta_exist ], $row_data[ $meta_exist ] );
590
+			$meta_exists = array_keys($raw_key, 'post_meta');
591
+			if ( ! empty($main_key) && ! empty($meta_exists)) {
592
+				foreach ($meta_exists as $meta_exist) {
593
+					if ( ! empty($main_key[$meta_exist]) && ! empty($row_data[$meta_exist])) {
594
+						update_post_meta($payment, $main_key[$meta_exist], $row_data[$meta_exist]);
595 595
 					}
596 596
 				}
597 597
 			}
598 598
 		} else {
599
-			$report['failed_donation'] = ( ! empty( $report['failed_donation'] ) ? ( absint( $report['failed_donation'] ) + 1 ) : 1 );
599
+			$report['failed_donation'] = ( ! empty($report['failed_donation']) ? (absint($report['failed_donation']) + 1) : 1);
600 600
 		}
601 601
 	}
602 602
 
603 603
 	// update the report
604
-	give_import_donation_report_update( $report );
604
+	give_import_donation_report_update($report);
605 605
 
606 606
 	return true;
607 607
 }
@@ -617,12 +617,12 @@  discard block
 block discarded – undo
617 617
  *
618 618
  * @return Give_Donor
619 619
  */
620
-function give_donation_import_update_donor_information( $donor, $payment_id, $payment_data ) {
620
+function give_donation_import_update_donor_information($donor, $payment_id, $payment_data) {
621 621
 	$old_donor = $donor;
622
-	if ( ! empty( $payment_data['donor_id'] ) ) {
623
-		$donor_id = absint( $payment_data['donor_id'] );
624
-		$donor    = new Give_Donor( $donor_id );
625
-		if ( ! empty( $donor->id ) ) {
622
+	if ( ! empty($payment_data['donor_id'])) {
623
+		$donor_id = absint($payment_data['donor_id']);
624
+		$donor    = new Give_Donor($donor_id);
625
+		if ( ! empty($donor->id)) {
626 626
 			return $donor;
627 627
 		}
628 628
 	}
@@ -635,12 +635,12 @@  discard block
 block discarded – undo
635 635
  *
636 636
  * @since 1.8.13
637 637
  */
638
-function give_import_donation_insert_payment( $payment_id, $payment_data ) {
638
+function give_import_donation_insert_payment($payment_id, $payment_data) {
639 639
 	// Update Give Customers purchase_count
640
-	if ( ! empty( $payment_data['status'] ) && ( 'complete' === (string) $payment_data['status'] || 'publish' === (string) $payment_data['status'] ) ) {
641
-		$donor_id = (int) get_post_meta( $payment_id, '_give_payment_customer_id', true );
642
-		if ( ! empty( $donor_id ) ) {
643
-			$donor = new Give_Donor( $donor_id );
640
+	if ( ! empty($payment_data['status']) && ('complete' === (string) $payment_data['status'] || 'publish' === (string) $payment_data['status'])) {
641
+		$donor_id = (int) get_post_meta($payment_id, '_give_payment_customer_id', true);
642
+		if ( ! empty($donor_id)) {
643
+			$donor = new Give_Donor($donor_id);
644 644
 			$donor->increase_purchase_count();
645 645
 		}
646 646
 	}
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
  *
652 652
  * @since 1.8.13
653 653
  */
654
-function give_donation_import_give_insert_payment_args( $args, $payment_data ) {
655
-	if ( ! empty( $payment_data['user_info']['id'] ) ) {
654
+function give_donation_import_give_insert_payment_args($args, $payment_data) {
655
+	if ( ! empty($payment_data['user_info']['id'])) {
656 656
 		$args['post_author'] = (int) $payment_data['user_info']['id'];
657 657
 	}
658 658
 
@@ -664,11 +664,11 @@  discard block
 block discarded – undo
664 664
  *
665 665
  * @since 1.8.13
666 666
  */
667
-function give_check_import_donation_duplicate( $payment_data, $data, $form, $donor_data ) {
667
+function give_check_import_donation_duplicate($payment_data, $data, $form, $donor_data) {
668 668
 	$return = false;
669
-	if ( ! empty( $data['post_date'] ) ) {
670
-		$post_date = mysql2date( 'Y-m-d-H-i-s', $data['post_date'] );
671
-		$post_date = explode( '-', $post_date );
669
+	if ( ! empty($data['post_date'])) {
670
+		$post_date = mysql2date('Y-m-d-H-i-s', $data['post_date']);
671
+		$post_date = explode('-', $post_date);
672 672
 		$args      = array(
673 673
 			'post_type'              => 'give_payment',
674 674
 			'cache_results'          => false,
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 			'meta_query'             => array(
690 690
 				array(
691 691
 					'key'     => '_give_payment_total',
692
-					'value'   => preg_replace( '/[\$,]/', '', $payment_data['price'] ),
692
+					'value'   => preg_replace('/[\$,]/', '', $payment_data['price']),
693 693
 					'compare' => 'LIKE',
694 694
 				),
695 695
 				array(
@@ -706,9 +706,9 @@  discard block
 block discarded – undo
706 706
 			),
707 707
 		);
708 708
 
709
-		$payments  = new Give_Payments_Query( $args );
709
+		$payments  = new Give_Payments_Query($args);
710 710
 		$donations = $payments->get_payments();
711
-		if ( ! empty( $donations ) ) {
711
+		if ( ! empty($donations)) {
712 712
 			return true;
713 713
 		}
714 714
 	}
@@ -725,9 +725,9 @@  discard block
 block discarded – undo
725 725
  *
726 726
  * @return void
727 727
  */
728
-function give_donation_import_insert_default_payment_note( $payment_id ) {
728
+function give_donation_import_insert_default_payment_note($payment_id) {
729 729
 	$current_user = wp_get_current_user();
730
-	give_insert_payment_note( $payment_id, esc_html( wp_sprintf( __( 'This donation was imported by %s', 'give' ), $current_user->user_email ) ) );
730
+	give_insert_payment_note($payment_id, esc_html(wp_sprintf(__('This donation was imported by %s', 'give'), $current_user->user_email)));
731 731
 }
732 732
 
733 733
 /**
@@ -739,14 +739,14 @@  discard block
 block discarded – undo
739 739
  *
740 740
  * @return string URL
741 741
  */
742
-function give_import_page_url( $parameter = array() ) {
742
+function give_import_page_url($parameter = array()) {
743 743
 	$defalut_query_arg = array(
744 744
 		'post_type'     => 'give_forms',
745 745
 		'page'          => 'give-tools',
746 746
 		'tab'           => 'import',
747 747
 		'importer-type' => 'import_donations',
748 748
 	);
749
-	$import_query_arg  = wp_parse_args( $parameter, $defalut_query_arg );
749
+	$import_query_arg = wp_parse_args($parameter, $defalut_query_arg);
750 750
 
751
-	return add_query_arg( $import_query_arg, admin_url( 'edit.php' ) );
751
+	return add_query_arg($import_query_arg, admin_url('edit.php'));
752 752
 }
753 753
\ No newline at end of file
Please login to merge, or discard this patch.
includes/misc-functions.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
  *
859 859
  * @todo  Remove this, when WordPress Core ticket is resolved (https://core.trac.wordpress.org/ticket/16828).
860 860
  *
861
- * @return bool
861
+ * @return false|null
862 862
  */
863 863
 function give_donation_metabox_menu() {
864 864
 
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
  * @since 1.8.13
1449 1449
  *
1450 1450
  * @param array      $list      List of objects or arrays
1451
- * @param int|string $field     Field from the object to place instead of the entire object
1451
+ * @param string $field     Field from the object to place instead of the entire object
1452 1452
  * @param int|string $index_key Optional. Field from the object to use as keys for the new array.
1453 1453
  *                              Default null.
1454 1454
  *
Please login to merge, or discard this patch.
Spacing   +320 added lines, -320 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_is_test_mode() {
25 25
 
26
-	$ret = give_is_setting_enabled( give_get_option( 'test_mode' ) );
26
+	$ret = give_is_setting_enabled(give_get_option('test_mode'));
27 27
 
28
-	return (bool) apply_filters( 'give_is_test_mode', $ret );
28
+	return (bool) apply_filters('give_is_test_mode', $ret);
29 29
 
30 30
 }
31 31
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
  */
38 38
 function give_get_currency() {
39 39
 
40
-	$currency = give_get_option( 'currency', 'USD' );
40
+	$currency = give_get_option('currency', 'USD');
41 41
 
42
-	return apply_filters( 'give_currency', $currency );
42
+	return apply_filters('give_currency', $currency);
43 43
 }
44 44
 
45 45
 /**
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function give_get_currency_position() {
53 53
 
54
-	$currency_pos = give_get_option( 'currency_position', 'before' );
54
+	$currency_pos = give_get_option('currency_position', 'before');
55 55
 
56
-	return apply_filters( 'give_currency_position', $currency_pos );
56
+	return apply_filters('give_currency_position', $currency_pos);
57 57
 }
58 58
 
59 59
 
@@ -66,39 +66,39 @@  discard block
 block discarded – undo
66 66
 
67 67
 function give_get_currencies() {
68 68
 	$currencies = array(
69
-		'USD'  => __( 'US Dollars ($)', 'give' ),
70
-		'EUR'  => __( 'Euros (€)', 'give' ),
71
-		'GBP'  => __( 'Pounds Sterling (£)', 'give' ),
72
-		'AUD'  => __( 'Australian Dollars ($)', 'give' ),
73
-		'BRL'  => __( 'Brazilian Real (R$)', 'give' ),
74
-		'CAD'  => __( 'Canadian Dollars ($)', 'give' ),
75
-		'CZK'  => __( 'Czech Koruna (Kč)', 'give' ),
76
-		'DKK'  => __( 'Danish Krone (kr.)', 'give' ),
77
-		'HKD'  => __( 'Hong Kong Dollar ($)', 'give' ),
78
-		'HUF'  => __( 'Hungarian Forint (Ft)', 'give' ),
79
-		'ILS'  => __( 'Israeli Shekel (₪)', 'give' ),
80
-		'JPY'  => __( 'Japanese Yen (¥)', 'give' ),
81
-		'MYR'  => __( 'Malaysian Ringgits (RM)', 'give' ),
82
-		'MXN'  => __( 'Mexican Peso ($)', 'give' ),
83
-		'MAD'  => __( 'Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give' ),
84
-		'NZD'  => __( 'New Zealand Dollar ($)', 'give' ),
85
-		'NOK'  => __( 'Norwegian Krone (Kr.)', 'give' ),
86
-		'PHP'  => __( 'Philippine Pesos (₱)', 'give' ),
87
-		'PLN'  => __( 'Polish Zloty (zł)', 'give' ),
88
-		'SGD'  => __( 'Singapore Dollar ($)', 'give' ),
89
-		'KRW'  => __( 'South Korean Won (₩)', 'give' ),
90
-		'ZAR'  => __( 'South African Rand (R)', 'give' ),
91
-		'SEK'  => __( 'Swedish Krona (kr)', 'give' ),
92
-		'CHF'  => __( 'Swiss Franc (CHF)', 'give' ),
93
-		'TWD'  => __( 'Taiwan New Dollars (NT$)', 'give' ),
94
-		'THB'  => __( 'Thai Baht (฿)', 'give' ),
95
-		'INR'  => __( 'Indian Rupee (₹)', 'give' ),
96
-		'TRY'  => __( 'Turkish Lira (₺)', 'give' ),
97
-		'RIAL' => __( 'Iranian Rial (﷼)', 'give' ),
98
-		'RUB'  => __( 'Russian Rubles (руб)', 'give' ),
69
+		'USD'  => __('US Dollars ($)', 'give'),
70
+		'EUR'  => __('Euros (€)', 'give'),
71
+		'GBP'  => __('Pounds Sterling (£)', 'give'),
72
+		'AUD'  => __('Australian Dollars ($)', 'give'),
73
+		'BRL'  => __('Brazilian Real (R$)', 'give'),
74
+		'CAD'  => __('Canadian Dollars ($)', 'give'),
75
+		'CZK'  => __('Czech Koruna (Kč)', 'give'),
76
+		'DKK'  => __('Danish Krone (kr.)', 'give'),
77
+		'HKD'  => __('Hong Kong Dollar ($)', 'give'),
78
+		'HUF'  => __('Hungarian Forint (Ft)', 'give'),
79
+		'ILS'  => __('Israeli Shekel (₪)', 'give'),
80
+		'JPY'  => __('Japanese Yen (¥)', 'give'),
81
+		'MYR'  => __('Malaysian Ringgits (RM)', 'give'),
82
+		'MXN'  => __('Mexican Peso ($)', 'give'),
83
+		'MAD'  => __('Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give'),
84
+		'NZD'  => __('New Zealand Dollar ($)', 'give'),
85
+		'NOK'  => __('Norwegian Krone (Kr.)', 'give'),
86
+		'PHP'  => __('Philippine Pesos (₱)', 'give'),
87
+		'PLN'  => __('Polish Zloty (zł)', 'give'),
88
+		'SGD'  => __('Singapore Dollar ($)', 'give'),
89
+		'KRW'  => __('South Korean Won (₩)', 'give'),
90
+		'ZAR'  => __('South African Rand (R)', 'give'),
91
+		'SEK'  => __('Swedish Krona (kr)', 'give'),
92
+		'CHF'  => __('Swiss Franc (CHF)', 'give'),
93
+		'TWD'  => __('Taiwan New Dollars (NT$)', 'give'),
94
+		'THB'  => __('Thai Baht (฿)', 'give'),
95
+		'INR'  => __('Indian Rupee (₹)', 'give'),
96
+		'TRY'  => __('Turkish Lira (₺)', 'give'),
97
+		'RIAL' => __('Iranian Rial (﷼)', 'give'),
98
+		'RUB'  => __('Russian Rubles (руб)', 'give'),
99 99
 	);
100 100
 
101
-	return apply_filters( 'give_currencies', $currencies );
101
+	return apply_filters('give_currencies', $currencies);
102 102
 }
103 103
 
104 104
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
  *
112 112
  * @return array
113 113
  */
114
-function give_currency_symbols( $decode_currencies = false ) {
114
+function give_currency_symbols($decode_currencies = false) {
115 115
 	$currencies = array(
116 116
 		'GBP'  => '&pound;',
117 117
 		'BRL'  => '&#82;&#36;',
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 		'MAD'  => '&#x2e;&#x62f;&#x2e;&#x645;',
144 144
 	);
145 145
 
146
-	if ( $decode_currencies ) {
147
-		$currencies = array_map( 'html_entity_decode', $currencies );
146
+	if ($decode_currencies) {
147
+		$currencies = array_map('html_entity_decode', $currencies);
148 148
 	}
149 149
 
150 150
 	/**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 *
155 155
 	 * @param array $currencies
156 156
 	 */
157
-	return apply_filters( 'give_currency_symbols', $currencies );
157
+	return apply_filters('give_currency_symbols', $currencies);
158 158
 }
159 159
 
160 160
 
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
  *
172 172
  * @return string           The symbol to use for the currency
173 173
  */
174
-function give_currency_symbol( $currency = '', $decode_currency = false ) {
174
+function give_currency_symbol($currency = '', $decode_currency = false) {
175 175
 
176
-	if ( empty( $currency ) ) {
176
+	if (empty($currency)) {
177 177
 		$currency = give_get_currency();
178 178
 	}
179 179
 
180
-	$currencies = give_currency_symbols( $decode_currency );
181
-	$symbol     = array_key_exists( $currency, $currencies ) ? $currencies[ $currency ] : $currency;
180
+	$currencies = give_currency_symbols($decode_currency);
181
+	$symbol     = array_key_exists($currency, $currencies) ? $currencies[$currency] : $currency;
182 182
 
183 183
 	/**
184 184
 	 * Filter the currency symbol
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 * @param string $symbol
189 189
 	 * @param string $currency
190 190
 	 */
191
-	return apply_filters( 'give_currency_symbol', $symbol, $currency );
191
+	return apply_filters('give_currency_symbol', $symbol, $currency);
192 192
 }
193 193
 
194 194
 
@@ -201,13 +201,13 @@  discard block
 block discarded – undo
201 201
  *
202 202
  * @return string
203 203
  */
204
-function give_get_currency_name( $currency_code ) {
204
+function give_get_currency_name($currency_code) {
205 205
 	$currency_name  = '';
206 206
 	$currency_names = give_get_currencies();
207 207
 
208
-	if ( $currency_code && array_key_exists( $currency_code, $currency_names ) ) {
209
-		$currency_name = explode( '(', $currency_names[ $currency_code ] );
210
-		$currency_name = trim( current( $currency_name ) );
208
+	if ($currency_code && array_key_exists($currency_code, $currency_names)) {
209
+		$currency_name = explode('(', $currency_names[$currency_code]);
210
+		$currency_name = trim(current($currency_name));
211 211
 	}
212 212
 
213 213
 	/**
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @param string $currency_name
219 219
 	 * @param string $currency_code
220 220
 	 */
221
-	return apply_filters( 'give_currency_name', $currency_name, $currency_code );
221
+	return apply_filters('give_currency_name', $currency_name, $currency_code);
222 222
 }
223 223
 
224 224
 
@@ -232,18 +232,18 @@  discard block
 block discarded – undo
232 232
 
233 233
 	global $wp;
234 234
 
235
-	if ( get_option( 'permalink_structure' ) ) {
236
-		$base = trailingslashit( home_url( $wp->request ) );
235
+	if (get_option('permalink_structure')) {
236
+		$base = trailingslashit(home_url($wp->request));
237 237
 	} else {
238
-		$base = add_query_arg( $wp->query_string, '', trailingslashit( home_url( $wp->request ) ) );
239
-		$base = remove_query_arg( array( 'post_type', 'name' ), $base );
238
+		$base = add_query_arg($wp->query_string, '', trailingslashit(home_url($wp->request)));
239
+		$base = remove_query_arg(array('post_type', 'name'), $base);
240 240
 	}
241 241
 
242 242
 	$scheme      = is_ssl() ? 'https' : 'http';
243
-	$current_uri = set_url_scheme( $base, $scheme );
243
+	$current_uri = set_url_scheme($base, $scheme);
244 244
 
245
-	if ( is_front_page() ) {
246
-		$current_uri = home_url( '/' );
245
+	if (is_front_page()) {
246
+		$current_uri = home_url('/');
247 247
 	}
248 248
 
249 249
 	/**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	 *
254 254
 	 * @param string $current_uri
255 255
 	 */
256
-	return apply_filters( 'give_get_current_page_url', $current_uri );
256
+	return apply_filters('give_get_current_page_url', $current_uri);
257 257
 
258 258
 }
259 259
 
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
 	 */
276 276
 	$gateways = give_get_enabled_payment_gateways();
277 277
 
278
-	if ( count( $gateways ) == 1 && ! isset( $gateways['paypal'] ) && ! isset( $gateways['manual'] ) ) {
278
+	if (count($gateways) == 1 && ! isset($gateways['paypal']) && ! isset($gateways['manual'])) {
279 279
 		$ret = true;
280
-	} elseif ( count( $gateways ) == 1 ) {
280
+	} elseif (count($gateways) == 1) {
281 281
 		$ret = false;
282
-	} elseif ( count( $gateways ) == 2 && isset( $gateways['paypal'] ) && isset( $gateways['manual'] ) ) {
282
+	} elseif (count($gateways) == 2 && isset($gateways['paypal']) && isset($gateways['manual'])) {
283 283
 		$ret = false;
284 284
 	}
285 285
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 *
291 291
 	 * @param bool $ret
292 292
 	 */
293
-	return (bool) apply_filters( 'give_is_cc_verify_enabled', $ret );
293
+	return (bool) apply_filters('give_is_cc_verify_enabled', $ret);
294 294
 }
295 295
 
296 296
 /**
@@ -302,26 +302,26 @@  discard block
 block discarded – undo
302 302
 function give_get_timezone_id() {
303 303
 
304 304
 	// if site timezone string exists, return it.
305
-	if ( $timezone = get_option( 'timezone_string' ) ) {
305
+	if ($timezone = get_option('timezone_string')) {
306 306
 		return $timezone;
307 307
 	}
308 308
 
309 309
 	// get UTC offset, if it isn't set return UTC.
310
-	if ( ! ( $utc_offset = 3600 * get_option( 'gmt_offset', 0 ) ) ) {
310
+	if ( ! ($utc_offset = 3600 * get_option('gmt_offset', 0))) {
311 311
 		return 'UTC';
312 312
 	}
313 313
 
314 314
 	// attempt to guess the timezone string from the UTC offset.
315
-	$timezone = timezone_name_from_abbr( '', $utc_offset );
315
+	$timezone = timezone_name_from_abbr('', $utc_offset);
316 316
 
317 317
 	// last try, guess timezone string manually.
318
-	if ( $timezone === false ) {
318
+	if ($timezone === false) {
319 319
 
320
-		$is_dst = date( 'I' );
320
+		$is_dst = date('I');
321 321
 
322
-		foreach ( timezone_abbreviations_list() as $abbr ) {
323
-			foreach ( $abbr as $city ) {
324
-				if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset ) {
322
+		foreach (timezone_abbreviations_list() as $abbr) {
323
+			foreach ($abbr as $city) {
324
+				if ($city['dst'] == $is_dst && $city['offset'] == $utc_offset) {
325 325
 					return $city['timezone_id'];
326 326
 				}
327 327
 			}
@@ -345,17 +345,17 @@  discard block
 block discarded – undo
345 345
 
346 346
 	$ip = '127.0.0.1';
347 347
 
348
-	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
348
+	if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) {
349 349
 		// check ip from share internet
350 350
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
351
-	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
351
+	} elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
352 352
 		// to check ip is pass from proxy
353 353
 		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
354
-	} elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
354
+	} elseif ( ! empty($_SERVER['REMOTE_ADDR'])) {
355 355
 		$ip = $_SERVER['REMOTE_ADDR'];
356 356
 	}
357 357
 
358
-	return apply_filters( 'give_get_ip', $ip );
358
+	return apply_filters('give_get_ip', $ip);
359 359
 }
360 360
 
361 361
 
@@ -370,9 +370,9 @@  discard block
 block discarded – undo
370 370
  *
371 371
  * @uses  Give()->session->set()
372 372
  */
373
-function give_set_purchase_session( $purchase_data = array() ) {
374
-	Give()->session->set( 'give_purchase', $purchase_data );
375
-	Give()->session->set( 'give_email', $purchase_data['user_email'] );
373
+function give_set_purchase_session($purchase_data = array()) {
374
+	Give()->session->set('give_purchase', $purchase_data);
375
+	Give()->session->set('give_email', $purchase_data['user_email']);
376 376
 }
377 377
 
378 378
 /**
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
  * @return mixed array | false
387 387
  */
388 388
 function give_get_purchase_session() {
389
-	return Give()->session->get( 'give_purchase' );
389
+	return Give()->session->get('give_purchase');
390 390
 }
391 391
 
392 392
 /**
@@ -398,33 +398,33 @@  discard block
 block discarded – undo
398 398
  *
399 399
  * @return string
400 400
  */
401
-function give_payment_gateway_item_title( $payment_data ) {
402
-	$form_id          = intval( $payment_data['post_data']['give-form-id'] );
401
+function give_payment_gateway_item_title($payment_data) {
402
+	$form_id          = intval($payment_data['post_data']['give-form-id']);
403 403
 	$item_name        = $payment_data['post_data']['give-form-title'];
404
-	$is_custom_amount = give_is_setting_enabled( give_get_meta( $form_id, '_give_custom_amount', true ) );
404
+	$is_custom_amount = give_is_setting_enabled(give_get_meta($form_id, '_give_custom_amount', true));
405 405
 
406 406
 	// Verify has variable prices.
407
-	if ( give_has_variable_prices( $form_id ) && isset( $payment_data['post_data']['give-price-id'] ) ) {
407
+	if (give_has_variable_prices($form_id) && isset($payment_data['post_data']['give-price-id'])) {
408 408
 
409
-		$item_price_level_text = give_get_price_option_name( $form_id, $payment_data['post_data']['give-price-id'] );
410
-		$price_level_amount    = give_get_price_option_amount( $form_id, $payment_data['post_data']['give-price-id'] );
409
+		$item_price_level_text = give_get_price_option_name($form_id, $payment_data['post_data']['give-price-id']);
410
+		$price_level_amount    = give_get_price_option_amount($form_id, $payment_data['post_data']['give-price-id']);
411 411
 
412 412
 		// Donation given doesn't match selected level (must be a custom amount).
413
-		if ( $price_level_amount !== give_maybe_sanitize_amount( $payment_data['post_data']['give-amount'] ) ) {
414
-			$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
413
+		if ($price_level_amount !== give_maybe_sanitize_amount($payment_data['post_data']['give-amount'])) {
414
+			$custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true);
415 415
 
416 416
 			// user custom amount text if any, fallback to default if not.
417
-			$item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', __( 'Custom Amount', 'give' ) );
417
+			$item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', __('Custom Amount', 'give'));
418 418
 
419
-		} elseif ( ! empty( $item_price_level_text ) ) {
419
+		} elseif ( ! empty($item_price_level_text)) {
420 420
 			// Matches a donation level - append level text.
421
-			$item_name .= ' - ' . $item_price_level_text;
421
+			$item_name .= ' - '.$item_price_level_text;
422 422
 		}
423 423
 	} // End if().
424
-	elseif ( $is_custom_amount && give_get_form_price( $form_id ) !== give_maybe_sanitize_amount( $payment_data['post_data']['give-amount'] ) ) {
425
-		$custom_amount_text = give_get_meta( $form_id, '_give_custom_amount_text', true );
424
+	elseif ($is_custom_amount && give_get_form_price($form_id) !== give_maybe_sanitize_amount($payment_data['post_data']['give-amount'])) {
425
+		$custom_amount_text = give_get_meta($form_id, '_give_custom_amount_text', true);
426 426
 		// user custom amount text if any, fallback to default if not.
427
-		$item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', __( 'Custom Amount', 'give' ) );
427
+		$item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', __('Custom Amount', 'give'));
428 428
 	}
429 429
 
430 430
 	/**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	 *
439 439
 	 * @return string
440 440
 	 */
441
-	return apply_filters( 'give_payment_gateway_item_title', $item_name, $form_id, $payment_data );
441
+	return apply_filters('give_payment_gateway_item_title', $item_name, $form_id, $payment_data);
442 442
 }
443 443
 
444 444
 /**
@@ -454,36 +454,36 @@  discard block
 block discarded – undo
454 454
  *
455 455
  * @return string
456 456
  */
457
-function give_payment_gateway_donation_summary( $donation_data, $name_and_email = true, $length = 255 ) {
458
-	$form_id = isset( $donation_data['post_data']['give-form-id'] ) ? $donation_data['post_data']['give-form-id'] : '';
457
+function give_payment_gateway_donation_summary($donation_data, $name_and_email = true, $length = 255) {
458
+	$form_id = isset($donation_data['post_data']['give-form-id']) ? $donation_data['post_data']['give-form-id'] : '';
459 459
 
460 460
 	// Form title.
461
-	$summary = ( ! empty( $donation_data['post_data']['give-form-title'] ) ? $donation_data['post_data']['give-form-title'] : ( ! empty( $form_id ) ? wp_sprintf( __( 'Donation Form ID: %d', 'give' ), $form_id ) : __( 'Untitled donation form', 'give' ) ) );
461
+	$summary = ( ! empty($donation_data['post_data']['give-form-title']) ? $donation_data['post_data']['give-form-title'] : ( ! empty($form_id) ? wp_sprintf(__('Donation Form ID: %d', 'give'), $form_id) : __('Untitled donation form', 'give')));
462 462
 
463 463
 	// Form multilevel if applicable.
464
-	if ( isset( $donation_data['post_data']['give-price-id'] ) ) {
465
-		$summary .= ': ' . give_get_price_option_name( $form_id, $donation_data['post_data']['give-price-id'] );
464
+	if (isset($donation_data['post_data']['give-price-id'])) {
465
+		$summary .= ': '.give_get_price_option_name($form_id, $donation_data['post_data']['give-price-id']);
466 466
 	}
467 467
 
468 468
 	// Add Donor's name + email if requested.
469
-	if ( $name_and_email ) {
469
+	if ($name_and_email) {
470 470
 
471 471
 		// First name
472
-		if ( isset( $donation_data['user_info']['first_name'] ) && ! empty( $donation_data['user_info']['first_name'] ) ) {
473
-			$summary .= ' - ' . $donation_data['user_info']['first_name'];
472
+		if (isset($donation_data['user_info']['first_name']) && ! empty($donation_data['user_info']['first_name'])) {
473
+			$summary .= ' - '.$donation_data['user_info']['first_name'];
474 474
 		}
475 475
 
476
-		if ( isset( $donation_data['user_info']['last_name'] ) && ! empty( $donation_data['user_info']['last_name'] ) ) {
477
-			$summary .= ' ' . $donation_data['user_info']['last_name'];
476
+		if (isset($donation_data['user_info']['last_name']) && ! empty($donation_data['user_info']['last_name'])) {
477
+			$summary .= ' '.$donation_data['user_info']['last_name'];
478 478
 		}
479 479
 
480
-		$summary .= ' (' . $donation_data['user_email'] . ')';
480
+		$summary .= ' ('.$donation_data['user_email'].')';
481 481
 	}
482 482
 
483 483
 	// Cut the length
484
-	$summary = substr( $summary, 0, $length );
484
+	$summary = substr($summary, 0, $length);
485 485
 
486
-	return apply_filters( 'give_payment_gateway_donation_summary', $summary );
486
+	return apply_filters('give_payment_gateway_donation_summary', $summary);
487 487
 }
488 488
 
489 489
 
@@ -498,31 +498,31 @@  discard block
 block discarded – undo
498 498
 function give_get_host() {
499 499
 	$host = false;
500 500
 
501
-	if ( defined( 'WPE_APIKEY' ) ) {
501
+	if (defined('WPE_APIKEY')) {
502 502
 		$host = 'WP Engine';
503
-	} elseif ( defined( 'PAGELYBIN' ) ) {
503
+	} elseif (defined('PAGELYBIN')) {
504 504
 		$host = 'Pagely';
505
-	} elseif ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
505
+	} elseif (DB_HOST == 'localhost:/tmp/mysql5.sock') {
506 506
 		$host = 'ICDSoft';
507
-	} elseif ( DB_HOST == 'mysqlv5' ) {
507
+	} elseif (DB_HOST == 'mysqlv5') {
508 508
 		$host = 'NetworkSolutions';
509
-	} elseif ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
509
+	} elseif (strpos(DB_HOST, 'ipagemysql.com') !== false) {
510 510
 		$host = 'iPage';
511
-	} elseif ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
511
+	} elseif (strpos(DB_HOST, 'ipowermysql.com') !== false) {
512 512
 		$host = 'IPower';
513
-	} elseif ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
513
+	} elseif (strpos(DB_HOST, '.gridserver.com') !== false) {
514 514
 		$host = 'MediaTemple Grid';
515
-	} elseif ( strpos( DB_HOST, '.pair.com' ) !== false ) {
515
+	} elseif (strpos(DB_HOST, '.pair.com') !== false) {
516 516
 		$host = 'pair Networks';
517
-	} elseif ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
517
+	} elseif (strpos(DB_HOST, '.stabletransit.com') !== false) {
518 518
 		$host = 'Rackspace Cloud';
519
-	} elseif ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
519
+	} elseif (strpos(DB_HOST, '.sysfix.eu') !== false) {
520 520
 		$host = 'SysFix.eu Power Hosting';
521
-	} elseif ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
521
+	} elseif (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
522 522
 		$host = 'Flywheel';
523 523
 	} else {
524 524
 		// Adding a general fallback for data gathering
525
-		$host = 'DBH: ' . DB_HOST . ', SRV: ' . $_SERVER['SERVER_NAME'];
525
+		$host = 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME'];
526 526
 	}
527 527
 
528 528
 	return $host;
@@ -538,67 +538,67 @@  discard block
 block discarded – undo
538 538
  *
539 539
  * @return bool true if host matches, false if not
540 540
  */
541
-function give_is_host( $host = false ) {
541
+function give_is_host($host = false) {
542 542
 
543 543
 	$return = false;
544 544
 
545
-	if ( $host ) {
546
-		$host = str_replace( ' ', '', strtolower( $host ) );
545
+	if ($host) {
546
+		$host = str_replace(' ', '', strtolower($host));
547 547
 
548
-		switch ( $host ) {
548
+		switch ($host) {
549 549
 			case 'wpengine':
550
-				if ( defined( 'WPE_APIKEY' ) ) {
550
+				if (defined('WPE_APIKEY')) {
551 551
 					$return = true;
552 552
 				}
553 553
 				break;
554 554
 			case 'pagely':
555
-				if ( defined( 'PAGELYBIN' ) ) {
555
+				if (defined('PAGELYBIN')) {
556 556
 					$return = true;
557 557
 				}
558 558
 				break;
559 559
 			case 'icdsoft':
560
-				if ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
560
+				if (DB_HOST == 'localhost:/tmp/mysql5.sock') {
561 561
 					$return = true;
562 562
 				}
563 563
 				break;
564 564
 			case 'networksolutions':
565
-				if ( DB_HOST == 'mysqlv5' ) {
565
+				if (DB_HOST == 'mysqlv5') {
566 566
 					$return = true;
567 567
 				}
568 568
 				break;
569 569
 			case 'ipage':
570
-				if ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
570
+				if (strpos(DB_HOST, 'ipagemysql.com') !== false) {
571 571
 					$return = true;
572 572
 				}
573 573
 				break;
574 574
 			case 'ipower':
575
-				if ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
575
+				if (strpos(DB_HOST, 'ipowermysql.com') !== false) {
576 576
 					$return = true;
577 577
 				}
578 578
 				break;
579 579
 			case 'mediatemplegrid':
580
-				if ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
580
+				if (strpos(DB_HOST, '.gridserver.com') !== false) {
581 581
 					$return = true;
582 582
 				}
583 583
 				break;
584 584
 			case 'pairnetworks':
585
-				if ( strpos( DB_HOST, '.pair.com' ) !== false ) {
585
+				if (strpos(DB_HOST, '.pair.com') !== false) {
586 586
 					$return = true;
587 587
 				}
588 588
 				break;
589 589
 			case 'rackspacecloud':
590
-				if ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
590
+				if (strpos(DB_HOST, '.stabletransit.com') !== false) {
591 591
 					$return = true;
592 592
 				}
593 593
 				break;
594 594
 			case 'sysfix.eu':
595 595
 			case 'sysfix.eupowerhosting':
596
-				if ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
596
+				if (strpos(DB_HOST, '.sysfix.eu') !== false) {
597 597
 					$return = true;
598 598
 				}
599 599
 				break;
600 600
 			case 'flywheel':
601
-				if ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
601
+				if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
602 602
 					$return = true;
603 603
 				}
604 604
 				break;
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
  * @param string $replacement Optional. The function that should have been called.
632 632
  * @param array  $backtrace   Optional. Contains stack backtrace of deprecated function.
633 633
  */
634
-function _give_deprecated_function( $function, $version, $replacement = null, $backtrace = null ) {
634
+function _give_deprecated_function($function, $version, $replacement = null, $backtrace = null) {
635 635
 
636 636
 	/**
637 637
 	 * Fires while give deprecated function call occurs.
@@ -644,19 +644,19 @@  discard block
 block discarded – undo
644 644
 	 * @param string $replacement Optional. The function that should have been called.
645 645
 	 * @param string $version     The plugin version that deprecated the function.
646 646
 	 */
647
-	do_action( 'give_deprecated_function_run', $function, $replacement, $version );
647
+	do_action('give_deprecated_function_run', $function, $replacement, $version);
648 648
 
649
-	$show_errors = current_user_can( 'manage_options' );
649
+	$show_errors = current_user_can('manage_options');
650 650
 
651 651
 	// Allow plugin to filter the output error trigger.
652
-	if ( WP_DEBUG && apply_filters( 'give_deprecated_function_trigger_error', $show_errors ) ) {
653
-		if ( ! is_null( $replacement ) ) {
654
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give' ), $function, $version, $replacement ) );
655
-			trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
652
+	if (WP_DEBUG && apply_filters('give_deprecated_function_trigger_error', $show_errors)) {
653
+		if ( ! is_null($replacement)) {
654
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give'), $function, $version, $replacement));
655
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
656 656
 			// Alternatively we could dump this to a file.
657 657
 		} else {
658
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give' ), $function, $version ) );
659
-			trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
658
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give'), $function, $version));
659
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
660 660
 			// Alternatively we could dump this to a file.
661 661
 		}
662 662
 	}
@@ -670,8 +670,8 @@  discard block
 block discarded – undo
670 670
  * @return string $post_id
671 671
  */
672 672
 function give_get_admin_post_id() {
673
-	$post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;
674
-	if ( ! $post_id && isset( $_POST['post_id'] ) ) {
673
+	$post_id = isset($_GET['post']) ? $_GET['post'] : null;
674
+	if ( ! $post_id && isset($_POST['post_id'])) {
675 675
 		$post_id = $_POST['post_id'];
676 676
 	}
677 677
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
  * @return string Arg separator output
686 686
  */
687 687
 function give_get_php_arg_separator_output() {
688
-	return ini_get( 'arg_separator.output' );
688
+	return ini_get('arg_separator.output');
689 689
 }
690 690
 
691 691
 
@@ -700,10 +700,10 @@  discard block
 block discarded – undo
700 700
  *
701 701
  * @return string Short month name
702 702
  */
703
-function give_month_num_to_name( $n ) {
704
-	$timestamp = mktime( 0, 0, 0, $n, 1, 2005 );
703
+function give_month_num_to_name($n) {
704
+	$timestamp = mktime(0, 0, 0, $n, 1, 2005);
705 705
 
706
-	return date_i18n( 'M', $timestamp );
706
+	return date_i18n('M', $timestamp);
707 707
 }
708 708
 
709 709
 
@@ -716,10 +716,10 @@  discard block
 block discarded – undo
716 716
  *
717 717
  * @return bool Whether or not function is disabled.
718 718
  */
719
-function give_is_func_disabled( $function ) {
720
-	$disabled = explode( ',', ini_get( 'disable_functions' ) );
719
+function give_is_func_disabled($function) {
720
+	$disabled = explode(',', ini_get('disable_functions'));
721 721
 
722
-	return in_array( $function, $disabled );
722
+	return in_array($function, $disabled);
723 723
 }
724 724
 
725 725
 /**
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 function give_get_newsletter() {
731 731
 	?>
732 732
 
733
-	<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
733
+	<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
734 734
 
735 735
 	<div class="give-newsletter-form-wrap">
736 736
 
@@ -738,33 +738,33 @@  discard block
 block discarded – undo
738 738
 			  method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
739 739
 			  target="_blank" novalidate>
740 740
 			<div class="give-newsletter-confirmation">
741
-				<p><?php esc_html_e( 'Thanks for Subscribing!', 'give' ); ?> :)</p>
741
+				<p><?php esc_html_e('Thanks for Subscribing!', 'give'); ?> :)</p>
742 742
 			</div>
743 743
 
744 744
 			<table class="form-table give-newsletter-form">
745 745
 				<tr valign="middle">
746 746
 					<td>
747 747
 						<label for="mce-EMAIL"
748
-							   class="screen-reader-text"><?php esc_html_e( 'Email Address (required)', 'give' ); ?></label>
748
+							   class="screen-reader-text"><?php esc_html_e('Email Address (required)', 'give'); ?></label>
749 749
 						<input type="email" name="EMAIL" id="mce-EMAIL"
750
-							   placeholder="<?php esc_attr_e( 'Email Address (required)', 'give' ); ?>"
750
+							   placeholder="<?php esc_attr_e('Email Address (required)', 'give'); ?>"
751 751
 							   class="required email" value="">
752 752
 					</td>
753 753
 					<td>
754 754
 						<label for="mce-FNAME"
755
-							   class="screen-reader-text"><?php esc_html_e( 'First Name', 'give' ); ?></label>
755
+							   class="screen-reader-text"><?php esc_html_e('First Name', 'give'); ?></label>
756 756
 						<input type="text" name="FNAME" id="mce-FNAME"
757
-							   placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>" class="" value="">
757
+							   placeholder="<?php esc_attr_e('First Name', 'give'); ?>" class="" value="">
758 758
 					</td>
759 759
 					<td>
760 760
 						<label for="mce-LNAME"
761
-							   class="screen-reader-text"><?php esc_html_e( 'Last Name', 'give' ); ?></label>
761
+							   class="screen-reader-text"><?php esc_html_e('Last Name', 'give'); ?></label>
762 762
 						<input type="text" name="LNAME" id="mce-LNAME"
763
-							   placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>" class="" value="">
763
+							   placeholder="<?php esc_attr_e('Last Name', 'give'); ?>" class="" value="">
764 764
 					</td>
765 765
 					<td>
766 766
 						<input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button"
767
-							   value="<?php esc_attr_e( 'Subscribe', 'give' ); ?>">
767
+							   value="<?php esc_attr_e('Subscribe', 'give'); ?>">
768 768
 					</td>
769 769
 				</tr>
770 770
 			</table>
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
  *
818 818
  * @return string
819 819
  */
820
-function give_svg_icons( $icon ) {
820
+function give_svg_icons($icon) {
821 821
 
822 822
 	// Store your SVGs in an associative array
823 823
 	$svgs = array(
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 	);
830 830
 
831 831
 	// Return the chosen icon's SVG string
832
-	return $svgs[ $icon ];
832
+	return $svgs[$icon];
833 833
 }
834 834
 
835 835
 /**
@@ -841,15 +841,15 @@  discard block
 block discarded – undo
841 841
  *
842 842
  * @return mixed
843 843
  */
844
-function modify_nav_menu_meta_box_object( $post_type ) {
845
-	if ( isset( $post_type->name ) && $post_type->name == 'give_forms' ) {
846
-		$post_type->labels->name = esc_html__( 'Donation Forms', 'give' );
844
+function modify_nav_menu_meta_box_object($post_type) {
845
+	if (isset($post_type->name) && $post_type->name == 'give_forms') {
846
+		$post_type->labels->name = esc_html__('Donation Forms', 'give');
847 847
 	}
848 848
 
849 849
 	return $post_type;
850 850
 }
851 851
 
852
-add_filter( 'nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object' );
852
+add_filter('nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object');
853 853
 
854 854
 /**
855 855
  * Show Donation Forms Post Type in Appearance > Menus by default on fresh install.
@@ -868,35 +868,35 @@  discard block
 block discarded – undo
868 868
 	// Proceed, if current screen is navigation menus.
869 869
 	if (
870 870
 		'nav-menus' === $screen->id &&
871
-		give_is_setting_enabled( give_get_option( 'forms_singular' ) ) &&
872
-		! get_user_option( 'give_is_donation_forms_menu_updated' )
871
+		give_is_setting_enabled(give_get_option('forms_singular')) &&
872
+		! get_user_option('give_is_donation_forms_menu_updated')
873 873
 	) {
874 874
 
875 875
 		// Return false, if it fails to retrieve hidden meta box list and is not admin.
876 876
 		if (
877 877
 			! is_admin() ||
878
-			( ! $hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus' ) )
878
+			( ! $hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus'))
879 879
 		) {
880 880
 			return false;
881 881
 		}
882 882
 
883 883
 		// Return false, In case, we don't find 'Donation Form' in hidden meta box list.
884
-		if ( ! in_array( 'add-post-type-give_forms', $hidden_meta_boxes, true ) ) {
884
+		if ( ! in_array('add-post-type-give_forms', $hidden_meta_boxes, true)) {
885 885
 			return false;
886 886
 		}
887 887
 
888 888
 		// Exclude 'Donation Form' value from hidden meta box's list.
889
-		$hidden_meta_boxes = array_diff( $hidden_meta_boxes, array( 'add-post-type-give_forms' ) );
889
+		$hidden_meta_boxes = array_diff($hidden_meta_boxes, array('add-post-type-give_forms'));
890 890
 
891 891
 		// Get current user ID.
892 892
 		$user = wp_get_current_user();
893 893
 
894
-		update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
895
-		update_user_option( $user->ID, 'give_is_donation_forms_menu_updated', true, true );
894
+		update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
895
+		update_user_option($user->ID, 'give_is_donation_forms_menu_updated', true, true);
896 896
 	}
897 897
 }
898 898
 
899
-add_action( 'current_screen', 'give_donation_metabox_menu' );
899
+add_action('current_screen', 'give_donation_metabox_menu');
900 900
 
901 901
 /**
902 902
  * Array_column backup usage
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
  * @license    https://opensource.org/licenses/MIT MIT
910 910
  */
911 911
 
912
-if ( ! function_exists( 'array_column' ) ) {
912
+if ( ! function_exists('array_column')) {
913 913
 	/**
914 914
 	 * Returns the values from a single column of the input array, identified by
915 915
 	 * the $columnKey.
@@ -928,53 +928,53 @@  discard block
 block discarded – undo
928 928
 	 *
929 929
 	 * @return array
930 930
 	 */
931
-	function array_column( $input = null, $columnKey = null, $indexKey = null ) {
931
+	function array_column($input = null, $columnKey = null, $indexKey = null) {
932 932
 		// Using func_get_args() in order to check for proper number of
933 933
 		// parameters and trigger errors exactly as the built-in array_column()
934 934
 		// does in PHP 5.5.
935 935
 		$argc   = func_num_args();
936 936
 		$params = func_get_args();
937 937
 
938
-		if ( $argc < 2 ) {
939
-			trigger_error( sprintf( esc_html__( 'array_column() expects at least 2 parameters, %s given.', 'give' ), $argc ), E_USER_WARNING );
938
+		if ($argc < 2) {
939
+			trigger_error(sprintf(esc_html__('array_column() expects at least 2 parameters, %s given.', 'give'), $argc), E_USER_WARNING);
940 940
 
941 941
 			return null;
942 942
 		}
943 943
 
944
-		if ( ! is_array( $params[0] ) ) {
945
-			trigger_error( sprintf( esc_html__( 'array_column() expects parameter 1 to be array, %s given.', 'give' ), gettype( $params[0] ) ), E_USER_WARNING );
944
+		if ( ! is_array($params[0])) {
945
+			trigger_error(sprintf(esc_html__('array_column() expects parameter 1 to be array, %s given.', 'give'), gettype($params[0])), E_USER_WARNING);
946 946
 
947 947
 			return null;
948 948
 		}
949 949
 
950
-		if ( ! is_int( $params[1] )
951
-			 && ! is_float( $params[1] )
952
-			 && ! is_string( $params[1] )
950
+		if ( ! is_int($params[1])
951
+			 && ! is_float($params[1])
952
+			 && ! is_string($params[1])
953 953
 			 && $params[1] !== null
954
-			 && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
954
+			 && ! (is_object($params[1]) && method_exists($params[1], '__toString'))
955 955
 		) {
956
-			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
956
+			trigger_error(esc_html__('array_column(): The column key should be either a string or an integer.', 'give'), E_USER_WARNING);
957 957
 
958 958
 			return false;
959 959
 		}
960 960
 
961
-		if ( isset( $params[2] )
962
-			 && ! is_int( $params[2] )
963
-			 && ! is_float( $params[2] )
964
-			 && ! is_string( $params[2] )
965
-			 && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
961
+		if (isset($params[2])
962
+			 && ! is_int($params[2])
963
+			 && ! is_float($params[2])
964
+			 && ! is_string($params[2])
965
+			 && ! (is_object($params[2]) && method_exists($params[2], '__toString'))
966 966
 		) {
967
-			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
967
+			trigger_error(esc_html__('array_column(): The index key should be either a string or an integer.', 'give'), E_USER_WARNING);
968 968
 
969 969
 			return false;
970 970
 		}
971 971
 
972 972
 		$paramsInput     = $params[0];
973
-		$paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null;
973
+		$paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null;
974 974
 
975 975
 		$paramsIndexKey = null;
976
-		if ( isset( $params[2] ) ) {
977
-			if ( is_float( $params[2] ) || is_int( $params[2] ) ) {
976
+		if (isset($params[2])) {
977
+			if (is_float($params[2]) || is_int($params[2])) {
978 978
 				$paramsIndexKey = (int) $params[2];
979 979
 			} else {
980 980
 				$paramsIndexKey = (string) $params[2];
@@ -983,26 +983,26 @@  discard block
 block discarded – undo
983 983
 
984 984
 		$resultArray = array();
985 985
 
986
-		foreach ( $paramsInput as $row ) {
986
+		foreach ($paramsInput as $row) {
987 987
 			$key    = $value = null;
988 988
 			$keySet = $valueSet = false;
989 989
 
990
-			if ( $paramsIndexKey !== null && array_key_exists( $paramsIndexKey, $row ) ) {
990
+			if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) {
991 991
 				$keySet = true;
992
-				$key    = (string) $row[ $paramsIndexKey ];
992
+				$key    = (string) $row[$paramsIndexKey];
993 993
 			}
994 994
 
995
-			if ( $paramsColumnKey === null ) {
995
+			if ($paramsColumnKey === null) {
996 996
 				$valueSet = true;
997 997
 				$value    = $row;
998
-			} elseif ( is_array( $row ) && array_key_exists( $paramsColumnKey, $row ) ) {
998
+			} elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) {
999 999
 				$valueSet = true;
1000
-				$value    = $row[ $paramsColumnKey ];
1000
+				$value    = $row[$paramsColumnKey];
1001 1001
 			}
1002 1002
 
1003
-			if ( $valueSet ) {
1004
-				if ( $keySet ) {
1005
-					$resultArray[ $key ] = $value;
1003
+			if ($valueSet) {
1004
+				if ($keySet) {
1005
+					$resultArray[$key] = $value;
1006 1006
 				} else {
1007 1007
 					$resultArray[] = $value;
1008 1008
 				}
@@ -1022,40 +1022,40 @@  discard block
 block discarded – undo
1022 1022
  *
1023 1023
  * @return bool Whether the receipt is visible or not.
1024 1024
  */
1025
-function give_can_view_receipt( $payment_key = '' ) {
1025
+function give_can_view_receipt($payment_key = '') {
1026 1026
 
1027 1027
 	$return = false;
1028 1028
 
1029
-	if ( empty( $payment_key ) ) {
1029
+	if (empty($payment_key)) {
1030 1030
 		return $return;
1031 1031
 	}
1032 1032
 
1033 1033
 	global $give_receipt_args;
1034 1034
 
1035
-	$give_receipt_args['id'] = give_get_purchase_id_by_key( $payment_key );
1035
+	$give_receipt_args['id'] = give_get_purchase_id_by_key($payment_key);
1036 1036
 
1037
-	$user_id = (int) give_get_payment_user_id( $give_receipt_args['id'] );
1037
+	$user_id = (int) give_get_payment_user_id($give_receipt_args['id']);
1038 1038
 
1039
-	$payment_meta = give_get_payment_meta( $give_receipt_args['id'] );
1039
+	$payment_meta = give_get_payment_meta($give_receipt_args['id']);
1040 1040
 
1041
-	if ( is_user_logged_in() ) {
1042
-		if ( $user_id === (int) get_current_user_id() ) {
1041
+	if (is_user_logged_in()) {
1042
+		if ($user_id === (int) get_current_user_id()) {
1043 1043
 			$return = true;
1044
-		} elseif ( wp_get_current_user()->user_email === give_get_payment_user_email( $give_receipt_args['id'] ) ) {
1044
+		} elseif (wp_get_current_user()->user_email === give_get_payment_user_email($give_receipt_args['id'])) {
1045 1045
 			$return = true;
1046
-		} elseif ( current_user_can( 'view_give_sensitive_data' ) ) {
1046
+		} elseif (current_user_can('view_give_sensitive_data')) {
1047 1047
 			$return = true;
1048 1048
 		}
1049 1049
 	}
1050 1050
 
1051 1051
 	$session = give_get_purchase_session();
1052
-	if ( ! empty( $session ) && ! is_user_logged_in() ) {
1053
-		if ( $session['purchase_key'] === $payment_meta['key'] ) {
1052
+	if ( ! empty($session) && ! is_user_logged_in()) {
1053
+		if ($session['purchase_key'] === $payment_meta['key']) {
1054 1054
 			$return = true;
1055 1055
 		}
1056 1056
 	}
1057 1057
 
1058
-	return (bool) apply_filters( 'give_can_view_receipt', $return, $payment_key );
1058
+	return (bool) apply_filters('give_can_view_receipt', $return, $payment_key);
1059 1059
 
1060 1060
 }
1061 1061
 
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
  *
1065 1065
  * Fallback in case the calendar extension is not loaded in PHP; Only supports Gregorian calendar
1066 1066
  */
1067
-if ( ! function_exists( 'cal_days_in_month' ) ) {
1067
+if ( ! function_exists('cal_days_in_month')) {
1068 1068
 	/**
1069 1069
 	 * cal_days_in_month
1070 1070
 	 *
@@ -1074,8 +1074,8 @@  discard block
 block discarded – undo
1074 1074
 	 *
1075 1075
 	 * @return bool|string
1076 1076
 	 */
1077
-	function cal_days_in_month( $calendar, $month, $year ) {
1078
-		return date( 't', mktime( 0, 0, 0, $month, 1, $year ) );
1077
+	function cal_days_in_month($calendar, $month, $year) {
1078
+		return date('t', mktime(0, 0, 0, $month, 1, $year));
1079 1079
 	}
1080 1080
 }
1081 1081
 
@@ -1094,42 +1094,42 @@  discard block
 block discarded – undo
1094 1094
  */
1095 1095
 function give_get_plugins() {
1096 1096
 	$plugins             = get_plugins();
1097
-	$active_plugin_paths = (array) get_option( 'active_plugins', array() );
1097
+	$active_plugin_paths = (array) get_option('active_plugins', array());
1098 1098
 
1099
-	if ( is_multisite() ) {
1100
-		$network_activated_plugin_paths = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );
1101
-		$active_plugin_paths            = array_merge( $active_plugin_paths, $network_activated_plugin_paths );
1099
+	if (is_multisite()) {
1100
+		$network_activated_plugin_paths = array_keys(get_site_option('active_sitewide_plugins', array()));
1101
+		$active_plugin_paths            = array_merge($active_plugin_paths, $network_activated_plugin_paths);
1102 1102
 	}
1103 1103
 
1104
-	foreach ( $plugins as $plugin_path => $plugin_data ) {
1104
+	foreach ($plugins as $plugin_path => $plugin_data) {
1105 1105
 		// Is plugin active?
1106
-		if ( in_array( $plugin_path, $active_plugin_paths ) ) {
1107
-			$plugins[ $plugin_path ]['Status'] = 'active';
1106
+		if (in_array($plugin_path, $active_plugin_paths)) {
1107
+			$plugins[$plugin_path]['Status'] = 'active';
1108 1108
 		} else {
1109
-			$plugins[ $plugin_path ]['Status'] = 'inactive';
1109
+			$plugins[$plugin_path]['Status'] = 'inactive';
1110 1110
 		}
1111 1111
 
1112
-		$dirname = strtolower( dirname( $plugin_path ) );
1112
+		$dirname = strtolower(dirname($plugin_path));
1113 1113
 
1114 1114
 		// Is plugin a Give add-on by WordImpress?
1115
-		if ( strstr( $dirname, 'give-' ) && strstr( $plugin_data['AuthorURI'], 'wordimpress.com' ) ) {
1115
+		if (strstr($dirname, 'give-') && strstr($plugin_data['AuthorURI'], 'wordimpress.com')) {
1116 1116
 			// Plugin is a Give-addon.
1117
-			$plugins[ $plugin_path ]['Type'] = 'add-on';
1117
+			$plugins[$plugin_path]['Type'] = 'add-on';
1118 1118
 
1119 1119
 			// Get license info from database.
1120
-			$plugin_name    = str_replace( 'Give - ', '', $plugin_data['Name'] );
1121
-			$db_option      = 'give_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $plugin_name ) ) ) . '_license_active';
1122
-			$license_active = get_option( $db_option );
1120
+			$plugin_name    = str_replace('Give - ', '', $plugin_data['Name']);
1121
+			$db_option      = 'give_'.preg_replace('/[^a-zA-Z0-9_\s]/', '', str_replace(' ', '_', strtolower($plugin_name))).'_license_active';
1122
+			$license_active = get_option($db_option);
1123 1123
 
1124 1124
 			// Does a valid license exist?
1125
-			if ( ! empty( $license_active ) && 'valid' === $license_active->license ) {
1126
-				$plugins[ $plugin_path ]['License'] = true;
1125
+			if ( ! empty($license_active) && 'valid' === $license_active->license) {
1126
+				$plugins[$plugin_path]['License'] = true;
1127 1127
 			} else {
1128
-				$plugins[ $plugin_path ]['License'] = false;
1128
+				$plugins[$plugin_path]['License'] = false;
1129 1129
 			}
1130 1130
 		} else {
1131 1131
 			// Plugin is not a Give add-on.
1132
-			$plugins[ $plugin_path ]['Type'] = 'other';
1132
+			$plugins[$plugin_path]['Type'] = 'other';
1133 1133
 		}
1134 1134
 	}
1135 1135
 
@@ -1146,16 +1146,16 @@  discard block
 block discarded – undo
1146 1146
  *
1147 1147
  * @return bool
1148 1148
  */
1149
-function give_is_terms_enabled( $form_id ) {
1150
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1149
+function give_is_terms_enabled($form_id) {
1150
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1151 1151
 
1152 1152
 	if (
1153
-		give_is_setting_enabled( $form_option, 'global' )
1154
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1153
+		give_is_setting_enabled($form_option, 'global')
1154
+		&& give_is_setting_enabled(give_get_option('terms'))
1155 1155
 	) {
1156 1156
 		return true;
1157 1157
 
1158
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1158
+	} elseif (give_is_setting_enabled($form_option)) {
1159 1159
 		return true;
1160 1160
 
1161 1161
 	} else {
@@ -1179,9 +1179,9 @@  discard block
 block discarded – undo
1179 1179
  *
1180 1180
  * @return WP_Error|bool
1181 1181
  */
1182
-function give_delete_donation_stats( $date_range = '', $args = array() ) {
1182
+function give_delete_donation_stats($date_range = '', $args = array()) {
1183 1183
 	// Delete all cache.
1184
-	$status = Give_Cache::delete( Give_Cache::get_options_like( 'give_stats' ) );
1184
+	$status = Give_Cache::delete(Give_Cache::get_options_like('give_stats'));
1185 1185
 
1186 1186
 	/**
1187 1187
 	 * Fire the action when donation stats delete.
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 	 * @param string|array $date_range
1192 1192
 	 * @param array        $args
1193 1193
 	 */
1194
-	do_action( 'give_delete_donation_stats', $status, $date_range, $args );
1194
+	do_action('give_delete_donation_stats', $status, $date_range, $args);
1195 1195
 
1196 1196
 	return $status;
1197 1197
 }
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
  *
1210 1210
  * @return mixed
1211 1211
  */
1212
-function give_get_meta( $id, $meta_key, $single = false, $default = false ) {
1212
+function give_get_meta($id, $meta_key, $single = false, $default = false) {
1213 1213
 	/**
1214 1214
 	 * Filter the meta value
1215 1215
 	 *
@@ -1217,14 +1217,14 @@  discard block
 block discarded – undo
1217 1217
 	 */
1218 1218
 	$meta_value = apply_filters(
1219 1219
 		'give_get_meta',
1220
-		get_post_meta( $id, $meta_key, $single ),
1220
+		get_post_meta($id, $meta_key, $single),
1221 1221
 		$id,
1222 1222
 		$meta_key,
1223 1223
 		$default
1224 1224
 	);
1225 1225
 
1226 1226
 	if (
1227
-		( empty( $meta_key ) || empty( $meta_value ) )
1227
+		(empty($meta_key) || empty($meta_value))
1228 1228
 		&& $default
1229 1229
 	) {
1230 1230
 		$meta_value = $default;
@@ -1245,15 +1245,15 @@  discard block
 block discarded – undo
1245 1245
  *
1246 1246
  * @return mixed
1247 1247
  */
1248
-function give_update_meta( $id, $meta_key, $meta_value, $prev_value = '' ) {
1249
-	$status = update_post_meta( $id, $meta_key, $meta_value, $prev_value );
1248
+function give_update_meta($id, $meta_key, $meta_value, $prev_value = '') {
1249
+	$status = update_post_meta($id, $meta_key, $meta_value, $prev_value);
1250 1250
 
1251 1251
 	/**
1252 1252
 	 * Filter the meta value update status
1253 1253
 	 *
1254 1254
 	 * @since 1.8.8
1255 1255
 	 */
1256
-	return apply_filters( 'give_update_meta', $status, $id, $meta_key, $meta_value );
1256
+	return apply_filters('give_update_meta', $status, $id, $meta_key, $meta_value);
1257 1257
 }
1258 1258
 
1259 1259
 /**
@@ -1267,15 +1267,15 @@  discard block
 block discarded – undo
1267 1267
  *
1268 1268
  * @return mixed
1269 1269
  */
1270
-function give_delete_meta( $id, $meta_key, $meta_value = '' ) {
1271
-	$status = delete_post_meta( $id, $meta_key, $meta_value );
1270
+function give_delete_meta($id, $meta_key, $meta_value = '') {
1271
+	$status = delete_post_meta($id, $meta_key, $meta_value);
1272 1272
 
1273 1273
 	/**
1274 1274
 	 * Filter the meta value delete status
1275 1275
 	 *
1276 1276
 	 * @since 1.8.8
1277 1277
 	 */
1278
-	return apply_filters( 'give_delete_meta', $status, $id, $meta_key, $meta_value );
1278
+	return apply_filters('give_delete_meta', $status, $id, $meta_key, $meta_value);
1279 1279
 }
1280 1280
 
1281 1281
 /**
@@ -1287,15 +1287,15 @@  discard block
 block discarded – undo
1287 1287
  *
1288 1288
  * @return bool                   If the action has been added to the completed actions array
1289 1289
  */
1290
-function give_has_upgrade_completed( $upgrade_action = '' ) {
1290
+function give_has_upgrade_completed($upgrade_action = '') {
1291 1291
 
1292
-	if ( empty( $upgrade_action ) ) {
1292
+	if (empty($upgrade_action)) {
1293 1293
 		return false;
1294 1294
 	}
1295 1295
 
1296 1296
 	$completed_upgrades = give_get_completed_upgrades();
1297 1297
 
1298
-	return in_array( $upgrade_action, $completed_upgrades );
1298
+	return in_array($upgrade_action, $completed_upgrades);
1299 1299
 
1300 1300
 }
1301 1301
 
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
  * @return mixed   When nothing to resume returns false, otherwise starts the upgrade where it left off
1308 1308
  */
1309 1309
 function give_maybe_resume_upgrade() {
1310
-	$doing_upgrade = get_option( 'give_doing_upgrade', false );
1311
-	if ( empty( $doing_upgrade ) ) {
1310
+	$doing_upgrade = get_option('give_doing_upgrade', false);
1311
+	if (empty($doing_upgrade)) {
1312 1312
 		return false;
1313 1313
 	}
1314 1314
 
@@ -1324,9 +1324,9 @@  discard block
 block discarded – undo
1324 1324
  *
1325 1325
  * @return bool                   If the function was successfully added
1326 1326
  */
1327
-function give_set_upgrade_complete( $upgrade_action = '' ) {
1327
+function give_set_upgrade_complete($upgrade_action = '') {
1328 1328
 
1329
-	if ( empty( $upgrade_action ) ) {
1329
+	if (empty($upgrade_action)) {
1330 1330
 		return false;
1331 1331
 	}
1332 1332
 
@@ -1334,16 +1334,16 @@  discard block
 block discarded – undo
1334 1334
 	$completed_upgrades[] = $upgrade_action;
1335 1335
 
1336 1336
 	// Remove any blanks, and only show uniques.
1337
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
1337
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
1338 1338
 
1339 1339
 	/**
1340 1340
 	 * Fire the action when any upgrade set to complete.
1341 1341
 	 *
1342 1342
 	 * @since 1.8.12
1343 1343
 	 */
1344
-	do_action( 'give_set_upgrade_completed', $upgrade_action, $completed_upgrades );
1344
+	do_action('give_set_upgrade_completed', $upgrade_action, $completed_upgrades);
1345 1345
 
1346
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
1346
+	return update_option('give_completed_upgrades', $completed_upgrades);
1347 1347
 }
1348 1348
 
1349 1349
 /**
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
  * @return array The array of completed upgrades
1354 1354
  */
1355 1355
 function give_get_completed_upgrades() {
1356
-	return (array) get_option( 'give_completed_upgrades' );
1356
+	return (array) get_option('give_completed_upgrades');
1357 1357
 }
1358 1358
 
1359 1359
 /**
@@ -1363,21 +1363,21 @@  discard block
 block discarded – undo
1363 1363
  *
1364 1364
  * @param \WP_Query
1365 1365
  */
1366
-function give_remove_pages_from_search( $query ) {
1367
-	if ( ! $query->is_admin && $query->is_search && $query->is_main_query() ) {
1368
-		$transaction_failed = give_get_option( 'failure_page', 0 );
1369
-		$success_page       = give_get_option( 'success_page', 0 );
1366
+function give_remove_pages_from_search($query) {
1367
+	if ( ! $query->is_admin && $query->is_search && $query->is_main_query()) {
1368
+		$transaction_failed = give_get_option('failure_page', 0);
1369
+		$success_page       = give_get_option('success_page', 0);
1370 1370
 		$args               = apply_filters(
1371 1371
 			'give_remove_pages_from_search', array(
1372 1372
 				$transaction_failed,
1373 1373
 				$success_page,
1374 1374
 			), $query
1375 1375
 		);
1376
-		$query->set( 'post__not_in', $args );
1376
+		$query->set('post__not_in', $args);
1377 1377
 	}
1378 1378
 }
1379 1379
 
1380
-add_action( 'pre_get_posts', 'give_remove_pages_from_search', 10, 1 );
1380
+add_action('pre_get_posts', 'give_remove_pages_from_search', 10, 1);
1381 1381
 
1382 1382
 /**
1383 1383
  * Inserts a new key/value before a key in the array.
@@ -1393,14 +1393,14 @@  discard block
 block discarded – undo
1393 1393
  *
1394 1394
  * @see   array_insert_before()
1395 1395
  */
1396
-function give_array_insert_before( $key, array &$array, $new_key, $new_value ) {
1397
-	if ( array_key_exists( $key, $array ) ) {
1396
+function give_array_insert_before($key, array &$array, $new_key, $new_value) {
1397
+	if (array_key_exists($key, $array)) {
1398 1398
 		$new = array();
1399
-		foreach ( $array as $k => $value ) {
1400
-			if ( $k === $key ) {
1401
-				$new[ $new_key ] = $new_value;
1399
+		foreach ($array as $k => $value) {
1400
+			if ($k === $key) {
1401
+				$new[$new_key] = $new_value;
1402 1402
 			}
1403
-			$new[ $k ] = $value;
1403
+			$new[$k] = $value;
1404 1404
 		}
1405 1405
 
1406 1406
 		return $new;
@@ -1423,13 +1423,13 @@  discard block
 block discarded – undo
1423 1423
  *
1424 1424
  * @see   array_insert_before()
1425 1425
  */
1426
-function give_array_insert_after( $key, array &$array, $new_key, $new_value ) {
1427
-	if ( array_key_exists( $key, $array ) ) {
1426
+function give_array_insert_after($key, array &$array, $new_key, $new_value) {
1427
+	if (array_key_exists($key, $array)) {
1428 1428
 		$new = array();
1429
-		foreach ( $array as $k => $value ) {
1430
-			$new[ $k ] = $value;
1431
-			if ( $k === $key ) {
1432
-				$new[ $new_key ] = $new_value;
1429
+		foreach ($array as $k => $value) {
1430
+			$new[$k] = $value;
1431
+			if ($k === $key) {
1432
+				$new[$new_key] = $new_value;
1433 1433
 			}
1434 1434
 		}
1435 1435
 
@@ -1456,21 +1456,21 @@  discard block
 block discarded – undo
1456 1456
  *               corresponding to `$index_key`. If `$index_key` is null, array keys from the original
1457 1457
  *               `$list` will be preserved in the results.
1458 1458
  */
1459
-function give_list_pluck( $list, $field, $index_key = null ) {
1459
+function give_list_pluck($list, $field, $index_key = null) {
1460 1460
 
1461
-	if ( ! $index_key ) {
1461
+	if ( ! $index_key) {
1462 1462
 		/*
1463 1463
 		 * This is simple. Could at some point wrap array_column()
1464 1464
 		 * if we knew we had an array of arrays.
1465 1465
 		 */
1466
-		foreach ( $list as $key => $value ) {
1467
-			if ( is_object( $value ) ) {
1468
-				if ( isset( $value->$field ) ) {
1469
-					$list[ $key ] = $value->$field;
1466
+		foreach ($list as $key => $value) {
1467
+			if (is_object($value)) {
1468
+				if (isset($value->$field)) {
1469
+					$list[$key] = $value->$field;
1470 1470
 				}
1471 1471
 			} else {
1472
-				if ( isset( $value[ $field ] ) ) {
1473
-					$list[ $key ] = $value[ $field ];
1472
+				if (isset($value[$field])) {
1473
+					$list[$key] = $value[$field];
1474 1474
 				}
1475 1475
 			}
1476 1476
 		}
@@ -1483,18 +1483,18 @@  discard block
 block discarded – undo
1483 1483
 	 * to the end of the stack. This is how array_column() behaves.
1484 1484
 	 */
1485 1485
 	$newlist = array();
1486
-	foreach ( $list as $value ) {
1487
-		if ( is_object( $value ) ) {
1488
-			if ( isset( $value->$index_key ) ) {
1489
-				$newlist[ $value->$index_key ] = $value->$field;
1486
+	foreach ($list as $value) {
1487
+		if (is_object($value)) {
1488
+			if (isset($value->$index_key)) {
1489
+				$newlist[$value->$index_key] = $value->$field;
1490 1490
 			} else {
1491 1491
 				$newlist[] = $value->$field;
1492 1492
 			}
1493 1493
 		} else {
1494
-			if ( isset( $value[ $index_key ] ) ) {
1495
-				$newlist[ $value[ $index_key ] ] = $value[ $field ];
1494
+			if (isset($value[$index_key])) {
1495
+				$newlist[$value[$index_key]] = $value[$field];
1496 1496
 			} else {
1497
-				$newlist[] = $value[ $field ];
1497
+				$newlist[] = $value[$field];
1498 1498
 			}
1499 1499
 		}
1500 1500
 	}
@@ -1517,8 +1517,8 @@  discard block
 block discarded – undo
1517 1517
  *
1518 1518
  * @return int|false Meta ID on success, false on failure.
1519 1519
  */
1520
-function add_donor_meta( $donor_id, $meta_key, $meta_value, $unique = false ) {
1521
-	return add_metadata( 'give_customer', $donor_id, $meta_key, $meta_value, $unique );
1520
+function add_donor_meta($donor_id, $meta_key, $meta_value, $unique = false) {
1521
+	return add_metadata('give_customer', $donor_id, $meta_key, $meta_value, $unique);
1522 1522
 }
1523 1523
 
1524 1524
 /**
@@ -1536,8 +1536,8 @@  discard block
 block discarded – undo
1536 1536
  *
1537 1537
  * @return bool True on success, false on failure.
1538 1538
  */
1539
-function delete_donor_meta( $donor_id, $meta_key, $meta_value = '' ) {
1540
-	return delete_metadata( 'give_customer', $donor_id, $meta_key, $meta_value );
1539
+function delete_donor_meta($donor_id, $meta_key, $meta_value = '') {
1540
+	return delete_metadata('give_customer', $donor_id, $meta_key, $meta_value);
1541 1541
 }
1542 1542
 
1543 1543
 /**
@@ -1552,8 +1552,8 @@  discard block
 block discarded – undo
1552 1552
  * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
1553 1553
  *  is true.
1554 1554
  */
1555
-function get_donor_meta( $donor_id, $key = '', $single = false ) {
1556
-	return get_metadata( 'give_customer', $donor_id, $key, $single );
1555
+function get_donor_meta($donor_id, $key = '', $single = false) {
1556
+	return get_metadata('give_customer', $donor_id, $key, $single);
1557 1557
 }
1558 1558
 
1559 1559
 /**
@@ -1570,8 +1570,8 @@  discard block
 block discarded – undo
1570 1570
  *
1571 1571
  * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure.
1572 1572
  */
1573
-function update_donor_meta( $donor_id, $meta_key, $meta_value, $prev_value = '' ) {
1574
-	return update_metadata( 'give_customer', $donor_id, $meta_key, $meta_value, $prev_value );
1573
+function update_donor_meta($donor_id, $meta_key, $meta_value, $prev_value = '') {
1574
+	return update_metadata('give_customer', $donor_id, $meta_key, $meta_value, $prev_value);
1575 1575
 }
1576 1576
 
1577 1577
 /*
@@ -1581,15 +1581,15 @@  discard block
 block discarded – undo
1581 1581
  *
1582 1582
  * @param int $form_id Form id of which recalculation needs to be done.
1583 1583
  */
1584
-function give_recount_form_income_donation( $form_id = false ) {
1584
+function give_recount_form_income_donation($form_id = false) {
1585 1585
 	// Check if form id is not empty.
1586
-	if ( ! empty( $form_id ) ) {
1586
+	if ( ! empty($form_id)) {
1587 1587
 		/**
1588 1588
 		 * Filter to modify payment status.
1589 1589
 		 *
1590 1590
 		 * @since 1.8.13
1591 1591
 		 */
1592
-		$accepted_statuses = apply_filters( 'give_recount_accepted_statuses', array( 'publish' ) );
1592
+		$accepted_statuses = apply_filters('give_recount_accepted_statuses', array('publish'));
1593 1593
 
1594 1594
 		/**
1595 1595
 		 * Filter to modify args of payment query before recalculating the form total
@@ -1600,7 +1600,7 @@  discard block
 block discarded – undo
1600 1600
 			'give_recount_form_stats_args', array(
1601 1601
 				'give_forms'     => $form_id,
1602 1602
 				'status'         => $accepted_statuses,
1603
-				'posts_per_page' => - 1,
1603
+				'posts_per_page' => -1,
1604 1604
 				'fields'         => 'ids',
1605 1605
 			)
1606 1606
 		);
@@ -1610,28 +1610,28 @@  discard block
 block discarded – undo
1610 1610
 			'earnings' => 0,
1611 1611
 		);
1612 1612
 
1613
-		$payments = new Give_Payments_Query( $args );
1613
+		$payments = new Give_Payments_Query($args);
1614 1614
 		$payments = $payments->get_payments();
1615 1615
 
1616
-		if ( $payments ) {
1617
-			foreach ( $payments as $payment ) {
1616
+		if ($payments) {
1617
+			foreach ($payments as $payment) {
1618 1618
 				// Ensure acceptible status only
1619
-				if ( ! in_array( $payment->post_status, $accepted_statuses ) ) {
1619
+				if ( ! in_array($payment->post_status, $accepted_statuses)) {
1620 1620
 					continue;
1621 1621
 				}
1622 1622
 
1623 1623
 				// Ensure only payments for this form are counted
1624
-				if ( $payment->form_id != $form_id ) {
1624
+				if ($payment->form_id != $form_id) {
1625 1625
 					continue;
1626 1626
 				}
1627 1627
 
1628
-				$totals['sales'] ++;
1628
+				$totals['sales']++;
1629 1629
 				$totals['earnings'] += $payment->total;
1630 1630
 
1631 1631
 			}
1632 1632
 		}
1633
-		give_update_meta( $form_id, '_give_form_sales', $totals['sales'] );
1634
-		give_update_meta( $form_id, '_give_form_earnings', give_sanitize_amount_for_db( $totals['earnings'] ) );
1633
+		give_update_meta($form_id, '_give_form_sales', $totals['sales']);
1634
+		give_update_meta($form_id, '_give_form_earnings', give_sanitize_amount_for_db($totals['earnings']));
1635 1635
 	}// End if().
1636 1636
 }
1637 1637
 
@@ -1662,7 +1662,7 @@  discard block
 block discarded – undo
1662 1662
 	);
1663 1663
 
1664 1664
 	// Check for Zero Based Currency.
1665
-	if ( in_array( give_get_currency(), $zero_based_currency ) ) {
1665
+	if (in_array(give_get_currency(), $zero_based_currency)) {
1666 1666
 		return true;
1667 1667
 	}
1668 1668
 
Please login to merge, or discard this patch.
templates/email-login-form.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
 
8 8
 global $give_access_form_outputted;
9 9
 $show_form = true;
10
-$email     = isset( $_POST['give_email'] ) ? $_POST['give_email'] : '';
10
+$email     = isset($_POST['give_email']) ? $_POST['give_email'] : '';
11 11
 
12 12
 // reCAPTCHA
13
-$recaptcha_key    = give_get_option( 'recaptcha_key' );
14
-$recaptcha_secret = give_get_option( 'recaptcha_secret' );
15
-$enable_recaptcha = ( ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ) ? true : false;
13
+$recaptcha_key    = give_get_option('recaptcha_key');
14
+$recaptcha_secret = give_get_option('recaptcha_secret');
15
+$enable_recaptcha = ( ! empty($recaptcha_key) && ! empty($recaptcha_secret)) ? true : false;
16 16
 
17 17
 // Only output the form once.
18
-if ( $give_access_form_outputted ) {
18
+if ($give_access_form_outputted) {
19 19
 	return;
20 20
 }
21 21
 
22 22
 // Form submission
23
-if ( is_email( $email ) && wp_verify_nonce( $_POST['_wpnonce'], 'give' ) ) {
23
+if (is_email($email) && wp_verify_nonce($_POST['_wpnonce'], 'give')) {
24 24
 
25 25
 	// Use reCAPTCHA
26
-	if ( $enable_recaptcha ) {
26
+	if ($enable_recaptcha) {
27 27
 
28 28
 		$args = array(
29 29
 			'secret'   => $recaptcha_secret,
@@ -31,68 +31,68 @@  discard block
 block discarded – undo
31 31
 			'remoteip' => $_POST['give_ip'],
32 32
 		);
33 33
 
34
-		if ( ! empty( $args['response'] ) ) {
35
-			$request = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array(
34
+		if ( ! empty($args['response'])) {
35
+			$request = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', array(
36 36
 				'body' => $args,
37
-			) );
38
-			if ( ! is_wp_error( $request ) || 200 == wp_remote_retrieve_response_code( $request ) ) {
37
+			));
38
+			if ( ! is_wp_error($request) || 200 == wp_remote_retrieve_response_code($request)) {
39 39
 
40
-				$response = json_decode( $request['body'], true );
40
+				$response = json_decode($request['body'], true);
41 41
 
42 42
 				// reCAPTCHA fail
43
-				if ( ! $response['success'] ) {
44
-					give_set_error( 'give_recaptcha_test_failed', apply_filters( 'give_recaptcha_test_failed_message', esc_html__( 'reCAPTCHA test failed.', 'give' ) ) );
43
+				if ( ! $response['success']) {
44
+					give_set_error('give_recaptcha_test_failed', apply_filters('give_recaptcha_test_failed_message', esc_html__('reCAPTCHA test failed.', 'give')));
45 45
 				}
46 46
 			} else {
47 47
 
48 48
 				// Connection issue
49
-				give_set_error( 'give_recaptcha_connection_issue', apply_filters( 'give_recaptcha_connection_issue_message', esc_html__( 'Unable to connect to reCAPTCHA server.', 'give' ) ) );
49
+				give_set_error('give_recaptcha_connection_issue', apply_filters('give_recaptcha_connection_issue_message', esc_html__('Unable to connect to reCAPTCHA server.', 'give')));
50 50
 
51 51
 			}
52 52
 		} // End if().
53 53
 		else {
54 54
 
55
-			give_set_error( 'give_recaptcha_failed', apply_filters( 'give_recaptcha_failed_message', esc_html__( 'It looks like the reCAPTCHA test has failed.', 'give' ) ) );
55
+			give_set_error('give_recaptcha_failed', apply_filters('give_recaptcha_failed_message', esc_html__('It looks like the reCAPTCHA test has failed.', 'give')));
56 56
 
57 57
 		}
58 58
 	}
59 59
 
60 60
 	// If no errors or only expired token key error - then send email
61
-	if ( ! give_get_errors() ) {
61
+	if ( ! give_get_errors()) {
62 62
 
63
-		$donor = Give()->donors->get_donor_by( 'email', $email );
63
+		$donor = Give()->donors->get_donor_by('email', $email);
64 64
 
65
-		if ( isset( $donor->id ) ) {
66
-			if ( Give()->email_access->can_send_email( $donor->id ) ) {
67
-				Give()->email_access->send_email( $donor->id, $email );
65
+		if (isset($donor->id)) {
66
+			if (Give()->email_access->can_send_email($donor->id)) {
67
+				Give()->email_access->send_email($donor->id, $email);
68 68
 				$show_form = false;
69 69
 			}
70 70
 		} else {
71
-			give_set_error( 'give_no_donor_email_exists', apply_filters( 'give_no_donor_email_exists_message', __( 'It looks like that donor email address does not exist.', 'give' ) ) );
71
+			give_set_error('give_no_donor_email_exists', apply_filters('give_no_donor_email_exists_message', __('It looks like that donor email address does not exist.', 'give')));
72 72
 		}
73 73
 	}
74 74
 }// End if().
75 75
 
76 76
 // Print any messages & errors
77
-Give()->notices->render_frontend_notices( 0 );
77
+Give()->notices->render_frontend_notices(0);
78 78
 
79 79
 // Show the email login form?
80
-if ( $show_form ) { ?>
80
+if ($show_form) { ?>
81 81
 	<div class="give-form">
82 82
 
83 83
 		<?php
84
-		if ( ! give_get_errors() ) {
85
-			Give()->notices->print_frontend_notice( apply_filters( 'give_email_access_message', __( 'Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give' ) ), true );
84
+		if ( ! give_get_errors()) {
85
+			Give()->notices->print_frontend_notice(apply_filters('give_email_access_message', __('Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give')), true);
86 86
 		} ?>
87 87
 
88 88
 		<form method="post" action="" id="give-email-access-form">
89
-			<label for="give-email"><?php esc_html__( 'Donation Email:', 'give' ); ?></label>
90
-			<input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e( 'Your donation email', 'give' ); ?>" />
91
-			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>" />
89
+			<label for="give-email"><?php esc_html__('Donation Email:', 'give'); ?></label>
90
+			<input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e('Your donation email', 'give'); ?>" />
91
+			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>" />
92 92
 
93 93
 			<?php
94 94
 			// Enable reCAPTCHA?
95
-			if ( $enable_recaptcha ) { ?>
95
+			if ($enable_recaptcha) { ?>
96 96
 
97 97
 				<script>
98 98
 									//IP verify for reCAPTCHA
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 				<input type="hidden" name="give_ip" class="give_ip" value="" />
111 111
 			<?php } ?>
112 112
 
113
-			<input type="submit" class="give-submit" value="<?php esc_attr_e( 'Email access token', 'give' ); ?>" />
113
+			<input type="submit" class="give-submit" value="<?php esc_attr_e('Email access token', 'give'); ?>" />
114 114
 		</form>
115 115
 	</div>
116 116
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	Give()->notices->print_frontend_notice(
122 122
 		sprintf(
123 123
 		/* translators: %s: user email address */
124
-			esc_html__( 'An email with an access link has been sent to %s.', 'give' ),
124
+			esc_html__('An email with an access link has been sent to %s.', 'give'),
125 125
 			$email
126 126
 		),
127 127
 		true,
Please login to merge, or discard this patch.
templates/history-donations.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 					<?php
95 95
 					// Display View Receipt or.
96 96
 					if ( 'publish' !== $post->post_status
97
-					     && 'subscription' !== $post->post_status
97
+						 && 'subscription' !== $post->post_status
98 98
 					) : ?>
99 99
 						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span
100 100
 									class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;'; ?></span></a>
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // User's Donations.
7
-if ( is_user_logged_in() ) {
8
-	$donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' );
9
-} elseif ( Give()->email_access->token_exists ) {
7
+if (is_user_logged_in()) {
8
+	$donations = give_get_users_donations(get_current_user_id(), 20, true, 'any');
9
+} elseif (Give()->email_access->token_exists) {
10 10
 	// Email Access Token?
11
-	$donations = give_get_users_donations( 0, 20, true, 'any' );
12
-} elseif ( Give()->session->get_session_expiration() !== false ) {
11
+	$donations = give_get_users_donations(0, 20, true, 'any');
12
+} elseif (Give()->session->get_session_expiration() !== false) {
13 13
 	// Session active?
14
-	$email     = Give()->session->get( 'give_email' );
15
-	$donations = give_get_users_donations( $email, 20, true, 'any' );
14
+	$email     = Give()->session->get('give_email');
15
+	$donations = give_get_users_donations($email, 20, true, 'any');
16 16
 }
17 17
 
18
-if ( $donations ) : ?>
18
+if ($donations) : ?>
19 19
 	<table id="give_user_history" class="give-table">
20 20
 		<thead>
21 21
 		<tr class="give-donation-row">
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 			 *
28 28
 			 * @since 1.7
29 29
 			 */
30
-			do_action( 'give_donation_history_header_before' );
30
+			do_action('give_donation_history_header_before');
31 31
 			?>
32
-			<th scope="col" class="give-donation-id"><?php esc_html_e( 'ID', 'give' ); ?></th>
33
-			<th scope="col" class="give-donation-date"><?php esc_html_e( 'Date', 'give' ); ?></th>
34
-			<th scope="col" class="give-donation-amount"><?php esc_html_e( 'Amount', 'give' ); ?></th>
35
-			<th scope="col" class="give-donation-details"><?php esc_html_e( 'Details', 'give' ); ?></th>
32
+			<th scope="col" class="give-donation-id"><?php esc_html_e('ID', 'give'); ?></th>
33
+			<th scope="col" class="give-donation-date"><?php esc_html_e('Date', 'give'); ?></th>
34
+			<th scope="col" class="give-donation-amount"><?php esc_html_e('Amount', 'give'); ?></th>
35
+			<th scope="col" class="give-donation-details"><?php esc_html_e('Details', 'give'); ?></th>
36 36
 			<?php
37 37
 			/**
38 38
 			 * Fires in current user donation history table, after the header row ends.
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 			 *
42 42
 			 * @since 1.7
43 43
 			 */
44
-			do_action( 'give_donation_history_header_after' );
44
+			do_action('give_donation_history_header_after');
45 45
 			?>
46 46
 		</tr>
47 47
 		</thead>
48
-		<?php foreach ( $donations as $post ) :
49
-			setup_postdata( $post );
50
-			$donation_data = give_get_payment_meta( $post->ID ); ?>
48
+		<?php foreach ($donations as $post) :
49
+			setup_postdata($post);
50
+			$donation_data = give_get_payment_meta($post->ID); ?>
51 51
 			<tr class="give-donation-row">
52 52
 				<?php
53 53
 				/**
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
 				 * @param int   $post_id       The ID of the post.
61 61
 				 * @param mixed $donation_data Payment meta data.
62 62
 				 */
63
-				do_action( 'give_donation_history_row_start', $post->ID, $donation_data );
63
+				do_action('give_donation_history_row_start', $post->ID, $donation_data);
64 64
 				?>
65
-				<td class="give-donation-id">#<?php echo give_get_payment_number( $post->ID ); ?></td>
66
-				<td class="give-donation-date"><?php echo date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ); ?></td>
65
+				<td class="give-donation-id">#<?php echo give_get_payment_number($post->ID); ?></td>
66
+				<td class="give-donation-date"><?php echo date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))); ?></td>
67 67
 				<td class="give-donation-amount">
68 68
 					<span class="give-donation-amount">
69 69
 					<?php
70
-					$currency_code = give_get_payment_currency_code( $post->ID );
70
+					$currency_code = give_get_payment_currency_code($post->ID);
71 71
 					$donation_amount = give_currency_filter(
72
-						give_format_amount( give_get_payment_amount( $post->ID ), array(
72
+						give_format_amount(give_get_payment_amount($post->ID), array(
73 73
 							'sanitize' => false,
74 74
 							'currency' => $currency_code
75
-						) ),
75
+						)),
76 76
 						$currency_code
77 77
 					);
78 78
 
@@ -86,20 +86,20 @@  discard block
 block discarded – undo
86 86
 					 *
87 87
 					 * @return int
88 88
 					 */
89
-					echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID );
89
+					echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID);
90 90
 					?>
91 91
 					</span>
92 92
 				</td>
93 93
 				<td class="give-donation-details">
94 94
 					<?php
95 95
 					// Display View Receipt or.
96
-					if ( 'publish' !== $post->post_status
96
+					if ('publish' !== $post->post_status
97 97
 					     && 'subscription' !== $post->post_status
98 98
 					) : ?>
99
-						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span
100
-									class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;'; ?></span></a>
99
+						<a href="<?php echo esc_url(add_query_arg('payment_key', give_get_payment_key($post->ID), give_get_history_page_uri())); ?>"><span
100
+									class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__('View', 'give').' '.give_get_payment_status($post, true).' &raquo;'; ?></span></a>
101 101
 					<?php else : ?>
102
-						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><?php esc_html_e( 'View Receipt &raquo;', 'give' ); ?></a>
102
+						<a href="<?php echo esc_url(add_query_arg('payment_key', give_get_payment_key($post->ID), give_get_history_page_uri())); ?>"><?php esc_html_e('View Receipt &raquo;', 'give'); ?></a>
103 103
 					<?php endif; ?>
104 104
 				</td>
105 105
 				<?php
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 				 * @param int   $post_id       The ID of the post.
114 114
 				 * @param mixed $donation_data Payment meta data.
115 115
 				 */
116
-				do_action( 'give_donation_history_row_end', $post->ID, $donation_data );
116
+				do_action('give_donation_history_row_end', $post->ID, $donation_data);
117 117
 				?>
118 118
 			</tr>
119 119
 		<?php endforeach; ?>
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
 	<div id="give-donation-history-pagination" class="give_pagination navigation">
122 122
 		<?php
123 123
 		$big = 999999;
124
-		echo paginate_links( array(
125
-			'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
124
+		echo paginate_links(array(
125
+			'base'    => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
126 126
 			'format'  => '?paged=%#%',
127
-			'current' => max( 1, get_query_var( 'paged' ) ),
128
-			'total'   => ceil( give_count_donations_of_donor() / 20 ) // 20 items per page
129
-		) );
127
+			'current' => max(1, get_query_var('paged')),
128
+			'total'   => ceil(give_count_donations_of_donor() / 20) // 20 items per page
129
+		));
130 130
 		?>
131 131
 	</div>
132 132
 	<?php wp_reset_postdata(); ?>
133 133
 <?php else : ?>
134
-	<?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
134
+	<?php Give()->notices->print_frontend_notice(esc_html__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?>
135 135
 <?php endif;
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,8 +98,11 @@  discard block
 block discarded – undo
98 98
 					) : ?>
99 99
 						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><span
100 100
 									class="give-donation-status <?php echo $post->post_status; ?>"><?php echo esc_html__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;'; ?></span></a>
101
-					<?php else : ?>
102
-						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) ); ?>"><?php esc_html_e( 'View Receipt &raquo;', 'give' ); ?></a>
101
+					<?php else {
102
+	: ?>
103
+						<a href="<?php echo esc_url( add_query_arg( 'payment_key', give_get_payment_key( $post->ID ), give_get_history_page_uri() ) );
104
+}
105
+?>"><?php esc_html_e( 'View Receipt &raquo;', 'give' ); ?></a>
103 106
 					<?php endif; ?>
104 107
 				</td>
105 108
 				<?php
@@ -130,6 +133,9 @@  discard block
 block discarded – undo
130 133
 		?>
131 134
 	</div>
132 135
 	<?php wp_reset_postdata(); ?>
133
-<?php else : ?>
134
-	<?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
136
+<?php else {
137
+	: ?>
138
+	<?php Give()->notices->print_frontend_notice( esc_html__( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' );
139
+}
140
+?>
135 141
 <?php endif;
Please login to merge, or discard this patch.