Test Failed
Push — master ( 15dfc4...36ff7d )
by Devin
06:56
created
includes/admin/tools/export/class-core-settings-export.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 		give_ignore_user_abort();
43 43
 
44 44
 		nocache_headers();
45
-		header( 'Content-Type: application/json; charset=utf-8' );
46
-		header( 'Content-Disposition: attachment; filename=' . apply_filters( 'give_core_settings_export_filename', 'give-export-' . $this->export_type . '-' . date( 'n' ) . '-' . date( 'Y' ) ) . '.json' );
47
-		header( 'Expires: 0' );
45
+		header('Content-Type: application/json; charset=utf-8');
46
+		header('Content-Disposition: attachment; filename='.apply_filters('give_core_settings_export_filename', 'give-export-'.$this->export_type.'-'.date('n').'-'.date('Y')).'.json');
47
+		header('Expires: 0');
48 48
 	}
49 49
 
50 50
 	/**
@@ -54,18 +54,18 @@  discard block
 block discarded – undo
54 54
 	 * @since 1.8.17
55 55
 	 */
56 56
 	public function json_core_settings_export() {
57
-		$settings_excludes = isset( $_POST['settings_export_excludes'] ) ? give_clean( $_POST['settings_export_excludes'] ) : array();
58
-		$give_settings     = get_option( 'give_settings' );
57
+		$settings_excludes = isset($_POST['settings_export_excludes']) ? give_clean($_POST['settings_export_excludes']) : array();
58
+		$give_settings     = get_option('give_settings');
59 59
 
60
-		if ( is_array( $settings_excludes ) && ! empty( $settings_excludes ) ) {
61
-			foreach ( $settings_excludes as $key => $value ) {
62
-				if ( give_is_setting_enabled( $value ) ) {
63
-					unset( $give_settings[ $key ] );
60
+		if (is_array($settings_excludes) && ! empty($settings_excludes)) {
61
+			foreach ($settings_excludes as $key => $value) {
62
+				if (give_is_setting_enabled($value)) {
63
+					unset($give_settings[$key]);
64 64
 				}
65 65
 			}
66 66
 		}
67 67
 
68
-		echo wp_json_encode( $give_settings );
68
+		echo wp_json_encode($give_settings);
69 69
 	}
70 70
 
71 71
 	/**
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 	 * @since  1.8.17
76 76
 	 */
77 77
 	public function export() {
78
-		if ( ! $this->can_export() ) {
78
+		if ( ! $this->can_export()) {
79 79
 			wp_die(
80
-				esc_html__( 'You do not have permission to export data.', 'give' ),
81
-				esc_html__( 'Error', 'give' ),
82
-				array( 'response' => 403 )
80
+				esc_html__('You do not have permission to export data.', 'give'),
81
+				esc_html__('Error', 'give'),
82
+				array('response' => 403)
83 83
 			);
84 84
 		}
85 85
 
Please login to merge, or discard this patch.
includes/admin/tools/views/html-admin-page-exports.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Admin View: Exports
4 4
  */
5 5
 
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if ( ! defined('ABSPATH')) {
7 7
 	exit;
8 8
 } ?>
9 9
 
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 				 *
19 19
 				 * @since 1.0
20 20
 				 */
21
-				do_action( 'give_tools_tab_export_content_top' );
21
+				do_action('give_tools_tab_export_content_top');
22 22
 				?>
23 23
 
24 24
 				<table class="widefat export-options-table give-table striped">
25 25
 					<thead>
26 26
 					<tr>
27
-						<th scope="col"><?php _e( 'Export Type', 'give' ); ?></th>
28
-						<th scope="col"><?php _e( 'Export Options', 'give' ); ?></th>
27
+						<th scope="col"><?php _e('Export Type', 'give'); ?></th>
28
+						<th scope="col"><?php _e('Export Options', 'give'); ?></th>
29 29
 					</tr>
30 30
 					</thead>
31 31
 					<tbody>
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
 					 *
39 39
 					 * @since 1.0
40 40
 					 */
41
-					do_action( 'give_tools_tab_export_table_top' );
41
+					do_action('give_tools_tab_export_table_top');
42 42
 					?>
43 43
 
44 44
 					<tr class="give-export-donations-history">
45 45
 						<td scope="row" class="row-title">
46 46
 							<h3>
47
-								<span><?php _e( 'Export Donation History', 'give' ); ?></span>
47
+								<span><?php _e('Export Donation History', 'give'); ?></span>
48 48
 							</h3>
49
-							<p><?php _e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
49
+							<p><?php _e('Download a CSV of all donations recorded.', 'give'); ?></p>
50 50
 						</td>
51 51
 						<td>
52 52
 							<a class="button"
53
-							   href="<?php echo add_query_arg( array( 'type' => 'export_donations' ) ); ?>">
54
-								<?php _e( 'Generate CSV', 'give' ); ?>
53
+							   href="<?php echo add_query_arg(array('type' => 'export_donations')); ?>">
54
+								<?php _e('Generate CSV', 'give'); ?>
55 55
 							</a>
56 56
 						</td>
57 57
 					</tr>
@@ -59,38 +59,38 @@  discard block
 block discarded – undo
59 59
 					<tr class="give-export-pdf-sales-earnings">
60 60
 						<td scope="row" class="row-title">
61 61
 							<h3>
62
-								<span><?php _e( 'Export PDF of Donations and Income', 'give' ); ?></span>
62
+								<span><?php _e('Export PDF of Donations and Income', 'give'); ?></span>
63 63
 							</h3>
64
-							<p><?php _e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
64
+							<p><?php _e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
65 65
 						</td>
66 66
 						<td>
67 67
 							<a class="button"
68
-							   href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>">
69
-								<?php _e( 'Generate PDF', 'give' ); ?>
68
+							   href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>">
69
+								<?php _e('Generate PDF', 'give'); ?>
70 70
 							</a>
71 71
 						</td>
72 72
 					</tr>
73 73
 					<tr class="give-export-sales-earnings">
74 74
 						<td scope="row" class="row-title">
75 75
 							<h3>
76
-								<span><?php _e( 'Export Income and Donation Stats', 'give' ); ?></span>
76
+								<span><?php _e('Export Income and Donation Stats', 'give'); ?></span>
77 77
 							</h3>
78
-							<p><?php _e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
78
+							<p><?php _e('Download a CSV of income and donations over time.', 'give'); ?></p>
79 79
 						</td>
80 80
 						<td>
81 81
 							<form method="post">
82 82
 								<?php
83 83
 								printf(
84 84
 								/* translators: 1: start date dropdown 2: end date dropdown */
85
-									esc_html__( '%1$s to %2$s', 'give' ),
86
-									Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ),
87
-									Give()->html->year_dropdown( 'end_year' ) . ' ' . Give()->html->month_dropdown( 'end_month' )
85
+									esc_html__('%1$s to %2$s', 'give'),
86
+									Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'),
87
+									Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month')
88 88
 								);
89 89
 								?>
90 90
 								<input type="hidden" name="give-action"
91 91
 								       value="earnings_export"/>
92 92
 								<input type="submit"
93
-								       value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>"
93
+								       value="<?php esc_attr_e('Generate CSV', 'give'); ?>"
94 94
 								       class="button-secondary"/>
95 95
 							</form>
96 96
 						</td>
@@ -99,96 +99,96 @@  discard block
 block discarded – undo
99 99
 					<tr class="give-export-donors">
100 100
 						<td scope="row" class="row-title">
101 101
 							<h3>
102
-								<span><?php _e( 'Export Donors', 'give' ); ?></span>
102
+								<span><?php _e('Export Donors', 'give'); ?></span>
103 103
 							</h3>
104
-							<p><?php _e( 'Download a CSV of donors. Column values reflect totals across all donation forms by default, or a single donation form if selected.', 'give' ); ?></p>
104
+							<p><?php _e('Download a CSV of donors. Column values reflect totals across all donation forms by default, or a single donation form if selected.', 'give'); ?></p>
105 105
 						</td>
106 106
 						<td>
107 107
 							<form method="post" id="give_donor_export" class="give-export-form">
108 108
 								<?php
109 109
 								// Start Date form field for donors
110
-								echo Give()->html->date_field( array(
110
+								echo Give()->html->date_field(array(
111 111
 									'id'          => 'give_donor_export_start_date',
112 112
 									'name'        => 'donor_export_start_date',
113
-									'placeholder' => esc_attr__( 'Start date', 'give' ),
114
-								) );
113
+									'placeholder' => esc_attr__('Start date', 'give'),
114
+								));
115 115
 
116 116
 								// End Date form field for donors
117
-								echo Give()->html->date_field( array(
117
+								echo Give()->html->date_field(array(
118 118
 									'id'          => 'give_donor_export_end_date',
119 119
 									'name'        => 'donor_export_end_date',
120
-									'placeholder' => esc_attr__( 'End date', 'give' ),
121
-								) );
120
+									'placeholder' => esc_attr__('End date', 'give'),
121
+								));
122 122
 
123 123
 								// Donation forms dropdown for donors export
124
-								echo Give()->html->forms_dropdown( array(
124
+								echo Give()->html->forms_dropdown(array(
125 125
 									'name'   => 'forms',
126 126
 									'id'     => 'give_donor_export_form',
127 127
 									'chosen' => true,
128
-								) );
128
+								));
129 129
 								?>
130
-								<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>"
130
+								<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>"
131 131
 								       class="button-secondary"/>
132 132
 
133 133
 								<div id="export-donor-options-wrap"
134 134
 								     class="give-clearfix">
135
-									<p><?php _e( 'Export Columns:', 'give' ); ?></p>
135
+									<p><?php _e('Export Columns:', 'give'); ?></p>
136 136
 									<ul id="give-export-option-ul">
137 137
 										<li>
138 138
 											<label for="give-export-fullname">
139 139
 												<input type="checkbox" checked
140 140
 												       name="give_export_option[full_name]"
141
-												       id="give-export-fullname"><?php _e( 'Name', 'give' ); ?>
141
+												       id="give-export-fullname"><?php _e('Name', 'give'); ?>
142 142
 											</label>
143 143
 										</li>
144 144
 										<li>
145 145
 											<label for="give-export-email">
146 146
 												<input type="checkbox" checked
147 147
 												       name="give_export_option[email]"
148
-												       id="give-export-email"><?php _e( 'Email', 'give' ); ?>
148
+												       id="give-export-email"><?php _e('Email', 'give'); ?>
149 149
 											</label>
150 150
 										</li>
151 151
 										<li>
152 152
 											<label for="give-export-address">
153 153
 												<input type="checkbox" checked
154 154
 												       name="give_export_option[address]"
155
-												       id="give-export-address"><?php _e( 'Address', 'give' ); ?>
155
+												       id="give-export-address"><?php _e('Address', 'give'); ?>
156 156
 											</label>
157 157
 										</li>
158 158
 										<li>
159 159
 											<label for="give-export-userid">
160 160
 												<input type="checkbox" checked
161 161
 												       name="give_export_option[userid]"
162
-												       id="give-export-userid"><?php _e( 'User ID', 'give' ); ?>
162
+												       id="give-export-userid"><?php _e('User ID', 'give'); ?>
163 163
 											</label>
164 164
 										</li>
165 165
 										<li>
166 166
 											<label for="give-export-first-donation-date">
167 167
 												<input type="checkbox" checked
168 168
 												       name="give_export_option[donor_created_date]"
169
-												       id="give-export-first-donation-date"><?php _e( 'Donor Created Date', 'give' ); ?>
169
+												       id="give-export-first-donation-date"><?php _e('Donor Created Date', 'give'); ?>
170 170
 											</label>
171 171
 										</li>
172 172
 										<li>
173 173
 											<label for="give-export-donation-number">
174 174
 												<input type="checkbox" checked
175 175
 												       name="give_export_option[donations]"
176
-												       id="give-export-donation-number"><?php _e( 'Number of Donations', 'give' ); ?>
176
+												       id="give-export-donation-number"><?php _e('Number of Donations', 'give'); ?>
177 177
 											</label>
178 178
 										</li>
179 179
 										<li>
180 180
 											<label for="give-export-donation-sum">
181 181
 												<input type="checkbox" checked
182 182
 												       name="give_export_option[donation_sum]"
183
-												       id="give-export-donation-sum"><?php _e( 'Total Donated', 'give' ); ?>
183
+												       id="give-export-donation-sum"><?php _e('Total Donated', 'give'); ?>
184 184
 											</label>
185 185
 										</li>
186 186
 									</ul>
187 187
 								</div>
188
-								<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
188
+								<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
189 189
 								<input type="hidden" name="give-export-class" value="Give_Batch_Donors_Export"/>
190 190
 								<input type="hidden" name="give_export_option[query_id]"
191
-								       value="<?php echo uniqid( 'give_' ); ?>"/>
191
+								       value="<?php echo uniqid('give_'); ?>"/>
192 192
 							</form>
193 193
 						</td>
194 194
 					</tr>
@@ -196,32 +196,32 @@  discard block
 block discarded – undo
196 196
 					<tr class="give-export-core-settings">
197 197
 						<td scope="row" class="row-title">
198 198
 							<h3>
199
-								<span><?php _e( 'Export Give Settings', 'give' ); ?></span>
199
+								<span><?php _e('Export Give Settings', 'give'); ?></span>
200 200
 							</h3>
201
-							<p><?php _e( 'Download an export of Give\'s settings and import it in a new WordPress installation.', 'give' ); ?></p>
201
+							<p><?php _e('Download an export of Give\'s settings and import it in a new WordPress installation.', 'give'); ?></p>
202 202
 						</td>
203 203
 						<td>
204 204
 							<form method="post">
205 205
 								<?php
206
-								$export_excludes = apply_filters( 'settings_export_excludes', array() );
207
-								if ( ! empty( $export_excludes ) ) {
206
+								$export_excludes = apply_filters('settings_export_excludes', array());
207
+								if ( ! empty($export_excludes)) {
208 208
 									?>
209
-									<i class="settings-excludes-title"><?php echo __( 'Checked options from the list will not be exported.', 'give' ); ?></i>
209
+									<i class="settings-excludes-title"><?php echo __('Checked options from the list will not be exported.', 'give'); ?></i>
210 210
 									<ul class="settings-excludes-list">
211
-										<?php foreach ( $export_excludes as $option_key => $option_label ) { ?>
211
+										<?php foreach ($export_excludes as $option_key => $option_label) { ?>
212 212
 											<li>
213 213
 												<label for="settings_export_excludes[<?php echo $option_key ?>]">
214 214
 													<input
215 215
 														type="checkbox" checked
216 216
 														name="settings_export_excludes[<?php echo $option_key ?>]"
217
-														id="settings_export_excludes[<?php echo $option_key ?>]"><?php echo esc_html( $option_label ); ?>
217
+														id="settings_export_excludes[<?php echo $option_key ?>]"><?php echo esc_html($option_label); ?>
218 218
 												</label>
219 219
 											</li>
220 220
 										<?php } ?>
221 221
 									</ul>
222 222
 								<?php } ?>
223 223
 								<input type="hidden" name="give-action" value="core_settings_export"/>
224
-								<input type="submit" value="<?php esc_attr_e( 'Export JSON', 'give' ); ?>"
224
+								<input type="submit" value="<?php esc_attr_e('Export JSON', 'give'); ?>"
225 225
 								       class="button-secondary"/>
226 226
 							</form>
227 227
 						</td>
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 					 *
236 236
 					 * @since 1.0
237 237
 					 */
238
-					do_action( 'give_tools_tab_export_table_bottom' );
238
+					do_action('give_tools_tab_export_table_bottom');
239 239
 					?>
240 240
 					</tbody>
241 241
 				</table>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 				 *
247 247
 				 * @since 1.0
248 248
 				 */
249
-				do_action( 'give_tools_tab_export_content_bottom' );
249
+				do_action('give_tools_tab_export_content_bottom');
250 250
 				?>
251 251
 
252 252
 			</div>
Please login to merge, or discard this patch.
includes/admin/tools/views/html-admin-page-data.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
  * Admin View: Exports
4 4
  */
5 5
 
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if ( ! defined('ABSPATH')) {
7 7
 	exit;
8 8
 }
9 9
 
10
-if ( ! current_user_can( 'manage_give_settings' ) ) {
10
+if ( ! current_user_can('manage_give_settings')) {
11 11
 	return;
12 12
 }
13 13
 
@@ -16,29 +16,29 @@  discard block
 block discarded – undo
16 16
  *
17 17
  * @since 1.5
18 18
  */
19
-do_action( 'give_tools_recount_stats_before' );
19
+do_action('give_tools_recount_stats_before');
20 20
 ?>
21 21
 	<div id="poststuff">
22 22
 		<div class="postbox">
23 23
 
24
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
24
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
25 25
 
26 26
 			<div class="inside recount-stats-controls">
27
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
27
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
28 28
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
29 29
 
30
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
30
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
31 31
 
32 32
 					<select name="give-export-class" id="recount-stats-type">
33
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
34
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
35
-						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option>
36
-						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option>
37
-						<option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
38
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Payments', 'give' ); ?></option>
39
-						<option data-type="delete-test-donors"   value="Give_Tools_Delete_Donors"><?php esc_html_e( 'Delete Test Donors and Payments', 'give' ); ?></option>
40
-						<option data-type="delete-import-donors"   value="Give_Tools_Import_Donors"><?php esc_html_e( 'Delete Imported Donors and Payments', 'give' ); ?></option>
41
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
33
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
34
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
35
+						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option>
36
+						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option>
37
+						<option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
38
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Payments', 'give'); ?></option>
39
+						<option data-type="delete-test-donors"   value="Give_Tools_Delete_Donors"><?php esc_html_e('Delete Test Donors and Payments', 'give'); ?></option>
40
+						<option data-type="delete-import-donors"   value="Give_Tools_Import_Donors"><?php esc_html_e('Delete Imported Donors and Payments', 'give'); ?></option>
41
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
42 42
 						<?php
43 43
 						/**
44 44
 						 * Fires in the recount stats selectbox.
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 						 *
48 48
 						 * @since 1.5
49 49
 						 */
50
-						do_action( 'give_recount_tool_options' );
50
+						do_action('give_recount_tool_options');
51 51
 						?>
52 52
 					</select>
53 53
 
@@ -56,32 +56,32 @@  discard block
 block discarded – undo
56 56
 						$args = array(
57 57
 							'class'       => 'tools-form-dropdown-recount-form-select',
58 58
 							'name'        => 'form_id',
59
-							'number'      => - 1,
59
+							'number'      => -1,
60 60
 							'chosen'      => true,
61
-							'placeholder' => __( 'Select Form', 'give' ),
61
+							'placeholder' => __('Select Form', 'give'),
62 62
 						);
63
-						echo Give()->html->forms_dropdown( $args );
63
+						echo Give()->html->forms_dropdown($args);
64 64
 						?>
65 65
 					</span>
66 66
 
67 67
 					<span class="tools-form-dropdown tools-form-dropdown-delete-import-donors" style="display: none">
68 68
 						<label for="delete-import-donors">
69 69
 							<?php
70
-							echo Give()->html->checkbox( array( 'name' => 'delete-import-donors' ) );
71
-							esc_html_e( 'Delete imported WordPress users', 'give' );
70
+							echo Give()->html->checkbox(array('name' => 'delete-import-donors'));
71
+							esc_html_e('Delete imported WordPress users', 'give');
72 72
 							?>
73 73
 						</label>
74 74
 					</span>
75 75
 
76
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
76
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
77 77
 
78 78
 					<br/>
79 79
 
80 80
 					<span class="give-recount-stats-descriptions">
81
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
82
-						<span id="recount-form"><?php esc_html_e( 'Recalculates the donation and income stats for a specific form.', 'give' ); ?></span>
83
-						<span id="recount-all"><?php esc_html_e( 'Recalculates the earnings and sales stats for all forms.', 'give' ); ?></span>
84
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
81
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
82
+						<span id="recount-form"><?php esc_html_e('Recalculates the donation and income stats for a specific form.', 'give'); ?></span>
83
+						<span id="recount-all"><?php esc_html_e('Recalculates the earnings and sales stats for all forms.', 'give'); ?></span>
84
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
85 85
 						<?php
86 86
 						/**
87 87
 						 * Fires in the recount stats description area.
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 						 *
91 91
 						 * @since 1.5
92 92
 						 */
93
-						do_action( 'give_recount_tool_descriptions' );
93
+						do_action('give_recount_tool_descriptions');
94 94
 						?>
95
-						<span id="delete-test-transactions"><strong><?php esc_html_e( 'Deletes', 'give' ); ?></strong> <?php esc_html_e( 'all TEST donations, donors, and related log entries.', 'give' ); ?></span>
96
-						<span id="reset-stats"><strong><?php esc_html_e( 'Deletes', 'give' ); ?></strong> <?php esc_html_e( 'ALL donations, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
95
+						<span id="delete-test-transactions"><strong><?php esc_html_e('Deletes', 'give'); ?></strong> <?php esc_html_e('all TEST donations, donors, and related log entries.', 'give'); ?></span>
96
+						<span id="reset-stats"><strong><?php esc_html_e('Deletes', 'give'); ?></strong> <?php esc_html_e('ALL donations, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
97 97
 					</span>
98 98
 
99 99
 					<span class="spinner"></span>
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 				 *
108 108
 				 * @since 1.5
109 109
 				 */
110
-				do_action( 'give_tools_recount_forms' );
110
+				do_action('give_tools_recount_forms');
111 111
 				?>
112 112
 			</div><!-- .inside -->
113 113
 		</div><!-- .postbox -->
@@ -118,4 +118,4 @@  discard block
 block discarded – undo
118 118
  *
119 119
  * @since 1.5
120 120
  */
121
-do_action( 'give_tools_recount_stats_after' );
121
+do_action('give_tools_recount_stats_after');
Please login to merge, or discard this patch.
includes/admin/tools/views/html-admin-page-import-donations.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@
 block discarded – undo
22 22
         <div class="postbox">
23 23
             <h1 class="give-importer-h1" align="center">
24 24
 	            <?php
25
-	            _e( 'Import Donations', 'give' );
25
+				_e( 'Import Donations', 'give' );
26 26
 
27
-	            if ( ! empty( $_POST['mapto'] ) && ! empty( $_GET['dry_run'] ) ) {
28
-		            printf(
27
+				if ( ! empty( $_POST['mapto'] ) && ! empty( $_GET['dry_run'] ) ) {
28
+					printf(
29 29
 						'<strong> %s</strong>',
30
-			            __( '(Dry Run)', 'give' )
31
-		            );
32
-	            }
33
-	            ?>
30
+						__( '(Dry Run)', 'give' )
31
+					);
32
+				}
33
+				?>
34 34
             </h1>
35 35
             <div class="inside give-tools-setting-page-import give-import-donations">
36 36
 				<?php
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
  * Admin View: Import Donations
4 4
  */
5 5
 
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if ( ! defined('ABSPATH')) {
7 7
 	exit;
8 8
 }
9 9
 
10
-if ( ! current_user_can( 'manage_give_settings' ) ) {
10
+if ( ! current_user_can('manage_give_settings')) {
11 11
 	return;
12 12
 }
13 13
 
@@ -16,18 +16,18 @@  discard block
 block discarded – undo
16 16
  *
17 17
  * @since 1.8.13
18 18
  */
19
-do_action( 'give_tools_import_donations_main_before' );
19
+do_action('give_tools_import_donations_main_before');
20 20
 ?>
21 21
     <div id="poststuff">
22 22
         <div class="postbox">
23 23
             <h1 class="give-importer-h1" align="center">
24 24
 	            <?php
25
-	            _e( 'Import Donations', 'give' );
25
+	            _e('Import Donations', 'give');
26 26
 
27
-	            if ( ! empty( $_POST['mapto'] ) && ! empty( $_GET['dry_run'] ) ) {
27
+	            if ( ! empty($_POST['mapto']) && ! empty($_GET['dry_run'])) {
28 28
 		            printf(
29 29
 						'<strong> %s</strong>',
30
-			            __( '(Dry Run)', 'give' )
30
+			            __('(Dry Run)', 'give')
31 31
 		            );
32 32
 	            }
33 33
 	            ?>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 				 *
40 40
 				 * @since 1.8.14
41 41
 				 */
42
-				do_action( 'give_tools_import_donations_form_before_start' );
42
+				do_action('give_tools_import_donations_form_before_start');
43 43
 				?>
44 44
                 <form method="post" id="give-import-donations-form" class="give-import-form tools-setting-page-import tools-setting-page-import">
45 45
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 					 *
50 50
 					 * @since 1.8.14
51 51
 					 */
52
-					do_action( 'give_tools_import_donations_form_start' );
52
+					do_action('give_tools_import_donations_form_start');
53 53
 					?>
54 54
 
55 55
 					<?php
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 					 *
59 59
 					 * @since 1.8.14
60 60
 					 */
61
-					do_action( 'give_tools_import_donations_form_end' );
61
+					do_action('give_tools_import_donations_form_end');
62 62
 					?>
63 63
                 </form>
64 64
 				<?php
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 				 *
68 68
 				 * @since 1.8.14
69 69
 				 */
70
-				do_action( 'give_tools_import_donations_form_after_end' );
70
+				do_action('give_tools_import_donations_form_after_end');
71 71
 				?>
72 72
             </div><!-- .inside -->
73 73
         </div><!-- .postbox -->
@@ -78,4 +78,4 @@  discard block
 block discarded – undo
78 78
  *
79 79
  * @since 1.8.13
80 80
  */
81
-do_action( 'give_tools_import_donations_main_after' );
81
+do_action('give_tools_import_donations_main_after');
Please login to merge, or discard this patch.
includes/admin/tools/import/class-give-import-core-settings.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  * @since       1.8.17
12 12
  */
13 13
 
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit; // Exit if accessed directly
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Give_Import_Core_Settings' ) ) {
18
+if ( ! class_exists('Give_Import_Core_Settings')) {
19 19
 
20 20
 	/**
21 21
 	 * Give_Import_Core_Settings.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		 * @return static
78 78
 		 */
79 79
 		public static function get_instance() {
80
-			if ( null === static::$instance ) {
80
+			if (null === static::$instance) {
81 81
 				self::$instance = new static();
82 82
 			}
83 83
 
@@ -104,26 +104,26 @@  discard block
 block discarded – undo
104 104
 		 * @return void
105 105
 		 */
106 106
 		private function setup_hooks() {
107
-			if ( ! $this->is_donations_import_page() ) {
107
+			if ( ! $this->is_donations_import_page()) {
108 108
 				return;
109 109
 			}
110 110
 
111 111
 			// Do not render main import tools page.
112
-			remove_action( 'give_admin_field_tools_import', array( 'Give_Settings_Import', 'render_import_field', ) );
112
+			remove_action('give_admin_field_tools_import', array('Give_Settings_Import', 'render_import_field',));
113 113
 
114 114
 			// Render donation import page
115
-			add_action( 'give_admin_field_tools_import', array( $this, 'render_page' ) );
115
+			add_action('give_admin_field_tools_import', array($this, 'render_page'));
116 116
 
117 117
 			// Print the HTML.
118
-			add_action( 'give_tools_import_core_settings_form_start', array( $this, 'html' ), 10 );
118
+			add_action('give_tools_import_core_settings_form_start', array($this, 'html'), 10);
119 119
 
120 120
 			// Run when form submit.
121
-			add_action( 'give-tools_save_import', array( $this, 'save' ) );
121
+			add_action('give-tools_save_import', array($this, 'save'));
122 122
 
123
-			add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 );
123
+			add_action('give-tools_update_notices', array($this, 'update_notices'), 11, 1);
124 124
 
125 125
 			// Used to add submit button.
126
-			add_action( 'give_tools_import_core_settings_form_end', array( $this, 'submit' ), 10 );
126
+			add_action('give_tools_import_core_settings_form_end', array($this, 'submit'), 10);
127 127
 		}
128 128
 
129 129
 		/**
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 		 *
136 136
 		 * @return mixed
137 137
 		 */
138
-		public function update_notices( $messages ) {
139
-			if ( ! empty( $_GET['tab'] ) && 'import' === give_clean( $_GET['tab'] ) ) {
140
-				unset( $messages['give-setting-updated'] );
138
+		public function update_notices($messages) {
139
+			if ( ! empty($_GET['tab']) && 'import' === give_clean($_GET['tab'])) {
140
+				unset($messages['give-setting-updated']);
141 141
 			}
142 142
 
143 143
 			return $messages;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		 * @since 1.8.17
150 150
 		 */
151 151
 		public function submit() {
152
-			wp_nonce_field( 'give-save-settings', '_give-save-settings' );
152
+			wp_nonce_field('give-save-settings', '_give-save-settings');
153 153
 			?>
154 154
 			<input type="hidden" class="import-step" id="import-step" name="step" value="<?php echo $this->get_step(); ?>"/>
155 155
 			<input type="hidden" class="importer-type" value="<?php echo $this->importer_type; ?>"/>
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 			?>
170 170
 			<section>
171 171
 				<table
172
-					class="widefat export-options-table give-table <?php echo "step-{$step}"; ?> <?php echo( 1 === $step && ! empty( $this->is_json_valid ) ? 'give-hidden' : '' ); ?> "
172
+					class="widefat export-options-table give-table <?php echo "step-{$step}"; ?> <?php echo(1 === $step && ! empty($this->is_json_valid) ? 'give-hidden' : ''); ?> "
173 173
 					id="<?php echo "step-{$step}"; ?>">
174 174
 					<tbody>
175 175
 					<?php
176
-					switch ( $step ) {
176
+					switch ($step) {
177 177
 						case 1:
178 178
 							$this->render_upload_html();
179 179
 							break;
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
 		public function import_success() {
201 201
 			// Imported successfully
202 202
 
203
-			$success = (bool) ( isset( $_GET['success'] ) ? give_clean( $_GET['success'] ) : false );
204
-			$undo = (bool) ( isset( $_GET['undo'] ) ? give_clean( $_GET['undo'] ) : false );
203
+			$success = (bool) (isset($_GET['success']) ? give_clean($_GET['success']) : false);
204
+			$undo = (bool) (isset($_GET['undo']) ? give_clean($_GET['undo']) : false);
205 205
 			$query_arg_setting = array(
206 206
 				'post_type' => 'give_forms',
207 207
 				'page'      => 'give-settings',
208 208
 			);
209 209
 
210
-			if ( $undo ) {
210
+			if ($undo) {
211 211
 				$success = false;
212 212
 			}
213 213
 
@@ -220,30 +220,30 @@  discard block
 block discarded – undo
220 220
 				'undo'      => 'true',
221 221
 			);
222 222
 
223
-			$title = __( 'Settings Importing Completed!', 'give' );
224
-			if ( $success ) {
223
+			$title = __('Settings Importing Completed!', 'give');
224
+			if ($success) {
225 225
 				$query_arg_success['undo'] = '1';
226 226
 				$query_arg_success['step'] = '3';
227 227
 				$query_arg_success['success'] = '1';
228
-				$text = __( 'Undo Importing', 'give' );
228
+				$text = __('Undo Importing', 'give');
229 229
 			} else {
230
-				if ( $undo ) {
231
-					$host_give_options = get_option( 'give_settings_old', array() );
232
-					update_option( 'give_settings', $host_give_options );
233
-					$title = __( 'Undo of Setting Imported Completed!', 'give' );
230
+				if ($undo) {
231
+					$host_give_options = get_option('give_settings_old', array());
232
+					update_option('give_settings', $host_give_options);
233
+					$title = __('Undo of Setting Imported Completed!', 'give');
234 234
 				} else {
235
-					$title = __( 'Failed to import', 'give' );
235
+					$title = __('Failed to import', 'give');
236 236
 				}
237 237
 
238
-				$text = __( 'Importing Again', 'give' );
238
+				$text = __('Importing Again', 'give');
239 239
 			}
240 240
 			?>
241 241
 			<tr valign="top" class="give-import-dropdown">
242 242
 				<th colspan="2">
243 243
 					<h2><?php echo $title; ?></h2>
244 244
 					<p>
245
-						<a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg_success, admin_url( 'edit.php' ) ); ?>"><?php echo $text; ?></a>
246
-						<a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg_setting, admin_url( 'edit.php' ) ); ?>"><?php echo __( 'View Settings', 'give' ); ?></a>
245
+						<a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg_success, admin_url('edit.php')); ?>"><?php echo $text; ?></a>
246
+						<a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg_setting, admin_url('edit.php')); ?>"><?php echo __('View Settings', 'give'); ?></a>
247 247
 					</p>
248 248
 				</th>
249 249
 			</tr>
@@ -256,14 +256,14 @@  discard block
 block discarded – undo
256 256
 		 * @since 1.8.17
257 257
 		 */
258 258
 		public function start_import() {
259
-			$type      = ( ! empty( $_GET['type'] ) ? give_clean( $_GET['type'] ) : 'replace' );
260
-			$file_name = ( ! empty( $_GET['file_name'] ) ? give_clean( $_GET['file_name'] ) : '' );
259
+			$type      = ( ! empty($_GET['type']) ? give_clean($_GET['type']) : 'replace');
260
+			$file_name = ( ! empty($_GET['file_name']) ? give_clean($_GET['file_name']) : '');
261 261
 
262 262
 			?>
263 263
 			<tr valign="top" class="give-import-dropdown">
264 264
 				<th colspan="2">
265
-					<h2 id="give-import-title"><?php esc_html_e( 'Importing', 'give' ) ?></h2>
266
-					<p class="give-field-description"><?php esc_html_e( 'Your settings are now being imported...', 'give' ) ?></p>
265
+					<h2 id="give-import-title"><?php esc_html_e('Importing', 'give') ?></h2>
266
+					<p class="give-field-description"><?php esc_html_e('Your settings are now being imported...', 'give') ?></p>
267 267
 				</th>
268 268
 			</tr>
269 269
 
@@ -290,14 +290,14 @@  discard block
 block discarded – undo
290 290
 			$step = $this->get_step();
291 291
 			?>
292 292
 			<ol class="give-progress-steps">
293
-				<li class="<?php echo( 1 === $step ? 'active' : '' ); ?>">
294
-					<?php esc_html_e( 'Upload JSON file', 'give' ); ?>
293
+				<li class="<?php echo(1 === $step ? 'active' : ''); ?>">
294
+					<?php esc_html_e('Upload JSON file', 'give'); ?>
295 295
 				</li>
296
-				<li class="<?php echo( 2 === $step ? 'active' : '' ); ?>">
297
-					<?php esc_html_e( 'Import', 'give' ); ?>
296
+				<li class="<?php echo(2 === $step ? 'active' : ''); ?>">
297
+					<?php esc_html_e('Import', 'give'); ?>
298 298
 				</li>
299
-				<li class="<?php echo( 3 === $step ? 'active' : '' ); ?>">
300
-					<?php esc_html_e( 'Done!', 'give' ); ?>
299
+				<li class="<?php echo(3 === $step ? 'active' : ''); ?>">
300
+					<?php esc_html_e('Done!', 'give'); ?>
301 301
 				</li>
302 302
 			</ol>
303 303
 			<?php
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
 		 * @return int $step on which step doest the import is on.
312 312
 		 */
313 313
 		public function get_step() {
314
-			$step    = (int) ( isset( $_REQUEST['step'] ) ? give_clean( $_REQUEST['step'] ) : 0 );
314
+			$step    = (int) (isset($_REQUEST['step']) ? give_clean($_REQUEST['step']) : 0);
315 315
 			$on_step = 1;
316 316
 
317
-			if ( empty( $step ) || 1 === $step ) {
317
+			if (empty($step) || 1 === $step) {
318 318
 				$on_step = 1;
319
-			} elseif ( 2 === $step ) {
319
+			} elseif (2 === $step) {
320 320
 				$on_step = 2;
321
-			} elseif ( 3 === $step ) {
321
+			} elseif (3 === $step) {
322 322
 				$on_step = 3;
323 323
 			}
324 324
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 		 * @since 1.8.17
332 332
 		 */
333 333
 		public function render_page() {
334
-			include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-import-core-settings.php';
334
+			include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-import-core-settings.php';
335 335
 		}
336 336
 
337 337
 		/**
@@ -343,28 +343,28 @@  discard block
 block discarded – undo
343 343
 		 * @return void
344 344
 		 */
345 345
 		public function render_upload_html() {
346
-			$json = ( isset( $_POST['json'] ) ? give_clean( $_POST['json'] ) : '' );
347
-			$type = ( isset( $_POST['type'] ) ? give_clean( $_POST['type'] ) : 'merge' );
346
+			$json = (isset($_POST['json']) ? give_clean($_POST['json']) : '');
347
+			$type = (isset($_POST['type']) ? give_clean($_POST['type']) : 'merge');
348 348
 			$step = $this->get_step();
349 349
 
350 350
 			?>
351 351
 			<tr valign="top">
352 352
 				<th colspan="2">
353
-					<h2 id="give-import-title"><?php esc_html_e( 'Import Core Settings from a JSON file', 'give' ) ?></h2>
354
-					<p class="give-field-description"><?php esc_html_e( 'This tool allows you to import Give settings from another Give installation. Settings imported contain data from Give core as well as any of our Premium Add-ons.', 'give' ) ?></p>
353
+					<h2 id="give-import-title"><?php esc_html_e('Import Core Settings from a JSON file', 'give') ?></h2>
354
+					<p class="give-field-description"><?php esc_html_e('This tool allows you to import Give settings from another Give installation. Settings imported contain data from Give core as well as any of our Premium Add-ons.', 'give') ?></p>
355 355
 				</th>
356 356
 			</tr>
357 357
 
358 358
 			<tr valign="top">
359 359
 				<th scope="row" class="titledesc">
360
-					<label for="json"><?php esc_html_e( 'Choose a JSON file:', 'give' ) ?></label>
360
+					<label for="json"><?php esc_html_e('Choose a JSON file:', 'give') ?></label>
361 361
 				</th>
362 362
 				<td class="give-forminp">
363 363
 					<div class="give-field-wrap">
364 364
 						<label for="json">
365 365
 							<input type="file" name="json" class="give-upload-json-file" value="<?php echo $json; ?>"
366 366
 							       accept=".json">
367
-							<p class="give-field-description"><?php esc_html_e( 'The file type must be JSON.', 'give' )?></p>
367
+							<p class="give-field-description"><?php esc_html_e('The file type must be JSON.', 'give')?></p>
368 368
 						</label>
369 369
 					</div>
370 370
 				</td>
@@ -373,21 +373,21 @@  discard block
 block discarded – undo
373 373
 			$settings = array(
374 374
 				array(
375 375
 					'id'          => 'type',
376
-					'name'        => __( 'Merge Type:', 'give' ),
377
-					'description' => __( 'Select "Merge" to retain existing settings, or "Replace" to overwrite with the settings from the JSON file', 'give' ),
376
+					'name'        => __('Merge Type:', 'give'),
377
+					'description' => __('Select "Merge" to retain existing settings, or "Replace" to overwrite with the settings from the JSON file', 'give'),
378 378
 					'default'     => $type,
379 379
 					'type'        => 'radio_inline',
380 380
 					'options'     => array(
381
-						'merge'   => __( 'Merge', 'give' ),
382
-						'replace' => __( 'Replace', 'give' ),
381
+						'merge'   => __('Merge', 'give'),
382
+						'replace' => __('Replace', 'give'),
383 383
 					),
384 384
 				),
385 385
 			);
386 386
 
387
-			$settings = apply_filters( 'give_import_core_setting_html', $settings );
387
+			$settings = apply_filters('give_import_core_setting_html', $settings);
388 388
 
389
-			if ( empty( $this->is_json_valid ) ) {
390
-				Give_Admin_Settings::output_fields( $settings, 'give_settings' );
389
+			if (empty($this->is_json_valid)) {
390
+				Give_Admin_Settings::output_fields($settings, 'give_settings');
391 391
 				?>
392 392
 				<tr valign="top">
393 393
 					<th></th>
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 						<input type="submit"
396 396
 						       class="button button-primary button-large button-secondary <?php echo "step-{$step}"; ?>"
397 397
 						       id="recount-stats-submit"
398
-						       value="<?php esc_attr_e( 'Submit', 'give' ); ?>"/>
398
+						       value="<?php esc_attr_e('Submit', 'give'); ?>"/>
399 399
 					</th>
400 400
 				</tr>
401 401
 				<?php
@@ -417,20 +417,20 @@  discard block
 block discarded – undo
417 417
 			$step = $this->get_step();
418 418
 
419 419
 			// Validation for first step.
420
-			if ( 1 === $step ) {
421
-				$type          = ( ! empty( $_REQUEST['type'] ) ? give_clean( $_REQUEST['type'] ) : 'replace' );
420
+			if (1 === $step) {
421
+				$type          = ( ! empty($_REQUEST['type']) ? give_clean($_REQUEST['type']) : 'replace');
422 422
 				$core_settings = self::upload_widget_settings_file();
423
-				if ( ! empty( $core_settings['error'] ) ) {
424
-					Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload a valid JSON settings file.', 'give' ) );
423
+				if ( ! empty($core_settings['error'])) {
424
+					Give_Admin_Settings::add_error('give-import-csv', __('Please upload a valid JSON settings file.', 'give'));
425 425
 				} else {
426
-					$file_path = explode( '/', $core_settings['file'] );
427
-					$count     = ( count( $file_path ) - 1 );
428
-					$url       = give_import_page_url( (array) apply_filters( 'give_import_core_settings_importing_url', array(
426
+					$file_path = explode('/', $core_settings['file']);
427
+					$count     = (count($file_path) - 1);
428
+					$url       = give_import_page_url((array) apply_filters('give_import_core_settings_importing_url', array(
429 429
 						'step'          => '2',
430 430
 						'importer-type' => $this->importer_type,
431 431
 						'type'          => $type,
432
-						'file_name'     => $file_path[ $count ],
433
-					) ) );
432
+						'file_name'     => $file_path[$count],
433
+					)));
434 434
 
435 435
 
436 436
 					$this->is_json_valid = $url;
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 		 * @return bool
446 446
 		 */
447 447
 		private function is_donations_import_page() {
448
-			return 'import' === give_get_current_setting_tab() && isset( $_GET['importer-type'] ) && $this->importer_type === give_clean( $_GET['importer-type'] );
448
+			return 'import' === give_get_current_setting_tab() && isset($_GET['importer-type']) && $this->importer_type === give_clean($_GET['importer-type']);
449 449
 		}
450 450
 
451 451
 		/**
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 		 */
455 455
 		public static function upload_widget_settings_file() {
456 456
 			$upload = false;
457
-			if ( isset( $_FILES['json'] ) ) {
458
-				add_filter( 'upload_mimes', array( __CLASS__, 'json_upload_mimes' ) );
457
+			if (isset($_FILES['json'])) {
458
+				add_filter('upload_mimes', array(__CLASS__, 'json_upload_mimes'));
459 459
 
460
-				$upload = wp_handle_upload( $_FILES['json'], array( 'test_form' => false ) );
460
+				$upload = wp_handle_upload($_FILES['json'], array('test_form' => false));
461 461
 
462
-				remove_filter( 'upload_mimes', array( __CLASS__, 'json_upload_mimes' ) );
462
+				remove_filter('upload_mimes', array(__CLASS__, 'json_upload_mimes'));
463 463
 			} else {
464
-				Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide a valid JSON file.', 'give' ) );
464
+				Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide a valid JSON file.', 'give'));
465 465
 			}
466 466
 
467 467
 			return $upload;
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 		 *
473 473
 		 * @param array $existing_mimes
474 474
 		 */
475
-		public static function json_upload_mimes( $existing_mimes = array() ) {
475
+		public static function json_upload_mimes($existing_mimes = array()) {
476 476
 			$existing_mimes['json'] = 'application/json';
477 477
 
478 478
 			return $existing_mimes;
Please login to merge, or discard this patch.
includes/admin/dashboard-widgets.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
  * @return void
22 22
  */
23 23
 function give_register_dashboard_widgets() {
24
-	if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
25
-		wp_add_dashboard_widget( 'give_dashboard_sales', __( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' );
24
+	if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
25
+		wp_add_dashboard_widget('give_dashboard_sales', __('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget');
26 26
 	}
27 27
 }
28 28
 
29
-add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 );
29
+add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10);
30 30
 
31 31
 /**
32 32
  * Sales Summary Dashboard Widget
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
  */
39 39
 function give_dashboard_sales_widget() {
40 40
 
41
-	if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) {
41
+	if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) {
42 42
 		return;
43 43
 	}
44 44
 	$stats = new Give_Payment_Stats(); ?>
@@ -46,27 +46,27 @@  discard block
 block discarded – undo
46 46
 	<div class="give-dashboard-widget">
47 47
 
48 48
 		<div class="give-dashboard-today give-clearfix">
49
-			<h3 class="give-dashboard-date-today"><?php echo date_i18n( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3>
49
+			<h3 class="give-dashboard-date-today"><?php echo date_i18n(_x('F j, Y', 'dashboard widget', 'give')); ?></h3>
50 50
 
51 51
 			<p class="give-dashboard-happy-day"><?php
52 52
 				printf(
53 53
 				/* translators: %s: day of the week */
54
-					__( 'Happy %s!', 'give' ),
55
-					date_i18n( 'l', current_time( 'timestamp' ) )
54
+					__('Happy %s!', 'give'),
55
+					date_i18n('l', current_time('timestamp'))
56 56
 				);
57 57
 			?></p>
58 58
 
59 59
 			<p class="give-dashboard-today-earnings"><?php
60
-				$earnings_today = $stats->get_earnings( 0, 'today', false );
61
-				echo give_currency_filter( give_format_amount( $earnings_today, array( 'sanitize' => false ) ) );
60
+				$earnings_today = $stats->get_earnings(0, 'today', false);
61
+				echo give_currency_filter(give_format_amount($earnings_today, array('sanitize' => false)));
62 62
 			?></p>
63 63
 
64 64
 			<p class="give-donations-today"><?php
65
-				$donations_today = $stats->get_sales( 0, 'today', false );
65
+				$donations_today = $stats->get_sales(0, 'today', false);
66 66
 				printf(
67 67
 					/* translators: %s: daily donation count */
68
-					__( '%s donations today', 'give' ),
69
-					give_format_amount( $donations_today, array( 'decimal' => false, 'sanitize' => false ) )
68
+					__('%s donations today', 'give'),
69
+					give_format_amount($donations_today, array('decimal' => false, 'sanitize' => false))
70 70
 				);
71 71
 			?></p>
72 72
 
@@ -76,34 +76,34 @@  discard block
 block discarded – undo
76 76
 		<table class="give-table-stats">
77 77
 			<thead style="display: none;">
78 78
 			<tr>
79
-				<th><?php _e( 'This Week', 'give' ); ?></th>
80
-				<th><?php _e( 'This Month', 'give' ); ?></th>
81
-				<th><?php _e( 'Past 30 Days', 'give' ); ?></th>
79
+				<th><?php _e('This Week', 'give'); ?></th>
80
+				<th><?php _e('This Month', 'give'); ?></th>
81
+				<th><?php _e('Past 30 Days', 'give'); ?></th>
82 82
 			</tr>
83 83
 			</thead>
84 84
 			<tbody>
85 85
 			<tr id="give-table-stats-tr-1">
86 86
 				<td>
87
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ), array( 'sanitize' => false ) ) ); ?></p>
87
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'), array('sanitize' => false))); ?></p>
88 88
 
89
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Week', 'give' ); ?></p>
89
+					<p class="give-dashboard-stat-total-label"><?php _e('This Week', 'give'); ?></p>
90 90
 				</td>
91 91
 				<td>
92
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ), array( 'sanitize' => false ) ) ); ?></p>
92
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'), array('sanitize' => false))); ?></p>
93 93
 
94
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Month', 'give' ); ?></p>
94
+					<p class="give-dashboard-stat-total-label"><?php _e('This Month', 'give'); ?></p>
95 95
 				</td>
96 96
 			</tr>
97 97
 			<tr id="give-table-stats-tr-2">
98 98
 				<td>
99
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ), array( 'sanitize' => false ) ) ) ?></p>
99
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'), array('sanitize' => false))) ?></p>
100 100
 
101
-					<p class="give-dashboard-stat-total-label"><?php _e( 'Last Month', 'give' ); ?></p>
101
+					<p class="give-dashboard-stat-total-label"><?php _e('Last Month', 'give'); ?></p>
102 102
 				</td>
103 103
 				<td>
104
-					<p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_quarter' ), array( 'sanitize' => false ) ) ) ?></p>
104
+					<p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_quarter'), array('sanitize' => false))) ?></p>
105 105
 
106
-					<p class="give-dashboard-stat-total-label"><?php _e( 'This Quarter', 'give' ); ?></p>
106
+					<p class="give-dashboard-stat-total-label"><?php _e('This Quarter', 'give'); ?></p>
107 107
 				</td>
108 108
 			</tr>
109 109
 			</tbody>
@@ -123,24 +123,24 @@  discard block
 block discarded – undo
123 123
  *
124 124
  * @return array
125 125
  */
126
-function give_dashboard_at_a_glance_widget( $items ) {
126
+function give_dashboard_at_a_glance_widget($items) {
127 127
 
128
-	$num_posts = wp_count_posts( 'give_forms' );
128
+	$num_posts = wp_count_posts('give_forms');
129 129
 
130
-	if ( $num_posts && $num_posts->publish ) {
130
+	if ($num_posts && $num_posts->publish) {
131 131
 
132 132
 		$text = sprintf(
133 133
 			/* translators: %s: number of posts published */
134
-			_n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ),
134
+			_n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'),
135 135
 			$num_posts->publish
136 136
 		);
137 137
 
138
-		$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );
138
+		$text = sprintf($text, number_format_i18n($num_posts->publish));
139 139
 
140
-		if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
140
+		if (current_user_can('edit_give_forms', get_current_user_id())) {
141 141
 			$text = sprintf(
142 142
 				'<a class="give-forms-count" href="%1$s">%2$s</a>',
143
-				admin_url( 'edit.php?post_type=give_forms' ),
143
+				admin_url('edit.php?post_type=give_forms'),
144 144
 				$text
145 145
 			);
146 146
 		} else {
@@ -156,4 +156,4 @@  discard block
 block discarded – undo
156 156
 	return $items;
157 157
 }
158 158
 
159
-add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 );
159
+add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1);
Please login to merge, or discard this patch.
includes/admin/payments/payments-history.php 1 patch
Spacing   +23 added lines, -23 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,10 +24,10 @@  discard block
 block discarded – undo
24 24
  * @return      void
25 25
 */
26 26
 function give_payment_history_page() {
27
-	if ( isset( $_GET['view'] ) && 'view-payment-details' == $_GET['view'] ) {
28
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/view-payment-details.php';
27
+	if (isset($_GET['view']) && 'view-payment-details' == $_GET['view']) {
28
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/view-payment-details.php';
29 29
 	} else {
30
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
30
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/class-payments-table.php';
31 31
 		$payments_table = new Give_Payment_History_Table();
32 32
 		$payments_table->prepare_items();
33 33
 	?>
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
 		 *
42 42
 		 * @since 1.7
43 43
 		 */
44
-		do_action( 'give_payments_page_top' );
44
+		do_action('give_payments_page_top');
45 45
 		?>
46 46
 		<hr class="wp-header-end">
47 47
 
48
-		<form id="give-payments-advanced-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>">
48
+		<form id="give-payments-advanced-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>">
49 49
 			<input type="hidden" name="post_type" value="give_forms" />
50 50
 			<input type="hidden" name="page" value="give-payment-history" />
51 51
 			<?php $payments_table->views() ?>
52 52
 			<?php $payments_table->advanced_filters(); ?>
53 53
 		</form>
54 54
 
55
-		<form id="give-payments-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>">
55
+		<form id="give-payments-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>">
56 56
 			<input type="hidden" name="post_type" value="give_forms" />
57 57
 			<input type="hidden" name="page" value="give-payment-history" />
58 58
 			<?php
59
-			if ( ! empty( $_GET['donor'] ) ) {
60
-				echo sprintf( '<input type="hidden" name="donor" value="%s"/>', absint( $_GET['donor'] ) );
59
+			if ( ! empty($_GET['donor'])) {
60
+				echo sprintf('<input type="hidden" name="donor" value="%s"/>', absint($_GET['donor']));
61 61
 			}
62 62
 
63 63
 			$payments_table->display();
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		 *
71 71
 		 * @since 1.7
72 72
 		 */
73
-		do_action( 'give_payments_page_bottom' );
73
+		do_action('give_payments_page_bottom');
74 74
 		?>
75 75
 
76 76
 	</div>
@@ -87,29 +87,29 @@  discard block
 block discarded – undo
87 87
  * @param $title
88 88
  * @return string
89 89
  */
90
-function give_view_donation_details_title( $admin_title, $title ) {
90
+function give_view_donation_details_title($admin_title, $title) {
91 91
 
92
-	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) {
92
+	if ('give_forms_page_give-payment-history' != get_current_screen()->base) {
93 93
 		return $admin_title;
94 94
 	}
95 95
 
96
-	if( ! isset( $_GET['give-action'] ) ) {
96
+	if ( ! isset($_GET['give-action'])) {
97 97
 		return $admin_title;
98 98
 	}
99 99
 
100
-	switch( $_GET['give-action'] ) :
100
+	switch ($_GET['give-action']) :
101 101
 
102 102
 		case 'view-payment-details' :
103 103
 			$title = sprintf(
104 104
 				/* translators: %s: admin title */
105
-				esc_html__( 'View Donation Details - %s', 'give' ),
105
+				esc_html__('View Donation Details - %s', 'give'),
106 106
 				$admin_title
107 107
 			);
108 108
 			break;
109 109
 		case 'edit-payment' :
110 110
 			$title = sprintf(
111 111
 				/* translators: %s: admin title */
112
-				esc_html__( 'Edit Donation - %s', 'give' ),
112
+				esc_html__('Edit Donation - %s', 'give'),
113 113
 				$admin_title
114 114
 			);
115 115
 			break;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 	return $title;
122 122
 }
123
-add_filter( 'admin_title', 'give_view_donation_details_title', 10, 2 );
123
+add_filter('admin_title', 'give_view_donation_details_title', 10, 2);
124 124
 
125 125
 /**
126 126
  * Intercept default Edit post links for Give payments and rewrite them to the View Order Details screen.
@@ -132,20 +132,20 @@  discard block
 block discarded – undo
132 132
  * @param $context
133 133
  * @return string
134 134
  */
135
-function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) {
135
+function give_override_edit_post_for_payment_link($url, $post_id = 0, $context) {
136 136
 
137
-	$post = get_post( $post_id );
137
+	$post = get_post($post_id);
138 138
 
139
-	if( ! $post ) {
139
+	if ( ! $post) {
140 140
 		return $url;
141 141
 	}
142 142
 
143
-	if( 'give_payment' != $post->post_type ) {
143
+	if ('give_payment' != $post->post_type) {
144 144
 		return $url;
145 145
 	}
146 146
 
147
-	$url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $post_id );
147
+	$url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$post_id);
148 148
 
149 149
 	return $url;
150 150
 }
151
-add_filter( 'get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3 );
151
+add_filter('get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3);
Please login to merge, or discard this patch.
includes/admin/payments/actions.php 1 patch
Spacing   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,48 +25,48 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * @return      void
27 27
  */
28
-function give_update_payment_details( $data ) {
28
+function give_update_payment_details($data) {
29 29
 
30
-	if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) {
31
-		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
30
+	if ( ! current_user_can('edit_give_payments', $data['give_payment_id'])) {
31
+		wp_die(__('You do not have permission to edit payments.', 'give'), __('Error', 'give'), array('response' => 403));
32 32
 	}
33 33
 
34
-	check_admin_referer( 'give_update_payment_details_nonce' );
34
+	check_admin_referer('give_update_payment_details_nonce');
35 35
 
36 36
 	// Retrieve the payment ID.
37
-	$payment_id = absint( $data['give_payment_id'] );
37
+	$payment_id = absint($data['give_payment_id']);
38 38
 
39 39
 	/* @var Give_Payment $payment */
40
-	$payment = new Give_Payment( $payment_id );
40
+	$payment = new Give_Payment($payment_id);
41 41
 
42 42
 	$status = $data['give-payment-status'];
43
-	$date   = sanitize_text_field( $data['give-payment-date'] );
44
-	$hour   = sanitize_text_field( $data['give-payment-time-hour'] );
43
+	$date   = sanitize_text_field($data['give-payment-date']);
44
+	$hour   = sanitize_text_field($data['give-payment-time-hour']);
45 45
 
46 46
 	// Restrict to our high and low.
47
-	if ( $hour > 23 ) {
47
+	if ($hour > 23) {
48 48
 		$hour = 23;
49
-	} elseif ( $hour < 0 ) {
49
+	} elseif ($hour < 0) {
50 50
 		$hour = 00;
51 51
 	}
52 52
 
53
-	$minute = sanitize_text_field( $data['give-payment-time-min'] );
53
+	$minute = sanitize_text_field($data['give-payment-time-min']);
54 54
 
55 55
 	// Restrict to our high and low.
56
-	if ( $minute > 59 ) {
56
+	if ($minute > 59) {
57 57
 		$minute = 59;
58
-	} elseif ( $minute < 0 ) {
58
+	} elseif ($minute < 0) {
59 59
 		$minute = 00;
60 60
 	}
61 61
 
62
-	$address = give_clean( $data['give-payment-address'][0] );
62
+	$address = give_clean($data['give-payment-address'][0]);
63 63
 
64 64
 	$curr_total = $payment->total;
65
-	$new_total  = give_maybe_sanitize_amount( ( ! empty( $data['give-payment-total'] ) ? $data['give-payment-total'] : 0 ) );
66
-	$date       = date( 'Y-m-d', strtotime( $date ) ) . ' ' . $hour . ':' . $minute . ':00';
65
+	$new_total  = give_maybe_sanitize_amount(( ! empty($data['give-payment-total']) ? $data['give-payment-total'] : 0));
66
+	$date       = date('Y-m-d', strtotime($date)).' '.$hour.':'.$minute.':00';
67 67
 
68
-	$curr_donor_id = sanitize_text_field( $data['give-current-donor'] );
69
-	$new_donor_id  = sanitize_text_field( $data['donor-id'] );
68
+	$curr_donor_id = sanitize_text_field($data['give-current-donor']);
69
+	$new_donor_id  = sanitize_text_field($data['donor-id']);
70 70
 
71 71
 	/**
72 72
 	 * Fires before updating edited donation.
@@ -76,71 +76,71 @@  discard block
 block discarded – undo
76 76
 	 *
77 77
 	 * @param int $payment_id The ID of the payment.
78 78
 	 */
79
-	do_action( 'give_update_edited_donation', $payment_id );
79
+	do_action('give_update_edited_donation', $payment_id);
80 80
 
81 81
 	$payment->date = $date;
82 82
 	$updated       = $payment->save();
83 83
 
84
-	if ( 0 === $updated ) {
85
-		wp_die( __( 'Error Updating Donation.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
84
+	if (0 === $updated) {
85
+		wp_die(__('Error Updating Donation.', 'give'), __('Error', 'give'), array('response' => 400));
86 86
 	}
87 87
 
88 88
 	$donor_changed = false;
89 89
 
90
-	if ( isset( $data['give-new-donor'] ) && $data['give-new-donor'] == '1' ) {
90
+	if (isset($data['give-new-donor']) && $data['give-new-donor'] == '1') {
91 91
 
92
-		$email      = ! empty( $data['give-new-donor-email'] ) ? sanitize_text_field( $data['give-new-donor-email'] ) : '';
93
-		$first_name = ! empty( $data['give-new-donor-first-name'] ) ? sanitize_text_field( $data['give-new-donor-first-name'] ) : '';
94
-		$last_name  = ! empty( $data['give-new-donor-last-name'] ) ? sanitize_text_field( $data['give-new-donor-last-name'] ) : '';
95
-		$names      = strip_tags( wp_unslash( trim( "{$first_name} {$last_name}" ) ) );
92
+		$email      = ! empty($data['give-new-donor-email']) ? sanitize_text_field($data['give-new-donor-email']) : '';
93
+		$first_name = ! empty($data['give-new-donor-first-name']) ? sanitize_text_field($data['give-new-donor-first-name']) : '';
94
+		$last_name  = ! empty($data['give-new-donor-last-name']) ? sanitize_text_field($data['give-new-donor-last-name']) : '';
95
+		$names      = strip_tags(wp_unslash(trim("{$first_name} {$last_name}")));
96 96
 
97
-		if ( empty( $email ) || empty( $first_name ) ) {
98
-			wp_die( __( 'New Donor requires first name and email address.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
97
+		if (empty($email) || empty($first_name)) {
98
+			wp_die(__('New Donor requires first name and email address.', 'give'), __('Error', 'give'), array('response' => 400));
99 99
 		}
100 100
 
101
-		$donor = new Give_Donor( $email );
102
-		if ( empty( $donor->id ) ) {
103
-			$donor_data = array( 'name' => $names, 'email' => $email );
104
-			$user_id       = email_exists( $email );
105
-			if ( false !== $user_id ) {
101
+		$donor = new Give_Donor($email);
102
+		if (empty($donor->id)) {
103
+			$donor_data = array('name' => $names, 'email' => $email);
104
+			$user_id = email_exists($email);
105
+			if (false !== $user_id) {
106 106
 				$donor_data['user_id'] = $user_id;
107 107
 			}
108 108
 
109
-			if ( ! $donor->create( $donor_data ) ) {
109
+			if ( ! $donor->create($donor_data)) {
110 110
 				// Failed to create the new donor, assume the previous donor.
111 111
 				$donor_changed = false;
112
-				$donor         = new Give_Donor( $curr_donor_id );
113
-				give_set_error( 'give-payment-new-donor-fail', __( 'Error creating new donor.', 'give' ) );
112
+				$donor         = new Give_Donor($curr_donor_id);
113
+				give_set_error('give-payment-new-donor-fail', __('Error creating new donor.', 'give'));
114 114
 			}
115 115
 		}
116 116
 
117 117
 		// Create and Update Donor First Name and Last Name in Meta Fields.
118
-		$donor->update_meta( '_give_donor_first_name', $first_name );
119
-		$donor->update_meta( '_give_donor_last_name', $last_name );
118
+		$donor->update_meta('_give_donor_first_name', $first_name);
119
+		$donor->update_meta('_give_donor_last_name', $last_name);
120 120
 
121 121
 		$new_donor_id = $donor->id;
122 122
 
123
-		$previous_donor = new Give_Donor( $curr_donor_id );
123
+		$previous_donor = new Give_Donor($curr_donor_id);
124 124
 
125 125
 		$donor_changed = true;
126 126
 
127
-	} elseif ( $curr_donor_id !== $new_donor_id ) {
127
+	} elseif ($curr_donor_id !== $new_donor_id) {
128 128
 
129
-		$donor = new Give_Donor( $new_donor_id );
129
+		$donor = new Give_Donor($new_donor_id);
130 130
 		$email    = $donor->email;
131 131
 		$names    = $donor->name;
132 132
 
133
-		$previous_donor = new Give_Donor( $curr_donor_id );
133
+		$previous_donor = new Give_Donor($curr_donor_id);
134 134
 
135 135
 		$donor_changed = true;
136 136
 
137 137
 	} else {
138
-		$donor = new Give_Donor( $curr_donor_id );
138
+		$donor = new Give_Donor($curr_donor_id);
139 139
 		$email    = $donor->email;
140 140
 		$names    = $donor->name;
141 141
 	}
142 142
 
143
-	if ( $donor_changed ) {
143
+	if ($donor_changed) {
144 144
 
145 145
 		// Setup first and last name from input values.
146 146
 		$first_name = $donor->get_first_name();
@@ -150,26 +150,26 @@  discard block
 block discarded – undo
150 150
 		$payment->last_name  = $last_name;
151 151
 
152 152
 		// Remove the stats and payment from the previous donor and attach it to the new donor.
153
-		$previous_donor->remove_payment( $payment_id, false );
154
-		$donor->attach_payment( $payment_id, false );
153
+		$previous_donor->remove_payment($payment_id, false);
154
+		$donor->attach_payment($payment_id, false);
155 155
 
156
-		if ( 'publish' == $status ) {
156
+		if ('publish' == $status) {
157 157
 
158 158
 			// Reduce previous user donation count and amount.
159 159
 			$previous_donor->decrease_donation_count();
160
-			$previous_donor->decrease_value( $curr_total );
160
+			$previous_donor->decrease_value($curr_total);
161 161
 
162 162
 			// If donation was completed adjust stats of new donors.
163 163
 			$donor->increase_purchase_count();
164
-			$donor->increase_value( $new_total );
164
+			$donor->increase_value($new_total);
165 165
 		}
166 166
 
167 167
 		$payment->customer_id = $donor->id;
168 168
 	} else {
169 169
 
170
-		if ( 'publish' === $status ) {
170
+		if ('publish' === $status) {
171 171
 			// Update user donation stat.
172
-			$donor->update_donation_value( $curr_total, $new_total );
172
+			$donor->update_donation_value($curr_total, $new_total);
173 173
 		}
174 174
 	}
175 175
 
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
 	$payment->total      = $new_total;
181 181
 
182 182
 	// Check for payment notes.
183
-	if ( ! empty( $data['give-payment-note'] ) ) {
183
+	if ( ! empty($data['give-payment-note'])) {
184 184
 
185
-		$note = wp_kses( $data['give-payment-note'], array() );
186
-		give_insert_payment_note( $payment_id, $note );
185
+		$note = wp_kses($data['give-payment-note'], array());
186
+		give_insert_payment_note($payment_id, $note);
187 187
 
188 188
 	}
189 189
 
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
 	$payment->status = $status;
192 192
 
193 193
 	// Adjust total store earnings if the payment total has been changed.
194
-	if ( $new_total !== $curr_total && 'publish' == $status ) {
194
+	if ($new_total !== $curr_total && 'publish' == $status) {
195 195
 
196
-		if ( $new_total > $curr_total ) {
196
+		if ($new_total > $curr_total) {
197 197
 			// Increase if our new total is higher.
198 198
 			$difference = $new_total - $curr_total;
199
-			give_increase_total_earnings( $difference );
199
+			give_increase_total_earnings($difference);
200 200
 
201
-		} elseif ( $curr_total > $new_total ) {
201
+		} elseif ($curr_total > $new_total) {
202 202
 			// Decrease if our new total is lower.
203 203
 			$difference = $curr_total - $new_total;
204
-			give_decrease_total_earnings( $difference );
204
+			give_decrease_total_earnings($difference);
205 205
 
206 206
 		}
207 207
 	}
@@ -209,55 +209,55 @@  discard block
 block discarded – undo
209 209
 	$payment->save();
210 210
 
211 211
 	// Get new give form ID.
212
-	$new_form_id     = absint( $data['give-payment-form-select'] );
213
-	$current_form_id = absint( $payment->get_meta( '_give_payment_form_id' ) );
212
+	$new_form_id     = absint($data['give-payment-form-select']);
213
+	$current_form_id = absint($payment->get_meta('_give_payment_form_id'));
214 214
 
215 215
 	// We are adding payment transfer code in last to remove any conflict with above functionality.
216 216
 	// For example: above code will automatically handle form stat (increase/decrease) when payment status changes.
217 217
 	// Check if user want to transfer current payment to new give form id.
218
-	if ( $new_form_id && $new_form_id != $current_form_id ) {
218
+	if ($new_form_id && $new_form_id != $current_form_id) {
219 219
 
220 220
 		// Get new give form title.
221
-		$new_form_title = get_the_title( $new_form_id );
221
+		$new_form_title = get_the_title($new_form_id);
222 222
 
223 223
 		// Update payment give form meta data.
224
-		$payment->update_meta( '_give_payment_form_id', $new_form_id );
225
-		$payment->update_meta( '_give_payment_form_title', $new_form_title );
224
+		$payment->update_meta('_give_payment_form_id', $new_form_id);
225
+		$payment->update_meta('_give_payment_form_title', $new_form_title);
226 226
 
227 227
 		// Update price id payment metadata.
228
-		if ( ! give_has_variable_prices( $new_form_id ) ) {
229
-			$payment->update_meta( '_give_payment_price_id', '' );
228
+		if ( ! give_has_variable_prices($new_form_id)) {
229
+			$payment->update_meta('_give_payment_price_id', '');
230 230
 		}
231 231
 
232 232
 		// If donation was completed, adjust stats of forms.
233
-		if ( 'publish' == $status ) {
233
+		if ('publish' == $status) {
234 234
 
235 235
 			// Decrease sale of old give form. For other payment status.
236
-			$current_form = new Give_Donate_Form( $current_form_id );
236
+			$current_form = new Give_Donate_Form($current_form_id);
237 237
 			$current_form->decrease_sales();
238
-			$current_form->decrease_earnings( $curr_total, $payment->ID );
238
+			$current_form->decrease_earnings($curr_total, $payment->ID);
239 239
 
240 240
 			// Increase sale of new give form.
241
-			$new_form = new Give_Donate_Form( $new_form_id );
241
+			$new_form = new Give_Donate_Form($new_form_id);
242 242
 			$new_form->increase_sales();
243
-			$new_form->increase_earnings( $new_total, $payment->ID );
243
+			$new_form->increase_earnings($new_total, $payment->ID);
244 244
 		}
245 245
 
246 246
 		// Re setup payment to update new meta value in object.
247
-		$payment->update_payment_setup( $payment->ID );
247
+		$payment->update_payment_setup($payment->ID);
248 248
 
249 249
 		// Update form id in payment logs.
250
-		Give()->async_process->data( array(
251
-			'data' => array( $new_form_id, $payment_id ),
250
+		Give()->async_process->data(array(
251
+			'data' => array($new_form_id, $payment_id),
252 252
 			'hook' => 'give_update_log_form_id',
253
-		) )->dispatch();
253
+		))->dispatch();
254 254
 	}
255 255
 
256 256
 	// Update price id if current form is variable form.
257 257
 	/* @var Give_Donate_Form $form */
258
-	$form = new Give_Donate_Form( $payment->form_id );
258
+	$form = new Give_Donate_Form($payment->form_id);
259 259
 
260
-	if ( isset( $data['give-variable-price'] ) && $form->has_variable_prices() ) {
260
+	if (isset($data['give-variable-price']) && $form->has_variable_prices()) {
261 261
 
262 262
 		// Get payment meta data.
263 263
 		$payment_meta = $payment->get_meta();
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 		$price_id = '';
267 267
 
268 268
 		// Get price info
269
-		if( 0 <= $data['give-variable-price'] ) {
270
-			foreach ( $form->prices as $variable_price ) {
271
-				if( $new_total === give_maybe_sanitize_amount( $variable_price['_give_amount'] ) ) {
269
+		if (0 <= $data['give-variable-price']) {
270
+			foreach ($form->prices as $variable_price) {
271
+				if ($new_total === give_maybe_sanitize_amount($variable_price['_give_amount'])) {
272 272
 					$price_info = $variable_price;
273 273
 					break;
274 274
 				}
@@ -276,15 +276,15 @@  discard block
 block discarded – undo
276 276
 		}
277 277
 
278 278
 		// Set price id.
279
-		if( ! empty( $price_info ) ) {
279
+		if ( ! empty($price_info)) {
280 280
 			$price_id = $data['give-variable-price'];
281 281
 
282
-			if( $data['give-variable-price'] !== $price_info['_give_id']['level_id'] ) {
282
+			if ($data['give-variable-price'] !== $price_info['_give_id']['level_id']) {
283 283
 				// Set price id to amount match.
284 284
 				$price_id = $price_info['_give_id']['level_id'];
285 285
 			}
286 286
 
287
-		} elseif( $form->is_custom_price_mode() ){
287
+		} elseif ($form->is_custom_price_mode()) {
288 288
 			$price_id = 'custom';
289 289
 		}
290 290
 
@@ -292,11 +292,11 @@  discard block
 block discarded – undo
292 292
 		$payment_meta['price_id'] = $price_id;
293 293
 
294 294
 		// Update payment give form meta data.
295
-		$payment->update_meta( '_give_payment_price_id', $price_id );
296
-		$payment->update_meta( '_give_payment_meta', $payment_meta );
295
+		$payment->update_meta('_give_payment_price_id', $price_id);
296
+		$payment->update_meta('_give_payment_meta', $payment_meta);
297 297
 
298 298
 		// Re setup payment to update new meta value in object.
299
-		$payment->update_payment_setup( $payment->ID );
299
+		$payment->update_payment_setup($payment->ID);
300 300
 	}
301 301
 
302 302
 	/**
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 	 *
308 308
 	 * @param int $payment_id The ID of the payment.
309 309
 	 */
310
-	do_action( 'give_updated_edited_donation', $payment_id );
310
+	do_action('give_updated_edited_donation', $payment_id);
311 311
 
312
-	wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=payment-updated&id=' . $payment_id ) );
312
+	wp_safe_redirect(admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=payment-updated&id='.$payment_id));
313 313
 	exit;
314 314
 }
315 315
 
316
-add_action( 'give_update_payment_details', 'give_update_payment_details' );
316
+add_action('give_update_payment_details', 'give_update_payment_details');
317 317
 
318 318
 /**
319 319
  * Trigger a Donation Deletion.
@@ -324,48 +324,48 @@  discard block
 block discarded – undo
324 324
  *
325 325
  * @return void
326 326
  */
327
-function give_trigger_donation_delete( $data ) {
328
-	if ( wp_verify_nonce( $data['_wpnonce'], 'give_donation_nonce' ) ) {
327
+function give_trigger_donation_delete($data) {
328
+	if (wp_verify_nonce($data['_wpnonce'], 'give_donation_nonce')) {
329 329
 
330
-		$payment_id = absint( $data['purchase_id'] );
330
+		$payment_id = absint($data['purchase_id']);
331 331
 
332
-		if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
333
-			wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
332
+		if ( ! current_user_can('edit_give_payments', $payment_id)) {
333
+			wp_die(__('You do not have permission to edit payments.', 'give'), __('Error', 'give'), array('response' => 403));
334 334
 		}
335 335
 
336
-		give_delete_donation( $payment_id );
337
-		wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&give-message=donation_deleted' ) );
336
+		give_delete_donation($payment_id);
337
+		wp_redirect(admin_url('edit.php?post_type=give_forms&page=give-payment-history&give-message=donation_deleted'));
338 338
 		give_die();
339 339
 	}
340 340
 }
341 341
 
342
-add_action( 'give_delete_payment', 'give_trigger_donation_delete' );
342
+add_action('give_delete_payment', 'give_trigger_donation_delete');
343 343
 
344 344
 /**
345 345
  * AJAX Store Donation Note
346 346
  */
347 347
 function give_ajax_store_payment_note() {
348 348
 
349
-	$payment_id = absint( $_POST['payment_id'] );
350
-	$note       = wp_kses( $_POST['note'], array() );
349
+	$payment_id = absint($_POST['payment_id']);
350
+	$note       = wp_kses($_POST['note'], array());
351 351
 
352
-	if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
353
-		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
352
+	if ( ! current_user_can('edit_give_payments', $payment_id)) {
353
+		wp_die(__('You do not have permission to edit payments.', 'give'), __('Error', 'give'), array('response' => 403));
354 354
 	}
355 355
 
356
-	if ( empty( $payment_id ) ) {
357
-		die( '-1' );
356
+	if (empty($payment_id)) {
357
+		die('-1');
358 358
 	}
359 359
 
360
-	if ( empty( $note ) ) {
361
-		die( '-1' );
360
+	if (empty($note)) {
361
+		die('-1');
362 362
 	}
363 363
 
364
-	$note_id = give_insert_payment_note( $payment_id, $note );
365
-	die( give_get_payment_note_html( $note_id ) );
364
+	$note_id = give_insert_payment_note($payment_id, $note);
365
+	die(give_get_payment_note_html($note_id));
366 366
 }
367 367
 
368
-add_action( 'wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note' );
368
+add_action('wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note');
369 369
 
370 370
 /**
371 371
  * Triggers a donation note deletion without ajax
@@ -376,24 +376,24 @@  discard block
 block discarded – undo
376 376
  *
377 377
  * @return void
378 378
  */
379
-function give_trigger_payment_note_deletion( $data ) {
379
+function give_trigger_payment_note_deletion($data) {
380 380
 
381
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_delete_payment_note_' . $data['note_id'] ) ) {
381
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give_delete_payment_note_'.$data['note_id'])) {
382 382
 		return;
383 383
 	}
384 384
 
385
-	if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) {
386
-		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
385
+	if ( ! current_user_can('edit_give_payments', $data['payment_id'])) {
386
+		wp_die(__('You do not have permission to edit payments.', 'give'), __('Error', 'give'), array('response' => 403));
387 387
 	}
388 388
 
389
-	$edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=donation-note-deleted&id=' . absint( $data['payment_id'] ) );
389
+	$edit_order_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&give-message=donation-note-deleted&id='.absint($data['payment_id']));
390 390
 
391
-	give_delete_payment_note( $data['note_id'], $data['payment_id'] );
391
+	give_delete_payment_note($data['note_id'], $data['payment_id']);
392 392
 
393
-	wp_redirect( $edit_order_url );
393
+	wp_redirect($edit_order_url);
394 394
 }
395 395
 
396
-add_action( 'give_delete_payment_note', 'give_trigger_payment_note_deletion' );
396
+add_action('give_delete_payment_note', 'give_trigger_payment_note_deletion');
397 397
 
398 398
 /**
399 399
  * Delete a payment note deletion with ajax
@@ -404,16 +404,16 @@  discard block
 block discarded – undo
404 404
  */
405 405
 function give_ajax_delete_payment_note() {
406 406
 
407
-	if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) {
408
-		wp_die( __( 'You do not have permission to edit payments.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
407
+	if ( ! current_user_can('edit_give_payments', $_POST['payment_id'])) {
408
+		wp_die(__('You do not have permission to edit payments.', 'give'), __('Error', 'give'), array('response' => 403));
409 409
 	}
410 410
 
411
-	if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) {
412
-		die( '1' );
411
+	if (give_delete_payment_note($_POST['note_id'], $_POST['payment_id'])) {
412
+		die('1');
413 413
 	} else {
414
-		die( '-1' );
414
+		die('-1');
415 415
 	}
416 416
 
417 417
 }
418 418
 
419
-add_action( 'wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note' );
419
+add_action('wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note');
Please login to merge, or discard this patch.
includes/admin/payments/view-payment-details.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -323,10 +323,10 @@
 block discarded – undo
323 323
 										</div>
324 324
 
325 325
 										<?php
326
-                                        // Display the transaction ID present.
327
-                                        // The transaction ID is the charge ID from the gateway.
328
-                                        // For instance, stripe "ch_BzvwYCchqOy5Nt".
329
-                                        if ( $transaction_id != $payment_id ) : ?>
326
+										// Display the transaction ID present.
327
+										// The transaction ID is the charge ID from the gateway.
328
+										// For instance, stripe "ch_BzvwYCchqOy5Nt".
329
+										if ( $transaction_id != $payment_id ) : ?>
330 330
 											<div class="give-order-tx-id give-admin-box-inside">
331 331
 												<p>
332 332
 													<strong><?php _e( 'Transaction ID:', 'give' ); ?> <span class="give-tooltip give-icon give-icon-question"  data-tooltip="<?php echo sprintf( esc_attr__( 'The transaction ID within %s.', 'give' ), $gateway); ?>"></span></strong>&nbsp;
Please login to merge, or discard this patch.
Spacing   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-if ( ! current_user_can( 'view_give_payments' ) ) {
17
+if ( ! current_user_can('view_give_payments')) {
18 18
 	wp_die(
19
-		__( 'Sorry, you are not allowed to access this page.', 'give' ), __( 'Error', 'give' ), array(
19
+		__('Sorry, you are not allowed to access this page.', 'give'), __('Error', 'give'), array(
20 20
 			'response' => 403,
21 21
 		)
22 22
 	);
@@ -28,35 +28,35 @@  discard block
 block discarded – undo
28 28
  * @since 1.0
29 29
  * @return void
30 30
  */
31
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
32
-	wp_die( __( 'Donation ID not supplied. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
31
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
32
+	wp_die(__('Donation ID not supplied. Please try again.', 'give'), __('Error', 'give'), array('response' => 400));
33 33
 }
34 34
 
35 35
 // Setup the variables
36
-$payment_id = absint( $_GET['id'] );
37
-$payment    = new Give_Payment( $payment_id );
36
+$payment_id = absint($_GET['id']);
37
+$payment    = new Give_Payment($payment_id);
38 38
 
39 39
 // Sanity check... fail if donation ID is invalid
40 40
 $payment_exists = $payment->ID;
41
-if ( empty( $payment_exists ) ) {
42
-	wp_die( __( 'The specified ID does not belong to a donation. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
41
+if (empty($payment_exists)) {
42
+	wp_die(__('The specified ID does not belong to a donation. Please try again.', 'give'), __('Error', 'give'), array('response' => 400));
43 43
 }
44 44
 
45 45
 $number       = $payment->number;
46 46
 $payment_meta = $payment->get_meta();
47 47
 
48
-$company_name   = ! empty( $payment_meta['_give_donation_company'] ) ? esc_attr( $payment_meta['_give_donation_company'] ) : '';
49
-$transaction_id = esc_attr( $payment->transaction_id );
48
+$company_name   = ! empty($payment_meta['_give_donation_company']) ? esc_attr($payment_meta['_give_donation_company']) : '';
49
+$transaction_id = esc_attr($payment->transaction_id);
50 50
 $user_id        = $payment->user_id;
51 51
 $donor_id       = $payment->customer_id;
52
-$payment_date   = strtotime( $payment->date );
53
-$user_info      = give_get_payment_meta_user_info( $payment_id );
52
+$payment_date   = strtotime($payment->date);
53
+$user_info      = give_get_payment_meta_user_info($payment_id);
54 54
 $address        = $payment->address;
55 55
 $currency_code  = $payment->currency;
56 56
 $gateway        = $payment->gateway;
57 57
 $currency_code  = $payment->currency;
58 58
 $payment_mode   = $payment->mode;
59
-$base_url       = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
59
+$base_url       = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
60 60
 
61 61
 ?>
62 62
 <div class="wrap give-wrap">
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	<?php
66 66
 		printf(
67 67
 			/* translators: %s: donation number */
68
-			esc_html__( 'Donation %s', 'give' ),
68
+			esc_html__('Donation %s', 'give'),
69 69
 			$number
70 70
 		);
71
-		if ( $payment_mode == 'test' ) {
71
+		if ($payment_mode == 'test') {
72 72
 			echo Give()->tooltips->render_span(array(
73
-				'label' => __( 'This donation was made in test mode.', 'give' ),
74
-				'tag_content' => __( 'Test Donation', 'give' ),
73
+				'label' => __('This donation was made in test mode.', 'give'),
74
+				'tag_content' => __('Test Donation', 'give'),
75 75
 				'position'=> 'right',
76 76
 				'attributes' => array(
77 77
 					'id' => 'test-payment-label',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 *
91 91
 	 * @param int $payment_id Payment id.
92 92
 	 */
93
-	do_action( 'give_view_donation_details_before', $payment_id );
93
+	do_action('give_view_donation_details_before', $payment_id);
94 94
 	?>
95 95
 
96 96
 	<hr class="wp-header-end">
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		 *
105 105
 		 * @param int $payment_id Payment id.
106 106
 		 */
107
-		do_action( 'give_view_donation_details_form_top', $payment_id );
107
+		do_action('give_view_donation_details_form_top', $payment_id);
108 108
 		?>
109 109
 		<div id="poststuff">
110 110
 			<div id="give-dashboard-widgets-wrap">
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
 							 *
121 121
 							 * @param int $payment_id Payment id.
122 122
 							 */
123
-							do_action( 'give_view_donation_details_sidebar_before', $payment_id );
123
+							do_action('give_view_donation_details_sidebar_before', $payment_id);
124 124
 							?>
125 125
 
126 126
 							<div id="give-order-update" class="postbox give-order-data">
127 127
 
128 128
 								<div class="give-order-top">
129
-									<h3 class="hndle"><?php _e( 'Update Donation', 'give' ); ?></h3>
129
+									<h3 class="hndle"><?php _e('Update Donation', 'give'); ?></h3>
130 130
 
131 131
 									<?php
132
-									if ( current_user_can( 'view_give_payments' ) ) {
132
+									if (current_user_can('view_give_payments')) {
133 133
 										echo sprintf(
134 134
 											'<span class="delete-donation" id="delete-donation-%d"><a class="delete-single-donation delete-donation-button dashicons dashicons-trash" href="%s" aria-label="%s"></a></span>',
135 135
 											$payment_id,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 													), $base_url
142 142
 												), 'give_donation_nonce'
143 143
 											),
144
-											sprintf( __( 'Delete Donation %s', 'give' ), $payment_id )
144
+											sprintf(__('Delete Donation %s', 'give'), $payment_id)
145 145
 										);
146 146
 									}
147 147
 									?>
@@ -158,33 +158,33 @@  discard block
 block discarded – undo
158 158
 										 *
159 159
 										 * @param int $payment_id Payment id.
160 160
 										 */
161
-										do_action( 'give_view_donation_details_totals_before', $payment_id );
161
+										do_action('give_view_donation_details_totals_before', $payment_id);
162 162
 										?>
163 163
 
164 164
 										<div class="give-admin-box-inside">
165 165
 											<p>
166
-												<label for="give-payment-status" class="strong"><?php _e( 'Status:', 'give' ); ?></label>&nbsp;
166
+												<label for="give-payment-status" class="strong"><?php _e('Status:', 'give'); ?></label>&nbsp;
167 167
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
168
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
169
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
168
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
169
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
170 170
 													<?php endforeach; ?>
171 171
 												</select>
172
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
172
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
173 173
 											</p>
174 174
 										</div>
175 175
 
176 176
 										<div class="give-admin-box-inside">
177 177
 											<p>
178
-												<label for="give-payment-date" class="strong"><?php _e( 'Date:', 'give' ); ?></label>&nbsp;
179
-												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
178
+												<label for="give-payment-date" class="strong"><?php _e('Date:', 'give'); ?></label>&nbsp;
179
+												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
180 180
 											</p>
181 181
 										</div>
182 182
 
183 183
 										<div class="give-admin-box-inside">
184 184
 											<p>
185
-												<label for="give-payment-time-hour" class="strong"><?php _e( 'Time:', 'give' ); ?></label>&nbsp;
186
-												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
187
-												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
185
+												<label for="give-payment-time-hour" class="strong"><?php _e('Time:', 'give'); ?></label>&nbsp;
186
+												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
187
+												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
188 188
 											</p>
189 189
 										</div>
190 190
 
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
 										 *
199 199
 										 * @param int $payment_id Payment id.
200 200
 										 */
201
-										do_action( 'give_view_donation_details_update_inner', $payment_id );
201
+										do_action('give_view_donation_details_update_inner', $payment_id);
202 202
 										?>
203 203
 
204 204
 										<div class="give-order-payment give-admin-box-inside">
205 205
 											<p>
206
-												<label for="give-payment-total" class="strong"><?php _e( 'Total Donation:', 'give' ); ?></label>&nbsp;
207
-												<?php echo give_currency_symbol( $payment->currency ); ?>
208
-												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_donation_amount( $payment_id ), false, false ) ); ?>"/>
206
+												<label for="give-payment-total" class="strong"><?php _e('Total Donation:', 'give'); ?></label>&nbsp;
207
+												<?php echo give_currency_symbol($payment->currency); ?>
208
+												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_donation_amount($payment_id), false, false)); ?>"/>
209 209
 											</p>
210 210
 										</div>
211 211
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 										 *
218 218
 										 * @param int $payment_id Payment id.
219 219
 										 */
220
-										do_action( 'give_view_donation_details_totals_after', $payment_id );
220
+										do_action('give_view_donation_details_totals_after', $payment_id);
221 221
 										?>
222 222
 
223 223
 									</div>
@@ -235,17 +235,17 @@  discard block
 block discarded – undo
235 235
 									 *
236 236
 									 * @param int $payment_id Payment id.
237 237
 									 */
238
-									do_action( 'give_view_donation_details_update_before', $payment_id );
238
+									do_action('give_view_donation_details_update_before', $payment_id);
239 239
 									?>
240 240
 
241 241
 									<div id="major-publishing-actions">
242 242
 										<div id="publishing-action">
243 243
 
244 244
 											<input type="submit" class="button button-primary right"
245
-											       value="<?php _e( 'Save Donation', 'give' ); ?>"/>
245
+											       value="<?php _e('Save Donation', 'give'); ?>"/>
246 246
 
247 247
 											<?php
248
-											if ( give_is_payment_complete( $payment_id ) ) {
248
+											if (give_is_payment_complete($payment_id)) {
249 249
 												echo sprintf(
250 250
 													'<a href="%1$s" id="give-resend-receipt" class="button-secondary right">%2$s</a>',
251 251
 													esc_url(
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 															)
257 257
 														)
258 258
 													),
259
-													__( 'Resend Receipt', 'give' )
259
+													__('Resend Receipt', 'give')
260 260
 												);
261 261
 											}
262 262
 											?>
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 									 *
272 272
 									 * @param int $payment_id Payment id.
273 273
 									 */
274
-									do_action( 'give_view_donation_details_update_after', $payment_id );
274
+									do_action('give_view_donation_details_update_after', $payment_id);
275 275
 									?>
276 276
 
277 277
 								</div>
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
 							<div id="give-order-details" class="postbox give-order-data">
284 284
 
285
-								<h3 class="hndle"><?php _e( 'Donation Meta', 'give' ); ?></h3>
285
+								<h3 class="hndle"><?php _e('Donation Meta', 'give'); ?></h3>
286 286
 
287 287
 								<div class="inside">
288 288
 									<div class="give-admin-box">
@@ -295,30 +295,30 @@  discard block
 block discarded – undo
295 295
 										 *
296 296
 										 * @param int $payment_id Payment id.
297 297
 										 */
298
-										do_action( 'give_view_donation_details_payment_meta_before', $payment_id );
298
+										do_action('give_view_donation_details_payment_meta_before', $payment_id);
299 299
 
300
-										$gateway = give_get_payment_gateway( $payment_id );
301
-										if ( $gateway ) :
300
+										$gateway = give_get_payment_gateway($payment_id);
301
+										if ($gateway) :
302 302
 										?>
303 303
 											<div class="give-order-gateway give-admin-box-inside">
304 304
 												<p>
305
-													<strong><?php _e( 'Gateway:', 'give' ); ?></strong>&nbsp;
306
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
305
+													<strong><?php _e('Gateway:', 'give'); ?></strong>&nbsp;
306
+													<?php echo give_get_gateway_admin_label($gateway); ?>
307 307
 												</p>
308 308
 											</div>
309 309
 										<?php endif; ?>
310 310
 
311 311
 										<div class="give-order-payment-key give-admin-box-inside">
312 312
 											<p>
313
-												<strong><?php _e( 'Key:', 'give' ); ?></strong>&nbsp;
314
-												<?php echo give_get_payment_key( $payment_id ); ?>
313
+												<strong><?php _e('Key:', 'give'); ?></strong>&nbsp;
314
+												<?php echo give_get_payment_key($payment_id); ?>
315 315
 											</p>
316 316
 										</div>
317 317
 
318 318
 										<div class="give-order-ip give-admin-box-inside">
319 319
 											<p>
320
-												<strong><?php _e( 'IP:', 'give' ); ?></strong>&nbsp;
321
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
320
+												<strong><?php _e('IP:', 'give'); ?></strong>&nbsp;
321
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
322 322
 											</p>
323 323
 										</div>
324 324
 
@@ -326,18 +326,18 @@  discard block
 block discarded – undo
326 326
                                         // Display the transaction ID present.
327 327
                                         // The transaction ID is the charge ID from the gateway.
328 328
                                         // For instance, stripe "ch_BzvwYCchqOy5Nt".
329
-                                        if ( $transaction_id != $payment_id ) : ?>
329
+                                        if ($transaction_id != $payment_id) : ?>
330 330
 											<div class="give-order-tx-id give-admin-box-inside">
331 331
 												<p>
332
-													<strong><?php _e( 'Transaction ID:', 'give' ); ?> <span class="give-tooltip give-icon give-icon-question"  data-tooltip="<?php echo sprintf( esc_attr__( 'The transaction ID within %s.', 'give' ), $gateway); ?>"></span></strong>&nbsp;
333
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
332
+													<strong><?php _e('Transaction ID:', 'give'); ?> <span class="give-tooltip give-icon give-icon-question"  data-tooltip="<?php echo sprintf(esc_attr__('The transaction ID within %s.', 'give'), $gateway); ?>"></span></strong>&nbsp;
333
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
334 334
 												</p>
335 335
 											</div>
336 336
 										<?php endif; ?>
337 337
 
338 338
 										<div class="give-admin-box-inside">
339
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( give_get_payment_donor_id( $payment_id ) ) ); ?>
340
-												<a href="<?php echo $purchase_url; ?>"><?php _e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
339
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint(give_get_payment_donor_id($payment_id))); ?>
340
+												<a href="<?php echo $purchase_url; ?>"><?php _e('View all donations for this donor &raquo;', 'give'); ?></a>
341 341
 											</p>
342 342
 										</div>
343 343
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 										 *
350 350
 										 * @param int $payment_id Payment id.
351 351
 										 */
352
-										do_action( 'give_view_donation_details_payment_meta_after', $payment_id );
352
+										do_action('give_view_donation_details_payment_meta_after', $payment_id);
353 353
 										?>
354 354
 
355 355
 									</div>
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 							 *
370 370
 							 * @param int $payment_id Payment id.
371 371
 							 */
372
-							do_action( 'give_view_donation_details_sidebar_after', $payment_id );
372
+							do_action('give_view_donation_details_sidebar_after', $payment_id);
373 373
 							?>
374 374
 
375 375
 						</div>
@@ -389,31 +389,31 @@  discard block
 block discarded – undo
389 389
 							 *
390 390
 							 * @param int $payment_id Payment id.
391 391
 							 */
392
-							do_action( 'give_view_donation_details_main_before', $payment_id );
392
+							do_action('give_view_donation_details_main_before', $payment_id);
393 393
 							?>
394 394
 
395 395
 							<?php $column_count = 'columns-3'; ?>
396 396
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
397
-								<h3 class="hndle"><?php _e( 'Donation Information', 'give' ); ?></h3>
397
+								<h3 class="hndle"><?php _e('Donation Information', 'give'); ?></h3>
398 398
 
399 399
 								<div class="inside">
400 400
 
401 401
 									<div class="column-container">
402 402
 										<div class="column">
403 403
 											<p>
404
-												<strong><?php _e( 'Donation Form ID:', 'give' ); ?></strong><br>
404
+												<strong><?php _e('Donation Form ID:', 'give'); ?></strong><br>
405 405
 												<?php
406
-												if ( $payment_meta['form_id'] ) :
406
+												if ($payment_meta['form_id']) :
407 407
 													printf(
408 408
 														'<a href="%1$s">%2$s</a>',
409
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
409
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
410 410
 														$payment_meta['form_id']
411 411
 													);
412 412
 												endif;
413 413
 												?>
414 414
 											</p>
415 415
 											<p>
416
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
416
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
417 417
 												<?php
418 418
 												echo Give()->html->forms_dropdown(
419 419
 													array(
@@ -429,21 +429,21 @@  discard block
 block discarded – undo
429 429
 										</div>
430 430
 										<div class="column">
431 431
 											<p>
432
-												<strong><?php _e( 'Donation Date:', 'give' ); ?></strong><br>
433
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
432
+												<strong><?php _e('Donation Date:', 'give'); ?></strong><br>
433
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
434 434
 											</p>
435 435
 											<p>
436
-												<strong><?php _e( 'Donation Level:', 'give' ); ?></strong><br>
436
+												<strong><?php _e('Donation Level:', 'give'); ?></strong><br>
437 437
 												<span class="give-donation-level">
438 438
 													<?php
439
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
440
-													if ( empty( $var_prices ) ) {
441
-														_e( 'n/a', 'give' );
439
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
440
+													if (empty($var_prices)) {
441
+														_e('n/a', 'give');
442 442
 													} else {
443 443
 														$prices_atts = array();
444
-														if ( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
445
-															foreach ( $variable_prices as $variable_price ) {
446
-																$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
444
+														if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) {
445
+															foreach ($variable_prices as $variable_price) {
446
+																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
447 447
 															}
448 448
 														}
449 449
 														// Variable price dropdown options.
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
 															'name'             => 'give-variable-price',
453 453
 															'chosen'           => true,
454 454
 															'show_option_all'  => '',
455
-															'show_option_none' => ( '' === get_post_meta( $payment_id, '_give_payment_price_id', true ) ? __( 'None', 'give' ) : '' ),
456
-															'select_atts'      => 'data-prices=' . esc_attr( wp_json_encode( $prices_atts ) ),
455
+															'show_option_none' => ('' === get_post_meta($payment_id, '_give_payment_price_id', true) ? __('None', 'give') : ''),
456
+															'select_atts'      => 'data-prices='.esc_attr(wp_json_encode($prices_atts)),
457 457
 															'selected'         => $payment_meta['price_id'],
458 458
 														);
459 459
 														// Render variable prices select tag html.
460
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
460
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
461 461
 													}
462 462
 													?>
463 463
 												</span>
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 										</div>
466 466
 										<div class="column">
467 467
 											<p>
468
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
469
-												<?php echo give_donation_amount( $payment, true ); ?>
468
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
469
+												<?php echo give_donation_amount($payment, true); ?>
470 470
 											</p>
471 471
 
472 472
 											<p>
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 												 *
481 481
 												 * @param int $payment_id Payment id.
482 482
 												 */
483
-												do_action( 'give_donation_details_thead_before', $payment_id );
483
+												do_action('give_donation_details_thead_before', $payment_id);
484 484
 
485 485
 
486 486
 												/**
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 												 *
493 493
 												 * @param int $payment_id Payment id.
494 494
 												 */
495
-												do_action( 'give_donation_details_thead_after', $payment_id );
495
+												do_action('give_donation_details_thead_after', $payment_id);
496 496
 
497 497
 												/**
498 498
 												 * Fires in donation details page, in the donation-information metabox, before the body elements.
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 												 *
504 504
 												 * @param int $payment_id Payment id.
505 505
 												 */
506
-												do_action( 'give_donation_details_tbody_before', $payment_id );
506
+												do_action('give_donation_details_tbody_before', $payment_id);
507 507
 
508 508
 												/**
509 509
 												 * Fires in donation details page, in the donation-information metabox, after the body elements.
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 												 *
515 515
 												 * @param int $payment_id Payment id.
516 516
 												 */
517
-												do_action( 'give_donation_details_tbody_after', $payment_id );
517
+												do_action('give_donation_details_tbody_after', $payment_id);
518 518
 												?>
519 519
 											</p>
520 520
 										</div>
@@ -534,59 +534,59 @@  discard block
 block discarded – undo
534 534
 							 *
535 535
 							 * @param int $payment_id Payment id.
536 536
 							 */
537
-							do_action( 'give_view_donation_details_donor_detail_before', $payment_id );
537
+							do_action('give_view_donation_details_donor_detail_before', $payment_id);
538 538
 							?>
539 539
 
540 540
 							<div id="give-donor-details" class="postbox">
541
-								<h3 class="hndle"><?php _e( 'Donor Details', 'give' ); ?></h3>
541
+								<h3 class="hndle"><?php _e('Donor Details', 'give'); ?></h3>
542 542
 
543 543
 								<div class="inside">
544 544
 
545
-									<?php $donor = new Give_Donor( $donor_id ); ?>
545
+									<?php $donor = new Give_Donor($donor_id); ?>
546 546
 
547 547
 									<div class="column-container donor-info">
548 548
 										<div class="column">
549 549
 											<p>
550
-												<strong><?php _e( 'Donor ID:', 'give' ); ?></strong><br>
550
+												<strong><?php _e('Donor ID:', 'give'); ?></strong><br>
551 551
 												<?php
552
-												if ( ! empty( $donor->id ) ) {
552
+												if ( ! empty($donor->id)) {
553 553
 													printf(
554 554
 														'<a href="%1$s">%2$s</a>',
555
-														admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ),
555
+														admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id),
556 556
 														$donor->id
557 557
 													);
558 558
 												}
559 559
 												?>
560
-												<span>(<a href="#new" class="give-payment-new-donor"><?php _e( 'Create New Donor', 'give' ); ?></a>)</span>
560
+												<span>(<a href="#new" class="give-payment-new-donor"><?php _e('Create New Donor', 'give'); ?></a>)</span>
561 561
 											</p>
562 562
 											<p>
563
-												<strong><?php _e( 'Donor Since:', 'give' ); ?></strong><br>
564
-												<?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?>
563
+												<strong><?php _e('Donor Since:', 'give'); ?></strong><br>
564
+												<?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?>
565 565
 											</p>
566 566
 										</div>
567 567
 										<div class="column">
568 568
 											<p>
569
-												<strong><?php _e( 'Donor Name:', 'give' ); ?></strong><br>
569
+												<strong><?php _e('Donor Name:', 'give'); ?></strong><br>
570 570
 												<?php
571
-												$donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' );
572
-												$donor_name         = give_get_donor_name_by( $donor_id, 'donor' );
571
+												$donor_billing_name = give_get_donor_name_by($payment_id, 'donation');
572
+												$donor_name         = give_get_donor_name_by($donor_id, 'donor');
573 573
 
574 574
 												// Check whether the donor name and WP_User name is same or not.
575
-												if ( sanitize_title( $donor_billing_name ) != sanitize_title( $donor_name ) ) {
576
-													echo $donor_billing_name . ' (<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id" ) ) . '">' . $donor_name . '</a>)';
575
+												if (sanitize_title($donor_billing_name) != sanitize_title($donor_name)) {
576
+													echo $donor_billing_name.' (<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$donor_id")).'">'.$donor_name.'</a>)';
577 577
 												} else {
578 578
 													echo $donor_name;
579 579
 												}
580 580
 												?>
581 581
 											</p>
582 582
 											<p>
583
-												<strong><?php _e( 'Donor Email:', 'give' ); ?></strong><br>
583
+												<strong><?php _e('Donor Email:', 'give'); ?></strong><br>
584 584
 												<?php echo $donor->email; ?>
585 585
 											</p>
586 586
 										</div>
587 587
 										<div class="column">
588 588
 											<p>
589
-												<strong><?php _e( 'Change Donor:', 'give' ); ?></strong><br>
589
+												<strong><?php _e('Change Donor:', 'give'); ?></strong><br>
590 590
 												<?php
591 591
 												echo Give()->html->donor_dropdown(
592 592
 													array(
@@ -597,9 +597,9 @@  discard block
 block discarded – undo
597 597
 												?>
598 598
 											</p>
599 599
 											<p>
600
-												<?php if ( ! empty( $company_name ) ) {
600
+												<?php if ( ! empty($company_name)) {
601 601
 													?>
602
-													<strong><?php esc_html_e( 'Company Name:', 'give' ); ?></strong><br>
602
+													<strong><?php esc_html_e('Company Name:', 'give'); ?></strong><br>
603 603
 													<?php
604 604
 													echo $company_name;
605 605
 												} ?>
@@ -610,19 +610,19 @@  discard block
 block discarded – undo
610 610
 									<div class="column-container new-donor" style="display: none">
611 611
 										<div class="column">
612 612
 											<p>
613
-												<label for="give-new-donor-first-name"><?php _e( 'New Donor First Name:', 'give' ); ?></label>
613
+												<label for="give-new-donor-first-name"><?php _e('New Donor First Name:', 'give'); ?></label>
614 614
 												<input id="give-new-donor-first-name" type="text" name="give-new-donor-first-name" value="" class="medium-text"/>
615 615
 											</p>
616 616
 										</div>
617 617
 										<div class="column">
618 618
 											<p>
619
-												<label for="give-new-donor-last-name"><?php _e( 'New Donor Last Name:', 'give' ); ?></label>
619
+												<label for="give-new-donor-last-name"><?php _e('New Donor Last Name:', 'give'); ?></label>
620 620
 												<input id="give-new-donor-last-name" type="text" name="give-new-donor-last-name" value="" class="medium-text"/>
621 621
 											</p>
622 622
 										</div>
623 623
 										<div class="column">
624 624
 											<p>
625
-												<label for="give-new-donor-email"><?php _e( 'New Donor Email:', 'give' ); ?></label>
625
+												<label for="give-new-donor-email"><?php _e('New Donor Email:', 'give'); ?></label>
626 626
 												<input id="give-new-donor-email" type="email" name="give-new-donor-email" value="" class="medium-text"/>
627 627
 											</p>
628 628
 										</div>
@@ -630,9 +630,9 @@  discard block
 block discarded – undo
630 630
 											<p>
631 631
 												<input type="hidden" name="give-current-donor" value="<?php echo $donor->id; ?>"/>
632 632
 												<input type="hidden" id="give-new-donor" name="give-new-donor" value="0"/>
633
-												<a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php _e( 'Cancel', 'give' ); ?></a>
633
+												<a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php _e('Cancel', 'give'); ?></a>
634 634
 												<br>
635
-												<em><?php _e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
635
+												<em><?php _e('Click "Save Donation" to create new donor.', 'give'); ?></em>
636 636
 											</p>
637 637
 										</div>
638 638
 									</div>
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 									 * @param array $payment_meta Payment meta.
648 648
 									 * @param array $user_info    User information.
649 649
 									 */
650
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
650
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
651 651
 
652 652
 									/**
653 653
 									 * Fires on the donation details page, in the donor-details metabox.
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 									 *
657 657
 									 * @param int $payment_id Payment id.
658 658
 									 */
659
-									do_action( 'give_payment_view_details', $payment_id );
659
+									do_action('give_payment_view_details', $payment_id);
660 660
 									?>
661 661
 
662 662
 								</div>
@@ -672,11 +672,11 @@  discard block
 block discarded – undo
672 672
 							 *
673 673
 							 * @param int $payment_id Payment id.
674 674
 							 */
675
-							do_action( 'give_view_donation_details_billing_before', $payment_id );
675
+							do_action('give_view_donation_details_billing_before', $payment_id);
676 676
 							?>
677 677
 
678 678
 							<div id="give-billing-details" class="postbox">
679
-								<h3 class="hndle"><?php _e( 'Billing Address', 'give' ); ?></h3>
679
+								<h3 class="hndle"><?php _e('Billing Address', 'give'); ?></h3>
680 680
 
681 681
 								<div class="inside">
682 682
 
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
 											<div class="data column-container">
687 687
 
688 688
 												<?php
689
-												$address['country'] = ( ! empty( $address['country'] ) ? $address['country'] : give_get_country() );
689
+												$address['country'] = ( ! empty($address['country']) ? $address['country'] : give_get_country());
690 690
 
691
-												$address['state'] = ( ! empty( $address['state'] ) ? $address['state'] : '' );
691
+												$address['state'] = ( ! empty($address['state']) ? $address['state'] : '');
692 692
 
693 693
 												// Get the country list that does not have any states init.
694 694
 												$no_states_country = give_no_states_country_list();
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 
697 697
 												<div class="row">
698 698
 													<div id="give-order-address-country-wrap">
699
-														<label class="order-data-address-line"><?php _e( 'Country:', 'give' ); ?></label>
699
+														<label class="order-data-address-line"><?php _e('Country:', 'give'); ?></label>
700 700
 														<?php
701 701
 														echo Give()->html->select(
702 702
 															array(
@@ -706,8 +706,8 @@  discard block
 block discarded – undo
706 706
 																'show_option_all'  => false,
707 707
 																'show_option_none' => false,
708 708
 																'chosen'           => true,
709
-																'placeholder'      => esc_attr__( 'Select a country', 'give' ),
710
-																'data'             => array( 'search-type' => 'no_ajax' ),
709
+																'placeholder'      => esc_attr__('Select a country', 'give'),
710
+																'data'             => array('search-type' => 'no_ajax'),
711 711
 															)
712 712
 														);
713 713
 														?>
@@ -716,35 +716,35 @@  discard block
 block discarded – undo
716 716
 
717 717
 												<div class="row">
718 718
 													<div class="give-wrap-address-line1">
719
-														<label for="give-payment-address-line1" class="order-data-address"><?php _e( 'Address 1:', 'give' ); ?></label>
720
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
719
+														<label for="give-payment-address-line1" class="order-data-address"><?php _e('Address 1:', 'give'); ?></label>
720
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
721 721
 													</div>
722 722
 												</div>
723 723
 
724 724
 												<div class="row">
725 725
 													<div class="give-wrap-address-line2">
726
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php _e( 'Address 2:', 'give' ); ?></label>
727
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
726
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php _e('Address 2:', 'give'); ?></label>
727
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
728 728
 													</div>
729 729
 												</div>
730 730
 
731 731
 												<div class="row">
732 732
 													<div class="give-wrap-address-city">
733
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
734
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
733
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
734
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
735 735
 													</div>
736 736
 												</div>
737 737
 
738 738
 												<?php
739
-												$state_exists = ( ! empty( $address['country'] ) && array_key_exists( $address['country'], $no_states_country ) ? true : false );
739
+												$state_exists = ( ! empty($address['country']) && array_key_exists($address['country'], $no_states_country) ? true : false);
740 740
 												?>
741 741
 												<div class="row">
742
-													<div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-state">
743
-														<div id="give-order-address-state-wrap" class="<?php echo( ! empty( $state_exists ) ? 'give-hidden' : '' ); ?>">
744
-															<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province / County:', 'give' ); ?></label>
742
+													<div class="<?php echo( ! empty($state_exists) ? 'column-full' : 'column'); ?> give-column give-column-state">
743
+														<div id="give-order-address-state-wrap" class="<?php echo( ! empty($state_exists) ? 'give-hidden' : ''); ?>">
744
+															<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province / County:', 'give'); ?></label>
745 745
 															<?php
746
-															$states = give_get_states( $address['country'] );
747
-															if ( ! empty( $states ) ) {
746
+															$states = give_get_states($address['country']);
747
+															if ( ! empty($states)) {
748 748
 																echo Give()->html->select(
749 749
 																	array(
750 750
 																		'options'          => $states,
@@ -753,23 +753,23 @@  discard block
 block discarded – undo
753 753
 																		'show_option_all'  => false,
754 754
 																		'show_option_none' => false,
755 755
 																		'chosen'           => true,
756
-																		'placeholder'      => esc_attr__( 'Select a state', 'give' ),
757
-																		'data'             => array( 'search-type' => 'no_ajax' ),
756
+																		'placeholder'      => esc_attr__('Select a state', 'give'),
757
+																		'data'             => array('search-type' => 'no_ajax'),
758 758
 																	)
759 759
 																);
760 760
 															} else {
761 761
 																?>
762
-																<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
762
+																<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
763 763
 																<?php
764 764
 															}
765 765
 															?>
766 766
 														</div>
767 767
 													</div>
768 768
 
769
-													<div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-zip">
769
+													<div class="<?php echo( ! empty($state_exists) ? 'column-full' : 'column'); ?> give-column give-column-zip">
770 770
 														<div class="give-wrap-address-zip">
771
-															<label for="give-payment-address-zip" class="order-data-address-line"><?php _e( 'Zip / Postal Code:', 'give' ); ?></label>
772
-															<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
771
+															<label for="give-payment-address-zip" class="order-data-address-line"><?php _e('Zip / Postal Code:', 'give'); ?></label>
772
+															<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
773 773
 														</div>
774 774
 													</div>
775 775
 												</div>
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 									 *
789 789
 									 * @param int $payment_id Payment id.
790 790
 									 */
791
-									do_action( 'give_payment_billing_details', $payment_id );
791
+									do_action('give_payment_billing_details', $payment_id);
792 792
 									?>
793 793
 
794 794
 								</div>
@@ -804,34 +804,34 @@  discard block
 block discarded – undo
804 804
 							 *
805 805
 							 * @param int $payment_id Payment id.
806 806
 							 */
807
-							do_action( 'give_view_donation_details_billing_after', $payment_id );
807
+							do_action('give_view_donation_details_billing_after', $payment_id);
808 808
 							?>
809 809
 
810 810
 							<div id="give-payment-notes" class="postbox">
811
-								<h3 class="hndle"><?php _e( 'Donation Notes', 'give' ); ?></h3>
811
+								<h3 class="hndle"><?php _e('Donation Notes', 'give'); ?></h3>
812 812
 
813 813
 								<div class="inside">
814 814
 									<div id="give-payment-notes-inner">
815 815
 										<?php
816
-										$notes = give_get_payment_notes( $payment_id );
817
-										if ( ! empty( $notes ) ) {
816
+										$notes = give_get_payment_notes($payment_id);
817
+										if ( ! empty($notes)) {
818 818
 											$no_notes_display = ' style="display:none;"';
819
-											foreach ( $notes as $note ) :
819
+											foreach ($notes as $note) :
820 820
 
821
-												echo give_get_payment_note_html( $note, $payment_id );
821
+												echo give_get_payment_note_html($note, $payment_id);
822 822
 
823 823
 											endforeach;
824 824
 										} else {
825 825
 											$no_notes_display = '';
826 826
 										}
827 827
 
828
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>';
828
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>';
829 829
 										?>
830 830
 									</div>
831 831
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
832 832
 
833 833
 									<div class="give-clearfix">
834
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php _e( 'Add Note', 'give' ); ?></button>
834
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php _e('Add Note', 'give'); ?></button>
835 835
 									</div>
836 836
 
837 837
 								</div>
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 							 *
848 848
 							 * @param int $payment_id Payment id.
849 849
 							 */
850
-							do_action( 'give_view_donation_details_main_after', $payment_id );
850
+							do_action('give_view_donation_details_main_after', $payment_id);
851 851
 							?>
852 852
 
853 853
 						</div>
@@ -869,11 +869,11 @@  discard block
 block discarded – undo
869 869
 		 *
870 870
 		 * @param int $payment_id Payment id.
871 871
 		 */
872
-		do_action( 'give_view_donation_details_form_bottom', $payment_id );
872
+		do_action('give_view_donation_details_form_bottom', $payment_id);
873 873
 
874
-		wp_nonce_field( 'give_update_payment_details_nonce' );
874
+		wp_nonce_field('give_update_payment_details_nonce');
875 875
 		?>
876
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
876
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
877 877
 		<input type="hidden" name="give_action" value="update_payment_details"/>
878 878
 	</form>
879 879
 	<?php
@@ -884,6 +884,6 @@  discard block
 block discarded – undo
884 884
 	 *
885 885
 	 * @param int $payment_id Payment id.
886 886
 	 */
887
-	do_action( 'give_view_donation_details_after', $payment_id );
887
+	do_action('give_view_donation_details_after', $payment_id);
888 888
 	?>
889 889
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.