Test Failed
Pull Request — master (#2211)
by Ravinder
05:56 queued 47s
created
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/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.
templates/shortcode-receipt.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@  discard block
 block discarded – undo
6 6
 global $give_receipt_args, $payment;
7 7
 
8 8
 // Validation: Ensure $payment var is set.
9
-if ( empty( $payment ) ) {
10
-	$payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0;
9
+if (empty($payment)) {
10
+	$payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0;
11 11
 }
12 12
 
13 13
 // Double-Validation: Check for $payment global.
14
-if ( empty( $payment ) ) {
15
-	Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) );
14
+if (empty($payment)) {
15
+	Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give'));
16 16
 
17 17
 	return;
18 18
 }
19 19
 
20 20
 $donation_id  = $payment->ID;
21
-$form_id      = give_get_payment_meta( $donation_id, '_give_payment_form_id', true );
22
-$meta         = give_get_payment_meta( $donation_id );
23
-$donation     = give_get_payment_form_title( $meta );
24
-$user         = give_get_payment_meta_user_info( $donation_id );
25
-$email        = give_get_payment_user_email( $donation_id );
21
+$form_id      = give_get_payment_meta($donation_id, '_give_payment_form_id', true);
22
+$meta         = give_get_payment_meta($donation_id);
23
+$donation     = give_get_payment_form_title($meta);
24
+$user         = give_get_payment_meta_user_info($donation_id);
25
+$email        = give_get_payment_user_email($donation_id);
26 26
 $status       = $payment->post_status;
27
-$status_label = give_get_payment_status( $payment, true );
27
+$status_label = give_get_payment_status($payment, true);
28 28
 
29 29
 /**
30 30
  * Generate Donation Receipt Arguments.
@@ -35,50 +35,50 @@  discard block
 block discarded – undo
35 35
  * @since 1.8.8
36 36
  */
37 37
 $give_receipt_args['donation_receipt']['donor'] = array(
38
-	'name'    => __( 'Donor', 'give' ),
39
-	'value'   => $user['first_name'] . ' ' . $user['last_name'],
38
+	'name'    => __('Donor', 'give'),
39
+	'value'   => $user['first_name'].' '.$user['last_name'],
40 40
 	'display' => $give_receipt_args['donor'],
41 41
 );
42 42
 
43 43
 $give_receipt_args['donation_receipt']['date'] = array(
44
-	'name'    => __( 'Date', 'give' ),
45
-	'value'   => date_i18n( give_date_format(), strtotime( $meta['date'] ) ),
44
+	'name'    => __('Date', 'give'),
45
+	'value'   => date_i18n(give_date_format(), strtotime($meta['date'])),
46 46
 	'display' => $give_receipt_args['date'],
47 47
 );
48 48
 
49 49
 $give_receipt_args['donation_receipt']['total_donation'] = array(
50
-	'name'    => __( 'Total Donation', 'give' ),
51
-	'value'   => give_payment_amount( $donation_id ),
50
+	'name'    => __('Total Donation', 'give'),
51
+	'value'   => give_payment_amount($donation_id),
52 52
 	'display' => $give_receipt_args['price'],
53 53
 );
54 54
 
55 55
 $give_receipt_args['donation_receipt']['donation'] = array(
56
-	'name'    => __( 'Donation', 'give' ),
56
+	'name'    => __('Donation', 'give'),
57 57
 	'value'   => $donation,
58 58
 	'display' => true,
59 59
 );
60 60
 
61 61
 $give_receipt_args['donation_receipt']['donation_status'] = array(
62
-	'name'    => __( 'Donation Status', 'give' ),
63
-	'value'   => esc_attr( $status_label ),
62
+	'name'    => __('Donation Status', 'give'),
63
+	'value'   => esc_attr($status_label),
64 64
 	'display' => $give_receipt_args['payment_status'],
65 65
 );
66 66
 
67 67
 $give_receipt_args['donation_receipt']['donation_id'] = array(
68
-	'name'    => __( 'Donation ID', 'give' ),
68
+	'name'    => __('Donation ID', 'give'),
69 69
 	'value'   => $donation_id,
70 70
 	'display' => $give_receipt_args['payment_id'],
71 71
 );
72 72
 
73 73
 $give_receipt_args['donation_receipt']['payment_key'] = array(
74
-	'name'    => __( 'Payment Key', 'give' ),
75
-	'value'   => get_post_meta( $donation_id, '_give_payment_purchase_key', true ),
74
+	'name'    => __('Payment Key', 'give'),
75
+	'value'   => get_post_meta($donation_id, '_give_payment_purchase_key', true),
76 76
 	'display' => $give_receipt_args['payment_key'],
77 77
 );
78 78
 
79 79
 $give_receipt_args['donation_receipt']['payment_method'] = array(
80
-	'name'    => __( 'Payment Method', 'give' ),
81
-	'value'   => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ),
80
+	'name'    => __('Payment Method', 'give'),
81
+	'value'   => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)),
82 82
 	'display' => $give_receipt_args['payment_method'],
83 83
 );
84 84
 
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
  *
94 94
  * @since 1.8.8
95 95
  */
96
-$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id );
96
+$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id);
97 97
 
98 98
 // When the donation were made through offline donation, We won't show receipt and payment status though.
99
-if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) {
99
+if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) {
100 100
 
101 101
 	/**
102 102
 	 * Before the offline donation receipt content starts.
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 	 * @param Give_Payment $payment           Donation payment object.
107 107
 	 * @param array        $give_receipt_args Receipt Arguments.
108 108
 	 */
109
-	do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args );
109
+	do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args);
110 110
 	?>
111
-	<h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2>
112
-	<div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>">
111
+	<h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2>
112
+	<div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>">
113 113
 		<?php
114 114
 		// Instruction for offline donation.
115
-		$offline_instruction = give_get_offline_payment_instruction( $form_id, true );
115
+		$offline_instruction = give_get_offline_payment_instruction($form_id, true);
116 116
 
117 117
 		/**
118 118
 		 * Instruction for the offline donation.
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		 * @param Give_Payment $payment             Payment object.
124 124
 		 * @param integer      $form_id             Donation form id.
125 125
 		 */
