Completed
Push — master ( 316c10...cbdcdc )
by Devin
19:15
created
includes/admin/reporting/class-settings-export.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Export' ) ) :
16
+if ( ! class_exists('Give_Settings_Export')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Export.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'export';
46
-			$this->label = esc_html__( 'Export', 'give' );
46
+			$this->label = esc_html__('Export', 'give');
47 47
 
48
-			add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) );
50
-			add_action( 'give_admin_field_report_export', array( $this, 'render_report_export_field' ), 10, 2 );
48
+			add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-reports_settings_{$this->id}_page", array($this, 'output'));
50
+			add_action('give_admin_field_report_export', array($this, 'render_report_export_field'), 10, 2);
51 51
 
52 52
 			// Do not use main donor for this tab.
53
-			if( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-reports_open_form', '__return_empty_string' );
55
-				add_action( 'give-reports_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-reports_open_form', '__return_empty_string');
55
+				add_action('give-reports_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		 * @param  array $pages Lst of pages.
64 64
 		 * @return array
65 65
 		 */
66
-		public function add_settings_page( $pages ) {
67
-			$pages[ $this->id ] = $this->label;
66
+		public function add_settings_page($pages) {
67
+			$pages[$this->id] = $this->label;
68 68
 
69 69
 			return $pages;
70 70
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @param  array $settings
87 87
 			 */
88 88
 			$settings = apply_filters(
89
-				'give_get_settings_' . $this->id,
89
+				'give_get_settings_'.$this->id,
90 90
 				array(
91 91
 					array(
92 92
 						'id'   => 'give_reports_export',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					),
96 96
 					array(
97 97
 						'id'   => 'export',
98
-						'name' => esc_html__( 'Export', 'give' ),
98
+						'name' => esc_html__('Export', 'give'),
99 99
 						'type' => 'report_export',
100 100
 					),
101 101
 					array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		public function output() {
120 120
 			$settings = $this->get_settings();
121 121
 
122
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
122
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
123 123
 		}
124 124
 
125 125
 		/**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 		 * @param $field
132 132
 		 * @param $option_value
133 133
 		 */
134
-		public function render_report_export_field( $field, $option_value ) {
135
-			do_action( 'give_reports_tab_export');
134
+		public function render_report_export_field($field, $option_value) {
135
+			do_action('give_reports_tab_export');
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.
includes/admin/reporting/reports.php 1 patch
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 
18 18
 // Exit if accessed directly.
19
-if ( ! defined( 'ABSPATH' ) ) {
19
+if ( ! defined('ABSPATH')) {
20 20
 	exit;
21 21
 }
22 22
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
  * @return void
30 30
  */
31 31
 function give_reports_page() {
32
-	$current_page = admin_url( 'edit.php?post_type=give_forms&page=give-reports' );
33
-	$active_tab   = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'earnings';
32
+	$current_page = admin_url('edit.php?post_type=give_forms&page=give-reports');
33
+	$active_tab   = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'earnings';
34 34
 	$views        = give_reports_default_views();
35 35
 	?>
36 36
 	<div class="wrap give-settings-page">
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
 		<h1 class="screen-reader-text"><?php echo get_admin_page_title(); ?></h1>
39 39
 
40 40
 		<h2 class="nav-tab-wrapper">
41
-			<?php foreach ( $views as $tab => $label ) { ?>
42
-				<a href="<?php echo esc_url( add_query_arg( array(
41
+			<?php foreach ($views as $tab => $label) { ?>
42
+				<a href="<?php echo esc_url(add_query_arg(array(
43 43
 					'tab'              => $tab,
44 44
 					'settings-updated' => false,
45
-				), $current_page ) ); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php echo esc_html( $label ); ?></a>
45
+				), $current_page)); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php echo esc_html($label); ?></a>
46 46
 			<?php } ?>
47
-			<?php if ( current_user_can( 'export_give_reports' ) ) { ?>
48
-				<a href="<?php echo esc_url( add_query_arg( array(
47
+			<?php if (current_user_can('export_give_reports')) { ?>
48
+				<a href="<?php echo esc_url(add_query_arg(array(
49 49
 					'tab'              => 'export',
50 50
 					'settings-updated' => false,
51
-				), $current_page ) ); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php esc_html_e( 'Export', 'give' ); ?></a>
51
+				), $current_page)); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php esc_html_e('Export', 'give'); ?></a>
52 52
 			<?php }
53 53
 			/**
54 54
 			 * Fires in the report tabs.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			 *
58 58
 			 * @since 1.0
59 59
 			 */
60
-			do_action( 'give_reports_tabs' );
60
+			do_action('give_reports_tabs');
61 61
 			?>
62 62
 		</h2>
63 63
 
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 		 *
68 68
 		 * @since 1.0
69 69
 		 */
70
-		do_action( 'give_reports_page_top' );
70
+		do_action('give_reports_page_top');
71 71
 
72 72
 		// Set $active_tab prior to hook firing.
73
-		if ( in_array( $active_tab, array_keys( $views ) ) ) {
73
+		if (in_array($active_tab, array_keys($views))) {
74 74
 			$active_tab = 'reports';
75 75
 		}
76 76
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 		 *
80 80
 		 * @since 1.0
81 81
 		 */
82
-		do_action( "give_reports_tab_{$active_tab}" );
82
+		do_action("give_reports_tab_{$active_tab}");
83 83
 
84 84
 		/**
85 85
 		 * Fires after the report page.
86 86
 		 *
87 87
 		 * @since 1.0
88 88
 		 */
89
-		do_action( 'give_reports_page_bottom' );
89
+		do_action('give_reports_page_bottom');
90 90
 		?>
91 91
 	</div><!-- .wrap -->
92 92
 	<?php
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
  */
101 101
 function give_reports_default_views() {
102 102
 	$views = array(
103
-		'earnings' => esc_html__( 'Income', 'give' ),
104
-		'forms'    => esc_html__( 'Forms', 'give' ),
105
-		'donors'   => esc_html__( 'Donors', 'give' ),
106
-		'gateways' => esc_html__( 'Donation Methods', 'give' ),
103
+		'earnings' => esc_html__('Income', 'give'),
104
+		'forms'    => esc_html__('Forms', 'give'),
105
+		'donors'   => esc_html__('Donors', 'give'),
106
+		'gateways' => esc_html__('Donation Methods', 'give'),
107 107
 	);
108 108
 
109
-	$views = apply_filters( 'give_report_views', $views );
109
+	$views = apply_filters('give_report_views', $views);
110 110
 
111 111
 	return $views;
112 112
 }
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
  * @since 1.0
122 122
  * @return string $view Report View
123 123
  */
124
-function give_get_reporting_view( $default = 'earnings' ) {
124
+function give_get_reporting_view($default = 'earnings') {
125 125
 
126
-	if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) {
126
+	if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) {
127 127
 		$view = $default;
128 128
 	} else {
129 129
 		$view = $_GET['view'];
130 130
 	}
131 131
 
132
-	return apply_filters( 'give_get_reporting_view', $view );
132
+	return apply_filters('give_get_reporting_view', $view);
133 133
 }
134 134
 
135 135
 /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	$current_view = 'earnings';
143 143
 	$views        = give_reports_default_views();
144 144
 
145
-	if ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $views ) ) {
145
+	if (isset($_GET['tab']) && array_key_exists($_GET['tab'], $views)) {
146 146
 		$current_view = $_GET['tab'];
147 147
 	}
148 148
 
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 	 *
152 152
 	 * @since 1.0
153 153
 	 */
154
-	do_action( "give_reports_view_{$current_view}" );
154
+	do_action("give_reports_view_{$current_view}");
155 155
 }
156 156
 
157
-add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' );
157
+add_action('give_reports_tab_reports', 'give_reports_tab_reports');
158 158
 
159 159
 /**
160 160
  * Renders the Reports Page Views Drop Downs
@@ -164,19 +164,19 @@  discard block
 block discarded – undo
164 164
  */
