Completed
Pull Request — master (#1574)
by
unknown
19:09
created
includes/admin/payments/view-order-details.php 1 patch
Spacing   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
  * @since 1.0
21 21
  * @return void
22 22
  */
23
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
24
-	wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
23
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
24
+	wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
25 25
 }
26 26
 
27 27
 // Setup the variables
28
-$payment_id = absint( $_GET['id'] );
29
-$payment    = new Give_Payment( $payment_id );
28
+$payment_id = absint($_GET['id']);
29
+$payment    = new Give_Payment($payment_id);
30 30
 
31 31
 // Sanity check... fail if donation ID is invalid
32 32
 $payment_exists = $payment->ID;
33
-if ( empty( $payment_exists ) ) {
34
-	wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
33
+if (empty($payment_exists)) {
34
+	wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
35 35
 }
36 36
 
37 37
 $number         = $payment->number;
38 38
 $payment_meta   = $payment->get_meta();
39
-$transaction_id = esc_attr( $payment->transaction_id );
39
+$transaction_id = esc_attr($payment->transaction_id);
40 40
 $user_id        = $payment->user_id;
41 41
 $customer_id    = $payment->customer_id;
42
-$payment_date   = strtotime( $payment->date );
43
-$user_info      = give_get_payment_meta_user_info( $payment_id );
42
+$payment_date   = strtotime($payment->date);
43
+$user_info      = give_get_payment_meta_user_info($payment_id);
44 44
 $address        = $payment->address;
45 45
 $gateway        = $payment->gateway;
46 46
 $currency_code  = $payment->currency;
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	<h1 id="transaction-details-heading"><?php
54 54
 		printf(
55 55
 			/* translators: %s: donation number */
56
-			esc_html__( 'Donation %s', 'give' ),
56
+			esc_html__('Donation %s', 'give'),
57 57
 			$number
58 58
 		);
59
-		if ( $payment_mode == 'test' ) {
60
-			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>';
59
+		if ($payment_mode == 'test') {
60
+			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>';
61 61
 		}
62 62
 		?></h1>
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @param int $payment_id Payment id.
71 71
 	 */
72
-	do_action( 'give_view_order_details_before', $payment_id );
72
+	do_action('give_view_order_details_before', $payment_id);
73 73
 	?>
74 74
 	<form id="give-edit-order-form" method="post">
75 75
 		<?php
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @param int $payment_id Payment id.
82 82
 		 */
83
-		do_action( 'give_view_order_details_form_top', $payment_id );
83
+		do_action('give_view_order_details_form_top', $payment_id);
84 84
 		?>
85 85
 		<div id="poststuff">
86 86
 			<div id="give-dashboard-widgets-wrap">
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
 							 *
97 97
 							 * @param int $payment_id Payment id.
98 98
 							 */
99
-							do_action( 'give_view_order_details_sidebar_before', $payment_id );
99
+							do_action('give_view_order_details_sidebar_before', $payment_id);
100 100
 							?>
101 101
 
102 102
 							<div id="give-order-update" class="postbox give-order-data">
103 103
 
104
-								<h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3>
104
+								<h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3>
105 105
 
106 106
 								<div class="inside">
107 107
 									<div class="give-admin-box">
@@ -114,33 +114,33 @@  discard block
 block discarded – undo
114 114
 										 *
115 115
 										 * @param int $payment_id Payment id.
116 116
 										 */
117
-										do_action( 'give_view_order_details_totals_before', $payment_id );
117
+										do_action('give_view_order_details_totals_before', $payment_id);
118 118
 										?>
119 119
 
120 120
 										<div class="give-admin-box-inside">
121 121
 											<p>
122
-												<label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label>&nbsp;
122
+												<label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label>&nbsp;
123 123
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
124
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
125
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
124
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
125
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
126 126
 													<?php endforeach; ?>
127 127
 												</select>
128
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
128
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
129 129
 											</p>
130 130
 										</div>
131 131
 
132 132
 										<div class="give-admin-box-inside">
133 133
 											<p>
134
-												<label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label>&nbsp;
135
-												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
134
+												<label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label>&nbsp;
135
+												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
136 136
 											</p>
137 137
 										</div>
138 138
 
139 139
 										<div class="give-admin-box-inside">
140 140
 											<p>
141
-												<label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label>&nbsp;
142
-												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
143
-												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
141
+												<label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label>&nbsp;
142
+												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
143
+												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
144 144
 											</p>
145 145
 										</div>
146 146
 
@@ -154,18 +154,18 @@  discard block
 block discarded – undo
154 154
 										 *
155 155
 										 * @param int $payment_id Payment id.
156 156
 										 */
157
-										do_action( 'give_view_order_details_update_inner', $payment_id );
157
+										do_action('give_view_order_details_update_inner', $payment_id);
158 158
 
159 159
 										// @TODO: Fees
160
-										$fees = give_get_payment_fees( $payment_id );
161
-										if ( ! empty( $fees ) ) : ?>
160
+										$fees = give_get_payment_fees($payment_id);
161
+										if ( ! empty($fees)) : ?>
162 162
 											<div class="give-order-fees give-admin-box-inside">
163
-												<p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p>
163
+												<p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p>
164 164
 												<ul class="give-payment-fees">
165
-													<?php foreach ( $fees as $fee ) : ?>
165
+													<?php foreach ($fees as $fee) : ?>
166 166
 														<li>
167 167
 															<span class="fee-label"><?php echo $fee['label']; ?>:</span>
168
-															<span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span>
168
+															<span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span>
169 169
 														</li>
170 170
 													<?php endforeach; ?>
171 171
 												</ul>
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
 										<div class="give-order-payment give-admin-box-inside">
176 176
 											<p>
177
-												<label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label>&nbsp;
178
-												<?php echo give_currency_symbol( $payment->currency ); ?>
179
-												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/>
177
+												<label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label>&nbsp;
178
+												<?php echo give_currency_symbol($payment->currency); ?>
179
+												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/>
180 180
 											</p>
181 181
 										</div>
182 182
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 										 *
189 189
 										 * @param int $payment_id Payment id.
190 190
 										 */
191
-										do_action( 'give_view_order_details_totals_after', $payment_id );
191
+										do_action('give_view_order_details_totals_after', $payment_id);
192 192
 										?>
193 193
 
194 194
 									</div>
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
 									 *
207 207
 									 * @param int $payment_id Payment id.
208 208
 									 */
209
-									do_action( 'give_view_order_details_update_before', $payment_id );
209
+									do_action('give_view_order_details_update_before', $payment_id);
210 210
 									?>
211 211
 
212 212
 									<div id="major-publishing-actions">
213 213
 										<div id="publishing-action">
214
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/>
215
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
216
-												<a href="<?php echo esc_url( add_query_arg( array(
214
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/>
215
+											<?php if (give_is_payment_complete($payment_id)) : ?>
216
+												<a href="<?php echo esc_url(add_query_arg(array(
217 217
 													'give-action' => 'email_links',
218 218
 													'purchase_id' => $payment_id,
219
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
219
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
220 220
 											<?php endif; ?>
221 221
 										</div>
222 222
 										<div class="clear"></div>
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 									 *
231 231
 									 * @param int $payment_id Payment id.
232 232
 									 */
233
-									do_action( 'give_view_order_details_update_after', $payment_id );
233
+									do_action('give_view_order_details_update_after', $payment_id);
234 234
 									?>
235 235
 
236 236
 								</div>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 							<div id="give-order-details" class="postbox give-order-data">
243 243
 
244
-								<h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3>
244
+								<h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3>
245 245
 
246 246
 								<div class="inside">
247 247
 									<div class="give-admin-box">
@@ -254,44 +254,44 @@  discard block
 block discarded – undo
254 254
 										 *
255 255
 										 * @param int $payment_id Payment id.
256 256
 										 */
257
-										do_action( 'give_view_order_details_payment_meta_before', $payment_id );
257
+										do_action('give_view_order_details_payment_meta_before', $payment_id);
258 258
 
259
-										$gateway = give_get_payment_gateway( $payment_id );
260
-										if ( $gateway ) : ?>
259
+										$gateway = give_get_payment_gateway($payment_id);
260
+										if ($gateway) : ?>
261 261
 											<div class="give-order-gateway give-admin-box-inside">
262 262
 												<p>
263
-													<strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong>&nbsp;
264
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
263
+													<strong><?php esc_html_e('Gateway:', 'give'); ?></strong>&nbsp;
264
+													<?php echo give_get_gateway_admin_label($gateway); ?>
265 265
 												</p>
266 266
 											</div>
267 267
 										<?php endif; ?>
268 268
 
269 269
 										<div class="give-order-payment-key give-admin-box-inside">
270 270
 											<p>
271
-												<strong><?php esc_html_e( 'Key:', 'give' ); ?></strong>&nbsp;
272
-												<?php echo give_get_payment_key( $payment_id ); ?>
271
+												<strong><?php esc_html_e('Key:', 'give'); ?></strong>&nbsp;
272
+												<?php echo give_get_payment_key($payment_id); ?>
273 273
 											</p>
274 274
 										</div>
275 275
 
276 276
 										<div class="give-order-ip give-admin-box-inside">
277 277
 											<p>
278
-												<strong><?php esc_html_e( 'IP:', 'give' ); ?></strong>&nbsp;
279
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
278
+												<strong><?php esc_html_e('IP:', 'give'); ?></strong>&nbsp;
279
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
280 280
 											</p>
281 281
 										</div>
282 282
 
283
-										<?php if ( $transaction_id ) : ?>
283
+										<?php if ($transaction_id) : ?>
284 284
 											<div class="give-order-tx-id give-admin-box-inside">
285 285
 												<p>
286
-													<strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong>&nbsp;
287
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
286
+													<strong><?php esc_html_e('Donation ID:', 'give'); ?></strong>&nbsp;
287
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
288 288
 												</p>
289 289
 											</div>
290 290
 										<?php endif; ?>
291 291
 
292 292
 										<div class="give-admin-box-inside">
293
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?>
294
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
293
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?>
294
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor &raquo;', 'give'); ?></a>
295 295
 											</p>
296 296
 										</div>
297 297
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 										 *
304 304
 										 * @param int $payment_id Payment id.
305 305
 										 */
306
-										do_action( 'give_view_order_details_payment_meta_after', $payment_id );
306
+										do_action('give_view_order_details_payment_meta_after', $payment_id);
307 307
 										?>
308 308
 
309 309
 									</div>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 							 *
324 324
 							 * @param int $payment_id Payment id.
325 325
 							 */
326
-							do_action( 'give_view_order_details_sidebar_after', $payment_id );
326
+							do_action('give_view_order_details_sidebar_after', $payment_id);
327 327
 							?>
328 328
 
329 329
 						</div>
@@ -343,55 +343,55 @@  discard block
 block discarded – undo
343 343
 							 *
344 344
 							 * @param int $payment_id Payment id.
345 345
 							 */
346
-							do_action( 'give_view_order_details_main_before', $payment_id );
346
+							do_action('give_view_order_details_main_before', $payment_id);
347 347
 							?>
348 348
 
349 349
 							<?php $column_count = 'columns-3'; ?>
350 350
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
351
-								<h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3>
351
+								<h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3>
352 352
 
353 353
 								<div class="inside">
354 354
 
355 355
 									<div class="column-container">
356 356
 										<div class="column">
357 357
 											<p>
358
-												<strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br>
358
+												<strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br>
359 359
 												<?php
360
-												if ( $payment_meta['form_id'] ) :
360
+												if ($payment_meta['form_id']) :
361 361
 													printf(
362 362
 														'<a href="%1$s" target="_blank">#%2$s</a>',
363
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
363
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
364 364
 														$payment_meta['form_id']
365 365
 													);
366 366
 												endif;
367 367
 												?>
368 368
 											</p>
369 369
 											<p>
370
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
371
-												<?php give_get_form_dropdown( array(
370
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
371
+												<?php give_get_form_dropdown(array(
372 372
 													'id'       => $payment_meta['form_id'],
373 373
 													'selected' => $payment_meta['form_id'],
374 374
 													'chosen'   => true,
375
-												), true ); ?>
375
+												), true); ?>
376 376
 											</p>
377 377
 										</div>
378 378
 										<div class="column">
379 379
 											<p>
380
-												<strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br>
381
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
380
+												<strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br>
381
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
382 382
 											</p>
383 383
 											<p>
384
-												<strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br>
384
+												<strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br>
385 385
 												<span class="give-donation-level">
386 386
 													<?php
387
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
388
-													if ( empty( $var_prices ) ) {
389
-														esc_html_e( 'n/a', 'give' );
387
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
388
+													if (empty($var_prices)) {
389
+														esc_html_e('n/a', 'give');
390 390
 													} else {
391 391
 														$prices_atts = '';
392
-														if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
393
-															foreach ( $variable_prices as $variable_price ) {
394
-																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] );
392
+														if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) {
393
+															foreach ($variable_prices as $variable_price) {
394
+																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']);
395 395
 															}
396 396
 														}
397 397
 														// Variable price dropdown options.
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 															'chosen'           => true,
402 402
 															'show_option_all'  => '',
403 403
 															'show_option_none' => '',
404
-															'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
404
+															'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
405 405
 															'selected'         => $payment_meta['price_id'],
406 406
 														);
407 407
 														// Render variable prices select tag html.
408
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
408
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
409 409
 													}
