Completed
Pull Request — master (#1412)
by Ravinder
17:25
created
includes/gateways/paypal-standard.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
  *
566 566
  * @since 1.6.3
567 567
  *
568
- * @param $pending_reason
568
+ * @param string $pending_reason
569 569
  *
570 570
  * @return string
571 571
  */
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
  * @param int   $payment_id   Payment ID
643 643
  * @param array $payment_data Array of payment data.
644 644
  *
645
- * @return mixed|string
645
+ * @return string
646 646
  */
647 647
 function give_build_paypal_url( $payment_id, $payment_data ) {
648 648
 	// Only send to PayPal if the pending payment is created successfully.
Please login to merge, or discard this patch.
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.0
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @access private
22 22
  * @since  1.0
23 23
  */
24
-add_action( 'give_paypal_cc_form', '__return_false' );
24
+add_action('give_paypal_cc_form', '__return_false');
25 25
 
26 26
 /**
27 27
  * Process PayPal Payment.
@@ -32,34 +32,34 @@  discard block
 block discarded – undo
32 32
  *
33 33
  * @return void
34 34
  */
35
-function give_process_paypal_payment( $payment_data ) {
35
+function give_process_paypal_payment($payment_data) {
36 36
 
37 37
 	// Validate nonce.
38
-	give_validate_nonce( $payment_data['gateway_nonce'], 'give-gateway' );
39
-	$payment_id = give_create_payment( $payment_data );
38
+	give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway');
39
+	$payment_id = give_create_payment($payment_data);
40 40
 
41 41
 	// Check payment.
42
-	if ( empty( $payment_id ) ) {
42
+	if (empty($payment_id)) {
43 43
 		// Record the error.
44 44
 		give_record_gateway_error(
45
-			esc_html__( 'Payment Error', 'give' ),
45
+			esc_html__('Payment Error', 'give'),
46 46
 			sprintf(
47 47
 				/* translators: %s: payment data */
48
-				esc_html__( 'Payment creation failed before sending donor to PayPal. Payment data: %s', 'give' ),
49
-				json_encode( $payment_data )
48
+				esc_html__('Payment creation failed before sending donor to PayPal. Payment data: %s', 'give'),
49
+				json_encode($payment_data)
50 50
 			),
51 51
 			$payment_id
52 52
 		);
53 53
 		// Problems? Send back.
54
-		give_send_back_to_checkout( '?payment-mode=' . $payment_data['post_data']['give-gateway'] );
54
+		give_send_back_to_checkout('?payment-mode='.$payment_data['post_data']['give-gateway']);
55 55
 	}
56 56
 
57 57
 	// Redirect to PayPal.
58
-	wp_redirect( give_build_paypal_url( $payment_id, $payment_data ) );
58
+	wp_redirect(give_build_paypal_url($payment_id, $payment_data));
59 59
 	exit;
60 60
 }
61 61
 
62
-add_action( 'give_gateway_paypal', 'give_process_paypal_payment' );
62
+add_action('give_gateway_paypal', 'give_process_paypal_payment');
63 63
 
64 64
 /**
65 65
  * Listens for a PayPal IPN requests and then sends to the processing function
@@ -69,17 +69,17 @@  discard block
 block discarded – undo
69 69
  */
70 70
 function give_listen_for_paypal_ipn() {
71 71
 	// Regular PayPal IPN
72
-	if ( isset( $_GET['give-listener'] ) && $_GET['give-listener'] == 'IPN' ) {
72
+	if (isset($_GET['give-listener']) && $_GET['give-listener'] == 'IPN') {
73 73
 		/**
74 74
 		 * Fires while verifying PayPal IPN
75 75
 		 *
76 76
 		 * @since 1.0
77 77
 		 */
78
-		do_action( 'give_verify_paypal_ipn' );
78
+		do_action('give_verify_paypal_ipn');
79 79
 	}
80 80
 }
81 81
 
82
-add_action( 'init', 'give_listen_for_paypal_ipn' );
82
+add_action('init', 'give_listen_for_paypal_ipn');
83 83
 
84 84
 /**
85 85
  * Process PayPal IPN
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 function give_process_paypal_ipn() {
91 91
 
92 92
 	// Check the request method is POST
93
-	if ( isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] != 'POST' ) {
93
+	if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'POST') {
94 94
 		return;
95 95
 	}
96 96
 
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	$post_data = '';
99 99
 
100 100
 	// Fallback just in case post_max_size is lower than needed
101
-	if ( ini_get( 'allow_url_fopen' ) ) {
102
-		$post_data = file_get_contents( 'php://input' );
101
+	if (ini_get('allow_url_fopen')) {
102
+		$post_data = file_get_contents('php://input');
103 103
 	} else {
104 104
 		// If allow_url_fopen is not enabled, then make sure that post_max_size is large enough
105
-		ini_set( 'post_max_size', '12M' );
105
+		ini_set('post_max_size', '12M');
106 106
 	}
107 107
 	// Start the encoded data collection with notification command
108 108
 	$encoded_data = 'cmd=_notify-validate';
@@ -111,39 +111,39 @@  discard block
 block discarded – undo
111 111
 	$arg_separator = give_get_php_arg_separator_output();
112 112
 
113 113
 	// Verify there is a post_data
114
-	if ( $post_data || strlen( $post_data ) > 0 ) {
114
+	if ($post_data || strlen($post_data) > 0) {
115 115
 		// Append the data
116
-		$encoded_data .= $arg_separator . $post_data;
116
+		$encoded_data .= $arg_separator.$post_data;
117 117
 	} else {
118 118
 		// Check if POST is empty
119
-		if ( empty( $_POST ) ) {
119
+		if (empty($_POST)) {
120 120
 			// Nothing to do
121 121
 			return;
122 122
 		} else {
123 123
 			// Loop through each POST
124
-			foreach ( $_POST as $key => $value ) {
124
+			foreach ($_POST as $key => $value) {
125 125
 				// Encode the value and append the data.
126
-				$encoded_data .= $arg_separator . "$key=" . urlencode( $value );
126
+				$encoded_data .= $arg_separator."$key=".urlencode($value);
127 127
 			}
128 128
 		}
129 129
 	}
130 130
 
131 131
 	// Convert collected post data to an array.
132
-	parse_str( $encoded_data, $encoded_data_array );
132
+	parse_str($encoded_data, $encoded_data_array);
133 133
 
134
-	foreach ( $encoded_data_array as $key => $value ) {
134
+	foreach ($encoded_data_array as $key => $value) {
135 135
 
136
-		if ( false !== strpos( $key, 'amp;' ) ) {
137
-			$new_key = str_replace( '&', '&', $key );
138
-			$new_key = str_replace( 'amp;', '&', $new_key );
136
+		if (false !== strpos($key, 'amp;')) {
137
+			$new_key = str_replace('&', '&', $key);
138
+			$new_key = str_replace('amp;', '&', $new_key);
139 139
 
140
-			unset( $encoded_data_array[ $key ] );
141
-			$encoded_data_array[ $new_key ] = $value;
140
+			unset($encoded_data_array[$key]);
141
+			$encoded_data_array[$new_key] = $value;
142 142
 		}
143 143
 	}
144 144
 
145 145
 	// Validate IPN request w/ PayPal if user hasn't disabled this security measure
146
-	if ( give_is_setting_enabled( give_get_option( 'paypal_verification' ) ) ) {
146
+	if (give_is_setting_enabled(give_get_option('paypal_verification'))) {
147 147
 
148 148
 		$remote_post_vars = array(
149 149
 			'method'      => 'POST',
@@ -163,28 +163,28 @@  discard block
 block discarded – undo
163 163
 		);
164 164
 
165 165
 		// Validate the IPN.
166
-		$api_response = wp_remote_post( give_get_paypal_redirect(), $remote_post_vars );
166
+		$api_response = wp_remote_post(give_get_paypal_redirect(), $remote_post_vars);
167 167
 
168
-		if ( is_wp_error( $api_response ) ) {
168
+		if (is_wp_error($api_response)) {
169 169
 			give_record_gateway_error(
170
-				esc_html__( 'IPN Error', 'give' ),
170
+				esc_html__('IPN Error', 'give'),
171 171
 				sprintf(
172 172
 					/* translators: %s: Paypal IPN response */
173
-					esc_html__( 'Invalid IPN verification response. IPN data: %s', 'give' ),
174
-					json_encode( $api_response )
173
+					esc_html__('Invalid IPN verification response. IPN data: %s', 'give'),
174
+					json_encode($api_response)
175 175
 				)
176 176
 			);
177 177
 
178 178
 			return; // Something went wrong
179 179
 		}
180 180
 
181
-		if ( $api_response['body'] !== 'VERIFIED' ) {
181
+		if ($api_response['body'] !== 'VERIFIED') {
182 182
 			give_record_gateway_error(
183
-				esc_html__( 'IPN Error', 'give' ),
183
+				esc_html__('IPN Error', 'give'),
184 184
 				sprintf(
185 185
 					/* translators: %s: Paypal IPN response */
186
-					esc_html__( 'Invalid IPN verification response. IPN data: %s', 'give' ),
187
-					json_encode( $api_response )
186
+					esc_html__('Invalid IPN verification response. IPN data: %s', 'give'),
187
+					json_encode($api_response)
188 188
 				)
189 189
 			);
190 190
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	}
194 194
 
195 195
 	// Check if $post_data_array has been populated
196
-	if ( ! is_array( $encoded_data_array ) && ! empty( $encoded_data_array ) ) {
196
+	if ( ! is_array($encoded_data_array) && ! empty($encoded_data_array)) {
197 197
 		return;
198 198
 	}
199 199
 
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 		'payment_status' => '',
203 203
 	);
204 204
 
205
-	$encoded_data_array = wp_parse_args( $encoded_data_array, $defaults );
205
+	$encoded_data_array = wp_parse_args($encoded_data_array, $defaults);
206 206
 
207
-	$payment_id = isset( $encoded_data_array['custom'] ) ? absint( $encoded_data_array['custom'] ) : 0;
207
+	$payment_id = isset($encoded_data_array['custom']) ? absint($encoded_data_array['custom']) : 0;
208 208
 	$txn_type   = $encoded_data_array['txn_type'];
209 209
 
210
-	if ( has_action( 'give_paypal_' . $txn_type ) ) {
210
+	if (has_action('give_paypal_'.$txn_type)) {
211 211
 		/**
212 212
 		 * Fires while processing PayPal IPN $txn_type.
213 213
 		 *
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 		 * @param array $encoded_data_array Encoded data.
219 219
 		 * @param int   $payment_id         Payment id.
220 220
 		 */
221
-		do_action( "give_paypal_{$txn_type}", $encoded_data_array, $payment_id );
221
+		do_action("give_paypal_{$txn_type}", $encoded_data_array, $payment_id);
222 222
 	} else {
223 223
 		/**
224 224
 		 * Fires while process PayPal IPN.
@@ -230,12 +230,12 @@  discard block
 block discarded – undo
230 230
 		 * @param array $encoded_data_array Encoded data.
231 231
 		 * @param int   $payment_id         Payment id.
232 232
 		 */
233
-		do_action( 'give_paypal_web_accept', $encoded_data_array, $payment_id );
233
+		do_action('give_paypal_web_accept', $encoded_data_array, $payment_id);
234 234
 	}
235 235
 	exit;
236 236
 }
237 237
 
238
-add_action( 'give_verify_paypal_ipn', 'give_process_paypal_ipn' );
238
+add_action('give_verify_paypal_ipn', 'give_process_paypal_ipn');
239 239
 
240 240
 /**
241 241
  * Process web accept (one time) payment IPNs.
@@ -247,128 +247,128 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return void
249 249
  */
250
-function give_process_paypal_web_accept_and_cart( $data, $payment_id ) {
250
+function give_process_paypal_web_accept_and_cart($data, $payment_id) {
251 251
 
252 252
 	// Only allow through these transaction types.
253
-	if ( $data['txn_type'] != 'web_accept' && $data['txn_type'] != 'cart' && strtolower( $data['payment_status'] ) != 'refunded' ) {
253
+	if ($data['txn_type'] != 'web_accept' && $data['txn_type'] != 'cart' && strtolower($data['payment_status']) != 'refunded') {
254 254
 		return;
255 255
 	}
256 256
 
257 257
 	// Need $payment_id to continue.
258
-	if ( empty( $payment_id ) ) {
258
+	if (empty($payment_id)) {
259 259
 		return;
260 260
 	}
261 261
 
262 262
 	// Collect donation payment details.
263 263
 	$paypal_amount  = $data['mc_gross'];
264
-	$payment_status = strtolower( $data['payment_status'] );
265
-	$currency_code  = strtolower( $data['mc_currency'] );
266
-	$business_email = isset( $data['business'] ) && is_email( $data['business'] ) ? trim( $data['business'] ) : trim( $data['receiver_email'] );
267
-	$payment_meta   = give_get_payment_meta( $payment_id );
264
+	$payment_status = strtolower($data['payment_status']);
265
+	$currency_code  = strtolower($data['mc_currency']);
266
+	$business_email = isset($data['business']) && is_email($data['business']) ? trim($data['business']) : trim($data['receiver_email']);
267
+	$payment_meta   = give_get_payment_meta($payment_id);
268 268
 
269 269
 	// Must be a PayPal standard IPN.
270
-	if ( give_get_payment_gateway( $payment_id ) != 'paypal' ) {
270
+	if (give_get_payment_gateway($payment_id) != 'paypal') {
271 271
 		return;
272 272
 	}
273 273
 
274 274
 	// Verify payment recipient
275
-	if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) != 0 ) {
275
+	if (strcasecmp($business_email, trim(give_get_option('paypal_email'))) != 0) {
276 276
 
277 277
 		give_record_gateway_error(
278
-			esc_html__( 'IPN Error', 'give' ),
278
+			esc_html__('IPN Error', 'give'),
279 279
 			sprintf(
280 280
 				/* translators: %s: Paypal IPN response */
281
-				esc_html__( 'Invalid business email in IPN response. IPN data: %s', 'give' ),
282
-				json_encode( $data )
281
+				esc_html__('Invalid business email in IPN response. IPN data: %s', 'give'),
282
+				json_encode($data)
283 283
 			),
284 284
 			$payment_id
285 285
 		);
286
-		give_update_payment_status( $payment_id, 'failed' );
287
-		give_insert_payment_note( $payment_id, esc_html__( 'Payment failed due to invalid PayPal business email.', 'give' ) );
286
+		give_update_payment_status($payment_id, 'failed');
287
+		give_insert_payment_note($payment_id, esc_html__('Payment failed due to invalid PayPal business email.', 'give'));
288 288
 
289 289
 		return;
290 290
 	}
291 291
 
292 292
 	// Verify payment currency.
293
-	if ( $currency_code != strtolower( $payment_meta['currency'] ) ) {
293
+	if ($currency_code != strtolower($payment_meta['currency'])) {
294 294
 
295 295
 		give_record_gateway_error(
296
-			esc_html__( 'IPN Error', 'give' ),
296
+			esc_html__('IPN Error', 'give'),
297 297
 			sprintf(
298 298
 				/* translators: %s: Paypal IPN response */
299
-				esc_html__( 'Invalid currency in IPN response. IPN data: %s', 'give' ),
300
-				json_encode( $data )
299
+				esc_html__('Invalid currency in IPN response. IPN data: %s', 'give'),
300
+				json_encode($data)
301 301
 			),
302 302
 			$payment_id
303 303
 		);
304
-		give_update_payment_status( $payment_id, 'failed' );
305
-		give_insert_payment_note( $payment_id, esc_html__( 'Payment failed due to invalid currency in PayPal IPN.', 'give' ) );
304
+		give_update_payment_status($payment_id, 'failed');
305
+		give_insert_payment_note($payment_id, esc_html__('Payment failed due to invalid currency in PayPal IPN.', 'give'));
306 306
 
307 307
 		return;
308 308
 	}
309 309
 
310 310
 	// Process refunds & reversed.
311
-	if ( $payment_status == 'refunded' || $payment_status == 'reversed' ) {
312
-		give_process_paypal_refund( $data, $payment_id );
311
+	if ($payment_status == 'refunded' || $payment_status == 'reversed') {
312
+		give_process_paypal_refund($data, $payment_id);
313 313
 
314 314
 		return;
315 315
 	}
316 316
 
317 317
 	// Only complete payments once.
318
-	if ( get_post_status( $payment_id ) == 'publish' ) {
318
+	if (get_post_status($payment_id) == 'publish') {
319 319
 		return;
320 320
 	}
321 321
 
322 322
 	// Retrieve the total donation amount (before PayPal).
323
-	$payment_amount = give_get_payment_amount( $payment_id );
323
+	$payment_amount = give_get_payment_amount($payment_id);
324 324
 
325 325
 	// Check that the donation PP and local db amounts match.
326
-	if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
326
+	if (number_format((float) $paypal_amount, 2) < number_format((float) $payment_amount, 2)) {
327 327
 		// The prices don't match
328 328
 		give_record_gateway_error(
329
-			esc_html__( 'IPN Error', 'give' ),
329
+			esc_html__('IPN Error', 'give'),
330 330
 			sprintf(
331 331
 				/* translators: %s: Paypal IPN response */
332
-				esc_html__( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ),
333
-				json_encode( $data )
332
+				esc_html__('Invalid payment amount in IPN response. IPN data: %s', 'give'),
333
+				json_encode($data)
334 334
 			),
335 335
 			$payment_id
336 336
 		);
337
-		give_update_payment_status( $payment_id, 'failed' );
338
-		give_insert_payment_note( $payment_id, esc_html__( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) );
337
+		give_update_payment_status($payment_id, 'failed');
338
+		give_insert_payment_note($payment_id, esc_html__('Payment failed due to invalid amount in PayPal IPN.', 'give'));
339 339
 
340 340
 		return;
341 341
 	}
342 342
 
343 343
 	// Process completed donations.
344
-	if ( $payment_status == 'completed' || give_is_test_mode() ) {
344
+	if ($payment_status == 'completed' || give_is_test_mode()) {
345 345
 
346 346
 		give_insert_payment_note(
347 347
 			$payment_id,
348 348
 			sprintf(
349 349
 				/* translators: %s: Paypal transaction ID */
350
-				esc_html__( 'PayPal Transaction ID: %s', 'give' ),
350
+				esc_html__('PayPal Transaction ID: %s', 'give'),
351 351
 				$data['txn_id']
352 352
 			)
353 353
 		);
354
-		give_set_payment_transaction_id( $payment_id, $data['txn_id'] );
355
-		give_update_payment_status( $payment_id, 'publish' );
354
+		give_set_payment_transaction_id($payment_id, $data['txn_id']);
355
+		give_update_payment_status($payment_id, 'publish');
356 356
 
357
-	} elseif ( 'pending' == $payment_status && isset( $data['pending_reason'] ) ) {
357
+	} elseif ('pending' == $payment_status && isset($data['pending_reason'])) {
358 358
 
359 359
 		// Look for possible pending reasons, such as an echeck.
360
-		$note = give_paypal_get_pending_donation_note( strtolower( $data['pending_reason'] ) );
360
+		$note = give_paypal_get_pending_donation_note(strtolower($data['pending_reason']));
361 361
 
362
-		if ( ! empty( $note ) ) {
362
+		if ( ! empty($note)) {
363 363
 
364
-			give_insert_payment_note( $payment_id, $note );
364
+			give_insert_payment_note($payment_id, $note);
365 365
 
366 366
 		}
367 367
 	}
368 368
 
369 369
 }
370 370
 
371
-add_action( 'give_paypal_web_accept', 'give_process_paypal_web_accept_and_cart', 10, 2 );
371
+add_action('give_paypal_web_accept', 'give_process_paypal_web_accept_and_cart', 10, 2);
372 372
 
373 373
 /**
374 374
  * Process PayPal IPN Refunds
@@ -380,27 +380,27 @@  discard block
 block discarded – undo
380 380
  *
381 381
  * @return void
382 382
  */
383
-function give_process_paypal_refund( $data, $payment_id = 0 ) {
383
+function give_process_paypal_refund($data, $payment_id = 0) {
384 384
 
385 385
 	// Collect payment details
386
-	if ( empty( $payment_id ) ) {
386
+	if (empty($payment_id)) {
387 387
 		return;
388 388
 	}
389 389
 
390
-	if ( get_post_status( $payment_id ) == 'refunded' ) {
390
+	if (get_post_status($payment_id) == 'refunded') {
391 391
 		return; // Only refund payments once
392 392
 	}
393 393
 
394
-	$payment_amount = give_get_payment_amount( $payment_id );
394
+	$payment_amount = give_get_payment_amount($payment_id);
395 395
 	$refund_amount  = $data['payment_gross'] * - 1;
396 396
 
397
-	if ( number_format( (float) $refund_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
397
+	if (number_format((float) $refund_amount, 2) < number_format((float) $payment_amount, 2)) {
398 398
 
399 399
 		give_insert_payment_note(
400 400
 			$payment_id,
401 401
 			sprintf(
402 402
 				/* translators: %s: Paypal parent transaction ID */
403
-				esc_html__( 'Partial PayPal refund processed: %s', 'give' ),
403
+				esc_html__('Partial PayPal refund processed: %s', 'give'),
404 404
 				$data['parent_txn_id']
405 405
 			)
406 406
 		);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 		$payment_id,
414 414
 		sprintf(
415 415
 			/* translators: 1: Paypal parent transaction ID 2. Paypal reason code */
416
-			esc_html__( 'PayPal Payment #%1$s Refunded for reason: %2$s', 'give' ),
416
+			esc_html__('PayPal Payment #%1$s Refunded for reason: %2$s', 'give'),
417 417
 			$data['parent_txn_id'],
418 418
 			$data['reason_code']
419 419
 		)
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
 		$payment_id,
423 423
 		sprintf(
424 424
 			/* translators: %s: Paypal transaction ID */
425
-			esc_html__( 'PayPal Refund Transaction ID: %s', 'give' ),
425
+			esc_html__('PayPal Refund Transaction ID: %s', 'give'),
426 426
 			$data['txn_id']
427 427
 		)
428 428
 	);
429
-	give_update_payment_status( $payment_id, 'refunded' );
429
+	give_update_payment_status($payment_id, 'refunded');
430 430
 }
431 431
 
432 432
 /**
@@ -438,24 +438,24 @@  discard block
 block discarded – undo
438 438
  *
439 439
  * @return string
440 440
  */
441
-function give_get_paypal_redirect( $ssl_check = false ) {
441
+function give_get_paypal_redirect($ssl_check = false) {
442 442
 
443
-	if ( is_ssl() || ! $ssl_check ) {
443
+	if (is_ssl() || ! $ssl_check) {
444 444
 		$protocol = 'https://';
445 445
 	} else {
446 446
 		$protocol = 'http://';
447 447
 	}
448 448
 
449 449
 	// Check the current payment mode
450
-	if ( give_is_test_mode() ) {
450
+	if (give_is_test_mode()) {
451 451
 		// Test mode
452
-		$paypal_uri = $protocol . 'www.sandbox.paypal.com/cgi-bin/webscr';
452
+		$paypal_uri = $protocol.'www.sandbox.paypal.com/cgi-bin/webscr';
453 453
 	} else {
454 454
 		// Live mode
455
-		$paypal_uri = $protocol . 'www.paypal.com/cgi-bin/webscr';
455
+		$paypal_uri = $protocol.'www.paypal.com/cgi-bin/webscr';
456 456
 	}
457 457
 
458
-	return apply_filters( 'give_paypal_uri', $paypal_uri );
458
+	return apply_filters('give_paypal_uri', $paypal_uri);
459 459
 }
460 460
 
461 461
 /**
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
  * @return string
466 466
  */
467 467
 function give_get_paypal_page_style() {
468
-	$page_style = trim( give_get_option( 'paypal_page_style', 'PayPal' ) );
468
+	$page_style = trim(give_get_option('paypal_page_style', 'PayPal'));
469 469
 
470
-	return apply_filters( 'give_paypal_page_style', $page_style );
470
+	return apply_filters('give_paypal_page_style', $page_style);
471 471
 }
472 472
 
473 473
 /**
@@ -481,26 +481,26 @@  discard block
 block discarded – undo
481 481
  *
482 482
  * @return string
483 483
  */
484
-function give_paypal_success_page_content( $content ) {
484
+function give_paypal_success_page_content($content) {
485 485
 
486
-	if ( ! isset( $_GET['payment-id'] ) && ! give_get_purchase_session() ) {
486
+	if ( ! isset($_GET['payment-id']) && ! give_get_purchase_session()) {
487 487
 		return $content;
488 488
 	}
489 489
 
490
-	$payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false;
490
+	$payment_id = isset($_GET['payment-id']) ? absint($_GET['payment-id']) : false;
491 491
 
492
-	if ( ! $payment_id ) {
492
+	if ( ! $payment_id) {
493 493
 		$session    = give_get_purchase_session();
494
-		$payment_id = give_get_purchase_id_by_key( $session['purchase_key'] );
494
+		$payment_id = give_get_purchase_id_by_key($session['purchase_key']);
495 495
 	}
496 496
 
497
-	$payment = get_post( $payment_id );
498
-	if ( $payment && 'pending' == $payment->post_status ) {
497
+	$payment = get_post($payment_id);
498
+	if ($payment && 'pending' == $payment->post_status) {
499 499
 
500 500
 		// Payment is still pending so show processing indicator to fix the race condition.
501 501
 		ob_start();
502 502
 
503
-		give_get_template_part( 'payment', 'processing' );
503
+		give_get_template_part('payment', 'processing');
504 504
 
505 505
 		$content = ob_get_clean();
506 506
 
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
 }
512 512
 
513
-add_filter( 'give_payment_confirm_paypal', 'give_paypal_success_page_content' );
513
+add_filter('give_payment_confirm_paypal', 'give_paypal_success_page_content');
514 514
 
515 515
 /**
516 516
  * Given a Payment ID, extract the transaction ID
@@ -521,22 +521,22 @@  discard block
 block discarded – undo
521 521
  *
522 522
  * @return string                   Transaction ID
523 523
  */
524
-function give_paypal_get_payment_transaction_id( $payment_id ) {
524
+function give_paypal_get_payment_transaction_id($payment_id) {
525 525
 
526 526
 	$transaction_id = '';
527
-	$notes          = give_get_payment_notes( $payment_id );
527
+	$notes          = give_get_payment_notes($payment_id);
528 528
 
529
-	foreach ( $notes as $note ) {
530
-		if ( preg_match( '/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match ) ) {
529
+	foreach ($notes as $note) {
530
+		if (preg_match('/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match)) {
531 531
 			$transaction_id = $match[1];
532 532
 			continue;
533 533
 		}
534 534
 	}
535 535
 
536
-	return apply_filters( 'give_paypal_set_payment_transaction_id', $transaction_id, $payment_id );
536
+	return apply_filters('give_paypal_set_payment_transaction_id', $transaction_id, $payment_id);
537 537
 }
538 538
 
539
-add_filter( 'give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1 );
539
+add_filter('give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1);
540 540
 
541 541
 /**
542 542
  * Given a transaction ID, generate a link to the PayPal transaction ID details
@@ -548,16 +548,16 @@  discard block
 block discarded – undo
548 548
  *
549 549
  * @return string                 A link to the PayPal transaction details
550 550
  */
551
-function give_paypal_link_transaction_id( $transaction_id, $payment_id ) {
551
+function give_paypal_link_transaction_id($transaction_id, $payment_id) {
552 552
 
553 553
 	$paypal_base_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=';
554
-	$transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
554
+	$transaction_url = '<a href="'.esc_url($paypal_base_url.$transaction_id).'" target="_blank">'.$transaction_id.'</a>';
555 555
 
556
-	return apply_filters( 'give_paypal_link_payment_details_transaction_id', $transaction_url );
556
+	return apply_filters('give_paypal_link_payment_details_transaction_id', $transaction_url);
557 557
 
558 558
 }
559 559
 
560
-add_filter( 'give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2 );
560
+add_filter('give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2);
561 561
 
562 562
 
563 563
 /**
@@ -569,64 +569,64 @@  discard block
 block discarded – undo
569 569
  *
570 570
  * @return string
571 571
  */
572
-function give_paypal_get_pending_donation_note( $pending_reason ) {
572
+function give_paypal_get_pending_donation_note($pending_reason) {
573 573
 
574 574
 	$note = '';
575 575
 
576
-	switch ( $pending_reason ) {
576
+	switch ($pending_reason) {
577 577
 
578 578
 		case 'echeck' :
579 579
 
580
-			$note = esc_html__( 'Payment made via eCheck and will clear automatically in 5-8 days.', 'give' );
580
+			$note = esc_html__('Payment made via eCheck and will clear automatically in 5-8 days.', 'give');
581 581
 
582 582
 			break;
583 583
 
584 584
 		case 'address' :
585 585
 
586
-			$note = esc_html__( 'Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give' );
586
+			$note = esc_html__('Payment requires a confirmed donor address and must be accepted manually through PayPal.', 'give');
587 587
 
588 588
 			break;
589 589
 
590 590
 		case 'intl' :
591 591
 
592
-			$note = esc_html__( 'Payment must be accepted manually through PayPal due to international account regulations.', 'give' );
592
+			$note = esc_html__('Payment must be accepted manually through PayPal due to international account regulations.', 'give');
593 593
 
594 594
 			break;
595 595
 
596 596
 		case 'multi-currency' :
597 597
 
598
-			$note = esc_html__( 'Payment received in non-shop currency and must be accepted manually through PayPal.', 'give' );
598
+			$note = esc_html__('Payment received in non-shop currency and must be accepted manually through PayPal.', 'give');
599 599
 
600 600
 			break;
601 601
 
602 602
 		case 'paymentreview' :
603 603
 		case 'regulatory_review' :
604 604
 
605
-			$note = esc_html__( 'Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give' );
605
+			$note = esc_html__('Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations.', 'give');
606 606
 
607 607
 			break;
608 608
 
609 609
 		case 'unilateral' :
610 610
 
611
-			$note = esc_html__( 'Payment was sent to non-confirmed or non-registered email address.', 'give' );
611
+			$note = esc_html__('Payment was sent to non-confirmed or non-registered email address.', 'give');
612 612
 
613 613
 			break;
614 614
 
615 615
 		case 'upgrade' :
616 616
 
617
-			$note = esc_html__( 'PayPal account must be upgraded before this payment can be accepted.', 'give' );
617
+			$note = esc_html__('PayPal account must be upgraded before this payment can be accepted.', 'give');
618 618
 
619 619
 			break;
620 620
 
621 621
 		case 'verify' :
622 622
 
623
-			$note = esc_html__( 'PayPal account is not verified. Verify account in order to accept this donation.', 'give' );
623
+			$note = esc_html__('PayPal account is not verified. Verify account in order to accept this donation.', 'give');
624 624
 
625 625
 			break;
626 626
 
627 627
 		case 'other' :
628 628
 
629
-			$note = esc_html__( 'Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give' );
629
+			$note = esc_html__('Payment is pending for unknown reasons. Contact PayPal support for assistance.', 'give');
630 630
 
631 631
 			break;
632 632
 
@@ -644,49 +644,49 @@  discard block
 block discarded – undo
644 644
  *
645 645
  * @return mixed|string
646 646
  */
647
-function give_build_paypal_url( $payment_id, $payment_data ) {
647
+function give_build_paypal_url($payment_id, $payment_data) {
648 648
 	// Only send to PayPal if the pending payment is created successfully.
649
-	$listener_url = add_query_arg( 'give-listener', 'IPN', home_url( 'index.php' ) );
649
+	$listener_url = add_query_arg('give-listener', 'IPN', home_url('index.php'));
650 650
 
651 651
 	// Get the success url.
652
-	$return_url = add_query_arg( array(
652
+	$return_url = add_query_arg(array(
653 653
 		'payment-confirmation' => 'paypal',
654 654
 		'payment-id'           => $payment_id,
655 655
 
656
-	), get_permalink( give_get_option( 'success_page' ) ) );
656
+	), get_permalink(give_get_option('success_page')));
657 657
 
658 658
 	// Get the PayPal redirect uri.
659
-	$paypal_redirect = trailingslashit( give_get_paypal_redirect() ) . '?';
659
+	$paypal_redirect = trailingslashit(give_get_paypal_redirect()).'?';
660 660
 
661 661
 	// Item name.
662
-	$item_name = give_build_paypal_item_title( $payment_data );
662
+	$item_name = give_build_paypal_item_title($payment_data);
663 663
 
664 664
 	// Setup PayPal API params.
665 665
 	$paypal_args = array(
666
-		'business'      => give_get_option( 'paypal_email', false ),
666
+		'business'      => give_get_option('paypal_email', false),
667 667
 		'first_name'    => $payment_data['user_info']['first_name'],
668 668
 		'last_name'     => $payment_data['user_info']['last_name'],
669 669
 		'email'         => $payment_data['user_email'],
670 670
 		'invoice'       => $payment_data['purchase_key'],
671 671
 		'amount'        => $payment_data['price'],
672
-		'item_name'     => stripslashes( $item_name ),
672
+		'item_name'     => stripslashes($item_name),
673 673
 		'no_shipping'   => '1',
674 674
 		'shipping'      => '0',
675 675
 		'no_note'       => '1',
676 676
 		'currency_code' => give_get_currency(),
677
-		'charset'       => get_bloginfo( 'charset' ),
677
+		'charset'       => get_bloginfo('charset'),
678 678
 		'custom'        => $payment_id,
679 679
 		'rm'            => '2',
680 680
 		'return'        => $return_url,
681
-		'cancel_return' => give_get_failed_transaction_uri( '?payment-id=' . $payment_id ),
681
+		'cancel_return' => give_get_failed_transaction_uri('?payment-id='.$payment_id),
682 682
 		'notify_url'    => $listener_url,
683 683
 		'page_style'    => give_get_paypal_page_style(),
684
-		'cbt'           => get_bloginfo( 'name' ),
684
+		'cbt'           => get_bloginfo('name'),
685 685
 		'bn'            => 'givewp_SP',
686 686
 	);
687 687
 
688 688
 	// Add user address if present.
689
-	if ( ! empty( $payment_data['user_info']['address'] ) ) {
689
+	if ( ! empty($payment_data['user_info']['address'])) {
690 690
 		$default_address = array(
691 691
 			'line1'   => '',
692 692
 			'line2'   => '',
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 			'country' => '',
696 696
 		);
697 697
 
698
-		$address = wp_parse_args( $payment_data['user_info']['address'], $default_address );
698
+		$address = wp_parse_args($payment_data['user_info']['address'], $default_address);
699 699
 
700 700
 		$paypal_args['address1'] = $address['line1'];
701 701
 		$paypal_args['address2'] = $address['line2'];
@@ -715,13 +715,13 @@  discard block
 block discarded – undo
715 715
 	 * @param array $paypal_args
716 716
 	 * @param array $payment_data
717 717
 	 */
718
-	$paypal_args = apply_filters( 'give_paypal_redirect_args', $paypal_args, $payment_data );
718
+	$paypal_args = apply_filters('give_paypal_redirect_args', $paypal_args, $payment_data);
719 719
 
720 720
 	// Build query.
721
-	$paypal_redirect .= http_build_query( $paypal_args );
721
+	$paypal_redirect .= http_build_query($paypal_args);
722 722
 
723 723
 	// Fix for some sites that encode the entities.
724
-	$paypal_redirect = str_replace( '&amp;', '&', $paypal_redirect );
724
+	$paypal_redirect = str_replace('&amp;', '&', $paypal_redirect);
725 725
 
726 726
 	return $paypal_redirect;
727 727
 }
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 function give_get_paypal_button_type() {
737 737
 	// paypal_button_type can be donation or standard.
738 738
 	$paypal_button_type = '_donations';
739
-	if ( give_get_option( 'paypal_button_type' ) === 'standard' ) {
739
+	if (give_get_option('paypal_button_type') === 'standard') {
740 740
 		$paypal_button_type = '_xclick';
741 741
 	}
742 742
 
@@ -752,32 +752,32 @@  discard block
 block discarded – undo
752 752
  *
753 753
  * @return string
754 754
  */
755
-function give_build_paypal_item_title( $payment_data ) {
756
-	$form_id   = intval( $payment_data['post_data']['give-form-id'] );
755
+function give_build_paypal_item_title($payment_data) {
756
+	$form_id   = intval($payment_data['post_data']['give-form-id']);
757 757
 	$item_name = $payment_data['post_data']['give-form-title'];
758 758
 
759 759
 	// Verify has variable prices.
760
-	if ( give_has_variable_prices( $form_id ) && isset( $payment_data['post_data']['give-price-id'] ) ) {
760
+	if (give_has_variable_prices($form_id) && isset($payment_data['post_data']['give-price-id'])) {
761 761
 
762
-		$item_price_level_text = give_get_price_option_name( $form_id, $payment_data['post_data']['give-price-id'] );
763
-		$price_level_amount    = give_get_price_option_amount( $form_id, $payment_data['post_data']['give-price-id'] );
762
+		$item_price_level_text = give_get_price_option_name($form_id, $payment_data['post_data']['give-price-id']);
763
+		$price_level_amount    = give_get_price_option_amount($form_id, $payment_data['post_data']['give-price-id']);
764 764
 
765 765
 		// Donation given doesn't match selected level (must be a custom amount).
766
-		if ( $price_level_amount != give_sanitize_amount( $payment_data['price'] ) ) {
767
-			$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
766
+		if ($price_level_amount != give_sanitize_amount($payment_data['price'])) {
767
+			$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
768 768
 			// user custom amount text if any, fallback to default if not.
769
-			$item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', esc_html__( 'Custom Amount', 'give' ) );
769
+			$item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', esc_html__('Custom Amount', 'give'));
770 770
 
771 771
 		} //Is there any donation level text?
772
-		elseif ( ! empty( $item_price_level_text ) ) {
773
-			$item_name .= ' - ' . $item_price_level_text;
772
+		elseif ( ! empty($item_price_level_text)) {
773
+			$item_name .= ' - '.$item_price_level_text;
774 774
 		}
775 775
 
776 776
 	} //Single donation: Custom Amount.
777
-	elseif ( give_get_form_price( $form_id ) !== give_sanitize_amount( $payment_data['price'] ) ) {
778
-		$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
777
+	elseif (give_get_form_price($form_id) !== give_sanitize_amount($payment_data['price'])) {
778
+		$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
779 779
 		// user custom amount text if any, fallback to default if not.
780
-		$item_name .= ' - ' . give_check_variable( $custom_amount_text, 'empty', esc_html__( 'Custom Amount', 'give' ) );
780
+		$item_name .= ' - '.give_check_variable($custom_amount_text, 'empty', esc_html__('Custom Amount', 'give'));
781 781
 	}
782 782
 
783 783
 	return $item_name;
Please login to merge, or discard this patch.
give.php 1 patch
Spacing   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  */
41 41
 
42 42
 // Exit if accessed directly.
43
-if ( ! defined( 'ABSPATH' ) ) {
43
+if ( ! defined('ABSPATH')) {
44 44
 	exit;
45 45
 }
46 46
 
47
-if ( ! class_exists( 'Give' ) ) :
47
+if ( ! class_exists('Give')) :
48 48
 
49 49
 	/**
50 50
 	 * Main Give Class
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		 * @return    Give
196 196
 		 */
197 197
 		public static function instance() {
198
-			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Give ) ) {
198
+			if ( ! isset(self::$instance) && ! (self::$instance instanceof Give)) {
199 199
 				self::$instance = new Give;
200 200
 				self::$instance->setup_constants();
201 201
 
202
-				add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
202
+				add_action('plugins_loaded', array(self::$instance, 'load_textdomain'));
203 203
 
204 204
 				self::$instance->includes();
205 205
 				self::$instance->roles           = new Give_Roles();
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		 */
233 233
 		public function __clone() {
234 234
 			// Cloning instances of the class is forbidden
235
-			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
235
+			_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
236 236
 		}
237 237
 
238 238
 		/**
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		 */
246 246
 		public function __wakeup() {
247 247
 			// Unserializing instances of the class is forbidden.
248
-			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
248
+			_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
249 249
 		}
250 250
 
251 251
 		/**
@@ -259,33 +259,33 @@  discard block
 block discarded – undo
259 259
 		private function setup_constants() {
260 260
 
261 261
 			// Plugin version
262
-			if ( ! defined( 'GIVE_VERSION' ) ) {
263
-				define( 'GIVE_VERSION', '1.8' );
262
+			if ( ! defined('GIVE_VERSION')) {
263
+				define('GIVE_VERSION', '1.8');
264 264
 			}
265 265
 
266 266
 			// Plugin Folder Path
267
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
268
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
267
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
268
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__));
269 269
 			}
270 270
 
271 271
 			// Plugin Folder URL
272
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
273
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
272
+			if ( ! defined('GIVE_PLUGIN_URL')) {
273
+				define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__));
274 274
 			}
275 275
 
276 276
 			// Plugin Basename aka: "give/give.php"
277
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
278
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
277
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
278
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__));
279 279
 			}
280 280
 
281 281
 			// Plugin Root File
282
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
283
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
282
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
283
+				define('GIVE_PLUGIN_FILE', __FILE__);
284 284
 			}
285 285
 
286 286
 			// Make sure CAL_GREGORIAN is defined
287
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
288
-				define( 'CAL_GREGORIAN', 1 );
287
+			if ( ! defined('CAL_GREGORIAN')) {
288
+				define('CAL_GREGORIAN', 1);
289 289
 			}
290 290
 		}
291 291
 
@@ -300,122 +300,122 @@  discard block
 block discarded – undo
300 300
 		private function includes() {
301 301
 			global $give_options;
302 302
 
303
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
304
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
303
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
304
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
305 305
 			$give_options = give_get_settings();
306 306
 
307
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
308
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
309
-			require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
310
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
311
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
312
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
313
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
314
-
315
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
316
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
317
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
318
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
319
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customers.php';
320
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customer-meta.php';
321
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-customer.php';
322
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
323
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
324
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
325
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
326
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
327
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
328
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
329
-
330
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
331
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
332
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
333
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
334
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
335
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
336
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
337
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
338
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
339
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
340
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
341
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
342
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
343
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
344
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
345
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
346
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
347
-
348
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
349
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
350
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
351
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
352
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
353
-
354
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
355
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
356
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
357
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
358
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
359
-
360
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
361
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
362
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
363
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
364
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
365
-
366
-            if( defined( 'WP_CLI' ) && WP_CLI ) {
367
-                require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
307
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
308
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
309
+			require_once GIVE_PLUGIN_DIR.'includes/scripts.php';
310
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
311
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
312
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
313
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
314
+
315
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
316
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
317
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
318
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
319
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customers.php';
320
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customer-meta.php';
321
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-customer.php';
322
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
323
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
324
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
325
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
326
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
327
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
328
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
329
+
330
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
331
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
332
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
333
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
334
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
335
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
336
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
337
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
338
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
339
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
340
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
341
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
342
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
343
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
344
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
345
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
346
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
347
+
348
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
349
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
350
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
351
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
352
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
353
+
354
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
355
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
356
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
357
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
358
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
359
+
360
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
361
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
362
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
363
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
364
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
365
+
366
+            if (defined('WP_CLI') && WP_CLI) {
367
+                require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
368 368
             }
369 369
 
370
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
371
-
372
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
373
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
374
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
375
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-notices.php';
376
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
377
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
378
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
379
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
380
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php';
381
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
382
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
383
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
384
-
385
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
386
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
387
-
388
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php';
389
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php';
390
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php';
391
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
392
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
393
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
394
-
395
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php';
396
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php';
397
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools.php';
398
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/tools-actions.php';
399
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php';
400
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php';
401
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
402
-
403
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
404
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
405
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
406
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
407
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
408
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
409
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
410
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
411
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
412
-
413
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
414
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
370
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
371
+
372
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
373
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
374
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
375
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-notices.php';
376
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
377
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
378
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
379
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
380
+				require_once GIVE_PLUGIN_DIR.'includes/admin/system-info.php';
381
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
382
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
383
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
384
+
385
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
386
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
387
+
388
+				require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customers.php';
389
+				require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-functions.php';
390
+				require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-actions.php';
391
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
392
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
393
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
394
+
395
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-functions.php';
396
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/reports.php';
397
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools.php';
398
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/tools-actions.php';
399
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/pdf-reports.php';
400
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-give-graph.php';
401
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/graphing.php';
402
+
403
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
404
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
405
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
406
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
407
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
408
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
409
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
410
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
411
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
412
+
413
+				require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php';
414
+				require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrades.php';
415 415
 
416 416
 			}
417 417
 
418
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
418
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
419 419
 
420 420
 		}
421 421
 
@@ -429,26 +429,26 @@  discard block
 block discarded – undo
429 429
 		 */
430 430
 		public function load_textdomain() {
431 431
 			// Set filter for Give's languages directory
432
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
433
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
432
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
433
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
434 434
 
435 435
 			// Traditional WordPress plugin locale filter
436
-			$locale = apply_filters( 'plugin_locale', get_locale(), 'give' );
437
-			$mofile = sprintf( '%1$s-%2$s.mo', 'give', $locale );
436
+			$locale = apply_filters('plugin_locale', get_locale(), 'give');
437
+			$mofile = sprintf('%1$s-%2$s.mo', 'give', $locale);
438 438
 
439 439
 			// Setup paths to current locale file
440
-			$mofile_local  = $give_lang_dir . $mofile;
441
-			$mofile_global = WP_LANG_DIR . '/give/' . $mofile;
440
+			$mofile_local  = $give_lang_dir.$mofile;
441
+			$mofile_global = WP_LANG_DIR.'/give/'.$mofile;
442 442
 
443
-			if ( file_exists( $mofile_global ) ) {
443
+			if (file_exists($mofile_global)) {
444 444
 				// Look in global /wp-content/languages/give folder
445
-				load_textdomain( 'give', $mofile_global );
446
-			} elseif ( file_exists( $mofile_local ) ) {
445
+				load_textdomain('give', $mofile_global);
446
+			} elseif (file_exists($mofile_local)) {
447 447
 				// Look in local location from filter `give_languages_directory`
448
-				load_textdomain( 'give', $mofile_local );
448
+				load_textdomain('give', $mofile_local);
449 449
 			} else {
450 450
 				// Load the default language files packaged up w/ Give
451
-				load_plugin_textdomain( 'give', false, $give_lang_dir );
451
+				load_plugin_textdomain('give', false, $give_lang_dir);
452 452
 			}
453 453
 		}
454 454
 
Please login to merge, or discard this patch.
includes/admin/tools/class-settings-logs.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Logs' ) ) :
16
+if ( ! class_exists('Give_Settings_Logs')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Logs.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'logs';
46
-			$this->label = esc_html__( 'Logs', 'give' );
46
+			$this->label = esc_html__('Logs', 'give');
47 47
 
48 48
 			$this->default_tab = 'sales';
49 49
 
50 50
 			parent::__construct();
51 51
 
52 52
 			// Do not use main form for this tab.
53
-			if ( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-tools_open_form', '__return_empty_string' );
55
-				add_action( 'give-tools_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-tools_open_form', '__return_empty_string');
55
+				add_action('give-tools_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 		 *
66 66
 		 * @return array
67 67
 		 */
68
-		public function add_settings_page( $pages ) {
69
-			$pages[ $this->id ] = $this->label;
68
+		public function add_settings_page($pages) {
69
+			$pages[$this->id] = $this->label;
70 70
 
71 71
 			return $pages;
72 72
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			$GLOBALS['give_hide_save_button'] = true;
83 83
 
84 84
 			// Get settings.
85
-			$settings = apply_filters( 'give_settings_system', array(
85
+			$settings = apply_filters('give_settings_system', array(
86 86
 				array(
87 87
 					'id'         => 'give_tools_logs',
88 88
 					'type'       => 'title',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 				),
91 91
 				array(
92 92
 					'id'   => 'api',
93
-					'name' => esc_html__( 'Log', 'give' ),
93
+					'name' => esc_html__('Log', 'give'),
94 94
 					'type' => 'logs',
95 95
 
96 96
 				),
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					'type'       => 'sectionend',
100 100
 					'table_html' => false,
101 101
 				),
102
-			) );
102
+			));
103 103
 
104 104
 			/**
105 105
 			 * Filter the settings.
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 			 *
109 109
 			 * @param  array $settings
110 110
 			 */
111
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
111
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
112 112
 
113 113
 			// Output.
114 114
 			return $settings;
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 		 */
123 123
 		public function get_sections() {
124 124
 			$sections = array(
125
-				'sales'          => esc_html__( 'Donations', 'give' ),
126
-				'gateway_errors' => esc_html__( 'Payment Errors', 'give' ),
127
-				'api_requests'   => esc_html__( 'API Requests', 'give' ),
125
+				'sales'          => esc_html__('Donations', 'give'),
126
+				'gateway_errors' => esc_html__('Payment Errors', 'give'),
127
+				'api_requests'   => esc_html__('API Requests', 'give'),
128 128
 			);
129 129
 
130
-			$sections = apply_filters( 'give_log_views', $sections );
130
+			$sections = apply_filters('give_log_views', $sections);
131 131
 
132
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
132
+			return apply_filters('give_get_sections_'.$this->id, $sections);
133 133
 		}
134 134
 
135 135
 		/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		public function output() {
142 142
 			$settings = $this->get_settings();
143 143
 
144
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
144
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
145 145
 		}
146 146
 	}
147 147
 
Please login to merge, or discard this patch.
includes/admin/class-admin-notices.php 1 patch
Spacing   +67 added lines, -67 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
 
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	 * @since 1.0
34 34
 	 */
35 35
 	public function __construct() {
36
-		add_action( 'admin_notices', array( $this, 'show_notices' ) );
37
-		add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) );
38
-		add_action( 'admin_bar_menu', array( $this, 'give_admin_bar_menu' ), 1000, 1 );
36
+		add_action('admin_notices', array($this, 'show_notices'));
37
+		add_action('give_dismiss_notices', array($this, 'dismiss_notices'));
38
+		add_action('admin_bar_menu', array($this, 'give_admin_bar_menu'), 1000, 1);
39 39
 
40 40
 		$this->notices = array(
41 41
 			'updated' => array(),
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 	 *
52 52
 	 * @return bool
53 53
 	 */
54
-	public function give_admin_bar_menu( $wp_admin_bar ) {
54
+	public function give_admin_bar_menu($wp_admin_bar) {
55 55
 
56
-		if ( ! give_is_test_mode() || ! current_user_can( 'view_give_reports' ) ) {
56
+		if ( ! give_is_test_mode() || ! current_user_can('view_give_reports')) {
57 57
 			return false;
58 58
 		}
59 59
 
60 60
 		// Add the main siteadmin menu item.
61
-		$wp_admin_bar->add_menu( array(
61
+		$wp_admin_bar->add_menu(array(
62 62
 			'id'     => 'give-test-notice',
63
-			'href'   => admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways' ),
63
+			'href'   => admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'),
64 64
 			'parent' => 'top-secondary',
65
-			'title'  => esc_html__( 'Give Test Mode Active', 'give' ),
66
-			'meta'   => array( 'class' => 'give-test-mode-active' ),
67
-		) );
65
+			'title'  => esc_html__('Give Test Mode Active', 'give'),
66
+			'meta'   => array('class' => 'give-test-mode-active'),
67
+		));
68 68
 
69 69
 	}
70 70
 
@@ -75,100 +75,100 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function show_notices() {
77 77
 
78
-		if ( ! give_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_give_settings' ) ) {
78
+		if ( ! give_test_ajax_works() && ! get_user_meta(get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true) && current_user_can('manage_give_settings')) {
79 79
 			echo '<div class="error">';
80
-			echo '<p>' . esc_html__( 'Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give' ) . '</p>';
80
+			echo '<p>'.esc_html__('Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give').'</p>';
81 81
 			/* translators: %s: https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/ */
82
-			echo '<p>' . sprintf( __( 'Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give' ), esc_url( 'https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/' ) ) . '</p>';
83
-			echo '<p><a href="' . add_query_arg( array(
82
+			echo '<p>'.sprintf(__('Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give'), esc_url('https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/')).'</p>';
83
+			echo '<p><a href="'.add_query_arg(array(
84 84
 					'give_action' => 'dismiss_notices',
85 85
 					'give_notice' => 'admin_ajax_inaccessible',
86
-				) ) . '">' . esc_html__( 'Dismiss Notice', 'give' ) . '</a></p>';
86
+				)).'">'.esc_html__('Dismiss Notice', 'give').'</a></p>';
87 87
 			echo '</div>';
88 88
 		}
89 89
 
90
-		if ( isset( $_GET['give-message'] ) ) {
90
+		if (isset($_GET['give-message'])) {
91 91
 
92 92
 			// Donation reports errors.
93
-			if ( current_user_can( 'view_give_reports' ) ) {
94
-				switch ( $_GET['give-message'] ) {
93
+			if (current_user_can('view_give_reports')) {
94
+				switch ($_GET['give-message']) {
95 95
 					case 'donation_deleted' :
96
-						$this->notices['updated']['give-donation-deleted'] = esc_attr__( 'The donation has been deleted.', 'give' );
96
+						$this->notices['updated']['give-donation-deleted'] = esc_attr__('The donation has been deleted.', 'give');
97 97
 						break;
98 98
 					case 'email_sent' :
99
-						$this->notices['updated']['give-payment-sent'] = esc_attr__( 'The donation receipt has been resent.', 'give' );
99
+						$this->notices['updated']['give-payment-sent'] = esc_attr__('The donation receipt has been resent.', 'give');
100 100
 						break;
101 101
 					case 'refreshed-reports' :
102
-						$this->notices['updated']['give-refreshed-reports'] = esc_attr__( 'The reports cache has been cleared.', 'give' );
102
+						$this->notices['updated']['give-refreshed-reports'] = esc_attr__('The reports cache has been cleared.', 'give');
103 103
 						break;
104 104
 					case 'donation-note-deleted' :
105
-						$this->notices['updated']['give-donation-note-deleted'] = esc_attr__( 'The donation note has been deleted.', 'give' );
105
+						$this->notices['updated']['give-donation-note-deleted'] = esc_attr__('The donation note has been deleted.', 'give');
106 106
 						break;
107 107
 				}
108 108
 			}
109 109
 
110 110
 			// Give settings notices and errors.
111
-			if ( current_user_can( 'manage_give_settings' ) ) {
112
-				switch ( $_GET['give-message'] ) {
111
+			if (current_user_can('manage_give_settings')) {
112
+				switch ($_GET['give-message']) {
113 113
 					case 'settings-imported' :
114
-						$this->notices['updated']['give-settings-imported'] = esc_attr__( 'The settings have been imported.', 'give' );
114
+						$this->notices['updated']['give-settings-imported'] = esc_attr__('The settings have been imported.', 'give');
115 115
 						break;
116 116
 					case 'api-key-generated' :
117
-						$this->notices['updated']['give-api-key-generated'] = esc_attr__( 'API keys have been generated.', 'give' );
117
+						$this->notices['updated']['give-api-key-generated'] = esc_attr__('API keys have been generated.', 'give');
118 118
 						break;
119 119
 					case 'api-key-exists' :
120
-						$this->notices['error']['give-api-key-exists'] = esc_attr__( 'The specified user already has API keys.', 'give' );
120
+						$this->notices['error']['give-api-key-exists'] = esc_attr__('The specified user already has API keys.', 'give');
121 121
 						break;
122 122
 					case 'api-key-regenerated' :
123
-						$this->notices['updated']['give-api-key-regenerated'] = esc_attr__( 'API keys have been regenerated.', 'give' );
123
+						$this->notices['updated']['give-api-key-regenerated'] = esc_attr__('API keys have been regenerated.', 'give');
124 124
 						break;
125 125
 					case 'api-key-revoked' :
126
-						$this->notices['updated']['give-api-key-revoked'] = esc_attr__( 'API keys have been revoked.', 'give' );
126
+						$this->notices['updated']['give-api-key-revoked'] = esc_attr__('API keys have been revoked.', 'give');
127 127
 						break;
128 128
 					case 'sent-test-email' :
129
-						$this->notices['updated']['give-sent-test-email'] = esc_attr__( 'The test email has been sent.', 'give' );
129
+						$this->notices['updated']['give-sent-test-email'] = esc_attr__('The test email has been sent.', 'give');
130 130
 						break;
131 131
 					case 'matched-success-failure-page':
132
-						$this->notices['updated']['give-matched-success-failure-page'] = esc_html__( 'You cannot set the success and failed pages to the same page', 'give' );
132
+						$this->notices['updated']['give-matched-success-failure-page'] = esc_html__('You cannot set the success and failed pages to the same page', 'give');
133 133
 				}
134 134
 			}
135 135
 			// Payments errors.
136
-			if ( current_user_can( 'edit_give_payments' ) ) {
137
-				switch ( $_GET['give-message'] ) {
136
+			if (current_user_can('edit_give_payments')) {
137
+				switch ($_GET['give-message']) {
138 138
 					case 'note-added' :
139
-						$this->notices['updated']['give-note-added'] = esc_attr__( 'The donation note has been added.', 'give' );
139
+						$this->notices['updated']['give-note-added'] = esc_attr__('The donation note has been added.', 'give');
140 140
 						break;
141 141
 					case 'payment-updated' :
142
-						$this->notices['updated']['give-payment-updated'] = esc_attr__( 'The donation has been updated.', 'give' );
142
+						$this->notices['updated']['give-payment-updated'] = esc_attr__('The donation has been updated.', 'give');
143 143
 						break;
144 144
 				}
145 145
 			}
146 146
 
147 147
 			// Customer Notices.
148
-			if ( current_user_can( 'edit_give_payments' ) ) {
149
-				switch ( $_GET['give-message'] ) {
148
+			if (current_user_can('edit_give_payments')) {
149
+				switch ($_GET['give-message']) {
150 150
 					case 'customer-deleted' :
151
-						$this->notices['updated']['give-customer-deleted'] = esc_attr__( 'The donor has been deleted.', 'give' );
151
+						$this->notices['updated']['give-customer-deleted'] = esc_attr__('The donor has been deleted.', 'give');
152 152
 						break;
153 153
 
154 154
 					case 'email-added' :
155
-						$this->notices['updated']['give-customer-email-added'] = esc_attr__( 'Donor email added', 'give' );
155
+						$this->notices['updated']['give-customer-email-added'] = esc_attr__('Donor email added', 'give');
156 156
 						break;
157 157
 
158 158
 					case 'email-removed' :
159
-						$this->notices['updated']['give-customer-email-removed'] = esc_attr__( 'Donor email removed', 'give' );
159
+						$this->notices['updated']['give-customer-email-removed'] = esc_attr__('Donor email removed', 'give');
160 160
 						break;
161 161
 
162 162
 					case 'email-remove-failed' :
163
-						$this->notices['error']['give-customer-email-remove-failed'] = esc_attr__( 'Failed to remove donor email', 'give' );
163
+						$this->notices['error']['give-customer-email-remove-failed'] = esc_attr__('Failed to remove donor email', 'give');
164 164
 						break;
165 165
 
166 166
 					case 'primary-email-updated' :
167
-						$this->notices['updated']['give-customer-primary-email-updated'] = esc_attr__( 'Primary email updated for donors', 'give' );
167
+						$this->notices['updated']['give-customer-primary-email-updated'] = esc_attr__('Primary email updated for donors', 'give');
168 168
 						break;
169 169
 
170 170
 					case 'primary-email-failed' :
171
-						$this->notices['error']['give-customer-primary-email-failed'] = esc_attr__( 'Failed to set primary email', 'give' );
171
+						$this->notices['error']['give-customer-primary-email-failed'] = esc_attr__('Failed to set primary email', 'give');
172 172
 
173 173
 				}
174 174
 			}
@@ -176,19 +176,19 @@  discard block
 block discarded – undo
176 176
 
177 177
 		$this->add_payment_bulk_action_notice();
178 178
 
179
-		if ( count( $this->notices['updated'] ) > 0 ) {
180
-			foreach ( $this->notices['updated'] as $notice => $message ) {
181
-				add_settings_error( 'give-notices', $notice, $message, 'updated' );
179
+		if (count($this->notices['updated']) > 0) {
180
+			foreach ($this->notices['updated'] as $notice => $message) {
181
+				add_settings_error('give-notices', $notice, $message, 'updated');
182 182
 			}
183 183
 		}
184 184
 
185
-		if ( count( $this->notices['error'] ) > 0 ) {
186
-			foreach ( $this->notices['error'] as $notice => $message ) {
187
-				add_settings_error( 'give-notices', $notice, $message, 'error' );
185
+		if (count($this->notices['error']) > 0) {
186
+			foreach ($this->notices['error'] as $notice => $message) {
187
+				add_settings_error('give-notices', $notice, $message, 'error');
188 188
 			}
189 189
 		}
190 190
 
191
-		settings_errors( 'give-notices' );
191
+		settings_errors('give-notices');
192 192
 
193 193
 	}
194 194
 
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	 * @return void
201 201
 	 */
202 202
 	function give_admin_addons_notices() {
203
-		add_settings_error( 'give-notices', 'give-addons-feed-error', esc_attr__( 'There seems to be an issue with the server. Please try again in a few minutes.', 'give' ), 'error' );
204
-		settings_errors( 'give-notices' );
203
+		add_settings_error('give-notices', 'give-addons-feed-error', esc_attr__('There seems to be an issue with the server. Please try again in a few minutes.', 'give'), 'error');
204
+		settings_errors('give-notices');
205 205
 	}
206 206
 
207 207
 
@@ -212,9 +212,9 @@  discard block
 block discarded – undo
212 212
 	 * @return void
213 213
 	 */
214 214
 	function dismiss_notices() {
215
-		if ( isset( $_GET['give_notice'] ) ) {
216
-			update_user_meta( get_current_user_id(), '_give_' . $_GET['give_notice'] . '_dismissed', 1 );
217
-			wp_redirect( remove_query_arg( array( 'give_action', 'give_notice' ) ) );
215
+		if (isset($_GET['give_notice'])) {
216
+			update_user_meta(get_current_user_id(), '_give_'.$_GET['give_notice'].'_dismissed', 1);
217
+			wp_redirect(remove_query_arg(array('give_action', 'give_notice')));
218 218
 			exit;
219 219
 		}
220 220
 	}
@@ -229,24 +229,24 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	function add_payment_bulk_action_notice() {
231 231
 		if (
232
-			current_user_can( 'edit_give_payments' )
233
-			&& isset( $_GET['action'] )
234
-			&& ! empty( $_GET['action'] )
235
-			&& isset( $_GET['payment'] )
236
-			&& ! empty( $_GET['payment'] )
232
+			current_user_can('edit_give_payments')
233
+			&& isset($_GET['action'])
234
+			&& ! empty($_GET['action'])
235
+			&& isset($_GET['payment'])
236
+			&& ! empty($_GET['payment'])
237 237
 		) {
238
-			$payment_count = isset( $_GET['payment'] ) ? count( $_GET['payment'] ) : 0;
238
+			$payment_count = isset($_GET['payment']) ? count($_GET['payment']) : 0;
239 239
 
240
-			switch ( $_GET['action'] ) {
240
+			switch ($_GET['action']) {
241 241
 				case 'delete':
242
-					if ( $payment_count ) {
243
-						$this->notices['updated']['bulk_action_delete'] = sprintf( _n( 'Successfully deleted only one transaction.', 'Successfully deleted %d number of transactions.', $payment_count, 'give' ), $payment_count );
242
+					if ($payment_count) {
243
+						$this->notices['updated']['bulk_action_delete'] = sprintf(_n('Successfully deleted only one transaction.', 'Successfully deleted %d number of transactions.', $payment_count, 'give'), $payment_count);
244 244
 					}
245 245
 					break;
246 246
 
247 247
 				case 'resend-receipt':
248
-					if ( $payment_count ) {
249
-						$this->notices['updated']['bulk_action_resend_receipt'] = sprintf( _n( 'Successfully send email receipt to only one recipient.', 'Successfully send email receipts to %d recipients.', $payment_count, 'give' ), $payment_count );
248
+					if ($payment_count) {
249
+						$this->notices['updated']['bulk_action_resend_receipt'] = sprintf(_n('Successfully send email receipt to only one recipient.', 'Successfully send email receipts to %d recipients.', $payment_count, 'give'), $payment_count);
250 250
 					}
251 251
 					break;
252 252
 			}
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-gateways.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 								'disabled' => __( 'Disabled', 'give' ),
87 87
 							)
88 88
 						),
89
-                        array(
90
-                            'name'  => esc_html__( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
-                            'id'    => 'paypal_standard_gateway_settings_docs_link',
92
-                            'url'   => esc_url( 'http://docs.givewp.com/paypalstandard' ),
93
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
-                            'type'  => 'give_docs_link',
95
-                        ),
89
+						array(
90
+							'name'  => esc_html__( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
+							'id'    => 'paypal_standard_gateway_settings_docs_link',
92
+							'url'   => esc_url( 'http://docs.givewp.com/paypalstandard' ),
93
+							'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
+							'type'  => 'give_docs_link',
95
+						),
96 96
 						array(
97 97
 							'type' => 'sectionend',
98 98
 							'id'   => 'give_title_gateway_settings_2',
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 								'textarea_rows' => 6,
146 146
 							)
147 147
 						),
148
-                        array(
149
-                            'name'  => esc_html__( 'Offline Donations Settings Docs Link', 'give' ),
150
-                            'id'    => 'offline_gateway_settings_docs_link',
151
-                            'url'   => esc_url( 'http://docs.givewp.com/offlinegateway' ),
152
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
153
-                            'type'  => 'give_docs_link',
154
-                        ),
148
+						array(
149
+							'name'  => esc_html__( 'Offline Donations Settings Docs Link', 'give' ),
150
+							'id'    => 'offline_gateway_settings_docs_link',
151
+							'url'   => esc_url( 'http://docs.givewp.com/offlinegateway' ),
152
+							'title' => __( 'Offline Gateway Settings', 'give' ),
153
+							'type'  => 'give_docs_link',
154
+						),
155 155
 						array(
156 156
 							'type' => 'sectionend',
157 157
 							'id'   => 'give_title_gateway_settings_3',
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
 							'id'   => 'default_gateway',
190 190
 							'type' => 'default_gateway'
191 191
 						),
192
-                        array(
193
-                            'name'  => esc_html__( 'Gateways Docs Link', 'give' ),
194
-                            'id'    => 'gateway_settings_docs_link',
195
-                            'url'   => esc_url( 'http://docs.givewp.com/gatewayssettings' ),
196
-                            'title' => __( 'Gateway Settings', 'give' ),
197
-                            'type'  => 'give_docs_link',
198
-                        ),
192
+						array(
193
+							'name'  => esc_html__( 'Gateways Docs Link', 'give' ),
194
+							'id'    => 'gateway_settings_docs_link',
195
+							'url'   => esc_url( 'http://docs.givewp.com/gatewayssettings' ),
196
+							'title' => __( 'Gateway Settings', 'give' ),
197
+							'type'  => 'give_docs_link',
198
+						),
199 199
 						array(
200 200
 							'id'   => 'give_title_gateway_settings_1',
201 201
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Gateways' ) ) :
16
+if ( ! class_exists('Give_Settings_Gateways')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Gateways.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'gateways';
30
-			$this->label = esc_html__( 'Payment Gateways', 'give' );
30
+			$this->label = esc_html__('Payment Gateways', 'give');
31 31
 
32 32
 			$this->default_tab = 'gateways-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'paypal-standard':
49 49
 					$settings = array(
50 50
 						// Section 2: Paypal Standard.
@@ -53,44 +53,44 @@  discard block
 block discarded – undo
53 53
 							'id'   => 'give_title_gateway_settings_2',
54 54
 						),
55 55
 						array(
56
-							'name' => esc_html__( 'PayPal Email', 'give' ),
57
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
56
+							'name' => esc_html__('PayPal Email', 'give'),
57
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
58 58
 							'id'   => 'paypal_email',
59 59
 							'type' => 'email',
60 60
 						),
61 61
 						array(
62
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
63
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
62
+							'name' => esc_html__('PayPal Page Style', 'give'),
63
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
64 64
 							'id'   => 'paypal_page_style',
65 65
 							'type' => 'text',
66 66
 						),
67 67
 						array(
68
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
69
-							'desc'    => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
68
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
69
+							'desc'    => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
70 70
 							'id'      => 'paypal_button_type',
71 71
 							'type'    => 'radio_inline',
72 72
 							'options' => array(
73
-								'donation' => esc_html__( 'Donation', 'give' ),
74
-								'standard' => esc_html__( 'Standard Transaction', 'give' )
73
+								'donation' => esc_html__('Donation', 'give'),
74
+								'standard' => esc_html__('Standard Transaction', 'give')
75 75
 							),
76 76
 							'default' => 'donation',
77 77
 						),
78 78
 						array(
79
-							'name'    => esc_html__( 'PayPal IPN Verification', 'give' ),
80
-							'desc'    => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
79
+							'name'    => esc_html__('PayPal IPN Verification', 'give'),
80
+							'desc'    => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
81 81
 							'id'      => 'paypal_verification',
82 82
 							'type'    => 'radio_inline',
83 83
 							'default' => 'enabled',
84 84
 							'options' => array(
85
-								'enabled'  => __( 'Enabled', 'give' ),
86
-								'disabled' => __( 'Disabled', 'give' ),
85
+								'enabled'  => __('Enabled', 'give'),
86
+								'disabled' => __('Disabled', 'give'),
87 87
 							)
88 88
 						),
89 89
                         array(
90
-                            'name'  => esc_html__( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
90
+                            'name'  => esc_html__('PayPal Standard Gateway Settings Docs Link', 'give'),
91 91
                             'id'    => 'paypal_standard_gateway_settings_docs_link',
92
-                            'url'   => esc_url( 'http://docs.givewp.com/paypalstandard' ),
93
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
92
+                            'url'   => esc_url('http://docs.givewp.com/paypalstandard'),
93
+                            'title' => __('PayPal Standard Gateway Settings', 'give'),
94 94
                             'type'  => 'give_docs_link',
95 95
                         ),
96 96
 						array(
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
 							'id'   => 'give_title_gateway_settings_3',
109 109
 						),
110 110
 						array(
111
-							'name'    => esc_html__( 'Collect Billing Details', 'give' ),
112
-							'desc'    => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
111
+							'name'    => esc_html__('Collect Billing Details', 'give'),
112
+							'desc'    => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
113 113
 							'id'      => 'give_offline_donation_enable_billing_fields',
114 114
 							'type'    => 'radio_inline',
115 115
 							'default' => 'disabled',
116 116
 							'options' => array(
117
-								'enabled'  => __( 'Enabled', 'give' ),
118
-								'disabled' => __( 'Disabled', 'give' )
117
+								'enabled'  => __('Enabled', 'give'),
118
+								'disabled' => __('Disabled', 'give')
119 119
 							)
120 120
 						),
121 121
 						array(
122
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
123
-							'desc'    => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
122
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
123
+							'desc'    => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
124 124
 							'id'      => 'global_offline_donation_content',
125 125
 							'default' => give_get_default_offline_donation_content(),
126 126
 							'type'    => 'wysiwyg',
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 							)
130 130
 						),
131 131
 						array(
132
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
133
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
132
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
133
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
134 134
 							'id'      => 'offline_donation_subject',
135
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
135
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
136 136
 							'type'    => 'text'
137 137
 						),
138 138
 						array(
139
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
140
-							'desc'    => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
139
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
140
+							'desc'    => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
141 141
 							'id'      => 'global_offline_donation_email',
142 142
 							'default' => give_get_default_offline_donation_email_content(),
143 143
 							'type'    => 'wysiwyg',
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 							)
147 147
 						),
148 148
                         array(
149
-                            'name'  => esc_html__( 'Offline Donations Settings Docs Link', 'give' ),
149
+                            'name'  => esc_html__('Offline Donations Settings Docs Link', 'give'),
150 150
                             'id'    => 'offline_gateway_settings_docs_link',
151
-                            'url'   => esc_url( 'http://docs.givewp.com/offlinegateway' ),
152
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
151
+                            'url'   => esc_url('http://docs.givewp.com/offlinegateway'),
152
+                            'title' => __('Offline Gateway Settings', 'give'),
153 153
                             'type'  => 'give_docs_link',
154 154
                         ),
155 155
 						array(
@@ -167,33 +167,33 @@  discard block
 block discarded – undo
167 167
 							'type' => 'title'
168 168
 						),
169 169
 						array(
170
-							'name'    => esc_html__( 'Test Mode', 'give' ),
171
-							'desc'    => esc_html__( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
170
+							'name'    => esc_html__('Test Mode', 'give'),
171
+							'desc'    => esc_html__('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
172 172
 							'id'      => 'test_mode',
173 173
 							'type'    => 'radio_inline',
174 174
 							'default' => 'disabled',
175 175
 							'options' => array(
176
-								'enabled'  => __( 'Enabled', 'give' ),
177
-								'disabled' => __( 'Disabled', 'give' ),
176
+								'enabled'  => __('Enabled', 'give'),
177
+								'disabled' => __('Disabled', 'give'),
178 178
 							)
179 179
 						),
180 180
 						array(
181
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
182
-							'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
181
+							'name' => esc_html__('Enabled Gateways', 'give'),
182
+							'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'),
183 183
 							'id'   => 'gateways',
184 184
 							'type' => 'enabled_gateways'
185 185
 						),
186 186
 						array(
187
-							'name' => esc_html__( 'Default Gateway', 'give' ),
188
-							'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ),
187
+							'name' => esc_html__('Default Gateway', 'give'),
188
+							'desc' => esc_html__('The gateway that will be selected by default.', 'give'),
189 189
 							'id'   => 'default_gateway',
190 190
 							'type' => 'default_gateway'
191 191
 						),
192 192
                         array(
193
-                            'name'  => esc_html__( 'Gateways Docs Link', 'give' ),
193
+                            'name'  => esc_html__('Gateways Docs Link', 'give'),
194 194
                             'id'    => 'gateway_settings_docs_link',
195
-                            'url'   => esc_url( 'http://docs.givewp.com/gatewayssettings' ),
196
-                            'title' => __( 'Gateway Settings', 'give' ),
195
+                            'url'   => esc_url('http://docs.givewp.com/gatewayssettings'),
196
+                            'title' => __('Gateway Settings', 'give'),
197 197
                             'type'  => 'give_docs_link',
198 198
                         ),
199 199
 						array(
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			 * Filter the payment gateways settings.
209 209
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
210 210
 			 */
211
-			$settings = apply_filters( 'give_settings_gateways', $settings );
211
+			$settings = apply_filters('give_settings_gateways', $settings);
212 212
 
213 213
 			/**
214 214
 			 * Filter the settings.
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 			 *
218 218
 			 * @param  array $settings
219 219
 			 */
220
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
220
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
221 221
 
222 222
 			// Output.
223 223
 			return $settings;
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 		 */
232 232
 		public function get_sections() {
233 233
 			$sections = array(
234
-				'gateways-settings' => esc_html__( 'Gateways', 'give' ),
235
-				'paypal-standard'   => esc_html__( 'Paypal Standard', 'give' ),
236
-				'offline-donations' => esc_html__( 'Offline', 'give' )
234
+				'gateways-settings' => esc_html__('Gateways', 'give'),
235
+				'paypal-standard'   => esc_html__('Paypal Standard', 'give'),
236
+				'offline-donations' => esc_html__('Offline', 'give')
237 237
 			);
238 238
 
239
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
239
+			return apply_filters('give_get_sections_'.$this->id, $sections);
240 240
 		}
241 241
 	}
242 242
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-display.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 								'disabled' => __( 'Disabled', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
92
-                            'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/displayoptions' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
92
+							'id'    => 'display_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/displayoptions' ),
94
+							'title' => __( 'Display Options Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_display_settings_1',
99 99
 							'type' => 'sectionend'
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 								'disabled' => __( 'Disabled', 'give' ),
171 171
 							)
172 172
 						),
173
-                        array(
174
-                            'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
175
-                            'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/posttypessettings' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
178
-                            'type'  => 'give_docs_link',
179
-                        ),
173
+						array(
174
+							'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
175
+							'id'    => 'post_types_settings_docs_link',
176
+							'url'   => esc_url( 'http://docs.givewp.com/posttypessettings' ),
177
+							'title' => __( 'Post Types Settings', 'give' ),
178
+							'type'  => 'give_docs_link',
179
+						),
180 180
 						array(
181 181
 							'id'   => 'give_title_display_settings_2',
182 182
 							'type' => 'sectionend'
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 								'disabled' => __( 'Disabled', 'give' ),
213 213
 							)
214 214
 						),
215
-                        array(
216
-                            'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
217
-                            'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/taxonomiessettings' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
220
-                            'type'  => 'give_docs_link',
221
-                        ),
215
+						array(
216
+							'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
217
+							'id'    => 'taxonomies_settings_docs_link',
218
+							'url'   => esc_url( 'http://docs.givewp.com/taxonomiessettings' ),
219
+							'title' => __( 'Taxonomies Settings', 'give' ),
220
+							'type'  => 'give_docs_link',
221
+						),
222 222
 						array(
223 223
 							'id'   => 'give_title_display_settings_3',
224 224
 							'type' => 'sectionend'
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261
-                        array(
262
-                            'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
263
-                            'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/termssettings' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
266
-                            'type'  => 'give_docs_link',
267
-                        ),
261
+						array(
262
+							'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
263
+							'id'    => 'terms_settings_docs_link',
264
+							'url'   => esc_url( 'http://docs.givewp.com/termssettings' ),
265
+							'title' => __( 'Terms and Conditions Settings', 'give' ),
266
+							'type'  => 'give_docs_link',
267
+						),
268 268
 						array(
269 269
 							'id'   => 'give_title_display_settings_4',
270 270
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Display' ) ) :
16
+if ( ! class_exists('Give_Settings_Display')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Display.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'display';
30
-			$this->label = esc_html__( 'Display Options', 'give' );
30
+			$this->label = esc_html__('Display Options', 'give');
31 31
 
32 32
 			$this->default_tab = 'display-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'display-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Display
@@ -53,45 +53,45 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => esc_html__( 'Default Give Styles', 'give' ),
57
-							'desc'    => esc_html__( 'Give includes default styles for donation forms and other frontend elements.', 'give' ),
56
+							'name'    => esc_html__('Default Give Styles', 'give'),
57
+							'desc'    => esc_html__('Give includes default styles for donation forms and other frontend elements.', 'give'),
58 58
 							'id'      => 'css',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'enabled',
61 61
 							'options' => array(
62
-								'enabled' => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled' => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67
-							'name' => esc_html__( 'Floating Labels', 'give' ),
67
+							'name' => esc_html__('Floating Labels', 'give'),
68 68
 							/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
69
-							'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> in set form labels within fields and can improve the donor experience. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
69
+							'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> in set form labels within fields and can improve the donor experience. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
70 70
 							'id'   => 'floatlabels',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled' => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled' => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79
-							'name'    => esc_html__( 'Welcome Screen', 'give' ),
79
+							'name'    => esc_html__('Welcome Screen', 'give'),
80 80
 							/* translators: %s: about page URL */
81
-							'desc'    => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that display each time Give is activated or updated.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
81
+							'desc'    => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that display each time Give is activated or updated.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('index.php?page=give-about'))),
82 82
 							'id'      => 'welcome',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'enabled',
85 85
 							'options' => array(
86
-								'enabled' => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled' => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							)
89 89
 						),
90 90
                         array(
91
-                            'name'  => esc_html__( 'Display Settings Docs Link', 'give' ),
91
+                            'name'  => esc_html__('Display Settings Docs Link', 'give'),
92 92
                             'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/displayoptions' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
93
+                            'url'   => esc_url('http://docs.givewp.com/displayoptions'),
94
+                            'title' => __('Display Options Settings', 'give'),
95 95
                             'type'  => 'give_docs_link',
96 96
                         ),
97 97
 						array(
@@ -108,73 +108,73 @@  discard block
 block discarded – undo
108 108
 							'type' => 'title'
109 109
 						),
110 110
 						array(
111
-							'name'    => esc_html__( 'Form Single Views', 'give' ),
112
-							'desc'    => esc_html__( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
111
+							'name'    => esc_html__('Form Single Views', 'give'),
112
+							'desc'    => esc_html__('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
113 113
 							'id'      => 'forms_singular',
114 114
 							'type'    => 'radio_inline',
115 115
 							'default' => 'enabled',
116 116
 							'options' => array(
117
-								'enabled' => __( 'Enabled', 'give' ),
118
-								'disabled' => __( 'Disabled', 'give' ),
117
+								'enabled' => __('Enabled', 'give'),
118
+								'disabled' => __('Disabled', 'give'),
119 119
 							)
120 120
 						),
121 121
 						array(
122
-							'name'    => esc_html__( 'Form Archives', 'give' ),
123
-							'desc'    => esc_html__( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
122
+							'name'    => esc_html__('Form Archives', 'give'),
123
+							'desc'    => esc_html__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
124 124
 							'id'      => 'forms_archives',
125 125
 							'type'    => 'radio_inline',
126 126
 							'default' => 'enabled',
127 127
 							'options' => array(
128
-								'enabled' => __( 'Enabled', 'give' ),
129
-								'disabled' => __( 'Disabled', 'give' ),
128
+								'enabled' => __('Enabled', 'give'),
129
+								'disabled' => __('Disabled', 'give'),
130 130
 							)
131 131
 						),
132 132
 						array(
133
-							'name'    => esc_html__( 'Form Excerpts', 'give' ),
134
-							'desc'    => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
133
+							'name'    => esc_html__('Form Excerpts', 'give'),
134
+							'desc'    => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
135 135
 							'id'      => 'forms_excerpt',
136 136
 							'type'    => 'radio_inline',
137 137
 							'default' => 'enabled',
138 138
 							'options' => array(
139
-								'enabled' => __( 'Enabled', 'give' ),
140
-								'disabled' => __( 'Disabled', 'give' ),
139
+								'enabled' => __('Enabled', 'give'),
140
+								'disabled' => __('Disabled', 'give'),
141 141
 							)
142 142
 						),
143 143
 						array(
144
-							'name'    => esc_html__( 'Form Featured Image', 'give' ),
145
-							'desc'    => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
144
+							'name'    => esc_html__('Form Featured Image', 'give'),
145
+							'desc'    => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
146 146
 							'id'      => 'form_featured_img',
147 147
 							'type'    => 'radio_inline',
148 148
 							'default' => 'enabled',
149 149
 							'options' => array(
150
-								'enabled' => __( 'Enabled', 'give' ),
151
-								'disabled' => __( 'Disabled', 'give' ),
150
+								'enabled' => __('Enabled', 'give'),
151
+								'disabled' => __('Disabled', 'give'),
152 152
 							)
153 153
 						),
154 154
 						array(
155
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
156
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give' ),
155
+							'name'    => esc_html__('Featured Image Size', 'give'),
156
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation form\'s featured image.', 'give'),
157 157
 							'id'      => 'featured_image_size',
158 158
 							'type'    => 'select',
159 159
 							'default' => 'large',
160 160
 							'options' => give_get_featured_image_sizes()
161 161
 						),
162 162
 						array(
163
-							'name'    => esc_html__( 'Single Form Sidebar', 'give' ),
164
-							'desc'    => esc_html__( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
163
+							'name'    => esc_html__('Single Form Sidebar', 'give'),
164
+							'desc'    => esc_html__('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
165 165
 							'id'      => 'form_sidebar',
166 166
 							'type'    => 'radio_inline',
167 167
 							'default' => 'enabled',
168 168
 							'options' => array(
169
-								'enabled' => __( 'Enabled', 'give' ),
170
-								'disabled' => __( 'Disabled', 'give' ),
169
+								'enabled' => __('Enabled', 'give'),
170
+								'disabled' => __('Disabled', 'give'),
171 171
 							)
172 172
 						),
173 173
                         array(
174
-                            'name'  => esc_html__( 'Post Types Docs Link', 'give' ),
174
+                            'name'  => esc_html__('Post Types Docs Link', 'give'),
175 175
                             'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/posttypessettings' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
176
+                            'url'   => esc_url('http://docs.givewp.com/posttypessettings'),
177
+                            'title' => __('Post Types Settings', 'give'),
178 178
                             'type'  => 'give_docs_link',
179 179
                         ),
180 180
 						array(
@@ -191,32 +191,32 @@  discard block
 block discarded – undo
191 191
 							'type' => 'title'
192 192
 						),
193 193
 						array(
194
-							'name' => esc_html__( 'Form Categories', 'give' ),
195
-							'desc' => esc_html__( 'Enable the "Category" taxonomy for all Give forms.', 'give' ),
194
+							'name' => esc_html__('Form Categories', 'give'),
195
+							'desc' => esc_html__('Enable the "Category" taxonomy for all Give forms.', 'give'),
196 196
 							'id'   => 'categories',
197 197
 							'type'    => 'radio_inline',
198 198
 							'default' => 'disabled',
199 199
 							'options' => array(
200
-								'enabled' => __( 'Enabled', 'give' ),
201
-								'disabled' => __( 'Disabled', 'give' ),
200
+								'enabled' => __('Enabled', 'give'),
201
+								'disabled' => __('Disabled', 'give'),
202 202
 							)
203 203
 						),
204 204
 						array(
205
-							'name' => esc_html__( 'Form Tags', 'give' ),
206
-							'desc' => esc_html__( 'Enable the "Tag" taxonomy for all Give forms.', 'give' ),
205
+							'name' => esc_html__('Form Tags', 'give'),
206
+							'desc' => esc_html__('Enable the "Tag" taxonomy for all Give forms.', 'give'),
207 207
 							'id'   => 'tags',
208 208
 							'type'    => 'radio_inline',
209 209
 							'default' => 'disabled',
210 210
 							'options' => array(
211
-								'enabled' => __( 'Enabled', 'give' ),
212
-								'disabled' => __( 'Disabled', 'give' ),
211
+								'enabled' => __('Enabled', 'give'),
212
+								'disabled' => __('Disabled', 'give'),
213 213
 							)
214 214
 						),
215 215
                         array(
216
-                            'name'  => esc_html__( 'Taxonomies Docs Link', 'give' ),
216
+                            'name'  => esc_html__('Taxonomies Docs Link', 'give'),
217 217
                             'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/taxonomiessettings' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
218
+                            'url'   => esc_url('http://docs.givewp.com/taxonomiessettings'),
219
+                            'title' => __('Taxonomies Settings', 'give'),
220 220
                             'type'  => 'give_docs_link',
221 221
                         ),
222 222
 						array(
@@ -233,36 +233,36 @@  discard block
 block discarded – undo
233 233
 							'type' => 'title'
234 234
 						),
235 235
 						array(
236
-							'name'    => esc_html__( 'Terms and Conditions', 'give' ),
237
-							'desc'    => esc_html__( 'Would you like donors to have to agree to your terms when making a donation? Note: You can toggle this option and customize the terms per form.', 'give' ),
236
+							'name'    => esc_html__('Terms and Conditions', 'give'),
237
+							'desc'    => esc_html__('Would you like donors to have to agree to your terms when making a donation? Note: You can toggle this option and customize the terms per form.', 'give'),
238 238
 							'id'      => 'terms',
239 239
 							'type'    => 'radio_inline',
240 240
 							'default' => 'disabled',
241 241
 							'options' => array(
242
-								'enabled' => __( 'Enabled', 'give' ),
243
-								'disabled' => __( 'Disabled', 'give' ),
242
+								'enabled' => __('Enabled', 'give'),
243
+								'disabled' => __('Disabled', 'give'),
244 244
 							)
245 245
 						),
246 246
 						array(
247
-							'name' => esc_html__( 'Agree to Terms Label', 'give' ),
248
-							'desc' => esc_html__( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder. Note: You can customize the label per form as needed.', 'give' ),
247
+							'name' => esc_html__('Agree to Terms Label', 'give'),
248
+							'desc' => esc_html__('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder. Note: You can customize the label per form as needed.', 'give'),
249 249
 							'id'   => 'agree_to_terms_label',
250 250
 							'attributes'  => array(
251
-								'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
251
+								'placeholder' => esc_attr__('Agree to Terms?', 'give'),
252 252
 							),
253 253
 							'type' => 'text'
254 254
 						),
255 255
 						array(
256
-							'name' => esc_html__( 'Agreement Text', 'give' ),
257
-							'desc' => esc_html__( 'This is the actual text which the user will have to agree to in order to make a donation. Note: You can customize the content per form as needed.', 'give' ),
256
+							'name' => esc_html__('Agreement Text', 'give'),
257
+							'desc' => esc_html__('This is the actual text which the user will have to agree to in order to make a donation. Note: You can customize the content per form as needed.', 'give'),
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261 261
                         array(
262
-                            'name'  => esc_html__( 'Terms and Conditions Docs Link', 'give' ),
262
+                            'name'  => esc_html__('Terms and Conditions Docs Link', 'give'),
263 263
                             'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/termssettings' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
264
+                            'url'   => esc_url('http://docs.givewp.com/termssettings'),
265
+                            'title' => __('Terms and Conditions Settings', 'give'),
266 266
                             'type'  => 'give_docs_link',
267 267
                         ),
268 268
 						array(
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			 * Filter the display options settings.
278 278
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
279 279
 			 */
280
-			$settings = apply_filters( 'give_settings_display', $settings );
280
+			$settings = apply_filters('give_settings_display', $settings);
281 281
 
282 282
 			/**
283 283
 			 * Filter the settings.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			 * @since  1.8
286 286
 			 * @param  array $settings
287 287
 			 */
288
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
288
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
289 289
 
290 290
 			// Output.
291 291
 			return $settings;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		 */
300 300
 		public function get_sections() {
301 301
 			$sections = array(
302
-				'display-settings'    => esc_html__( 'Display', 'give' ),
303
-				'post-types'          => esc_html__( 'Post Types', 'give' ),
304
-				'taxonomies'          => esc_html__( 'Taxonomies', 'give' ),
305
-				'term-and-conditions' => esc_html__( 'Terms and Conditions', 'give' )
302
+				'display-settings'    => esc_html__('Display', 'give'),
303
+				'post-types'          => esc_html__('Post Types', 'give'),
304
+				'taxonomies'          => esc_html__('Taxonomies', 'give'),
305
+				'term-and-conditions' => esc_html__('Terms and Conditions', 'give')
306 306
 			);
307 307
 
308
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
308
+			return apply_filters('give_get_sections_'.$this->id, $sections);
309 309
 		}
310 310
 	}
311 311
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-advanced.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@
 block discarded – undo
87 87
 								'disabled' => __( 'Disabled', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
92
-                            'id'    => 'advanced_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/advancedsettings' ),
94
-                            'title' => __( 'Advanced Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
92
+							'id'    => 'advanced_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/advancedsettings' ),
94
+							'title' => __( 'Advanced Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_data_control_2',
99 99
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Advanced' ) ) :
16
+if ( ! class_exists('Give_Settings_Advanced')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Advanced.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'advanced';
30
-			$this->label = esc_html__( 'Advanced', 'give' );
30
+			$this->label = esc_html__('Advanced', 'give');
31 31
 
32 32
 			$this->default_tab = 'advanced-options';
33 33
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 			$current_section = give_get_current_setting_section();
47 47
 
48
-			switch ( $current_section ) {
48
+			switch ($current_section) {
49 49
 				case 'advanced-options':
50 50
 					$settings = array(
51 51
 						array(
@@ -53,45 +53,45 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => esc_html__( 'Remove Data on Uninstall', 'give' ),
57
-							'desc'    => esc_html__( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
56
+							'name'    => esc_html__('Remove Data on Uninstall', 'give'),
57
+							'desc'    => esc_html__('When the plugin is deleted, completely remove all Give data.', 'give'),
58 58
 							'id'      => 'uninstall_on_delete',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'disabled',
61 61
 							'options' => array(
62
-								'enabled'  => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled'  => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67 67
 							/* translators: %s: the_content */
68
-							'name'    => sprintf( __( '%s filter', 'give' ), '<code>the_content</code>' ),
68
+							'name'    => sprintf(__('%s filter', 'give'), '<code>the_content</code>'),
69 69
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
70
-							'desc'    => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
70
+							'desc'    => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
71 71
 							'id'      => 'the_content_filter',
72 72
 							'default' => 'enabled',
73 73
 							'type'    => 'radio_inline',
74 74
 							'options' => array(
75
-								'enabled'  => __( 'Enabled', 'give' ),
76
-								'disabled' => __( 'Disabled', 'give' ),
75
+								'enabled'  => __('Enabled', 'give'),
76
+								'disabled' => __('Disabled', 'give'),
77 77
 							)
78 78
 						),
79 79
 						array(
80
-							'name'    => esc_html__( 'Load Scripts in Footer?', 'give' ),
81
-							'desc'    => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
80
+							'name'    => esc_html__('Load Scripts in Footer?', 'give'),
81
+							'desc'    => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
82 82
 							'id'      => 'scripts_footer',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'disabled',
85 85
 							'options' => array(
86
-								'enabled'  => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled'  => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							)
89 89
 						),
90 90
                         array(
91
-                            'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
91
+                            'name'  => esc_html__('Advanced Settings Docs Link', 'give'),
92 92
                             'id'    => 'advanced_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/advancedsettings' ),
94
-                            'title' => __( 'Advanced Settings', 'give' ),
93
+                            'url'   => esc_url('http://docs.givewp.com/advancedsettings'),
94
+                            'title' => __('Advanced Settings', 'give'),
95 95
                             'type'  => 'give_docs_link',
96 96
                         ),
97 97
 						array(
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			 * Filter the advanced settings.
108 108
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
109 109
 			 */
110
-			$settings = apply_filters( 'give_settings_advanced', $settings );
110
+			$settings = apply_filters('give_settings_advanced', $settings);
111 111
 
112 112
 			/**
113 113
 			 * Filter the settings.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 			 *
117 117
 			 * @param  array $settings
118 118
 			 */
119
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
119
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
120 120
 
121 121
 			// Output.
122 122
 			return $settings;
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 		 */
131 131
 		public function get_sections() {
132 132
 			$sections = array(
133
-				'advanced-options' => esc_html__( 'Advanced Options', 'give' )
133
+				'advanced-options' => esc_html__('Advanced Options', 'give')
134 134
 			);
135 135
 
136
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
136
+			return apply_filters('give_get_sections_'.$this->id, $sections);
137 137
 		}
138 138
 	}
139 139
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-license.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_License' ) ) :
16
+if ( ! class_exists('Give_Settings_License')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_License.
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'licenses';
46
-			$this->label = esc_html__( 'Licenses', 'give' );
46
+			$this->label = esc_html__('Licenses', 'give');
47 47
 
48
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-settings_settings_{$this->id}_page", array($this, 'output'));
50 50
 		}
51 51
 
52 52
 		/**
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 		 * @param  array $pages Lst of pages.
57 57
 		 * @return array
58 58
 		 */
59
-		public function add_settings_page( $pages ) {
59
+		public function add_settings_page($pages) {
60 60
 			$setting = $this->get_settings();
61 61
 			// Bailout: Do not add licenses setting tab if it does not contain any setting fields.
62
-			if( ! empty( $setting ) ) {
63
-				$pages[ $this->id ] = $this->label;
62
+			if ( ! empty($setting)) {
63
+				$pages[$this->id] = $this->label;
64 64
 			}
65 65
 
66 66
 			return $pages;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			 * Filter the licenses settings.
80 80
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
81 81
 			 */
82
-			$settings = apply_filters( 'give_settings_licenses', $settings );
82
+			$settings = apply_filters('give_settings_licenses', $settings);
83 83
 
84 84
 			/**
85 85
 			 * Filter the settings.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			 * @since  1.8
88 88
 			 * @param  array $settings
89 89
 			 */
90
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
90
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
91 91
 
92 92
 			// Output.
93 93
 			return $settings;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		public function output() {
103 103
 			$settings = $this->get_settings();
104 104
 
105
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
105
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
106 106
 		}
107 107
 	}
108 108
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-addon.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Addon' ) ) :
16
+if ( ! class_exists('Give_Settings_Addon')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Addon.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'addons';
29
-			$this->label = esc_html__( 'Add-ons', 'give' );
29
+			$this->label = esc_html__('Add-ons', 'give');
30 30
 
31 31
 			parent::__construct();
32 32
 		}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		 * @param  $setting_tab
39 39
 		 * @return string
40 40
 		 */
41
-		function set_default_setting_tab( $setting_tab ) {
41
+		function set_default_setting_tab($setting_tab) {
42 42
 			$default_tab = '';
43 43
 
44 44
 			// Set default tab to first setting tab.
45
-			if( $sections = array_keys( $this->get_sections() ) ) {
46
-				$default_tab = current( $sections );
45
+			if ($sections = array_keys($this->get_sections())) {
46
+				$default_tab = current($sections);
47 47
 			}
48 48
 			return $default_tab;
49 49
 		}
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 		 * @param  array $pages Lst of pages.
56 56
 		 * @return array
57 57
 		 */
58
-		public function add_settings_page( $pages ) {
58
+		public function add_settings_page($pages) {
59 59
 			$setting = $this->get_settings();
60 60
 			// Bailout: Do not add addons setting tab if it does not contain any setting fields.
61
-			if( ! empty( $setting ) ) {
62
-				$pages[ $this->id ] = $this->label;
61
+			if ( ! empty($setting)) {
62
+				$pages[$this->id] = $this->label;
63 63
 			}
64 64
 
65 65
 			return $pages;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			 * Filter the addons settings.
79 79
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
80 80
 			 */
81
-			$settings = apply_filters( 'give_settings_addons', $settings );
81
+			$settings = apply_filters('give_settings_addons', $settings);
82 82
 
83 83
 			/**
84 84
 			 * Filter the settings.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @since  1.8
87 87
 			 * @param  array $settings
88 88
 			 */
89
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
89
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
90 90
 
91 91
 			// Output.
92 92
 			return $settings;
Please login to merge, or discard this patch.