165 165
 function give_report_views() {
166 166
 	$views        = give_reports_default_views();
167
-	$current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings';
167
+	$current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings';
168 168
 	/**
169 169
 	 * Fires before the report page actions form.
170 170
 	 *
171 171
 	 * @since 1.0
172 172
 	 */
173
-	do_action( 'give_report_view_actions_before' );
173
+	do_action('give_report_view_actions_before');
174 174
 	?>
175 175
 	<form id="give-reports-filter" method="get">
176 176
 		<select id="give-reports-view" name="view">
177
-			<option value="-1"><?php esc_html_e( 'Report Type', 'give' ); ?></option>
178
-			<?php foreach ( $views as $view_id => $label ) : ?>
179
-				<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
177
+			<option value="-1"><?php esc_html_e('Report Type', 'give'); ?></option>
178
+			<?php foreach ($views as $view_id => $label) : ?>
179
+				<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
180 180
 			<?php endforeach; ?>
181 181
 		</select>
182 182
 
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 		 *
189 189
 		 * @since 1.0
190 190
 		 */
191
-		do_action( 'give_report_view_actions' );
191
+		do_action('give_report_view_actions');
192 192
 		?>
193 193
 
194 194
 		<input type="hidden" name="post_type" value="give_forms"/>
195 195
 		<input type="hidden" name="page" value="give-reports"/>
196
-		<?php submit_button( esc_html__( 'Show', 'give' ), 'secondary', 'submit', false ); ?>
196
+		<?php submit_button(esc_html__('Show', 'give'), 'secondary', 'submit', false); ?>
197 197
 	</form>
198 198
 	<?php
199 199
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 *
202 202
 	 * @since 1.0
203 203
 	 */
204
-	do_action( 'give_report_view_actions_after' );
204
+	do_action('give_report_view_actions_after');
205 205
 }
206 206
 
207 207
 /**
@@ -214,18 +214,18 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function give_reports_forms_table() {
216 216
 
217
-	if ( isset( $_GET['form-id'] ) ) {
217
+	if (isset($_GET['form-id'])) {
218 218
 		return;
219 219
 	}
220 220
 
221
-	include( dirname( __FILE__ ) . '/class-form-reports-table.php' );
221
+	include(dirname(__FILE__).'/class-form-reports-table.php');
222 222
 
223 223
 	$give_table = new Give_Form_Reports_Table();
224 224
 	$give_table->prepare_items();
225 225
 	$give_table->display();
226 226
 }
227 227
 
228
-add_action( 'give_reports_view_forms', 'give_reports_forms_table' );
228
+add_action('give_reports_view_forms', 'give_reports_forms_table');
229 229
 
230 230
 /**
231 231
  * Renders the detailed report for a specific give form
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
  * @return void
235 235
  */
236 236
 function give_reports_form_details() {
237
-	if ( ! isset( $_GET['form-id'] ) ) {
237
+	if ( ! isset($_GET['form-id'])) {
238 238
 		return;
239 239
 	}
240 240
 	?>
241 241
 	<div class="tablenav top reports-forms-details-wrap">
242 242
 		<div class="actions bulkactions">
243
-			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e( 'Go Back', 'give' ); ?></button>
243
+			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e('Go Back', 'give'); ?></button>
244 244
 		</div>
245 245
 	</div>
246 246
 	<?php
247
-	give_reports_graph_of_form( absint( $_GET['form-id'] ) );
247
+	give_reports_graph_of_form(absint($_GET['form-id']));
248 248
 }
249 249
 
250
-add_action( 'give_reports_view_forms', 'give_reports_form_details' );
250
+add_action('give_reports_view_forms', 'give_reports_form_details');
251 251
 
252 252
 /**
253 253
  * Renders the Reports Donors Table
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
  * @return void
259 259
  */
260 260
 function give_reports_donors_table() {
261
-	include( dirname( __FILE__ ) . '/class-donor-reports-table.php' );
261
+	include(dirname(__FILE__).'/class-donor-reports-table.php');
262 262
 
263 263
 	$give_table = new Give_Donor_Reports_Table();
264 264
 	$give_table->prepare_items();
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 		 *
271 271
 		 * @since 1.0
272 272
 		 */
273
-		do_action( 'give_logs_donors_table_top' );
273
+		do_action('give_logs_donors_table_top');
274 274
 		?>
275 275
 		<form id="give-donors-filter" method="get">
276 276
 			<?php
277
-			$give_table->search_box( esc_html__( 'Search', 'give' ), 'give-donors' );
277
+			$give_table->search_box(esc_html__('Search', 'give'), 'give-donors');
278 278
 			$give_table->display();
279 279
 			?>
280 280
 			<input type="hidden" name="post_type" value="give_forms"/>
@@ -287,13 +287,13 @@  discard block
 block discarded – undo
287 287
 		 *
288 288
 		 * @since 1.0
289 289
 		 */
290
-		do_action( 'give_logs_donors_table_bottom' );
290
+		do_action('give_logs_donors_table_bottom');
291 291
 		?>
292 292
 	</div>
293 293
 	<?php
294 294
 }
295 295
 
296
-add_action( 'give_reports_view_donors', 'give_reports_donors_table' );
296
+add_action('give_reports_view_donors', 'give_reports_donors_table');
297 297
 
298 298
 
299 299
 /**
@@ -305,14 +305,14 @@  discard block
 block discarded – undo
305 305
  * @return void
306 306
  */
307 307
 function give_reports_gateways_table() {
308
-	include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' );
308
+	include(dirname(__FILE__).'/class-gateways-reports-table.php');
309 309
 
310 310
 	$give_table = new Give_Gateawy_Reports_Table();
311 311
 	$give_table->prepare_items();
312 312
 	$give_table->display();
313 313
 }
314 314
 
315
-add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' );
315
+add_action('give_reports_view_gateways', 'give_reports_gateways_table');
316 316
 
317 317
 
318 318
 /**
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
 function give_reports_earnings() {
325 325
 	?>
326 326
 	<div class="tablenav top reports-table-nav">
327
-		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Income Report', 'give' ); ?></span></h3>
327
+		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Income Report', 'give'); ?></span></h3>
328 328
 	</div>
329 329
 	<?php
330 330
 	give_reports_graph();
331 331
 }
332 332
 
333
-add_action( 'give_reports_view_earnings', 'give_reports_earnings' );
333
+add_action('give_reports_view_earnings', 'give_reports_earnings');
334 334
 
335 335
 
336 336
 /**
@@ -351,14 +351,14 @@  discard block
 block discarded – undo
351 351
 				 *
352 352
 				 * @since 1.0
353 353
 				 */
354
-				do_action( 'give_reports_tab_export_content_top' );
354
+				do_action('give_reports_tab_export_content_top');
355 355
 				?>
356 356
 
357 357
 				<table class="widefat export-options-table give-table">
358 358
 					<thead>
359 359
 						<tr>
360
-							<th scope="col"><?php esc_html_e( 'Export Type', 'give' ); ?></th>
361
-							<th scope="col"><?php esc_html_e( 'Export Options', 'give' ); ?></th>
360
+							<th scope="col"><?php esc_html_e('Export Type', 'give'); ?></th>
361
+							<th scope="col"><?php esc_html_e('Export Options', 'give'); ?></th>
362 362
 						</tr>
363 363
 					</thead>
364 364
 					<tbody>
@@ -370,42 +370,42 @@  discard block
 block discarded – undo
370 370
 						 *
371 371
 						 * @since 1.0
372 372
 						 */
373
-						do_action( 'give_reports_tab_export_table_top' );
373
+						do_action('give_reports_tab_export_table_top');
374 374
 						?>
375 375
 						<tr class="give-export-pdf-sales-earnings">
376 376
 							<td scope="row" class="row-title">
377
-								<h3><span><?php esc_html_e( 'Export PDF of Donations and Income', 'give' ); ?></span>
377
+								<h3><span><?php esc_html_e('Export PDF of Donations and Income', 'give'); ?></span>
378 378
 								</h3>
379
-								<p><?php esc_html_e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
379
+								<p><?php esc_html_e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
380 380
 							</td>
381 381
 							<td>
382
-								<a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"><?php esc_html_e( 'Generate PDF', 'give' ); ?></a>
382
+								<a class="button" href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>"><?php esc_html_e('Generate PDF', 'give'); ?></a>
383 383
 							</td>
384 384
 						</tr>
385 385
 						<tr class="alternate give-export-sales-earnings">
386 386
 							<td scope="row" class="row-title">
387
-								<h3><span><?php esc_html_e( 'Export Income and Donation Stats', 'give' ); ?></span></h3>
388
-								<p><?php esc_html_e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
387
+								<h3><span><?php esc_html_e('Export Income and Donation Stats', 'give'); ?></span></h3>
388
+								<p><?php esc_html_e('Download a CSV of income and donations over time.', 'give'); ?></p>
389 389
 							</td>
390 390
 							<td>
391 391
 								<form method="post">
392 392
 									<?php
393 393
 									printf(
394 394
 									/* translators: 1: start date dropdown 2: end date dropdown */
395
-										esc_html__( '%1$s to %2$s', 'give' ),
396
-										Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ),
397
-										Give()->html->year_dropdown( 'end_year' ) . ' ' . Give()->html->month_dropdown( 'end_month' )
395
+										esc_html__('%1$s to %2$s', 'give'),
396
+										Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'),
397
+										Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month')
398 398
 									);