410 410
 													?>
411 411
 												</span>
@@ -413,8 +413,8 @@  discard block
 block discarded – undo
413 413
 										</div>
414 414
 										<div class="column">
415 415
 											<p>
416
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
417
-												<?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?>
416
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
417
+												<?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?>
418 418
 											</p>
419 419
 											<p>
420 420
 												<?php
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 												 *
428 428
 												 * @param int $payment_id Payment id.
429 429
 												 */
430
-												do_action( 'give_donation_details_thead_before', $payment_id );
430
+												do_action('give_donation_details_thead_before', $payment_id);
431 431
 
432 432
 
433 433
 												/**
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 												 *
440 440
 												 * @param int $payment_id Payment id.
441 441
 												 */
442
-												do_action( 'give_donation_details_thead_after', $payment_id );
442
+												do_action('give_donation_details_thead_after', $payment_id);
443 443
 
444 444
 												/**
445 445
 												 * Fires in order details page, in the donation-information metabox, before the body elements.
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 												 *
451 451
 												 * @param int $payment_id Payment id.
452 452
 												 */
453
-												do_action( 'give_donation_details_tbody_before', $payment_id );
453
+												do_action('give_donation_details_tbody_before', $payment_id);
454 454
 
455 455
 												/**
456 456
 												 * Fires in order details page, in the donation-information metabox, after the body elements.
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 												 *
462 462
 												 * @param int $payment_id Payment id.
463 463
 												 */
464
-												do_action( 'give_donation_details_tbody_after', $payment_id );
464
+												do_action('give_donation_details_tbody_after', $payment_id);
465 465
 												?>
466 466
 											</p>
467 467
 										</div>
@@ -481,57 +481,57 @@  discard block
 block discarded – undo
481 481
 							 *
482 482
 							 * @param int $payment_id Payment id.
483 483
 							 */
484
-							do_action( 'give_view_order_details_files_after', $payment_id );
484
+							do_action('give_view_order_details_files_after', $payment_id);
485 485
 							?>
486 486
 
487 487
 							<div id="give-donor-details" class="postbox">
488
-								<h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3>
488
+								<h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3>
489 489
 
490 490
 								<div class="inside">
491 491
 
492
-									<?php $customer = new Give_Customer( $customer_id ); ?>
492
+									<?php $customer = new Give_Customer($customer_id); ?>
493 493
 
494 494
 									<div class="column-container customer-info">
495 495
 										<div class="column">
496 496
 											<p>
497
-												<strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br>
497
+												<strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br>
498 498
 												<?php
499
-												if ( ! empty( $customer->id ) ) {
499
+												if ( ! empty($customer->id)) {
500 500
 													printf(
501 501
 														'<a href="%1$s" target="_blank">#%2$s</a>',
502
-														admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ),
502
+														admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id),
503 503
 														$customer->id
504 504
 													);
505 505
 												}
506 506
 												?>
507 507
 											</p>
508 508
 											<p>
509
-												<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
510
-												<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
509
+												<strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br>
510
+												<?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?>
511 511
 											</p>
512 512
 										</div>
513 513
 										<div class="column">
514 514
 											<p>
515
-												<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br>
515
+												<strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br>
516 516
 												<?php echo $customer->name; ?>
517 517
 											</p>
518 518
 											<p>
519
-												<strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br>
519
+												<strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br>
520 520
 												<?php echo $customer->email; ?>
521 521
 											</p>
522 522
 										</div>
523 523
 										<div class="column">
524 524
 											<p>
525
-												<strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br>
525
+												<strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br>
526 526
 												<?php
527
-												echo Give()->html->donor_dropdown( array(
527
+												echo Give()->html->donor_dropdown(array(
528 528
 													'selected' => $customer->id,
529 529
 													'name'     => 'customer-id',
530
-												) );
530
+												));
531 531
 												?>
532 532
 											</p>
533 533
 											<p>
534
-												<a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a>
534
+												<a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a>
535 535
 											</p>
536 536
 										</div>
537 537
 									</div>
@@ -539,13 +539,13 @@  discard block
 block discarded – undo
539 539
 									<div class="column-container new-customer" style="display: none">
540 540
 										<div class="column">
541 541
 											<p>
542
-												<label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label>
542
+												<label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label>
543 543
 												<input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>
544 544
 											</p>
545 545
 										</div>
546 546
 										<div class="column">
547 547
 											<p>
548
-												<label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label>
548
+												<label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label>
549 549
 												<input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>
550 550
 											</p>
551 551
 										</div>
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
 											<p>
554 554
 												<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
555 555
 												<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
556
-												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
556
+												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
557 557
 												<br>
558
-												<em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
558
+												<em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em>
559 559
 											</p>
560 560
 										</div>
561 561
 									</div>
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 									 * @param array $payment_meta Payment meta.
572 572
 									 * @param array $user_info    User information.
573 573
 									 */
574
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
574
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
575 575
 
576 576
 									/**
577 577
 									 * Fires in order details page, in the donor-details metabox.
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 									 *
581 581
 									 * @param int $payment_id Payment id.
582 582
 									 */
583
-									do_action( 'give_payment_view_details', $payment_id );
583
+									do_action('give_payment_view_details', $payment_id);
584 584
 									?>
585 585
 
586 586
 								</div>
@@ -596,11 +596,11 @@  discard block
 block discarded – undo
596 596
 							 *
597 597
 							 * @param int $payment_id Payment id.
598 598
 							 */
599
-							do_action( 'give_view_order_details_billing_before', $payment_id );
599
+							do_action('give_view_order_details_billing_before', $payment_id);
600 600
 							?>
601 601
 
602 602
 							<div id="give-billing-details" class="postbox">
603
-								<h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3>
603
+								<h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3>
604 604
 
605 605
 								<div class="inside">
606 606
 
@@ -610,57 +610,57 @@  discard block
 block discarded – undo
610 610
 											<div class="data column-container">
611 611
 												<div class="column">
612 612
 													<div class="give-wrap-address-line1">
613
-														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label>
614
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
613
+														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label>
614
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
615 615
 													</div>
616 616
 													<div class="give-wrap-address-line2">
617
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label>
618
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
617
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label>
618
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
619 619
 													</div>
620 620
 												</div>
621 621
 												<div class="column">
622 622
 													<div class="give-wrap-address-city">
623
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
624
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
623
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
624
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
625 625
 													</div>
626 626
 													<div class="give-wrap-address-zip">
627
-														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>
628
-														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
627
+														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label>
628
+														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
629 629
 
630 630
 													</div>
631 631
 												</div>
632 632
 												<div class="column">
633 633
 													<div id="give-order-address-country-wrap">
634
-														<label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>
634
+														<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label>
635 635
 														<?php
636
-														echo Give()->html->select( array(
636
+														echo Give()->html->select(array(
637 637
 															'options'          => give_get_country_list(),
638 638
 															'name'             => 'give-payment-address[0][country]',
639 639
 															'selected'         => $address['country'],
640 640
 															'show_option_all'  => false,
641 641
 															'show_option_none' => false,
642 642
 															'chosen'           => true,
643
-															'placeholder'      => esc_attr__( 'Select a country', 'give' ),
644
-														) );
643
+															'placeholder'      => esc_attr__('Select a country', 'give'),
644
+														));
645 645
 														?>
646 646
 													</div>
647 647
 													<div id="give-order-address-state-wrap">
648
-														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>
648
+														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label>
649 649
 														<?php