126
-		echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id );
126
+		echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id);
127 127
 		?>
128 128
 	</div>
129 129
 	<?php
@@ -135,52 +135,52 @@  discard block
 block discarded – undo
135 135
 	 * @param Give_Payment $payment           Donation payment object.
136 136
 	 * @param array        $give_receipt_args Receipt Arguments.
137 137
 	 */
138
-	do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args );
138
+	do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args);
139 139
 
140 140
 	return;
141 141
 }
142 142
 
143 143
 // Show payment status notice based on shortcode attribute.
144
-if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) {
144
+if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) {
145 145
 	$notice_message = '';
146 146
 	$notice_type    = 'warning';
147 147
 
148
-	switch ( $status ) {
148
+	switch ($status) {
149 149
 		case 'publish':
150
-			$notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' );
150
+			$notice_message = __('Payment Complete: Thank you for your donation.', 'give');
151 151
 			$notice_type    = 'success';
152 152
 			break;
153 153
 		case 'pending':
154
-			$notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' );
154
+			$notice_message = __('Payment Pending: Your donation is currently processing.', 'give');
155 155
 			$notice_type    = 'warning';
156 156
 			break;
157 157
 		case 'refunded':
158
-			$notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' );
158
+			$notice_message = __('Payment Refunded: Your donation has been refunded.', 'give');
159 159
 			$notice_type    = 'warning';
160 160
 			break;
161 161
 		case 'preapproval':
162
-			$notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' );
162
+			$notice_message = __('Payment Preapproved: Thank you for your donation.', 'give');
163 163
 			$notice_type    = 'warning';
164 164
 			break;
165 165
 		case 'failed':
166
-			$notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' );
166
+			$notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give');
167 167
 			$notice_type    = 'error';
168 168
 			break;
169 169
 		case 'cancelled':
170
-			$notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' );
170
+			$notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give');
171 171
 			$notice_type    = 'error';
172 172
 			break;
173 173
 		case 'abandoned':
174
-			$notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' );
174
+			$notice_message = __('Payment Abandoned: This donation has not been completed.', 'give');
175 175
 			$notice_type    = 'error';
176 176
 			break;
177 177
 		case 'revoked':
178
-			$notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' );
178
+			$notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give');
179 179
 			$notice_type    = 'error';
180 180
 			break;
181 181
 	}
182 182
 
183
-	if ( ! empty( $notice_message ) ) {
183
+	if ( ! empty($notice_message)) {
184 184
 		/**
185 185
 		 * Filters payment status notice for receipts.
186 186
 		 *
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		 * @param string $status Payment status.
196 196
 		 * @param array  $meta   Array of meta data related to the payment.
197 197
 		 */
198
-		echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $meta );
198
+		echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $meta);
199 199
 	}
200 200
 }// End if().
201 201
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
  * @param object $payment           The payment object.
210 210
  * @param array  $give_receipt_args Receipt_argument.
211 211
  */
212
-do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args );
212
+do_action('give_payment_receipt_before_table', $payment, $give_receipt_args);
213 213
 ?>
214 214
 
215 215
 <table id="give_donation_receipt" class="give-table">
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	 * @param object $payment           The payment object.
226 226
 	 * @param array  $give_receipt_args Receipt_argument.
227 227
 	 */
228
-	do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args );
228
+	do_action('give_payment_receipt_header_before', $payment, $give_receipt_args);
229 229
 	?>
230 230
 	<tr>
231 231
 		<th scope="colgroup" colspan="2">
232
-			<span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span>
232
+			<span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span>
233 233
 		</th>
234 234
 	</tr>
235 235
 	<?php
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 * @param object $payment           The payment object.
244 244
 	 * @param array  $give_receipt_args Receipt_argument.
245 245
 	 */
246
-	do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args );
246
+	do_action('give_payment_receipt_header_after', $payment, $give_receipt_args);
247 247
 	?>
248 248
 	</thead>
249 249
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 	 * @param object $payment           The payment object.
260 260
 	 * @param array  $give_receipt_args Receipt_argument.
261 261
 	 */
262
-	do_action( 'give_payment_receipt_before', $payment, $give_receipt_args );
262
+	do_action('give_payment_receipt_before', $payment, $give_receipt_args);
263 263
 	?>
264 264
 
265
-	<?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?>
266
-		<?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
265
+	<?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?>
266
+		<?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?>
267 267
 			<tr>
268 268
 				<td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td>
269 269
 				<td><?php echo $receipt_item['value']; ?></td>
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 * @param object $payment           The payment object.
283 283
 	 * @param array  $give_receipt_args Receipt_argument.
284 284
 	 */
285
-	do_action( 'give_payment_receipt_after', $payment, $give_receipt_args );
285
+	do_action('give_payment_receipt_after', $payment, $give_receipt_args);
286 286
 	?>
287 287
 	</tbody>
288 288
 </table>
@@ -298,5 +298,5 @@  discard block
 block discarded – undo
298 298
  * @param object $payment           The payment object.
299 299
  * @param array  $give_receipt_args Receipt_argument.
300 300
  */
301
-do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args );
301
+do_action('give_payment_receipt_after_table', $payment, $give_receipt_args);
302 302
 ?>
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ):
12
+if (is_user_logged_in()):
13 13
 	$user_id = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16 16
 	$display_name = $current_user->display_name;
17
-	$address      = give_get_donor_address( $user_id );
17
+	$address      = give_get_donor_address($user_id);
18 18
 
19
-	if ( isset( $_GET['updated'] ) && $_GET['updated'] == true && ! give_get_errors() ): ?>
19
+	if (isset($_GET['updated']) && $_GET['updated'] == true && ! give_get_errors()): ?>
20 20
 		<p class="give_success">
21
-			<strong><?php esc_html_e( 'Success:', 'give' ); ?></strong> <?php esc_html_e( 'Your profile has been updated.', 'give' ); ?>
21
+			<strong><?php esc_html_e('Success:', 'give'); ?></strong> <?php esc_html_e('Your profile has been updated.', 'give'); ?>
22 22
 		</p>
23 23
 	<?php endif; ?>
24 24
 