399 399
 									?>
400 400
 									<input type="hidden" name="give-action" value="earnings_export"/>
401
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
401
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
402 402
 								</form>
403 403
 							</td>
404 404
 						</tr>
405 405
 						<tr class="give-export-payment-history">
406 406
 							<td scope="row" class="row-title">
407
-								<h3><span><?php esc_html_e( 'Export Donation History', 'give' ); ?></span></h3>
408
-								<p><?php esc_html_e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
407
+								<h3><span><?php esc_html_e('Export Donation History', 'give'); ?></span></h3>
408
+								<p><?php esc_html_e('Download a CSV of all donations recorded.', 'give'); ?></p>
409 409
 							</td>
410 410
 							<td>
411 411
 								<form id="give-export-payments" class="give-export-form" method="post">
@@ -413,27 +413,27 @@  discard block
 block discarded – undo
413 413
 									$args = array(
414 414
 										'id'          => 'give-payment-export-start',
415 415
 										'name'        => 'start',
416
-										'placeholder' => esc_attr__( 'Start date', 'give' ),
416
+										'placeholder' => esc_attr__('Start date', 'give'),
417 417
 									);
418
-									echo Give()->html->date_field( $args ); ?>
418
+									echo Give()->html->date_field($args); ?>
419 419
 									<?php
420 420
 									$args = array(
421 421
 										'id'          => 'give-payment-export-end',
422 422
 										'name'        => 'end',
423
-										'placeholder' => esc_attr__( 'End date', 'give' ),
423
+										'placeholder' => esc_attr__('End date', 'give'),
424 424
 									);
425
-									echo Give()->html->date_field( $args ); ?>
425
+									echo Give()->html->date_field($args); ?>
426 426
 									<select name="status">
427
-										<option value="any"><?php esc_html_e( 'All Statuses', 'give' ); ?></option>
427
+										<option value="any"><?php esc_html_e('All Statuses', 'give'); ?></option>
428 428
 										<?php
429 429
 										$statuses = give_get_payment_statuses();
430
-										foreach ( $statuses as $status => $label ) {
431
-											echo '<option value="' . $status . '">' . $label . '</option>';
430
+										foreach ($statuses as $status => $label) {
431
+											echo '<option value="'.$status.'">'.$label.'</option>';
432 432
 										}
433 433
 										?>
434 434
 									</select>
435 435
 									<?php
436
-									if ( give_is_setting_enabled( give_get_option( 'categories' ) ) ) {
436
+									if (give_is_setting_enabled(give_get_option('categories'))) {
437 437
 										echo Give()->html->category_dropdown(
438 438
 											'give_forms_categories[]',
439 439
 											0,
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
 												'multiple'        => true,
444 444
 												'selected'        => array(),
445 445
 												'show_option_all' => false,
446
-												'placeholder'     => __( 'Choose one or more from categories', 'give' ),
446
+												'placeholder'     => __('Choose one or more from categories', 'give'),
447 447
 											)
448 448
 										);
449 449
 										$add_break = true;
450 450
 									}
451 451
 
452
-									if ( give_is_setting_enabled( give_get_option( 'tags' ) ) ) {
452
+									if (give_is_setting_enabled(give_get_option('tags'))) {
453 453
 										echo Give()->html->tags_dropdown(
454 454
 											'give_forms_tags[]',
455 455
 											0,
@@ -459,17 +459,17 @@  discard block
 block discarded – undo
459 459
 												'multiple'        => true,
460 460
 												'selected'        => array(),
461 461
 												'show_option_all' => false,
462
-												'placeholder'     => __( 'Choose one or more from tags', 'give' ),
462
+												'placeholder'     => __('Choose one or more from tags', 'give'),
463 463
 											)
464 464
 										);
465 465
 										$add_break = true;
466 466
 									}
467 467
 
468
-									wp_nonce_field( 'give_ajax_export', 'give_ajax_export' );
468
+									wp_nonce_field('give_ajax_export', 'give_ajax_export');
469 469
 									?>
470 470
 									<input type="hidden" name="give-export-class" value="Give_Batch_Payments_Export"/>
471 471
 									<span>
472
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
472
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
473 473
 									<span class="spinner"></span>
474 474
 								</span>
475 475
 								</form>
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 						</tr>
478 478
 						<tr class="alternate give-export-donors">
479 479
 							<td scope="row" class="row-title">
480
-								<h3><span><?php esc_html_e( 'Export Donors in CSV', 'give' ); ?></span></h3>
481
-								<p><?php esc_html_e( 'Download an export of donors for all donation forms or only those who have given to a particular form.', 'give' ); ?></p>
480
+								<h3><span><?php esc_html_e('Export Donors in CSV', 'give'); ?></span></h3>
481
+								<p><?php esc_html_e('Download an export of donors for all donation forms or only those who have given to a particular form.', 'give'); ?></p>
482 482
 							</td>
483 483
 							<td>
484 484
 								<form method="post" id="give_donor_export" class="give-export-form">
@@ -489,46 +489,46 @@  discard block
 block discarded – undo
489 489
 										'id'     => 'give_customer_export_form',
490 490
 										'chosen' => true,
491 491
 									);
492
-									echo Give()->html->forms_dropdown( $args ); ?>
492
+									echo Give()->html->forms_dropdown($args); ?>
493 493
 
494
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
494
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
495 495
 
496 496
 									<div id="export-donor-options-wrap" class="give-clearfix">
497
-										<p><?php esc_html_e( 'Export Columns:', 'give' ); ?></p>
497
+										<p><?php esc_html_e('Export Columns:', 'give'); ?></p>
498 498
 										<ul id="give-export-option-ul">
499 499
 											<li>
500
-												<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e( 'Name', 'give' ); ?>
500
+												<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e('Name', 'give'); ?>
501 501
 												</label>
502 502
 											</li>
503 503
 											<li>
504
-												<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e( 'Email', 'give' ); ?>
504
+												<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e('Email', 'give'); ?>
505 505
 												</label>
506 506
 											</li>
507 507
 											<li>
508
-												<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e( 'Address', 'give' ); ?>
508
+												<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e('Address', 'give'); ?>
509 509
 												</label>
510 510
 											</li>
511 511
 											<li>
512
-												<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e( 'User ID', 'give' ); ?>
512
+												<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e('User ID', 'give'); ?>
513 513
 												</label>