650
-														$states = give_get_states( $address['country'] );
651
-														if ( ! empty( $states ) ) {
652
-															echo Give()->html->select( array(
650
+														$states = give_get_states($address['country']);
651
+														if ( ! empty($states)) {
652
+															echo Give()->html->select(array(
653 653
 																'options'          => $states,
654 654
 																'name'             => 'give-payment-address[0][state]',
655 655
 																'selected'         => $address['state'],
656 656
 																'show_option_all'  => false,
657 657
 																'show_option_none' => false,
658 658
 																'chosen'           => true,
659
-																'placeholder'      => esc_attr__( 'Select a state', 'give' ),
660
-															) );
659
+																'placeholder'      => esc_attr__('Select a state', 'give'),
660
+															));
661 661
 														} else {
662 662
 															?>
663
-															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
663
+															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
664 664
 															<?php
665 665
 														} ?>
666 666
 													</div>
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 									 *
681 681
 									 * @param int $payment_id Payment id.
682 682
 									 */
683
-									do_action( 'give_payment_billing_details', $payment_id );
683
+									do_action('give_payment_billing_details', $payment_id);
684 684
 									?>
685 685
 
686 686
 								</div>
@@ -696,32 +696,32 @@  discard block
 block discarded – undo
696 696
 							 *
697 697
 							 * @param int $payment_id Payment id.
698 698
 							 */
699
-							do_action( 'give_view_order_details_billing_after', $payment_id );
699
+							do_action('give_view_order_details_billing_after', $payment_id);
700 700
 							?>
701 701
 
702 702
 							<div id="give-payment-notes" class="postbox">
703
-								<h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3>
703
+								<h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3>
704 704
 
705 705
 								<div class="inside">
706 706
 									<div id="give-payment-notes-inner">
707 707
 										<?php
708
-										$notes = give_get_payment_notes( $payment_id );
709
-										if ( ! empty( $notes ) ) {
708
+										$notes = give_get_payment_notes($payment_id);
709
+										if ( ! empty($notes)) {
710 710
 											$no_notes_display = ' style="display:none;"';
711
-											foreach ( $notes as $note ) :
711
+											foreach ($notes as $note) :
712 712
 
713
-												echo give_get_payment_note_html( $note, $payment_id );
713
+												echo give_get_payment_note_html($note, $payment_id);
714 714
 
715 715
 											endforeach;
716 716
 										} else {
717 717
 											$no_notes_display = '';
718 718
 										}
719
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?>
719
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?>
720 720
 									</div>
721 721
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
722 722
 
723 723
 									<div class="give-clearfix">
724
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>
724
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button>
725 725
 									</div>
726 726
 
727 727
 								</div>
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 							 *
738 738
 							 * @param int $payment_id Payment id.
739 739
 							 */
740
-							do_action( 'give_view_order_details_main_after', $payment_id );
740
+							do_action('give_view_order_details_main_after', $payment_id);
741 741
 							?>
742 742
 
743 743
 						</div>
@@ -759,11 +759,11 @@  discard block
 block discarded – undo
759 759
 		 *
760 760
 		 * @param int $payment_id Payment id.
761 761
 		 */
762
-		do_action( 'give_view_order_details_form_bottom', $payment_id );
762
+		do_action('give_view_order_details_form_bottom', $payment_id);
763 763
 
764
-		wp_nonce_field( 'give_update_payment_details_nonce' );
764
+		wp_nonce_field('give_update_payment_details_nonce');
765 765
 		?>
766
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
766
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
767 767
 		<input type="hidden" name="give_action" value="update_payment_details"/>
768 768
 	</form>
769 769
 	<?php
@@ -774,6 +774,6 @@  discard block
 block discarded – undo
774 774
 	 *
775 775
 	 * @param int $payment_id Payment id.
776 776
 	 */
777
-	do_action( 'give_view_order_details_after', $payment_id );
777
+	do_action('give_view_order_details_after', $payment_id);
778 778
 	?>
779 779
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 *                               'testing'           => false, // (required) Never leave as "true" in production!!!
33 33
 	 *                               }
34 34
 	 */
35
-	function __construct( $_banner_details ) {
35
+	function __construct($_banner_details) {
36 36
 		$current_user = wp_get_current_user();
37 37
 
38 38
 		$this->plugin_activate_by   = 0;
39 39
 		$this->banner_details       = $_banner_details;
40
-		$this->test_mode            = ( $this->banner_details['testing'] == 'true' ) ? true : false;
41
-		$this->nag_meta_key         = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
42
-		$this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user';
40
+		$this->test_mode            = ($this->banner_details['testing'] == 'true') ? true : false;
41
+		$this->nag_meta_key         = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
42
+		$this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user';
43 43
 
44 44
 		//Get current user
45 45
 		$this->user_id = $current_user->ID;
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 	public function init() {
63 63
 
64 64
 		//Testing?
65
-		if ( $this->test_mode ) {
66
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
65
+		if ($this->test_mode) {
66
+			delete_user_meta($this->user_id, $this->nag_meta_key);
67 67
 		}
68 68
 
69 69
 		//Get the current page to add the notice to
70
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
71
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
70
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
71
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
72 72
 
73 73
 		// File path of addon must be included in banner detail other addon activate meta will not delete.
74
-		add_action( 'deactivate_' . $this->get_plugin_file_name(), array( $this, 'remove_addon_activate_meta' ) );
74
+		add_action('deactivate_'.$this->get_plugin_file_name(), array($this, 'remove_addon_activate_meta'));
75 75
 	}
76 76
 
77 77
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function is_plugin_page() {
86 86
 		$screen = get_current_screen();
87 87
 
88
-		return ( $screen->parent_file === 'plugins.php' );
88
+		return ($screen->parent_file === 'plugins.php');
89 89
 	}
90 90
 
91 91
 
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	public function give_addon_activation_admin_notice() {
99 99
 
100 100
 		// Bailout.
101
-		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) {
101
+		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) {
102 102
 			return;
103 103
 		}
104 104
 
105 105
 		// If the user hasn't already dismissed the alert, output activation banner.
106
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
106
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
107 107
 
108 108
 			// Output inline styles here because there's no reason
109 109
 			// to enqueued them after the alert is dismissed.
@@ -185,44 +185,44 @@  discard block
 block discarded – undo
185 185
 					<h3><?php
186 186
 						printf(
187 187
 						/* translators: %s: Add-on name */
188
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
189
-							'<span>' . $this->banner_details['name'] . '</span>'
188
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
189
+							'<span>'.$this->banner_details['name'].'</span>'
190 190
 						);
191 191
 						?></h3>
192 192
 
193 193
 					<a href="<?php
194 194
 					//The Dismiss Button.
195
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
196
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
195
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
196
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
197 197
 							class="dashicons dashicons-dismiss"></span></a>
198 198
 
199 199
 					<div class="alert-actions">
200 200
 
201 201
 						<?php //Point them to your settings page.
202
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
202
+						if (isset($this->banner_details['settings_url'])) { ?>
203 203
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
204
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?>
204
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?>
205 205
 							</a>
206 206
 						<?php } ?>
207 207
 
208 208
 						<?php
209 209
 						// Show them how to configure the Addon.
210
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
210
+						if (isset($this->banner_details['documentation_url'])) { ?>
211 211
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
212 212
 								<span class="dashicons dashicons-media-text"></span><?php
213 213
 								printf(
214 214
 								/* translators: %s: Add-on name */
215
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
215
+									esc_html__('Documentation: %s Add-on', 'give'),
216 216
 									$this->banner_details['name']
217 217
 								);
218 218
 								?></a>
219 219
 						<?php } ?>
220 220
 						<?php
221 221
 						//Let them signup for plugin updates
222
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
222
+						if (isset($this->banner_details['support_url'])) { ?>
223 223
 
224 224
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
225
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
225
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
226 226
 							</a>
227 227
 
228 228
 						<?php } ?>
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
250 250
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
251 251
 		 */
252
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
252
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
253 253
 
254 254
 			//Get the global user
255 255
 			$current_user = wp_get_current_user();
256 256
 			$user_id      = $current_user->ID;
257 257
 
258
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
258
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
259 259
 		}
260 260
 	}
261 261
 
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 	 * @access private
267 267
 	 */
268 268
 	private function add_addon_activate_meta() {
269
-		$user_id                  = get_option( $this->activate_by_meta_key );
269
+		$user_id                  = get_option($this->activate_by_meta_key);
270 270
 		$this->plugin_activate_by = (int) $user_id;
271 271
 
272
-		if ( ! $user_id ) {
273
-			add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' );
272
+		if ( ! $user_id) {
273
+			add_option($this->activate_by_meta_key, $this->user_id, '', 'no');
274 274
 			$this->plugin_activate_by = (int) $this->user_id;
275 275
 		}
276 276
 	}
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
 	 * @access public
284 284
 	 */
285 285
 	public function remove_addon_activate_meta() {
286
-		$user_id = get_option( $this->activate_by_meta_key );
286
+		$user_id = get_option($this->activate_by_meta_key);
287 287
 
288
-		if ( $user_id ) {
289
-			delete_option( $this->activate_by_meta_key );
288
+		if ($user_id) {
289
+			delete_option($this->activate_by_meta_key);
290 290
 		}
291 291
 	}
292 292
 
@@ -299,35 +299,35 @@  discard block
 block discarded – undo
299 299
 	 * @return mixed
300 300
 	 */
301 301
 	private function get_plugin_file_name() {
302
-		$active_plugins = get_option( 'active_plugins' );
302
+		$active_plugins = get_option('active_plugins');
303 303
 		$file_name      = '';
304 304
 
305 305
 		try {
306 306
 
307 307
 			// Check addon file path.
308
-			if ( ! empty( $this->banner_details['file'] ) ) {
308
+			if ( ! empty($this->banner_details['file'])) {
309 309
 				$file_name = '';
310
-				if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) {
311
-					$file_path = array_pop( $file_path );
312
-					$file_name = current( explode( '/', $file_path ) );
310
+				if ($file_path = explode('/plugins/', $this->banner_details['file'])) {
311
+					$file_path = array_pop($file_path);
312
+					$file_name = current(explode('/', $file_path));
313 313
 				}
314 314
 
315
-				foreach ( $active_plugins as $plugin ) {
316
-					if ( false !== strpos( $plugin, $file_name ) ) {
315
+				foreach ($active_plugins as $plugin) {
316
+					if (false !== strpos($plugin, $file_name)) {
317 317
 						$file_name = $plugin;
318 318
 						break;
319 319
 					}
320 320
 				}
321 321
 			} else {
322
-				throw new Exception( __( "File path must be added of {$this->banner_details['name']} addon in banner details.", 'give' ) );
322
+				throw new Exception(__("File path must be added of {$this->banner_details['name']} addon in banner details.", 'give'));
323 323
 			}
324 324
 
325 325
 			// Check plugin path calculated by addon file path.
326
-			if ( empty( $file_name ) ) {
327
-				throw new Exception( __( "Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give' ) );
326
+			if (empty($file_name)) {
327
+				throw new Exception(__("Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give'));
328 328
 			}
329 329
 
330
-		} catch ( Exception $e ) {
330
+		} catch (Exception $e) {
331 331
 			echo $e->getMessage();
332 332
 		}
333 333
 
Please login to merge, or discard this patch.
includes/admin/class-api-keys-table.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  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
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 		global $status, $page;
54 54
 
55 55
 		// Set parent defaults
56
-		parent::__construct( array(
57
-			'singular' => esc_html__( 'API Key', 'give' ),     // Singular name of the listed records
58
-			'plural'   => esc_html__( 'API Keys', 'give' ),    // Plural name of the listed records
59
-			'ajax'     => false,// Does this table support ajax?
60
-		) );
56
+		parent::__construct(array(
57
+			'singular' => esc_html__('API Key', 'give'), // Singular name of the listed records
58
+			'plural'   => esc_html__('API Keys', 'give'), // Plural name of the listed records
59
+			'ajax'     => false, // Does this table support ajax?
60
+		));
61 61
 
62 62
 		$this->query();
63 63
 	}
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return string Column Name
75 75
 	 */
76
-	public function column_default( $item, $column_name ) {
77
-		return $item[ $column_name ];
76
+	public function column_default($item, $column_name) {
77
+		return $item[$column_name];
78 78
 	}
79 79
 
80 80
 	/**
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return string Column Name
89 89
 	 */
90
-	public function column_key( $item ) {
91
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['key'] ) . '"/>';
90
+	public function column_key($item) {
91
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['key']).'"/>';
92 92
 	}
93 93
 
94 94
 	/**
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @return string Column Name
103 103
 	 */
104
-	public function column_token( $item ) {
105
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['token'] ) . '"/>';
104
+	public function column_token($item) {
105
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['token']).'"/>';
106 106
 	}
107 107
 
108 108
 	/**
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @return string Column Name
117 117
 	 */
118
-	public function column_secret( $item ) {
119
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['secret'] ) . '"/>';
118
+	public function column_secret($item) {
119
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['secret']).'"/>';
120 120
 	}
121 121
 
122 122
 	/**
@@ -126,46 +126,46 @@  discard block
 block discarded – undo
126 126
 	 * @since  1.1
127 127
 	 * @return string
128 128
 	 */
129
-	public function column_user( $item ) {
129
+	public function column_user($item) {
130 130
 
131 131
 		$actions = array();
132 132
 
133
-		if ( apply_filters( 'give_api_log_requests', true ) ) {
133
+		if (apply_filters('give_api_log_requests', true)) {
134 134
 			$actions['view'] = sprintf(
135 135
 				'<a href="%s">%s</a>',
136
-				esc_url( add_query_arg( array(
136
+				esc_url(add_query_arg(array(
137 137
 					'section'   => 'api_requests',
138 138
 					'post_type' => 'give_forms',
139 139
 					'page'      => 'give-tools',
140 140
 					'tab'       => 'logs',
141 141
 					's'         => $item['email'],
142
-				), 'edit.php' ) ),
143
-				esc_html__( 'View API Log', 'give' )
142
+				), 'edit.php')),
143
+				esc_html__('View API Log', 'give')
144 144
 			);
145 145
 		}
146 146
 
147 147
 		$actions['reissue'] = sprintf(
148 148
 			'<a href="%s" class="give-regenerate-api-key">%s</a>',
149
-			esc_url( wp_nonce_url( add_query_arg( array(
149
+			esc_url(wp_nonce_url(add_query_arg(array(
150 150
 				'user_id'          => $item['id'],
151 151
 				'give_action'      => 'process_api_key',
152 152
 				'give_api_process' => 'regenerate',
153
-			) ), 'give-api-nonce' ) ),
154
-			esc_html__( 'Reissue', 'give' )
153
+			)), 'give-api-nonce')),
154
+			esc_html__('Reissue', 'give')
155 155
 		);
156
-		$actions['revoke']  = sprintf(
156
+		$actions['revoke'] = sprintf(
157 157
 			'<a href="%s" class="give-revoke-api-key give-delete">%s</a>',
158
-			esc_url( wp_nonce_url( add_query_arg( array(
158
+			esc_url(wp_nonce_url(add_query_arg(array(
159 159
 				'user_id'          => $item['id'],
160 160
 				'give_action'      => 'process_api_key',
161 161
 				'give_api_process' => 'revoke',
162
-			) ), 'give-api-nonce' ) ),
163
-			esc_html__( 'Revoke', 'give' )
162
+			)), 'give-api-nonce')),
163
+			esc_html__('Revoke', 'give')
164 164
 		);
165 165
 
166
-		$actions = apply_filters( 'give_api_row_actions', array_filter( $actions ) );
166
+		$actions = apply_filters('give_api_row_actions', array_filter($actions));
167 167
 
168
-		return sprintf( '%1$s %2$s', $item['user'], $this->row_actions( $actions ) );
168
+		return sprintf('%1$s %2$s', $item['user'], $this->row_actions($actions));
169 169
 	}
170 170
 
171 171
 	/**
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function get_columns() {
191 191
 		$columns = array(
192
-			'user'   => esc_html__( 'Username', 'give' ),
193
-			'key'    => esc_html__( 'Public Key', 'give' ),
194
-			'token'  => esc_html__( 'Token', 'give' ),
195
-			'secret' => esc_html__( 'Secret Key', 'give' ),
192
+			'user'   => esc_html__('Username', 'give'),
193
+			'key'    => esc_html__('Public Key', 'give'),
194
+			'token'  => esc_html__('Token', 'give'),
195
+			'secret' => esc_html__('Secret Key', 'give'),
196 196
 		);
197 197
 
198 198
 		return $columns;
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
 	 *
207 207
 	 * @param string $which
208 208
 	 */
209
-	protected function display_tablenav( $which ) {
210
-		if ( 'top' === $which ) {
211
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
209
+	protected function display_tablenav($which) {
210
+		if ('top' === $which) {
211
+			wp_nonce_field('bulk-'.$this->_args['plural']);
212 212
 		}
213 213
 		?>
214
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
214
+		<div class="tablenav <?php echo esc_attr($which); ?>">
215 215
 
216 216
 			<div class="alignleft actions bulkactions">
217
-				<?php $this->bulk_actions( $which ); ?>
217
+				<?php $this->bulk_actions($which); ?>
218 218
 			</div>
219 219
 
220 220
 			<?php
221
-			$this->extra_tablenav( $which );
222
-			$this->pagination( $which );
221
+			$this->extra_tablenav($which);
222
+			$this->pagination($which);
223 223
 			?>
224 224
 
225 225
 			<br class="clear"/>
@@ -237,19 +237,19 @@  discard block
 block discarded – undo
237 237
 	 *
238 238
 	 * @return void
239 239
 	 */
240
-	function bulk_actions( $which = '' ) {
240
+	function bulk_actions($which = '') {
241 241
 		// These aren't really bulk actions but this outputs the markup in the right place
242 242
 		static $give_api_is_bottom;
243 243
 
244
-		if ( $give_api_is_bottom ) {
244
+		if ($give_api_is_bottom) {
245 245
 			return;
246 246
 		}
247 247
 		?>
248 248
 		<input type="hidden" name="give_action" value="process_api_key"/>
249 249
 		<input type="hidden" name="give_api_process" value="generate"/>
250
-		<?php wp_nonce_field( 'give-api-nonce' ); ?>
250
+		<?php wp_nonce_field('give-api-nonce'); ?>
251 251
 		<?php echo Give()->html->ajax_user_search(); ?>
252
-		<?php submit_button( esc_html__( 'Generate New API Keys', 'give' ), 'secondary', 'submit', false ); ?>
252
+		<?php submit_button(esc_html__('Generate New API Keys', 'give'), 'secondary', 'submit', false); ?>
253 253
 		<?php
254 254
 		$give_api_is_bottom = true;
255 255
 	}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @return int Current page number
263 263
 	 */
264 264
 	public function get_paged() {
265
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
265
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
266 266
 	}
267 267
 
268 268
 	/**
@@ -273,21 +273,21 @@  discard block
 block discarded – undo
273 273
 	 * @return array
274 274
 	 */
275 275
 	public function query() {
276
-		$users = get_users( array(
276
+		$users = get_users(array(
277 277
 			'meta_value' => 'give_user_secret_key',
278 278
 			'number'     => $this->per_page,
279
-			'offset'     => $this->per_page * ( $this->get_paged() - 1 ),
280
-		) );
281
-		$keys  = array();
282
-
283
-		foreach ( $users as $user ) {
284
-			$keys[ $user->ID ]['id']    = $user->ID;
285
-			$keys[ $user->ID ]['email'] = $user->user_email;
286
-			$keys[ $user->ID ]['user']  = '<a href="' . add_query_arg( 'user_id', $user->ID, 'user-edit.php' ) . '"><strong>' . $user->user_login . '</strong></a>';
287
-
288
-			$keys[ $user->ID ]['key']    = Give()->api->get_user_public_key( $user->ID );
289
-			$keys[ $user->ID ]['secret'] = Give()->api->get_user_secret_key( $user->ID );
290
-			$keys[ $user->ID ]['token']  = Give()->api->get_token( $user->ID );
279
+			'offset'     => $this->per_page * ($this->get_paged() - 1),
280
+		));
281
+		$keys = array();
282
+
283
+		foreach ($users as $user) {
284
+			$keys[$user->ID]['id']    = $user->ID;
285
+			$keys[$user->ID]['email'] = $user->user_email;
286
+			$keys[$user->ID]['user']  = '<a href="'.add_query_arg('user_id', $user->ID, 'user-edit.php').'"><strong>'.$user->user_login.'</strong></a>';
287
+
288
+			$keys[$user->ID]['key']    = Give()->api->get_user_public_key($user->ID);
289
+			$keys[$user->ID]['secret'] = Give()->api->get_user_secret_key($user->ID);
290
+			$keys[$user->ID]['token']  = Give()->api->get_token($user->ID);
291 291
 		}
292 292
 
293 293
 		return $keys;
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
 	public function total_items() {
305 305
 		global $wpdb;
306 306
 
307
-		if ( ! get_transient( 'give_total_api_keys' ) ) {
308
-			$total_items = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'" );
307
+		if ( ! get_transient('give_total_api_keys')) {
308
+			$total_items = $wpdb->get_var("SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'");
309 309
 
310
-			set_transient( 'give_total_api_keys', $total_items, 60 * 60 );
310
+			set_transient('give_total_api_keys', $total_items, 60 * 60);
311 311
 		}
312 312
 
313
-		return get_transient( 'give_total_api_keys' );
313
+		return get_transient('give_total_api_keys');
314 314
 	}
315 315
 
316 316
 	/**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		$hidden   = array(); // No hidden columns
327 327
 		$sortable = array(); // Not sortable... for now
328 328
 
329
-		$this->_column_headers = array( $columns, $hidden, $sortable );
329
+		$this->_column_headers = array($columns, $hidden, $sortable);
330 330
 
331 331
 		$data = $this->query();
332 332
 
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
 
335 335
 		$this->items = $data;
336 336
 
337
-		$this->set_pagination_args( array(
337
+		$this->set_pagination_args(array(
338 338
 				'total_items' => $total_items,
339 339
 				'per_page'    => $this->per_page,
340
-				'total_pages' => ceil( $total_items / $this->per_page ),
340
+				'total_pages' => ceil($total_items / $this->per_page),
341 341
 			)
342 342
 		);
343 343
 	}
Please login to merge, or discard this patch.
includes/admin/reporting/tools/tools-actions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
  * @since  1.5
21 21
  */
22 22
 function give_register_batch_recount_export_classes() {
23
-	add_action( 'give_batch_export_class_include', 'give_include_batch_export_class', 10, 1 );
23
+	add_action('give_batch_export_class_include', 'give_include_batch_export_class', 10, 1);
24 24
 }
25 25
 
26
-add_action( 'give_register_batch_exporter', 'give_register_batch_recount_export_classes', 10 );
26
+add_action('give_register_batch_exporter', 'give_register_batch_recount_export_classes', 10);
27 27
 
28 28
 
29 29
 /**
@@ -35,31 +35,31 @@  discard block
 block discarded – undo
35 35
  *
36 36
  * @return void
37 37
  */
38
-function give_include_batch_export_class( $class ) {
39
-	switch ( $class ) {
38
+function give_include_batch_export_class($class) {
39
+	switch ($class) {
40 40
 
41 41
 		case 'Give_Tools_Delete_Test_Transactions':
42
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php';
42
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php';
43 43
 			break;
44 44
 
45 45
 		case 'Give_Tools_Recount_Customer_Stats':
46
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php';
46
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php';
47 47
 			break;
48 48
 
49 49
 		case 'Give_Tools_Reset_Stats':
50
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-reset-stats.php';
50
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-reset-stats.php';
51 51
 			break;
52 52
 
53 53
 		case 'Give_Tools_Recount_All_Stats':
54
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php';
54
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php';
55 55
 			break;
56 56
 
57 57
 		case 'Give_Tools_Recount_Form_Stats':
58
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php';
58
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php';
59 59
 			break;
60 60
 
61 61
 		case 'Give_Tools_Recount_Income':
62
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-income.php';
62
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-income.php';
63 63
 			break;
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-payments.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function csv_cols() {
41 41
 		$cols = array(
42
-			'id'        => esc_html__( 'ID', 'give' ), // unaltered payment ID (use for querying).
43
-			'seq_id'    => esc_html__( 'Payment Number', 'give' ), // sequential payment ID.
44
-			'email'     => esc_html__( 'Email', 'give' ),
45
-			'first'     => esc_html__( 'First Name', 'give' ),
46
-			'last'      => esc_html__( 'Last Name', 'give' ),
47
-			'address1'  => esc_html__( 'Address 1', 'give' ),
48
-			'address2'  => esc_html__( 'Address 2', 'give' ),
49
-			'city'      => esc_html__( 'City', 'give' ),
50
-			'state'     => esc_html__( 'State', 'give' ),
51
-			'country'   => esc_html__( 'Country', 'give' ),
52
-			'zip'       => esc_html__( 'Zip / Postal Code', 'give' ),
53
-			'form_id'   => esc_html__( 'Form ID', 'give' ),
54
-			'form_name' => esc_html__( 'Form Name', 'give' ),
55
-			'amount'    => esc_html__( 'Amount', 'give' ) . ' (' . html_entity_decode( give_currency_filter( '' ) ) . ')',
56
-			'gateway'   => esc_html__( 'Payment Method', 'give' ),
57
-			'trans_id'  => esc_html__( 'Transaction ID', 'give' ),
58
-			'key'       => esc_html__( 'Key', 'give' ),
59
-			'date'      => esc_html__( 'Date', 'give' ),
60
-			'user'      => esc_html__( 'User', 'give' ),
61
-			'status'    => esc_html__( 'Status', 'give' )
42
+			'id'        => esc_html__('ID', 'give'), // unaltered payment ID (use for querying).
43
+			'seq_id'    => esc_html__('Payment Number', 'give'), // sequential payment ID.
44
+			'email'     => esc_html__('Email', 'give'),
45
+			'first'     => esc_html__('First Name', 'give'),
46
+			'last'      => esc_html__('Last Name', 'give'),
47
+			'address1'  => esc_html__('Address 1', 'give'),
48
+			'address2'  => esc_html__('Address 2', 'give'),
49
+			'city'      => esc_html__('City', 'give'),
50
+			'state'     => esc_html__('State', 'give'),
51
+			'country'   => esc_html__('Country', 'give'),
52
+			'zip'       => esc_html__('Zip / Postal Code', 'give'),
53
+			'form_id'   => esc_html__('Form ID', 'give'),
54
+			'form_name' => esc_html__('Form Name', 'give'),
55
+			'amount'    => esc_html__('Amount', 'give').' ('.html_entity_decode(give_currency_filter('')).')',
56
+			'gateway'   => esc_html__('Payment Method', 'give'),
57
+			'trans_id'  => esc_html__('Transaction ID', 'give'),
58
+			'key'       => esc_html__('Key', 'give'),
59
+			'date'      => esc_html__('Date', 'give'),
60
+			'user'      => esc_html__('User', 'give'),
61
+			'status'    => esc_html__('Status', 'give')
62 62
 		);
63 63
 
64
-		if ( ! give_get_option( 'enable_sequential' ) ) {
65
-			unset( $cols['seq_id'] );
64
+		if ( ! give_get_option('enable_sequential')) {
65
+			unset($cols['seq_id']);
66 66
 		}
67 67
 
68 68
 		return $cols;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			'status' => $this->status
88 88
 		);
89 89
 
90
-		if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
90
+		if ( ! empty($this->start) || ! empty($this->end)) {
91 91
 
92 92
 			$args['date_query'] = array(
93 93
 				array(
94
-					'after'     => date( 'Y-n-d 00:00:00', strtotime( $this->start ) ),
95
-					'before'    => date( 'Y-n-d 23:59:59', strtotime( $this->end ) ),
94
+					'after'     => date('Y-n-d 00:00:00', strtotime($this->start)),
95
+					'before'    => date('Y-n-d 23:59:59', strtotime($this->end)),
96 96
 					'inclusive' => true
97 97
 				)
98 98
 			);
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 
102 102
 		// Add category or tag to payment query if any.
103
-		if ( ! empty( $this->categories ) || ! empty( $this->tags ) ) {
103
+		if ( ! empty($this->categories) || ! empty($this->tags)) {
104 104
 			$form_args = array(
105 105
 				'post_type'      => 'give_forms',
106 106
 				'post_status'    => 'publish',
107
-				'posts_per_page' => - 1,
107
+				'posts_per_page' => -1,
108 108
 				'fields'         => 'ids',
109 109
 				'tax_query'      => array(
110 110
 					'relation' => 'AND',
@@ -112,75 +112,75 @@  discard block
 block discarded – undo
112 112
 			);
113 113
 
114 114
 
115
-			if ( ! empty( $this->categories ) ) {
115
+			if ( ! empty($this->categories)) {
116 116
 				$form_args['tax_query'][] = array(
117 117
 					'taxonomy' => 'give_forms_category',
118 118
 					'terms'    => $this->categories,
119 119
 				);
120 120
 			}
121 121
 
122
-			if ( ! empty( $this->tags ) ) {
122
+			if ( ! empty($this->tags)) {
123 123
 				$form_args['tax_query'][] = array(
124 124
 					'taxonomy' => 'give_forms_tag',
125 125
 					'terms'    => $this->tags,
126 126
 				);
127 127
 			}
128 128
 
129
-			$forms = new WP_Query( $form_args );
129
+			$forms = new WP_Query($form_args);
130 130
 
131
-			if ( empty( $forms->posts ) ) {
131
+			if (empty($forms->posts)) {
132 132
 				return array();
133 133
 			}
134 134
 
135 135
 			$args['give_forms'] = $forms->posts;
136 136
 		}
137 137
 
138
-		$payments = give_get_payments( $args );
138
+		$payments = give_get_payments($args);
139 139
 
140
-		if ( $payments ) {
140
+		if ($payments) {
141 141
 
142
-			foreach ( $payments as $payment ) {
143
-				$payment_meta = give_get_payment_meta( $payment->ID );
144
-				$user_info    = give_get_payment_meta_user_info( $payment->ID );
145
-				$total        = give_get_payment_amount( $payment->ID );
146
-				$user_id      = isset( $user_info['id'] ) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
142
+			foreach ($payments as $payment) {
143
+				$payment_meta = give_get_payment_meta($payment->ID);
144
+				$user_info    = give_get_payment_meta_user_info($payment->ID);
145
+				$total        = give_get_payment_amount($payment->ID);
146
+				$user_id      = isset($user_info['id']) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
147 147
 				$products     = '';
148 148
 				$skus         = '';
149 149
 
150
-				if ( is_numeric( $user_id ) ) {
151
-					$user = get_userdata( $user_id );
150
+				if (is_numeric($user_id)) {
151
+					$user = get_userdata($user_id);
152 152
 				} else {
153 153
 					$user = false;
154 154
 				}
155 155
 
156 156
 				$data[] = array(
157 157
 					'id'        => $payment->ID,
158
-					'seq_id'    => give_get_payment_number( $payment->ID ),
158
+					'seq_id'    => give_get_payment_number($payment->ID),
159 159
 					'email'     => $payment_meta['email'],
160 160
 					'first'     => $user_info['first_name'],
161 161
 					'last'      => $user_info['last_name'],
162
-					'address1'  => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '',
163
-					'address2'  => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '',
164
-					'city'      => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '',
165
-					'state'     => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '',
166
-					'country'   => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '',
167
-					'zip'       => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '',
168
-					'form_id'   => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '',
169
-					'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '',
162
+					'address1'  => isset($user_info['address']['line1']) ? $user_info['address']['line1'] : '',
163
+					'address2'  => isset($user_info['address']['line2']) ? $user_info['address']['line2'] : '',
164
+					'city'      => isset($user_info['address']['city']) ? $user_info['address']['city'] : '',
165
+					'state'     => isset($user_info['address']['state']) ? $user_info['address']['state'] : '',
166
+					'country'   => isset($user_info['address']['country']) ? $user_info['address']['country'] : '',
167
+					'zip'       => isset($user_info['address']['zip']) ? $user_info['address']['zip'] : '',
168
+					'form_id'   => isset($payment_meta['form_id']) ? $payment_meta['form_id'] : '',
169
+					'form_name' => isset($payment_meta['form_title']) ? $payment_meta['form_title'] : '',
170 170
 					'skus'      => $skus,
171
-					'amount'    => html_entity_decode( give_format_amount( $total ) ),
172
-					'gateway'   => give_get_gateway_admin_label( get_post_meta( $payment->ID, '_give_payment_gateway', true ) ),
173
-					'trans_id'  => give_get_payment_transaction_id( $payment->ID ),
171
+					'amount'    => html_entity_decode(give_format_amount($total)),
172
+					'gateway'   => give_get_gateway_admin_label(get_post_meta($payment->ID, '_give_payment_gateway', true)),
173
+					'trans_id'  => give_get_payment_transaction_id($payment->ID),
174 174
 					'key'       => $payment_meta['key'],
175 175
 					'date'      => $payment->post_date,
176
-					'user'      => $user ? $user->display_name : __( 'guest', 'give' ),
177
-					'status'    => give_get_payment_status( $payment, true )
176
+					'user'      => $user ? $user->display_name : __('guest', 'give'),
177
+					'status'    => give_get_payment_status($payment, true)
178 178
 				);
179 179
 
180 180
 			}
181 181
 
182
-			$data = apply_filters( 'give_export_get_data', $data );
183
-			$data = apply_filters( "give_export_get_data_{$this->export_type}", $data );
182
+			$data = apply_filters('give_export_get_data', $data);
183
+			$data = apply_filters("give_export_get_data_{$this->export_type}", $data);
184 184
 
185 185
 			return $data;
186 186
 
@@ -200,27 +200,27 @@  discard block
 block discarded – undo
200 200
 
201 201
 		$status = $this->status;
202 202
 		$args   = array(
203
-			'start-date' => date( 'n/d/Y', strtotime( $this->start ) ),
204
-			'end-date'   => date( 'n/d/Y', strtotime( $this->end ) ),
203
+			'start-date' => date('n/d/Y', strtotime($this->start)),
204
+			'end-date'   => date('n/d/Y', strtotime($this->end)),
205 205
 		);
206 206
 
207
-		if ( 'any' == $status ) {
207
+		if ('any' == $status) {
208 208
 
209
-			$total = array_sum( (array) give_count_payments( $args ) );
209
+			$total = array_sum((array) give_count_payments($args));
210 210
 
211 211
 		} else {
212 212
 
213
-			$total = give_count_payments( $args )->$status;
213
+			$total = give_count_payments($args)->$status;
214 214
 
215 215
 		}
216 216
 
217 217
 		$percentage = 100;
218 218
 
219
-		if ( $total > 0 ) {
220
-			$percentage = ( ( 30 * $this->step ) / $total ) * 100;
219
+		if ($total > 0) {
220
+			$percentage = ((30 * $this->step) / $total) * 100;
221 221
 		}
222 222
 
223
-		if ( $percentage > 100 ) {
223
+		if ($percentage > 100) {
224 224
 			$percentage = 100;
225 225
 		}
226 226
 
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 	 *
235 235
 	 * @param array $request The Form Data passed into the batch processing.
236 236
 	 */
237
-	public function set_properties( $request ) {
238
-		$this->start      = isset( $request['start'] ) ? sanitize_text_field( $request['start'] ) : '';
239
-		$this->end        = isset( $request['end'] ) ? sanitize_text_field( $request['end'] ) : '';
240
-		$this->status     = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete';
241
-		$this->categories = isset( $request['give_forms_categories'] ) ? give_clean( $request['give_forms_categories'] ) : array();
242
-		$this->tags       = isset( $request['give_forms_tags'] ) ? give_clean( $request['give_forms_tags'] ) : array();
237
+	public function set_properties($request) {
238
+		$this->start      = isset($request['start']) ? sanitize_text_field($request['start']) : '';
239
+		$this->end        = isset($request['end']) ? sanitize_text_field($request['end']) : '';
240
+		$this->status     = isset($request['status']) ? sanitize_text_field($request['status']) : 'complete';
241
+		$this->categories = isset($request['give_forms_categories']) ? give_clean($request['give_forms_categories']) : array();
242
+		$this->tags       = isset($request['give_forms_tags']) ? give_clean($request['give_forms_tags']) : array();
243 243
 	}
244 244
 }
Please login to merge, or discard this patch.
includes/admin/reporting/logs.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function give_logs_view_sales() {
26
-	include( dirname( __FILE__ ) . '/class-sales-logs-list-table.php' );
26
+	include(dirname(__FILE__).'/class-sales-logs-list-table.php');
27 27
 
28 28
 	$logs_table = new Give_Sales_Log_Table();
29 29
 	$logs_table->prepare_items();
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 }
33 33
 
34
-add_action( 'give_logs_view_sales', 'give_logs_view_sales' );
34
+add_action('give_logs_view_sales', 'give_logs_view_sales');
35 35
 
36 36
 
37 37
 /**
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  */
45 45
 function give_logs_view_gateway_errors() {
46
-	include( dirname( __FILE__ ) . '/class-gateway-error-logs-list-table.php' );
46
+	include(dirname(__FILE__).'/class-gateway-error-logs-list-table.php');
47 47
 
48 48
 	$logs_table = new Give_Gateway_Error_Log_Table();
49 49
 	$logs_table->prepare_items();
50 50
 	$logs_table->display();
51 51
 }
52 52
 
53
-add_action( 'give_logs_view_gateway_errors', 'give_logs_view_gateway_errors' );
53
+add_action('give_logs_view_gateway_errors', 'give_logs_view_gateway_errors');
54 54
 
55 55
 /**
56 56
  * API Request Logs
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  * @return void
63 63
  */
64 64
 function give_logs_view_api_requests() {
65
-	include( dirname( __FILE__ ) . '/class-api-requests-logs-list-table.php' );
65
+	include(dirname(__FILE__).'/class-api-requests-logs-list-table.php');
66 66
 
67 67
 	$logs_table = new Give_API_Request_Log_Table();
68 68
 	$logs_table->prepare_items();
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 		 *
76 76
 		 * @since 1.0
77 77
 		 */
78
-		do_action( 'give_logs_api_requests_top' );
78
+		do_action('give_logs_api_requests_top');
79 79
 		?>
80 80
 
81 81
 		<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs'; ?>">
82 82
 			<?php
83
-			$logs_table->search_box( esc_html__( 'Search', 'give' ), 'give-api-requests' );
83
+			$logs_table->search_box(esc_html__('Search', 'give'), 'give-api-requests');
84 84
 			$logs_table->display();
85 85
 			?>
86 86
 			<input type="hidden" name="post_type" value="give_forms"/>
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 		 *
94 94
 		 * @since 1.0
95 95
 		 */
96
-		do_action( 'give_logs_api_requests_bottom' );
96
+		do_action('give_logs_api_requests_bottom');
97 97
 		?>
98 98
 
99 99
 	</div>
100 100
 	<?php
101 101
 }
102 102
 
103
-add_action( 'give_logs_view_api_requests', 'give_logs_view_api_requests' );
103
+add_action('give_logs_view_api_requests', 'give_logs_view_api_requests');
104 104
 
105 105
 /**
106 106
  * Renders the Reports page views drop down
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 	$current_section = give_get_current_setting_section();
113 113
 
114 114
 	// If there are not any event attach to action then do not show form.
115
-	if ( ! has_action( 'give_log_view_actions' ) ) {
115
+	if ( ! has_action('give_log_view_actions')) {
116 116
 		return;
117 117
 	}
118 118
 	?>
119
-	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section=' . $current_section; ?>">
119
+	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section='.$current_section; ?>">
120 120
 		<?php
121 121
 		/**
122 122
 		 * Fires after displaying the reports page views drop down.
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 		 *
126 126
 		 * @since 1.0
127 127
 		 */
128
-		do_action( 'give_log_view_actions' );
128
+		do_action('give_log_view_actions');
129 129
 		?>
130 130
 
131 131
 		<input type="hidden" name="post_type" value="give_forms"/>
132 132
 		<input type="hidden" name="page" value="give-tools"/>
133 133
 		<input type="hidden" name="tab" value="logs"/>
134 134
 
135
-		<?php submit_button( esc_html__( 'Apply', 'give' ), 'secondary', 'submit', false ); ?>
135
+		<?php submit_button(esc_html__('Apply', 'give'), 'secondary', 'submit', false); ?>
136 136
 	</form>
137 137
 	<?php
138 138
 }
Please login to merge, or discard this patch.
includes/admin/admin-actions.php 2 patches
Spacing   +26 added lines, -26 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
 
@@ -24,53 +24,53 @@  discard block
 block discarded – undo
24 24
 function give_hide_subscription_notices() {
25 25
 
26 26
 	// Hide subscription notices permanently.
27
-	if ( ! empty( $_GET['_give_hide_license_notices_permanently'] ) ) {
27
+	if ( ! empty($_GET['_give_hide_license_notices_permanently'])) {
28 28
 		$current_user = wp_get_current_user();
29 29
 
30 30
 		// check previously disabled notice ids.
31
-		$already_dismiss_notices = ( $already_dismiss_notices = get_user_meta( $current_user->ID, '_give_hide_license_notices_permanently', true ) )
31
+		$already_dismiss_notices = ($already_dismiss_notices = get_user_meta($current_user->ID, '_give_hide_license_notices_permanently', true))
32 32
 			? $already_dismiss_notices
33 33
 			: array();
34 34
 
35 35
 		// Get notice id.
36
-		$notice_id = sanitize_text_field( $_GET['_give_hide_license_notices_permanently'] );
36
+		$notice_id = sanitize_text_field($_GET['_give_hide_license_notices_permanently']);
37 37
 
38
-		if ( ! in_array( $notice_id, $already_dismiss_notices ) ) {
38
+		if ( ! in_array($notice_id, $already_dismiss_notices)) {
39 39
 			$already_dismiss_notices[] = $notice_id;
40 40
 		}
41 41
 
42 42
 		// Store subscription ids.
43
-		update_user_meta( $current_user->ID, '_give_hide_license_notices_permanently', $already_dismiss_notices );
43
+		update_user_meta($current_user->ID, '_give_hide_license_notices_permanently', $already_dismiss_notices);
44 44
 
45 45
 		// Redirect user.
46
-		wp_safe_redirect( remove_query_arg( '_give_hide_license_notices_permanently', $_SERVER['REQUEST_URI'] ) );
46
+		wp_safe_redirect(remove_query_arg('_give_hide_license_notices_permanently', $_SERVER['REQUEST_URI']));
47 47
 		exit();
48 48
 	}
49 49
 
50 50
 	// Hide subscription notices shortly.
51
-	if ( ! empty( $_GET['_give_hide_license_notices_shortly'] ) ) {
51
+	if ( ! empty($_GET['_give_hide_license_notices_shortly'])) {
52 52
 		$current_user = wp_get_current_user();
53 53
 
54 54
 		// Get notice id.
55
-		$notice_id = sanitize_text_field( $_GET['_give_hide_license_notices_shortly'] );
55
+		$notice_id = sanitize_text_field($_GET['_give_hide_license_notices_shortly']);
56 56
 
57 57
 		// Transient key name.
58 58
 		$transient_key = "_give_hide_license_notices_shortly_{$current_user->ID}_{$notice_id}";
59 59
 
60
-		if ( get_transient( $transient_key ) ) {
60
+		if (get_transient($transient_key)) {
61 61
 			return;
62 62
 		}
63 63
 
64 64
 		// Hide notice for 24 hours.
65
-		set_transient( $transient_key, true, 24 * HOUR_IN_SECONDS );
65
+		set_transient($transient_key, true, 24 * HOUR_IN_SECONDS);
66 66
 
67 67
 		// Redirect user.
68
-		wp_safe_redirect( remove_query_arg( '_give_hide_license_notices_shortly', $_SERVER['REQUEST_URI'] ) );
68
+		wp_safe_redirect(remove_query_arg('_give_hide_license_notices_shortly', $_SERVER['REQUEST_URI']));
69 69
 		exit();
70 70
 	}
71 71
 }
72 72
 
73
-add_action( 'admin_init', 'give_hide_subscription_notices' );
73
+add_action('admin_init', 'give_hide_subscription_notices');
74 74
 
75 75
 /**
76 76
  * Load wp editor by ajax.
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
  * @since 1.8
79 79
  */
80 80
 function give_load_wp_editor() {
81
-	if ( ! isset( $_POST['wp_editor'] ) ) {
81
+	if ( ! isset($_POST['wp_editor'])) {
82 82
 		die();
83 83
 	}
84 84
 
85
-	$wp_editor                     = json_decode( base64_decode( $_POST['wp_editor'] ), true );
85
+	$wp_editor                     = json_decode(base64_decode($_POST['wp_editor']), true);
86 86
 	$wp_editor[2]['textarea_name'] = $_POST['textarea_name'];
87 87
 
88
-	wp_editor( $wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2] );
88
+	wp_editor($wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2]);
89 89
 
90 90
 	die();
91 91
 }
92 92
 
93
-add_action( 'wp_ajax_give_load_wp_editor', 'give_load_wp_editor' );
93
+add_action('wp_ajax_give_load_wp_editor', 'give_load_wp_editor');
94 94
 
95 95
 
96 96
 /**
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 	);
110 110
 
111 111
 	// Get current page.
112
-	$current_page = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : '';
112
+	$current_page = isset($_GET['page']) ? esc_attr($_GET['page']) : '';
113 113
 
114 114
 	// Bailout.
115 115
 	if (
116
-		empty( $current_page )
117
-		|| empty( $_GET['_wp_http_referer'] )
118
-		|| ! in_array( $current_page, $give_pages )
116
+		empty($current_page)
117
+		|| empty($_GET['_wp_http_referer'])
118
+		|| ! in_array($current_page, $give_pages)
119 119
 	) {
120 120
 		return false;
121 121
 	}
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.8
127 127
 	 */
128
-	$redirect = apply_filters( "give_validate_{$current_page}", true );
128
+	$redirect = apply_filters("give_validate_{$current_page}", true);
129 129
 
130
-	if ( $redirect ) {
130
+	if ($redirect) {
131 131
 		// Redirect.
132 132
 		wp_redirect(
133 133
 			remove_query_arg(
134
-				array( '_wp_http_referer', '_wpnonce' ),
135
-				wp_unslash( $_SERVER['REQUEST_URI'] )
134
+				array('_wp_http_referer', '_wpnonce'),
135
+				wp_unslash($_SERVER['REQUEST_URI'])
136 136
 			)
137 137
 		);
138 138
 		exit;
139 139
 	}
140 140
 }
141 141
 
142
-add_action( 'admin_init', 'give_redirect_to_clean_url_admin_pages' );
142
+add_action('admin_init', 'give_redirect_to_clean_url_admin_pages');
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
  *
99 99
  * @since 1.8
100 100
  *
101
- * @return bool
101
+ * @return false|null
102 102
  */
103 103
 function give_redirect_to_clean_url_admin_pages() {
104 104
 	// Give admin pages.
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -49,45 +49,45 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function admin_menus() {
52
-		list( $display_version ) = explode( '-', GIVE_VERSION );
52
+		list($display_version) = explode('-', GIVE_VERSION);
53 53
 
54 54
 		// About Page
55 55
 		add_dashboard_page(
56 56
 			/* translators: %s: Give version */
57
-			sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ),
58
-			esc_html__( 'Welcome to Give', 'give' ),
57
+			sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version),
58
+			esc_html__('Welcome to Give', 'give'),
59 59
 			$this->minimum_capability,
60 60
 			'give-about',
61
-			array( $this, 'about_screen' )
61
+			array($this, 'about_screen')
62 62
 		);
63 63
 
64 64
 		// Changelog Page
65 65
 		add_dashboard_page(
66
-			esc_html__( 'Give Changelog', 'give' ),
67
-			esc_html__( 'Give Changelog', 'give' ),
66
+			esc_html__('Give Changelog', 'give'),
67
+			esc_html__('Give Changelog', 'give'),
68 68
 			$this->minimum_capability,
69 69
 			'give-changelog',
70
-			array( $this, 'changelog_screen' )
70
+			array($this, 'changelog_screen')
71 71
 		);
72 72
 
73 73
 		// Getting Started Page
74 74
 		add_dashboard_page(
75 75
 			/* translators: %s: Give version */
76
-			sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ),
77
-			esc_html__( 'Getting started with Give', 'give' ),
76
+			sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version),
77
+			esc_html__('Getting started with Give', 'give'),
78 78
 			$this->minimum_capability,
79 79
 			'give-getting-started',
80
-			array( $this, 'getting_started_screen' )
80
+			array($this, 'getting_started_screen')
81 81
 		);
82 82
 
83 83
 		// Credits Page
84 84
 		add_dashboard_page(
85 85
 			/* translators: %s: Give version */
86
-			sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ),
87
-			esc_html__( 'The people that build Give', 'give' ),
86
+			sprintf(esc_html__('Give %s - Credits', 'give'), $display_version),
87
+			esc_html__('The people that build Give', 'give'),
88 88
 			$this->minimum_capability,
89 89
 			'give-credits',
90
-			array( $this, 'credits_screen' )
90
+			array($this, 'credits_screen')
91 91
 		);
92 92
 	}
93 93
 
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function admin_head() {
102 102
 
103
-		remove_submenu_page( 'index.php', 'give-about' );
104
-		remove_submenu_page( 'index.php', 'give-changelog' );
105
-		remove_submenu_page( 'index.php', 'give-getting-started' );
106
-		remove_submenu_page( 'index.php', 'give-credits' );
103
+		remove_submenu_page('index.php', 'give-about');
104
+		remove_submenu_page('index.php', 'give-changelog');
105
+		remove_submenu_page('index.php', 'give-getting-started');
106
+		remove_submenu_page('index.php', 'give-credits');
107 107
 
108 108
 		// Badge for welcome page
109
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
109
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
110 110
 
111 111
 		?>
112 112
 		<style type="text/css" media="screen">
@@ -186,20 +186,20 @@  discard block
 block discarded – undo
186 186
 	 * @return void
187 187
 	 */
188 188
 	public function tabs() {
189
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
189
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
190 190
 		?>
191 191
 		<h2 class="nav-tab-wrapper">
192
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
193
-				<?php esc_html_e( 'About Give', 'give' ); ?>
192
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
193
+				<?php esc_html_e('About Give', 'give'); ?>
194 194
 			</a>
195
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
196
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
195
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
196
+				<?php esc_html_e('Getting Started', 'give'); ?>
197 197
 			</a>
198
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
199
-				<?php esc_html_e( 'Credits', 'give' ); ?>
198
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
199
+				<?php esc_html_e('Credits', 'give'); ?>
200 200
 			</a>
201
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
202
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
201
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>">
202
+				<?php esc_html_e('Add-ons', 'give'); ?>
203 203
 			</a>
204 204
 		</h2>
205 205
 	<?php
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 * @return void
214 214
 	 */
215 215
 	public function about_screen() {
216
-		list( $display_version ) = explode( '-', GIVE_VERSION );
216
+		list($display_version) = explode('-', GIVE_VERSION);
217 217
 		?>
218 218
 		<div class="wrap about-wrap">
219 219
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 			<p class="about-text"><?php
224 224
 				printf(
225 225
 					/* translators: %s: https://givewp.com/documenation/ */
226
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
227
-					esc_url( 'https://givewp.com/documenation/' )
226
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
227
+					esc_url('https://givewp.com/documenation/')
228 228
 				);
229 229
 			?></p>
230 230
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			<div class="give-badge"><?php
234 234
 				printf(
235 235
 					/* translators: %s: Give version */
236
-					esc_html__( 'Version %s', 'give' ),
236
+					esc_html__('Version %s', 'give'),
237 237
 					$display_version
238 238
 				);
239 239
 			?></div>
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
 			<div class="feature-section clearfix introduction">
244 244
 
245 245
 				<div class="video feature-section-item">
246
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>">
246
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e('A Give donation form', 'give'); ?>">
247 247
 				</div>
248 248
 
249 249
 				<div class="content feature-section-item last-feature">
250 250
 
251
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
251
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
252 252
 
253
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
253
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
254 254
 					<a href="https://givewp.com" target="_blank" class="button-secondary">
255
-						<?php esc_html_e( 'Learn More', 'give' ); ?>
255
+						<?php esc_html_e('Learn More', 'give'); ?>
256 256
 						<span class="dashicons dashicons-external"></span>
257 257
 					</a>
258 258
 
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
 
266 266
 				<div class="content feature-section-item">
267 267
 
268
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
268
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
269 269
 
270
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
270
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
271 271
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary">
272
-						<?php esc_html_e( 'View Documentation', 'give' ); ?>
272
+						<?php esc_html_e('View Documentation', 'give'); ?>
273 273
 						<span class="dashicons dashicons-external"></span>
274 274
 					</a>
275 275
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
 				<div class="content  feature-section-item last-feature">
279 279
 
280
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e( 'Give', 'give' ); ?>">
280
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e('Give', 'give'); ?>">
281 281
 
282 282
 				</div>
283 283
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 * @return void
298 298
 	 */
299 299
 	public function changelog_screen() {
300
-		list( $display_version ) = explode( '-', GIVE_VERSION );
300
+		list($display_version) = explode('-', GIVE_VERSION);
301 301
 		?>
302 302
 		<div class="wrap about-wrap">
303 303
 			<h1><?php echo get_admin_page_title(); ?></h1>
@@ -305,14 +305,14 @@  discard block
 block discarded – undo
305 305
 			<p class="about-text"><?php
306 306
 				printf(
307 307
 					/* translators: %s: Give version */
308
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
308
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
309 309
 					$display_version
310 310
 				);
311 311
 			?></p>
312 312
 			<div class="give-badge"><?php
313 313
 				printf(
314 314
 					/* translators: %s: Give version */
315
-					esc_html__( 'Version %s', 'give' ),
315
+					esc_html__('Version %s', 'give'),
316 316
 					$display_version
317 317
 				);
318 318
 			?></div>
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			<?php $this->tabs(); ?>
321 321
 
322 322
 			<div class="changelog">
323
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
323
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
324 324
 
325 325
 				<div class="feature-section">
326 326
 					<?php echo $this->parse_readme(); ?>
@@ -328,10 +328,10 @@  discard block
 block discarded – undo
328 328
 			</div>
329 329
 
330 330
 			<div class="return-to-dashboard">
331
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
331
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
332 332
 					'post_type' => 'give_forms',
333 333
 					'page'      => 'give-settings'
334
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a>
334
+				), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a>
335 335
 			</div>
336 336
 		</div>
337 337
 	<?php
@@ -345,37 +345,37 @@  discard block
 block discarded – undo
345 345
 	 * @return void
346 346
 	 */
347 347
 	public function getting_started_screen() {
348
-		list( $display_version ) = explode( '-', GIVE_VERSION );
348
+		list($display_version) = explode('-', GIVE_VERSION);
349 349
 		?>
350 350
 		<div class="wrap about-wrap get-started">
351 351
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
352 352
 
353 353
 			<?php give_social_media_elements() ?>
354 354
 
355
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
355
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
356 356
 
357 357
 			<?php give_get_newsletter(); ?>
358 358
 
359 359
 			<div class="give-badge"><?php
360 360
 				printf(
361 361
 					/* translators: %s: Give version */
362
-					esc_html__( 'Version %s', 'give' ),
362
+					esc_html__('Version %s', 'give'),
363 363
 					$display_version
364 364
 				);
365 365
 			?></div>
366 366
 
367 367
 			<?php $this->tabs(); ?>
368 368
 
369
-			<p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
369
+			<p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p>
370 370
 
371 371
 			<div class="feature-section clearfix">
372 372
 
373 373
 				<div class="content feature-section-item">
374
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
374
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
375 375
 
376
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p>
376
+					<p><?php esc_html_e('Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p>
377 377
 
378
-					<p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p>
378
+					<p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give'); ?></p>
379 379
 				</div>
380 380
 
381 381
 				<div class="content feature-section-item last-feature">
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
 				</div>
393 393
 
394 394
 				<div class="content feature-section-item last-feature">
395
-					<h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
395
+					<h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3>
396 396
 
397
-					<p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p>
397
+					<p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p>
398 398
 				</div>
399 399
 
400 400
 			</div>
@@ -403,11 +403,11 @@  discard block
 block discarded – undo
403 403
 			<div class="feature-section clearfix">
404 404
 
405 405
 				<div class="content feature-section-item add-content">
406
-					<h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
406
+					<h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3>
407 407
 
408
-					<p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p>
408
+					<p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p>
409 409
 
410
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
410
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
411 411
 				</div>
412 412
 
413 413
 				<div class="content feature-section-item last-feature">
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
 				</div>
425 425
 
426 426
 				<div class="content feature-section-item last-feature">
427
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
427
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
428 428
 
429
-					<p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p>
429
+					<p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p>
430 430
 				</div>
431 431
 
432 432
 
@@ -446,23 +446,23 @@  discard block
 block discarded – undo
446 446
 	 * @return void
447 447
 	 */
448 448
 	public function credits_screen() {
449
-		list( $display_version ) = explode( '-', GIVE_VERSION );
449
+		list($display_version) = explode('-', GIVE_VERSION);
450 450
 		?>
451 451
 		<div class="wrap about-wrap">
452 452
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
453 453
 
454 454
 			<?php give_social_media_elements() ?>
455 455
 
456
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
456
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p>
457 457
 
458
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
458
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
459 459
 
460 460
 			<?php give_get_newsletter(); ?>
461 461
 
462 462
 			<div class="give-badge"><?php
463 463
 				printf(
464 464
 					/* translators: %s: Give version */
465
-					esc_html__( 'Version %s', 'give' ),
465
+					esc_html__('Version %s', 'give'),
466 466
 					$display_version
467 467
 				);
468 468
 			?></div>
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 			<p class="about-description"><?php
473 473
 				printf(
474 474
 					/* translators: %s: https://github.com/WordImpress/give */
475
-					__( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ),
476
-					esc_url( 'https://github.com/WordImpress/give' )
475
+					__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'),
476
+					esc_url('https://github.com/WordImpress/give')
477 477
 				);
478 478
 			?></p>
479 479
 
@@ -490,21 +490,21 @@  discard block
 block discarded – undo
490 490
 	 * @return string $readme HTML formatted readme file
491 491
 	 */
492 492
 	public function parse_readme() {
493
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
493
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
494 494
 
495
-		if ( ! $file ) {
496
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
495
+		if ( ! $file) {
496
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
497 497
 		} else {
498
-			$readme = file_get_contents( $file );
499
-			$readme = nl2br( esc_html( $readme ) );
500
-			$readme = explode( '== Changelog ==', $readme );
501
-			$readme = end( $readme );
502
-
503
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
504
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
505
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
506
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
507
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
498
+			$readme = file_get_contents($file);
499
+			$readme = nl2br(esc_html($readme));
500
+			$readme = explode('== Changelog ==', $readme);
501
+			$readme = end($readme);
502
+
503
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
504
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
505
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
506
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
507
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
508 508
 		}
509 509
 
510 510
 		return $readme;
@@ -521,24 +521,24 @@  discard block
 block discarded – undo
521 521
 	public function contributors() {
522 522
 		$contributors = $this->get_contributors();
523 523
 
524
-		if ( empty( $contributors ) ) {
524
+		if (empty($contributors)) {
525 525
 			return '';
526 526
 		}
527 527
 
528 528
 		$contributor_list = '<ul class="wp-people-group">';
529 529
 
530
-		foreach ( $contributors as $contributor ) {
530
+		foreach ($contributors as $contributor) {
531 531
 			$contributor_list .= '<li class="wp-person">';
532 532
 			$contributor_list .= sprintf(
533 533
 				'<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
534
-				esc_url( 'https://github.com/' . $contributor->login ),
535
-				esc_url( $contributor->avatar_url ),
536
-				esc_attr( $contributor->login )
534
+				esc_url('https://github.com/'.$contributor->login),
535
+				esc_url($contributor->avatar_url),
536
+				esc_attr($contributor->login)
537 537
 			);
538 538
 			$contributor_list .= sprintf(
539 539
 				'<a class="web" target="_blank" href="%1$s">%2$s</a>',
540
-				esc_url( 'https://github.com/' . $contributor->login ),
541
-				esc_html( $contributor->login )
540
+				esc_url('https://github.com/'.$contributor->login),
541
+				esc_html($contributor->login)
542 542
 			);
543 543
 			$contributor_list .= '</li>';
544 544
 		}
@@ -556,25 +556,25 @@  discard block
 block discarded – undo
556 556
 	 * @return array $contributors List of contributors
557 557
 	 */
558 558
 	public function get_contributors() {
559
-		$contributors = get_transient( 'give_contributors' );
559
+		$contributors = get_transient('give_contributors');
560 560
 
561
-		if ( false !== $contributors ) {
561
+		if (false !== $contributors) {
562 562
 			return $contributors;
563 563
 		}
564 564
 
565
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
565
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
566 566
 
567
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
567
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
568 568
 			return array();
569 569
 		}
570 570
 
571
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
571
+		$contributors = json_decode(wp_remote_retrieve_body($response));
572 572
 
573
-		if ( ! is_array( $contributors ) ) {
573
+		if ( ! is_array($contributors)) {
574 574
 			return array();
575 575
 		}
576 576
 
577
-		set_transient( 'give_contributors', $contributors, 3600 );
577
+		set_transient('give_contributors', $contributors, 3600);
578 578
 
579 579
 		return $contributors;
580 580
 	}
@@ -592,24 +592,24 @@  discard block
 block discarded – undo
592 592
 		$give_options = give_get_settings();
593 593
 
594 594
 		// Bail if no activation redirect
595
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
595
+		if ( ! get_transient('_give_activation_redirect')) {
596 596
 			return;
597 597
 		}
598 598
 
599 599
 		// Delete the redirect transient
600
-		delete_transient( '_give_activation_redirect' );
600
+		delete_transient('_give_activation_redirect');
601 601
 
602 602
 		// Bail if activating from network, or bulk
603
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
603
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
604 604
 			return;
605 605
 		}
606 606
 
607
-		$upgrade = get_option( 'give_version_upgraded_from' );
607
+		$upgrade = get_option('give_version_upgraded_from');
608 608
 
609
-		if ( ! $upgrade ) { // First time install
610
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
609
+		if ( ! $upgrade) { // First time install
610
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
611 611
 			exit;
612
-		} elseif( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
612
+		} elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings
613 613
 
614 614
 		} else { // Welcome is NOT disabled in settings
615 615
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.
includes/formatting.php 1 patch
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return mixed
24 24
  */
25 25
 function give_get_price_decimals() {
26
-	return apply_filters( 'give_sanitize_amount_decimals', give_get_option( 'number_decimals', 0 ) );
26
+	return apply_filters('give_sanitize_amount_decimals', give_get_option('number_decimals', 0));
27 27
 }
28 28
 
29 29
 /**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  * @return mixed
35 35
  */
36 36
 function give_get_price_thousand_separator() {
37
-	return give_get_option( 'thousands_separator', ',' );
37
+	return give_get_option('thousands_separator', ',');
38 38
 }
39 39
 
40 40
 /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * @return mixed
46 46
  */
47 47
 function give_get_price_decimal_separator() {
48
-	return give_get_option( 'decimal_separator', '.' );
48
+	return give_get_option('decimal_separator', '.');
49 49
 }
50 50
 
51 51
 /**
@@ -61,67 +61,67 @@  discard block
 block discarded – undo
61 61
  *
62 62
  * @return string $amount Newly sanitized amount
63 63
  */
64
-function give_sanitize_amount( $number, $dp = false, $trim_zeros = false ) {
64
+function give_sanitize_amount($number, $dp = false, $trim_zeros = false) {
65 65
 
66 66
 	// Bailout.
67
-	if ( empty( $number ) ) {
67
+	if (empty($number)) {
68 68
 		return $number;
69 69
 	}
70 70
 
71 71
 	// Remove slash from amount.
72 72
 	// If thousand or decimal separator is set to ' then in $_POST or $_GET param we will get an escaped number.
73 73
 	// To prevent notices and warning remove slash from amount/number.
74
-	$number = wp_unslash( $number );
74
+	$number = wp_unslash($number);
75 75
 
76 76
 	$thousand_separator = give_get_price_thousand_separator();
77 77
 
78 78
 	$locale   = localeconv();
79
-	$decimals = array( give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point'] );
79
+	$decimals = array(give_get_price_decimal_separator(), $locale['decimal_point'], $locale['mon_decimal_point']);
80 80
 
81 81
 	// Remove locale from string
82
-	if ( ! is_float( $number ) ) {
83
-		$number = str_replace( $decimals, '.', $number );
82
+	if ( ! is_float($number)) {
83
+		$number = str_replace($decimals, '.', $number);
84 84
 	}
85 85
 
86 86
 	// Remove thousand amount formatting if amount has.
87 87
 	// This condition use to add backward compatibility to version before 1.6, because before version 1.6 we were saving formatted amount to db.
88 88
 	// Do not replace thousand separator from price if it is same as decimal separator, because it will be already replace by above code.
89
-	if ( ! in_array( $thousand_separator, $decimals ) && ( false !== strpos( $number, $thousand_separator ) ) ) {
90
-		$number = str_replace( $thousand_separator, '', $number );
91
-	} elseif ( in_array( $thousand_separator, $decimals ) ) {
92
-		$number = preg_replace( '/\.(?=.*\.)/', '', $number );
89
+	if ( ! in_array($thousand_separator, $decimals) && (false !== strpos($number, $thousand_separator))) {
90
+		$number = str_replace($thousand_separator, '', $number);
91
+	} elseif (in_array($thousand_separator, $decimals)) {
92
+		$number = preg_replace('/\.(?=.*\.)/', '', $number);
93 93
 	}
94 94
 
95 95
 	// Remove non numeric entity before decimal separator.
96
-	$number     = preg_replace( '/[^0-9\.]/', '', $number );
96
+	$number     = preg_replace('/[^0-9\.]/', '', $number);
97 97
 	$default_dp = give_get_price_decimals();
98 98
 
99 99
 	// Reset negative amount to zero.
100
-	if ( 0 > $number ) {
101
-		$number = number_format( 0, $default_dp, '.' );
100
+	if (0 > $number) {
101
+		$number = number_format(0, $default_dp, '.');
102 102
 	}
103 103
 
104 104
 	// If number does not have decimal then add number of decimals to it.
105 105
 	if (
106
-		false === strpos( $number, '.' )
107
-		|| ( $default_dp > strlen( substr( $number, strpos( $number, '.' ) + 1 ) ) )
106
+		false === strpos($number, '.')
107
+		|| ($default_dp > strlen(substr($number, strpos($number, '.') + 1)))
108 108
 	) {
109
-		$number = number_format( $number, $default_dp, '.', '' );
109
+		$number = number_format($number, $default_dp, '.', '');
110 110
 	}
111 111
 
112 112
 	// Format number by custom number of decimals.
113
-	if ( false !== $dp ) {
114
-		$dp     = intval( empty( $dp ) ? $default_dp : $dp );
115
-		$dp     = apply_filters( 'give_sanitize_amount_decimals', $dp, $number );
116
-		$number = number_format( floatval( $number ), $dp, '.', '' );
113
+	if (false !== $dp) {
114
+		$dp     = intval(empty($dp) ? $default_dp : $dp);
115
+		$dp     = apply_filters('give_sanitize_amount_decimals', $dp, $number);
116
+		$number = number_format(floatval($number), $dp, '.', '');
117 117
 	}
118 118
 
119 119
 	// Trim zeros.
120
-	if ( $trim_zeros && strstr( $number, '.' ) ) {
121
-		$number = rtrim( rtrim( $number, '0' ), '.' );
120
+	if ($trim_zeros && strstr($number, '.')) {
121
+		$number = rtrim(rtrim($number, '0'), '.');
122 122
 	}
123 123
 
124
-	return apply_filters( 'give_sanitize_amount', $number );
124
+	return apply_filters('give_sanitize_amount', $number);
125 125
 }
126 126
 
127 127
 /**
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return string $amount   Newly formatted amount or Price Not Available
136 136
  */
137
-function give_format_amount( $amount, $decimals = true ) {
138
-	$thousands_sep = give_get_option( 'thousands_separator', ',' );
139
-	$decimal_sep   = give_get_option( 'decimal_separator', '.' );
137
+function give_format_amount($amount, $decimals = true) {
138
+	$thousands_sep = give_get_option('thousands_separator', ',');
139
+	$decimal_sep   = give_get_option('decimal_separator', '.');
140 140
 
141
-	if ( empty( $amount ) ) {
141
+	if (empty($amount)) {
142 142
 		$amount = 0;
143 143
 	} else {
144 144
 		// Sanitize amount before formatting.
145
-		$amount = give_sanitize_amount( $amount );
145
+		$amount = give_sanitize_amount($amount);
146 146
 	}
147 147
 
148 148
 	$decimals = $decimals ? give_get_price_decimals() : 0;
149 149
 
150
-	$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep );
150
+	$formatted = number_format($amount, $decimals, $decimal_sep, $thousands_sep);
151 151
 
152
-	return apply_filters( 'give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep );
152
+	return apply_filters('give_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep);
153 153
 }
154 154
 
155 155
 
@@ -166,33 +166,33 @@  discard block
 block discarded – undo
166 166
  *
167 167
  * @return float|string  formatted amount number with large number names.
168 168
  */
169
-function give_human_format_large_amount( $amount ) {
169
+function give_human_format_large_amount($amount) {
170 170
 
171 171
 	// Get thousand separator.
172 172
 	$thousands_sep = give_get_price_thousand_separator();
173 173
 
174 174
 	// Sanitize amount.
175
-	$sanitize_amount = give_sanitize_amount( $amount );
175
+	$sanitize_amount = give_sanitize_amount($amount);
176 176
 
177 177
 	// Explode amount to calculate name of large numbers.
178
-	$amount_array = explode( $thousands_sep, $amount );
178
+	$amount_array = explode($thousands_sep, $amount);
179 179
 
180 180
 	// Calculate amount parts count.
181
-	$amount_count_parts = count( $amount_array );
181
+	$amount_count_parts = count($amount_array);
182 182
 
183 183
 	// Human format amount (default).
184 184
 	$human_format_amount = $amount;
185 185
 
186 186
 	// Calculate large number formatted amount.
187
-	if ( 4 < $amount_count_parts ) {
188
-		$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
189
-	} elseif ( 3 < $amount_count_parts ) {
190
-		$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
191
-	} elseif ( 2 < $amount_count_parts ) {
192
-		$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
187
+	if (4 < $amount_count_parts) {
188
+		$human_format_amount = sprintf(esc_html__('%s trillion', 'give'), round(($sanitize_amount / 1000000000000), 2));
189
+	} elseif (3 < $amount_count_parts) {
190
+		$human_format_amount = sprintf(esc_html__('%s billion', 'give'), round(($sanitize_amount / 1000000000), 2));
191
+	} elseif (2 < $amount_count_parts) {
192
+		$human_format_amount = sprintf(esc_html__('%s million', 'give'), round(($sanitize_amount / 1000000), 2));
193 193
 	}
194 194
 
195
-	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );
195
+	return apply_filters('give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount);
196 196
 }
197 197
 
198 198
 /**
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
  *
206 206
  * @return string $amount Newly formatted amount or Price Not Available
207 207
  */
208
-function give_format_decimal( $amount, $dp = false ) {
208
+function give_format_decimal($amount, $dp = false) {
209 209
 	$decimal_separator = give_get_price_decimal_separator();
210
-	$formatted_amount  = give_sanitize_amount( $amount, $dp );
210
+	$formatted_amount  = give_sanitize_amount($amount, $dp);
211 211
 
212
-	if ( false !== strpos( $formatted_amount, '.' ) ) {
213
-		$formatted_amount = str_replace( '.', $decimal_separator, $formatted_amount );
212
+	if (false !== strpos($formatted_amount, '.')) {
213
+		$formatted_amount = str_replace('.', $decimal_separator, $formatted_amount);
214 214
 	}
215 215
 
216
-	return apply_filters( 'give_format_decimal', $formatted_amount, $amount, $decimal_separator );
216
+	return apply_filters('give_format_decimal', $formatted_amount, $amount, $decimal_separator);
217 217
 }
218 218
 
219 219
 /**
@@ -226,24 +226,24 @@  discard block
 block discarded – undo
226 226
  *
227 227
  * @return mixed|string
228 228
  */
229
-function give_currency_filter( $price = '', $currency = '' ) {
229
+function give_currency_filter($price = '', $currency = '') {
230 230
 
231
-	if ( empty( $currency ) ) {
231
+	if (empty($currency)) {
232 232
 		$currency = give_get_currency();
233 233
 	}
234 234
 
235
-	$position = give_get_option( 'currency_position', 'before' );
235
+	$position = give_get_option('currency_position', 'before');
236 236
 
237 237
 	$negative = $price < 0;
238 238
 
239
-	if ( $negative ) {
239
+	if ($negative) {
240 240
 		// Remove proceeding "-".
241
-		$price = substr( $price, 1 );
241
+		$price = substr($price, 1);
242 242
 	}
243 243
 
244
-	$symbol = give_currency_symbol( $currency );
244
+	$symbol = give_currency_symbol($currency);
245 245
 
246
-	switch ( $currency ) :
246
+	switch ($currency) :
247 247
 		case 'GBP' :
248 248
 		case 'BRL' :
249 249
 		case 'EUR' :
@@ -272,13 +272,13 @@  discard block
 block discarded – undo
272 272
 		case 'MAD' :
273 273
 		case 'KRW' :
274 274
 		case 'ZAR' :
275
-			$formatted = ( 'before' === $position ? $symbol . $price : $price . $symbol );
275
+			$formatted = ('before' === $position ? $symbol.$price : $price.$symbol);
276 276
 			break;
277 277
 		case 'NOK' :
278
-			$formatted = ( 'before' === $position ? $symbol . ' ' . $price : $price . ' ' . $symbol );
278
+			$formatted = ('before' === $position ? $symbol.' '.$price : $price.' '.$symbol);
279 279
 			break;
280 280
 		default :
281
-			$formatted = ( 'before' === $position ? $currency . ' ' . $price : $price . ' ' . $currency );
281
+			$formatted = ('before' === $position ? $currency.' '.$price : $price.' '.$currency);
282 282
 			break;
283 283
 	endswitch;
284 284
 
@@ -293,11 +293,11 @@  discard block
 block discarded – undo
293 293
 	 *           and if currency is USD and currency position is after then
294 294
 	 *           filter name will be give_usd_currency_filter_after
295 295
 	 */
296
-	$formatted = apply_filters( 'give_' . strtolower( $currency ) . "_currency_filter_{$position}", $formatted, $currency, $price );
296
+	$formatted = apply_filters('give_'.strtolower($currency)."_currency_filter_{$position}", $formatted, $currency, $price);
297 297
 
298
-	if ( $negative ) {
298
+	if ($negative) {
299 299
 		// Prepend the minus sign before the currency sign.
300
-		$formatted = '-' . $formatted;
300
+		$formatted = '-'.$formatted;
301 301
 	}
302 302
 
303 303
 	return $formatted;
@@ -313,21 +313,21 @@  discard block
 block discarded – undo
313 313
  */
314 314
 function give_currency_decimal_filter() {
315 315
 
316
-	remove_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
316
+	remove_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
317 317
 
318 318
 	// Set default number of decimals.
319 319
 	$decimals = give_get_price_decimals();
320 320
 
321
-	add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
321
+	add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
322 322
 
323 323
 	// Get number of decimals with backward compatibility ( version < 1.6 )
324
-	if ( 1 <= func_num_args() ) {
325
-		$decimals = ( false === func_get_arg( 0 ) ? $decimals : absint( func_get_arg( 0 ) ) );
324
+	if (1 <= func_num_args()) {
325
+		$decimals = (false === func_get_arg(0) ? $decimals : absint(func_get_arg(0)));
326 326
 	}
327 327
 
328 328
 	$currency = give_get_currency();
329 329
 
330
-	switch ( $currency ) {
330
+	switch ($currency) {
331 331
 		case 'RIAL' :
332 332
 		case 'JPY' :
333 333
 		case 'TWD' :
@@ -337,11 +337,11 @@  discard block
 block discarded – undo
337 337
 			break;
338 338
 	}
339 339
 
340
-	return apply_filters( 'give_currency_decimal_count', $decimals, $currency );
340
+	return apply_filters('give_currency_decimal_count', $decimals, $currency);
341 341
 }
342 342
 
343
-add_filter( 'give_sanitize_amount_decimals', 'give_currency_decimal_filter' );
344
-add_filter( 'give_format_amount_decimals', 'give_currency_decimal_filter' );
343
+add_filter('give_sanitize_amount_decimals', 'give_currency_decimal_filter');
344
+add_filter('give_format_amount_decimals', 'give_currency_decimal_filter');
345 345
 
346 346
 
347 347
 /**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
  *
354 354
  * @return string                  Date format string
355 355
  */
356
-function give_date_format( $date_context = '' ) {
356
+function give_date_format($date_context = '') {
357 357
 	/**
358 358
 	 * Filter the date context
359 359
 	 *
@@ -374,19 +374,19 @@  discard block
 block discarded – undo
374 374
 	 *
375 375
 	 *    }
376 376
 	 */
377
-	$date_format_contexts = apply_filters( 'give_date_format_contexts', array() );
377
+	$date_format_contexts = apply_filters('give_date_format_contexts', array());
378 378
 
379 379
 	// Set date format to default date format.
380
-	$date_format = get_option( 'date_format' );
380
+	$date_format = get_option('date_format');
381 381
 
382 382
 	// Update date format if we have non empty date format context array and non empty date format string for that context.
383
-	if ( $date_context && ! empty( $date_format_contexts ) && array_key_exists( $date_context, $date_format_contexts ) ) {
384
-		$date_format = ! empty( $date_format_contexts[ $date_context ] )
385
-			? $date_format_contexts[ $date_context ]
383
+	if ($date_context && ! empty($date_format_contexts) && array_key_exists($date_context, $date_format_contexts)) {
384
+		$date_format = ! empty($date_format_contexts[$date_context])
385
+			? $date_format_contexts[$date_context]
386 386
 			: $date_format;
387 387
 	}
388 388
 
389
-	return apply_filters( 'give_date_format', $date_format );
389
+	return apply_filters('give_date_format', $date_format);
390 390
 }
391 391
 
392 392
 /**
@@ -399,13 +399,13 @@  discard block
 block discarded – undo
399 399
  *
400 400
  * @return string
401 401
  */
402
-function give_get_cache_key( $action, $query_args ) {
402
+function give_get_cache_key($action, $query_args) {
403 403
 	// Bailout.
404
-	if ( ! is_array( $query_args ) || empty( $query_args ) ) {
404
+	if ( ! is_array($query_args) || empty($query_args)) {
405 405
 		return '';
406 406
 	}
407 407
 
408
-	return "give_cache_{$action}_" . substr( md5( serialize( $query_args ) ), 0, 15 );
408
+	return "give_cache_{$action}_".substr(md5(serialize($query_args)), 0, 15);
409 409
 }
410 410
 
411 411
 /**
@@ -418,11 +418,11 @@  discard block
 block discarded – undo
418 418
  *
419 419
  * @return string|array
420 420
  */
421
-function give_clean( $var ) {
422
-	if ( is_array( $var ) ) {
423
-		return array_map( 'give_clean', $var );
421
+function give_clean($var) {
422
+	if (is_array($var)) {
423
+		return array_map('give_clean', $var);
424 424
 	} else {
425
-		return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
425
+		return is_scalar($var) ? sanitize_text_field($var) : $var;
426 426
 	}
427 427
 }
428 428
 
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
  *
436 436
  * @return int
437 437
  */
438
-function give_let_to_num( $size ) {
439
-	$l   = substr( $size, - 1 );
440
-	$ret = substr( $size, 0, - 1 );
441
-	switch ( strtoupper( $l ) ) {
438
+function give_let_to_num($size) {
439
+	$l   = substr($size, - 1);
440
+	$ret = substr($size, 0, - 1);
441
+	switch (strtoupper($l)) {
442 442
 		case 'P':
443 443
 			$ret *= 1024;
444 444
 		case 'T':
@@ -463,17 +463,17 @@  discard block
 block discarded – undo
463 463
  * @param int   $action
464 464
  * @param array $wp_die_args
465 465
  */
466
-function give_validate_nonce( $nonce, $action = - 1, $wp_die_args = array() ) {
466
+function give_validate_nonce($nonce, $action = - 1, $wp_die_args = array()) {
467 467
 
468 468
 	$default_wp_die_args = array(
469
-		'message' => esc_html__( 'Nonce verification has failed.', 'give' ),
470
-		'title'   => esc_html__( 'Error', 'give' ),
471
-		'args'    => array( 'response' => 403 ),
469
+		'message' => esc_html__('Nonce verification has failed.', 'give'),
470
+		'title'   => esc_html__('Error', 'give'),
471
+		'args'    => array('response' => 403),
472 472
 	);
473 473
 
474
-	$wp_die_args = wp_parse_args( $wp_die_args, $default_wp_die_args );
474
+	$wp_die_args = wp_parse_args($wp_die_args, $default_wp_die_args);
475 475
 
476
-	if ( ! wp_verify_nonce( $nonce, $action ) ) {
476
+	if ( ! wp_verify_nonce($nonce, $action)) {
477 477
 		wp_die(
478 478
 			$wp_die_args['message'],
479 479
 			$wp_die_args['title'],
@@ -495,23 +495,23 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return mixed
497 497
  */
498
-function give_check_variable( $variable, $conditional = '', $default = false ) {
498
+function give_check_variable($variable, $conditional = '', $default = false) {
499 499
 
500
-	switch ( $conditional ) {
500
+	switch ($conditional) {
501 501
 		case 'isset_empty':
502
-			$variable = ( isset( $variable ) && ! empty( $variable ) ) ? $variable : $default;
502
+			$variable = (isset($variable) && ! empty($variable)) ? $variable : $default;
503 503
 			break;
504 504
 
505 505
 		case 'empty':
506
-			$variable = ! empty( $variable ) ? $variable : $default;
506
+			$variable = ! empty($variable) ? $variable : $default;
507 507
 			break;
508 508
 
509 509
 		case 'null':
510
-			$variable = ! is_null( $variable ) ? $variable : $default;
510
+			$variable = ! is_null($variable) ? $variable : $default;
511 511
 			break;
512 512
 
513 513
 		default:
514
-			$variable = isset( $variable ) ? $variable : $default;
514
+			$variable = isset($variable) ? $variable : $default;
515 515
 
516 516
 	}
517 517
 
Please login to merge, or discard this patch.