Test Failed
Pull Request — master (#2225)
by Devin
04:31
created
templates/email-login-form.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@  discard block
 block discarded – undo
7 7
 
8 8
 global $give_access_form_outputted;
9 9
 $show_form = true;
10
-$email     = isset( $_POST['give_email'] ) ? $_POST['give_email'] : '';
10
+$email     = isset($_POST['give_email']) ? $_POST['give_email'] : '';
11 11
 
12 12
 // reCAPTCHA
13
-$recaptcha_key    = give_get_option( 'recaptcha_key' );
14
-$recaptcha_secret = give_get_option( 'recaptcha_secret' );
15
-$enable_recaptcha = ( ! empty( $recaptcha_key ) && ! empty( $recaptcha_secret ) ) ? true : false;
13
+$recaptcha_key    = give_get_option('recaptcha_key');
14
+$recaptcha_secret = give_get_option('recaptcha_secret');
15
+$enable_recaptcha = ( ! empty($recaptcha_key) && ! empty($recaptcha_secret)) ? true : false;
16 16
 
17 17
 // Only output the form once.
18
-if ( $give_access_form_outputted ) {
18
+if ($give_access_form_outputted) {
19 19
 	return;
20 20
 }
21 21
 
22 22
 // Form submission
23
-if ( is_email( $email ) && wp_verify_nonce( $_POST['_wpnonce'], 'give' ) ) {
23
+if (is_email($email) && wp_verify_nonce($_POST['_wpnonce'], 'give')) {
24 24
 
25 25
 	// Use reCAPTCHA
26
-	if ( $enable_recaptcha ) {
26
+	if ($enable_recaptcha) {
27 27
 
28 28
 		$args = array(
29 29
 			'secret'   => $recaptcha_secret,
@@ -31,68 +31,68 @@  discard block
 block discarded – undo
31 31
 			'remoteip' => $_POST['give_ip'],
32 32
 		);
33 33
 
34
-		if ( ! empty( $args['response'] ) ) {
35
-			$request = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array(
34
+		if ( ! empty($args['response'])) {
35
+			$request = wp_remote_post('https://www.google.com/recaptcha/api/siteverify', array(
36 36
 				'body' => $args,
37
-			) );
38
-			if ( ! is_wp_error( $request ) || 200 == wp_remote_retrieve_response_code( $request ) ) {
37
+			));
38
+			if ( ! is_wp_error($request) || 200 == wp_remote_retrieve_response_code($request)) {
39 39
 
40
-				$response = json_decode( $request['body'], true );
40
+				$response = json_decode($request['body'], true);
41 41
 
42 42
 				// reCAPTCHA fail
43
-				if ( ! $response['success'] ) {
44
-					give_set_error( 'give_recaptcha_test_failed', apply_filters( 'give_recaptcha_test_failed_message', esc_html__( 'reCAPTCHA test failed.', 'give' ) ) );
43
+				if ( ! $response['success']) {
44
+					give_set_error('give_recaptcha_test_failed', apply_filters('give_recaptcha_test_failed_message', esc_html__('reCAPTCHA test failed.', 'give')));
45 45
 				}
46 46
 			} else {
47 47
 
48 48
 				// Connection issue
49
-				give_set_error( 'give_recaptcha_connection_issue', apply_filters( 'give_recaptcha_connection_issue_message', esc_html__( 'Unable to connect to reCAPTCHA server.', 'give' ) ) );
49
+				give_set_error('give_recaptcha_connection_issue', apply_filters('give_recaptcha_connection_issue_message', esc_html__('Unable to connect to reCAPTCHA server.', 'give')));
50 50
 
51 51
 			}
52 52
 		} // End if().
53 53
 		else {
54 54
 
55
-			give_set_error( 'give_recaptcha_failed', apply_filters( 'give_recaptcha_failed_message', esc_html__( 'It looks like the reCAPTCHA test has failed.', 'give' ) ) );
55
+			give_set_error('give_recaptcha_failed', apply_filters('give_recaptcha_failed_message', esc_html__('It looks like the reCAPTCHA test has failed.', 'give')));
56 56
 
57 57
 		}
58 58
 	}
59 59
 
60 60
 	// If no errors or only expired token key error - then send email
61
-	if ( ! give_get_errors() ) {
61
+	if ( ! give_get_errors()) {
62 62
 
63
-		$donor = Give()->donors->get_donor_by( 'email', $email );
63
+		$donor = Give()->donors->get_donor_by('email', $email);
64 64
 
65
-		if ( isset( $donor->id ) ) {
66
-			if ( Give()->email_access->can_send_email( $donor->id ) ) {
67
-				Give()->email_access->send_email( $donor->id, $email );
65
+		if (isset($donor->id)) {
66
+			if (Give()->email_access->can_send_email($donor->id)) {
67
+				Give()->email_access->send_email($donor->id, $email);
68 68
 				$show_form = false;
69 69
 			}
70 70
 		} else {
71
-			give_set_error( 'give_no_donor_email_exists', apply_filters( 'give_no_donor_email_exists_message', __( 'It looks like that donor email address does not exist.', 'give' ) ) );
71
+			give_set_error('give_no_donor_email_exists', apply_filters('give_no_donor_email_exists_message', __('It looks like that donor email address does not exist.', 'give')));
72 72
 		}
73 73
 	}
74 74
 }// End if().
75 75
 
76 76
 // Print any messages & errors
77
-Give()->notices->render_frontend_notices( 0 );
77
+Give()->notices->render_frontend_notices(0);
78 78
 
79 79
 // Show the email login form?
80
-if ( $show_form ) { ?>
80
+if ($show_form) { ?>
81 81
 	<div class="give-form">
82 82
 
83 83
 		<?php
84
-		if ( ! give_get_errors() ) {
85
-			Give()->notices->print_frontend_notice( apply_filters( 'give_email_access_message', __( 'Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give' ) ), true );
84
+		if ( ! give_get_errors()) {
85
+			Give()->notices->print_frontend_notice(apply_filters('give_email_access_message', __('Please enter the email address you used for your donation. A verification email containing an access link will be sent to you.', 'give')), true);
86 86
 		} ?>
87 87
 
88 88
 		<form method="post" action="" id="give-email-access-form">
89
-			<label for="give-email"><?php esc_html__( 'Donation Email:', 'give' ); ?></label>
90
-			<input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e( 'Your donation email', 'give' ); ?>" />
91
-			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce( 'give' ); ?>" />
89
+			<label for="give-email"><?php esc_html__('Donation Email:', 'give'); ?></label>
90
+			<input id="give-email" type="email" name="give_email" value="" placeholder="<?php esc_attr_e('Your donation email', 'give'); ?>" />
91
+			<input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('give'); ?>" />
92 92
 
93 93
 			<?php
94 94
 			// Enable reCAPTCHA?
95
-			if ( $enable_recaptcha ) { ?>
95
+			if ($enable_recaptcha) { ?>
96 96
 
97 97
 				<script>
98 98
 									//IP verify for reCAPTCHA
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 				<input type="hidden" name="give_ip" class="give_ip" value="" />
111 111
 			<?php } ?>
112 112
 
113
-			<input type="submit" class="give-submit" value="<?php esc_attr_e( 'Email access token', 'give' ); ?>" />
113
+			<input type="submit" class="give-submit" value="<?php esc_attr_e('Email access token', 'give'); ?>" />
114 114
 		</form>
115 115
 	</div>
116 116
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	Give()->notices->print_frontend_notice(
122 122
 		sprintf(
123 123
 		/* translators: %s: user email address */
124
-			esc_html__( 'An email with an access link has been sent to %s.', 'give' ),
124
+			esc_html__('An email with an access link has been sent to %s.', 'give'),
125 125
 			$email
126 126
 		),
127 127
 		true,
Please login to merge, or discard this patch.
templates/shortcode-receipt.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@  discard block
 block discarded – undo
6 6
 global $give_receipt_args, $payment;
7 7
 
8 8
 // Validation: Ensure $payment var is set.
9
-if ( empty( $payment ) ) {
10
-	$payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0;
9
+if (empty($payment)) {
10
+	$payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0;
11 11
 }
12 12
 
13 13
 // Double-Validation: Check for $payment global.
14
-if ( empty( $payment ) ) {
15
-	Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) );
14
+if (empty($payment)) {
15
+	Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give'));
16 16
 
17 17
 	return;
18 18
 }
19 19
 
20 20
 $donation_id  = $payment->ID;
21
-$form_id      = give_get_payment_meta( $donation_id, '_give_payment_form_id', true );
22
-$meta         = give_get_payment_meta( $donation_id );
23
-$donation     = give_get_payment_form_title( $meta );
24
-$user         = give_get_payment_meta_user_info( $donation_id );
25
-$email        = give_get_payment_user_email( $donation_id );
21
+$form_id      = give_get_payment_meta($donation_id, '_give_payment_form_id', true);
22
+$meta         = give_get_payment_meta($donation_id);
23
+$donation     = give_get_payment_form_title($meta);
24
+$user         = give_get_payment_meta_user_info($donation_id);
25
+$email        = give_get_payment_user_email($donation_id);
26 26
 $status       = $payment->post_status;
27
-$status_label = give_get_payment_status( $payment, true );
27
+$status_label = give_get_payment_status($payment, true);
28 28
 
29 29
 /**
30 30
  * Generate Donation Receipt Arguments.
@@ -35,50 +35,50 @@  discard block
 block discarded – undo
35 35
  * @since 1.8.8
36 36
  */
37 37
 $give_receipt_args['donation_receipt']['donor'] = array(
38
-	'name'    => __( 'Donor', 'give' ),
39
-	'value'   => $user['first_name'] . ' ' . $user['last_name'],
38
+	'name'    => __('Donor', 'give'),
39
+	'value'   => $user['first_name'].' '.$user['last_name'],
40 40
 	'display' => $give_receipt_args['donor'],
41 41
 );
42 42
 
43 43
 $give_receipt_args['donation_receipt']['date'] = array(
44
-	'name'    => __( 'Date', 'give' ),
45
-	'value'   => date_i18n( give_date_format(), strtotime( $meta['date'] ) ),
44
+	'name'    => __('Date', 'give'),
45
+	'value'   => date_i18n(give_date_format(), strtotime($meta['date'])),
46 46
 	'display' => $give_receipt_args['date'],
47 47
 );
48 48
 
49 49
 $give_receipt_args['donation_receipt']['total_donation'] = array(
50
-	'name'    => __( 'Total Donation', 'give' ),
51
-	'value'   => give_payment_amount( $donation_id ),
50
+	'name'    => __('Total Donation', 'give'),
51
+	'value'   => give_payment_amount($donation_id),
52 52
 	'display' => $give_receipt_args['price'],
53 53
 );
54 54
 
55 55
 $give_receipt_args['donation_receipt']['donation'] = array(
56
-	'name'    => __( 'Donation', 'give' ),
56
+	'name'    => __('Donation', 'give'),
57 57
 	'value'   => $donation,
58 58
 	'display' => true,
59 59
 );
60 60
 
61 61
 $give_receipt_args['donation_receipt']['donation_status'] = array(
62
-	'name'    => __( 'Donation Status', 'give' ),
63
-	'value'   => esc_attr( $status_label ),
62
+	'name'    => __('Donation Status', 'give'),
63
+	'value'   => esc_attr($status_label),
64 64
 	'display' => $give_receipt_args['payment_status'],
65 65
 );
66 66
 
67 67
 $give_receipt_args['donation_receipt']['donation_id'] = array(
68
-	'name'    => __( 'Donation ID', 'give' ),
68
+	'name'    => __('Donation ID', 'give'),
69 69
 	'value'   => $donation_id,
70 70
 	'display' => $give_receipt_args['payment_id'],
71 71
 );
72 72
 
73 73
 $give_receipt_args['donation_receipt']['payment_key'] = array(
74
-	'name'    => __( 'Payment Key', 'give' ),
75
-	'value'   => get_post_meta( $donation_id, '_give_payment_purchase_key', true ),
74
+	'name'    => __('Payment Key', 'give'),
75
+	'value'   => get_post_meta($donation_id, '_give_payment_purchase_key', true),
76 76
 	'display' => $give_receipt_args['payment_key'],
77 77
 );
78 78
 
79 79
 $give_receipt_args['donation_receipt']['payment_method'] = array(
80
-	'name'    => __( 'Payment Method', 'give' ),
81
-	'value'   => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ),
80
+	'name'    => __('Payment Method', 'give'),
81
+	'value'   => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)),
82 82
 	'display' => $give_receipt_args['payment_method'],
83 83
 );
84 84
 
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
  *
94 94
  * @since 1.8.8
95 95
  */
96
-$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id );
96
+$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id);
97 97
 
98 98
 // When the donation were made through offline donation, We won't show receipt and payment status though.
99
-if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) {
99
+if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) {
100 100
 
101 101
 	/**
102 102
 	 * Before the offline donation receipt content starts.
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 	 * @param Give_Payment $payment           Donation payment object.
107 107
 	 * @param array        $give_receipt_args Receipt Arguments.
108 108
 	 */
109
-	do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args );
109
+	do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args);
110 110
 	?>
111
-	<h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2>
112
-	<div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>">
111
+	<h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2>
112
+	<div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>">
113 113
 		<?php
114 114
 		// Instruction for offline donation.
115
-		$offline_instruction = give_get_offline_payment_instruction( $form_id, true );
115
+		$offline_instruction = give_get_offline_payment_instruction($form_id, true);
116 116
 
117 117
 		/**
118 118
 		 * Instruction for the offline donation.
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		 * @param Give_Payment $payment             Payment object.
124 124
 		 * @param integer      $form_id             Donation form id.
125 125
 		 */
126
-		echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id );
126
+		echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id);
127 127
 		?>
128 128
 	</div>
129 129
 	<?php
@@ -135,52 +135,52 @@  discard block
 block discarded – undo
135 135
 	 * @param Give_Payment $payment           Donation payment object.
136 136
 	 * @param array        $give_receipt_args Receipt Arguments.
137 137
 	 */
138
-	do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args );
138
+	do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args);
139 139
 
140 140
 	return;
141 141
 }
142 142
 
143 143
 // Show payment status notice based on shortcode attribute.
144
-if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) {
144
+if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) {
145 145
 	$notice_message = '';
146 146
 	$notice_type    = 'warning';
147 147
 
148
-	switch ( $status ) {
148
+	switch ($status) {
149 149
 		case 'publish':
150
-			$notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' );
150
+			$notice_message = __('Payment Complete: Thank you for your donation.', 'give');
151 151
 			$notice_type    = 'success';
152 152
 			break;
153 153
 		case 'pending':
154
-			$notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' );
154
+			$notice_message = __('Payment Pending: Your donation is currently processing.', 'give');
155 155
 			$notice_type    = 'warning';
156 156
 			break;
157 157
 		case 'refunded':
158
-			$notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' );
158
+			$notice_message = __('Payment Refunded: Your donation has been refunded.', 'give');
159 159
 			$notice_type    = 'warning';
160 160
 			break;
161 161
 		case 'preapproval':
162
-			$notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' );
162
+			$notice_message = __('Payment Preapproved: Thank you for your donation.', 'give');
163 163
 			$notice_type    = 'warning';
164 164
 			break;
165 165
 		case 'failed':
166
-			$notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' );
166
+			$notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give');
167 167
 			$notice_type    = 'error';
168 168
 			break;
169 169
 		case 'cancelled':
170
-			$notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' );
170
+			$notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give');
171 171
 			$notice_type    = 'error';
172 172
 			break;
173 173
 		case 'abandoned':
174
-			$notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' );
174
+			$notice_message = __('Payment Abandoned: This donation has not been completed.', 'give');
175 175
 			$notice_type    = 'error';
176 176
 			break;
177 177
 		case 'revoked':
178
-			$notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' );
178
+			$notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give');
179 179
 			$notice_type    = 'error';
180 180
 			break;
181 181
 	}
182 182
 
183
-	if ( ! empty( $notice_message ) ) {
183
+	if ( ! empty($notice_message)) {
184 184
 		/**
185 185
 		 * Filters payment status notice for receipts.
186 186
 		 *
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 		 * @param string $status Payment status.
196 196
 		 * @param array  $meta   Array of meta data related to the payment.
197 197
 		 */
198
-		echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $meta );
198
+		echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $meta);
199 199
 	}
200 200
 }// End if().
201 201
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
  * @param object $payment           The payment object.
210 210
  * @param array  $give_receipt_args Receipt_argument.
211 211
  */
212
-do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args );
212
+do_action('give_payment_receipt_before_table', $payment, $give_receipt_args);
213 213
 ?>