514 514
 											</li>
515 515
 											<li>
516
-												<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e( 'First Donation Date', 'give' ); ?>
516
+												<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e('First Donation Date', 'give'); ?>
517 517
 												</label>
518 518
 											</li>
519 519
 											<li>
520
-												<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e( 'Number of Donations', 'give' ); ?>
520
+												<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e('Number of Donations', 'give'); ?>
521 521
 												</label>
522 522
 											</li>
523 523
 											<li>
524
-												<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e( 'Total Donated', 'give' ); ?>
524
+												<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e('Total Donated', 'give'); ?>
525 525
 												</label>
526 526
 											</li>
527 527
 										</ul>
528 528
 									</div>
529
-									<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
529
+									<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
530 530
 									<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
531
-									<input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid( 'give_' ); ?>"/>
531
+									<input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid('give_'); ?>"/>
532 532
 									<input type="hidden" name="give_action" value="email_export"/>
533 533
 								</form>
534 534
 							</td>
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 						 *
542 542
 						 * @since 1.0
543 543
 						 */
544
-						do_action( 'give_reports_tab_export_table_bottom' );
544
+						do_action('give_reports_tab_export_table_bottom');
545 545
 						?>
546 546
 					</tbody>
547 547
 				</table>
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 				 *
553 553
 				 * @since 1.0
554 554
 				 */
555
-				do_action( 'give_reports_tab_export_content_bottom' );
555
+				do_action('give_reports_tab_export_content_bottom');
556 556
 				?>
557 557
 
558 558
 			</div>
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 	<?php
564 564
 }
565 565
 
566
-add_action( 'give_reports_tab_export', 'give_reports_tab_export' );
566
+add_action('give_reports_tab_export', 'give_reports_tab_export');
567 567
 
568 568
 /**
569 569
  * Renders the Reports page
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
  */
574 574
 function give_reports_tab_logs() {
575 575
 
576
-	require( GIVE_PLUGIN_DIR . 'includes/admin/reporting/logs.php' );
576
+	require(GIVE_PLUGIN_DIR.'includes/admin/reporting/logs.php');
577 577
 
578 578
 	// Get current section.
579 579
 	$current_section = $_GET['section'] = give_get_current_setting_section();
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 	 *
584 584
 	 * @since 1.0
585 585
 	 */
586
-	do_action( "give_logs_view_{$current_section}" );
586
+	do_action("give_logs_view_{$current_section}");
587 587
 }
588 588
 
589 589
 /**
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
  */
595 595
 function give_estimated_monthly_stats() {
596 596
 
597
-	$estimated = get_transient( 'give_estimated_monthly_stats' );
597
+	$estimated = get_transient('give_estimated_monthly_stats');
598 598
 
599
-	if ( false === $estimated ) {
599
+	if (false === $estimated) {
600 600
 
601 601
 		$estimated = array(
602 602
 			'earnings' => 0,
@@ -605,22 +605,22 @@  discard block
 block discarded – undo
605 605
 
606 606
 		$stats = new Give_Payment_Stats;
607 607
 
608
-		$to_date_earnings = $stats->get_earnings( 0, 'this_month' );
609
-		$to_date_sales    = $stats->get_sales( 0, 'this_month' );
608
+		$to_date_earnings = $stats->get_earnings(0, 'this_month');
609
+		$to_date_sales    = $stats->get_sales(0, 'this_month');
610 610
 
611
-		$current_day   = date( 'd', current_time( 'timestamp' ) );
612
-		$current_month = date( 'n', current_time( 'timestamp' ) );
613
-		$current_year  = date( 'Y', current_time( 'timestamp' ) );
614
-		$days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year );
611
+		$current_day   = date('d', current_time('timestamp'));
612
+		$current_month = date('n', current_time('timestamp'));
613
+		$current_year  = date('Y', current_time('timestamp'));
614
+		$days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year);
615 615
 
616
-		$estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month;
617
-		$estimated['sales']    = ( $to_date_sales / $current_day ) * $days_in_month;
616
+		$estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month;
617
+		$estimated['sales']    = ($to_date_sales / $current_day) * $days_in_month;
618 618
 
619 619
 		// Cache for one day
620
-		set_transient( 'give_estimated_monthly_stats', $estimated, 86400 );
620
+		set_transient('give_estimated_monthly_stats', $estimated, 86400);
621 621
 	}
622 622
 
623
-	return maybe_unserialize( $estimated );
623
+	return maybe_unserialize($estimated);
624 624
 }
625 625
 
626 626
 // @TODO: After release 1.8 Donations -> Reports generates with new setting api, so we can remove some old code from this file.
Please login to merge, or discard this patch.
includes/admin/reporting/class-settings-gateways.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Gateways' ) ) :
16
+if ( ! class_exists('Give_Settings_Gateways')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Gateways.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'gateways';
46
-			$this->label = esc_html__( 'Donation Methods', 'give' );
46
+			$this->label = esc_html__('Donation Methods', 'give');
47 47
 
48
-			add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) );
50
-			add_action( 'give_admin_field_report_gateways', array( $this, 'render_report_gateways_field' ), 10, 2 );
48
+			add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-reports_settings_{$this->id}_page", array($this, 'output'));
50
+			add_action('give_admin_field_report_gateways', array($this, 'render_report_gateways_field'), 10, 2);
51 51
 
52 52
 			// Do not use main form for this tab.
