Completed
Pull Request — master (#782)
by
unknown
20:41
created
includes/admin/payments/actions.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -26,106 +26,106 @@  discard block
 block discarded – undo
26 26
  * @return      void
27 27
  *
28 28
  */
29
-function give_update_payment_details( $data ) {
29
+function give_update_payment_details($data) {
30 30
 
31
-	if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) {
32
-		wp_die( esc_html__( 'You do not have permission to edit payment records.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
31
+	if ( ! current_user_can('edit_give_payments', $data['give_payment_id'])) {
32
+		wp_die(esc_html__('You do not have permission to edit payment records.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
33 33
 	}
34 34
 
35
-	check_admin_referer( 'give_update_payment_details_nonce' );
35
+	check_admin_referer('give_update_payment_details_nonce');
36 36
 
37 37
 	// Retrieve the payment ID
38
-	$payment_id = absint( $data['give_payment_id'] );
39
-	$payment    = new Give_Payment( $payment_id );
38
+	$payment_id = absint($data['give_payment_id']);
39
+	$payment    = new Give_Payment($payment_id);
40 40
 
41 41
 	// Retrieve existing payment meta
42 42
 	$meta      = $payment->get_meta();
43 43
 	$user_info = $payment->user_info;
44 44
 
45 45
 	$status = $data['give-payment-status'];
46
-	$date   = sanitize_text_field( $data['give-payment-date'] );
47
-	$hour   = sanitize_text_field( $data['give-payment-time-hour'] );
46
+	$date   = sanitize_text_field($data['give-payment-date']);
47
+	$hour   = sanitize_text_field($data['give-payment-time-hour']);
48 48
 
49 49
 	// Restrict to our high and low
50
-	if ( $hour > 23 ) {
50
+	if ($hour > 23) {
51 51
 		$hour = 23;
52
-	} elseif ( $hour < 0 ) {
52
+	} elseif ($hour < 0) {
53 53
 		$hour = 00;
54 54
 	}
55 55
 
56
-	$minute = sanitize_text_field( $data['give-payment-time-min'] );
56
+	$minute = sanitize_text_field($data['give-payment-time-min']);
57 57
 
58 58
 	// Restrict to our high and low
59
-	if ( $minute > 59 ) {
59
+	if ($minute > 59) {
60 60
 		$minute = 59;
61
-	} elseif ( $minute < 0 ) {
61
+	} elseif ($minute < 0) {
62 62
 		$minute = 00;
63 63
 	}
64 64
 
65
-	$address = array_map( 'trim', $data['give-payment-address'][0] );
65
+	$address = array_map('trim', $data['give-payment-address'][0]);
66 66
 
67
-	$curr_total = give_sanitize_amount( $payment->total );
68
-	$new_total  = give_sanitize_amount( $_POST['give-payment-total'] );
69
-	$date       = date( 'Y-m-d', strtotime( $date ) ) . ' ' . $hour . ':' . $minute . ':00';
67
+	$curr_total = give_sanitize_amount($payment->total);
68
+	$new_total  = give_sanitize_amount($_POST['give-payment-total']);
69
+	$date       = date('Y-m-d', strtotime($date)).' '.$hour.':'.$minute.':00';
70 70
 
71
-	$curr_customer_id = sanitize_text_field( $data['give-current-customer'] );
72
-	$new_customer_id  = sanitize_text_field( $data['customer-id'] );
71
+	$curr_customer_id = sanitize_text_field($data['give-current-customer']);
72
+	$new_customer_id  = sanitize_text_field($data['customer-id']);
73 73
 
74
-	do_action( 'give_update_edited_purchase', $payment_id );
74
+	do_action('give_update_edited_purchase', $payment_id);
75 75
 
76 76
 	$payment->date = $date;
77 77
 	$updated       = $payment->save();
78 78
 
79
-	if ( 0 === $updated ) {
80
-		wp_die( esc_html__( 'Error Updating Payment.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
79
+	if (0 === $updated) {
80
+		wp_die(esc_html__('Error Updating Payment.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
81 81
 	}
82 82
 
83 83
 	$customer_changed = false;
84 84
 
85
-	if ( isset( $data['give-new-customer'] ) && $data['give-new-customer'] == '1' ) {
85
+	if (isset($data['give-new-customer']) && $data['give-new-customer'] == '1') {
86 86
 
87
-		$email = isset( $data['give-new-customer-email'] ) ? sanitize_text_field( $data['give-new-customer-email'] ) : '';
88
-		$names = isset( $data['give-new-customer-name'] ) ? sanitize_text_field( $data['give-new-customer-name'] ) : '';
87
+		$email = isset($data['give-new-customer-email']) ? sanitize_text_field($data['give-new-customer-email']) : '';
88
+		$names = isset($data['give-new-customer-name']) ? sanitize_text_field($data['give-new-customer-name']) : '';
89 89
 
90
-		if ( empty( $email ) || empty( $names ) ) {
91
-			wp_die( esc_html__( 'New Customers require a name and email address.', 'give' ) );
90
+		if (empty($email) || empty($names)) {
91
+			wp_die(esc_html__('New Customers require a name and email address.', 'give'));
92 92
 		}
93 93
 
94
-		$customer = new Give_Customer( $email );
95
-		if ( empty( $customer->id ) ) {
96
-			$customer_data = array( 'name' => $names, 'email' => $email );
97
-			$user_id       = email_exists( $email );
98
-			if ( false !== $user_id ) {
94
+		$customer = new Give_Customer($email);
95
+		if (empty($customer->id)) {
96
+			$customer_data = array('name' => $names, 'email' => $email);
97
+			$user_id       = email_exists($email);
98
+			if (false !== $user_id) {
99 99
 				$customer_data['user_id'] = $user_id;
100 100
 			}
101 101
 
102
-			if ( ! $customer->create( $customer_data ) ) {
102
+			if ( ! $customer->create($customer_data)) {
103 103
 				// Failed to crete the new donor, assume the previous donor
104 104
 				$customer_changed = false;
105
-				$customer         = new Give_Customer( $curr_customer_id );
106
-				give_set_error( 'give-payment-new-customer-fail', esc_html__( 'Error creating new donor.', 'give' ) );
105
+				$customer         = new Give_Customer($curr_customer_id);
106
+				give_set_error('give-payment-new-customer-fail', esc_html__('Error creating new donor.', 'give'));
107 107
 			}
108 108
 		}
109 109
 
110 110
 		$new_customer_id = $customer->id;
111 111
 
112
-		$previous_customer = new Give_Customer( $curr_customer_id );
112
+		$previous_customer = new Give_Customer($curr_customer_id);
113 113
 
114 114
 		$customer_changed = true;
115 115
 
116
-	} elseif ( $curr_customer_id !== $new_customer_id ) {
116
+	} elseif ($curr_customer_id !== $new_customer_id) {
117 117
 
118
-		$customer = new Give_Customer( $new_customer_id );
118
+		$customer = new Give_Customer($new_customer_id);
119 119
 		$email    = $customer->email;
120 120
 		$names    = $customer->name;
121 121
 
122
-		$previous_customer = new Give_Customer( $curr_customer_id );
122
+		$previous_customer = new Give_Customer($curr_customer_id);
123 123
 
124 124
 		$customer_changed = true;
125 125
 
126 126
 	} else {
127 127
 
128
-		$customer = new Give_Customer( $curr_customer_id );
128
+		$customer = new Give_Customer($curr_customer_id);
129 129
 		$email    = $customer->email;
130 130
 		$names    = $customer->name;
131 131
 
@@ -133,29 +133,29 @@  discard block
 block discarded – undo
133 133
 
134 134
 
135 135
 	// Setup first and last name from input values
136
-	$names      = explode( ' ', $names );
137
-	$first_name = ! empty( $names[0] ) ? $names[0] : '';
136
+	$names      = explode(' ', $names);
137
+	$first_name = ! empty($names[0]) ? $names[0] : '';
138 138
 	$last_name  = '';
139
-	if ( ! empty( $names[1] ) ) {
140
-		unset( $names[0] );
141
-		$last_name = implode( ' ', $names );
139
+	if ( ! empty($names[1])) {
140
+		unset($names[0]);
141
+		$last_name = implode(' ', $names);
142 142
 	}
143 143
 
144 144
 
145
-	if ( $customer_changed ) {
145
+	if ($customer_changed) {
146 146
 
147 147
 		// Remove the stats and payment from the previous customer and attach it to the new customer
148
-		$previous_customer->remove_payment( $payment_id, false );
149
-		$customer->attach_payment( $payment_id, false );
148
+		$previous_customer->remove_payment($payment_id, false);
149
+		$customer->attach_payment($payment_id, false);
150 150
 
151 151
 		// If purchase was completed and not ever refunded, adjust stats of customers
152
-		if ( 'revoked' == $status || 'publish' == $status ) {
152
+		if ('revoked' == $status || 'publish' == $status) {
153 153
 
154 154
 			$previous_customer->decrease_purchase_count();
155
-			$previous_customer->decrease_value( $new_total );
155
+			$previous_customer->decrease_value($new_total);
156 156
 
157 157
 			$customer->increase_purchase_count();
158
-			$customer->increase_value( $new_total );
158
+			$customer->increase_value($new_total);
159 159
 		}
160 160
 
161 161
 		$payment->customer_id = $customer->id;
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
 
173 173
 	// Check for payment notes
174
-	if ( ! empty( $data['give-payment-note'] ) ) {
174
+	if ( ! empty($data['give-payment-note'])) {
175 175
 
176
-		$note = wp_kses( $data['give-payment-note'], array() );
177
-		give_insert_payment_note( $payment_id, $note );
176
+		$note = wp_kses($data['give-payment-note'], array());
177
+		give_insert_payment_note($payment_id, $note);
178 178
 
179 179
 	}
180 180
 
@@ -182,17 +182,17 @@  discard block
 block discarded – undo
182 182
 	$payment->status = $status;
183 183
 
184 184
 	// Adjust total store earnings if the payment total has been changed
185
-	if ( $new_total !== $curr_total && ( 'publish' == $status || 'revoked' == $status ) ) {
185
+	if ($new_total !== $curr_total && ('publish' == $status || 'revoked' == $status)) {
186 186
 
187
-		if ( $new_total > $curr_total ) {
187
+		if ($new_total > $curr_total) {
188 188
 			// Increase if our new total is higher
189 189
 			$difference = $new_total - $curr_total;
190
-			give_increase_total_earnings( $difference );
190
+			give_increase_total_earnings($difference);
191 191
 
192
-		} elseif ( $curr_total > $new_total ) {
192
+		} elseif ($curr_total > $new_total) {
193 193
 			// Decrease if our new total is lower
194 194
 			$difference = $curr_total - $new_total;
195
-			give_decrease_total_earnings( $difference );
195
+			give_decrease_total_earnings($difference);
196 196
 
197 197
 		}
198 198
 
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
 
201 201
 	$payment->save();
202 202
 
203
-	do_action( 'give_updated_edited_purchase', $payment_id );
203
+	do_action('give_updated_edited_purchase', $payment_id);
204 204
 
205
-	wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id=' . $payment_id ) );
205
+	wp_safe_redirect(admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id='.$payment_id));
206 206
 	exit;
207 207
 }
208 208
 
209
-add_action( 'give_update_payment_details', 'give_update_payment_details' );
209
+add_action('give_update_payment_details', 'give_update_payment_details');
210 210
 
211 211
 /**
212 212
  * Trigger a Purchase Deletion
@@ -217,48 +217,48 @@  discard block
 block discarded – undo
217 217
  *
218 218
  * @return void
219 219
  */
220
-function give_trigger_purchase_delete( $data ) {
221
-	if ( wp_verify_nonce( $data['_wpnonce'], 'give_payment_nonce' ) ) {
220
+function give_trigger_purchase_delete($data) {
221
+	if (wp_verify_nonce($data['_wpnonce'], 'give_payment_nonce')) {
222 222
 
223
-		$payment_id = absint( $data['purchase_id'] );
223
+		$payment_id = absint($data['purchase_id']);
224 224
 
225
-		if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
226
-			wp_die( esc_html__( 'You do not have permission to edit payment records.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
225
+		if ( ! current_user_can('edit_give_payments', $payment_id)) {
226
+			wp_die(esc_html__('You do not have permission to edit payment records.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
227 227
 		}
228 228
 
229
-		give_delete_purchase( $payment_id );
230
-		wp_redirect( admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted' ) );
229
+		give_delete_purchase($payment_id);
230
+		wp_redirect(admin_url('/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted'));
231 231
 		give_die();
232 232
 	}
233 233
 }
234 234
 
235
-add_action( 'give_delete_payment', 'give_trigger_purchase_delete' );
235
+add_action('give_delete_payment', 'give_trigger_purchase_delete');
236 236
 
237 237
 /**
238 238
  * AJAX Store Payment Note
239 239
  */
240 240
 function give_ajax_store_payment_note() {
241 241
 
242
-	$payment_id = absint( $_POST['payment_id'] );
243
-	$note       = wp_kses( $_POST['note'], array() );
242
+	$payment_id = absint($_POST['payment_id']);
243
+	$note       = wp_kses($_POST['note'], array());
244 244
 
245
-	if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
246
-		wp_die( esc_html__( 'You do not have permission to edit payment records.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
245
+	if ( ! current_user_can('edit_give_payments', $payment_id)) {
246
+		wp_die(esc_html__('You do not have permission to edit payment records.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
247 247
 	}
248 248
 
249
-	if ( empty( $payment_id ) ) {
250
-		die( '-1' );
249
+	if (empty($payment_id)) {
250
+		die('-1');
251 251
 	}
252 252
 
253
-	if ( empty( $note ) ) {
254
-		die( '-1' );
253
+	if (empty($note)) {
254
+		die('-1');
255 255
 	}
256 256
 
257
-	$note_id = give_insert_payment_note( $payment_id, $note );
258
-	die( give_get_payment_note_html( $note_id ) );
257
+	$note_id = give_insert_payment_note($payment_id, $note);
258
+	die(give_get_payment_note_html($note_id));
259 259
 }
260 260
 
261
-add_action( 'wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note' );
261
+add_action('wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note');
262 262
 
263 263
 /**
264 264
  * Triggers a payment note deletion without ajax
@@ -269,24 +269,24 @@  discard block
 block discarded – undo
269 269
  *
270 270
  * @return void
271 271
  */
272
-function give_trigger_payment_note_deletion( $data ) {
272
+function give_trigger_payment_note_deletion($data) {
273 273
 
274
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_delete_payment_note_' . $data['note_id'] ) ) {
274
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give_delete_payment_note_'.$data['note_id'])) {
275 275
 		return;
276 276
 	}
277 277
 
278
-	if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) {
279
-		wp_die( esc_html__( 'You do not have permission to edit payment records.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
278
+	if ( ! current_user_can('edit_give_payments', $data['payment_id'])) {
279
+		wp_die(esc_html__('You do not have permission to edit payment records.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
280 280
 	}
281 281
 
282
-	$edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id=' . absint( $data['payment_id'] ) );
282
+	$edit_order_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id='.absint($data['payment_id']));
283 283
 
284
-	give_delete_payment_note( $data['note_id'], $data['payment_id'] );
284
+	give_delete_payment_note($data['note_id'], $data['payment_id']);
285 285
 
286
-	wp_redirect( $edit_order_url );
286
+	wp_redirect($edit_order_url);
287 287
 }
288 288
 
289
-add_action( 'give_delete_payment_note', 'give_trigger_payment_note_deletion' );
289
+add_action('give_delete_payment_note', 'give_trigger_payment_note_deletion');
290 290
 
291 291
 /**
292 292
  * Delete a payment note deletion with ajax
@@ -299,16 +299,16 @@  discard block
 block discarded – undo
299 299
  */
300 300
 function give_ajax_delete_payment_note() {
301 301
 
302
-	if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) {
303
-		wp_die( esc_html__( 'You do not have permission to edit payment records.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
302
+	if ( ! current_user_can('edit_give_payments', $_POST['payment_id'])) {
303
+		wp_die(esc_html__('You do not have permission to edit payment records.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
304 304
 	}
305 305
 
306
-	if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) {
307
-		die( '1' );
306
+	if (give_delete_payment_note($_POST['note_id'], $_POST['payment_id'])) {
307
+		die('1');
308 308
 	} else {
309
-		die( '-1' );
309
+		die('-1');
310 310
 	}
311 311
 
312 312
 }
313 313
 
314
-add_action( 'wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note' );
315 314
\ No newline at end of file
315
+add_action('wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note');
316 316
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 1 patch
Spacing   +182 added lines, -182 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
 /**
@@ -120,37 +120,37 @@  discard block
 block discarded – undo
120 120
 		global $status, $page;
121 121
 
122 122
 		// Set parent defaults
123
-		parent::__construct( array(
124
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
125
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
123
+		parent::__construct(array(
124
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
125
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
126 126
 			'ajax'     => false                        // Does this table support ajax?
127
-		) );
127
+		));
128 128
 
129 129
 		$this->get_payment_counts();
130 130
 		$this->process_bulk_action();
131
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
131
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
132 132
 	}
133 133
 
134 134
 	public function advanced_filters() {
135
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
136
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
137
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
135
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
136
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
137
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
138 138
 		?>
139 139
 		<div id="give-payment-filters">
140 140
 			<span id="give-payment-date-filters">
141
-				<label for="start-date" class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>
141
+				<label for="start-date" class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label>
142 142
 				<input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>
143
-				<label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>
143
+				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label>
144 144
 				<input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>
145
-				<input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>
145
+				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/>
146 146
 			</span>
147
-			<?php if ( ! empty( $status ) ) : ?>
148
-				<input type="hidden" name="status" value="<?php esc_attr_e( $status ); ?>"/>
147
+			<?php if ( ! empty($status)) : ?>
148
+				<input type="hidden" name="status" value="<?php esc_attr_e($status); ?>"/>
149 149
 			<?php endif; ?>
150
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
151
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>
150
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
151
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a>
152 152
 			<?php endif; ?>
153
-			<?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>
153
+			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?>
154 154
 		</div>
155 155
 
156 156
 		<?php
@@ -167,25 +167,25 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @return void
169 169
 	 */
170
-	public function search_box( $text, $input_id ) {
171
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
170
+	public function search_box($text, $input_id) {
171
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
172 172
 			return;
173 173
 		}
174 174
 
175
-		$input_id = $input_id . '-search-input';
175
+		$input_id = $input_id.'-search-input';
176 176
 
177
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
178
-			echo '<input type="hidden" name="orderby" value="' . esc_attr__( $_REQUEST['orderby'] ) . '" />';
177
+		if ( ! empty($_REQUEST['orderby'])) {
178
+			echo '<input type="hidden" name="orderby" value="'.esc_attr__($_REQUEST['orderby']).'" />';
179 179
 		}
180
-		if ( ! empty( $_REQUEST['order'] ) ) {
181
-			echo '<input type="hidden" name="order" value="' . esc_attr__( $_REQUEST['order'] ) . '" />';
180
+		if ( ! empty($_REQUEST['order'])) {
181
+			echo '<input type="hidden" name="order" value="'.esc_attr__($_REQUEST['order']).'" />';
182 182
 		}
183 183
 		?>
184 184
 		<p class="search-box">
185
-			<?php do_action( 'give_payment_history_search' ); ?>
185
+			<?php do_action('give_payment_history_search'); ?>
186 186
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
187 187
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
188
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>
188
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/>
189 189
 		</p>
190 190
 		<?php
191 191
 	}
@@ -199,52 +199,52 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function get_views() {
201 201
 
202
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
203
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
204
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
205
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
206
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
207
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
208
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
209
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
210
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
202
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
203
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
204
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
205
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
206
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
207
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
208
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
209
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
210
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
211 211
 
212 212
 		$views = array(
213
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
213
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
214 214
 				'status',
215 215
 				'paged'
216
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),
217
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
216
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count),
217
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
218 218
 				'status' => 'publish',
219 219
 				'paged'  => false
220
-			) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),
221
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
220
+			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count),
221
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
222 222
 				'status' => 'pending',
223 223
 				'paged'  => false
224
-			) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),
225
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
224
+			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count),
225
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
226 226
 				'status' => 'refunded',
227 227
 				'paged'  => false
228
-			) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),
229
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
228
+			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count),
229
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
230 230
 				'status' => 'revoked',
231 231
 				'paged'  => false
232
-			) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),
233
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count),
233
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'failed',
235 235
 				'paged'  => false
236
-			) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),
237
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count),
237
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'cancelled',
239 239
 				'paged'  => false
240
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),
241
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count),
241
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'abandoned',
243 243
 				'paged'  => false
244
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count )
244
+			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count)
245 245
 		);
246 246
 
247
-		return apply_filters( 'give_payments_table_views', $views );
247
+		return apply_filters('give_payments_table_views', $views);
248 248
 	}
249 249
 
250 250
 	/**
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
 	public function get_columns() {
258 258
 		$columns = array(
259 259
 			'cb'       => '<input type="checkbox" />', //Render a checkbox instead of text
260
-			'email'    => esc_html__( 'Email', 'give' ),
261
-			'details'  => esc_html__( 'Details', 'give' ),
262
-			'amount'   => esc_html__( 'Amount', 'give' ),
263
-			'donation' => esc_html__( 'Donation', 'give' ),
264
-			'status'   => esc_html__( 'Status', 'give' ),
265
-			'date'     => esc_html__( 'Date', 'give' ),
266
-			'donor'    => esc_html__( 'Donor', 'give' ),
267
-			'ID'       => esc_html__( 'ID', 'give' ),
260
+			'email'    => esc_html__('Email', 'give'),
261
+			'details'  => esc_html__('Details', 'give'),
262
+			'amount'   => esc_html__('Amount', 'give'),
263
+			'donation' => esc_html__('Donation', 'give'),
264
+			'status'   => esc_html__('Status', 'give'),
265
+			'date'     => esc_html__('Date', 'give'),
266
+			'donor'    => esc_html__('Donor', 'give'),
267
+			'ID'       => esc_html__('ID', 'give'),
268 268
 		);
269 269
 
270
-		return apply_filters( 'give_payments_table_columns', $columns );
270
+		return apply_filters('give_payments_table_columns', $columns);
271 271
 	}
272 272
 
273 273
 	/**
@@ -279,12 +279,12 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function get_sortable_columns() {
281 281
 		$columns = array(
282
-			'ID'     => array( 'ID', true ),
283
-			'amount' => array( 'amount', false ),
284
-			'date'   => array( 'date', false )
282
+			'ID'     => array('ID', true),
283
+			'amount' => array('amount', false),
284
+			'date'   => array('date', false)
285 285
 		);
286 286
 
287
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
287
+		return apply_filters('give_payments_table_sortable_columns', $columns);
288 288
 	}
289 289
 
290 290
 	/**
@@ -310,41 +310,41 @@  discard block
 block discarded – undo
310 310
 	 *
311 311
 	 * @return string Column Name
312 312
 	 */
313
-	public function column_default( $payment, $column_name ) {
314
-		switch ( $column_name ) {
313
+	public function column_default($payment, $column_name) {
314
+		switch ($column_name) {
315 315
 			case 'amount' :
316
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
317
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
316
+				$amount = ! empty($payment->total) ? $payment->total : 0;
317
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
318 318
 				break;
319 319
 			case 'donation' :
320
-				$value = '<a href="' . get_permalink( $payment->form_id ) . '">' . $payment->form_title . '</a>';
321
-				$level = give_get_payment_form_title( $payment->meta, true );
320
+				$value = '<a href="'.get_permalink($payment->form_id).'">'.$payment->form_title.'</a>';
321
+				$level = give_get_payment_form_title($payment->meta, true);
322 322
 
323
-				if ( ! empty( $level ) ) {
323
+				if ( ! empty($level)) {
324 324
 					$value .= $level;
325 325
 				}
326 326
 
327 327
 				break;
328 328
 			case 'date' :
329
-				$date  = strtotime( $payment->date );
330
-				$value = date_i18n( get_option( 'date_format' ), $date );
329
+				$date  = strtotime($payment->date);
330
+				$value = date_i18n(get_option('date_format'), $date);
331 331
 				break;
332 332
 			case 'status' :
333
-				$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
334
-				if ( $payment->mode == 'test' ) {
335
-					$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This payment was made in test mode', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';
333
+				$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
334
+				if ($payment->mode == 'test') {
335
+					$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This payment was made in test mode', 'give').'">'.esc_html__('Test', 'give').'</span>';
336 336
 				}
337 337
 				break;
338 338
 			case 'details' :
339
-				$value = '<div class="give-payment-details-link-wrap"><a href="' . esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) ) . '" class="give-payment-details-link button button-small">' . esc_html__( 'View Details', 'give' ) . '</a></div>';
339
+				$value = '<div class="give-payment-details-link-wrap"><a href="'.esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))).'" class="give-payment-details-link button button-small">'.esc_html__('View Details', 'give').'</a></div>';
340 340
 				break;
341 341
 			default:
342
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
342
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
343 343
 				break;
344 344
 
345 345
 		}
346 346
 
347
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
347
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
348 348
 	}
349 349
 
350 350
 	/**
@@ -357,40 +357,40 @@  discard block
 block discarded – undo
357 357
 	 *
358 358
 	 * @return string Data shown in the Email column
359 359
 	 */
360
-	public function column_email( $payment ) {
360
+	public function column_email($payment) {
361 361
 
362 362
 		$row_actions = array();
363 363
 
364
-		$email = give_get_payment_user_email( $payment->ID );
364
+		$email = give_get_payment_user_email($payment->ID);
365 365
 
366 366
 		// Add search term string back to base URL
367
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
368
-		if ( ! empty( $search_terms ) ) {
369
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
367
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
368
+		if ( ! empty($search_terms)) {
369
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
370 370
 		}
371 371
 
372
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
373
-			$row_actions['email_links'] = '<a href="' . add_query_arg( array(
372
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
373
+			$row_actions['email_links'] = '<a href="'.add_query_arg(array(
374 374
 					'give-action' => 'email_links',
375 375
 					'purchase_id' => $payment->ID
376
-				), $this->base_url ) . '">' . esc_html__( 'Resend Donation Receipt', 'give' ) . '</a>';
376
+				), $this->base_url).'">'.esc_html__('Resend Donation Receipt', 'give').'</a>';
377 377
 
378 378
 		}
379 379
 
380
-		$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array(
380
+		$row_actions['delete'] = '<a href="'.wp_nonce_url(add_query_arg(array(
381 381
 				'give-action' => 'delete_payment',
382 382
 				'purchase_id' => $payment->ID
383
-			), $this->base_url ), 'give_payment_nonce' ) . '">' . esc_html__( 'Delete', 'give' ) . '</a>';
383
+			), $this->base_url), 'give_payment_nonce').'">'.esc_html__('Delete', 'give').'</a>';
384 384
 
385
-		$row_actions = apply_filters( 'give_payment_row_actions', $row_actions, $payment );
385
+		$row_actions = apply_filters('give_payment_row_actions', $row_actions, $payment);
386 386
 
387
-		if ( empty( $email ) ) {
388
-			$email = esc_html__( '(unknown)', 'give' );
387
+		if (empty($email)) {
388
+			$email = esc_html__('(unknown)', 'give');
389 389
 		}
390 390
 
391
-		$value = '<span class="give-email-column-value">' . $email . '</span>' . $this->row_actions( $row_actions );
391
+		$value = '<span class="give-email-column-value">'.$email.'</span>'.$this->row_actions($row_actions);
392 392
 
393
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
393
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
394 394
 	}
395 395
 
396 396
 	/**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 *
404 404
 	 * @return string Displays a checkbox
405 405
 	 */
406
-	public function column_cb( $payment ) {
406
+	public function column_cb($payment) {
407 407
 		return sprintf(
408 408
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
409 409
 			'payment',
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
 	 *
422 422
 	 * @return string Displays a checkbox
423 423
 	 */
424
-	public function column_ID( $payment ) {
425
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
424
+	public function column_ID($payment) {
425
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
426 426
 	}
427 427
 
428 428
 	/**
@@ -435,19 +435,19 @@  discard block
 block discarded – undo
435 435
 	 *
436 436
 	 * @return string Data shown in the User column
437 437
 	 */
438
-	public function column_donor( $payment ) {
438
+	public function column_donor($payment) {
439 439
 
440
-		$customer_id = give_get_payment_customer_id( $payment->ID );
440
+		$customer_id = give_get_payment_customer_id($payment->ID);
441 441
 
442
-		if ( ! empty( $customer_id ) ) {
443
-			$customer = new Give_Customer( $customer_id );
444
-			$value    = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';
442
+		if ( ! empty($customer_id)) {
443
+			$customer = new Give_Customer($customer_id);
444
+			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>';
445 445
 		} else {
446
-			$email = give_get_payment_user_email( $payment->ID );
447
-			$value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';
446
+			$email = give_get_payment_user_email($payment->ID);
447
+			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>';
448 448
 		}
449 449
 
450
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
450
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
451 451
 	}
452 452
 
453 453
 	/**
@@ -459,18 +459,18 @@  discard block
 block discarded – undo
459 459
 	 */
460 460
 	public function get_bulk_actions() {
461 461
 		$actions = array(
462
-			'delete'               => esc_html__( 'Delete', 'give' ),
463
-			'set-status-publish'   => esc_html__( 'Set To Completed', 'give' ),
464
-			'set-status-pending'   => esc_html__( 'Set To Pending', 'give' ),
465
-			'set-status-refunded'  => esc_html__( 'Set To Refunded', 'give' ),
466
-			'set-status-revoked'   => esc_html__( 'Set To Revoked', 'give' ),
467
-			'set-status-failed'    => esc_html__( 'Set To Failed', 'give' ),
468
-			'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),
469
-			'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),
470
-			'resend-receipt'       => esc_html__( 'Resend Email Receipts', 'give' )
462
+			'delete'               => esc_html__('Delete', 'give'),
463
+			'set-status-publish'   => esc_html__('Set To Completed', 'give'),
464
+			'set-status-pending'   => esc_html__('Set To Pending', 'give'),
465
+			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'),
466
+			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'),
467
+			'set-status-failed'    => esc_html__('Set To Failed', 'give'),
468
+			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'),
469
+			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'),
470
+			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give')
471 471
 		);
472 472
 
473
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
473
+		return apply_filters('give_payments_table_bulk_actions', $actions);
474 474
 	}
475 475
 
476 476
 	/**
@@ -481,61 +481,61 @@  discard block
 block discarded – undo
481 481
 	 * @return void
482 482
 	 */
483 483
 	public function process_bulk_action() {
484
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
484
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
485 485
 		$action = $this->current_action();
486 486
 
487
-		if ( ! is_array( $ids ) ) {
488
-			$ids = array( $ids );
487
+		if ( ! is_array($ids)) {
488
+			$ids = array($ids);
489 489
 		}
490 490
 
491
-		if ( empty( $action ) ) {
491
+		if (empty($action)) {
492 492
 			return;
493 493
 		}
494 494
 
495
-		foreach ( $ids as $id ) {
495
+		foreach ($ids as $id) {
496 496
 
497 497
 			// Detect when a bulk action is being triggered...
498
-			if ( 'delete' === $this->current_action() ) {
499
-				give_delete_purchase( $id );
498
+			if ('delete' === $this->current_action()) {
499
+				give_delete_purchase($id);
500 500
 			}
501 501
 
502
-			if ( 'set-status-publish' === $this->current_action() ) {
503
-				give_update_payment_status( $id, 'publish' );
502
+			if ('set-status-publish' === $this->current_action()) {
503
+				give_update_payment_status($id, 'publish');
504 504
 			}
505 505
 
506
-			if ( 'set-status-pending' === $this->current_action() ) {
507
-				give_update_payment_status( $id, 'pending' );
506
+			if ('set-status-pending' === $this->current_action()) {
507
+				give_update_payment_status($id, 'pending');
508 508
 			}
509 509
 
510
-			if ( 'set-status-refunded' === $this->current_action() ) {
511
-				give_update_payment_status( $id, 'refunded' );
510
+			if ('set-status-refunded' === $this->current_action()) {
511
+				give_update_payment_status($id, 'refunded');
512 512
 			}
513 513
 
514
-			if ( 'set-status-revoked' === $this->current_action() ) {
515
-				give_update_payment_status( $id, 'revoked' );
514
+			if ('set-status-revoked' === $this->current_action()) {
515
+				give_update_payment_status($id, 'revoked');
516 516
 			}
517 517
 
518
-			if ( 'set-status-failed' === $this->current_action() ) {
519
-				give_update_payment_status( $id, 'failed' );
518
+			if ('set-status-failed' === $this->current_action()) {
519
+				give_update_payment_status($id, 'failed');
520 520
 			}
521 521
 
522
-			if ( 'set-status-cancelled' === $this->current_action() ) {
523
-				give_update_payment_status( $id, 'cancelled' );
522
+			if ('set-status-cancelled' === $this->current_action()) {
523
+				give_update_payment_status($id, 'cancelled');
524 524
 			}
525 525
 
526
-			if ( 'set-status-abandoned' === $this->current_action() ) {
527
-				give_update_payment_status( $id, 'abandoned' );
526
+			if ('set-status-abandoned' === $this->current_action()) {
527
+				give_update_payment_status($id, 'abandoned');
528 528
 			}
529 529
 
530
-			if ( 'set-status-preapproval' === $this->current_action() ) {
531
-				give_update_payment_status( $id, 'preapproval' );
530
+			if ('set-status-preapproval' === $this->current_action()) {
531
+				give_update_payment_status($id, 'preapproval');
532 532
 			}
533 533
 
534
-			if ( 'resend-receipt' === $this->current_action() ) {
535
-				give_email_donation_receipt( $id, false );
534
+			if ('resend-receipt' === $this->current_action()) {
535
+				give_email_donation_receipt($id, false);
536 536
 			}
537 537
 
538
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
538
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
539 539
 		}
540 540
 
541 541
 	}
@@ -553,27 +553,27 @@  discard block
 block discarded – undo
553 553
 
554 554
 		$args = array();
555 555
 
556
-		if ( isset( $_GET['user'] ) ) {
557
-			$args['user'] = urldecode( $_GET['user'] );
558
-		} elseif ( isset( $_GET['s'] ) ) {
559
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
560
-			if ( $is_user ) {
561
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
562
-				unset( $args['s'] );
556
+		if (isset($_GET['user'])) {
557
+			$args['user'] = urldecode($_GET['user']);
558
+		} elseif (isset($_GET['s'])) {
559
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
560
+			if ($is_user) {
561
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
562
+				unset($args['s']);
563 563
 			} else {
564
-				$args['s'] = sanitize_text_field( $_GET['s'] );
564
+				$args['s'] = sanitize_text_field($_GET['s']);
565 565
 			}
566 566
 		}
567 567
 
568
-		if ( ! empty( $_GET['start-date'] ) ) {
569
-			$args['start-date'] = urldecode( $_GET['start-date'] );
568
+		if ( ! empty($_GET['start-date'])) {
569
+			$args['start-date'] = urldecode($_GET['start-date']);
570 570
 		}
571 571
 
572
-		if ( ! empty( $_GET['end-date'] ) ) {
573
-			$args['end-date'] = urldecode( $_GET['end-date'] );
572
+		if ( ! empty($_GET['end-date'])) {
573
+			$args['end-date'] = urldecode($_GET['end-date']);
574 574
 		}
575 575
 
576
-		$payment_count         = give_count_payments( $args );
576
+		$payment_count         = give_count_payments($args);
577 577
 		$this->complete_count  = $payment_count->publish;
578 578
 		$this->pending_count   = $payment_count->pending;
579 579
 		$this->refunded_count  = $payment_count->refunded;
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		$this->cancelled_count = $payment_count->cancelled;
583 583
 		$this->abandoned_count = $payment_count->abandoned;
584 584
 
585
-		foreach ( $payment_count as $count ) {
585
+		foreach ($payment_count as $count) {
586 586
 			$this->total_count += $count;
587 587
 		}
588 588
 	}
@@ -597,26 +597,26 @@  discard block
 block discarded – undo
597 597
 	public function payments_data() {
598 598
 
599 599
 		$per_page   = $this->per_page;
600
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
601
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
602
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
603
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
604
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
605
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
606
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
607
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
608
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
609
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
610
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
611
-
612
-		if ( ! empty( $search ) ) {
600
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
601
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
602
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
603
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
604
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
605
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
606
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
607
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
608
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
609
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
610
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
611
+
612
+		if ( ! empty($search)) {
613 613
 			$status = 'any'; // Force all payment statuses when searching
614 614
 		}
615 615
 
616 616
 		$args = array(
617 617
 			'output'     => 'payments',
618 618
 			'number'     => $per_page,
619
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
619
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
620 620
 			'orderby'    => $orderby,
621 621
 			'order'      => $order,
622 622
 			'user'       => $user,
@@ -630,14 +630,14 @@  discard block
 block discarded – undo
630 630
 			'end_date'   => $end_date,
631 631
 		);
632 632
 
633
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
633
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
634 634
 
635 635
 			$args['search_in_notes'] = true;
636
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
636
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
637 637
 
638 638
 		}
639 639
 
640
-		$p_query = new Give_Payments_Query( $args );
640
+		$p_query = new Give_Payments_Query($args);
641 641
 
642 642
 		return $p_query->get_payments();
643 643
 
@@ -657,17 +657,17 @@  discard block
 block discarded – undo
657 657
 	 */
658 658
 	public function prepare_items() {
659 659
 
660
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
660
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
661 661
 
662 662
 		$columns  = $this->get_columns();
663 663
 		$hidden   = array(); // No hidden columns
664 664
 		$sortable = $this->get_sortable_columns();
665 665
 		$data     = $this->payments_data();
666
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
666
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
667 667
 
668
-		$this->_column_headers = array( $columns, $hidden, $sortable );
668
+		$this->_column_headers = array($columns, $hidden, $sortable);
669 669
 
670
-		switch ( $status ) {
670
+		switch ($status) {
671 671
 			case 'publish':
672 672
 				$total_items = $this->complete_count;
673 673
 				break;
@@ -694,18 +694,18 @@  discard block
 block discarded – undo
694 694
 				break;
695 695
 			default:
696 696
 				// Retrieve the count of the non-default-Give status
697
-				$count       = wp_count_posts( 'give_payment' );
697
+				$count       = wp_count_posts('give_payment');
698 698
 				$total_items = $count->{$status};
699 699
 		}
700 700
 
701 701
 		$this->items = $data;
702 702
 
703
-		$this->set_pagination_args( array(
703
+		$this->set_pagination_args(array(
704 704
 				'total_items' => $total_items,
705 705
 				// WE have to calculate the total number of items
706 706
 				'per_page'    => $this->per_page,
707 707
 				// WE have to determine how many items to show on a page
708
-				'total_pages' => ceil( $total_items / $this->per_page )
708
+				'total_pages' => ceil($total_items / $this->per_page)
709 709
 				// WE have to calculate the total number of pages
710 710
 			)
711 711
 		);
Please login to merge, or discard this patch.
includes/admin/add-ons.php 1 patch
Spacing   +12 added lines, -12 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
 
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 function give_add_ons_page() {
26 26
 	ob_start(); ?>
27 27
 	<div class="wrap" id="give-add-ons">
28
-		<h2><?php esc_html_e( 'Give Add-ons', 'give' ); ?>
29
-			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php esc_attr_e( 'Browse All Add-ons', 'give' ); ?>" target="_blank"><?php esc_html_e( 'View All Add-ons', 'give' ); ?>
28
+		<h2><?php esc_html_e('Give Add-ons', 'give'); ?>
29
+			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php esc_attr_e('Browse All Add-ons', 'give'); ?>" target="_blank"><?php esc_html_e('View All Add-ons', 'give'); ?>
30 30
 				<span class="dashicons dashicons-external"></span></a>
31 31
 		</h2>
32 32
 
33
-		<p><?php esc_html_e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p>
33
+		<p><?php esc_html_e('The following Add-ons extend the functionality of Give.', 'give'); ?></p>
34 34
 		<?php echo give_add_ons_get_feed(); ?>
35 35
 	</div>
36 36
 	<?php
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 function give_add_ons_get_feed() {
49 49
 
50 50
 	$addons_debug = false; //set to true to debug
51
-	$cache        = get_transient( 'give_add_ons_feed' );
51
+	$cache        = get_transient('give_add_ons_feed');
52 52
 
53
-	if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) {
54
-		$feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) );
53
+	if ($cache === false || $addons_debug === true && WP_DEBUG === true) {
54
+		$feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false));
55 55
 
56
-		if ( ! is_wp_error( $feed ) ) {
57
-			if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
58
-				$cache = wp_remote_retrieve_body( $feed );
59
-				set_transient( 'give_add_ons_feed', $cache, 3600 );
56
+		if ( ! is_wp_error($feed)) {
57
+			if (isset($feed['body']) && strlen($feed['body']) > 0) {
58
+				$cache = wp_remote_retrieve_body($feed);
59
+				set_transient('give_add_ons_feed', $cache, 3600);
60 60
 			}
61 61
 		} else {
62
-			$cache = '<div class="error"><p>' . esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>';
62
+			$cache = '<div class="error"><p>'.esc_html__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>';
63 63
 		}
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
includes/admin/dashboard-widgets.php 1 patch
Spacing   +33 added lines, -33 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
 
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
  * @return void
22 22
  */
23 23
 function give_register_dashboard_widgets() {
24
-	if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
25
-		wp_add_dashboard_widget( 'give_dashboard_sales', esc_html__( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' );
24
+	if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
25
+		wp_add_dashboard_widget('give_dashboard_sales', esc_html__('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget');
26 26
 	}
27 27
 }
28 28
 
29
-add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 );
29
+add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10);
30 30
 
31 31
 /**
32 32
  * Sales Summary Dashboard Widget
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
  */
39 39
 function give_dashboard_sales_widget() {
40 40
 
41
-	if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
41
+	if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
42 42
 		return;
43 43
 	}
44 44
 	$stats = new Give_Payment_Stats; ?>
@@ -46,25 +46,25 @@  discard block
 block discarded – undo
46 46
 	<div class="give-dashboard-widget">
47 47
 
48 48
 		<div class="give-dashboard-today give-clearfix">
49
-			<h3 class="give-dashboard-date-today"><?php echo date( 'F j, Y' ); ?></h3>
49
+			<h3 class="give-dashboard-date-today"><?php echo date('F j, Y'); ?></h3>
50 50
 
51 51
 			<p class="give-dashboard-happy-day"><?php
52 52
 				printf(
53 53
 					/* translators: %s: day of the week */
54
-					esc_html__( 'Happy %s!', 'give' ),
55
-					date( 'l', current_time( 'timestamp' ) )
54
+					esc_html__('Happy %s!', 'give'),
55
+					date('l', current_time('timestamp'))
56 56
 				);
57 57
 			?></p>
58 58
 
59
-			<?php $earnings_today = $stats->get_earnings( 0, 'today', false ); ?>
59
+			<?php $earnings_today = $stats->get_earnings(0, 'today', false); ?>
60 60
 
61
-			<p class="give-dashboard-today-earnings"><?php echo give_currency_filter( give_format_amount( $earnings_today ) ); ?></p>
61
+			<p class="give-dashboard-today-earnings"><?php echo give_currency_filter(give_format_amount($earnings_today)); ?></p>
62 62
 
63
-			<p class="give-orders-today"><?php $donations_today = $stats->get_sales( 0, 'today', false, array(
63
+			<p class="give-orders-today"><?php $donations_today = $stats->get_sales(0, 'today', false, array(
64 64
 					'publish',
65 65
 					'revoked'
66
-				) ); ?><?php echo give_format_amount( $donations_today, false ); ?>
67
-				<span><?php echo _x( 'donations today', 'Displays in WP admin dashboard widget after the day\'s total donations', 'give' ); ?></span>
66
+				)); ?><?php echo give_format_amount($donations_today, false); ?>
67
+				<span><?php echo _x('donations today', 'Displays in WP admin dashboard widget after the day\'s total donations', 'give'); ?></span>
68 68
 			</p>
69 69
 
70 70
 
@@ -74,34 +74,34 @@  discard block
 block discarded – undo
74 74
 		<table class="give-table-stats">
75 75
 			<thead style="display: none;">
76 76
 			<tr>
77
-				<th><?php esc_html_e( 'This Week', 'give' ); ?></th>
78
-				<th><?php esc_html_e( 'This Month', 'give' ); ?></th>
79
-				<th><?php esc_html_e( 'Past 30 Days', 'give' ); ?></th>
77
+				<th><?php esc_html_e('This Week', 'give'); ?></th>
78
+				<th><?php esc_html_e('This Month', 'give'); ?></th>
79
+				<th><?php esc_html_e('Past 30 Days', 'give'); ?></th>
80 80
 			</tr>
81 81
 			</thead>
82 82
 			<tbody>
83 83
 			<tr id="give-table-stats-tr-1">
84 84
 				<td>
85
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ) ) ); ?></p>
85
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'))); ?></p>
86 86
 
87
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'this week', 'give' ); ?></p>
87
+					<p class="give-dashboard-stat-total-label"><?php esc_html_e('this week', 'give'); ?></p>
88 88
 				</td>
89 89
 				<td>
90
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ) ) ); ?></p>
90
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'))); ?></p>
91 91
 
92
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'this month', 'give' ); ?></p>
92
+					<p class="give-dashboard-stat-total-label"><?php esc_html_e('this month', 'give'); ?></p>
93 93
 				</td>
94 94
 			</tr>
95 95
 			<tr id="give-table-stats-tr-2">
96 96
 				<td>
97
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ) ) ) ?></p>
97
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'))) ?></p>
98 98
 
99
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'last month', 'give' ); ?></p>
99
+					<p class="give-dashboard-stat-total-label"><?php esc_html_e('last month', 'give'); ?></p>
100 100
 				</td>
101 101
 				<td>
102
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_year', false ) ) ) ?></p>
102
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false))) ?></p>
103 103
 
104
-					<p class="give-dashboard-stat-total-label"><?php esc_html_e( 'this year', 'give' ); ?></p>
104
+					<p class="give-dashboard-stat-total-label"><?php esc_html_e('this year', 'give'); ?></p>
105 105
 				</td>
106 106
 			</tr>
107 107
 			</tbody>
@@ -121,25 +121,25 @@  discard block
 block discarded – undo
121 121
  *
122 122
  * @return array
123 123
  */
124
-function give_dashboard_at_a_glance_widget( $items ) {
125
-	$num_posts = wp_count_posts( 'give_forms' );
124
+function give_dashboard_at_a_glance_widget($items) {
125
+	$num_posts = wp_count_posts('give_forms');
126 126
 
127
-	if ( $num_posts && $num_posts->publish ) {
127
+	if ($num_posts && $num_posts->publish) {
128 128
         
129 129
 		$text = sprintf(
130 130
 			/* translators: 1: number of posts published 2: forms singular label 3: forms plural label */
131
-			_n( '%1$s Give %2$s', '%1$s Give %3$s', $num_posts->publish, 'give' ),
131
+			_n('%1$s Give %2$s', '%1$s Give %3$s', $num_posts->publish, 'give'),
132 132
 			$num_posts->publish,
133 133
 			give_get_forms_label_singular(),
134 134
 			give_get_forms_label_plural()
135 135
 		);
136 136
 
137
-		$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
137
+		$text = sprintf($text, number_format_i18n($num_posts->publish));
138 138
 
139
-		if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
140
-			$text = sprintf( '<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text );
139
+		if (current_user_can('edit_give_forms', get_current_user_id())) {
140
+			$text = sprintf('<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text);
141 141
 		} else {
142
-			$text = sprintf( '<span class="give-forms-count">%1$s</span>', $text );
142
+			$text = sprintf('<span class="give-forms-count">%1$s</span>', $text);
143 143
 		}
144 144
 
145 145
 		$items[] = $text;
@@ -148,4 +148,4 @@  discard block
 block discarded – undo
148 148
 	return $items;
149 149
 }
150 150
 
151
-add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1);
151
+add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1);
Please login to merge, or discard this patch.
includes/admin/customers/customers.php 1 patch
Spacing   +142 added lines, -142 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,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_customers_page() {
26 26
 	$default_views  = give_customer_views();
27
-	$requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'customers';
28
-	if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) {
29
-		give_render_customer_view( $requested_view, $default_views );
27
+	$requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'customers';
28
+	if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) {
29
+		give_render_customer_view($requested_view, $default_views);
30 30
 	} else {
31 31
 		give_customers_list();
32 32
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	$views = array();
44 44
 
45
-	return apply_filters( 'give_customer_views', $views );
45
+	return apply_filters('give_customer_views', $views);
46 46
 
47 47
 }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	$tabs = array();
58 58
 
59
-	return apply_filters( 'give_customer_tabs', $tabs );
59
+	return apply_filters('give_customer_tabs', $tabs);
60 60
 
61 61
 }
62 62
 
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
  * @return void
68 68
  */
69 69
 function give_customers_list() {
70
-	include( dirname( __FILE__ ) . '/class-customer-table.php' );
70
+	include(dirname(__FILE__).'/class-customer-table.php');
71 71
 
72 72
 	$customers_table = new Give_Customer_Reports_Table();
73 73
 	$customers_table->prepare_items();
74 74
 	?>
75 75
 	<div class="wrap">
76
-		<h2><?php esc_html_e( 'Donors', 'give' ); ?></h2>
77
-		<?php do_action( 'give_donors_table_top' ); ?>
78
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>">
76
+		<h2><?php esc_html_e('Donors', 'give'); ?></h2>
77
+		<?php do_action('give_donors_table_top'); ?>
78
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>">
79 79
 			<?php
80
-			$customers_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' );
80
+			$customers_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors');
81 81
 			$customers_table->display();
82 82
 			?>
83 83
 			<input type="hidden" name="post_type" value="give_forms" />
84 84
 			<input type="hidden" name="page" value="give-donors" />
85 85
 			<input type="hidden" name="view" value="customers" />
86 86
 		</form>
87
-		<?php do_action( 'give_donors_table_bottom' ); ?>
87
+		<?php do_action('give_donors_table_bottom'); ?>
88 88
 	</div>
89 89
 	<?php
90 90
 }
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
  *
100 100
  * @return void
101 101
  */
102
-function give_render_customer_view( $view, $callbacks ) {
102
+function give_render_customer_view($view, $callbacks) {
103 103
 
104 104
 	$render = true;
105 105
 
106
-	$customer_view_role = apply_filters( 'give_view_customers_role', 'view_give_reports' );
106
+	$customer_view_role = apply_filters('give_view_customers_role', 'view_give_reports');
107 107
 
108
-	if ( ! current_user_can( $customer_view_role ) ) {
109
-		give_set_error( 'give-no-access', esc_html__( 'You are not permitted to view this data.', 'give' ) );
108
+	if ( ! current_user_can($customer_view_role)) {
109
+		give_set_error('give-no-access', esc_html__('You are not permitted to view this data.', 'give'));
110 110
 		$render = false;
111 111
 	}
112 112
  
113
-	if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
114
-		give_set_error( 'give-invalid_customer', esc_html__( 'Invalid Donor ID Provided.', 'give' ) );
113
+	if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
114
+		give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID Provided.', 'give'));
115 115
 		$render = false;
116 116
 	}
117 117
 
118 118
 	$customer_id = (int) $_GET['id'];
119
-	$customer    = new Give_Customer( $customer_id );
119
+	$customer    = new Give_Customer($customer_id);
120 120
 
121
-	if ( empty( $customer->id ) ) {
122
-		give_set_error( 'give-invalid_customer', esc_html__( 'Invalid Donor ID Provided.', 'give' ) );
121
+	if (empty($customer->id)) {
122
+		give_set_error('give-invalid_customer', esc_html__('Invalid Donor ID Provided.', 'give'));
123 123
 		$render = false;
124 124
 	}
125 125
 
@@ -128,27 +128,27 @@  discard block
 block discarded – undo
128 128
 
129 129
 	<div class='wrap'>
130 130
 
131
-		<?php if ( give_get_errors() ) : ?>
131
+		<?php if (give_get_errors()) : ?>
132 132
 			<div class="error settings-error">
133
-				<?php give_print_errors( 0 ); ?>
133
+				<?php give_print_errors(0); ?>
134 134
 			</div>
135 135
 		<?php endif; ?>
136 136
 
137
-		<?php if ( $customer && $render ) : ?>
137
+		<?php if ($customer && $render) : ?>
138 138
 
139 139
 			<div id="customer-tab-wrapper">
140 140
 				<ul id="customer-tab-wrapper-list" class="nav-tab-wrapper">
141
-					<?php foreach ( $customer_tabs as $key => $tab ) : ?>
141
+					<?php foreach ($customer_tabs as $key => $tab) : ?>
142 142
 						<?php $active = $key === $view ? true : false; ?>
143 143
 						<?php $class = $active ? 'active' : 'inactive'; ?>
144 144
 
145
-						<li class="<?php echo sanitize_html_class( $class ); ?>">
146
-							<?php if ( ! $active ) : ?>
147
-							<a title="<?php esc_attr_e( $tab['title'] ); ?>" aria-label="<?php esc_attr_e( $tab['title'] ); ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $customer->id ) ); ?>">
145
+						<li class="<?php echo sanitize_html_class($class); ?>">
146
+							<?php if ( ! $active) : ?>
147
+							<a title="<?php esc_attr_e($tab['title']); ?>" aria-label="<?php esc_attr_e($tab['title']); ?>" href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$customer->id)); ?>">
148 148
 								<?php endif; ?>
149 149
 
150
-								<span class="dashicons <?php echo sanitize_html_class( $tab['dashicon'] ); ?>"></span> <?php esc_html_e( $tab['title'] ); ?>
151
-								<?php if ( ! $active ) : ?>
150
+								<span class="dashicons <?php echo sanitize_html_class($tab['dashicon']); ?>"></span> <?php esc_html_e($tab['title']); ?>
151
+								<?php if ( ! $active) : ?>
152 152
 							</a>
153 153
 						<?php endif; ?>
154 154
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			</div>
161 161
 
162 162
 			<div id="give-customer-card-wrapper">
163
-				<?php $callbacks[ $view ]( $customer ) ?>
163
+				<?php $callbacks[$view]($customer) ?>
164 164
 			</div>
165 165
 
166 166
 		<?php endif; ?>
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
  *
181 181
  * @return void
182 182
  */
183
-function give_customers_view( $customer ) {
183
+function give_customers_view($customer) {
184 184
 
185
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
185
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
186 186
 
187 187
 	?>
188 188
 
189
-	<?php do_action( 'give_donor_card_top', $customer ); ?>
189
+	<?php do_action('give_donor_card_top', $customer); ?>
190 190
 
191 191
 	<div id="donor-summary" class="info-wrapper customer-section postbox">
192 192
 
193
-		<form id="edit-customer-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>">
193
+		<form id="edit-customer-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>">
194 194
 
195 195
 			<div class="customer-info">
196 196
 
@@ -198,22 +198,22 @@  discard block
 block discarded – undo
198 198
 				<div class="donor-bio-header clearfix">
199 199
 
200 200
 					<div class="avatar-wrap left" id="customer-avatar">
201
-						<?php echo get_avatar( $customer->email ); ?>
201
+						<?php echo get_avatar($customer->email); ?>
202 202
 					</div>
203 203
 
204 204
 					<div class="customer-id" class="left">
205 205
 						#<?php echo $customer->id; ?>
206 206
 					</div>
207 207
 					<div id="customer-name-wrap" class="left">
208
-						<span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e( $customer->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span>
208
+						<span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e($customer->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span>
209 209
 						<span class="customer-name info-item editable"><span data-key="name"><?php echo $customer->name; ?></span></span>
210 210
 					</div>
211 211
 					<p class="customer-since info-item">
212
-						<?php esc_html_e( 'Donor since', 'give' ); ?>
213
-						<?php echo date_i18n( get_option( 'date_format' ), strtotime( $customer->date_created ) ) ?>
212
+						<?php esc_html_e('Donor since', 'give'); ?>
213
+						<?php echo date_i18n(get_option('date_format'), strtotime($customer->date_created)) ?>
214 214
 					</p>
215
-					<?php if ( current_user_can( $customer_edit_role ) ): ?>
216
-						<a title="<?php esc_attr_e( 'Edit Donor', 'give' ); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a>
215
+					<?php if (current_user_can($customer_edit_role)): ?>
216
+						<a title="<?php esc_attr_e('Edit Donor', 'give'); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a>
217 217
 					<?php endif; ?>
218 218
 				</div>
219 219
 				<!-- /donor-bio-header -->
@@ -223,14 +223,14 @@  discard block
 block discarded – undo
223 223
 					<table class="widefat">
224 224
 						<tbody>
225 225
 						<tr>
226
-							<td><label for="tablecell"><?php esc_html_e( 'Email', 'give' ); ?></label>:</td>
226
+							<td><label for="tablecell"><?php esc_html_e('Email', 'give'); ?></label>:</td>
227 227
 							<td class="row-title">
228
-								<span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e( 'Donor Email', 'give' ); ?>" /></span>
228
+								<span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e('Donor Email', 'give'); ?>" /></span>
229 229
 								<span class="customer-email info-item editable" data-key="email"><?php echo $customer->email; ?></span>
230 230
 							</td>
231 231
 						</tr>
232 232
 						<tr class="alternate">
233
-							<td><label for="tablecell"><?php esc_html_e( 'User ID', 'give' ); ?></label>:</td>
233
+							<td><label for="tablecell"><?php esc_html_e('User ID', 'give'); ?></label>:</td>
234 234
 							<td class="row-title">
235 235
 								<span class="customer-user-id info-item edit-item">
236 236
 									<?php
@@ -246,38 +246,38 @@  discard block
 block discarded – undo
246 246
 										'data'  => $data_atts,
247 247
 									);
248 248
 
249
-									if ( ! empty( $user_id ) ) {
250
-										$userdata           = get_userdata( $user_id );
249
+									if ( ! empty($user_id)) {
250
+										$userdata           = get_userdata($user_id);
251 251
 										$user_args['value'] = $userdata->user_login;
252 252
 									}
253 253
 
254
-									echo Give()->html->ajax_user_search( $user_args );
254
+									echo Give()->html->ajax_user_search($user_args);
255 255
 									?>
256 256
 									<input type="hidden" name="customerinfo[user_id]" data-key="user_id" value="<?php echo $customer->user_id; ?>" />
257 257
 								</span>
258 258
 			
259 259
 								<span class="customer-user-id info-item editable">
260
-									<?php if ( intval( $customer->user_id ) > 0 ) : ?>
260
+									<?php if (intval($customer->user_id) > 0) : ?>
261 261
 										<span data-key="user_id"><?php echo $customer->user_id; ?></span>
262 262
 									<?php else : ?>
263
-										<span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span>
263
+										<span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span>
264 264
 									<?php endif; ?>
265
-									<?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) : ?>
266
-										<span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e( 'Disconnects the current user ID from this customer record', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span>
265
+									<?php if (current_user_can($customer_edit_role) && intval($customer->user_id) > 0) : ?>
266
+										<span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e('Disconnects the current user ID from this customer record', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span>
267 267
 									<?php endif; ?>
268 268
 								</span>
269 269
 							</td>
270 270
 						</tr>
271
-						<?php if ( isset( $customer->user_id ) && $customer->user_id > 0 ) : ?>
271
+						<?php if (isset($customer->user_id) && $customer->user_id > 0) : ?>
272 272
 
273 273
 							<tr>
274
-								<td><?php esc_html_e( 'Address', 'give' ); ?>:</td>
274
+								<td><?php esc_html_e('Address', 'give'); ?>:</td>
275 275
 								<td class="row-title">
276 276
 
277 277
 									<div class="customer-address-wrapper">
278 278
 
279 279
 										<?php
280
-										$address  = get_user_meta( $customer->user_id, '_give_user_address', true );
280
+										$address  = get_user_meta($customer->user_id, '_give_user_address', true);
281 281
 										$defaults = array(
282 282
 											'line1'   => '',
283 283
 											'line2'   => '',
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 											'zip'     => ''
288 288
 										);
289 289
 
290
-										$address = wp_parse_args( $address, $defaults );
290
+										$address = wp_parse_args($address, $defaults);
291 291
 										?>
292 292
 
293
-										<?php if ( ! empty( $address ) ) { ?>
293
+										<?php if ( ! empty($address)) { ?>
294 294
 											<span class="customer-address info-item editable">
295 295
 												<span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span>
296 296
 												<span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span>
@@ -301,38 +301,38 @@  discard block
 block discarded – undo
301 301
 											</span>
302 302
 										<?php } ?>
303 303
 										<span class="customer-address info-item edit-item">
304
-											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" />
305
-											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" />
306
-											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" />
304
+											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" />
305
+											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" />
306
+											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" />
307 307
 											<select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item">
308 308
 												<?php
309 309
 
310 310
 												$selected_country = $address['country'];
311 311
 
312 312
 												$countries = give_get_country_list();
313
-												foreach ( $countries as $country_code => $country ) {
314
-													echo '<option value="' . esc_attr__( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
313
+												foreach ($countries as $country_code => $country) {
314
+													echo '<option value="'.esc_attr__($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
315 315
 												}
316 316
 												?>
317 317
 											</select>
318 318
 											<?php
319 319
 											$selected_state = give_get_state();
320
-											$states         = give_get_states( $selected_country );
320
+											$states         = give_get_states($selected_country);
321 321
 
322
-											$selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state;
322
+											$selected_state = isset($address['state']) ? $address['state'] : $selected_state;
323 323
 
324
-											if ( ! empty( $states ) ) : ?>
324
+											if ( ! empty($states)) : ?>
325 325
 												<select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item">
326 326
 													<?php
327
-													foreach ( $states as $state_code => $state ) {
328
-														echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
327
+													foreach ($states as $state_code => $state) {
328
+														echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
329 329
 													}
330 330
 													?>
331 331
 												</select>
332 332
 											<?php else : ?>
333
-												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>" />
333
+												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province', 'give'); ?>" />
334 334
 											<?php endif; ?>
335
-											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Postal', 'give' ); ?>" value="<?php echo $address['zip']; ?>" />
335
+											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Postal', 'give'); ?>" value="<?php echo $address['zip']; ?>" />
336 336
 													</span>
337 337
 
338 338
 									</div>
@@ -350,112 +350,112 @@  discard block
 block discarded – undo
350 350
 
351 351
 			<span id="customer-edit-actions" class="edit-item">
352 352
 				<input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $customer->id; ?>" />
353
-				<?php wp_nonce_field( 'edit-customer', '_wpnonce', false, true ); ?>
353
+				<?php wp_nonce_field('edit-customer', '_wpnonce', false, true); ?>
354 354
 				<input type="hidden" name="give_action" value="edit-customer" />
355
-				<input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" />
356
-				<a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
355
+				<input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" />
356
+				<a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a>
357 357
 			</span>
358 358
 
359 359
 		</form>
360 360
 	</div>
361 361
 
362
-	<?php do_action( 'give_donor_before_stats', $customer ); ?>
362
+	<?php do_action('give_donor_before_stats', $customer); ?>
363 363
 
364 364
 	<div id="customer-stats-wrapper" class="customer-section postbox clear">
365 365
 		<ul>
366 366
 			<li>
367
-				<a title="<?php esc_attr_e( 'View All Donations', 'give' ); ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $customer->email ) ); ?>">
367
+				<a title="<?php esc_attr_e('View All Donations', 'give'); ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($customer->email)); ?>">
368 368
 					<span class="dashicons dashicons-heart"></span>
369 369
 					<?php
370 370
 					//Completed Donations
371
-					$completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give' ), $customer->purchase_count );
372
-					echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $customer );
371
+					$completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give'), $customer->purchase_count);
372
+					echo apply_filters('give_donor_completed_donations', $completed_donations_text, $customer);
373 373
 					?>
374 374
 				</a>
375 375
 			</li>
376 376
 			<li>
377 377
 				<span class="dashicons dashicons-chart-area"></span>
378
-				<?php echo give_currency_filter( give_format_amount( $customer->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?>
378
+				<?php echo give_currency_filter(give_format_amount($customer->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?>
379 379
 			</li>
380
-			<?php do_action( 'give_donor_stats_list', $customer ); ?>
380
+			<?php do_action('give_donor_stats_list', $customer); ?>
381 381
 		</ul>
382 382
 	</div>
383 383
 
384
-	<?php do_action( 'give_donor_before_tables_wrapper', $customer ); ?>
384
+	<?php do_action('give_donor_before_tables_wrapper', $customer); ?>
385 385
 
386 386
 	<div id="customer-tables-wrapper" class="customer-section">
387 387
 
388
-		<?php do_action( 'give_donor_before_tables', $customer ); ?>
388
+		<?php do_action('give_donor_before_tables', $customer); ?>
389 389
 
390
-		<h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3>
390
+		<h3><?php esc_html_e('Recent Donations', 'give'); ?></h3>
391 391
 		<?php
392
-		$payment_ids = explode( ',', $customer->payment_ids );
393
-		$payments    = give_get_payments( array( 'post__in' => $payment_ids ) );
394
-		$payments    = array_slice( $payments, 0, 10 );
392
+		$payment_ids = explode(',', $customer->payment_ids);
393
+		$payments    = give_get_payments(array('post__in' => $payment_ids));
394
+		$payments    = array_slice($payments, 0, 10);
395 395
 		?>
396 396
 		<table class="wp-list-table widefat striped payments">
397 397
 			<thead>
398 398
 			<tr>
399
-				<th><?php esc_html_e( 'ID', 'give' ); ?></th>
400
-				<th><?php esc_html_e( 'Amount', 'give' ); ?></th>
401
-				<th><?php esc_html_e( 'Date', 'give' ); ?></th>
402
-				<th><?php esc_html_e( 'Status', 'give' ); ?></th>
403
-				<th><?php esc_html_e( 'Actions', 'give' ); ?></th>
399
+				<th><?php esc_html_e('ID', 'give'); ?></th>
400
+				<th><?php esc_html_e('Amount', 'give'); ?></th>
401
+				<th><?php esc_html_e('Date', 'give'); ?></th>
402
+				<th><?php esc_html_e('Status', 'give'); ?></th>
403
+				<th><?php esc_html_e('Actions', 'give'); ?></th>
404 404
 			</tr>
405 405
 			</thead>
406 406
 			<tbody>
407
-			<?php if ( ! empty( $payments ) ) : ?>
408
-				<?php foreach ( $payments as $payment ) : ?>
407
+			<?php if ( ! empty($payments)) : ?>
408
+				<?php foreach ($payments as $payment) : ?>
409 409
 					<tr>
410 410
 						<td><?php echo $payment->ID; ?></td>
411
-						<td><?php echo give_payment_amount( $payment->ID ); ?></td>
412
-						<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->post_date ) ); ?></td>
413
-						<td><?php echo give_get_payment_status( $payment, true ); ?></td>
411
+						<td><?php echo give_payment_amount($payment->ID); ?></td>
412
+						<td><?php echo date_i18n(get_option('date_format'), strtotime($payment->post_date)); ?></td>
413
+						<td><?php echo give_get_payment_status($payment, true); ?></td>
414 414
 						<td>
415
-							<a title="<?php esc_attr_e( 'View Details for Donation', 'give' );
416
-							echo ' ' . $payment->ID; ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment->ID ); ?>">
417
-								<?php esc_html_e( 'View Details', 'give' ); ?>
415
+							<a title="<?php esc_attr_e('View Details for Donation', 'give');
416
+							echo ' '.$payment->ID; ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment->ID); ?>">
417
+								<?php esc_html_e('View Details', 'give'); ?>
418 418
 							</a>
419
-							<?php do_action( 'give_donor_recent_purchases_actions', $customer, $payment ); ?>
419
+							<?php do_action('give_donor_recent_purchases_actions', $customer, $payment); ?>
420 420
 						</td>
421 421
 					</tr>
422 422
 				<?php endforeach; ?>
423 423
 			<?php else: ?>
424 424
 				<tr>
425
-					<td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); ?></td>
425
+					<td colspan="5"><?php esc_html_e('No Donations Found', 'give'); ?></td>
426 426
 				</tr>
427 427
 			<?php endif; ?>
428 428
 			</tbody>
429 429
 		</table>
430 430
 
431
-		<h3><?php esc_html_e( 'Completed Donations', 'give' ); ?></h3>
431
+		<h3><?php esc_html_e('Completed Donations', 'give'); ?></h3>
432 432
 		<?php
433
-		$donations = give_get_users_completed_donations( $customer->email );
433
+		$donations = give_get_users_completed_donations($customer->email);
434 434
 		?>
435 435
 		<table class="wp-list-table widefat striped donations">
436 436
 			<thead>
437 437
 			<tr>
438 438
 				<th><?php echo give_get_forms_label_singular(); ?></th>
439
-				<th width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th>
439
+				<th width="120px"><?php esc_html_e('Actions', 'give'); ?></th>
440 440
 			</tr>
441 441
 			</thead>
442 442
 			<tbody>
443
-			<?php if ( ! empty( $donations ) ) : ?>
444
-				<?php foreach ( $donations as $donation ) : ?>
443
+			<?php if ( ! empty($donations)) : ?>
444
+				<?php foreach ($donations as $donation) : ?>
445 445
 					<tr>
446 446
 						<td><?php echo $donation->post_title; ?></td>
447 447
 						<td>
448 448
 							<a title="<?php
449 449
 								printf(
450 450
 									/* translators: %s: post title */
451
-									esc_attr__( 'View %s', 'give' ),
451
+									esc_attr__('View %s', 'give'),
452 452
 									$donation->post_title
453
-								); ?>" href="<?php echo esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) );
453
+								); ?>" href="<?php echo esc_url(admin_url('post.php?action=edit&post='.$donation->ID));
454 454
 							?>">
455 455
 								<?php
456 456
 									printf(
457 457
 										/* translators: %s: forms singular label */
458
-										esc_html__( 'View %s', 'give' ),
458
+										esc_html__('View %s', 'give'),
459 459
 										give_get_forms_label_singular()
460 460
 									);
461 461
 								?>
@@ -465,17 +465,17 @@  discard block
 block discarded – undo
465 465
 				<?php endforeach; ?>
466 466
 			<?php else: ?>
467 467
 				<tr>
468
-					<td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); ?></td>
468
+					<td colspan="2"><?php esc_html_e('No Completed Donations Found', 'give'); ?></td>
469 469
 				</tr>
470 470
 			<?php endif; ?>
471 471
 			</tbody>
472 472
 		</table>
473 473
 
474
-		<?php do_action( 'give_donor_after_tables', $customer ); ?>
474
+		<?php do_action('give_donor_after_tables', $customer); ?>
475 475
 
476 476
 	</div>
477 477
 
478
-	<?php do_action( 'give_donor_card_bottom', $customer ); ?>
478
+	<?php do_action('give_donor_card_bottom', $customer); ?>
479 479
 
480 480
 	<?php
481 481
 }
@@ -489,30 +489,30 @@  discard block
 block discarded – undo
489 489
  *
490 490
  * @return void
491 491
  */
492
-function give_customer_notes_view( $customer ) {
492
+function give_customer_notes_view($customer) {
493 493
 
494
-	$paged          = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1;
495
-	$paged          = absint( $paged );
494
+	$paged          = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1;
495
+	$paged          = absint($paged);
496 496
 	$note_count     = $customer->get_notes_count();
497
-	$per_page       = apply_filters( 'give_customer_notes_per_page', 20 );
498
-	$total_pages    = ceil( $note_count / $per_page );
499
-	$customer_notes = $customer->get_notes( $per_page, $paged );
497
+	$per_page       = apply_filters('give_customer_notes_per_page', 20);
498
+	$total_pages    = ceil($note_count / $per_page);
499
+	$customer_notes = $customer->get_notes($per_page, $paged);
500 500
 	?>
501 501
 
502 502
 	<div id="customer-notes-wrapper">
503 503
 		<div class="customer-notes-header">
504
-			<?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span>
504
+			<?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span>
505 505
 		</div>
506
-		<h3><?php esc_html_e( 'Notes', 'give' ); ?></h3>
506
+		<h3><?php esc_html_e('Notes', 'give'); ?></h3>
507 507
 
508
-		<?php if ( 1 == $paged ) : ?>
508
+		<?php if (1 == $paged) : ?>
509 509
 			<div style="display: block; margin-bottom: 55px;">
510
-				<form id="give-add-customer-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $customer->id ); ?>">
510
+				<form id="give-add-customer-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$customer->id); ?>">
511 511
 					<textarea id="customer-note" name="customer_note" class="customer-note-input" rows="10"></textarea>
512 512
 					<br />
513 513
 					<input type="hidden" id="customer-id" name="customer_id" value="<?php echo $customer->id; ?>" />
514 514
 					<input type="hidden" name="give_action" value="add-customer-note" />
515
-					<?php wp_nonce_field( 'add-customer-note', 'add_customer_note_nonce', true, true ); ?>
515
+					<?php wp_nonce_field('add-customer-note', 'add_customer_note_nonce', true, true); ?>
516 516
 					<input id="add-customer-note" class="right button-primary" type="submit" value="Add Note" />
517 517
 				</form>
518 518
 			</div>
@@ -527,46 +527,46 @@  discard block
 block discarded – undo
527 527
 			'show_all' => true
528 528
 		);
529 529
 
530
-		echo paginate_links( $pagination_args );
530
+		echo paginate_links($pagination_args);
531 531
 		?>
532 532
 
533 533
 		<div id="give-customer-notes" class="postbox">
534
-			<?php if ( count( $customer_notes ) > 0 ) : ?>
535
-				<?php foreach ( $customer_notes as $key => $note ) : ?>
534
+			<?php if (count($customer_notes) > 0) : ?>
535
+				<?php foreach ($customer_notes as $key => $note) : ?>
536 536
 					<div class="customer-note-wrapper dashboard-comment-wrap comment-item">
537 537
 					<span class="note-content-wrap">
538
-						<?php echo stripslashes( $note ); ?>
538
+						<?php echo stripslashes($note); ?>
539 539
 					</span>
540 540
 					</div>
541 541
 				<?php endforeach; ?>
542 542
 			<?php else: ?>
543 543
 				<div class="give-no-customer-notes">
544
-					<?php esc_html_e( 'No Donor Notes', 'give' ); ?>
544
+					<?php esc_html_e('No Donor Notes', 'give'); ?>
545 545
 				</div>
546 546
 			<?php endif; ?>
547 547
 		</div>
548 548
 
549
-		<?php echo paginate_links( $pagination_args ); ?>
549
+		<?php echo paginate_links($pagination_args); ?>
550 550
 
551 551
 	</div>
552 552
 
553 553
 	<?php
554 554
 }
555 555
 
556
-function give_customers_delete_view( $customer ) {
556
+function give_customers_delete_view($customer) {
557 557
 
558
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
558
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
559 559
 
560 560
 	?>
561 561
 
562
-	<?php do_action( 'give_customer_delete_top', $customer ); ?>
562
+	<?php do_action('give_customer_delete_top', $customer); ?>
563 563
 
564 564
 	<div class="info-wrapper customer-section">
565 565
 
566
-		<form id="delete-customer" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer->id ); ?>">
566
+		<form id="delete-customer" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$customer->id); ?>">
567 567
 
568 568
 			<div class="customer-notes-header">
569
-				<?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span>
569
+				<?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span>
570 570
 			</div>
571 571
 
572 572
 
@@ -574,27 +574,27 @@  discard block
 block discarded – undo
574 574
 
575 575
 				<span class="delete-customer-options">
576 576
 					<p>
577
-						<?php echo Give()->html->checkbox( array( 'name' => 'give-customer-delete-confirm' ) ); ?>
578
-						<label for="give-customer-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label>
577
+						<?php echo Give()->html->checkbox(array('name' => 'give-customer-delete-confirm')); ?>
578
+						<label for="give-customer-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label>
579 579
 					</p>
580 580
 
581 581
 					<p>
582
-						<?php echo Give()->html->checkbox( array(
582
+						<?php echo Give()->html->checkbox(array(
583 583
 							'name'    => 'give-customer-delete-records',
584
-							'options' => array( 'disabled' => true )
585
-						) ); ?>
586
-						<label for="give-customer-delete-records"><?php esc_html_e( 'Delete all associated payments and records?', 'give' ); ?></label>
584
+							'options' => array('disabled' => true)
585
+						)); ?>
586
+						<label for="give-customer-delete-records"><?php esc_html_e('Delete all associated payments and records?', 'give'); ?></label>
587 587
 					</p>
588 588
 
589
-					<?php do_action( 'give_customer_delete_inputs', $customer ); ?>
589
+					<?php do_action('give_customer_delete_inputs', $customer); ?>
590 590
 				</span>
591 591
 
592 592
 				<span id="customer-edit-actions">
593 593
 					<input type="hidden" name="customer_id" value="<?php echo $customer->id; ?>" />
594
-					<?php wp_nonce_field( 'delete-customer', '_wpnonce', false, true ); ?>
594
+					<?php wp_nonce_field('delete-customer', '_wpnonce', false, true); ?>
595 595
 					<input type="hidden" name="give_action" value="delete-customer" />
596
-					<input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" />
597
-					<a id="give-delete-customer-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
596
+					<input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" />
597
+					<a id="give-delete-customer-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a>
598 598
 				</span>
599 599
 
600 600
 			</div>
@@ -604,5 +604,5 @@  discard block
 block discarded – undo
604 604
 
605 605
 	<?php
606 606
 
607
-	do_action( 'give_customer_delete_bottom', $customer );
607
+	do_action('give_customer_delete_bottom', $customer);
608 608
 }
Please login to merge, or discard this patch.
includes/admin/customers/class-customer-table.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@
 block discarded – undo
115 115
 
116 116
 			case 'num_purchases' :
117 117
 				$value = '<a href="' .
118
-				         admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
119
-				         ) . '">' . esc_html__( $item['num_purchases'] ) . '</a>';
118
+						 admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
119
+						 ) . '">' . esc_html__( $item['num_purchases'] ) . '</a>';
120 120
 				break;
121 121
 
122 122
 			case 'amount_spent' :
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 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
 /**
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		global $status, $page;
63 63
 
64 64
 		// Set parent defaults
65
-		parent::__construct( array(
66
-			'singular' => esc_html__( 'Donor', 'give' ),     // Singular name of the listed records
67
-			'plural'   => esc_html__( 'Donors', 'give' ),    // Plural name of the listed records
65
+		parent::__construct(array(
66
+			'singular' => esc_html__('Donor', 'give'), // Singular name of the listed records
67
+			'plural'   => esc_html__('Donors', 'give'), // Plural name of the listed records
68 68
 			'ajax'     => false                            // Does this table support ajax?
69
-		) );
69
+		));
70 70
 
71 71
 	}
72 72
 
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return void
83 83
 	 */
84
-	public function search_box( $text, $input_id ) {
85
-		$input_id = $input_id . '-search-input';
84
+	public function search_box($text, $input_id) {
85
+		$input_id = $input_id.'-search-input';
86 86
 
87
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
88
-			echo '<input type="hidden" name="orderby" value="' . esc_attr__( $_REQUEST['orderby'] ) . '" />';
87
+		if ( ! empty($_REQUEST['orderby'])) {
88
+			echo '<input type="hidden" name="orderby" value="'.esc_attr__($_REQUEST['orderby']).'" />';
89 89
 		}
90
-		if ( ! empty( $_REQUEST['order'] ) ) {
91
-			echo '<input type="hidden" name="order" value="' . esc_attr__( $_REQUEST['order'] ) . '" />';
90
+		if ( ! empty($_REQUEST['order'])) {
91
+			echo '<input type="hidden" name="order" value="'.esc_attr__($_REQUEST['order']).'" />';
92 92
 		}
93 93
 		?>
94 94
 		<p class="search-box">
95 95
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
96 96
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
97
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
97
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
98 98
 		</p>
99 99
 	<?php
100 100
 	}
@@ -110,42 +110,42 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Column Name
112 112
 	 */
113
-	public function column_default( $item, $column_name ) {
114
-		switch ( $column_name ) {
113
+	public function column_default($item, $column_name) {
114
+		switch ($column_name) {
115 115
 
116 116
 			case 'num_purchases' :
117
-				$value = '<a href="' .
118
-				         admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
119
-				         ) . '">' . esc_html__( $item['num_purchases'] ) . '</a>';
117
+				$value = '<a href="'.
118
+				         admin_url('/edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($item['email'])
119
+				         ).'">'.esc_html__($item['num_purchases']).'</a>';
120 120
 				break;
121 121
 
122 122
 			case 'amount_spent' :
123
-				$value = give_currency_filter( give_format_amount( $item[ $column_name ] ) );
123
+				$value = give_currency_filter(give_format_amount($item[$column_name]));
124 124
 				break;
125 125
 
126 126
 			case 'date_created' :
127
-				$value = date_i18n( get_option( 'date_format' ), strtotime( $item['date_created'] ) );
127
+				$value = date_i18n(get_option('date_format'), strtotime($item['date_created']));
128 128
 				break;
129 129
 
130 130
 			default:
131
-				$value = isset( $item[ $column_name ] ) ? $item[ $column_name ] : null;
131
+				$value = isset($item[$column_name]) ? $item[$column_name] : null;
132 132
 				break;
133 133
 		}
134 134
 
135
-		return apply_filters( 'give_report_column_' . $column_name, $value, $item['id'] );
135
+		return apply_filters('give_report_column_'.$column_name, $value, $item['id']);
136 136
 
137 137
 	}
138 138
 
139
-	public function column_name( $item ) {
140
-		$name = '#' . $item['id'] . ' ';
141
-		$name .= ! empty( $item['name'] ) ? $item['name'] : '<em>' . esc_html__( 'Unnamed Donor', 'give' ) . '</em>';
142
-		$view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $item['id'] );
139
+	public function column_name($item) {
140
+		$name = '#'.$item['id'].' ';
141
+		$name .= ! empty($item['name']) ? $item['name'] : '<em>'.esc_html__('Unnamed Donor', 'give').'</em>';
142
+		$view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$item['id']);
143 143
 		$actions  = array(
144
-			'view'   => sprintf( '<a href="%1$s">%2$s</a>', $view_url, esc_html__( 'View Donor', 'give' ) ),
145
-			'delete' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $item['id'] ), esc_html__( 'Delete', 'give' ) )
144
+			'view'   => sprintf('<a href="%1$s">%2$s</a>', $view_url, esc_html__('View Donor', 'give')),
145
+			'delete' => sprintf('<a href="%1$s">%2$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$item['id']), esc_html__('Delete', 'give'))
146 146
 		);
147 147
 
148
-		return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions );
148
+		return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions);
149 149
 	}
150 150
 
151 151
 	/**
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function get_columns() {
159 159
 		$columns = array(
160
-			'name'          => esc_html__( 'Name', 'give' ),
161
-			'email'         => esc_html__( 'Email', 'give' ),
162
-			'num_purchases' => esc_html__( 'Donations', 'give' ),
163
-			'amount_spent'  => esc_html__( 'Total Donated', 'give' ),
164
-			'date_created'  => esc_html__( 'Date Created', 'give' )
160
+			'name'          => esc_html__('Name', 'give'),
161
+			'email'         => esc_html__('Email', 'give'),
162
+			'num_purchases' => esc_html__('Donations', 'give'),
163
+			'amount_spent'  => esc_html__('Total Donated', 'give'),
164
+			'date_created'  => esc_html__('Date Created', 'give')
165 165
 		);
166 166
 
167
-		return apply_filters( 'give_report_customer_columns', $columns );
167
+		return apply_filters('give_report_customer_columns', $columns);
168 168
 
169 169
 	}
170 170
 
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function get_sortable_columns() {
179 179
 		return array(
180
-			'date_created'  => array( 'date_created', true ),
181
-			'name'          => array( 'name', true ),
182
-			'num_purchases' => array( 'purchase_count', false ),
183
-			'amount_spent'  => array( 'purchase_value', false ),
180
+			'date_created'  => array('date_created', true),
181
+			'name'          => array('name', true),
182
+			'num_purchases' => array('purchase_count', false),
183
+			'amount_spent'  => array('purchase_value', false),
184 184
 		);
185 185
 	}
186 186
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 * @since  1.0
192 192
 	 * @return void
193 193
 	 */
194
-	public function bulk_actions( $which = '' ) {
194
+	public function bulk_actions($which = '') {
195 195
 		// These aren't really bulk actions but this outputs the markup in the right place
196 196
 	}
197 197
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @return int Current page number
204 204
 	 */
205 205
 	public function get_paged() {
206
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
206
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 * @return mixed string If search is present, false otherwise
215 215
 	 */
216 216
 	public function get_search() {
217
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
217
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
218 218
 	}
219 219
 
220 220
 	/**
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$data    = array();
233 233
 		$paged   = $this->get_paged();
234
-		$offset  = $this->per_page * ( $paged - 1 );
234
+		$offset  = $this->per_page * ($paged - 1);
235 235
 		$search  = $this->get_search();
236
-		$order   = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
237
-		$orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
236
+		$order   = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC';
237
+		$orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id';
238 238
 
239 239
 		$args = array(
240 240
 			'number'  => $this->per_page,
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
 			'orderby' => $orderby
244 244
 		);
245 245
 
246
-		if ( is_email( $search ) ) {
246
+		if (is_email($search)) {
247 247
 			$args['email'] = $search;
248
-		} elseif ( is_numeric( $search ) ) {
248
+		} elseif (is_numeric($search)) {
249 249
 			$args['id'] = $search;
250 250
 		} else {
251 251
 			$args['name'] = $search;
252 252
 		}
253 253
 
254
-		$customers = Give()->customers->get_customers( $args );
254
+		$customers = Give()->customers->get_customers($args);
255 255
 
256
-		if ( $customers ) {
256
+		if ($customers) {
257 257
 
258
-			foreach ( $customers as $customer ) {
258
+			foreach ($customers as $customer) {
259 259
 
260
-				$user_id = ! empty( $customer->user_id ) ? intval( $customer->user_id ) : 0;
260
+				$user_id = ! empty($customer->user_id) ? intval($customer->user_id) : 0;
261 261
 
262 262
 				$data[] = array(
263 263
 					'id'            => $customer->id,
@@ -291,16 +291,16 @@  discard block
 block discarded – undo
291 291
 		$hidden   = array(); // No hidden columns
292 292
 		$sortable = $this->get_sortable_columns();
293 293
 
294
-		$this->_column_headers = array( $columns, $hidden, $sortable );
294
+		$this->_column_headers = array($columns, $hidden, $sortable);
295 295
 
296 296
 		$this->items = $this->reports_data();
297 297
 
298 298
 		$this->total = give_count_total_customers();
299 299
 
300
-		$this->set_pagination_args( array(
300
+		$this->set_pagination_args(array(
301 301
 			'total_items' => $this->total,
302 302
 			'per_page'    => $this->per_page,
303
-			'total_pages' => ceil( $this->total / $this->per_page )
304
-		) );
303
+			'total_pages' => ceil($this->total / $this->per_page)
304
+		));
305 305
 	}
306 306
 }
307 307
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/customers/customer-actions.php 1 patch
Spacing   +128 added lines, -128 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,15 +23,15 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array $output Response messages
25 25
  */
26
-function give_edit_customer( $args ) {
26
+function give_edit_customer($args) {
27 27
 	
28
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
28
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
29 29
 
30
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
31
-		wp_die( esc_html__( 'You do not have permission to edit this donor.', 'give' ) );
30
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
31
+		wp_die(esc_html__('You do not have permission to edit this donor.', 'give'));
32 32
 	}
33 33
 
34
-	if ( empty( $args ) ) {
34
+	if (empty($args)) {
35 35
 		return;
36 36
 	}
37 37
 
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 	$customer_id   = (int) $args['customerinfo']['id'];
40 40
 	$nonce         = $args['_wpnonce'];
41 41
 
42
-	if ( ! wp_verify_nonce( $nonce, 'edit-customer' ) ) {
43
-		wp_die( esc_html__( 'Cheatin\' eh?!', 'give' ) );
42
+	if ( ! wp_verify_nonce($nonce, 'edit-customer')) {
43
+		wp_die(esc_html__('Cheatin\' eh?!', 'give'));
44 44
 	}
45 45
 
46
-	$customer = new Give_Customer( $customer_id );
47
-	if ( empty( $customer->id ) ) {
46
+	$customer = new Give_Customer($customer_id);
47
+	if (empty($customer->id)) {
48 48
 		return false;
49 49
 	}
50 50
 
@@ -54,23 +54,23 @@  discard block
 block discarded – undo
54 54
 		'user_id' => 0
55 55
 	);
56 56
 
57
-	$customer_info = wp_parse_args( $customer_info, $defaults );
57
+	$customer_info = wp_parse_args($customer_info, $defaults);
58 58
 
59
-	if ( ! is_email( $customer_info['email'] ) ) {
60
-		give_set_error( 'give-invalid-email', esc_html__( 'Please enter a valid email address.', 'give' ) );
59
+	if ( ! is_email($customer_info['email'])) {
60
+		give_set_error('give-invalid-email', esc_html__('Please enter a valid email address.', 'give'));
61 61
 	}
62 62
 
63
-	if ( (int) $customer_info['user_id'] != (int) $customer->user_id ) {
63
+	if ((int) $customer_info['user_id'] != (int) $customer->user_id) {
64 64
 
65 65
 		// Make sure we don't already have this user attached to a customer
66
-		if ( ! empty( $customer_info['user_id'] ) && false !== Give()->customers->get_customer_by( 'user_id', $customer_info['user_id'] ) ) {
67
-			give_set_error( 'give-invalid-customer-user_id', sprintf( esc_html__( 'The User ID %d is already associated with a different donor.', 'give' ), $customer_info['user_id'] ) );
66
+		if ( ! empty($customer_info['user_id']) && false !== Give()->customers->get_customer_by('user_id', $customer_info['user_id'])) {
67
+			give_set_error('give-invalid-customer-user_id', sprintf(esc_html__('The User ID %d is already associated with a different donor.', 'give'), $customer_info['user_id']));
68 68
 		}
69 69
 
70 70
 		// Make sure it's actually a user
71
-		$user = get_user_by( 'id', $customer_info['user_id'] );
72
-		if ( ! empty( $customer_info['user_id'] ) && false === $user ) {
73
-			give_set_error( 'give-invalid-user_id', sprintf( esc_html__( 'The User ID %d does not exist. Please assign an existing user.', 'give' ), $customer_info['user_id'] ) );
71
+		$user = get_user_by('id', $customer_info['user_id']);
72
+		if ( ! empty($customer_info['user_id']) && false === $user) {
73
+			give_set_error('give-invalid-user_id', sprintf(esc_html__('The User ID %d does not exist. Please assign an existing user.', 'give'), $customer_info['user_id']));
74 74
 		}
75 75
 
76 76
 	}
@@ -78,82 +78,82 @@  discard block
 block discarded – undo
78 78
 	// Record this for later
79 79
 	$previous_user_id = $customer->user_id;
80 80
 
81
-	if ( give_get_errors() ) {
81
+	if (give_get_errors()) {
82 82
 		return;
83 83
 	}
84 84
 
85 85
 	// Setup the customer address, if present
86 86
 	$address = array();
87
-	if ( intval( $customer_info['user_id'] ) > 0 ) {
87
+	if (intval($customer_info['user_id']) > 0) {
88 88
 
89
-		$current_address = get_user_meta( $customer_info['user_id'], '_give_user_address', true );
89
+		$current_address = get_user_meta($customer_info['user_id'], '_give_user_address', true);
90 90
 
91
-		if ( false === $current_address ) {
92
-			$address['line1']   = isset( $customer_info['line1'] ) ? $customer_info['line1'] : '';
93
-			$address['line2']   = isset( $customer_info['line2'] ) ? $customer_info['line2'] : '';
94
-			$address['city']    = isset( $customer_info['city'] ) ? $customer_info['city'] : '';
95
-			$address['country'] = isset( $customer_info['country'] ) ? $customer_info['country'] : '';
96
-			$address['zip']     = isset( $customer_info['zip'] ) ? $customer_info['zip'] : '';
97
-			$address['state']   = isset( $customer_info['state'] ) ? $customer_info['state'] : '';
91
+		if (false === $current_address) {
92
+			$address['line1']   = isset($customer_info['line1']) ? $customer_info['line1'] : '';
93
+			$address['line2']   = isset($customer_info['line2']) ? $customer_info['line2'] : '';
94
+			$address['city']    = isset($customer_info['city']) ? $customer_info['city'] : '';
95
+			$address['country'] = isset($customer_info['country']) ? $customer_info['country'] : '';
96
+			$address['zip']     = isset($customer_info['zip']) ? $customer_info['zip'] : '';
97
+			$address['state']   = isset($customer_info['state']) ? $customer_info['state'] : '';
98 98
 		} else {
99
-			$current_address    = wp_parse_args( $current_address, array(
99
+			$current_address    = wp_parse_args($current_address, array(
100 100
 				'line1',
101 101
 				'line2',
102 102
 				'city',
103 103
 				'zip',
104 104
 				'state',
105 105
 				'country'
106
-			) );
107
-			$address['line1']   = isset( $customer_info['line1'] ) ? $customer_info['line1'] : $current_address['line1'];
108
-			$address['line2']   = isset( $customer_info['line2'] ) ? $customer_info['line2'] : $current_address['line2'];
109
-			$address['city']    = isset( $customer_info['city'] ) ? $customer_info['city'] : $current_address['city'];
110
-			$address['country'] = isset( $customer_info['country'] ) ? $customer_info['country'] : $current_address['country'];
111
-			$address['zip']     = isset( $customer_info['zip'] ) ? $customer_info['zip'] : $current_address['zip'];
112
-			$address['state']   = isset( $customer_info['state'] ) ? $customer_info['state'] : $current_address['state'];
106
+			));
107
+			$address['line1']   = isset($customer_info['line1']) ? $customer_info['line1'] : $current_address['line1'];
108
+			$address['line2']   = isset($customer_info['line2']) ? $customer_info['line2'] : $current_address['line2'];
109
+			$address['city']    = isset($customer_info['city']) ? $customer_info['city'] : $current_address['city'];
110
+			$address['country'] = isset($customer_info['country']) ? $customer_info['country'] : $current_address['country'];
111
+			$address['zip']     = isset($customer_info['zip']) ? $customer_info['zip'] : $current_address['zip'];
112
+			$address['state']   = isset($customer_info['state']) ? $customer_info['state'] : $current_address['state'];
113 113
 		}
114 114
 
115 115
 	}
116 116
 
117 117
 	// Sanitize the inputs
118 118
 	$customer_data            = array();
119
-	$customer_data['name']    = strip_tags( stripslashes( $customer_info['name'] ) );
119
+	$customer_data['name']    = strip_tags(stripslashes($customer_info['name']));
120 120
 	$customer_data['email']   = $customer_info['email'];
121 121
 	$customer_data['user_id'] = $customer_info['user_id'];
122 122
 
123
-	$customer_data = apply_filters( 'give_edit_customer_info', $customer_data, $customer_id );
124
-	$address       = apply_filters( 'give_edit_customer_address', $address, $customer_id );
123
+	$customer_data = apply_filters('give_edit_customer_info', $customer_data, $customer_id);
124
+	$address       = apply_filters('give_edit_customer_address', $address, $customer_id);
125 125
 
126
-	$customer_data = array_map( 'sanitize_text_field', $customer_data );
127
-	$address       = array_map( 'sanitize_text_field', $address );
126
+	$customer_data = array_map('sanitize_text_field', $customer_data);
127
+	$address       = array_map('sanitize_text_field', $address);
128 128
 
129
-	do_action( 'give_pre_edit_customer', $customer_id, $customer_data, $address );
129
+	do_action('give_pre_edit_customer', $customer_id, $customer_data, $address);
130 130
 
131 131
 	$output         = array();
132 132
 	$previous_email = $customer->email;
133 133
 
134
-	if ( $customer->update( $customer_data ) ) {
134
+	if ($customer->update($customer_data)) {
135 135
 
136
-		if ( ! empty( $customer->user_id ) && $customer->user_id > 0 ) {
137
-			update_user_meta( $customer->user_id, '_give_user_address', $address );
136
+		if ( ! empty($customer->user_id) && $customer->user_id > 0) {
137
+			update_user_meta($customer->user_id, '_give_user_address', $address);
138 138
 		}
139 139
 
140 140
 		// Update some payment meta if we need to
141
-		$payments_array = explode( ',', $customer->payment_ids );
141
+		$payments_array = explode(',', $customer->payment_ids);
142 142
 
143
-		if ( $customer->email != $previous_email ) {
144
-			foreach ( $payments_array as $payment_id ) {
145
-				give_update_payment_meta( $payment_id, 'email', $customer->email );
143
+		if ($customer->email != $previous_email) {
144
+			foreach ($payments_array as $payment_id) {
145
+				give_update_payment_meta($payment_id, 'email', $customer->email);
146 146
 			}
147 147
 		}
148 148
 
149
-		if ( $customer->user_id != $previous_user_id ) {
150
-			foreach ( $payments_array as $payment_id ) {
151
-				give_update_payment_meta( $payment_id, '_give_payment_user_id', $customer->user_id );
149
+		if ($customer->user_id != $previous_user_id) {
150
+			foreach ($payments_array as $payment_id) {
151
+				give_update_payment_meta($payment_id, '_give_payment_user_id', $customer->user_id);
152 152
 			}
153 153
 		}
154 154
 
155 155
 		$output['success']       = true;
156
-		$customer_data           = array_merge( $customer_data, $address );
156
+		$customer_data           = array_merge($customer_data, $address);
157 157
 		$output['customer_info'] = $customer_data;
158 158
 
159 159
 	} else {
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 
163 163
 	}
164 164
 
165
-	do_action( 'give_post_edit_customer', $customer_id, $customer_data );
165
+	do_action('give_post_edit_customer', $customer_id, $customer_data);
166 166
 
167
-	if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
168
-		header( 'Content-Type: application/json' );
169
-		echo json_encode( $output );
167
+	if (defined('DOING_AJAX') && DOING_AJAX) {
168
+		header('Content-Type: application/json');
169
+		echo json_encode($output);
170 170
 		wp_die();
171 171
 	}
172 172
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
 }
176 176
 
177
-add_action( 'give_edit-customer', 'give_edit_customer', 10, 1 );
177
+add_action('give_edit-customer', 'give_edit_customer', 10, 1);
178 178
 
179 179
 /**
180 180
  * Save a customer note being added
@@ -185,53 +185,53 @@  discard block
 block discarded – undo
185 185
  *
186 186
  * @return int         The Note ID that was saved, or 0 if nothing was saved
187 187
  */
188
-function give_customer_save_note( $args ) {
188
+function give_customer_save_note($args) {
189 189
 
190
-	$customer_view_role = apply_filters( 'give_view_customers_role', 'view_give_reports' );
190
+	$customer_view_role = apply_filters('give_view_customers_role', 'view_give_reports');
191 191
 
192
-	if ( ! is_admin() || ! current_user_can( $customer_view_role ) ) {
193
-		wp_die( esc_html__( 'You do not have permission to edit this donor.', 'give' ) );
192
+	if ( ! is_admin() || ! current_user_can($customer_view_role)) {
193
+		wp_die(esc_html__('You do not have permission to edit this donor.', 'give'));
194 194
 	}
195 195
 
196
-	if ( empty( $args ) ) {
196
+	if (empty($args)) {
197 197
 		return;
198 198
 	}
199 199
 
200
-	$customer_note = trim( sanitize_text_field( $args['customer_note'] ) );
200
+	$customer_note = trim(sanitize_text_field($args['customer_note']));
201 201
 	$customer_id   = (int) $args['customer_id'];
202 202
 	$nonce         = $args['add_customer_note_nonce'];
203 203
 
204
-	if ( ! wp_verify_nonce( $nonce, 'add-customer-note' ) ) {
205
-		wp_die( esc_html__( 'Cheatin\' eh?!', 'give' ) );
204
+	if ( ! wp_verify_nonce($nonce, 'add-customer-note')) {
205
+		wp_die(esc_html__('Cheatin\' eh?!', 'give'));
206 206
 	}
207 207
 
208
-	if ( empty( $customer_note ) ) {
209
-		give_set_error( 'empty-customer-note', esc_html__( 'A note is required.', 'give' ) );
208
+	if (empty($customer_note)) {
209
+		give_set_error('empty-customer-note', esc_html__('A note is required.', 'give'));
210 210
 	}
211 211
 
212
-	if ( give_get_errors() ) {
212
+	if (give_get_errors()) {
213 213
 		return;
214 214
 	}
215 215
 
216
-	$customer = new Give_Customer( $customer_id );
217
-	$new_note = $customer->add_note( $customer_note );
216
+	$customer = new Give_Customer($customer_id);
217
+	$new_note = $customer->add_note($customer_note);
218 218
 
219
-	do_action( 'give_pre_insert_customer_note', $customer_id, $new_note );
219
+	do_action('give_pre_insert_customer_note', $customer_id, $new_note);
220 220
 
221
-	if ( ! empty( $new_note ) && ! empty( $customer->id ) ) {
221
+	if ( ! empty($new_note) && ! empty($customer->id)) {
222 222
 
223 223
 		ob_start();
224 224
 		?>
225 225
 		<div class="customer-note-wrapper dashboard-comment-wrap comment-item">
226 226
 			<span class="note-content-wrap">
227
-				<?php echo stripslashes( $new_note ); ?>
227
+				<?php echo stripslashes($new_note); ?>
228 228
 			</span>
229 229
 		</div>
230 230
 		<?php
231 231
 		$output = ob_get_contents();
232 232
 		ob_end_clean();
233 233
 
234
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
234
+		if (defined('DOING_AJAX') && DOING_AJAX) {
235 235
 			echo $output;
236 236
 			exit;
237 237
 		}
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 }
246 246
 
247
-add_action( 'give_add-customer-note', 'give_customer_save_note', 10, 1 );
247
+add_action('give_add-customer-note', 'give_customer_save_note', 10, 1);
248 248
 
249 249
 /**
250 250
  * Delete a customer
@@ -255,87 +255,87 @@  discard block
 block discarded – undo
255 255
  *
256 256
  * @return int Whether it was a successful deletion
257 257
  */
258
-function give_customer_delete( $args ) {
258
+function give_customer_delete($args) {
259 259
 
260
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
260
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
261 261
 
262
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
263
-		wp_die( esc_html__( 'You do not have permission to delete donors.', 'give' ) );
262
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
263
+		wp_die(esc_html__('You do not have permission to delete donors.', 'give'));
264 264
 	}
265 265
 
266
-	if ( empty( $args ) ) {
266
+	if (empty($args)) {
267 267
 		return;
268 268
 	}
269 269
 
270 270
 	$customer_id = (int) $args['customer_id'];
271
-	$confirm     = ! empty( $args['give-customer-delete-confirm'] ) ? true : false;
272
-	$remove_data = ! empty( $args['give-customer-delete-records'] ) ? true : false;
271
+	$confirm     = ! empty($args['give-customer-delete-confirm']) ? true : false;
272
+	$remove_data = ! empty($args['give-customer-delete-records']) ? true : false;
273 273
 	$nonce       = $args['_wpnonce'];
274 274
 
275
-	if ( ! wp_verify_nonce( $nonce, 'delete-customer' ) ) {
276
-		wp_die( esc_html__( 'Cheatin\' eh?!', 'give' ) );
275
+	if ( ! wp_verify_nonce($nonce, 'delete-customer')) {
276
+		wp_die(esc_html__('Cheatin\' eh?!', 'give'));
277 277
 	}
278 278
 
279
-	if ( ! $confirm ) {
280
-		give_set_error( 'customer-delete-no-confirm', esc_html__( 'Please confirm you want to delete this donor.', 'give' ) );
279
+	if ( ! $confirm) {
280
+		give_set_error('customer-delete-no-confirm', esc_html__('Please confirm you want to delete this donor.', 'give'));
281 281
 	}
282 282
 
283
-	if ( give_get_errors() ) {
284
-		wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer_id ) );
283
+	if (give_get_errors()) {
284
+		wp_redirect(admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer_id));
285 285
 		exit;
286 286
 	}
287 287
 
288
-	$customer = new Give_Customer( $customer_id );
288
+	$customer = new Give_Customer($customer_id);
289 289
 
290
-	do_action( 'give_pre_delete_customer', $customer_id, $confirm, $remove_data );
290
+	do_action('give_pre_delete_customer', $customer_id, $confirm, $remove_data);
291 291
 
292 292
 	$success = false;
293 293
 
294
-	if ( $customer->id > 0 ) {
294
+	if ($customer->id > 0) {
295 295
 
296
-		$payments_array = explode( ',', $customer->payment_ids );
297
-		$success        = Give()->customers->delete( $customer->id );
296
+		$payments_array = explode(',', $customer->payment_ids);
297
+		$success        = Give()->customers->delete($customer->id);
298 298
 
299
-		if ( $success ) {
299
+		if ($success) {
300 300
 
301
-			if ( $remove_data ) {
301
+			if ($remove_data) {
302 302
 
303 303
 				// Remove all payments, logs, etc
304
-				foreach ( $payments_array as $payment_id ) {
305
-					give_delete_purchase( $payment_id );
304
+				foreach ($payments_array as $payment_id) {
305
+					give_delete_purchase($payment_id);
306 306
 				}
307 307
 
308 308
 			} else {
309 309
 
310 310
 				// Just set the payments to customer_id of 0
311
-				foreach ( $payments_array as $payment_id ) {
312
-					give_update_payment_meta( $payment_id, '_give_payment_customer_id', 0 );
311
+				foreach ($payments_array as $payment_id) {
312
+					give_update_payment_meta($payment_id, '_give_payment_customer_id', 0);
313 313
 				}
314 314
 
315 315
 			}
316 316
 
317
-			$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&give-message=customer-deleted' );
317
+			$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&give-message=customer-deleted');
318 318
 
319 319
 		} else {
320 320
 
321
-			give_set_error( 'give-donor-delete-failed', esc_html__( 'Error deleting donor.', 'give' ) );
322
-			$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer_id );
321
+			give_set_error('give-donor-delete-failed', esc_html__('Error deleting donor.', 'give'));
322
+			$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$customer_id);
323 323
 
324 324
 		}
325 325
 
326 326
 	} else {
327 327
 
328
-		give_set_error( 'give-customer-delete-invalid-id', esc_html__( 'Invalid Donor ID.', 'give' ) );
329
-		$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors' );
328
+		give_set_error('give-customer-delete-invalid-id', esc_html__('Invalid Donor ID.', 'give'));
329
+		$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors');
330 330
 
331 331
 	}
332 332
 
333
-	wp_redirect( $redirect );
333
+	wp_redirect($redirect);
334 334
 	exit;
335 335
 
336 336
 }
337 337
 
338
-add_action( 'give_delete-customer', 'give_customer_delete', 10, 1 );
338
+add_action('give_delete-customer', 'give_customer_delete', 10, 1);
339 339
 
340 340
 /**
341 341
  * Disconnect a user ID from a donor
@@ -346,39 +346,39 @@  discard block
 block discarded – undo
346 346
  *
347 347
  * @return bool        If the disconnect was successful
348 348
  */
349
-function give_disconnect_customer_user_id( $args ) {
349
+function give_disconnect_customer_user_id($args) {
350 350
 
351
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
351
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
352 352
 
353
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
354
-		wp_die( esc_html__( 'You do not have permission to edit this donor.', 'give' ) );
353
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
354
+		wp_die(esc_html__('You do not have permission to edit this donor.', 'give'));
355 355
 	}
356 356
 
357
-	if ( empty( $args ) ) {
357
+	if (empty($args)) {
358 358
 		return;
359 359
 	}
360 360
 
361 361
 	$customer_id = (int) $args['customer_id'];
362 362
 	$nonce       = $args['_wpnonce'];
363 363
 
364
-	if ( ! wp_verify_nonce( $nonce, 'edit-customer' ) ) {
365
-		wp_die( esc_html__( 'Cheatin\' eh?!', 'give' ) );
364
+	if ( ! wp_verify_nonce($nonce, 'edit-customer')) {
365
+		wp_die(esc_html__('Cheatin\' eh?!', 'give'));
366 366
 	}
367 367
 
368
-	$customer = new Give_Customer( $customer_id );
369
-	if ( empty( $customer->id ) ) {
368
+	$customer = new Give_Customer($customer_id);
369
+	if (empty($customer->id)) {
370 370
 		return false;
371 371
 	}
372 372
 
373
-	do_action( 'give_pre_customer_disconnect_user_id', $customer_id, $customer->user_id );
373
+	do_action('give_pre_customer_disconnect_user_id', $customer_id, $customer->user_id);
374 374
 
375
-	$customer_args = array( 'user_id' => 0 );
375
+	$customer_args = array('user_id' => 0);
376 376
 
377
-	if ( $customer->update( $customer_args ) ) {
377
+	if ($customer->update($customer_args)) {
378 378
 		global $wpdb;
379 379
 
380
-		if ( ! empty( $customer->payment_ids ) ) {
381
-			$wpdb->query( "UPDATE $wpdb->postmeta SET meta_value = 0 WHERE meta_key = '_give_payment_user_id' AND post_id IN ( $customer->payment_ids )" );
380
+		if ( ! empty($customer->payment_ids)) {
381
+			$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = 0 WHERE meta_key = '_give_payment_user_id' AND post_id IN ( $customer->payment_ids )");
382 382
 		}
383 383
 
384 384
 		$output['success'] = true;
@@ -386,14 +386,14 @@  discard block
 block discarded – undo
386 386
 	} else {
387 387
 
388 388
 		$output['success'] = false;
389
-		give_set_error( 'give-disconnect-user-fail', esc_html__( 'Failed to disconnect user from donor.', 'give' ) );
389
+		give_set_error('give-disconnect-user-fail', esc_html__('Failed to disconnect user from donor.', 'give'));
390 390
 	}
391 391
 
392
-	do_action( 'give_post_customer_disconnect_user_id', $customer_id );
392
+	do_action('give_post_customer_disconnect_user_id', $customer_id);
393 393
 
394
-	if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
395
-		header( 'Content-Type: application/json' );
396
-		echo json_encode( $output );
394
+	if (defined('DOING_AJAX') && DOING_AJAX) {
395
+		header('Content-Type: application/json');
396
+		echo json_encode($output);
397 397
 		wp_die();
398 398
 	}
399 399
 
@@ -401,4 +401,4 @@  discard block
 block discarded – undo
401 401
 
402 402
 }
403 403
 
404
-add_action( 'give_disconnect-userid', 'give_disconnect_customer_user_id', 10, 1 );
404
+add_action('give_disconnect-userid', 'give_disconnect_customer_user_id', 10, 1);
Please login to merge, or discard this patch.
includes/admin/system-info.php 1 patch
Spacing   +146 added lines, -146 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
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_system_info_callback() {
26 26
 
27
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
27
+	if ( ! current_user_can('manage_give_settings')) {
28 28
 		return;
29 29
 	}
30 30
 	?>
31
-	<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" title="<?php esc_attr_e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'give' ); ?>"><?php echo give_tools_sysinfo_get(); ?></textarea>
31
+	<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" title="<?php esc_attr_e('To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'give'); ?>"><?php echo give_tools_sysinfo_get(); ?></textarea>
32 32
 	<p class="submit">
33 33
 		<input type="hidden" name="give-action" value="download_sysinfo"/>
34
-		<?php submit_button( esc_html__( 'Download System Info File', 'give' ), 'secondary', 'give-download-sysinfo', false ); ?>
34
+		<?php submit_button(esc_html__('Download System Info File', 'give'), 'secondary', 'give-download-sysinfo', false); ?>
35 35
 	</p>
36 36
 	<?php
37 37
 }
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
  * @return bool
48 48
  */
49 49
 function give_allow_sessions_for_sysinfo() {
50
-	if ( is_admin() && ( isset( $_GET['page'] ) && isset( $_GET['tab'] ) ) && ( $_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings' ) ) {
50
+	if (is_admin() && (isset($_GET['page']) && isset($_GET['tab'])) && ($_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings')) {
51 51
 		return true;
52 52
 	}
53 53
 }
54 54
 
55
-add_filter( 'give_start_session', 'give_allow_sessions_for_sysinfo' );
55
+add_filter('give_start_session', 'give_allow_sessions_for_sysinfo');
56 56
 
57 57
 
58 58
 /**
@@ -67,63 +67,63 @@  discard block
 block discarded – undo
67 67
 function give_tools_sysinfo_get() {
68 68
 	global $wpdb, $give_options;
69 69
 
70
-	if ( ! class_exists( 'Browser' ) ) {
71
-		require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php';
70
+	if ( ! class_exists('Browser')) {
71
+		require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php';
72 72
 	}
73 73
 
74 74
 	$browser = new Browser();
75 75
 
76 76
 	// Get theme info
77
-	if ( get_bloginfo( 'version' ) < '3.4' ) {
78
-		$theme_data = wp_get_theme( get_stylesheet_directory() . '/style.css' );
79
-		$theme      = $theme_data['Name'] . ' ' . $theme_data['Version'];
77
+	if (get_bloginfo('version') < '3.4') {
78
+		$theme_data = wp_get_theme(get_stylesheet_directory().'/style.css');
79
+		$theme      = $theme_data['Name'].' '.$theme_data['Version'];
80 80
 	} else {
81 81
 		$theme_data = wp_get_theme();
82
-		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
82
+		$theme      = $theme_data->Name.' '.$theme_data->Version;
83 83
 	}
84 84
 
85 85
 	// Try to identify the hosting provider
86 86
 	$host = give_get_host();
87 87
 
88
-	$return = '### Begin System Info ###' . "\n\n";
88
+	$return = '### Begin System Info ###'."\n\n";
89 89
 
90 90
 	// Start with the basics...
91
-	$return .= '-- Site Info' . "\n\n";
92
-	$return .= 'Site URL:                 ' . site_url() . "\n";
93
-	$return .= 'Home URL:                 ' . home_url() . "\n";
94
-	$return .= 'Multisite:                ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
91
+	$return .= '-- Site Info'."\n\n";
92
+	$return .= 'Site URL:                 '.site_url()."\n";
93
+	$return .= 'Home URL:                 '.home_url()."\n";
94
+	$return .= 'Multisite:                '.(is_multisite() ? 'Yes' : 'No')."\n";
95 95
 
96
-	$return = apply_filters( 'give_sysinfo_after_site_info', $return );
96
+	$return = apply_filters('give_sysinfo_after_site_info', $return);
97 97
 
98 98
 	// Can we determine the site's host?
99
-	if ( $host ) {
100
-		$return .= "\n" . '-- Hosting Provider' . "\n\n";
101
-		$return .= 'Host:                     ' . $host . "\n";
99
+	if ($host) {
100
+		$return .= "\n".'-- Hosting Provider'."\n\n";
101
+		$return .= 'Host:                     '.$host."\n";
102 102
 
103
-		$return = apply_filters( 'give_sysinfo_after_host_info', $return );
103
+		$return = apply_filters('give_sysinfo_after_host_info', $return);
104 104
 	}
105 105
 
106 106
 	// The local users' browser information, handled by the Browser class
107
-	$return .= "\n" . '-- User Browser' . "\n\n";
107
+	$return .= "\n".'-- User Browser'."\n\n";
108 108
 	$return .= $browser;
109 109
 
110
-	$return = apply_filters( 'give_sysinfo_after_user_browser', $return );
110
+	$return = apply_filters('give_sysinfo_after_user_browser', $return);
111 111
 
112 112
 	// WordPress configuration
113
-	$return .= "\n" . '-- WordPress Configuration' . "\n\n";
114
-	$return .= 'Version:                  ' . get_bloginfo( 'version' ) . "\n";
115
-	$return .= 'Language:                 ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
116
-	$return .= 'Permalink Structure:      ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
117
-	$return .= 'Active Theme:             ' . $theme . "\n";
118
-	$return .= 'Show On Front:            ' . get_option( 'show_on_front' ) . "\n";
113
+	$return .= "\n".'-- WordPress Configuration'."\n\n";
114
+	$return .= 'Version:                  '.get_bloginfo('version')."\n";
115
+	$return .= 'Language:                 '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n";
116
+	$return .= 'Permalink Structure:      '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n";
117
+	$return .= 'Active Theme:             '.$theme."\n";
118
+	$return .= 'Show On Front:            '.get_option('show_on_front')."\n";
119 119
 
120 120
 	// Only show page specs if frontpage is set to 'page'
121
-	if ( get_option( 'show_on_front' ) == 'page' ) {
122
-		$front_page_id = get_option( 'page_on_front' );
123
-		$blog_page_id  = get_option( 'page_for_posts' );
121
+	if (get_option('show_on_front') == 'page') {
122
+		$front_page_id = get_option('page_on_front');
123
+		$blog_page_id  = get_option('page_for_posts');
124 124
 
125
-		$return .= 'Page On Front:            ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
126
-		$return .= 'Page For Posts:           ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
125
+		$return .= 'Page On Front:            '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n";
126
+		$return .= 'Page For Posts:           '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n";
127 127
 	}
128 128
 
129 129
 	// Make sure wp_remote_post() is working
@@ -132,205 +132,205 @@  discard block
 block discarded – undo
132 132
 	$params = array(
133 133
 		'sslverify'  => false,
134 134
 		'timeout'    => 60,
135
-		'user-agent' => 'Give/' . GIVE_VERSION,
135
+		'user-agent' => 'Give/'.GIVE_VERSION,
136 136
 		'body'       => $request
137 137
 	);
138 138
 
139
-	$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
139
+	$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params);
140 140
 
141
-	if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
141
+	if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
142 142
 		$WP_REMOTE_POST = 'wp_remote_post() works';
143 143
 	} else {
144 144
 		$WP_REMOTE_POST = 'wp_remote_post() does not work';
145 145
 	}
146 146
 
147
-	$return .= 'Remote Post:              ' . $WP_REMOTE_POST . "\n";
148
-	$return .= 'Table Prefix:             ' . 'Length: ' . strlen( $wpdb->prefix ) . '   Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
149
-	$return .= 'Admin AJAX:               ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n";
150
-	$return .= 'WP_DEBUG:                 ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
151
-	$return .= 'Memory Limit:             ' . WP_MEMORY_LIMIT . "\n";
152
-	$return .= 'Registered Post Stati:    ' . implode( ', ', get_post_stati() ) . "\n";
147
+	$return .= 'Remote Post:              '.$WP_REMOTE_POST."\n";
148
+	$return .= 'Table Prefix:             '.'Length: '.strlen($wpdb->prefix).'   Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n";
149
+	$return .= 'Admin AJAX:               '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n";
150
+	$return .= 'WP_DEBUG:                 '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n";
151
+	$return .= 'Memory Limit:             '.WP_MEMORY_LIMIT."\n";
152
+	$return .= 'Registered Post Stati:    '.implode(', ', get_post_stati())."\n";
153 153
 
154
-	$return = apply_filters( 'give_sysinfo_after_wordpress_config', $return );
154
+	$return = apply_filters('give_sysinfo_after_wordpress_config', $return);
155 155
 
156 156
 	// GIVE configuration
157
-	$return .= "\n" . '-- Give Configuration' . "\n\n";
158
-	$return .= 'Version:                  ' . GIVE_VERSION . "\n";
159
-	$return .= 'Upgraded From:            ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n";
160
-	$return .= 'Test Mode:                ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" );
161
-	$return .= 'Currency Code:            ' . give_get_currency() . "\n";
162
-	$return .= 'Currency Position:        ' . give_get_option( 'currency_position', 'before' ) . "\n";
163
-	$return .= 'Decimal Separator:        ' . give_get_option( 'decimal_separator', '.' ) . "\n";
164
-	$return .= 'Thousands Separator:      ' . give_get_option( 'thousands_separator', ',' ) . "\n";
157
+	$return .= "\n".'-- Give Configuration'."\n\n";
158
+	$return .= 'Version:                  '.GIVE_VERSION."\n";
159
+	$return .= 'Upgraded From:            '.get_option('give_version_upgraded_from', 'None')."\n";
160
+	$return .= 'Test Mode:                '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n");
161
+	$return .= 'Currency Code:            '.give_get_currency()."\n";
162
+	$return .= 'Currency Position:        '.give_get_option('currency_position', 'before')."\n";
163
+	$return .= 'Decimal Separator:        '.give_get_option('decimal_separator', '.')."\n";
164
+	$return .= 'Thousands Separator:      '.give_get_option('thousands_separator', ',')."\n";
165 165
 
166
-	$return = apply_filters( 'give_sysinfo_after_give_config', $return );
166
+	$return = apply_filters('give_sysinfo_after_give_config', $return);
167 167
 
168 168
 	// GIVE pages
169
-	$return .= "\n" . '-- Give Page Configuration' . "\n\n";
170
-	$return .= 'Success Page:             ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" );
171
-	$return .= 'Failure Page:             ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" );
172
-	$return .= 'Give Forms Slug:           ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" );
169
+	$return .= "\n".'-- Give Page Configuration'."\n\n";
170
+	$return .= 'Success Page:             '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n");
171
+	$return .= 'Failure Page:             '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n");
172
+	$return .= 'Give Forms Slug:           '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n");
173 173
 
174
-	$return = apply_filters( 'give_sysinfo_after_give_pages', $return );
174
+	$return = apply_filters('give_sysinfo_after_give_pages', $return);
175 175
 
176 176
 	// GIVE gateways
177
-	$return .= "\n" . '-- Give Gateway Configuration' . "\n\n";
177
+	$return .= "\n".'-- Give Gateway Configuration'."\n\n";
178 178
 
179 179
 	$active_gateways = give_get_enabled_payment_gateways();
180
-	if ( $active_gateways ) {
181
-		$default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
182
-		if ( $default_gateway_is_active ) {
183
-			$default_gateway = give_get_default_gateway( null );
184
-			$default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
180
+	if ($active_gateways) {
181
+		$default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null));
182
+		if ($default_gateway_is_active) {
183
+			$default_gateway = give_get_default_gateway(null);
184
+			$default_gateway = $active_gateways[$default_gateway]['admin_label'];
185 185
 		} else {
186 186
 			$default_gateway = 'Test Payment';
187 187
 		}
188 188
 
189 189
 		$gateways = array();
190
-		foreach ( $active_gateways as $gateway ) {
190
+		foreach ($active_gateways as $gateway) {
191 191
 			$gateways[] = $gateway['admin_label'];
192 192
 		}
193 193
 
194
-		$return .= 'Enabled Gateways:         ' . implode( ', ', $gateways ) . "\n";
195
-		$return .= 'Default Gateway:          ' . $default_gateway . "\n";
194
+		$return .= 'Enabled Gateways:         '.implode(', ', $gateways)."\n";
195
+		$return .= 'Default Gateway:          '.$default_gateway."\n";
196 196
 	} else {
197
-		$return .= 'Enabled Gateways:         None' . "\n";
197
+		$return .= 'Enabled Gateways:         None'."\n";
198 198
 	}
199 199
 
200
-	$return = apply_filters( 'give_sysinfo_after_give_gateways', $return );
200
+	$return = apply_filters('give_sysinfo_after_give_gateways', $return);
201 201
 
202 202
 	// GIVE Templates
203
-	$dir = get_stylesheet_directory() . '/give_templates/*';
204
-	if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) {
205
-		$return .= "\n" . '-- Give Template Overrides' . "\n\n";
203
+	$dir = get_stylesheet_directory().'/give_templates/*';
204
+	if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) {
205
+		$return .= "\n".'-- Give Template Overrides'."\n\n";
206 206
 
207
-		foreach ( glob( $dir ) as $file ) {
208
-			$return .= 'Filename:                 ' . basename( $file ) . "\n";
207
+		foreach (glob($dir) as $file) {
208
+			$return .= 'Filename:                 '.basename($file)."\n";
209 209
 		}
210 210
 
211
-		$return = apply_filters( 'give_sysinfo_after_give_templates', $return );
211
+		$return = apply_filters('give_sysinfo_after_give_templates', $return);
212 212
 	}
213 213
 
214 214
 	// Must-use plugins
215 215
 	$muplugins = get_mu_plugins();
216
-	if ( count( $muplugins > 0 ) ) {
217
-		$return .= "\n" . '-- Must-Use Plugins' . "\n\n";
216
+	if (count($muplugins > 0)) {
217
+		$return .= "\n".'-- Must-Use Plugins'."\n\n";
218 218
 
219
-		foreach ( $muplugins as $plugin => $plugin_data ) {
220
-			$return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
219
+		foreach ($muplugins as $plugin => $plugin_data) {
220
+			$return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n";
221 221
 		}
222 222
 
223
-		$return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return );
223
+		$return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return);
224 224
 	}
225 225
 
226 226
 	// WordPress active plugins
227
-	$return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
227
+	$return .= "\n".'-- WordPress Active Plugins'."\n\n";
228 228
 
229 229
 	$plugins        = get_plugins();
230
-	$active_plugins = get_option( 'active_plugins', array() );
230
+	$active_plugins = get_option('active_plugins', array());
231 231
 
232
-	foreach ( $plugins as $plugin_path => $plugin ) {
233
-		if ( ! in_array( $plugin_path, $active_plugins ) ) {
232
+	foreach ($plugins as $plugin_path => $plugin) {
233
+		if ( ! in_array($plugin_path, $active_plugins)) {
234 234
 			continue;
235 235
 		}
236 236
 
237
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
237
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
238 238
 	}
239 239
 
240
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return );
240
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins', $return);
241 241
 
242 242
 	// WordPress inactive plugins
243
-	$return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
243
+	$return .= "\n".'-- WordPress Inactive Plugins'."\n\n";
244 244
 
245
-	foreach ( $plugins as $plugin_path => $plugin ) {
246
-		if ( in_array( $plugin_path, $active_plugins ) ) {
245
+	foreach ($plugins as $plugin_path => $plugin) {
246
+		if (in_array($plugin_path, $active_plugins)) {
247 247
 			continue;
248 248
 		}
249 249
 
250
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
250
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
251 251
 	}
252 252
 
253
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return );
253
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return);
254 254
 
255
-	if ( is_multisite() ) {
255
+	if (is_multisite()) {
256 256
 		// WordPress Multisite active plugins
257
-		$return .= "\n" . '-- Network Active Plugins' . "\n\n";
257
+		$return .= "\n".'-- Network Active Plugins'."\n\n";
258 258
 
259 259
 		$plugins        = wp_get_active_network_plugins();
260
-		$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
260
+		$active_plugins = get_site_option('active_sitewide_plugins', array());
261 261
 
262
-		foreach ( $plugins as $plugin_path ) {
263
-			$plugin_base = plugin_basename( $plugin_path );
262
+		foreach ($plugins as $plugin_path) {
263
+			$plugin_base = plugin_basename($plugin_path);
264 264
 
265
-			if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
265
+			if ( ! array_key_exists($plugin_base, $active_plugins)) {
266 266
 				continue;
267 267
 			}
268 268
 
269
-			$plugin = get_plugin_data( $plugin_path );
270
-			$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
269
+			$plugin = get_plugin_data($plugin_path);
270
+			$return .= $plugin['Name'].': '.$plugin['Version']."\n";
271 271
 		}
272 272
 
273
-		$return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return );
273
+		$return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return);
274 274
 	}
275 275
 
276 276
 	// Server configuration (really just versioning)
277
-	$return .= "\n" . '-- Webserver Configuration' . "\n\n";
278
-	$return .= 'PHP Version:              ' . PHP_VERSION . "\n";
279
-	$return .= 'MySQL Version:            ' . $wpdb->db_version() . "\n";
280
-	$return .= 'Webserver Info:           ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
277
+	$return .= "\n".'-- Webserver Configuration'."\n\n";
278
+	$return .= 'PHP Version:              '.PHP_VERSION."\n";
279
+	$return .= 'MySQL Version:            '.$wpdb->db_version()."\n";
280
+	$return .= 'Webserver Info:           '.$_SERVER['SERVER_SOFTWARE']."\n";
281 281
 
282
-	$return = apply_filters( 'give_sysinfo_after_webserver_config', $return );
282
+	$return = apply_filters('give_sysinfo_after_webserver_config', $return);
283 283
 
284 284
 	// PHP configs... now we're getting to the important stuff
285
-	$return .= "\n" . '-- PHP Configuration' . "\n\n";
286
-	$return .= 'Safe Mode:                ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
287
-	$return .= 'Memory Limit:             ' . ini_get( 'memory_limit' ) . "\n";
288
-	$return .= 'Upload Max Size:          ' . ini_get( 'upload_max_filesize' ) . "\n";
289
-	$return .= 'Post Max Size:            ' . ini_get( 'post_max_size' ) . "\n";
290
-	$return .= 'Upload Max Filesize:      ' . ini_get( 'upload_max_filesize' ) . "\n";
291
-	$return .= 'Time Limit:               ' . ini_get( 'max_execution_time' ) . "\n";
292
-	$return .= 'Max Input Vars:           ' . ini_get( 'max_input_vars' ) . "\n";
293
-	$return .= 'URL-aware fopen:          ' . ( ini_get( 'allow_url_fopen' ) ? 'On (' . ini_get( 'allow_url_fopen' ) . ')' : 'N/A' ) . "\n";
294
-	$return .= 'Display Errors:           ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
295
-
296
-	$return = apply_filters( 'give_sysinfo_after_php_config', $return );
285
+	$return .= "\n".'-- PHP Configuration'."\n\n";
286
+	$return .= 'Safe Mode:                '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n");
287
+	$return .= 'Memory Limit:             '.ini_get('memory_limit')."\n";
288
+	$return .= 'Upload Max Size:          '.ini_get('upload_max_filesize')."\n";
289
+	$return .= 'Post Max Size:            '.ini_get('post_max_size')."\n";
290
+	$return .= 'Upload Max Filesize:      '.ini_get('upload_max_filesize')."\n";
291
+	$return .= 'Time Limit:               '.ini_get('max_execution_time')."\n";
292
+	$return .= 'Max Input Vars:           '.ini_get('max_input_vars')."\n";
293
+	$return .= 'URL-aware fopen:          '.(ini_get('allow_url_fopen') ? 'On ('.ini_get('allow_url_fopen').')' : 'N/A')."\n";
294
+	$return .= 'Display Errors:           '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
295
+
296
+	$return = apply_filters('give_sysinfo_after_php_config', $return);
297 297
 
298 298
 	// PHP extensions and such
299
-	$return .= "\n" . '-- PHP Extensions' . "\n\n";
300
-	$return .= 'cURL:                     ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
299
+	$return .= "\n".'-- PHP Extensions'."\n\n";
300
+	$return .= 'cURL:                     '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
301 301
 
302 302
 	//cURL version
303
-	if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) {
303
+	if (function_exists('curl_init') && function_exists('curl_version')) {
304 304
 		$curl_values = curl_version();
305
-		$return .= 'cURL Version:             ' . $curl_values["version"] . "\n";
305
+		$return .= 'cURL Version:             '.$curl_values["version"]."\n";
306 306
 	}
307
-	$return .= 'zlib:                     ' . ( function_exists( 'gzcompress' ) ? 'Supported' : 'Not Supported' ) . "\n";
308
-	$return .= 'GD:                       ' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'Supported' : 'Not Supported' ) . "\n";
309
-	$return .= 'fsockopen:                ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
310
-	$return .= 'SOAP Client:              ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n";
311
-	$return .= 'Suhosin:                  ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
312
-	$return .= 'DOM:                      ' . ( extension_loaded( 'dom' ) ? 'Installed' : 'Not Installed' ) . "\n";
313
-	$return .= 'MBString:                 ' . ( extension_loaded( 'mbstring' ) ? 'Installed' : 'Not Installed' ) . "\n";
307
+	$return .= 'zlib:                     '.(function_exists('gzcompress') ? 'Supported' : 'Not Supported')."\n";
308
+	$return .= 'GD:                       '.((extension_loaded('gd') && function_exists('gd_info')) ? 'Supported' : 'Not Supported')."\n";
309
+	$return .= 'fsockopen:                '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
310
+	$return .= 'SOAP Client:              '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
311
+	$return .= 'Suhosin:                  '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
312
+	$return .= 'DOM:                      '.(extension_loaded('dom') ? 'Installed' : 'Not Installed')."\n";
313
+	$return .= 'MBString:                 '.(extension_loaded('mbstring') ? 'Installed' : 'Not Installed')."\n";
314 314
 
315
-	$return = apply_filters( 'give_sysinfo_after_php_ext', $return );
315
+	$return = apply_filters('give_sysinfo_after_php_ext', $return);
316 316
 
317 317
 	// Session stuff
318
-	$return .= "\n" . '-- Session Configuration' . "\n\n";
319
-	$return .= 'Give Use Sessions:        ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n";
320
-	$return .= 'Session:                  ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
318
+	$return .= "\n".'-- Session Configuration'."\n\n";
319
+	$return .= 'Give Use Sessions:        '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n";
320
+	$return .= 'Session:                  '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n";
321 321
 
322 322
 	// The rest of this is only relevant is session is enabled
323
-	if ( isset( $_SESSION ) ) {
324
-		$return .= 'Session Name:             ' . esc_html__( ini_get( 'session.name' ) ) . "\n";
325
-		$return .= 'Cookie Path:              ' . esc_html__( ini_get( 'session.cookie_path' ) ) . "\n";
326
-		$return .= 'Save Path:                ' . esc_html__( ini_get( 'session.save_path' ) ) . "\n";
327
-		$return .= 'Use Cookies:              ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
328
-		$return .= 'Use Only Cookies:         ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
323
+	if (isset($_SESSION)) {
324
+		$return .= 'Session Name:             '.esc_html__(ini_get('session.name'))."\n";
325
+		$return .= 'Cookie Path:              '.esc_html__(ini_get('session.cookie_path'))."\n";
326
+		$return .= 'Save Path:                '.esc_html__(ini_get('session.save_path'))."\n";
327
+		$return .= 'Use Cookies:              '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
328
+		$return .= 'Use Only Cookies:         '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
329 329
 	}
330 330
 
331
-	$return = apply_filters( 'give_sysinfo_after_session_config', $return );
331
+	$return = apply_filters('give_sysinfo_after_session_config', $return);
332 332
 
333
-	$return .= "\n" . '### End System Info ###';
333
+	$return .= "\n".'### End System Info ###';
334 334
 
335 335
 	return $return;
336 336
 }
@@ -344,17 +344,17 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function give_tools_sysinfo_download() {
346 346
 
347
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
347
+	if ( ! current_user_can('manage_give_settings')) {
348 348
 		return;
349 349
 	}
350 350
 
351 351
 	nocache_headers();
352 352
 
353
-	header( 'Content-Type: text/plain' );
354
-	header( 'Content-Disposition: attachment; filename="give-system-info.txt"' );
353
+	header('Content-Type: text/plain');
354
+	header('Content-Disposition: attachment; filename="give-system-info.txt"');
355 355
 
356
-	echo wp_strip_all_tags( $_POST['give-sysinfo'] );
356
+	echo wp_strip_all_tags($_POST['give-sysinfo']);
357 357
 	give_die();
358 358
 }
359 359
 
360
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' );
361 360
\ No newline at end of file
361
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download');
362 362
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 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
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html__( 'Welcome to Give', 'give' ),
55
-			esc_html__( 'Welcome to Give', 'give' ),
54
+			esc_html__('Welcome to Give', 'give'),
55
+			esc_html__('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html__( 'Give Changelog', 'give' ),
64
-			esc_html__( 'Give Changelog', 'give' ),
63
+			esc_html__('Give Changelog', 'give'),
64
+			esc_html__('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html__( 'Getting started with Give', 'give' ),
73
-			esc_html__( 'Getting started with Give', 'give' ),
72
+			esc_html__('Getting started with Give', 'give'),
73
+			esc_html__('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html__( 'The people that build Give', 'give' ),
82
-			esc_html__( 'The people that build Give', 'give' ),
81
+			esc_html__('The people that build Give', 'give'),
82
+			esc_html__('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h1 class="nav-tab-wrapper">
221
-			<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' ) ) ); ?>">
222
-				<?php esc_html_e( "About Give", 'give' ); ?>
221
+			<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'))); ?>">
222
+				<?php esc_html_e("About Give", 'give'); ?>
223 223
 			</a>
224
-			<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' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<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'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<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' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<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'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h1>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html__( 'Welcome to Give %s', 'give' ),
251
+					esc_html__('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<div class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( '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. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr__( 'View the Give plugin documentation online', 'give' )
261
+					__('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. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr__('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></div>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html__( 'Version %s', 'give' ),
274
+					esc_html__('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -283,15 +283,15 @@  discard block
 block discarded – undo
283 283
 			<div class="feature-section clearfix introduction">
284 284
 
285 285
 				<div class="video feature-section-item">
286
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
286
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
287 287
 
288 288
 				</div>
289 289
 
290 290
 				<div class="content feature-section-item last-feature">
291 291
 
292
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
292
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
293 293
 
294
-					<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>
294
+					<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>
295 295
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
296 296
 						<span class="dashicons dashicons-external"></span></a>
297 297
 
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 
305 305
 				<div class="content feature-section-item">
306 306
 
307
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
307
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
308 308
 
309
-					<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>
309
+					<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>
310 310
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
311 311
 						<span class="dashicons dashicons-external"></span></a>
312 312
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 				<div class="content  feature-section-item last-feature">
316 316
 
317
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
317
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
318 318
 
319 319
 				</div>
320 320
 
@@ -334,22 +334,22 @@  discard block
 block discarded – undo
334 334
 	 * @return void
335 335
 	 */
336 336
 	public function changelog_screen() {
337
-		list( $display_version ) = explode( '-', GIVE_VERSION );
337
+		list($display_version) = explode('-', GIVE_VERSION);
338 338
 		?>
339 339
 		<div class="wrap about-wrap">
340
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
340
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
341 341
 
342 342
 			<div class="about-text"><?php
343 343
 				printf(
344 344
 					/* translators: %s: Give version */
345
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
345
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
346 346
 					$display_version
347 347
 				);
348 348
 			?></div>
349 349
 			<div class="give-badge"><?php
350 350
 				printf(
351 351
 					/* translators: %s: Give version */
352
-					esc_html__( 'Version %s', 'give' ),
352
+					esc_html__('Version %s', 'give'),
353 353
 					$display_version
354 354
 				);
355 355
 			?></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			<?php $this->tabs(); ?>
358 358
 
359 359
 			<div class="changelog">
360
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
360
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
361 361
 
362 362
 				<div class="feature-section">
363 363
 					<?php echo $this->parse_readme(); ?>
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
 			</div>
366 366
 
367 367
 			<div class="return-to-dashboard">
368
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
368
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
369 369
 					'post_type' => 'give_forms',
370 370
 					'page'      => 'give-settings'
371
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
371
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
372 372
 			</div>
373 373
 		</div>
374 374
 	<?php
@@ -382,29 +382,29 @@  discard block
 block discarded – undo
382 382
 	 * @return void
383 383
 	 */
384 384
 	public function getting_started_screen() {
385
-		list( $display_version ) = explode( '-', GIVE_VERSION );
385
+		list($display_version) = explode('-', GIVE_VERSION);
386 386
 		?>
387 387
 		<div class="wrap about-wrap get-started">
388 388
 			<h1 class="welcome-h1"><?php
389 389
 				printf(
390 390
 					/* translators: %s: Give version */
391
-					esc_html__( 'Give %s - Getting Started Guide', 'give' ),
391
+					esc_html__('Give %s - Getting Started Guide', 'give'),
392 392
 					$display_version
393 393
 				);
394 394
 			?></h1>
395 395
 
396 396
 			<?php give_social_media_elements() ?>
397 397
 
398
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
398
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
399 399
 
400
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
400
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
401 401
 
402 402
 			<?php give_get_newsletter() ?>
403 403
 
404 404
 			<div class="give-badge"><?php
405 405
 				printf(
406 406
 					/* translators: %s: Give version */
407
-					esc_html__( 'Version %s', 'give' ),
407
+					esc_html__('Version %s', 'give'),
408 408
 					$display_version
409 409
 				);
410 410
 			?></div>
@@ -412,17 +412,17 @@  discard block
 block discarded – undo
412 412
 			<?php $this->tabs(); ?>
413 413
 
414 414
 
415
-			<div 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 ); ?></div>
415
+			<div 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); ?></div>
416 416
 
417 417
 
418 418
 			<div class="feature-section clearfix">
419 419
 
420 420
 				<div class="content feature-section-item">
421
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
421
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
422 422
 
423
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
423
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
424 424
 
425
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
425
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
426 426
 				</div>
427 427
 
428 428
 				<div class="content feature-section-item last-feature">
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 				</div>
440 440
 
441 441
 				<div class="content feature-section-item last-feature">
442
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
442
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
443 443
 
444
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
444
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
445 445
 				</div>
446 446
 
447 447
 			</div>
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 			<div class="feature-section clearfix">
451 451
 
452 452
 				<div class="content feature-section-item add-content">
453
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
453
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
454 454
 
455
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
455
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
456 456
 
457
-					<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>
457
+					<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>
458 458
 				</div>
459 459
 
460 460
 				<div class="content feature-section-item last-feature">
@@ -471,9 +471,9 @@  discard block
 block discarded – undo
471 471
 				</div>
472 472
 
473 473
 				<div class="content feature-section-item last-feature">
474
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
474
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
475 475
 
476
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
476
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
477 477
 				</div>
478 478
 
479 479
 
@@ -493,38 +493,38 @@  discard block
 block discarded – undo
493 493
 	 * @return void
494 494
 	 */
495 495
 	public function credits_screen() {
496
-		list( $display_version ) = explode( '-', GIVE_VERSION );
496
+		list($display_version) = explode('-', GIVE_VERSION);
497 497
 		?>
498 498
 		<div class="wrap about-wrap">
499 499
 			<h1 class="welcome-h1"><?php
500 500
 				printf(
501 501
 					/* translators: %s: Give version */
502
-					esc_html__( 'Give %s - Credits', 'give' ),
502
+					esc_html__('Give %s - Credits', 'give'),
503 503
 					$display_version
504 504
 				);
505 505
 			?></h1>
506 506
 
507 507
 			<?php give_social_media_elements() ?>
508 508
 
509
-			<div class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></div>
509
+			<div class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></div>
510 510
 
511
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
511
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
512 512
 
513
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
513
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
514 514
 
515 515
 			<?php give_get_newsletter() ?>
516 516
 
517 517
 			<div class="give-badge"><?php
518 518
 				printf(
519 519
 					/* translators: %s: Give version */
520
-					esc_html__( 'Version %s', 'give' ),
520
+					esc_html__('Version %s', 'give'),
521 521
 					$display_version
522 522
 				);
523 523
 			?></div>
524 524
 
525 525
 			<?php $this->tabs(); ?>
526 526
 
527
-			<p class="about-description"><?php printf( __( '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' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
527
+			<p class="about-description"><?php printf(__('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'), esc_url('https://github.com/WordImpress/give')); ?></p>
528 528
 
529 529
 			<?php echo $this->contributors(); ?>
530 530
 		</div>
@@ -539,21 +539,21 @@  discard block
 block discarded – undo
539 539
 	 * @return string $readme HTML formatted readme file
540 540
 	 */
541 541
 	public function parse_readme() {
542
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
542
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
543 543
 
544
-		if ( ! $file ) {
545
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
544
+		if ( ! $file) {
545
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
546 546
 		} else {
547
-			$readme = file_get_contents( $file );
548
-			$readme = nl2br( esc_html__( $readme ) );
549
-			$readme = explode( '== Changelog ==', $readme );
550
-			$readme = end( $readme );
551
-
552
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
553
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
554
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
555
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
556
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
547
+			$readme = file_get_contents($file);
548
+			$readme = nl2br(esc_html__($readme));
549
+			$readme = explode('== Changelog ==', $readme);
550
+			$readme = end($readme);
551
+
552
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
553
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
554
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
555
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
556
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
557 557
 		}
558 558
 
559 559
 		return $readme;
@@ -570,27 +570,27 @@  discard block
 block discarded – undo
570 570
 	public function contributors() {
571 571
 		$contributors = $this->get_contributors();
572 572
 
573
-		if ( empty( $contributors ) ) {
573
+		if (empty($contributors)) {
574 574
 			return '';
575 575
 		}
576 576
 
577 577
 		$contributor_list = '<ul class="wp-people-group">';
578 578
 
579
-		foreach ( $contributors as $contributor ) {
579
+		foreach ($contributors as $contributor) {
580 580
 			$contributor_list .= '<li class="wp-person">';
581
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
582
-				esc_url( 'https://github.com/' . $contributor->login ),
581
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
582
+				esc_url('https://github.com/'.$contributor->login),
583 583
 				esc_html__(
584 584
 					sprintf(
585 585
 						/* translators: %s: github contributor */
586
-						esc_html__( 'View %s', 'give' ),
586
+						esc_html__('View %s', 'give'),
587 587
 						$contributor->login
588 588
 					)
589 589
 				)
590 590
 			);
591
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html__( $contributor->login ) );
591
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html__($contributor->login));
592 592
 			$contributor_list .= '</a>';
593
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html__( $contributor->login ) );
593
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html__($contributor->login));
594 594
 			$contributor_list .= '</a>';
595 595
 			$contributor_list .= '</li>';
596 596
 		}
@@ -608,25 +608,25 @@  discard block
 block discarded – undo
608 608
 	 * @return array $contributors List of contributors
609 609
 	 */
610 610
 	public function get_contributors() {
611
-		$contributors = get_transient( 'give_contributors' );
611
+		$contributors = get_transient('give_contributors');
612 612
 
613
-		if ( false !== $contributors ) {
613
+		if (false !== $contributors) {
614 614
 			return $contributors;
615 615
 		}
616 616
 
617
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
617
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
618 618
 
619
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
619
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
620 620
 			return array();
621 621
 		}
622 622
 
623
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
623
+		$contributors = json_decode(wp_remote_retrieve_body($response));
624 624
 
625
-		if ( ! is_array( $contributors ) ) {
625
+		if ( ! is_array($contributors)) {
626 626
 			return array();
627 627
 		}
628 628
 
629
-		set_transient( 'give_contributors', $contributors, 3600 );
629
+		set_transient('give_contributors', $contributors, 3600);
630 630
 
631 631
 		return $contributors;
632 632
 	}
@@ -645,24 +645,24 @@  discard block
 block discarded – undo
645 645
 
646 646
 
647 647
 		// Bail if no activation redirect
648
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
648
+		if ( ! get_transient('_give_activation_redirect')) {
649 649
 			return;
650 650
 		}
651 651
 
652 652
 		// Delete the redirect transient
653
-		delete_transient( '_give_activation_redirect' );
653
+		delete_transient('_give_activation_redirect');
654 654
 
655 655
 		// Bail if activating from network, or bulk
656
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
656
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
657 657
 			return;
658 658
 		}
659 659
 
660
-		$upgrade = get_option( 'give_version_upgraded_from' );
660
+		$upgrade = get_option('give_version_upgraded_from');
661 661
 
662
-		if ( ! $upgrade ) { // First time install
663
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
662
+		if ( ! $upgrade) { // First time install
663
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
664 664
 			exit;
665
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
665
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
666 666
 
667 667
 		} else { // Welcome is NOT disabled in settings
668 668
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.