25
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
25
+	<?php Give()->notices->render_frontend_notices(0); ?>
26 26
 
27 27
 	<?php
28 28
 	/**
@@ -32,39 +32,39 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @since 1.0
34 34
 	 */
35
-	do_action( 'give_profile_editor_before' );
35
+	do_action('give_profile_editor_before');
36 36
 	?>
37 37
 
38 38
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post">
39 39
 
40 40
 		<fieldset>
41
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
41
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
42 42
 
43
-			<h3 id="give_personal_information_label" class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
43
+			<h3 id="give_personal_information_label" class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
44 44
 
45 45
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
46
-				<label for="give_first_name"><?php _e( 'First Name', 'give' ); ?></label>
47
-				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr( $first_name ); ?>"/>
46
+				<label for="give_first_name"><?php _e('First Name', 'give'); ?></label>
47
+				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr($first_name); ?>"/>
48 48
 			</p>
49 49
 
50 50
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
51
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
52
-				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr( $last_name ); ?>"/>
51
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
52
+				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr($last_name); ?>"/>
53 53
 			</p>
54 54
 
55 55
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
56
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
56
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
57 57
 				<select name="give_display_name" id="give_display_name" class="select give-select">
58
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
59
-						<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
58
+					<?php if ( ! empty($current_user->first_name)): ?>
59
+						<option <?php selected($display_name, $current_user->first_name); ?> value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
60 60
 					<?php endif; ?>
61
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
62
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
63
-						<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
61
+					<option <?php selected($display_name, $current_user->user_nicename); ?> value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
62
+					<?php if ( ! empty($current_user->last_name)): ?>
63
+						<option <?php selected($display_name, $current_user->last_name); ?> value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
64 64
 					<?php endif; ?>
65
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
66
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
67
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
65
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
66
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
67
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
68 68
 					<?php endif; ?>
69 69
 				</select>
70 70
 				<?php
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 				 *
76 76
 				 * @since 1.0
77 77
 				 */
78
-				do_action( 'give_profile_editor_name' );
78
+				do_action('give_profile_editor_name');
79 79
 				?>
80 80
 			</p>
81 81
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			 *
88 88
 			 * @since 1.0
89 89
 			 */
90
-			do_action( 'give_profile_editor_after_name' );
90
+			do_action('give_profile_editor_after_name');
91 91
 			?>
92 92
 
93 93
 			<p class="form-row form-row-last form-row-responsive">
94
-				<label for="give_email"><?php _e( 'Email Address', 'give' ); ?></label>
95
-				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
94
+				<label for="give_email"><?php _e('Email Address', 'give'); ?></label>
95
+				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
96 96
 				<?php
97 97
 				/**
98 98
 				 * Fires in the profile editor shortcode, to the email section.
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				 *
102 102
 				 * @since 1.0
103 103
 				 */
104
-				do_action( 'give_profile_editor_email' );
104
+				do_action('give_profile_editor_email');
105 105
 				?>
106 106
 			</p>
107 107
 
@@ -113,33 +113,33 @@  discard block
 block discarded – undo
113 113
 			 *
114 114
 			 * @since 1.0
115 115
 			 */
116
-			do_action( 'give_profile_editor_after_email' );
116
+			do_action('give_profile_editor_after_email');
117 117
 			?>
118 118
 
119
-			<h3 id="give_profile_billing_address_label" class="give-section-break"><?php _e( 'Change your Billing Address', 'give' ); ?></h3>
119
+			<h3 id="give_profile_billing_address_label" class="give-section-break"><?php _e('Change your Billing Address', 'give'); ?></h3>
120 120
 
121 121
 			<div id="give_profile_billing_address_wrap">
122 122
 				<?php
123 123
 				// Get selected country from address.
124
-				$selected_country = ( ! empty( $address['country'] ) ? $address['country'] : '' );
124
+				$selected_country = ( ! empty($address['country']) ? $address['country'] : '');
125 125
 
126 126
 				$selected_state = '';