53
-			if( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-reports_open_form', '__return_empty_string' );
55
-				add_action( 'give-reports_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-reports_open_form', '__return_empty_string');
55
+				add_action('give-reports_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		 * @param  array $pages Lst of pages.
64 64
 		 * @return array
65 65
 		 */
66
-		public function add_settings_page( $pages ) {
67
-			$pages[ $this->id ] = $this->label;
66
+		public function add_settings_page($pages) {
67
+			$pages[$this->id] = $this->label;
68 68
 
69 69
 			return $pages;
70 70
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @param  array $settings
87 87
 			 */
88 88
 			$settings = apply_filters(
89
-				'give_get_settings_' . $this->id,
89
+				'give_get_settings_'.$this->id,
90 90
 				array(
91 91
 					array(
92 92
 						'id'   => 'give_reports_gateways',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					),
96 96
 					array(
97 97
 						'id'   => 'gateways',
98
-						'name' => esc_html__( 'Gateways', 'give' ),
98
+						'name' => esc_html__('Gateways', 'give'),
99 99
 						'type' => 'report_gateways',
100 100
 					),
101 101
 					array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		public function output() {
120 120
 			$settings = $this->get_settings();
121 121
 
122
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
122
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
123 123
 		}
124 124
 
125 125
 		/**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 		 * @param $field
132 132
 		 * @param $option_value
133 133
 		 */
134
-		public function render_report_gateways_field( $field, $option_value ) {
135
-			do_action( 'give_reports_view_gateways');
134
+		public function render_report_gateways_field($field, $option_value) {
135
+			do_action('give_reports_view_gateways');
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.
includes/admin/reporting/class-settings-donors.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Donors' ) ) :
16
+if ( ! class_exists('Give_Settings_Donors')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Donors.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'donors';
46
-			$this->label = esc_html__( 'Donors', 'give' );
46
+			$this->label = esc_html__('Donors', 'give');
47 47
 
48
-			add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) );
50
-			add_action( 'give_admin_field_report_donors', array( $this, 'render_report_donors_field' ), 10, 2 );
48
+			add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-reports_settings_{$this->id}_page", array($this, 'output'));
50
+			add_action('give_admin_field_report_donors', array($this, 'render_report_donors_field'), 10, 2);
51 51
 
52 52
 			// Do not use main donor for this tab.
53
-			if( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-reports_open_form', '__return_empty_string' );
55
-				add_action( 'give-reports_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-reports_open_form', '__return_empty_string');
55
+				add_action('give-reports_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		 * @param  array $pages Lst of pages.
64 64
 		 * @return array
65 65
 		 */
66
-		public function add_settings_page( $pages ) {
67
-			$pages[ $this->id ] = $this->label;
66
+		public function add_settings_page($pages) {
67
+			$pages[$this->id] = $this->label;
68 68
 
69 69
 			return $pages;
70 70
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @param  array $settings
87 87
 			 */
88 88
 			$settings = apply_filters(
89
-				'give_get_settings_' . $this->id,
89
+				'give_get_settings_'.$this->id,
90 90
 				array(
91 91
 					array(
92 92
 						'id'   => 'give_reports_donors',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					),
96 96
 					array(
97 97
 						'id'   => 'donors',
98
-						'name' => esc_html__( 'Donors', 'give' ),
98
+						'name' => esc_html__('Donors', 'give'),
99 99
 						'type' => 'report_donors',
100 100
 					),
101 101
 					array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		public function output() {
120 120
 			$settings = $this->get_settings();
121 121
 
122
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
122
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
123 123
 		}
124 124
 
125 125
 		/**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 		 * @param $field
132 132
 		 * @param $option_value
133 133
 		 */
134
-		public function render_report_donors_field( $field, $option_value ) {
135
-			do_action( 'give_reports_view_donors');
134
+		public function render_report_donors_field($field, $option_value) {
135
+			do_action('give_reports_view_donors');
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.
includes/admin/reporting/class-settings-forms.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Forms' ) ) :
16
+if ( ! class_exists('Give_Settings_Forms')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Forms.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'forms';
46
-			$this->label = esc_html__( 'Forms', 'give' );
46
+			$this->label = esc_html__('Forms', 'give');
47 47
 
48
-			add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) );
50
-			add_action( 'give_admin_field_report_forms', array( $this, 'render_report_forms_field' ), 10, 2 );
48
+			add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-reports_settings_{$this->id}_page", array($this, 'output'));
50
+			add_action('give_admin_field_report_forms', array($this, 'render_report_forms_field'), 10, 2);
51 51
 
52 52
 			// Do not use main form for this tab.
53
-			if( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-reports_open_form', '__return_empty_string' );
55
-				add_action( 'give-reports_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-reports_open_form', '__return_empty_string');
55
+				add_action('give-reports_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		 * @param  array $pages Lst of pages.
64 64
 		 * @return array
65 65
 		 */
66
-		public function add_settings_page( $pages ) {
67
-			$pages[ $this->id ] = $this->label;
66
+		public function add_settings_page($pages) {
67
+			$pages[$this->id] = $this->label;
68 68
 
69 69
 			return $pages;
70 70
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @param  array $settings
87 87
 			 */
88 88
 			$settings = apply_filters(
89
-				'give_get_settings_' . $this->id,
89
+				'give_get_settings_'.$this->id,
90 90
 				array(
91 91
 					array(
92 92
 						'id'   => 'give_reports_forms',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					),
96 96
 					array(
97 97
 						'id'   => 'forms',
98
-						'name' => esc_html__( 'Forms', 'give' ),
98
+						'name' => esc_html__('Forms', 'give'),
99 99
 						'type' => 'report_forms',
100 100
 					),
101 101
 					array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		public function output() {
120 120
 			$settings = $this->get_settings();
121 121
 
122
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
122
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
123 123
 		}
124 124
 
125 125
 		/**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 		 * @param $field
132 132
 		 * @param $option_value
133 133
 		 */
134
-		public function render_report_forms_field( $field, $option_value ) {
135
-			do_action( 'give_reports_view_forms');
134
+		public function render_report_forms_field($field, $option_value) {
135
+			do_action('give_reports_view_forms');
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export.php 1 patch
Spacing   +34 added lines, -34 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
 
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 	 * @param $_step int The step to process
107 107
 	 * @since 1.5
108 108
 	 */
109
-	public function __construct( $_step = 1 ) {
109
+	public function __construct($_step = 1) {
110 110
 
111 111
 		$upload_dir       = wp_upload_dir();
112 112
 		$this->filetype   = '.csv';
113
-		$this->filename   = 'give-' . $this->export_type . $this->filetype;
114
-		$this->file       = trailingslashit( $upload_dir['basedir'] ) . $this->filename;
113
+		$this->filename   = 'give-'.$this->export_type.$this->filetype;
114
+		$this->file       = trailingslashit($upload_dir['basedir']).$this->filename;
115 115
 
116
-		if ( ! is_writeable( $upload_dir['basedir'] ) ) {
116
+		if ( ! is_writeable($upload_dir['basedir'])) {
117 117
 			$this->is_writable = false;
118 118
 		}
119 119
 
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function process_step() {
131 131
 
132
-		if ( ! $this->can_export() ) {
133
-			wp_die( esc_html__( 'You do not have permission to export data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
132
+		if ( ! $this->can_export()) {
133
+			wp_die(esc_html__('You do not have permission to export data.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
134 134
 		}
135 135
 
136
-		if( $this->step < 2 ) {
136
+		if ($this->step < 2) {
137 137
 
138 138
 			// Make sure we start with a fresh file on step 1
139
-			@unlink( $this->file );
139
+			@unlink($this->file);
140 140
 			$this->print_csv_cols();
141 141
 		}
142 142
 
143 143
 		$rows = $this->print_csv_rows();
144 144
 
145
-		if( $rows ) {
145
+		if ($rows) {
146 146
 			return true;
147 147
 		} else {
148 148
 			return false;
@@ -162,14 +162,14 @@  discard block
 block discarded – undo
162 162
 		$col_data = '';
163 163
 		$cols = $this->get_csv_cols();
164 164
 		$i = 1;
165
-		foreach( $cols as $col_id => $column ) {
166
-			$col_data .= '"' . addslashes( $column ) . '"';
167
-			$col_data .= $i == count( $cols ) ? '' : ',';
165
+		foreach ($cols as $col_id => $column) {
166
+			$col_data .= '"'.addslashes($column).'"';
167
+			$col_data .= $i == count($cols) ? '' : ',';
168 168
 			$i++;
169 169
 		}
170 170
 		$col_data .= "\r\n";
171 171
 
172
-		$this->stash_step_data( $col_data );
172
+		$this->stash_step_data($col_data);
173 173
 
174 174
 		return $col_data;
175 175
 
@@ -188,23 +188,23 @@  discard block
 block discarded – undo
188 188
 		$data     = $this->get_data();
189 189
 		$cols     = $this->get_csv_cols();
190 190
 
191
-		if( $data ) {
191
+		if ($data) {
192 192
 
193 193
 			// Output each row
194
-			foreach ( $data as $row ) {
194
+			foreach ($data as $row) {
195 195
 				$i = 1;
196
-				foreach ( $row as $col_id => $column ) {
196
+				foreach ($row as $col_id => $column) {
197 197
 					// Make sure the column is valid
198
-					if ( array_key_exists( $col_id, $cols ) ) {
199
-						$row_data .= '"' . addslashes( preg_replace( "/\"/","'", $column ) ) . '"';
200
-						$row_data .= $i == count( $cols ) ? '' : ',';
198
+					if (array_key_exists($col_id, $cols)) {
199
+						$row_data .= '"'.addslashes(preg_replace("/\"/", "'", $column)).'"';
200
+						$row_data .= $i == count($cols) ? '' : ',';
201 201
 						$i++;
202 202
 					}
203 203
 				}
204 204
 				$row_data .= "\r\n";
205 205
 			}
206 206
 
207
-			$this->stash_step_data( $row_data );
207
+			$this->stash_step_data($row_data);
208 208
 
209 209
 			return $row_data;
210 210
 		}
@@ -232,18 +232,18 @@  discard block
 block discarded – undo
232 232
 
233 233
 		$file = '';
234 234
 
235
-		if ( @file_exists( $this->file ) ) {
235
+		if (@file_exists($this->file)) {
236 236
 
237
-			if ( ! is_writeable( $this->file ) ) {
237
+			if ( ! is_writeable($this->file)) {
238 238
 				$this->is_writable = false;
239 239
 			}
240 240
 
241
-			$file = @file_get_contents( $this->file );
241
+			$file = @file_get_contents($this->file);
242 242
 
243 243
 		} else {
244 244
 
245
-			@file_put_contents( $this->file, '' );
246
-			@chmod( $this->file, 0664 );
245
+			@file_put_contents($this->file, '');
246
+			@chmod($this->file, 0664);
247 247
 
248 248
 		}
249 249
 
@@ -257,18 +257,18 @@  discard block
 block discarded – undo
257 257
 	 * @param $data string The data to add to the file
258 258
 	 * @return void
259 259
 	 */
260
-	protected function stash_step_data( $data = '' ) {
260
+	protected function stash_step_data($data = '') {
261 261
 
262 262
 		$file = $this->get_file();
263 263
 		$file .= $data;
264
-		@file_put_contents( $this->file, $file );
264
+		@file_put_contents($this->file, $file);
265 265
 
266 266
 		// If we have no rows after this step, mark it as an empty export
267
-		$file_rows    = file( $this->file, FILE_SKIP_EMPTY_LINES);
267
+		$file_rows    = file($this->file, FILE_SKIP_EMPTY_LINES);
268 268
 		$default_cols = $this->get_csv_cols();
269
-		$default_cols = empty( $default_cols ) ? 0 : 1;
269
+		$default_cols = empty($default_cols) ? 0 : 1;
270 270
 
271
-		$this->is_empty = count( $file_rows ) == $default_cols ? true : false;
271
+		$this->is_empty = count($file_rows) == $default_cols ? true : false;
272 272
 
273 273
 	}
274 274
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
 		$file = $this->get_file();
288 288
 
289
-		@unlink( $this->file );
289
+		@unlink($this->file);
290 290
 
291 291
 		echo $file;
292 292
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		 *
296 296
 		 * @since 1.8
297 297
 		 */
298
-		do_action( 'give_file_export_complete', $_REQUEST );
298
+		do_action('give_file_export_complete', $_REQUEST);
299 299
 
300 300
 		give_die();
301 301
 	}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	 * @since 1.5
307 307
 	 * @param array $request The Form Data passed into the batch processing
308 308
 	 */
309
-	public function set_properties( $request ) {}
309
+	public function set_properties($request) {}
310 310
 
311 311
 	/**
312 312
 	 * Allow for prefetching of data for the remainder of the exporter
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-customers.php 1 patch
Spacing   +75 added lines, -75 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
 
@@ -62,26 +62,26 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @param array $request The Form Data passed into the batch processing
64 64
 	 */
65
-	public function set_properties( $request ) {
65
+	public function set_properties($request) {
66 66
 
67 67
 		// Set data from form submission
68
-		if ( isset( $_POST['form'] ) ) {
69
-			parse_str( $_POST['form'], $this->data );
68
+		if (isset($_POST['form'])) {
69
+			parse_str($_POST['form'], $this->data);
70 70
 		}
71 71
 
72 72
 		$this->form = $this->data['forms'];
73 73
 
74 74
 		// Setup donor ids cache.
75
-		if( ! empty( $this->form ) ) {
75
+		if ( ! empty($this->form)) {
76 76
 			// Cache donor ids to output unique list of donor.
77
-			$this->query_id = give_clean( $_REQUEST['give_export_option']['query_id'] );
78
-			if( ! ( $this->donor_ids = get_transient( $this->query_id ) ) ) {
77
+			$this->query_id = give_clean($_REQUEST['give_export_option']['query_id']);
78
+			if ( ! ($this->donor_ids = get_transient($this->query_id))) {
79 79
 				$this->donor_ids = array();
80
-				set_transient( $this->query_id, $this->donor_ids, HOUR_IN_SECONDS );
80
+				set_transient($this->query_id, $this->donor_ids, HOUR_IN_SECONDS);
81 81
 			}
82 82
 		}
83 83
 
84
-		$this->price_id = ! empty( $request['give_price_option'] ) && 0 !== $request['give_price_option'] ? absint( $request['give_price_option'] ) : null;
84
+		$this->price_id = ! empty($request['give_price_option']) && 0 !== $request['give_price_option'] ? absint($request['give_price_option']) : null;
85 85
 
86 86
 	}
87 87
 
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 
97 97
 		$cols = array();
98 98
 
99
-		$columns = isset( $this->data['give_export_option'] ) ? $this->data['give_export_option'] : array();
99
+		$columns = isset($this->data['give_export_option']) ? $this->data['give_export_option'] : array();
100 100
 
101 101
 		// We need columns.
102
-		if ( empty( $columns ) ) {
102
+		if (empty($columns)) {
103 103
 			return false;
104 104
 		}
105 105
 
106
-		$cols = $this->get_cols( $columns );
106
+		$cols = $this->get_cols($columns);
107 107
 
108 108
 		return $cols;
109 109
 	}
@@ -115,38 +115,38 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @return array
117 117
 	 */
118
-	private function get_cols( $columns ) {
118
+	private function get_cols($columns) {
119 119
 
120 120
 		$cols = array();
121 121
 
122
-		foreach ( $columns as $key => $value ) {
122
+		foreach ($columns as $key => $value) {
123 123
 
124
-			switch ( $key ) {
124
+			switch ($key) {
125 125
 				case 'full_name' :
126
-					$cols['full_name'] = esc_html__( 'Full Name', 'give' );
126
+					$cols['full_name'] = esc_html__('Full Name', 'give');
127 127
 					break;
128 128
 				case 'email' :
129
-					$cols['email'] = esc_html__( 'Email Address', 'give' );
129
+					$cols['email'] = esc_html__('Email Address', 'give');
130 130
 					break;
131 131
 				case 'address' :
132
-					$cols['address_line1']   = esc_html__( 'Address', 'give' );
133
-					$cols['address_line2']   = esc_html__( 'Address 2', 'give' );
134
-					$cols['address_city']    = esc_html__( 'City', 'give' );
135
-					$cols['address_state']   = esc_html__( 'State', 'give' );
136
-					$cols['address_zip']     = esc_html__( 'Zip', 'give' );
137
-					$cols['address_country'] = esc_html__( 'Country', 'give' );
132
+					$cols['address_line1']   = esc_html__('Address', 'give');
133
+					$cols['address_line2']   = esc_html__('Address 2', 'give');
134
+					$cols['address_city']    = esc_html__('City', 'give');
135
+					$cols['address_state']   = esc_html__('State', 'give');
136
+					$cols['address_zip']     = esc_html__('Zip', 'give');
137
+					$cols['address_country'] = esc_html__('Country', 'give');
138 138
 					break;
139 139
 				case 'userid' :
140
-					$cols['userid'] = esc_html__( 'User ID', 'give' );
140
+					$cols['userid'] = esc_html__('User ID', 'give');
141 141
 					break;
142 142
 				case 'date_first_donated' :
143
-					$cols['date_first_donated'] = esc_html__( 'First Donation Date', 'give' );
143
+					$cols['date_first_donated'] = esc_html__('First Donation Date', 'give');
144 144
 					break;
145 145
 				case 'donations' :
146
-					$cols['donations'] = esc_html__( 'Number of Donations', 'give' );
146
+					$cols['donations'] = esc_html__('Number of Donations', 'give');
147 147
 					break;
148 148
 				case 'donation_sum' :
149
-					$cols['donation_sum'] = esc_html__( 'Sum of Donations', 'give' );
149
+					$cols['donation_sum'] = esc_html__('Sum of Donations', 'give');
150 150
 					break;
151 151
 			}
152 152
 		}
@@ -169,20 +169,20 @@  discard block
 block discarded – undo
169 169
 
170 170
 		$i = 0;
171 171
 
172
-		if ( ! empty( $this->form ) ) {
172
+		if ( ! empty($this->form)) {
173 173
 
174 174
 			// Export donors of a specific product
175 175
 			global $give_logs;
176 176
 
177 177
 			$args = array(
178
-				'post_parent'    => absint( $this->form ),
178
+				'post_parent'    => absint($this->form),
179 179
 				'log_type'       => 'sale',
180 180
 				'posts_per_page' => 30,
181 181
 				'paged'          => $this->step,
182 182
 			);
183 183
 
184 184
 			// Check for price option
185
-			if ( null !== $this->price_id ) {
185
+			if (null !== $this->price_id) {
186 186
 				$args['meta_query'] = array(
187 187
 					array(
188 188
 						'key'   => '_give_log_price_id',
@@ -191,44 +191,44 @@  discard block
 block discarded – undo
191 191
 				);
192 192
 			}
193 193
 
194
-			$logs = $give_logs->get_connected_logs( $args );
194
+			$logs = $give_logs->get_connected_logs($args);
195 195
 
196
-			if ( $logs ) {
197
-				foreach ( $logs as $log ) {
198
-					$payment_id = get_post_meta( $log->ID, '_give_log_payment_id', true );
199
-					$payment    = new Give_Payment( $payment_id );
196
+			if ($logs) {
197
+				foreach ($logs as $log) {
198
+					$payment_id = get_post_meta($log->ID, '_give_log_payment_id', true);
199
+					$payment    = new Give_Payment($payment_id);
200 200
 
201 201
 					// Continue if donor already included.
202
-					if( in_array( $payment->customer_id , $this->donor_ids ) ) {
202
+					if (in_array($payment->customer_id, $this->donor_ids)) {
203 203
 						continue;
204 204
 					}
205 205
 
206 206
 					$this->donor_ids[] = $payment->customer_id;
207 207
 
208
-					$donor      = Give()->customers->get_customer_by( 'id', $payment->customer_id );
209
-					$data[]     = $this->set_donor_data( $i, $data, $donor );
210
-					$i ++;
208
+					$donor      = Give()->customers->get_customer_by('id', $payment->customer_id);
209
+					$data[]     = $this->set_donor_data($i, $data, $donor);
210
+					$i++;
211 211
 				}
212 212
 
213 213
 				// Cache donor ids only if admin export donor for specific form.
214
-				set_transient( $this->query_id, array_unique( $this->donor_ids ), HOUR_IN_SECONDS );
214
+				set_transient($this->query_id, array_unique($this->donor_ids), HOUR_IN_SECONDS);
215 215
 			}
216 216
 		} else {
217 217
 
218 218
 			// Export all customers
219
-			$offset = 30 * ( $this->step - 1 );
220
-			$donors = Give()->customers->get_customers( array( 'number' => 30, 'offset' => $offset ) );
219
+			$offset = 30 * ($this->step - 1);
220
+			$donors = Give()->customers->get_customers(array('number' => 30, 'offset' => $offset));
221 221
 
222
-			foreach ( $donors as $donor ) {
222
+			foreach ($donors as $donor) {
223 223
 
224
-				$data[] = $this->set_donor_data( $i, $data, $donor );
225
-				$i ++;
224
+				$data[] = $this->set_donor_data($i, $data, $donor);
225
+				$i++;
226 226
 			}
227 227
 		}
228 228
 
229 229
 
230
-		$data = apply_filters( 'give_export_get_data', $data );
231
-		$data = apply_filters( "give_export_get_data_{$this->export_type}", $data );
230
+		$data = apply_filters('give_export_get_data', $data);
231
+		$data = apply_filters("give_export_get_data_{$this->export_type}", $data);
232 232
 
233 233
 		return $data;
234 234
 	}
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
 		$percentage = 0;
245 245
 
246 246
 		// We can't count the number when getting them for a specific form
247
-		if ( empty( $this->form ) ) {
247
+		if (empty($this->form)) {
248 248
 
249 249
 			$total = Give()->customers->count();
250 250
 
251
-			if ( $total > 0 ) {
251
+			if ($total > 0) {
252 252
 
253
-				$percentage = ( ( 30 * $this->step ) / $total ) * 100;
253
+				$percentage = ((30 * $this->step) / $total) * 100;
254 254
 
255 255
 			}
256 256
 		}
257 257
 
258
-		if ( $percentage > 100 ) {
258
+		if ($percentage > 100) {
259 259
 			$percentage = 100;
260 260
 		}
261 261
 
@@ -271,46 +271,46 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 * @return mixed
273 273
 	 */
274
-	private function set_donor_data( $i, $data, $donor ) {
274
+	private function set_donor_data($i, $data, $donor) {
275 275
 
276 276
 		$columns = $this->csv_cols();
277 277
 
278 278
 		// Set address variable
279 279
 		$address = '';
280
-		if ( isset( $donor->user_id ) && $donor->user_id > 0 ) {
281
-			$address = give_get_donor_address( $donor->user_id );
280
+		if (isset($donor->user_id) && $donor->user_id > 0) {
281
+			$address = give_get_donor_address($donor->user_id);
282 282
 		}
283 283
 
284 284
 		// Set columns
285
-		if ( ! empty( $columns['full_name'] ) ) {
286
-			$data[ $i ]['full_name'] = $donor->name;
285
+		if ( ! empty($columns['full_name'])) {
286
+			$data[$i]['full_name'] = $donor->name;
287 287
 		}
288
-		if ( ! empty( $columns['email'] ) ) {
289
-			$data[ $i ]['email'] = $donor->email;
288
+		if ( ! empty($columns['email'])) {
289
+			$data[$i]['email'] = $donor->email;
290 290
 		}
291
-		if ( ! empty( $columns['address_line1'] ) ) {
292
-
293
-			$data[ $i ]['address_line1']   = isset( $address['line1'] ) ? $address['line1'] : '';
294
-			$data[ $i ]['address_line2']   = isset( $address['line2'] ) ? $address['line2'] : '';
295
-			$data[ $i ]['address_city']    = isset( $address['city'] ) ? $address['city'] : '';
296
-			$data[ $i ]['address_state']   = isset( $address['state'] ) ? $address['state'] : '';
297
-			$data[ $i ]['address_zip']     = isset( $address['zip'] ) ? $address['zip'] : '';
298
-			$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';
291
+		if ( ! empty($columns['address_line1'])) {
292
+
293
+			$data[$i]['address_line1']   = isset($address['line1']) ? $address['line1'] : '';
294
+			$data[$i]['address_line2']   = isset($address['line2']) ? $address['line2'] : '';
295
+			$data[$i]['address_city']    = isset($address['city']) ? $address['city'] : '';
296
+			$data[$i]['address_state']   = isset($address['state']) ? $address['state'] : '';
297
+			$data[$i]['address_zip']     = isset($address['zip']) ? $address['zip'] : '';
298
+			$data[$i]['address_country'] = isset($address['country']) ? $address['country'] : '';
299 299
 		}
300
-		if ( ! empty( $columns['userid'] ) ) {
301
-			$data[ $i ]['userid'] = ! empty( $donor->user_id ) ? $donor->user_id : '';
300
+		if ( ! empty($columns['userid'])) {
301
+			$data[$i]['userid'] = ! empty($donor->user_id) ? $donor->user_id : '';
302 302
 		}
303
-		if ( ! empty( $columns['date_first_donated'] ) ) {
304
-			$data[ $i ]['date_first_donated'] = date_i18n( give_date_format(), strtotime( $donor->date_created ) );
303
+		if ( ! empty($columns['date_first_donated'])) {
304
+			$data[$i]['date_first_donated'] = date_i18n(give_date_format(), strtotime($donor->date_created));
305 305
 		}
306
-		if ( ! empty( $columns['donations'] ) ) {
307
-			$data[ $i ]['donations'] = $donor->purchase_count;
306
+		if ( ! empty($columns['donations'])) {
307
+			$data[$i]['donations'] = $donor->purchase_count;
308 308
 		}
309
-		if ( ! empty( $columns['donation_sum'] ) ) {
310
-			$data[ $i ]['donation_sum'] = give_format_amount( $donor->purchase_value );
309
+		if ( ! empty($columns['donation_sum'])) {
310
+			$data[$i]['donation_sum'] = give_format_amount($donor->purchase_value);
311 311
 		}
312 312
 
313
-		return $data[ $i ];
313
+		return $data[$i];
314 314
 
315 315
 	}
316 316
 
Please login to merge, or discard this patch.
includes/admin/reporting/export/export-actions.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @license     https://opensource.org/licenses/gpl-license GNU Public License
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_process_batch_export_form() {
24 24
 
25
-	if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
26
-		wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
25
+	if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) {
26
+		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
27 27
 	}
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31 31
 	/**
32 32
 	 * Fires before batch export.
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param string $class Export class.
37 37
 	 */
38
-	do_action( 'give_batch_export_class_include', $_REQUEST['class'] );
38
+	do_action('give_batch_export_class_include', $_REQUEST['class']);
39 39
 
40 40
 	$export = new $_REQUEST['class'];
41 41
 	$export->export();
42 42
 
43 43
 }
44 44
 
45
-add_action( 'give_form_batch_export', 'give_process_batch_export_form' );
45
+add_action('give_form_batch_export', 'give_process_batch_export_form');
46 46
 
47 47
 /**
48 48
  * Exports earnings for a specified time period
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
  * @return void
54 54
  */
55 55
 function give_export_earnings() {
56
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php';
56
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php';
57 57
 
58 58
 	$earnings_export = new Give_Earnings_Export();
59 59
 
60 60
 	$earnings_export->export();
61 61
 }
62 62
 
63
-add_action( 'give_earnings_export', 'give_export_earnings' );
63
+add_action('give_earnings_export', 'give_export_earnings');
64 64
 
65 65
 
66 66
 /**
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
  * @return void
74 74
  */
75 75
 function give_export_all_customers() {
76
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php';
76
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-customers.php';
77 77
 
78 78
 	$customer_export = new Give_Donors_Export();
79 79
 
80 80
 	$customer_export->export();
81 81
 }
82 82
 
83
-add_action( 'give_email_export', 'give_export_all_customers' );
83
+add_action('give_email_export', 'give_export_all_customers');
84 84
 
85 85
 /**
86 86
  * Add a hook allowing extensions to register a hook on the batch export process
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
  * @return void
90 90
  */
91 91
 function give_register_batch_exporters() {
92
-	if ( is_admin() ) {
92
+	if (is_admin()) {
93 93
 		/**
94 94
 		 * Fires in the admin, while plugins loaded.
95 95
 		 *
@@ -99,21 +99,21 @@  discard block
 block discarded – undo
99 99
 		 *
100 100
 		 * @param string $class Export class.
101 101
 		 */
102
-		do_action( 'give_register_batch_exporter' );
102
+		do_action('give_register_batch_exporter');
103 103
 	}
104 104
 }
105 105
 
106
-add_action( 'plugins_loaded', 'give_register_batch_exporters' );
106
+add_action('plugins_loaded', 'give_register_batch_exporters');
107 107
 
108 108
 /**
109 109
  * Register the payments batch exporter
110 110
  * @since  1.5
111 111
  */
112 112
 function give_register_payments_batch_export() {
113
-	add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 );
113
+	add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1);
114 114
 }
115 115
 
116
-add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 );
116
+add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10);
117 117
 
118 118
 /**
119 119
  * Loads the payments batch process if needed
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return void
126 126
  */
127
-function give_include_payments_batch_processor( $class ) {
127
+function give_include_payments_batch_processor($class) {
128 128
 
129
-	if ( 'Give_Batch_Payments_Export' === $class ) {
130
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php';
129
+	if ('Give_Batch_Payments_Export' === $class) {
130
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php';
131 131
 	}
132 132
 
133 133
 }
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
  * @since  1.5.2
138 138
  */
139 139
 function give_register_customers_batch_export() {
140
-	add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 );
140
+	add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1);
141 141
 }
142 142
 
143
-add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 );
143
+add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10);
144 144
 
145 145
 /**
146 146
  * Loads the customers batch process if needed
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
  *
152 152
  * @return void
153 153
  */
154
-function give_include_customers_batch_processor( $class ) {
154
+function give_include_customers_batch_processor($class) {
155 155
 
156
-	if ( 'Give_Batch_Customers_Export' === $class ) {
157
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php';
156
+	if ('Give_Batch_Customers_Export' === $class) {
157
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php';
158 158
 	}
159 159
 
160 160
 }
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
  * @since  1.5
166 166
  */
167 167
 function give_register_forms_batch_export() {
168
-	add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 );
168
+	add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1);
169 169
 }
170 170
 
171
-add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 );
171
+add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10);
172 172
 
173 173
 /**
174 174
  * Loads the file downloads batch process if needed
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
  *
180 180
  * @return void
181 181
  */
182
-function give_include_forms_batch_processor( $class ) {
182
+function give_include_forms_batch_processor($class) {
183 183
 
184
-	if ( 'Give_Batch_Forms_Export' === $class ) {
185
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
184
+	if ('Give_Batch_Forms_Export' === $class) {
185
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php';
186 186
 	}
187 187
 
188 188
 }
189 189
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reporting/class-settings-earnings.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Earnings' ) ) :
16
+if ( ! class_exists('Give_Settings_Earnings')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Earnings.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'earnings';
46
-			$this->label = esc_html__( 'Income', 'give' );
46
+			$this->label = esc_html__('Income', 'give');
47 47
 
48
-			add_filter( 'give-reports_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-reports_settings_{$this->id}_page", array( $this, 'output' ) );
50
-			add_action( 'give_admin_field_report_earnings', array( $this, 'render_report_earnings_field' ), 10, 2 );
48
+			add_filter('give-reports_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-reports_settings_{$this->id}_page", array($this, 'output'));
50
+			add_action('give_admin_field_report_earnings', array($this, 'render_report_earnings_field'), 10, 2);
51 51
 
52 52
 			// Do not use main form for this tab.
53
-			if( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-reports_open_form', '__return_empty_string' );
55
-				add_action( 'give-reports_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-reports_open_form', '__return_empty_string');
55
+				add_action('give-reports_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 		 * @param  array $pages Lst of pages.
64 64
 		 * @return array
65 65
 		 */
66
-		public function add_settings_page( $pages ) {
67
-			$pages[ $this->id ] = $this->label;
66
+		public function add_settings_page($pages) {
67
+			$pages[$this->id] = $this->label;
68 68
 
69 69
 			return $pages;
70 70
 		}
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @param  array $settings
87 87
 			 */
88 88
 			$settings = apply_filters(
89
-				'give_get_settings_' . $this->id,
89
+				'give_get_settings_'.$this->id,
90 90
 				array(
91 91
 					array(
92 92
 						'id'   => 'give_tools_earnings',
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					),
96 96
 					array(
97 97
 						'id'   => 'earnings',
98
-						'name' => esc_html__( 'Income', 'give' ),
98
+						'name' => esc_html__('Income', 'give'),
99 99
 						'type' => 'report_earnings',
100 100
 					),
101 101
 					array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		public function output() {
120 120
 			$settings = $this->get_settings();
121 121
 
122
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
122
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
123 123
 		}
124 124
 
125 125
 		/**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 		 * @param $field
132 132
 		 * @param $option_value
133 133
 		 */
134
-		public function render_report_earnings_field( $field, $option_value ) {
135
-			do_action( 'give_reports_view_earnings' );
134
+		public function render_report_earnings_field($field, $option_value) {
135
+			do_action('give_reports_view_earnings');
136 136
 		}
137 137
 	}
138 138
 
Please login to merge, or discard this patch.