214 214
 
215 215
 <table id="give_donation_receipt" class="give-table">
@@ -225,11 +225,11 @@  discard block
 block discarded – undo
225 225
 	 * @param object $payment           The payment object.
226 226
 	 * @param array  $give_receipt_args Receipt_argument.
227 227
 	 */
228
-	do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args );
228
+	do_action('give_payment_receipt_header_before', $payment, $give_receipt_args);
229 229
 	?>
230 230
 	<tr>
231 231
 		<th scope="colgroup" colspan="2">
232
-			<span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span>
232
+			<span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span>
233 233
 		</th>
234 234
 	</tr>
235 235
 	<?php
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 * @param object $payment           The payment object.
244 244
 	 * @param array  $give_receipt_args Receipt_argument.
245 245
 	 */
246
-	do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args );
246
+	do_action('give_payment_receipt_header_after', $payment, $give_receipt_args);
247 247
 	?>
248 248
 	</thead>
249 249
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 	 * @param object $payment           The payment object.
260 260
 	 * @param array  $give_receipt_args Receipt_argument.
261 261
 	 */
262
-	do_action( 'give_payment_receipt_before', $payment, $give_receipt_args );
262
+	do_action('give_payment_receipt_before', $payment, $give_receipt_args);
263 263
 	?>
264 264
 
265
-	<?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?>
266
-		<?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
265
+	<?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?>
266
+		<?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?>
267 267
 			<tr>
268 268
 				<td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td>
269 269
 				<td><?php echo $receipt_item['value']; ?></td>
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 * @param object $payment           The payment object.
283 283
 	 * @param array  $give_receipt_args Receipt_argument.
284 284
 	 */
285
-	do_action( 'give_payment_receipt_after', $payment, $give_receipt_args );
285
+	do_action('give_payment_receipt_after', $payment, $give_receipt_args);
286 286
 	?>
287 287
 	</tbody>
288 288
 </table>
@@ -298,5 +298,5 @@  discard block
 block discarded – undo
298 298
  * @param object $payment           The payment object.
299 299
  * @param array  $give_receipt_args Receipt_argument.
300 300
  */
301
-do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args );
301
+do_action('give_payment_receipt_after_table', $payment, $give_receipt_args);
302 302
 ?>
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ):
12
+if (is_user_logged_in()):
13 13
 	$user_id = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16 16
 	$display_name = $current_user->display_name;
17
-	$address      = give_get_donor_address( $user_id );
17
+	$address      = give_get_donor_address($user_id);
18 18
 
19
-	if ( isset( $_GET['updated'] ) && $_GET['updated'] == true && ! give_get_errors() ): ?>
19
+	if (isset($_GET['updated']) && $_GET['updated'] == true && ! give_get_errors()): ?>
20 20
 		<p class="give_success">
21
-			<strong><?php esc_html_e( 'Success:', 'give' ); ?></strong> <?php esc_html_e( 'Your profile has been updated.', 'give' ); ?>
21
+			<strong><?php esc_html_e('Success:', 'give'); ?></strong> <?php esc_html_e('Your profile has been updated.', 'give'); ?>
22 22
 		</p>
23 23
 	<?php endif; ?>
24 24
 
25
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
25
+	<?php Give()->notices->render_frontend_notices(0); ?>
26 26
 
27 27
 	<?php
28 28
 	/**
@@ -32,39 +32,39 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @since 1.0
34 34
 	 */
35
-	do_action( 'give_profile_editor_before' );
35
+	do_action('give_profile_editor_before');
36 36
 	?>
37 37
 
38 38
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post">
39 39
 
40 40
 		<fieldset>
41
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
41
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
42 42
 
43
-			<h3 id="give_personal_information_label" class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
43
+			<h3 id="give_personal_information_label" class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
44 44
 
45 45
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
46
-				<label for="give_first_name"><?php _e( 'First Name', 'give' ); ?></label>
47
-				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr( $first_name ); ?>"/>
46
+				<label for="give_first_name"><?php _e('First Name', 'give'); ?></label>
47
+				<input name="give_first_name" id="give_first_name" class="text give-input" type="text" value="<?php echo esc_attr($first_name); ?>"/>
48 48
 			</p>
49 49
 
50 50
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
51
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
52
-				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr( $last_name ); ?>"/>
51
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
52
+				<input name="give_last_name" id="give_last_name" class="text give-input" type="text" value="<?php echo esc_attr($last_name); ?>"/>
53 53
 			</p>
54 54
 
55 55
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
56
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
56
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
57 57
 				<select name="give_display_name" id="give_display_name" class="select give-select">
58
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
59
-						<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
58
+					<?php if ( ! empty($current_user->first_name)): ?>
59
+						<option <?php selected($display_name, $current_user->first_name); ?> value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
60 60
 					<?php endif; ?>
61
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
62
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
63
-						<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
61
+					<option <?php selected($display_name, $current_user->user_nicename); ?> value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
62
+					<?php if ( ! empty($current_user->last_name)): ?>
63
+						<option <?php selected($display_name, $current_user->last_name); ?> value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
64 64
 					<?php endif; ?>
65
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
66
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
67
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
65
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
66
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?> value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
67
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?> value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
68 68
 					<?php endif; ?>
69 69
 				</select>
70 70
 				<?php
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 				 *
76 76
 				 * @since 1.0
77 77
 				 */
78
-				do_action( 'give_profile_editor_name' );
78
+				do_action('give_profile_editor_name');
79 79
 				?>
80 80
 			</p>
81 81
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			 *
88 88
 			 * @since 1.0
89 89
 			 */
90
-			do_action( 'give_profile_editor_after_name' );
90
+			do_action('give_profile_editor_after_name');
91 91
 			?>
92 92
 
93 93
 			<p class="form-row form-row-last form-row-responsive">
94
-				<label for="give_email"><?php _e( 'Email Address', 'give' ); ?></label>
95
-				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
94
+				<label for="give_email"><?php _e('Email Address', 'give'); ?></label>
95
+				<input name="give_email" id="give_email" class="text give-input required" type="email" value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
96 96
 				<?php
97 97
 				/**
98 98
 				 * Fires in the profile editor shortcode, to the email section.
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 				 *
102 102
 				 * @since 1.0
103 103
 				 */
104
-				do_action( 'give_profile_editor_email' );
104
+				do_action('give_profile_editor_email');
105 105
 				?>
106 106
 			</p>
107 107
 
@@ -113,33 +113,33 @@  discard block
 block discarded – undo
113 113
 			 *
114 114
 			 * @since 1.0
115 115
 			 */
116
-			do_action( 'give_profile_editor_after_email' );
116
+			do_action('give_profile_editor_after_email');
117 117
 			?>
118 118
 
119
-			<h3 id="give_profile_billing_address_label" class="give-section-break"><?php _e( 'Change your Billing Address', 'give' ); ?></h3>
119
+			<h3 id="give_profile_billing_address_label" class="give-section-break"><?php _e('Change your Billing Address', 'give'); ?></h3>
120 120
 
121 121
 			<div id="give_profile_billing_address_wrap">
122 122
 				<?php
123 123
 				// Get selected country from address.
124
-				$selected_country = ( ! empty( $address['country'] ) ? $address['country'] : '' );
124
+				$selected_country = ( ! empty($address['country']) ? $address['country'] : '');
125 125
 
126 126
 				$selected_state = '';