127
-				if ( $selected_country === give_get_country() ) {
127
+				if ($selected_country === give_get_country()) {
128 128
 					// Get default selected state by admin.
129 129
 					$selected_state = give_get_state();
130 130
 				}
131 131
 
132 132
 				// Get selected state from address.
133
-				$selected_state = ! empty( $address['state'] ) ? $address['state'] : $selected_state;
133
+				$selected_state = ! empty($address['state']) ? $address['state'] : $selected_state;
134 134
 
135
-				$label        = __( 'State', 'give' );
135
+				$label        = __('State', 'give');
136 136
 				$states_label = give_get_states_label();
137 137
 				// Check if $country code exists in the array key for states label.
138
-				if ( array_key_exists( $selected_country, $states_label ) ) {
139
-					$label = $states_label[ $selected_country ];
138
+				if (array_key_exists($selected_country, $states_label)) {
139
+					$label = $states_label[$selected_country];
140 140
 				}
141 141
 
142
-				$states = give_get_states( $selected_country );
142
+				$states = give_get_states($selected_country);
143 143
 
144 144
 				// Get the country list that do not have any states init.
145 145
 				$no_states_country = give_no_states_country_list();
@@ -149,39 +149,39 @@  discard block
 block discarded – undo
149 149
 				?>
150 150
 
151 151
 				<p id="give-card-country-wrap" class="form-row form-row-wide">
152
-					<label for="give_address_country"><?php _e( 'Country', 'give' ); ?></label>
152
+					<label for="give_address_country"><?php _e('Country', 'give'); ?></label>
153 153
 					<select name="give_address_country" id="give_address_country" class="select give-select">
154
-						<?php foreach ( give_get_country_list() as $key => $country ) : ?>
155
-							<option value="<?php echo $key; ?>"<?php selected( $selected_country, $key ); ?>><?php echo esc_html( $country ); ?></option>
154
+						<?php foreach (give_get_country_list() as $key => $country) : ?>
155
+							<option value="<?php echo $key; ?>"<?php selected($selected_country, $key); ?>><?php echo esc_html($country); ?></option>
156 156
 						<?php endforeach; ?>
157 157
 					</select>
158 158
 				</p>
159 159
 
160 160
 				<p id="give-card-address-wrap" class="form-row form-row-wide">
161
-					<label for="give_address_line1"><?php _e( 'Address 1', 'give' ); ?></label>
161
+					<label for="give_address_line1"><?php _e('Address 1', 'give'); ?></label>
162 162
 					<input name="give_address_line1" id="give_address_line1" class="text give-input" type="text"
163
-					       value="<?php echo esc_attr( $address['line1'] ); ?>"/>
163
+					       value="<?php echo esc_attr($address['line1']); ?>"/>
164 164
 				</p>
165 165
 
166 166
 				<p id="give-card-address-2-wrap" class="form-row form-row-wide">
167
-					<label for="give_address_line2"><?php _e( 'Address 2', 'give' ); ?></label>
167
+					<label for="give_address_line2"><?php _e('Address 2', 'give'); ?></label>
168 168
 					<input name="give_address_line2" id="give_address_line2" class="text give-input" type="text"
169
-					       value="<?php echo esc_attr( $address['line2'] ); ?>"/>
169
+					       value="<?php echo esc_attr($address['line2']); ?>"/>
170 170
 				</p>
171 171
 
172 172
 
173 173
 				<p id="give-card-state-wrap"
174
-				   class="form-row form-row-wide <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?>">
175
-					<label for="give_address_state"><?php _e( 'State / Province / County', 'give' ); ?></label>
174
+				   class="form-row form-row-wide <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?>">
175
+					<label for="give_address_state"><?php _e('State / Province / County', 'give'); ?></label>
176 176
 					<?php
177
-					if ( ! empty( $states ) ) : ?>
177
+					if ( ! empty($states)) : ?>
178 178
 						<select
179 179
 								name="give_address_state"
180 180
 								id="give_address_state"
181 181
 								class="give_address_state"
182 182
 						<?php
183
-						foreach ( $states as $state_code => $state ) {
184
-							echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
183
+						foreach ($states as $state_code => $state) {
184
+							echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
185 185
 						}
186 186
 						?>
187 187
 						</select>
@@ -194,15 +194,15 @@  discard block
 block discarded – undo
194 194
 				</p>
195 195
 
196 196
 				<p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
197
-					<label for="give_address_city"><?php _e( 'City', 'give' ); ?></label>
197
+					<label for="give_address_city"><?php _e('City', 'give'); ?></label>
198 198
 					<input name="give_address_city" id="give_address_city" class="text give-input" type="text"
199
-					       value="<?php echo esc_attr( $address['city'] ); ?>"/>
199
+					       value="<?php echo esc_attr($address['city']); ?>"/>
200 200
 				</p>
201 201
 
202 202
 				<p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
203
-					<label for="give_address_zip"><?php _e( 'Zip / Postal Code', 'give' ); ?></label>
203
+					<label for="give_address_zip"><?php _e('Zip / Postal Code', 'give'); ?></label>
204 204
 					<input name="give_address_zip" id="give_address_zip" class="text give-input" type="text"
205
-					       value="<?php echo esc_attr( $address['zip'] ); ?>"/>
205
+					       value="<?php echo esc_attr($address['zip']); ?>"/>
206 206
 				</p>
207 207
 
208 208
 				<?php
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 				 *
214 214
 				 * @since 1.0
215 215
 				 */
216
-				do_action( 'give_profile_editor_address' );
216
+				do_action('give_profile_editor_address');
217 217
 				?>
218 218
 
219 219
 			</div>
@@ -226,19 +226,19 @@  discard block
 block discarded – undo
226 226
 			 *
227 227
 			 * @since 1.0
228 228
 			 */
229
-			do_action( 'give_profile_editor_after_address' );
229
+			do_action('give_profile_editor_after_address');
230 230
 			?>
231 231
 
232
-			<h3 id="give_profile_password_label" class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
232
+			<h3 id="give_profile_password_label" class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
233 233
 
234 234
 			<div id="give_profile_password_wrap" class="give-clearfix">
235 235
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
236
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
236
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
237 237
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" type="password"/>
238 238
 				</p>
239 239
 
240 240
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
241
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
241
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
242 242
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" type="password"/>
243 243
 					<?php
244 244
 					/**
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 					 *
249 249
 					 * @since 1.0
250 250
 					 */
251
-					do_action( 'give_profile_editor_password' );
251
+					do_action('give_profile_editor_password');
252 252
 					?>
253 253
 				</p>
254 254
 			</div>
255 255
 
256
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
256
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
257 257
 
258 258
 			<?php
259 259
 			/**
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
 			 *
264 264
 			 * @since 1.0
265 265
 			 */
266
-			do_action( 'give_profile_editor_after_password' );
266
+			do_action('give_profile_editor_after_password');
267 267
 			?>
268 268
 
269 269
 			<p id="give_profile_submit_wrap">
270
-				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
270
+				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
271 271
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
272
-				<input type="hidden" name="give_redirect" value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
273
-				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
272
+				<input type="hidden" name="give_redirect" value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
273
+				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
274 274
 			</p>
275 275
 
276 276
 		</fieldset>
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 	 *
286 286
 	 * @since 1.0
287 287
 	 */
288
-	do_action( 'give_profile_editor_after' );
288
+	do_action('give_profile_editor_after');
289 289
 	?>
290 290
 
291 291
 	<?php
292 292
 else:
293
-	_e( 'You need to login to edit your profile.', 'give' );
293
+	_e('You need to login to edit your profile.', 'give');
294 294
 	echo give_login_form();
295 295
 endif;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -185,10 +185,13 @@  discard block
 block discarded – undo
185 185
 						}
186 186
 						?>
187 187
 						</select>
188
-					<?php else : ?>
188
+					<?php else {
189
+	: ?>
189 190
 						<input type="text" size="6" name="give_address_state" id="give_address_state"
190 191
 						       class="give_address_state give-input"
191
-						       placeholder="<?php echo $label; ?>" value="<?php echo $selected_state; ?>"/>
192
+						       placeholder="<?php echo $label;
193
+}
194
+?>" value="<?php echo $selected_state; ?>"/>
192 195
 					<?php endif;
193 196
 					?>
194 197
 				</p>
@@ -289,7 +292,9 @@  discard block
 block discarded – undo
289 292
 	?>
290 293
 
291 294
 	<?php
292
-else:
295
+else {
296
+	:
293 297
 	_e( 'You need to login to edit your profile.', 'give' );
298
+}
294 299
 	echo give_login_form();
295 300
 endif;
Please login to merge, or discard this patch.
includes/shortcodes.php 1 patch
Spacing   +103 added lines, -103 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
 
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 function give_donation_history() {
27 27
 
28 28
 	// If payment_key query arg exists, return receipt instead of donation history.
29
-	if ( isset( $_GET['payment_key'] ) ) {
29
+	if (isset($_GET['payment_key'])) {
30 30
 		ob_start();
31
-		echo give_receipt_shortcode( array() );
32
-		echo '<a href="' . esc_url( give_get_history_page_uri() ) . '">&laquo; ' . __( 'Return to All Donations', 'give' ) . '</a>';
31
+		echo give_receipt_shortcode(array());
32
+		echo '<a href="'.esc_url(give_get_history_page_uri()).'">&laquo; '.__('Return to All Donations', 'give').'</a>';
33 33
 
34 34
 		return ob_get_clean();
35 35
 	}
36 36
 
37
-	$email_access = give_get_option( 'email_access' );
37
+	$email_access = give_get_option('email_access');
38 38
 
39 39
 	/**
40 40
 	 * Determine access
@@ -44,30 +44,30 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	if (
46 46
 		is_user_logged_in() || false !== Give()->session->get_session_expiration()
47
-		|| ( give_is_setting_enabled( $email_access ) && Give()->email_access->token_exists )
47
+		|| (give_is_setting_enabled($email_access) && Give()->email_access->token_exists)
48 48
 	) {
49 49
 		ob_start();
50
-		give_get_template_part( 'history', 'donations' );
50
+		give_get_template_part('history', 'donations');
51 51
 
52 52
 		return ob_get_clean();
53 53
 
54
-	} elseif ( give_is_setting_enabled( $email_access ) ) {
54
+	} elseif (give_is_setting_enabled($email_access)) {
55 55
 		// Is Email-based access enabled?
56 56
 		ob_start();
57
-		give_get_template_part( 'email', 'login-form' );
57
+		give_get_template_part('email', 'login-form');
58 58
 
59 59
 		return ob_get_clean();
60 60
 
61 61
 	} else {
62 62
 
63
-		$output = apply_filters( 'give_donation_history_nonuser_message', Give()->notices->print_frontend_notice( __( 'You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give' ), false ) );
64
-		$output .= do_shortcode( '[give_login]' );
63
+		$output = apply_filters('give_donation_history_nonuser_message', Give()->notices->print_frontend_notice(__('You must be logged in to view your donation history. Please login using your account or create an account using the same email you used to donate with.', 'give'), false));
64
+		$output .= do_shortcode('[give_login]');
65 65
 
66 66
 		return $output;
67 67
 	}
68 68
 }
69 69
 
70
-add_shortcode( 'donation_history', 'give_donation_history' );
70
+add_shortcode('donation_history', 'give_donation_history');
71 71
 
72 72
 /**
73 73
  * Donation Form Shortcode
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
  *
81 81
  * @return string
82 82
  */
83
-function give_form_shortcode( $atts ) {
84
-	$atts = shortcode_atts( array(
83
+function give_form_shortcode($atts) {
84
+	$atts = shortcode_atts(array(
85 85
 		'id'                    => '',
86 86
 		'show_title'            => true,
87 87
 		'show_goal'             => true,
@@ -89,21 +89,21 @@  discard block
 block discarded – undo
89 89
 		'float_labels'          => '',
90 90
 		'display_style'         => '',
91 91
 		'continue_button_title' => '',
92
-	), $atts, 'give_form' );
92
+	), $atts, 'give_form');
93 93
 
94 94
 	// Convert string to bool.
95
-	$atts['show_title'] = filter_var( $atts['show_title'], FILTER_VALIDATE_BOOLEAN );
96
-	$atts['show_goal']  = filter_var( $atts['show_goal'], FILTER_VALIDATE_BOOLEAN );
95
+	$atts['show_title'] = filter_var($atts['show_title'], FILTER_VALIDATE_BOOLEAN);
96
+	$atts['show_goal']  = filter_var($atts['show_goal'], FILTER_VALIDATE_BOOLEAN);
97 97
 
98 98
 	//get the Give Form
99 99
 	ob_start();
100
-	give_get_donation_form( $atts );
100
+	give_get_donation_form($atts);
101 101
 	$final_output = ob_get_clean();
102 102
 
103
-	return apply_filters( 'give_donate_form', $final_output, $atts );
103
+	return apply_filters('give_donate_form', $final_output, $atts);
104 104
 }
105 105
 
106
-add_shortcode( 'give_form', 'give_form_shortcode' );
106
+add_shortcode('give_form', 'give_form_shortcode');
107 107
 
108 108
 /**
109 109
  * Donation Form Goal Shortcode.
@@ -116,37 +116,37 @@  discard block
 block discarded – undo
116 116
  *
117 117
  * @return string
118 118
  */
119
-function give_goal_shortcode( $atts ) {
120
-	$atts = shortcode_atts( array(
119
+function give_goal_shortcode($atts) {
120
+	$atts = shortcode_atts(array(
121 121
 		'id'        => '',
122 122
 		'show_text' => true,
123 123
 		'show_bar'  => true,
124
-	), $atts, 'give_goal' );
124
+	), $atts, 'give_goal');
125 125
 
126 126
 
127 127
 	//get the Give Form.
128 128
 	ob_start();
129 129
 
130 130
 	//Sanity check 1: ensure there is an ID Provided.
131
-	if ( empty( $atts['id'] ) ) {
132
-		Give()->notices->print_frontend_notice( __( 'The shortcode is missing Donation Form ID attribute.', 'give' ), true );
131
+	if (empty($atts['id'])) {
132
+		Give()->notices->print_frontend_notice(__('The shortcode is missing Donation Form ID attribute.', 'give'), true);
133 133
 	}
134 134
 
135 135
 	//Sanity check 2: Check the form even has Goals enabled.
136
-	if ( ! give_is_setting_enabled( give_get_meta( $atts['id'], '_give_goal_option', true ) ) ) {
136
+	if ( ! give_is_setting_enabled(give_get_meta($atts['id'], '_give_goal_option', true))) {
137 137
 
138
-		Give()->notices->print_frontend_notice( __( 'The form does not have Goals enabled.', 'give' ), true );
138
+		Give()->notices->print_frontend_notice(__('The form does not have Goals enabled.', 'give'), true);
139 139
 	} else {
140 140
 		//Passed all sanity checks: output Goal.
141
-		give_show_goal_progress( $atts['id'], $atts );
141
+		give_show_goal_progress($atts['id'], $atts);
142 142
 	}
143 143
 
144 144
 	$final_output = ob_get_clean();
145 145
 
146
-	return apply_filters( 'give_goal_shortcode_output', $final_output, $atts );
146
+	return apply_filters('give_goal_shortcode_output', $final_output, $atts);
147 147
 }
148 148
 
149
-add_shortcode( 'give_goal', 'give_goal_shortcode' );
149
+add_shortcode('give_goal', 'give_goal_shortcode');
150 150
 
151 151
 
152 152
 /**
@@ -163,22 +163,22 @@  discard block
 block discarded – undo
163 163
  *
164 164
  * @return string
165 165
  */
166
-function give_login_form_shortcode( $atts ) {
167
-	$atts = shortcode_atts( array(
166
+function give_login_form_shortcode($atts) {
167
+	$atts = shortcode_atts(array(
168 168
 		// Add backward compatibility for redirect attribute.
169 169
 		'redirect' => '',
170 170
 
171 171
 		'login-redirect'  => '',
172 172
 		'logout-redirect' => '',
173
-	), $atts, 'give_login' );
173
+	), $atts, 'give_login');
174 174
 
175 175
 	// Check login-redirect attribute first, if it empty or not found then check for redirect attribute and add value of this to login-redirect attribute.
176
-	$atts['login-redirect'] = ! empty( $atts['login-redirect'] ) ? $atts['login-redirect'] : ( ! empty( $atts['redirect'] ) ? $atts['redirect'] : '' );
176
+	$atts['login-redirect'] = ! empty($atts['login-redirect']) ? $atts['login-redirect'] : ( ! empty($atts['redirect']) ? $atts['redirect'] : '');
177 177
 
178
-	return give_login_form( $atts['login-redirect'], $atts['logout-redirect'] );
178
+	return give_login_form($atts['login-redirect'], $atts['logout-redirect']);
179 179
 }
180 180
 
181
-add_shortcode( 'give_login', 'give_login_form_shortcode' );
181
+add_shortcode('give_login', 'give_login_form_shortcode');
182 182
 
183 183
 /**
184 184
  * Register Shortcode.
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string
195 195
  */
196
-function give_register_form_shortcode( $atts ) {
197
-	$atts = shortcode_atts( array(
196
+function give_register_form_shortcode($atts) {
197
+	$atts = shortcode_atts(array(
198 198
 		'redirect' => '',
199
-	), $atts, 'give_register' );
199
+	), $atts, 'give_register');
200 200
 
201
-	return give_register_form( $atts['redirect'] );
201
+	return give_register_form($atts['redirect']);
202 202
 }
203 203
 
204
-add_shortcode( 'give_register', 'give_register_form_shortcode' );
204
+add_shortcode('give_register', 'give_register_form_shortcode');
205 205
 
206 206
 /**
207 207
  * Receipt Shortcode.
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
  *
215 215
  * @return string
216 216
  */
217
-function give_receipt_shortcode( $atts ) {
217
+function give_receipt_shortcode($atts) {
218 218
 
219 219
 	global $give_receipt_args, $payment;
220 220
 
221
-	$give_receipt_args = shortcode_atts( array(
222
-		'error'          => __( 'You are missing the payment key to view this donation receipt.', 'give' ),
221
+	$give_receipt_args = shortcode_atts(array(
222
+		'error'          => __('You are missing the payment key to view this donation receipt.', 'give'),
223 223
 		'price'          => true,
224 224
 		'donor'          => true,
225 225
 		'date'           => true,
@@ -228,50 +228,50 @@  discard block
 block discarded – undo
228 228
 		'payment_id'     => true,
229 229
 		'payment_status' => false,
230 230
 		'status_notice'  => true,
231
-	), $atts, 'give_receipt' );
231
+	), $atts, 'give_receipt');
232 232
 
233 233
 	//set $session var
234 234
 	$session = give_get_purchase_session();
235 235
 
236 236
 	//set payment key var
237
-	if ( isset( $_GET['payment_key'] ) ) {
238
-		$payment_key = urldecode( $_GET['payment_key'] );
239
-	} elseif ( $session ) {
237
+	if (isset($_GET['payment_key'])) {
238
+		$payment_key = urldecode($_GET['payment_key']);
239
+	} elseif ($session) {
240 240
 		$payment_key = $session['purchase_key'];
241
-	} elseif ( $give_receipt_args['payment_key'] ) {
241
+	} elseif ($give_receipt_args['payment_key']) {
242 242
 		$payment_key = $give_receipt_args['payment_key'];
243 243
 	}
244 244
 
245
-	$email_access = give_get_option( 'email_access' );
245
+	$email_access = give_get_option('email_access');
246 246
 
247 247
 	// No payment_key found & Email Access is Turned on:
248
-	if ( ! isset( $payment_key ) && give_is_setting_enabled( $email_access ) && ! Give()->email_access->token_exists ) {
248
+	if ( ! isset($payment_key) && give_is_setting_enabled($email_access) && ! Give()->email_access->token_exists) {
249 249
 
250 250
 		ob_start();
251 251
 
252
-		give_get_template_part( 'email-login-form' );
252
+		give_get_template_part('email-login-form');
253 253
 
254 254
 		return ob_get_clean();
255 255
 
256
-	} elseif ( ! isset( $payment_key ) ) {
256
+	} elseif ( ! isset($payment_key)) {
257 257
 
258
-		return Give()->notices->print_frontend_notice( $give_receipt_args['error'], false, 'error' );
258
+		return Give()->notices->print_frontend_notice($give_receipt_args['error'], false, 'error');
259 259
 
260 260
 	}
261 261
 
262
-	$payment_id    = give_get_purchase_id_by_key( $payment_key );
263
-	$user_can_view = give_can_view_receipt( $payment_key );
262
+	$payment_id    = give_get_purchase_id_by_key($payment_key);
263
+	$user_can_view = give_can_view_receipt($payment_key);
264 264
 
265 265
 	// Key was provided, but user is logged out. Offer them the ability to login and view the receipt.
266
-	if ( ! $user_can_view && give_is_setting_enabled( $email_access ) && ! Give()->email_access->token_exists ) {
266
+	if ( ! $user_can_view && give_is_setting_enabled($email_access) && ! Give()->email_access->token_exists) {
267 267
 
268 268
 		ob_start();
269 269
 
270
-		give_get_template_part( 'email-login-form' );
270
+		give_get_template_part('email-login-form');
271 271
 
272 272
 		return ob_get_clean();
273 273
 
274
-	} elseif ( ! $user_can_view ) {
274
+	} elseif ( ! $user_can_view) {
275 275
 
276 276
 		global $give_login_redirect;
277 277
 
@@ -279,9 +279,9 @@  discard block
 block discarded – undo
279 279
 
280 280
 		ob_start();
281 281
 
282
-		Give()->notices->print_frontend_notice( apply_filters( 'give_must_be_logged_in_error_message', __( 'You must be logged in to view this donation receipt.', 'give' ) ) );
282
+		Give()->notices->print_frontend_notice(apply_filters('give_must_be_logged_in_error_message', __('You must be logged in to view this donation receipt.', 'give')));
283 283
 
284
-		give_get_template_part( 'shortcode', 'login' );
284
+		give_get_template_part('shortcode', 'login');
285 285
 
286 286
 		$login_form = ob_get_clean();
287 287
 
@@ -295,20 +295,20 @@  discard block
 block discarded – undo
295 295
 	 * or if user is logged out and donation was made as a guest, the donation session is checked for
296 296
 	 * or if user is logged in and the user can view sensitive shop data.
297 297
 	 */
298
-	if ( ! apply_filters( 'give_user_can_view_receipt', $user_can_view, $give_receipt_args ) ) {
299
-		return Give()->notices->print_frontend_notice( $give_receipt_args['error'], false, 'error' );
298
+	if ( ! apply_filters('give_user_can_view_receipt', $user_can_view, $give_receipt_args)) {
299
+		return Give()->notices->print_frontend_notice($give_receipt_args['error'], false, 'error');
300 300
 	}
301 301
 
302 302
 	ob_start();
303 303
 
304
-	give_get_template_part( 'shortcode', 'receipt' );
304
+	give_get_template_part('shortcode', 'receipt');
305 305
 
306 306
 	$display = ob_get_clean();
307 307
 
308 308
 	return $display;
309 309
 }
310 310
 
311
-add_shortcode( 'give_receipt', 'give_receipt_shortcode' );
311
+add_shortcode('give_receipt', 'give_receipt_shortcode');
312 312
 
313 313
 /**
314 314
  * Profile Editor Shortcode.
@@ -327,25 +327,25 @@  discard block
 block discarded – undo
327 327
  *
328 328
  * @return string Output generated from the profile editor
329 329
  */
330
-function give_profile_editor_shortcode( $atts ) {
330
+function give_profile_editor_shortcode($atts) {
331 331
 
332 332
 	ob_start();
333 333
 
334 334
 	// Restrict access to donor profile, if donor and user are disconnected.
335
-	$is_donor_disconnected = get_user_meta( get_current_user_id(), '_give_is_donor_disconnected', true );
336
-	if( is_user_logged_in() && $is_donor_disconnected ) {
337
-		Give()->notices->print_frontend_notice( __( 'Your Donor and User profile are no longer connected. Please contact the site administrator.', 'give' ), true, 'error' );
335
+	$is_donor_disconnected = get_user_meta(get_current_user_id(), '_give_is_donor_disconnected', true);
336
+	if (is_user_logged_in() && $is_donor_disconnected) {
337
+		Give()->notices->print_frontend_notice(__('Your Donor and User profile are no longer connected. Please contact the site administrator.', 'give'), true, 'error');
338 338
 		return false;
339 339
 	}
340 340
 
341
-	give_get_template_part( 'shortcode', 'profile-editor' );
341
+	give_get_template_part('shortcode', 'profile-editor');
342 342
 
343 343
 	$display = ob_get_clean();
344 344
 
345 345
 	return $display;
346 346
 }
347 347
 
348
-add_shortcode( 'give_profile_editor', 'give_profile_editor_shortcode' );
348
+add_shortcode('give_profile_editor', 'give_profile_editor_shortcode');
349 349
 
350 350
 /**
351 351
  * Process Profile Updater Form.
@@ -358,30 +358,30 @@  discard block
 block discarded – undo
358 358
  *
359 359
  * @return bool
360 360
  */
361
-function give_process_profile_editor_updates( $data ) {
361
+function give_process_profile_editor_updates($data) {
362 362
 	// Profile field change request
363
-	if ( empty( $_POST['give_profile_editor_submit'] ) && ! is_user_logged_in() ) {
363
+	if (empty($_POST['give_profile_editor_submit']) && ! is_user_logged_in()) {
364 364
 		return false;
365 365
 	}
366 366
 
367 367
 	// Nonce security
368
-	if ( ! wp_verify_nonce( $data['give_profile_editor_nonce'], 'give-profile-editor-nonce' ) ) {
368
+	if ( ! wp_verify_nonce($data['give_profile_editor_nonce'], 'give-profile-editor-nonce')) {
369 369
 		return false;
370 370
 	}
371 371
 
372 372
 	$user_id       = get_current_user_id();
373
-	$old_user_data = get_userdata( $user_id );
374
-
375
-	$display_name = isset( $data['give_display_name'] ) ? sanitize_text_field( $data['give_display_name'] ) : $old_user_data->display_name;
376
-	$first_name   = isset( $data['give_first_name'] ) ? sanitize_text_field( $data['give_first_name'] ) : $old_user_data->first_name;
377
-	$last_name    = isset( $data['give_last_name'] ) ? sanitize_text_field( $data['give_last_name'] ) : $old_user_data->last_name;
378
-	$email        = isset( $data['give_email'] ) ? sanitize_email( $data['give_email'] ) : $old_user_data->user_email;
379
-	$line1        = ( isset( $data['give_address_line1'] ) ? sanitize_text_field( $data['give_address_line1'] ) : '' );
380
-	$line2        = ( isset( $data['give_address_line2'] ) ? sanitize_text_field( $data['give_address_line2'] ) : '' );
381
-	$city         = ( isset( $data['give_address_city'] ) ? sanitize_text_field( $data['give_address_city'] ) : '' );
382
-	$state        = ( isset( $data['give_address_state'] ) ? sanitize_text_field( $data['give_address_state'] ) : '' );
383
-	$zip          = ( isset( $data['give_address_zip'] ) ? sanitize_text_field( $data['give_address_zip'] ) : '' );
384
-	$country      = ( isset( $data['give_address_country'] ) ? sanitize_text_field( $data['give_address_country'] ) : '' );
373
+	$old_user_data = get_userdata($user_id);
374
+
375
+	$display_name = isset($data['give_display_name']) ? sanitize_text_field($data['give_display_name']) : $old_user_data->display_name;
376
+	$first_name   = isset($data['give_first_name']) ? sanitize_text_field($data['give_first_name']) : $old_user_data->first_name;
377
+	$last_name    = isset($data['give_last_name']) ? sanitize_text_field($data['give_last_name']) : $old_user_data->last_name;
378
+	$email        = isset($data['give_email']) ? sanitize_email($data['give_email']) : $old_user_data->user_email;
379
+	$line1        = (isset($data['give_address_line1']) ? sanitize_text_field($data['give_address_line1']) : '');
380
+	$line2        = (isset($data['give_address_line2']) ? sanitize_text_field($data['give_address_line2']) : '');
381
+	$city         = (isset($data['give_address_city']) ? sanitize_text_field($data['give_address_city']) : '');
382
+	$state        = (isset($data['give_address_state']) ? sanitize_text_field($data['give_address_state']) : '');
383
+	$zip          = (isset($data['give_address_zip']) ? sanitize_text_field($data['give_address_zip']) : '');
384
+	$country      = (isset($data['give_address_country']) ? sanitize_text_field($data['give_address_country']) : '');
385 385
 
386 386
 	$userdata = array(
387 387
 		'ID'           => $user_id,
@@ -409,40 +409,40 @@  discard block
 block discarded – undo
409 409
 	 * @param int $user_id The ID of the user.
410 410
 	 * @param array $userdata User info, including ID, first name, last name, display name and email.
411 411
 	 */
412
-	do_action( 'give_pre_update_user_profile', $user_id, $userdata );
412
+	do_action('give_pre_update_user_profile', $user_id, $userdata);
413 413
 
414 414
 	// Make sure to validate passwords for existing Donors
415
-	give_validate_user_password( $data['give_new_user_pass1'], $data['give_new_user_pass2'] );
415
+	give_validate_user_password($data['give_new_user_pass1'], $data['give_new_user_pass2']);
416 416
 
417
-	if ( empty( $email ) ) {
417
+	if (empty($email)) {
418 418
 		// Make sure email should not be empty.
419
-		give_set_error( 'email_empty', __( 'The email you entered is empty.', 'give' ) );
419
+		give_set_error('email_empty', __('The email you entered is empty.', 'give'));
420 420
 
421
-	} else if ( ! is_email( $email ) ) {
421
+	} else if ( ! is_email($email)) {
422 422
 		// Make sure email should be valid.
423
-		give_set_error( 'email_not_valid', __( 'The email you entered is not valid. Please use another', 'give' ) );
423
+		give_set_error('email_not_valid', __('The email you entered is not valid. Please use another', 'give'));
424 424
 
425
-	} else if ( $email != $old_user_data->user_email ) {
425
+	} else if ($email != $old_user_data->user_email) {
426 426
 		// Make sure the new email doesn't belong to another user
427
-		if ( email_exists( $email ) ) {
428
-			give_set_error( 'email_exists', __( 'The email you entered belongs to another user. Please use another.', 'give' ) );
427
+		if (email_exists($email)) {
428
+			give_set_error('email_exists', __('The email you entered belongs to another user. Please use another.', 'give'));
429 429
 		}
430 430
 	}
431 431
 
432 432
 	// Check for errors
433 433
 	$errors = give_get_errors();
434 434
 
435
-	if ( $errors ) {
435
+	if ($errors) {
436 436
 		// Send back to the profile editor if there are errors
437
-		wp_redirect( $data['give_redirect'] );
437
+		wp_redirect($data['give_redirect']);
438 438
 		give_die();
439 439
 	}
440 440
 
441 441
 	// Update the user
442
-	$meta    = update_user_meta( $user_id, '_give_user_address', $address );
443
-	$updated = wp_update_user( $userdata );
442
+	$meta    = update_user_meta($user_id, '_give_user_address', $address);
443
+	$updated = wp_update_user($userdata);
444 444
 
445
-	if ( $updated ) {
445
+	if ($updated) {
446 446
 
447 447
 		/**
448 448
 		 * Fires after updating user profile.
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
 		 * @param int $user_id The ID of the user.
453 453
 		 * @param array $userdata User info, including ID, first name, last name, display name and email.
454 454
 		 */
455
-		do_action( 'give_user_profile_updated', $user_id, $userdata );
456
-		wp_redirect( add_query_arg( 'updated', 'true', $data['give_redirect'] ) );
455
+		do_action('give_user_profile_updated', $user_id, $userdata);
456
+		wp_redirect(add_query_arg('updated', 'true', $data['give_redirect']));
457 457
 		give_die();
458 458
 	}
459 459
 
460 460
 	return false;
461 461
 }
462 462
 
463
-add_action( 'give_edit_user_profile', 'give_process_profile_editor_updates' );
463
+add_action('give_edit_user_profile', 'give_process_profile_editor_updates');
Please login to merge, or discard this patch.