127
-				if ( $selected_country === give_get_country() ) {
127
+				if ($selected_country === give_get_country()) {
128 128
 					// Get default selected state by admin.
129 129
 					$selected_state = give_get_state();
130 130
 				}
131 131
 
132 132
 				// Get selected state from address.
133
-				$selected_state = ! empty( $address['state'] ) ? $address['state'] : $selected_state;
133
+				$selected_state = ! empty($address['state']) ? $address['state'] : $selected_state;
134 134
 
135
-				$label        = __( 'State', 'give' );
135
+				$label        = __('State', 'give');
136 136
 				$states_label = give_get_states_label();
137 137
 				// Check if $country code exists in the array key for states label.
138
-				if ( array_key_exists( $selected_country, $states_label ) ) {
139
-					$label = $states_label[ $selected_country ];
138
+				if (array_key_exists($selected_country, $states_label)) {
139
+					$label = $states_label[$selected_country];
140 140
 				}
141 141
 
142
-				$states = give_get_states( $selected_country );
142
+				$states = give_get_states($selected_country);
143 143
 
144 144
 				// Get the country list that do not have any states init.
145 145
 				$no_states_country = give_no_states_country_list();
@@ -149,39 +149,39 @@  discard block
 block discarded – undo
149 149
 				?>
150 150
 
151 151
 				<p id="give-card-country-wrap" class="form-row form-row-wide">
152
-					<label for="give_address_country"><?php _e( 'Country', 'give' ); ?></label>
152
+					<label for="give_address_country"><?php _e('Country', 'give'); ?></label>
153 153
 					<select name="give_address_country" id="give_address_country" class="select give-select">
154
-						<?php foreach ( give_get_country_list() as $key => $country ) : ?>
155
-							<option value="<?php echo $key; ?>"<?php selected( $selected_country, $key ); ?>><?php echo esc_html( $country ); ?></option>
154
+						<?php foreach (give_get_country_list() as $key => $country) : ?>
155
+							<option value="<?php echo $key; ?>"<?php selected($selected_country, $key); ?>><?php echo esc_html($country); ?></option>
156 156
 						<?php endforeach; ?>
157 157
 					</select>
158 158
 				</p>
159 159
 
160 160
 				<p id="give-card-address-wrap" class="form-row form-row-wide">
161
-					<label for="give_address_line1"><?php _e( 'Address 1', 'give' ); ?></label>
161
+					<label for="give_address_line1"><?php _e('Address 1', 'give'); ?></label>
162 162
 					<input name="give_address_line1" id="give_address_line1" class="text give-input" type="text"
163
-					       value="<?php echo esc_attr( $address['line1'] ); ?>"/>
163
+					       value="<?php echo esc_attr($address['line1']); ?>"/>
164 164
 				</p>
165 165
 
166 166
 				<p id="give-card-address-2-wrap" class="form-row form-row-wide">
167
-					<label for="give_address_line2"><?php _e( 'Address 2', 'give' ); ?></label>
167
+					<label for="give_address_line2"><?php _e('Address 2', 'give'); ?></label>
168 168
 					<input name="give_address_line2" id="give_address_line2" class="text give-input" type="text"
169
-					       value="<?php echo esc_attr( $address['line2'] ); ?>"/>
169
+					       value="<?php echo esc_attr($address['line2']); ?>"/>
170 170
 				</p>
171 171
 
172 172
 
173 173
 				<p id="give-card-state-wrap"
174
-				   class="form-row form-row-wide <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ) ? 'give-hidden' : ''; ?>">
175
-					<label for="give_address_state"><?php _e( 'State / Province / County', 'give' ); ?></label>
174
+				   class="form-row form-row-wide <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country)) ? 'give-hidden' : ''; ?>">
175
+					<label for="give_address_state"><?php _e('State / Province / County', 'give'); ?></label>
176 176
 					<?php
177
-					if ( ! empty( $states ) ) : ?>
177
+					if ( ! empty($states)) : ?>
178 178
 						<select
179 179
 								name="give_address_state"
180 180
 								id="give_address_state"
181 181
 								class="give_address_state"
182 182
 						<?php
183
-						foreach ( $states as $state_code => $state ) {
184
-							echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
183
+						foreach ($states as $state_code => $state) {
184
+							echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
185 185
 						}
186 186
 						?>
187 187
 						</select>
@@ -194,15 +194,15 @@  discard block
 block discarded – undo
194 194
 				</p>
195 195
 
196 196
 				<p id="give-card-city-wrap" class="form-row form-row-first form-row-responsive">
197
-					<label for="give_address_city"><?php _e( 'City', 'give' ); ?></label>
197
+					<label for="give_address_city"><?php _e('City', 'give'); ?></label>
198 198
 					<input name="give_address_city" id="give_address_city" class="text give-input" type="text"
199
-					       value="<?php echo esc_attr( $address['city'] ); ?>"/>
199
+					       value="<?php echo esc_attr($address['city']); ?>"/>
200 200
 				</p>
201 201
 
202 202
 				<p id="give-card-zip-wrap" class="form-row form-row-last form-row-responsive">
203
-					<label for="give_address_zip"><?php _e( 'Zip / Postal Code', 'give' ); ?></label>
203
+					<label for="give_address_zip"><?php _e('Zip / Postal Code', 'give'); ?></label>
204 204
 					<input name="give_address_zip" id="give_address_zip" class="text give-input" type="text"
205
-					       value="<?php echo esc_attr( $address['zip'] ); ?>"/>
205
+					       value="<?php echo esc_attr($address['zip']); ?>"/>
206 206
 				</p>
207 207
 
208 208
 				<?php
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 				 *
214 214
 				 * @since 1.0
215 215
 				 */
216
-				do_action( 'give_profile_editor_address' );
216
+				do_action('give_profile_editor_address');
217 217
 				?>
218 218
 
219 219
 			</div>
@@ -226,19 +226,19 @@  discard block
 block discarded – undo
226 226
 			 *
227 227
 			 * @since 1.0
228 228
 			 */
229
-			do_action( 'give_profile_editor_after_address' );
229
+			do_action('give_profile_editor_after_address');
230 230
 			?>
231 231
 
232
-			<h3 id="give_profile_password_label" class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
232
+			<h3 id="give_profile_password_label" class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
233 233
 
234 234
 			<div id="give_profile_password_wrap" class="give-clearfix">
235 235
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
236
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
236
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
237 237
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input" type="password"/>
238 238
 				</p>
239 239
 
240 240
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
241
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
241
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
242 242
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input" type="password"/>
243 243
 					<?php
244 244
 					/**
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 					 *
249 249
 					 * @since 1.0
250 250
 					 */
251
-					do_action( 'give_profile_editor_password' );
251
+					do_action('give_profile_editor_password');
252 252
 					?>
253 253
 				</p>
254 254
 			</div>
255 255
 
256
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
256
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
257 257
 
258 258
 			<?php
259 259
 			/**
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
 			 *
264 264
 			 * @since 1.0
265 265
 			 */
266
-			do_action( 'give_profile_editor_after_password' );
266
+			do_action('give_profile_editor_after_password');
267 267
 			?>
268 268
 
269 269
 			<p id="give_profile_submit_wrap">
270
-				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
270
+				<input type="hidden" name="give_profile_editor_nonce" value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
271 271
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
272
-				<input type="hidden" name="give_redirect" value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
273
-				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
272
+				<input type="hidden" name="give_redirect" value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
273
+				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit" class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
274 274
 			</p>
275 275
 
276 276
 		</fieldset>
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 	 *
286 286
 	 * @since 1.0
287 287
 	 */
288
-	do_action( 'give_profile_editor_after' );
288
+	do_action('give_profile_editor_after');
289 289
 	?>
290 290
 
291 291
 	<?php
292 292
 else:
293
-	_e( 'You need to login to edit your profile.', 'give' );
293
+	_e('You need to login to edit your profile.', 'give');
294 294
 	echo give_login_form();
295 295
 endif;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -185,10 +185,13 @@  discard block
 block discarded – undo
185 185
 						}
186 186
 						?>
187 187
 						</select>
188
-					<?php else : ?>
188
+					<?php else {
189
+	: ?>
189 190
 						<input type="text" size="6" name="give_address_state" id="give_address_state"
190 191
 						       class="give_address_state give-input"
191
-						       placeholder="<?php echo $label; ?>" value="<?php echo $selected_state; ?>"/>
192
+						       placeholder="<?php echo $label;
193
+}
194
+?>" value="<?php echo $selected_state; ?>"/>
192 195
 					<?php endif;
193 196
 					?>
194 197
 				</p>
@@ -289,7 +292,9 @@  discard block
 block discarded – undo
289 292
 	?>
290 293
 
291 294
 	<?php
292
-else:
295
+else {
296
+	:
293 297
 	_e( 'You need to login to edit your profile.', 'give' );
298
+}
294 299
 	echo give_login_form();
295 300
 endif;
Please login to merge, or discard this patch.
includes/donors/class-give-donors-query.php 1 patch
Spacing   +46 added lines, -47 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
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @param  $args array The array of arguments that can be passed in and used for setting up this payment query.
87 87
 	 */
88
-	public function __construct( $args = array() ) {
88
+	public function __construct($args = array()) {
89 89
 		$defaults = array(
90 90
 			'number'     => 20,
91 91
 			'offset'     => 0,
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			// 'form'       => array(),
104 104
 		);
105 105
 
106
-		$this->args = wp_parse_args( $args, $defaults );
106
+		$this->args = wp_parse_args($args, $defaults);
107 107
 
108 108
 		$this->table_name      = Give()->donors->table_name;
109 109
 		$this->meta_table_name = Give()->donor_meta->table_name;
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 		 *
147 147
 		 * @param Give_Donors_Query $this Donors query object.
148 148
 		 */
149
-		do_action( 'give_pre_get_donors', $this );
149
+		do_action('give_pre_get_donors', $this);
150 150
 
151
-		if ( empty( $this->args['count'] ) ) {
152
-			$this->donors = $wpdb->get_results( $this->get_sql() );
151
+		if (empty($this->args['count'])) {
152
+			$this->donors = $wpdb->get_results($this->get_sql());
153 153
 		} else {
154
-			$this->donors = $wpdb->get_var( $this->get_sql() );
154
+			$this->donors = $wpdb->get_var($this->get_sql());
155 155
 		}
156 156
 
157 157
 		/**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		 *
162 162
 		 * @param Give_Donors_Query $this Donors query object.
163 163
 		 */
164
-		do_action( 'give_post_get_donors', $this );
164
+		do_action('give_post_get_donors', $this);
165 165
 
166 166
 		return $this->donors;
167 167
 	}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	public function get_sql() {
179 179
 		global $wpdb;
180 180
 
181
-		if ( $this->args['number'] < 1 ) {
181
+		if ($this->args['number'] < 1) {
182 182
 			$this->args['number'] = 999999999999;
183 183
 		}
184 184
 
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
 
187 187
 
188 188
 		// Set offset.
189
-		if ( empty( $this->args['offset'] ) && ( 0 < $this->args['paged'] ) ) {
190
-			$this->args['offset'] = $this->args['number'] * ( $this->args['paged'] - 1 );
189
+		if (empty($this->args['offset']) && (0 < $this->args['paged'])) {
190
+			$this->args['offset'] = $this->args['number'] * ($this->args['paged'] - 1);
191 191
 		}
192 192
 
193 193
 		// Set fields.
194 194
 		$fields = "{$this->table_name}.*";
195
-		if ( ! empty( $this->args['fields'] ) && 'all' !== $this->args['fields'] ) {
196
-			if ( is_string( $this->args['fields'] ) ) {
195
+		if ( ! empty($this->args['fields']) && 'all' !== $this->args['fields']) {
196
+			if (is_string($this->args['fields'])) {
197 197
 				$fields = "{$this->table_name}.{$this->args['fields']}";
198
-			} else if ( is_array( $this->args['fields'] ) ) {
199
-				$fields = "{$this->table_name}." . implode( " , {$this->table_name}.", $this->args['fields'] );
198
+			} else if (is_array($this->args['fields'])) {
199
+				$fields = "{$this->table_name}.".implode(" , {$this->table_name}.", $this->args['fields']);
200 200
 			}
201 201
 		}
202 202
 
203 203
 		// Set count.
204
-		if ( ! empty( $this->args['count'] ) ) {
204
+		if ( ! empty($this->args['count'])) {
205 205
 			$fields = "COUNT({$this->table_name}.id)";
206 206
 		}
207 207
 
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
 
210 210
 		return $wpdb->prepare(
211 211
 			"SELECT {$fields} FROM {$this->table_name} {$where} {$orderby} {$this->args['order']} LIMIT %d,%d;",
212
-			absint( $this->args['offset'] ),
213
-			absint( $this->args['number'] )
212
+			absint($this->args['offset']),
213
+			absint($this->args['number'])
214 214
 		);
215 215
 	}
216 216
 
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
 		$where = '';
228 228
 
229 229
 		// Get sql query for meta.
230
-		if ( ! empty( $this->args['meta_query'] ) ) {
231
-			$meta_query_object = new WP_Meta_Query( $this->args['meta_query'] );
230
+		if ( ! empty($this->args['meta_query'])) {
231
+			$meta_query_object = new WP_Meta_Query($this->args['meta_query']);
232 232
 			$meta_query        = $meta_query_object->get_sql(
233 233
 				$this->meta_type,
234 234
 				$this->table_name,
235 235
 				'id'
236 236
 			);
237
-			$where             = implode( '', $meta_query );
237
+			$where = implode('', $meta_query);
238 238
 		}
239 239
 
240 240
 		$where .= 'WHERE 1=1';
@@ -261,17 +261,17 @@  discard block
 block discarded – undo
261 261
 
262 262
 		$where = '';
263 263
 
264
-		if ( ! empty( $this->args['email'] ) ) {
264
+		if ( ! empty($this->args['email'])) {
265 265
 
266
-			if ( is_array( $this->args['email'] ) ) {
266
+			if (is_array($this->args['email'])) {
267 267
 
268
-				$emails_count       = count( $this->args['email'] );
269
-				$emails_placeholder = array_fill( 0, $emails_count, '%s' );
270
-				$emails             = implode( ', ', $emails_placeholder );
268
+				$emails_count       = count($this->args['email']);
269
+				$emails_placeholder = array_fill(0, $emails_count, '%s');
270
+				$emails             = implode(', ', $emails_placeholder);
271 271
 
272
-				$where .= $wpdb->prepare( " AND {$this->table_name}.email IN( $emails ) ", $this->args['email'] );
272
+				$where .= $wpdb->prepare(" AND {$this->table_name}.email IN( $emails ) ", $this->args['email']);
273 273
 			} else {
274
-				$where .= $wpdb->prepare( " AND {$this->table_name}.email = %s ", $this->args['email'] );
274
+				$where .= $wpdb->prepare(" AND {$this->table_name}.email = %s ", $this->args['email']);
275 275
 			}
276 276
 		}
277 277
 
@@ -291,11 +291,11 @@  discard block
 block discarded – undo
291 291
 		$where = '';
292 292
 
293 293
 		// Specific donors.
294
-		if ( ! empty( $this->args['donor'] ) ) {
295
-			if ( ! is_array( $this->args['donor'] ) ) {
296
-				$this->args['donor'] = explode( ',', $this->args['donor'] );
294
+		if ( ! empty($this->args['donor'])) {
295
+			if ( ! is_array($this->args['donor'])) {
296
+				$this->args['donor'] = explode(',', $this->args['donor']);
297 297
 			}
298
-			$log_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) );
298
+			$log_ids = implode(',', array_map('intval', $this->args['donor']));
299 299
 
300 300
 			$where .= " AND {$this->table_name}.id IN( {$log_ids} ) ";
301 301
 		}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$where = '';
317 317
 
318 318
 		// Donors created for a specific date or in a date range
319
-		if ( ! empty( $this->args['date_query'] ) ) {
319
+		if ( ! empty($this->args['date_query'])) {
320 320
 			$date_query_object = new WP_Date_Query(
321 321
 				$this->args['date_query'],
322 322
 				"{$this->table_name}.date_created"
@@ -341,11 +341,11 @@  discard block
 block discarded – undo
341 341
 		$where = '';
342 342
 
343 343
 		// Donors created for a specific date or in a date range
344
-		if ( ! empty( $this->args['s'] ) && false !== strpos( $this->args['s'], ':' ) ) {
345
-			$search_parts = explode( ':', $this->args['s'] );
344
+		if ( ! empty($this->args['s']) && false !== strpos($this->args['s'], ':')) {
345
+			$search_parts = explode(':', $this->args['s']);
346 346
 
347
-			if ( ! empty( $search_parts[0] ) ) {
348
-				switch ( $search_parts[0] ) {
347
+			if ( ! empty($search_parts[0])) {
348
+				switch ($search_parts[0]) {
349 349
 					case 'name':
350 350
 						$where = " AND {$this->table_name}.name LIKE '%{$search_parts[1]}%' ";
351 351
 						break;
@@ -373,11 +373,11 @@  discard block
 block discarded – undo
373 373
 		$where = '';
374 374
 
375 375
 		// Donors create for specific wp user.
376
-		if ( ! empty( $this->args['user'] ) ) {
377
-			if ( ! is_array( $this->args['user'] ) ) {
378
-				$this->args['user'] = explode( ',', $this->args['user'] );
376
+		if ( ! empty($this->args['user'])) {
377
+			if ( ! is_array($this->args['user'])) {
378
+				$this->args['user'] = explode(',', $this->args['user']);
379 379
 			}
380
-			$user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) );
380
+			$user_ids = implode(',', array_map('intval', $this->args['user']));
381 381
 
382 382
 			$where .= " AND {$this->table_name}.user_id IN( {$user_ids} ) ";
383 383
 		}
@@ -396,14 +396,13 @@  discard block
 block discarded – undo
396 396
 	private function get_order_query() {
397 397
 		$table_columns = Give()->donors->get_columns();
398 398
 
399
-		$this->args['orderby'] = ! array_key_exists( $this->args['orderby'], $table_columns ) ?
400
-			'id' :
401
-			$this->args['orderby'];
399
+		$this->args['orderby'] = ! array_key_exists($this->args['orderby'], $table_columns) ?
400
+			'id' : $this->args['orderby'];
402 401
 
403
-		$this->args['orderby'] = esc_sql( $this->args['orderby'] );
404
-		$this->args['order']   = esc_sql( $this->args['order'] );
402
+		$this->args['orderby'] = esc_sql($this->args['orderby']);
403
+		$this->args['order']   = esc_sql($this->args['order']);
405 404
 
406
-		switch ( $table_columns[ $this->args['orderby'] ] ) {
405
+		switch ($table_columns[$this->args['orderby']]) {
407 406
 			case '%d':
408 407
 			case '%f':
409 408
 				$query = "ORDER BY {$this->table_name}.{$this->args['orderby']}+0";
Please login to merge, or discard this patch.
includes/admin/donors/donors.php 1 patch
Spacing   +170 added lines, -170 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_donors_page() {
26 26
 	$default_views  = give_donor_views();
27
-	$requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors';
28
-	if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) {
29
-		give_render_donor_view( $requested_view, $default_views );
27
+	$requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors';
28
+	if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) {
29
+		give_render_donor_view($requested_view, $default_views);
30 30
 	} else {
31 31
 		give_donors_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_donor_views', $views );
45
+	return apply_filters('give_donor_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_donor_tabs', $tabs );
59
+	return apply_filters('give_donor_tabs', $tabs);
60 60
 
61 61
 }
62 62
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  * @return void
68 68
  */
69 69
 function give_donors_list() {
70
-	include dirname( __FILE__ ) . '/class-donor-table.php';
70
+	include dirname(__FILE__).'/class-donor-table.php';
71 71
 
72 72
 	$donors_table = new Give_Donor_List_Table();
73 73
 	$donors_table->prepare_items();
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @since 1.0
82 82
 		 */
83
-		do_action( 'give_donors_table_top' );
83
+		do_action('give_donors_table_top');
84 84
 		?>
85 85
 
86 86
 		<hr class="wp-header-end">
87 87
 
88
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>">
88
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>">
89 89
 			<?php
90
-			$donors_table->search_box( __( 'Search Donors', 'give' ), 'give-donors' );
90
+			$donors_table->search_box(__('Search Donors', 'give'), 'give-donors');
91 91
 			$donors_table->display();
92 92
 			?>
93 93
 			<input type="hidden" name="post_type" value="give_forms" />
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		 *
101 101
 		 * @since 1.0
102 102
 		 */
103
-		do_action( 'give_donors_table_bottom' );
103
+		do_action('give_donors_table_bottom');
104 104
 		?>
105 105
 	</div>
106 106
 	<?php
@@ -116,33 +116,33 @@  discard block
 block discarded – undo
116 116
  *
117 117
  * @return void
118 118
  */
119
-function give_render_donor_view( $view, $callbacks ) {
119
+function give_render_donor_view($view, $callbacks) {
120 120
 
121 121
 	$render = true;
122 122
 
123
-	$donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' );
123
+	$donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports');
124 124
 
125
-	if ( ! current_user_can( $donor_view_role ) ) {
126
-		give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) );
125
+	if ( ! current_user_can($donor_view_role)) {
126
+		give_set_error('give-no-access', __('You are not permitted to view this data.', 'give'));
127 127
 		$render = false;
128 128
 	}
129 129
 
130
-	if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
131
-		give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) );
130
+	if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
131
+		give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give'));
132 132
 		$render = false;
133 133
 	}
134 134
 
135 135
 	$donor_id          = (int) $_GET['id'];
136
-	$reconnect_user_id = ! empty( $_GET['user_id'] ) ? (int) $_GET['user_id'] : '';
137
-	$donor             = new Give_Donor( $donor_id );
136
+	$reconnect_user_id = ! empty($_GET['user_id']) ? (int) $_GET['user_id'] : '';
137
+	$donor             = new Give_Donor($donor_id);
138 138
 
139 139
 	// Reconnect User with Donor profile.
140
-	if( $reconnect_user_id ) {
141
-		give_connect_user_donor_profile( $donor, array( 'user_id' => $reconnect_user_id ), array() );
140
+	if ($reconnect_user_id) {
141
+		give_connect_user_donor_profile($donor, array('user_id' => $reconnect_user_id), array());
142 142
 	}
143 143
 
144
-	if ( empty( $donor->id ) ) {
145
-		give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) );
144
+	if (empty($donor->id)) {
145
+		give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give'));
146 146
 		$render = false;
147 147
 	}
148 148
 
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 
152 152
 	<div class='wrap'>
153 153
 
154
-		<?php if ( give_get_errors() ) : ?>
154
+		<?php if (give_get_errors()) : ?>
155 155
 			<div class="error settings-error">
156
-				<?php Give()->notices->render_frontend_notices( 0 ); ?>
156
+				<?php Give()->notices->render_frontend_notices(0); ?>
157 157
 			</div>
158 158
 		<?php endif; ?>
159 159
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 			<?php
162 162
 			printf(
163 163
 			/* translators: %s: donor number */
164
-				esc_html__( 'Donor %s', 'give' ),
164
+				esc_html__('Donor %s', 'give'),
165 165
 				$donor_id
166 166
 			);
167 167
 			?>
@@ -169,26 +169,26 @@  discard block
 block discarded – undo
169 169
 
170 170
 		<hr class="wp-header-end">
171 171
 		
172
-		<?php if ( $donor && $render ) : ?>
172
+		<?php if ($donor && $render) : ?>
173 173
 
174 174
 			<h2 class="nav-tab-wrapper">
175 175
 				<?php
176
-				foreach ( $donor_tabs as $key => $tab ) :
176
+				foreach ($donor_tabs as $key => $tab) :
177 177
 					$active = $key === $view ? true : false;
178 178
 					$class = $active ? 'nav-tab nav-tab-active' : 'nav-tab';
179 179
 					printf(
180
-						'<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n",
181
-						esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ),
182
-						esc_attr( $class ),
183
-						sanitize_html_class( $tab['dashicon'] ),
184
-						esc_html( $tab['title'] )
180
+						'<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n",
181
+						esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)),
182
+						esc_attr($class),
183
+						sanitize_html_class($tab['dashicon']),
184
+						esc_html($tab['title'])
185 185
 					);
186 186
 				endforeach;
187 187
 				?>
188 188
 			</h2>
189 189
 
190 190
 			<div id="give-donor-card-wrapper">
191
-				<?php $callbacks[ $view ]( $donor ) ?>
191
+				<?php $callbacks[$view]($donor) ?>
192 192
 			</div>
193 193
 
194 194
 		<?php endif; ?>
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
  *
209 209
  * @return void
210 210
  */
211
-function give_donor_view( $donor ) {
211
+function give_donor_view($donor) {
212 212
 
213
-	$donor_edit_role   = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
213
+	$donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments');
214 214
 
215 215
 	/**
216 216
 	 * Fires in donor profile screen, above the donor card.
@@ -219,32 +219,32 @@  discard block
 block discarded – undo
219 219
 	 *
220 220
 	 * @param object $donor The donor object being displayed.
221 221
 	 */
222
-	do_action( 'give_donor_card_top', $donor );
222
+	do_action('give_donor_card_top', $donor);
223 223
 	?>
224 224
 
225 225
 	<div id="donor-summary" class="info-wrapper donor-section postbox">
226 226
 
227
-		<form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>">
227
+		<form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>">
228 228
 
229 229
 			<div class="donor-info">
230 230
 
231 231
 				<div class="donor-bio-header clearfix">
232 232
 
233 233
 					<div class="avatar-wrap left" id="donor-avatar">
234
-						<?php echo get_avatar( $donor->email ); ?>
234
+						<?php echo get_avatar($donor->email); ?>
235 235
 					</div>
236 236
 
237 237
 					<div id="donor-name-wrap" class="left">
238 238
 						<span class="donor-id">#<?php echo $donor->id; ?></span>
239
-						<span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php _e( 'Donor Name', 'give' ); ?>" /></span>
239
+						<span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php _e('Donor Name', 'give'); ?>" /></span>
240 240
 						<span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span>
241 241
 					</div>
242 242
 					<p class="donor-since info-item">
243
-						<?php _e( 'Donor since', 'give' ); ?>
244
-						<?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?>
243
+						<?php _e('Donor since', 'give'); ?>
244
+						<?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?>
245 245
 					</p>
246
-					<?php if ( current_user_can( $donor_edit_role ) ) : ?>
247
-						<a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e( 'Edit Donor', 'give' ); ?></a>
246
+					<?php if (current_user_can($donor_edit_role)) : ?>
247
+						<a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e('Edit Donor', 'give'); ?></a>
248 248
 					<?php endif; ?>
249 249
 				</div>
250 250
 				<!-- /donor-bio-header -->
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 					<table class="widefat">
255 255
 						<tbody>
256 256
 						<tr class="alternate">
257
-							<th scope="col"><label for="tablecell"><?php _e( 'User:', 'give' ); ?></label></th>
257
+							<th scope="col"><label for="tablecell"><?php _e('User:', 'give'); ?></label></th>
258 258
 							<td>
259 259
 								<span class="donor-user-id info-item edit-item">
260 260
 									<?php
@@ -271,48 +271,48 @@  discard block
 block discarded – undo
271 271
 										'data'  => $data_atts,
272 272
 									);
273 273
 
274
-									if ( ! empty( $user_id ) ) {
275
-										$userdata           = get_userdata( $user_id );
274
+									if ( ! empty($user_id)) {
275
+										$userdata = get_userdata($user_id);
276 276
 										$user_args['selected'] = $user_id;
277 277
 									}
278 278
 
279
-									echo Give()->html->ajax_user_search( $user_args );
279
+									echo Give()->html->ajax_user_search($user_args);
280 280
 									?>
281 281
 								</span>
282 282
 
283 283
 								<span class="donor-user-id info-item editable">
284
-									<?php if ( ! empty( $userdata ) ) { ?>
285
-										<span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span>
284
+									<?php if ( ! empty($userdata)) { ?>
285
+										<span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span>
286 286
 									<?php } else { ?>
287
-										<span data-key="user_id"><?php _e( 'None', 'give' ); ?></span>
287
+										<span data-key="user_id"><?php _e('None', 'give'); ?></span>
288 288
 									<?php } ?>
289
-									<?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?>
289
+									<?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?>
290 290
 										<span class="disconnect-user">
291 291
  											-
292
- 											<a id="disconnect-donor" href="#disconnect" aria-label="<?php _e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>">
293
- 												<?php _e( 'Disconnect User', 'give' ); ?>
292
+ 											<a id="disconnect-donor" href="#disconnect" aria-label="<?php _e('Disconnects the current user ID from this donor record.', 'give'); ?>">
293
+ 												<?php _e('Disconnect User', 'give'); ?>
294 294
 											</a>
295 295
  										</span>
296 296
 										<span class="view-user-profile">
297 297
  											|
298
- 											<a id="view-user-profile" href="<?php echo 'user-edit.php?user_id=' . $donor->user_id; ?>" aria-label="<?php _e( 'View User Profile of current user ID.', 'give' ); ?>">
299
- 												<?php _e( 'View User Profile', 'give' ); ?>
298
+ 											<a id="view-user-profile" href="<?php echo 'user-edit.php?user_id='.$donor->user_id; ?>" aria-label="<?php _e('View User Profile of current user ID.', 'give'); ?>">
299
+ 												<?php _e('View User Profile', 'give'); ?>
300 300
 											</a>
301 301
  										</span>
302 302
 									<?php } ?>
303 303
 								</span>
304 304
 							</td>
305 305
 						</tr>
306
-						<?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?>
306
+						<?php if (isset($donor->user_id) && $donor->user_id > 0) : ?>
307 307
 
308 308
 							<tr>
309
-								<th scope="col"><?php _e( 'Address:', 'give' ); ?></th>
309
+								<th scope="col"><?php _e('Address:', 'give'); ?></th>
310 310
 								<td class="row-title">
311 311
 
312 312
 									<div class="donor-address-wrapper">
313 313
 
314 314
 										<?php
315
-										$address  = get_user_meta( $donor->user_id, '_give_user_address', true );
315
+										$address  = get_user_meta($donor->user_id, '_give_user_address', true);
316 316
 										$defaults = array(
317 317
 											'line1'   => '',
318 318
 											'line2'   => '',
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
 											'zip'     => '',
323 323
 										);
324 324
 
325
-										$address = wp_parse_args( $address, $defaults );
325
+										$address = wp_parse_args($address, $defaults);
326 326
 										?>
327 327
 
328
-										<?php if ( ! empty( $address ) ) { ?>
328
+										<?php if ( ! empty($address)) { ?>
329 329
 											<span class="donor-address info-item editable">
330 330
 												<span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span>
331 331
 												<span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span>
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 
343 343
 										// For State.
344 344
 										$selected_state = give_get_state();
345
-										$states         = give_get_states( $selected_country );
346
-										$selected_state = ( isset( $address['state'] ) ? $address['state'] : $selected_state );
345
+										$states         = give_get_states($selected_country);
346
+										$selected_state = (isset($address['state']) ? $address['state'] : $selected_state);
347 347
 
348 348
 										// Get the country list that does not have any states init.
349 349
 										$no_states_country = give_no_states_country_list();
@@ -351,32 +351,32 @@  discard block
 block discarded – undo
351 351
 										<span class="donor-address info-item edit-item">
352 352
 											<select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item">
353 353
 												<?php
354
-												foreach ( $countries as $country_code => $country ) {
355
-													echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
354
+												foreach ($countries as $country_code => $country) {
355
+													echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
356 356
 												}
357 357
 												?>
358 358
 											</select>
359
-											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" />
360
-											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" />
359
+											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" />
360
+											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" />
361 361
 											<?php
362
-											if ( ! empty( $states ) ) {
362
+											if ( ! empty($states)) {
363 363
 												?>
364 364
 												<select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item">
365 365
 													<?php
366
-													foreach ( $states as $state_code => $state ) {
367
-														echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
366
+													foreach ($states as $state_code => $state) {
367
+														echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
368 368
 													}
369 369
 													?>
370 370
 												</select>
371 371
 												<?php
372 372
 											} else {
373 373
 												?>
374
-												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ? 'give-hidden' : '' ); ?>" placeholder="<?php _e( 'State / Province / County', 'give' ); ?>" />
374
+												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country) ? 'give-hidden' : ''); ?>" placeholder="<?php _e('State / Province / County', 'give'); ?>" />
375 375
 												<?php
376 376
 											}
377 377
 											?>
378
-											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" />
379
-											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" />
378
+											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" />
379
+											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" />
380 380
 										</span>
381 381
 
382 382
 									</div>
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
 
393 393
 			<span id="donor-edit-actions" class="edit-item">
394 394
 				<input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" />
395
-				<?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?>
395
+				<?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?>
396 396
 				<input type="hidden" name="give_action" value="edit-donor" />
397
-				<input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e( 'Update Donor', 'give' ); ?>" />
398
-				<a id="give-edit-donor-cancel" href="" class="delete"><?php _e( 'Cancel', 'give' ); ?></a>
397
+				<input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e('Update Donor', 'give'); ?>" />
398
+				<a id="give-edit-donor-cancel" href="" class="delete"><?php _e('Cancel', 'give'); ?></a>
399 399
 			</span>
400 400
 
401 401
 		</form>
@@ -410,24 +410,24 @@  discard block
 block discarded – undo
410 410
 	 *
411 411
 	 * @param object $donor The donor object being displayed.
412 412
 	 */
413
-	do_action( 'give_donor_before_stats', $donor );
413
+	do_action('give_donor_before_stats', $donor);
414 414
 	?>
415 415
 
416 416
 	<div id="donor-stats-wrapper" class="donor-section postbox clear">
417 417
 		<ul>
418 418
 			<li>
419
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor->id ) ); ?>">
419
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($donor->id)); ?>">
420 420
 					<span class="dashicons dashicons-heart"></span>
421 421
 					<?php
422 422
 					// Completed Donations.
423
-					$completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count );
424
-					echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor );
423
+					$completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count);
424
+					echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor);
425 425
 					?>
426 426
 				</a>
427 427
 			</li>
428 428
 			<li>
429 429
 				<span class="dashicons dashicons-chart-area"></span>
430
-				<?php echo give_currency_filter( give_format_amount( $donor->purchase_value, array( 'sanitize' => false ) ) ); ?> <?php _e( 'Lifetime Donations', 'give' ); ?>
430
+				<?php echo give_currency_filter(give_format_amount($donor->purchase_value, array('sanitize' => false))); ?> <?php _e('Lifetime Donations', 'give'); ?>
431 431
 			</li>
432 432
 			<?php
433 433
 			/**
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 			 *
440 440
 			 * @param object $donor The donor object being displayed.
441 441
 			 */
442
-			do_action( 'give_donor_stats_list', $donor );
442
+			do_action('give_donor_stats_list', $donor);
443 443
 			?>
444 444
 		</ul>
445 445
 	</div>
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 *
453 453
 	 * @param object $donor The donor object being displayed.
454 454
 	 */
455
-	do_action( 'give_donor_before_tables_wrapper', $donor );
455
+	do_action('give_donor_before_tables_wrapper', $donor);
456 456
 	?>
457 457
 
458 458
 	<div id="donor-tables-wrapper" class="donor-section">
@@ -465,46 +465,46 @@  discard block
 block discarded – undo
465 465
 		 *
466 466
 		 * @param object $donor The donor object being displayed.
467 467
 		 */
468
-		do_action( 'give_donor_before_tables', $donor );
468
+		do_action('give_donor_before_tables', $donor);
469 469
 		?>
470 470
 
471
-		<h3><?php _e( 'Donor Emails', 'give' ); ?></h3>
471
+		<h3><?php _e('Donor Emails', 'give'); ?></h3>
472 472
 
473 473
 		<table class="wp-list-table widefat striped emails">
474 474
 			<thead>
475 475
 			<tr>
476
-				<th><?php _e( 'Email', 'give' ); ?></th>
477
-				<th><?php _e( 'Actions', 'give' ); ?></th>
476
+				<th><?php _e('Email', 'give'); ?></th>
477
+				<th><?php _e('Actions', 'give'); ?></th>
478 478
 			</tr>
479 479
 			</thead>
480 480
 
481 481
 			<tbody>
482
-			<?php if ( ! empty( $donor->emails ) ) { ?>
482
+			<?php if ( ! empty($donor->emails)) { ?>
483 483
 
484
-				<?php foreach ( $donor->emails as $key => $email ) : ?>
484
+				<?php foreach ($donor->emails as $key => $email) : ?>
485 485
 					<tr data-key="<?php echo $key; ?>">
486 486
 						<td>
487 487
 							<?php echo $email; ?>
488
-							<?php if ( 'primary' === $key ) : ?>
488
+							<?php if ('primary' === $key) : ?>
489 489
 								<span class="dashicons dashicons-star-filled primary-email-icon"></span>
490 490
 							<?php endif; ?>
491 491
 						</td>
492 492
 						<td>
493
-							<?php if ( 'primary' !== $key ) : ?>
493
+							<?php if ('primary' !== $key) : ?>
494 494
 								<?php
495
-								$base_url    = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id );
496
-								$promote_url = wp_nonce_url( add_query_arg( array(
497
-									'email' => rawurlencode( $email ),
495
+								$base_url    = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id);
496
+								$promote_url = wp_nonce_url(add_query_arg(array(
497
+									'email' => rawurlencode($email),
498 498
 									'give_action' => 'set_donor_primary_email',
499
-								), $base_url ), 'give-set-donor-primary-email' );
500
-								$remove_url  = wp_nonce_url( add_query_arg( array(
501
-									'email' => rawurlencode( $email ),
499
+								), $base_url), 'give-set-donor-primary-email');
500
+								$remove_url = wp_nonce_url(add_query_arg(array(
501
+									'email' => rawurlencode($email),
502 502
 									'give_action' => 'remove_donor_email',
503
-								), $base_url ), 'give-remove-donor-email' );
503
+								), $base_url), 'give-remove-donor-email');
504 504
 								?>
505
-								<a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a>
505
+								<a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a>
506 506
 								&nbsp;|&nbsp;
507
-								<a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a>
507
+								<a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a>
508 508
 							<?php endif; ?>
509 509
 						</td>
510 510
 					</tr>
@@ -514,59 +514,59 @@  discard block
 block discarded – undo
514 514
 					<td colspan="2" class="add-donor-email-td">
515 515
 						<div class="add-donor-email-wrapper">
516 516
 							<input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" />
517
-							<?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?>
518
-							<input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" />&nbsp;
519
-							<input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" />&nbsp;<label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label>
520
-							<button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button>
517
+							<?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?>
518
+							<input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" />&nbsp;
519
+							<input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" />&nbsp;<label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label>
520
+							<button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button>
521 521
 							<span class="spinner"></span>
522 522
 						</div>
523 523
 						<div class="notice-wrap"></div>
524 524
 					</td>
525 525
 				</tr>
526 526
 			<?php } else { ?>
527
-				<tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr>
527
+				<tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr>
528 528
 			<?php }// End if().
529 529
 			?>
530 530
 			</tbody>
531 531
 		</table>
532 532
 
533
-		<h3><?php _e( 'Recent Donations', 'give' ); ?></h3>
533
+		<h3><?php _e('Recent Donations', 'give'); ?></h3>
534 534
 		<?php
535
-		$payment_ids = explode( ',', $donor->payment_ids );
536
-		$payments    = give_get_payments( array(
535
+		$payment_ids = explode(',', $donor->payment_ids);
536
+		$payments    = give_get_payments(array(
537 537
 			'post__in' => $payment_ids,
538
-		) );
539
-		$payments    = array_slice( $payments, 0, 10 );
538
+		));
539
+		$payments    = array_slice($payments, 0, 10);
540 540
 		?>
541 541
 		<table class="wp-list-table widefat striped payments">
542 542
 			<thead>
543 543
 			<tr>
544
-				<th scope="col"><?php _e( 'ID', 'give' ); ?></th>
545
-				<th scope="col"><?php _e( 'Amount', 'give' ); ?></th>
546
-				<th scope="col"><?php _e( 'Date', 'give' ); ?></th>
547
-				<th scope="col"><?php _e( 'Status', 'give' ); ?></th>
548
-				<th scope="col"><?php _e( 'Actions', 'give' ); ?></th>
544
+				<th scope="col"><?php _e('ID', 'give'); ?></th>
545
+				<th scope="col"><?php _e('Amount', 'give'); ?></th>
546
+				<th scope="col"><?php _e('Date', 'give'); ?></th>
547
+				<th scope="col"><?php _e('Status', 'give'); ?></th>
548
+				<th scope="col"><?php _e('Actions', 'give'); ?></th>
549 549
 			</tr>
550 550
 			</thead>
551 551
 			<tbody>
552
-			<?php if ( ! empty( $payments ) ) { ?>
553
-				<?php foreach ( $payments as $payment ) : ?>
552
+			<?php if ( ! empty($payments)) { ?>
553
+				<?php foreach ($payments as $payment) : ?>
554 554
 					<tr>
555 555
 						<td><?php echo $payment->ID; ?></td>
556
-						<td><?php echo give_payment_amount( $payment->ID ); ?></td>
557
-						<td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td>
558
-						<td><?php echo give_get_payment_status( $payment, true ); ?></td>
556
+						<td><?php echo give_payment_amount($payment->ID); ?></td>
557
+						<td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td>
558
+						<td><?php echo give_get_payment_status($payment, true); ?></td>
559 559
 						<td>
560 560
 							<?php
561 561
 							printf(
562 562
 								'<a href="%1$s" aria-label="%2$s">%3$s</a>',
563
-								admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ),
563
+								admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID),
564 564
 								sprintf(
565 565
 								/* translators: %s: Donation ID */
566
-									esc_attr__( 'View Donation %s.', 'give' ),
566
+									esc_attr__('View Donation %s.', 'give'),
567 567
 									$payment->ID
568 568
 								),
569
-								__( 'View Donation', 'give' )
569
+								__('View Donation', 'give')
570 570
 							);
571 571
 							?>
572 572
 
@@ -581,47 +581,47 @@  discard block
 block discarded – undo
581 581
 							 * @param object $donor The donor object being displayed.
582 582
 							 * @param object $payment  The payment object being displayed.
583 583
 							 */
584
-							do_action( 'give_donor_recent_purchases_actions', $donor, $payment );
584
+							do_action('give_donor_recent_purchases_actions', $donor, $payment);
585 585
 							?>
586 586
 						</td>
587 587
 					</tr>
588 588
 				<?php endforeach; ?>
589 589
 			<?php } else { ?>
590 590
 				<tr>
591
-					<td colspan="5"><?php _e( 'No donations found.', 'give' ); ?></td>
591
+					<td colspan="5"><?php _e('No donations found.', 'give'); ?></td>
592 592
 				</tr>
593 593
 			<?php }// End if().
594 594
 			?>
595 595
 			</tbody>
596 596
 		</table>
597 597
 
598
-		<h3><?php _e( 'Completed Forms', 'give' ); ?></h3>
598
+		<h3><?php _e('Completed Forms', 'give'); ?></h3>
599 599
 		<?php
600
-		$donations = give_get_users_completed_donations( $donor->email );
600
+		$donations = give_get_users_completed_donations($donor->email);
601 601
 		?>
602 602
 		<table class="wp-list-table widefat striped donations">
603 603
 			<thead>
604 604
 			<tr>
605
-				<th scope="col"><?php _e( 'Form', 'give' ); ?></th>
606
-				<th scope="col" width="120px"><?php _e( 'Actions', 'give' ); ?></th>
605
+				<th scope="col"><?php _e('Form', 'give'); ?></th>
606
+				<th scope="col" width="120px"><?php _e('Actions', 'give'); ?></th>
607 607
 			</tr>
608 608
 			</thead>
609 609
 			<tbody>
610
-			<?php if ( ! empty( $donations ) ) { ?>
611
-				<?php foreach ( $donations as $donation ) : ?>
610
+			<?php if ( ! empty($donations)) { ?>
611
+				<?php foreach ($donations as $donation) : ?>
612 612
 					<tr>
613 613
 						<td><?php echo $donation->post_title; ?></td>
614 614
 						<td>
615 615
 							<?php
616 616
 							printf(
617 617
 								'<a href="%1$s" aria-label="%2$s">%3$s</a>',
618
-								esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ),
618
+								esc_url(admin_url('post.php?action=edit&post='.$donation->ID)),
619 619
 								sprintf(
620 620
 								/* translators: %s: form name */
621
-									esc_attr__( 'View Form %s.', 'give' ),
621
+									esc_attr__('View Form %s.', 'give'),
622 622
 									$donation->post_title
623 623
 								),
624
-								__( 'View Form', 'give' )
624
+								__('View Form', 'give')
625 625
 							);
626 626
 							?>
627 627
 						</td>
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 				<?php endforeach; ?>
630 630
 			<?php } else { ?>
631 631
 				<tr>
632
-					<td colspan="2"><?php _e( 'No completed donations found.', 'give' ); ?></td>
632
+					<td colspan="2"><?php _e('No completed donations found.', 'give'); ?></td>
633 633
 				</tr>
634 634
 			<?php } ?>
635 635
 			</tbody>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 		 *
644 644
 		 * @param object $donor The donor object being displayed.
645 645
 		 */
646
-		do_action( 'give_donor_after_tables', $donor );
646
+		do_action('give_donor_after_tables', $donor);
647 647
 		?>
648 648
 
649 649
 	</div>
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 	 *
657 657
 	 * @param object $donor The donor object being displayed.
658 658
 	 */
659
-	do_action( 'give_donor_card_bottom', $donor );
659
+	do_action('give_donor_card_bottom', $donor);
660 660
 
661 661
 }
662 662
 
@@ -669,30 +669,30 @@  discard block
 block discarded – undo
669 669
  *
670 670
  * @return void
671 671
  */
672
-function give_donor_notes_view( $donor ) {
672
+function give_donor_notes_view($donor) {
673 673
 
674
-	$paged          = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1;
675
-	$paged          = absint( $paged );
674
+	$paged          = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1;
675
+	$paged          = absint($paged);
676 676
 	$note_count     = $donor->get_notes_count();
677
-	$per_page       = apply_filters( 'give_donor_notes_per_page', 20 );
678
-	$total_pages    = ceil( $note_count / $per_page );
679
-	$donor_notes = $donor->get_notes( $per_page, $paged );
677
+	$per_page       = apply_filters('give_donor_notes_per_page', 20);
678
+	$total_pages    = ceil($note_count / $per_page);
679
+	$donor_notes = $donor->get_notes($per_page, $paged);
680 680
 	?>
681 681
 
682 682
 	<div id="donor-notes-wrapper">
683 683
 		<div class="donor-notes-header">
684
-			<?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span>
684
+			<?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span>
685 685
 		</div>
686
-		<h3><?php _e( 'Notes', 'give' ); ?></h3>
686
+		<h3><?php _e('Notes', 'give'); ?></h3>
687 687
 
688
-		<?php if ( 1 == $paged ) : ?>
688
+		<?php if (1 == $paged) : ?>
689 689
 			<div style="display: block; margin-bottom: 55px;">
690
-				<form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>">
690
+				<form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>">
691 691
 					<textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea>
692 692
 					<br />
693 693
 					<input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" />
694 694
 					<input type="hidden" name="give_action" value="add-donor-note" />
695
-					<?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?>
695
+					<?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?>
696 696
 					<input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" />
697 697
 				</form>
698 698
 			</div>
@@ -707,26 +707,26 @@  discard block
 block discarded – undo
707 707
 			'show_all' => true,
708 708
 		);
709 709
 
710
-		echo paginate_links( $pagination_args );
710
+		echo paginate_links($pagination_args);
711 711
 		?>
712 712
 
713 713
 		<div id="give-donor-notes" class="postbox">
714
-			<?php if ( count( $donor_notes ) > 0 ) { ?>
715
-				<?php foreach ( $donor_notes as $key => $note ) : ?>
714
+			<?php if (count($donor_notes) > 0) { ?>
715
+				<?php foreach ($donor_notes as $key => $note) : ?>
716 716
 					<div class="donor-note-wrapper dashboard-comment-wrap comment-item">
717 717
 					<span class="note-content-wrap">
718
-						<?php echo stripslashes( $note ); ?>
718
+						<?php echo stripslashes($note); ?>
719 719
 					</span>
720 720
 					</div>
721 721
 				<?php endforeach; ?>
722 722
 			<?php } else { ?>
723 723
 				<div class="give-no-donor-notes">
724
-					<?php _e( 'No donor notes found.', 'give' ); ?>
724
+					<?php _e('No donor notes found.', 'give'); ?>
725 725
 				</div>
726 726
 			<?php } ?>
727 727
 		</div>
728 728
 
729
-		<?php echo paginate_links( $pagination_args ); ?>
729
+		<?php echo paginate_links($pagination_args); ?>
730 730
 
731 731
 	</div>
732 732
 
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
  *
743 743
  * @return void
744 744
  */
745
-function give_donor_delete_view( $donor ) {
745
+function give_donor_delete_view($donor) {
746 746
 
747
-	$donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
747
+	$donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments');
748 748
 
749 749
 	/**
750 750
 	 * Fires in donor delete screen, above the content.
@@ -753,15 +753,15 @@  discard block
 block discarded – undo
753 753
 	 *
754 754
 	 * @param object $donor The donor object being displayed.
755 755
 	 */
756
-	do_action( 'give_donor_delete_top', $donor );
756
+	do_action('give_donor_delete_top', $donor);
757 757
 	?>
758 758
 
759 759
 	<div class="info-wrapper donor-section">
760 760
 
761
-		<form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>">
761
+		<form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>">
762 762
 
763 763
 			<div class="donor-notes-header">
764
-				<?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span>
764
+				<?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span>
765 765
 			</div>
766 766
 
767 767
 
@@ -769,20 +769,20 @@  discard block
 block discarded – undo
769 769
 
770 770
 				<span class="delete-donor-options">
771 771
 					<p>
772
-						<?php echo Give()->html->checkbox( array(
772
+						<?php echo Give()->html->checkbox(array(
773 773
 							'name' => 'give-donor-delete-confirm',
774
-						) ); ?>
775
-						<label for="give-donor-delete-confirm"><?php _e( 'Are you sure you want to delete this donor?', 'give' ); ?></label>
774
+						)); ?>
775
+						<label for="give-donor-delete-confirm"><?php _e('Are you sure you want to delete this donor?', 'give'); ?></label>
776 776
 					</p>
777 777
 
778 778
 					<p>
779
-						<?php echo Give()->html->checkbox( array(
779
+						<?php echo Give()->html->checkbox(array(
780 780
 							'name'    => 'give-donor-delete-records',
781 781
 							'options' => array(
782 782
 								'disabled' => true,
783 783
 							),
784
-						) ); ?>
785
-						<label for="give-donor-delete-records"><?php _e( 'Delete all associated donations and records?', 'give' ); ?></label>
784
+						)); ?>
785
+						<label for="give-donor-delete-records"><?php _e('Delete all associated donations and records?', 'give'); ?></label>
786 786
 					</p>
787 787
 
788 788
 					<?php
@@ -795,16 +795,16 @@  discard block
 block discarded – undo
795 795
 					 *
796 796
 					 * @param object $donor The donor object being displayed.
797 797
 					 */
798
-					do_action( 'give_donor_delete_inputs', $donor );
798
+					do_action('give_donor_delete_inputs', $donor);
799 799
 					?>
800 800
 				</span>
801 801
 
802 802
 				<span id="donor-edit-actions">
803 803
 					<input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" />
804
-					<?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?>
804
+					<?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?>
805 805
 					<input type="hidden" name="give_action" value="delete-donor" />
806
-					<input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e( 'Delete Donor', 'give' ); ?>" />
807
-					<a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php _e( 'Cancel', 'give' ); ?></a>
806
+					<input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e('Delete Donor', 'give'); ?>" />
807
+					<a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php _e('Cancel', 'give'); ?></a>
808 808
 				</span>
809 809
 
810 810
 			</div>
@@ -820,5 +820,5 @@  discard block
 block discarded – undo
820 820
 	 *
821 821
 	 * @param object $donor The donor object being displayed.
822 822
 	 */
823
-	do_action( 'give_donor_delete_bottom', $donor );
823
+	do_action('give_donor_delete_bottom', $donor);
824 824
 }
Please login to merge, or discard this patch.
includes/admin/donors/donor-functions.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array        The altered list of views.
25 25
  */
26
-function give_register_default_donor_views( $views ) {
26
+function give_register_default_donor_views($views) {
27 27
 
28 28
 	$default_views = array(
29 29
 		'overview' => 'give_donor_view',
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		'notes'    => 'give_donor_notes_view',
32 32
 	);
33 33
 
34
-	return array_merge( $views, $default_views );
34
+	return array_merge($views, $default_views);
35 35
 
36 36
 }
37 37
 
38
-add_filter( 'give_donor_views', 'give_register_default_donor_views', 1, 1 );
38
+add_filter('give_donor_views', 'give_register_default_donor_views', 1, 1);
39 39
 
40 40
 /**
41 41
  * Register a tab for the single donor view.
@@ -46,23 +46,23 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return array       The altered list of tabs
48 48
  */
49
-function give_register_default_donor_tabs( $tabs ) {
49
+function give_register_default_donor_tabs($tabs) {
50 50
 
51 51
 	$default_tabs = array(
52 52
 		'overview' => array(
53 53
 			'dashicon' => 'dashicons-admin-users',
54
-			'title' => __( 'Donor Profile', 'give' ),
54
+			'title' => __('Donor Profile', 'give'),
55 55
 		),
56 56
 		'notes'    => array(
57 57
 			'dashicon' => 'dashicons-admin-comments',
58
-			'title' => __( 'Donor Notes', 'give' ),
58
+			'title' => __('Donor Notes', 'give'),
59 59
 		),
60 60
 	);
61 61
 
62
-	return array_merge( $tabs, $default_tabs );
62
+	return array_merge($tabs, $default_tabs);
63 63
 }
64 64
 
65
-add_filter( 'give_donor_tabs', 'give_register_default_donor_tabs', 1, 1 );
65
+add_filter('give_donor_tabs', 'give_register_default_donor_tabs', 1, 1);
66 66
 
67 67
 /**
68 68
  * Register the Delete icon as late as possible so it's at the bottom.
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
  *
74 74
  * @return array       The altered list of tabs, with 'delete' at the bottom.
75 75
  */
76
-function give_register_delete_donor_tab( $tabs ) {
76
+function give_register_delete_donor_tab($tabs) {
77 77
 
78 78
 	$tabs['delete'] = array(
79 79
 		'dashicon' => 'dashicons-trash',
80
-		'title'    => __( 'Delete Donor', 'give' ),
80
+		'title'    => __('Delete Donor', 'give'),
81 81
 	);
82 82
 
83 83
 	return $tabs;
84 84
 }
85 85
 
86
-add_filter( 'give_donor_tabs', 'give_register_delete_donor_tab', PHP_INT_MAX, 1 );
86
+add_filter('give_donor_tabs', 'give_register_delete_donor_tab', PHP_INT_MAX, 1);
87 87
 
88 88
 /**
89 89
  * Connect and Reconnect Donor with User profile.
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  *
97 97
  * @return array
98 98
  */
99
-function give_connect_user_donor_profile( $donor, $donor_data, $address ) {
99
+function give_connect_user_donor_profile($donor, $donor_data, $address) {
100 100
 
101 101
 	$donor_id         = $donor->id;
102 102
 	$previous_user_id = $donor->user_id;
@@ -110,40 +110,40 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @since 1.0
112 112
 	 */
113
-	do_action( 'give_pre_edit_donor', $donor_id, $donor_data, $address );
113
+	do_action('give_pre_edit_donor', $donor_id, $donor_data, $address);
114 114
 
115 115
 	$output = array();
116 116
 
117
-	if ( $donor->update( $donor_data ) ) {
117
+	if ($donor->update($donor_data)) {
118 118
 
119
-		if ( ! empty( $donor->user_id ) && $donor->user_id > 0 ) {
120
-			update_user_meta( $donor->user_id, '_give_user_address', $address );
119
+		if ( ! empty($donor->user_id) && $donor->user_id > 0) {
120
+			update_user_meta($donor->user_id, '_give_user_address', $address);
121 121
 		}
122 122
 
123 123
 		// Update some donation meta if we need to.
124
-		$payments_array = explode( ',', $donor->payment_ids );
124
+		$payments_array = explode(',', $donor->payment_ids);
125 125
 
126
-		if ( $donor->user_id !== $previous_user_id ) {
127
-			foreach ( $payments_array as $payment_id ) {
128
-				give_update_payment_meta( $payment_id, '_give_payment_user_id', $donor->user_id );
126
+		if ($donor->user_id !== $previous_user_id) {
127
+			foreach ($payments_array as $payment_id) {
128
+				give_update_payment_meta($payment_id, '_give_payment_user_id', $donor->user_id);
129 129
 			}
130 130
 		}
131 131
 
132 132
 		// Fetch disconnected user id, if exists.
133
-		$disconnected_user_id = $donor->get_meta( '_give_disconnected_user_id', true );
133
+		$disconnected_user_id = $donor->get_meta('_give_disconnected_user_id', true);
134 134
 
135 135
 		// Flag User and Donor Disconnection.
136
-		delete_user_meta( $disconnected_user_id, '_give_is_donor_disconnected' );
136
+		delete_user_meta($disconnected_user_id, '_give_is_donor_disconnected');
137 137
 
138 138
 		// Check whether the disconnected user id and the reconnected user id are same or not.
139 139
 		// If both are same then delete user id store in donor meta.
140
-		if( $donor_data['user_id'] === $disconnected_user_id ) {
141
-			delete_user_meta( $disconnected_user_id, '_give_disconnected_donor_id' );
142
-			$donor->delete_meta( '_give_disconnected_user_id' );
140
+		if ($donor_data['user_id'] === $disconnected_user_id) {
141
+			delete_user_meta($disconnected_user_id, '_give_disconnected_donor_id');
142
+			$donor->delete_meta('_give_disconnected_user_id');
143 143
 		}
144 144
 
145 145
 		$output['success']       = true;
146
-		$donor_data              = array_merge( $donor_data, $address );
146
+		$donor_data              = array_merge($donor_data, $address);
147 147
 		$output['customer_info'] = $donor_data;
148 148
 
149 149
 	} else {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 *
161 161
 	 * @since 1.0
162 162
 	 */
163
-	do_action( 'give_post_edit_donor', $donor_id, $donor_data );
163
+	do_action('give_post_edit_donor', $donor_id, $donor_data);
164 164
 
165 165
 
166 166
 	return $output;
Please login to merge, or discard this patch.
includes/admin/class-admin-settings.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 
94 94
 			// Show error message if Akismet not configured and Admin try to save 'enabled' option.
95 95
 			if ( isset( $_POST['akismet_spam_protection'] )
96
-			     && give_is_setting_enabled( $_POST['akismet_spam_protection'] )
97
-			     && ! give_check_akismet_key()
96
+				 && give_is_setting_enabled( $_POST['akismet_spam_protection'] )
97
+				 && ! give_check_akismet_key()
98 98
 			) {
99 99
 				self::add_error( 'give-akismet-protection', __( 'Please properly configure Akismet to enable SPAM protection.', 'give' ) );
100 100
 
@@ -763,9 +763,9 @@  discard block
 block discarded – undo
763 763
                         <td class="give-docs-link" colspan="2">
764 764
 							<?php
765 765
 							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
766
-							     . '" target="_blank">'
767
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
768
-							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
766
+								 . '" target="_blank">'
767
+								 . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
768
+								 . '<span class="dashicons dashicons-editor-help"></span></a></p>';
769 769
 							?>
770 770
                         </td>
771 771
                         </tr><?php
Please login to merge, or discard this patch.
Spacing   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Admin_Settings' ) ) :
16
+if ( ! class_exists('Give_Admin_Settings')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Admin_Settings Class.
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			 *
73 73
 			 * @param array $settings Array of settings class object.
74 74
 			 */
75
-			self::$settings = apply_filters( self::$setting_filter_prefix . '_get_settings_pages', array() );
75
+			self::$settings = apply_filters(self::$setting_filter_prefix.'_get_settings_pages', array());
76 76
 
77 77
 			return self::$settings;
78 78
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		 * @return bool
87 87
 		 */
88 88
 		public static function verify_nonce() {
89
-			if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
89
+			if (empty($_REQUEST['_give-save-settings']) || ! wp_verify_nonce($_REQUEST['_give-save-settings'], 'give-save-settings')) {
90 90
 				return false;
91 91
 			}
92 92
 
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 		public static function save() {
103 103
 			$current_tab = give_get_current_setting_tab();
104 104
 
105
-			if( ! self::verify_nonce()  ) {
106
-				echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>';
105
+			if ( ! self::verify_nonce()) {
106
+				echo '<div class="notice error"><p>'.__('Action failed. Please refresh the page and retry.', 'give').'</p></div>';
107 107
 				die();
108 108
 			}
109 109
 
110 110
 			// Show error message if Akismet not configured and Admin try to save 'enabled' option.
111
-			if ( isset( $_POST['akismet_spam_protection'] )
112
-			     && give_is_setting_enabled( $_POST['akismet_spam_protection'] )
111
+			if (isset($_POST['akismet_spam_protection'])
112
+			     && give_is_setting_enabled($_POST['akismet_spam_protection'])
113 113
 			     && ! give_check_akismet_key()
114 114
 			) {
115
-				self::add_error( 'give-akismet-protection', __( 'Please properly configure Akismet to enable SPAM protection.', 'give' ) );
115
+				self::add_error('give-akismet-protection', __('Please properly configure Akismet to enable SPAM protection.', 'give'));
116 116
 
117 117
 				return;
118 118
 			}
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 			 *
127 127
 			 * @since 1.8
128 128
 			 */
129
-			do_action( self::$setting_filter_prefix . '_save_' . $current_tab );
129
+			do_action(self::$setting_filter_prefix.'_save_'.$current_tab);
130 130
 
131
-			self::add_message( 'give-setting-updated', __( 'Your settings have been saved.', 'give' ) );
131
+			self::add_message('give-setting-updated', __('Your settings have been saved.', 'give'));
132 132
 
133 133
 			/**
134 134
 			 * Trigger Action.
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 			 *
140 140
 			 * @since 1.8
141 141
 			 */
142
-			do_action( self::$setting_filter_prefix . '_saved' );
142
+			do_action(self::$setting_filter_prefix.'_saved');
143 143
 		}
144 144
 
145 145
 		/**
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 		 *
153 153
 		 * @return void
154 154
 		 */
155
-		public static function add_message( $code, $message ) {
156
-			self::$messages[ $code ] = $message;
155
+		public static function add_message($code, $message) {
156
+			self::$messages[$code] = $message;
157 157
 		}
158 158
 
159 159
 		/**
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 		 *
167 167
 		 * @return void
168 168
 		 */
169
-		public static function add_error( $code, $message ) {
170
-			self::$errors[ $code ] = $message;
169
+		public static function add_error($code, $message) {
170
+			self::$errors[$code] = $message;
171 171
 		}
172 172
 
173 173
 		/**
@@ -180,18 +180,18 @@  discard block
 block discarded – undo
180 180
 			$notice_html = '';
181 181
 			$classes     = 'give-notice settings-error notice is-dismissible';
182 182
 
183
-			self::$errors   = apply_filters( self::$setting_filter_prefix . '_error_notices', self::$errors );
184
-			self::$messages = apply_filters( self::$setting_filter_prefix . '_update_notices', self::$messages );
183
+			self::$errors   = apply_filters(self::$setting_filter_prefix.'_error_notices', self::$errors);
184
+			self::$messages = apply_filters(self::$setting_filter_prefix.'_update_notices', self::$messages);
185 185
 
186
-			if ( 0 < count( self::$errors ) ) {
187
-				foreach ( self::$errors as $code => $message ) {
188
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' error"><p><strong>' . $message . '</strong></p></div>';
186
+			if (0 < count(self::$errors)) {
187
+				foreach (self::$errors as $code => $message) {
188
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' error"><p><strong>'.$message.'</strong></p></div>';
189 189
 				}
190 190
 			}
191 191
 
192
-			if ( 0 < count( self::$messages ) ) {
193
-				foreach ( self::$messages as $code => $message ) {
194
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' updated"><p><strong>' . $message . '</strong></p></div>';
192
+			if (0 < count(self::$messages)) {
193
+				foreach (self::$messages as $code => $message) {
194
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' updated"><p><strong>'.$message.'</strong></p></div>';
195 195
 				}
196 196
 			}
197 197
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			self::$setting_filter_prefix = give_get_current_setting_page();
212 212
 
213 213
 			// Bailout: Exit if setting page is not defined.
214
-			if ( empty( self::$setting_filter_prefix ) ) {
214
+			if (empty(self::$setting_filter_prefix)) {
215 215
 				return false;
216 216
 			}
217 217
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 			 *
225 225
 			 * @since 1.8
226 226
 			 */
227
-			do_action( self::$setting_filter_prefix . '_start' );
227
+			do_action(self::$setting_filter_prefix.'_start');
228 228
 
229 229
 			$current_tab = give_get_current_setting_tab();
230 230
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 			self::get_settings_pages();
233 233
 
234 234
 			// Save settings if data has been posted.
235
-			if ( ! empty( $_POST ) ) {
235
+			if ( ! empty($_POST)) {
236 236
 				self::save();
237 237
 			}
238 238
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 			 *
246 246
 			 * @since 1.8
247 247
 			 */
248
-			$tabs = apply_filters( self::$setting_filter_prefix . '_tabs_array', array() );
248
+			$tabs = apply_filters(self::$setting_filter_prefix.'_tabs_array', array());
249 249
 
250 250
 			include 'views/html-admin-settings.php';
251 251
 
@@ -263,25 +263,25 @@  discard block
 block discarded – undo
263 263
 		 *
264 264
 		 * @return string|bool
265 265
 		 */
266
-		public static function get_option( $option_name = '', $field_id = '', $default = false ) {
266
+		public static function get_option($option_name = '', $field_id = '', $default = false) {
267 267
 			// Bailout.
268
-			if ( empty( $option_name ) && empty( $field_id ) ) {
268
+			if (empty($option_name) && empty($field_id)) {
269 269
 				return false;
270 270
 			}
271 271
 
272
-			if ( ! empty( $field_id ) && ! empty( $option_name ) ) {
272
+			if ( ! empty($field_id) && ! empty($option_name)) {
273 273
 				// Get field value if any.
274
-				$option_value = get_option( $option_name );
274
+				$option_value = get_option($option_name);
275 275
 
276
-				$option_value = ( is_array( $option_value ) && array_key_exists( $field_id, $option_value ) )
277
-					? $option_value[ $field_id ]
276
+				$option_value = (is_array($option_value) && array_key_exists($field_id, $option_value))
277
+					? $option_value[$field_id]
278 278
 					: $default;
279 279
 			} else {
280 280
 				// If option name is empty but not field name then this means, setting is direct store to option table under there field name.
281 281
 				$option_name = ! $option_name ? $field_id : $option_name;
282 282
 
283 283
 				// Get option value if any.
284
-				$option_value = get_option( $option_name, $default );
284
+				$option_value = get_option($option_name, $default);
285 285
 			}
286 286
 
287 287
 			return $option_value;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		 *
300 300
 		 * @return void
301 301
 		 */
302
-		public static function output_fields( $options, $option_name = '' ) {
302
+		public static function output_fields($options, $option_name = '') {
303 303
 			$current_tab = give_get_current_setting_tab();
304 304
 
305 305
 			// Field Default values.
@@ -312,52 +312,52 @@  discard block
 block discarded – undo
312 312
 				'table_html' => true,
313 313
 			);
314 314
 
315
-			foreach ( $options as $value ) {
316
-				if ( ! isset( $value['type'] ) ) {
315
+			foreach ($options as $value) {
316
+				if ( ! isset($value['type'])) {
317 317
 					continue;
318 318
 				}
319 319
 
320 320
 				// Set title.
321
-				$defaults['title'] = isset( $value['name'] ) ? $value['name'] : '';
321
+				$defaults['title'] = isset($value['name']) ? $value['name'] : '';
322 322
 
323 323
 				// Set default setting.
324
-				$value = wp_parse_args( $value, $defaults );
324
+				$value = wp_parse_args($value, $defaults);
325 325
 
326 326
 				// Colorpicker field.
327
-				$value['class'] = ( 'colorpicker' === $value['type'] ? trim( $value['class'] ) . ' give-colorpicker' : $value['class'] );
328
-				$value['type']  = ( 'colorpicker' === $value['type'] ? 'text' : $value['type'] );
327
+				$value['class'] = ('colorpicker' === $value['type'] ? trim($value['class']).' give-colorpicker' : $value['class']);
328
+				$value['type']  = ('colorpicker' === $value['type'] ? 'text' : $value['type']);
329 329
 
330 330
 
331 331
 				// Custom attribute handling.
332 332
 				$custom_attributes = array();
333 333
 
334
-				if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) {
335
-					foreach ( $value['attributes'] as $attribute => $attribute_value ) {
336
-						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
334
+				if ( ! empty($value['attributes']) && is_array($value['attributes'])) {
335
+					foreach ($value['attributes'] as $attribute => $attribute_value) {
336
+						$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"';
337 337
 					}
338 338
 				}
339 339
 
340 340
 				// Description handling.
341
-				$description          = self::get_field_description( $value );
341
+				$description = self::get_field_description($value);
342 342
 
343 343
 				// Switch based on type.
344
-				switch ( $value['type'] ) {
344
+				switch ($value['type']) {
345 345
 
346 346
 					// Section Titles
347 347
 					case 'title':
348
-						if ( ! empty( $value['title'] ) ) {
349
-							echo '<div class="give-setting-tab-header give-setting-tab-header-' . $current_tab . '"><h2>' . self::get_field_title( $value ) . '</h2><hr></div>';
348
+						if ( ! empty($value['title'])) {
349
+							echo '<div class="give-setting-tab-header give-setting-tab-header-'.$current_tab.'"><h2>'.self::get_field_title($value).'</h2><hr></div>';
350 350
 						}
351 351
 
352
-						if ( ! empty( $value['desc'] ) ) {
353
-							echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
352
+						if ( ! empty($value['desc'])) {
353
+							echo wpautop(wptexturize(wp_kses_post($value['desc'])));
354 354
 						}
355 355
 
356
-						if ( $value['table_html'] ) {
357
-							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-' . $current_tab . '">' . "\n\n";
356
+						if ($value['table_html']) {
357
+							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-'.$current_tab.'">'."\n\n";
358 358
 						}
359 359
 
360
-						if ( ! empty( $value['id'] ) ) {
360
+						if ( ! empty($value['id'])) {
361 361
 
362 362
 							/**
363 363
 							 * Trigger Action.
@@ -366,14 +366,14 @@  discard block
 block discarded – undo
366 366
 							 *
367 367
 							 * @since 1.8
368 368
 							 */
369
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) );
369
+							do_action('give_settings_'.sanitize_title($value['id']));
370 370
 						}
371 371
 
372 372
 						break;
373 373
 
374 374
 					// Section Ends.
375 375
 					case 'sectionend':
376
-						if ( ! empty( $value['id'] ) ) {
376
+						if ( ! empty($value['id'])) {
377 377
 
378 378
 							/**
379 379
 							 * Trigger Action.
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 							 *
383 383
 							 * @since 1.8
384 384
 							 */
385
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_end' );
385
+							do_action('give_settings_'.sanitize_title($value['id']).'_end');
386 386
 						}
387 387
 
388
-						if ( $value['table_html'] ) {
388
+						if ($value['table_html']) {
389 389
 							echo '</table>';
390 390
 						}
391 391
 
392
-						if ( ! empty( $value['id'] ) ) {
392
+						if ( ! empty($value['id'])) {
393 393
 
394 394
 							/**
395 395
 							 * Trigger Action.
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 							 *
399 399
 							 * @since 1.8
400 400
 							 */
401
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_after' );
401
+							do_action('give_settings_'.sanitize_title($value['id']).'_after');
402 402
 						}
403 403
 
404 404
 						break;
@@ -406,27 +406,27 @@  discard block
 block discarded – undo
406 406
 					// Standard text inputs and subtypes like 'number'.
407 407
 					case 'colorpicker':
408 408
 					case 'hidden' :
409
-						$value['wrapper_class'] = empty( $value['wrapper_class'] ) ? 'give-hidden' : trim( $value['wrapper_class'] ) . ' give-hidden';
409
+						$value['wrapper_class'] = empty($value['wrapper_class']) ? 'give-hidden' : trim($value['wrapper_class']).' give-hidden';
410 410
 					case 'text':
411 411
 					case 'email':
412 412
 					case 'number':
413 413
 					case 'password' :
414 414
 						$type = $value['type'];
415
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
415
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
416 416
 						?>
417
-						<tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
417
+						<tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
418 418
 							<th scope="row" class="titledesc">
419
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
419
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
420 420
 							</th>
421
-							<td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
421
+							<td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
422 422
 								<input
423
-										name="<?php echo esc_attr( $value['id'] ); ?>"
424
-										id="<?php echo esc_attr( $value['id'] ); ?>"
425
-										type="<?php echo esc_attr( $type ); ?>"
426
-										style="<?php echo esc_attr( $value['css'] ); ?>"
427
-										value="<?php echo esc_attr( $option_value ); ?>"
428
-										class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
429
-									<?php echo implode( ' ', $custom_attributes ); ?>
423
+										name="<?php echo esc_attr($value['id']); ?>"
424
+										id="<?php echo esc_attr($value['id']); ?>"
425
+										type="<?php echo esc_attr($type); ?>"
426
+										style="<?php echo esc_attr($value['css']); ?>"
427
+										value="<?php echo esc_attr($option_value); ?>"
428
+										class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
429
+									<?php echo implode(' ', $custom_attributes); ?>
430 430
 								/> <?php echo $description; ?>
431 431
 							</td>
432 432
 						</tr>
@@ -436,23 +436,23 @@  discard block
 block discarded – undo
436 436
 					// Textarea.
437 437
 					case 'textarea':
438 438
 
439
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
439
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
440 440
 
441 441
 						?>
442
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
442
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
443 443
                         <th scope="row" class="titledesc">
444
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
444
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
445 445
                         </th>
446
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
446
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
447 447
 								<textarea
448
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
449
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
450
-                                        style="<?php echo esc_attr( $value['css'] ); ?>"
451
-                                        class="<?php echo esc_attr( $value['class'] ); ?>"
448
+                                        name="<?php echo esc_attr($value['id']); ?>"
449
+                                        id="<?php echo esc_attr($value['id']); ?>"
450
+                                        style="<?php echo esc_attr($value['css']); ?>"
451
+                                        class="<?php echo esc_attr($value['class']); ?>"
452 452
                                         rows="10"
453 453
                                         cols="60"
454
-									<?php echo implode( ' ', $custom_attributes ); ?>
455
-                                ><?php echo esc_textarea( $option_value ); ?></textarea>
454
+									<?php echo implode(' ', $custom_attributes); ?>
455
+                                ><?php echo esc_textarea($option_value); ?></textarea>
456 456
 							<?php echo $description; ?>
457 457
                         </td>
458 458
                         </tr><?php
@@ -462,35 +462,35 @@  discard block
 block discarded – undo
462 462
 					case 'select' :
463 463
 					case 'multiselect' :
464 464
 
465
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
465
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
466 466
 
467 467
 						?>
468
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
468
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
469 469
                         <th scope="row" class="titledesc">
470
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
470
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
471 471
                         </th>
472
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
472
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
473 473
                             <select
474
-                                    name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) {
474
+                                    name="<?php echo esc_attr($value['id']); ?><?php if ($value['type'] == 'multiselect') {
475 475
 										echo '[]';
476 476
 									} ?>"
477
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
478
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
479
-                                    class="<?php echo esc_attr( $value['class'] ); ?>"
480
-								<?php echo implode( ' ', $custom_attributes ); ?>
481
-								<?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?>
477
+                                    id="<?php echo esc_attr($value['id']); ?>"
478
+                                    style="<?php echo esc_attr($value['css']); ?>"
479
+                                    class="<?php echo esc_attr($value['class']); ?>"
480
+								<?php echo implode(' ', $custom_attributes); ?>
481
+								<?php echo ('multiselect' == $value['type']) ? 'multiple="multiple"' : ''; ?>
482 482
                             >
483 483
 
484 484
 								<?php
485
-								if ( ! empty( $value['options'] ) ) {
486
-									foreach ( $value['options'] as $key => $val ) {
485
+								if ( ! empty($value['options'])) {
486
+									foreach ($value['options'] as $key => $val) {
487 487
 										?>
488
-                                        <option value="<?php echo esc_attr( $key ); ?>" <?php
488
+                                        <option value="<?php echo esc_attr($key); ?>" <?php
489 489
 
490
-										if ( is_array( $option_value ) ) {
491
-											selected( in_array( $key, $option_value ), true );
490
+										if (is_array($option_value)) {
491
+											selected(in_array($key, $option_value), true);
492 492
 										} else {
493
-											selected( $option_value, $key );
493
+											selected($option_value, $key);
494 494
 										}
495 495
 
496 496
 										?>><?php echo $val ?></option>
@@ -506,28 +506,28 @@  discard block
 block discarded – undo
506 506
 
507 507
 					// Radio inputs.
508 508
 					case 'radio_inline' :
509
-						$value['class'] = empty( $value['class'] ) ? 'give-radio-inline' : $value['class'] . ' give-radio-inline';
509
+						$value['class'] = empty($value['class']) ? 'give-radio-inline' : $value['class'].' give-radio-inline';
510 510
 					case 'radio' :
511
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
511
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
512 512
 						?>
513
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
513
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
514 514
                         <th scope="row" class="titledesc">
515
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
515
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
516 516
                         </th>
517
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
517
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
518 518
                             <fieldset>
519 519
                                 <ul>
520 520
 									<?php
521
-									foreach ( $value['options'] as $key => $val ) {
521
+									foreach ($value['options'] as $key => $val) {
522 522
 										?>
523 523
                                         <li>
524 524
                                             <label><input
525
-                                                        name="<?php echo esc_attr( $value['id'] ); ?>"
525
+                                                        name="<?php echo esc_attr($value['id']); ?>"
526 526
                                                         value="<?php echo $key; ?>"
527 527
                                                         type="radio"
528
-                                                        style="<?php echo esc_attr( $value['css'] ); ?>"
529
-													<?php echo implode( ' ', $custom_attributes ); ?>
530
-													<?php checked( $key, $option_value ); ?>
528
+                                                        style="<?php echo esc_attr($value['css']); ?>"
529
+													<?php echo implode(' ', $custom_attributes); ?>
530
+													<?php checked($key, $option_value); ?>
531 531
                                                 /> <?php echo $val ?></label>
532 532
                                         </li>
533 533
 										<?php
@@ -541,21 +541,21 @@  discard block
 block discarded – undo
541 541
 
542 542
 					// Checkbox input.
543 543
 					case 'checkbox' :
544
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
544
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
545 545
 						?>
546
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
546
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
547 547
                             <th scope="row" class="titledesc">
548
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
548
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
549 549
                             </th>
550 550
                             <td class="give-forminp">
551 551
                                 <input
552
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
553
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
552
+                                        name="<?php echo esc_attr($value['id']); ?>"
553
+                                        id="<?php echo esc_attr($value['id']); ?>"
554 554
                                         type="checkbox"
555
-                                        class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
555
+                                        class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>"
556 556
                                         value="1"
557
-									<?php checked( $option_value, 'on' ); ?>
558
-									<?php echo implode( ' ', $custom_attributes ); ?>
557
+									<?php checked($option_value, 'on'); ?>
558
+									<?php echo implode(' ', $custom_attributes); ?>
559 559
                                 />
560 560
 								<?php echo $description; ?>
561 561
                             </td>
@@ -565,28 +565,28 @@  discard block
 block discarded – undo
565 565
 
566 566
 					// Multi Checkbox input.
567 567
 					case 'multicheck' :
568
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
569
-						$option_value = is_array( $option_value ) ? $option_value : array();
568
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
569
+						$option_value = is_array($option_value) ? $option_value : array();
570 570
 						?>
571
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
571
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
572 572
                             <th scope="row" class="titledesc">
573
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
573
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
574 574
                             </th>
575
-                            <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
575
+                            <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
576 576
                                 <fieldset>
577 577
                                     <ul>
578 578
 										<?php
579
-										foreach ( $value['options'] as $key => $val ) {
579
+										foreach ($value['options'] as $key => $val) {
580 580
 											?>
581 581
                                             <li>
582 582
                                                 <label>
583 583
                                                     <input
584
-                                                            name="<?php echo esc_attr( $value['id'] ); ?>[]"
584
+                                                            name="<?php echo esc_attr($value['id']); ?>[]"
585 585
                                                             value="<?php echo $key; ?>"
586 586
                                                             type="checkbox"
587
-                                                            style="<?php echo esc_attr( $value['css'] ); ?>"
588
-														<?php echo implode( ' ', $custom_attributes ); ?>
589
-														<?php if ( in_array( $key, $option_value ) ) {
587
+                                                            style="<?php echo esc_attr($value['css']); ?>"
588
+														<?php echo implode(' ', $custom_attributes); ?>
589
+														<?php if (in_array($key, $option_value)) {
590 590
 															echo 'checked="checked"';
591 591
 														} ?>
592 592
                                                     /> <?php echo $val ?>
@@ -605,35 +605,35 @@  discard block
 block discarded – undo
605 605
 					// File input field.
606 606
 					case 'file' :
607 607
 					case 'media' :
608
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
609
-						$button_label = esc_html__( sprintf( 'Add or Upload %s', ( 'file' === $value['type'] ? 'File' : 'Image' ) ), 'give' );
610
-						$fvalue       = empty( $value['fvalue'] ) ? 'url' : $value['fvalue'];
611
-
612
-						$allow_media_preview_tags = array( 'jpg', 'jpeg', 'png', 'gif', 'ico' );
613
-						$preview_image_src        = $option_value ? ( 'id' === $fvalue ? wp_get_attachment_url( $option_value ) : $option_value ) : '#';
614
-						$preview_image_extension  = $preview_image_src ? pathinfo( $preview_image_src, PATHINFO_EXTENSION ) : '';
615
-						$is_show_preview = in_array( $preview_image_extension, $allow_media_preview_tags );
608
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
609
+						$button_label = esc_html__(sprintf('Add or Upload %s', ('file' === $value['type'] ? 'File' : 'Image')), 'give');
610
+						$fvalue       = empty($value['fvalue']) ? 'url' : $value['fvalue'];
611
+
612
+						$allow_media_preview_tags = array('jpg', 'jpeg', 'png', 'gif', 'ico');
613
+						$preview_image_src        = $option_value ? ('id' === $fvalue ? wp_get_attachment_url($option_value) : $option_value) : '#';
614
+						$preview_image_extension  = $preview_image_src ? pathinfo($preview_image_src, PATHINFO_EXTENSION) : '';
615
+						$is_show_preview = in_array($preview_image_extension, $allow_media_preview_tags);
616 616
 						?>
617
-						<tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
617
+						<tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
618 618
 							<th scope="row" class="titledesc">
619
-								<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
619
+								<label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
620 620
 							</th>
621 621
 							<td class="give-forminp">
622 622
 								<div class="give-field-wrap">
623 623
 									<label for="<?php echo $value['id'] ?>">
624 624
 										<input
625
-												name="<?php echo esc_attr( $value['id'] ); ?>"
626
-												id="<?php echo esc_attr( $value['id'] ); ?>"
625
+												name="<?php echo esc_attr($value['id']); ?>"
626
+												id="<?php echo esc_attr($value['id']); ?>"
627 627
 												type="text"
628
-												class="give-input-field<?php echo esc_attr( isset( $value['class'] ) ? ' ' . $value['class'] : '' ); ?>"
628
+												class="give-input-field<?php echo esc_attr(isset($value['class']) ? ' '.$value['class'] : ''); ?>"
629 629
 												value="<?php echo $option_value; ?>"
630
-												style="<?php echo esc_attr( $value['css'] ); ?>"
631
-											<?php echo implode( ' ', $custom_attributes ); ?>
630
+												style="<?php echo esc_attr($value['css']); ?>"
631
+											<?php echo implode(' ', $custom_attributes); ?>
632 632
 										/>&nbsp;&nbsp;&nbsp;&nbsp;<input class="give-upload-button button" type="button" data-fvalue="<?php echo $fvalue; ?>" data-field-type="<?php echo $value['type']; ?>" value="<?php echo $button_label; ?>">
633 633
 										<?php echo $description ?>
634 634
 										<div class="give-image-thumb<?php echo ! $option_value || ! $is_show_preview ? ' give-hidden' : ''; ?>">
635 635
 											<span class="give-delete-image-thumb dashicons dashicons-no-alt"></span>
636
-											<img src="<?php echo $preview_image_src ; ?>" alt="">
636
+											<img src="<?php echo $preview_image_src; ?>" alt="">
637 637
 										</div>
638 638
 									</label>
639 639
 								</div>
@@ -645,17 +645,17 @@  discard block
 block discarded – undo
645 645
 					// WordPress Editor.
646 646
 					case 'wysiwyg' :
647 647
 						// Get option value.
648
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
648
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
649 649
 
650 650
 						// Get editor settings.
651
-						$editor_settings = ! empty( $value['options'] ) ? $value['options'] : array();
651
+						$editor_settings = ! empty($value['options']) ? $value['options'] : array();
652 652
 						?>
653
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
653
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
654 654
                         <th scope="row" class="titledesc">
655
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
655
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
656 656
                         </th>
657 657
                         <td class="give-forminp">
658
-							<?php wp_editor( $option_value, $value['id'], $editor_settings ); ?>
658
+							<?php wp_editor($option_value, $value['id'], $editor_settings); ?>
659 659
 							<?php echo $description; ?>
660 660
                         </td>
661 661
                         </tr><?php
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
 					// Custom: System setting field.
665 665
 					case 'system_info' :
666 666
 						?>
667
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
667
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
668 668
                         <th scope="row" class="titledesc">
669
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
669
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
670 670
                         </th>
671 671
                         <td class="give-forminp">
672 672
 							<?php give_system_info_callback(); ?>
@@ -677,14 +677,14 @@  discard block
 block discarded – undo
677 677
 
678 678
 					// Custom: Default gateways setting field.
679 679
 					case 'default_gateway' :
680
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
680
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
681 681
 						?>
682
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
682
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
683 683
                         <th scope="row" class="titledesc">
684
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
684
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
685 685
                         </th>
686 686
                         <td class="give-forminp">
687
-							<?php give_default_gateway_callback( $value, $option_value ); ?>
687
+							<?php give_default_gateway_callback($value, $option_value); ?>
688 688
 							<?php echo $description; ?>
689 689
                         </td>
690 690
                         </tr><?php
@@ -692,14 +692,14 @@  discard block
 block discarded – undo
692 692
 
693 693
 					// Custom: Enable gateways setting field.
694 694
 					case 'enabled_gateways' :
695
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
695
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
696 696
 						?>
697
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
697
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
698 698
                         <th scope="row" class="titledesc">
699
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
699
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
700 700
                         </th>
701 701
                         <td class="give-forminp">
702
-							<?php give_enabled_gateways_callback( $value, $option_value ); ?>
702
+							<?php give_enabled_gateways_callback($value, $option_value); ?>
703 703
 							<?php echo $description; ?>
704 704
                         </td>
705 705
                         </tr><?php
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
 					// Custom: Email preview buttons field.
709 709
 					case 'email_preview_buttons' :
710 710
 						?>
711
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
711
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
712 712
                         <th scope="row" class="titledesc">
713
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
713
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
714 714
                         </th>
715 715
                         <td class="give-forminp">
716 716
 							<?php give_email_preview_buttons_callback(); ?>
@@ -727,22 +727,22 @@  discard block
 block discarded – undo
727 727
 
728 728
 					// Custom: Gateway API key.
729 729
 					case 'api_key' :
730
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
731
-						$type         = ! empty( $option_value ) ? 'password' : 'text';
730
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
731
+						$type         = ! empty($option_value) ? 'password' : 'text';
732 732
 						?>
733
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
733
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
734 734
                         <th scope="row" class="titledesc">
735
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
735
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
736 736
                         </th>
737
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
737
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
738 738
                             <input
739
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
740
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
741
-                                    type="<?php echo esc_attr( $type ); ?>"
742
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
743
-                                    value="<?php echo esc_attr( trim( $option_value ) ); ?>"
744
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
745
-								<?php echo implode( ' ', $custom_attributes ); ?>
739
+                                    name="<?php echo esc_attr($value['id']); ?>"
740
+                                    id="<?php echo esc_attr($value['id']); ?>"
741
+                                    type="<?php echo esc_attr($type); ?>"
742
+                                    style="<?php echo esc_attr($value['css']); ?>"
743
+                                    value="<?php echo esc_attr(trim($option_value)); ?>"
744
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
745
+								<?php echo implode(' ', $custom_attributes); ?>
746 746
                             /> <?php echo $description; ?>
747 747
                         </td>
748 748
                         </tr><?php
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 						 *
760 760
 						 * @since 1.0
761 761
 						 */
762
-						do_action( "give_logs_view_{$current_section}" );
762
+						do_action("give_logs_view_{$current_section}");
763 763
 
764 764
 						echo $description;
765 765
 						break;
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 					// Custom: Data field.
768 768
 					case 'data' :
769 769
 
770
-						include  GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-data.php';
770
+						include  GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-data.php';
771 771
 
772 772
 						echo $description;
773 773
 						break;
@@ -775,12 +775,12 @@  discard block
 block discarded – undo
775 775
 					// Custom: Give Docs Link field type.
776 776
 					case 'give_docs_link' :
777 777
 						?>
778
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
778
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
779 779
                         <td class="give-docs-link" colspan="2">
780 780
 							<?php
781
-							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
781
+							echo '<p class="give-docs-link"><a href="'.esc_url($value['url'])
782 782
 							     . '" target="_blank">'
783
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
783
+							     . sprintf(esc_html__('Need Help? See docs on "%s"', 'give'), $value['title'])
784 784
 							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
785 785
 							?>
786 786
                         </td>
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
 					// You can add or handle your custom field action.
792 792
 					default:
793 793
 						// Get option value.
794
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
795
-						do_action( 'give_admin_field_' . $value['type'], $value, $option_value );
794
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
795
+						do_action('give_admin_field_'.$value['type'], $value, $option_value);
796 796
 						break;
797 797
 				}
798 798
 			}
@@ -808,15 +808,15 @@  discard block
 block discarded – undo
808 808
 		 *
809 809
 		 * @return string The HTML description of the field.
810 810
 		 */
811
-		public static function get_field_description( $value ) {
811
+		public static function get_field_description($value) {
812 812
 			$description = '';
813 813
 
814 814
 			// Support for both 'description' and 'desc' args.
815
-			$description_key = isset( $value['description'] ) ? 'description' : 'desc';
816
-			$value           = ( isset( $value[ $description_key ] ) && ! empty( $value[ $description_key ] ) ) ? $value[ $description_key ] : '';
815
+			$description_key = isset($value['description']) ? 'description' : 'desc';
816
+			$value           = (isset($value[$description_key]) && ! empty($value[$description_key])) ? $value[$description_key] : '';
817 817
 
818
-			if ( ! empty( $value ) ) {
819
-				$description = '<p class="give-field-description">' . wp_kses_post( $value ) . '</p>';
818
+			if ( ! empty($value)) {
819
+				$description = '<p class="give-field-description">'.wp_kses_post($value).'</p>';
820 820
 			}
821 821
 
822 822
 			return $description;
@@ -833,11 +833,11 @@  discard block
 block discarded – undo
833 833
 		 *
834 834
 		 * @return array The description and tip as a 2 element array
835 835
 		 */
836
-		public static function get_field_title( $value ) {
837
-			$title = esc_html( $value['title'] );
836
+		public static function get_field_title($value) {
837
+			$title = esc_html($value['title']);
838 838
 
839 839
 			// If html tag detected then allow them to print.
840
-			if ( strip_tags( $title ) ) {
840
+			if (strip_tags($title)) {
841 841
 				$title = $value['title'];
842 842
 			}
843 843
 
@@ -856,8 +856,8 @@  discard block
 block discarded – undo
856 856
 		 *
857 857
 		 * @return bool
858 858
 		 */
859
-		public static function save_fields( $options, $option_name = '' ) {
860
-			if ( empty( $_POST ) ) {
859
+		public static function save_fields($options, $option_name = '') {
860
+			if (empty($_POST)) {
861 861
 				return false;
862 862
 			}
863 863
 
@@ -865,37 +865,37 @@  discard block
 block discarded – undo
865 865
 			$update_options = array();
866 866
 
867 867
 			// Loop options and get values to save.
868
-			foreach ( $options as $option ) {
869
-				if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
868
+			foreach ($options as $option) {
869
+				if ( ! isset($option['id']) || ! isset($option['type'])) {
870 870
 					continue;
871 871
 				}
872 872
 
873 873
 				// Get posted value.
874
-				if ( strstr( $option['id'], '[' ) ) {
875
-					parse_str( $option['id'], $option_name_array );
876
-					$field_option_name = current( array_keys( $option_name_array ) );
877
-					$setting_name      = key( $option_name_array[ $field_option_name ] );
878
-					$raw_value         = isset( $_POST[ $field_option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $field_option_name ][ $setting_name ] ) : null;
874
+				if (strstr($option['id'], '[')) {
875
+					parse_str($option['id'], $option_name_array);
876
+					$field_option_name = current(array_keys($option_name_array));
877
+					$setting_name      = key($option_name_array[$field_option_name]);
878
+					$raw_value         = isset($_POST[$field_option_name][$setting_name]) ? wp_unslash($_POST[$field_option_name][$setting_name]) : null;
879 879
 				} else {
880 880
 					$field_option_name = $option['id'];
881 881
 					$setting_name      = '';
882
-					$raw_value         = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
882
+					$raw_value         = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null;
883 883
 				}
884 884
 
885 885
 				// Format the value based on option type.
886
-				switch ( $option['type'] ) {
886
+				switch ($option['type']) {
887 887
 					case 'checkbox' :
888
-						$value = is_null( $raw_value ) ? '' : 'on';
888
+						$value = is_null($raw_value) ? '' : 'on';
889 889
 						break;
890 890
 					case 'wysiwyg'  :
891 891
 					case 'textarea' :
892
-						$value = wp_kses_post( trim( $raw_value ) );
892
+						$value = wp_kses_post(trim($raw_value));
893 893
 						break;
894 894
 					case 'multiselect' :
895
-						$value = array_filter( array_map( 'give_clean', (array) $raw_value ) );
895
+						$value = array_filter(array_map('give_clean', (array) $raw_value));
896 896
 						break;
897 897
 					default :
898
-						$value = give_clean( $raw_value );
898
+						$value = give_clean($raw_value);
899 899
 						break;
900 900
 				}
901 901
 
@@ -904,37 +904,37 @@  discard block
 block discarded – undo
904 904
 				 *
905 905
 				 * @since 1.8
906 906
 				 */
907
-				$value = apply_filters( 'give_admin_settings_sanitize_option', $value, $option, $raw_value );
907
+				$value = apply_filters('give_admin_settings_sanitize_option', $value, $option, $raw_value);
908 908
 
909 909
 				/**
910 910
 				 * Sanitize the value of an option by option name.
911 911
 				 *
912 912
 				 * @since 1.8
913 913
 				 */
914
-				$value = apply_filters( "give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value );
914
+				$value = apply_filters("give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value);
915 915
 
916
-				if ( is_null( $value ) ) {
916
+				if (is_null($value)) {
917 917
 					continue;
918 918
 				}
919 919
 
920 920
 				// Check if option is an array and handle that differently to single values.
921
-				if ( $field_option_name && $setting_name ) {
922
-					if ( ! isset( $update_options[ $field_option_name ] ) ) {
923
-						$update_options[ $field_option_name ] = get_option( $field_option_name, array() );
921
+				if ($field_option_name && $setting_name) {
922
+					if ( ! isset($update_options[$field_option_name])) {
923
+						$update_options[$field_option_name] = get_option($field_option_name, array());
924 924
 					}
925
-					if ( ! is_array( $update_options[ $field_option_name ] ) ) {
926
-						$update_options[ $field_option_name ] = array();
925
+					if ( ! is_array($update_options[$field_option_name])) {
926
+						$update_options[$field_option_name] = array();
927 927
 					}
928
-					$update_options[ $field_option_name ][ $setting_name ] = $value;
928
+					$update_options[$field_option_name][$setting_name] = $value;
929 929
 				} else {
930
-					$update_options[ $field_option_name ] = $value;
930
+					$update_options[$field_option_name] = $value;
931 931
 				}
932 932
 			}
933 933
 
934 934
 			// Save all options in our array or there own option name i.e. option id.
935
-			if ( empty( $option_name ) ) {
936
-				foreach ( $update_options as $name => $value ) {
937
-					update_option( $name, $value );
935
+			if (empty($option_name)) {
936
+				foreach ($update_options as $name => $value) {
937
+					update_option($name, $value);
938 938
 
939 939
 					/**
940 940
 					 * Trigger action.
@@ -943,13 +943,13 @@  discard block
 block discarded – undo
943 943
 					 *
944 944
 					 * @since 1.8
945 945
 					 */
946
-					do_action( "give_save_option_{$name}", $value, $name );
946
+					do_action("give_save_option_{$name}", $value, $name);
947 947
 				}
948 948
 			} else {
949
-				$old_options    = ( $old_options = get_option( $option_name ) ) ? $old_options : array();
950
-				$update_options = array_merge( $old_options, $update_options );
949
+				$old_options    = ($old_options = get_option($option_name)) ? $old_options : array();
950
+				$update_options = array_merge($old_options, $update_options);
951 951
 
952
-				update_option( $option_name, $update_options );
952
+				update_option($option_name, $update_options);
953 953
 
954 954
 				/**
955 955
 				 * Trigger action.
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 				 *
959 959
 				 * @since 1.8
960 960
 				 */
961
-				do_action( "give_save_settings_{$option_name}", $update_options, $option_name );
961
+				do_action("give_save_settings_{$option_name}", $update_options, $option_name);
962 962
 			}
963 963
 
964 964
 			return true;
Please login to merge, or discard this patch.
includes/admin/upgrades/views/upgrades-complete.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@
 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
 <div class="wrap" id="poststuff">
18 18
 	<div id="give-updates">
19
-		<h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates Complete', 'give' ); ?></h1>
19
+		<h1 id="give-updates-h1"><?php esc_html_e('Give - Updates Complete', 'give'); ?></h1>
20 20
 		<hr class="wp-header-end">
21 21
 
22 22
 		<div class="give-update-panel-content">
23
-			<p><?php esc_html_e( 'Congratulations! You are running the latest versions of Give and it\'s add-ons.', 'give' ); ?></p>
23
+			<p><?php esc_html_e('Congratulations! You are running the latest versions of Give and it\'s add-ons.', 'give'); ?></p>
24 24
 		</div>
25 25
 
26 26
 	</div>
Please login to merge, or discard this patch.
includes/admin/upgrades/views/upgrades.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -18,33 +18,33 @@  discard block
 block discarded – undo
18 18
 ?>
19 19
 <div class="wrap" id="poststuff">
20 20
 	<div id="give-updates">
21
-		<h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates', 'give' ); ?></h1>
21
+		<h1 id="give-updates-h1"><?php esc_html_e('Give - Updates', 'give'); ?></h1>
22 22
 		<hr class="wp-header-end">
23 23
 
24 24
 		<div class="give-update-panel-content">
25
-			<p><?php printf( __( 'Give regularly receives new features, bug fixes, and enhancements. It is important to always stay up-to-date with latest version of Give core and its add-ons.  Please create a backup of your site before updating. To update add-ons be sure your <a href="%1$s">license keys</a> are activated.', 'give' ), 'https://givewp.com/my-account/' ); ?></p>
25
+			<p><?php printf(__('Give regularly receives new features, bug fixes, and enhancements. It is important to always stay up-to-date with latest version of Give core and its add-ons.  Please create a backup of your site before updating. To update add-ons be sure your <a href="%1$s">license keys</a> are activated.', 'give'), 'https://givewp.com/my-account/'); ?></p>
26 26
 		</div>
27 27
 
28 28
 		<?php $update_counter = 1; ?>
29 29
 
30 30
 		<?php $db_updates = $give_updates->get_db_update_count(); ?>
31
-		<?php if ( ! empty( $db_updates ) ) : ?>
32
-			<?php $db_update_url = add_query_arg( array(
31
+		<?php if ( ! empty($db_updates)) : ?>
32
+			<?php $db_update_url = add_query_arg(array(
33 33
 				'type' => 'database',
34
-			) ); ?>
34
+			)); ?>
35 35
 			<div id="give-db-updates">
36 36
 				<div class="postbox-container">
37 37
 					<div class="postbox">
38
-						<h2 class="hndle"><?php _e( 'Database Updates', 'give' ); ?></h2>
38
+						<h2 class="hndle"><?php _e('Database Updates', 'give'); ?></h2>
39 39
 						<div class="inside">
40 40
 							<div class="panel-content">
41
-								<p class="give-update-button"><?php echo sprintf( __( 'Give needs to update the database. <a href="%s">Update now</a>', 'give' ), $db_update_url ); ?></p>
41
+								<p class="give-update-button"><?php echo sprintf(__('Give needs to update the database. <a href="%s">Update now</a>', 'give'), $db_update_url); ?></p>
42 42
 							</div>
43 43
 							<div class="progress-container give-hidden">
44 44
 								<p class="update-message"
45 45
 								   data-update-count="<?php echo $db_updates; ?>"
46 46
 								   data-resume-update="<?php echo $give_updates->resume_updates(); ?>">
47
-									<strong><?php echo sprintf( __( 'Update 1 of %s', 'give' ), $db_updates ); ?></strong>
47
+									<strong><?php echo sprintf(__('Update 1 of %s', 'give'), $db_updates); ?></strong>
48 48
 								</p>
49 49
 								<div class="progress-content"></div>
50 50
 							</div>
@@ -61,17 +61,17 @@  discard block
 block discarded – undo
61 61
 		<?php endif; ?>
62 62
 
63 63
 		<?php $plugin_updates = $give_updates->get_plugin_update_count(); ?>
64
-		<?php if ( ! empty( $plugin_updates ) ) : ?>
65
-			<?php $plugin_update_url = add_query_arg( array(
64
+		<?php if ( ! empty($plugin_updates)) : ?>
65
+			<?php $plugin_update_url = add_query_arg(array(
66 66
 				's' => 'Give',
67
-			), admin_url( '/plugins.php' ) ); ?>
67
+			), admin_url('/plugins.php')); ?>
68 68
 			<div id="give-plugin-updates">
69 69
 				<div class="postbox-container">
70 70
 					<div class="postbox">
71
-						<h2 class="hndle"><?php _e( 'Add-on Updates', 'give' ); ?></h2>
71
+						<h2 class="hndle"><?php _e('Add-on Updates', 'give'); ?></h2>
72 72
 						<div class="inside">
73 73
 							<div class="panel-content">
74
-								<p><?php echo sprintf( __( 'There %1$s %2$s Give %3$s that %4$s to be updated. <a href="%5$s">Update now</a>', 'give' ), _n( 'is', 'are', $plugin_updates, 'give' ), $plugin_updates, _n( 'add-on', 'add-ons', $plugin_updates, 'give' ), _n( 'needs', 'need', $plugin_updates, 'give' ), $plugin_update_url  ); ?></p>
74
+								<p><?php echo sprintf(__('There %1$s %2$s Give %3$s that %4$s to be updated. <a href="%5$s">Update now</a>', 'give'), _n('is', 'are', $plugin_updates, 'give'), $plugin_updates, _n('add-on', 'add-ons', $plugin_updates, 'give'), _n('needs', 'need', $plugin_updates, 'give'), $plugin_update_url); ?></p>
75 75
 								<?php include_once 'plugins-update-section.php'; ?>
76 76
 							</div>
77 77
 						</div>
Please login to merge, or discard this patch.