Completed
Pull Request — master (#552)
by Devin
16:50
created
includes/admin/reporting/reports.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Reports Page
4
- *
5
- * Language Changes from EDD:
6
- * 1. "Report Type" stays
7
- * 2. "Earnings" changes to "Income"
8
- * 3. "Donors" changes to "Donors"
9
- * 4. "Payment Method" stays.
10
- *
11
- * @package     Give
12
- * @subpackage  Admin/Reports
13
- * @copyright   Copyright (c) 2015, WordImpress
14
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
15
- * @since       1.0
16
- */
3
+	 * Admin Reports Page
4
+	 *
5
+	 * Language Changes from EDD:
6
+	 * 1. "Report Type" stays
7
+	 * 2. "Earnings" changes to "Income"
8
+	 * 3. "Donors" changes to "Donors"
9
+	 * 4. "Payment Method" stays.
10
+	 *
11
+	 * @package     Give
12
+	 * @subpackage  Admin/Reports
13
+	 * @copyright   Copyright (c) 2015, WordImpress
14
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
15
+	 * @since       1.0
16
+	 */
17 17
 
18 18
 // Exit if accessed directly
19 19
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 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
 
@@ -32,32 +32,32 @@  discard block
 block discarded – undo
32 32
 function give_reports_page() {
33 33
 	global $give_options;
34 34
 
35
-	$current_page = admin_url( 'edit.php?post_type=give_forms&page=give-reports' );
36
-	$active_tab   = isset( $_GET['tab'] ) ? $_GET['tab'] : 'reports';
35
+	$current_page = admin_url('edit.php?post_type=give_forms&page=give-reports');
36
+	$active_tab   = isset($_GET['tab']) ? $_GET['tab'] : 'reports';
37 37
 	?>
38 38
 	<div class="wrap">
39 39
 		<h1 class="nav-tab-wrapper">
40
-			<a href="<?php echo esc_url( add_query_arg( array(
40
+			<a href="<?php echo esc_url(add_query_arg(array(
41 41
 				'tab'              => 'reports',
42 42
 				'settings-updated' => false
43
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Reports', 'give' ); ?></a>
44
-			<?php if ( current_user_can( 'export_give_reports' ) ) { ?>
45
-				<a href="<?php echo esc_url( add_query_arg( array(
43
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php _e('Reports', 'give'); ?></a>
44
+			<?php if (current_user_can('export_give_reports')) { ?>
45
+				<a href="<?php echo esc_url(add_query_arg(array(
46 46
 					'tab'              => 'export',
47 47
 					'settings-updated' => false
48
-				), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Export', 'give' ); ?></a>
48
+				), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php _e('Export', 'give'); ?></a>
49 49
 			<?php } ?>
50
-			<a href="<?php echo esc_url( add_query_arg( array(
50
+			<a href="<?php echo esc_url(add_query_arg(array(
51 51
 				'tab'              => 'logs',
52 52
 				'settings-updated' => false
53
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Logs', 'give' ); ?></a>
54
-			<?php do_action( 'give_reports_tabs' ); ?>
53
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php _e('Logs', 'give'); ?></a>
54
+			<?php do_action('give_reports_tabs'); ?>
55 55
 		</h1>
56 56
 
57 57
 		<?php
58
-		do_action( 'give_reports_page_top' );
59
-		do_action( 'give_reports_tab_' . $active_tab );
60
-		do_action( 'give_reports_page_bottom' );
58
+		do_action('give_reports_page_top');
59
+		do_action('give_reports_tab_'.$active_tab);
60
+		do_action('give_reports_page_bottom');
61 61
 		?>
62 62
 	</div><!-- .wrap -->
63 63
 	<?php
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
  */
72 72
 function give_reports_default_views() {
73 73
 	$views = array(
74
-		'earnings' => __( 'Income', 'give' ),
74
+		'earnings' => __('Income', 'give'),
75 75
 		'forms'    => give_get_forms_label_plural(),
76
-		'donors'   => __( 'Donors', 'give' ),
77
-		'gateways' => __( 'Payment Methods', 'give' )
76
+		'donors'   => __('Donors', 'give'),
77
+		'gateways' => __('Payment Methods', 'give')
78 78
 	);
79 79
 
80
-	$views = apply_filters( 'give_report_views', $views );
80
+	$views = apply_filters('give_report_views', $views);
81 81
 
82 82
 	return $views;
83 83
 }
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
  * @return string $view Report View
94 94
  *
95 95
  */
96
-function give_get_reporting_view( $default = 'earnings' ) {
96
+function give_get_reporting_view($default = 'earnings') {
97 97
 
98
-	if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) {
98
+	if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) {
99 99
 		$view = $default;
100 100
 	} else {
101 101
 		$view = $_GET['view'];
102 102
 	}
103 103
 
104
-	return apply_filters( 'give_get_reporting_view', $view );
104
+	return apply_filters('give_get_reporting_view', $view);
105 105
 }
106 106
 
107 107
 /**
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
 	$current_view = 'earnings';
115 115
 	$views        = give_reports_default_views();
116 116
 
117
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) {
117
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $views)) {
118 118
 		$current_view = $_GET['view'];
119 119
 	}
120 120
 
121
-	do_action( 'give_reports_view_' . $current_view );
121
+	do_action('give_reports_view_'.$current_view);
122 122
 }
123 123
 
124
-add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' );
124
+add_action('give_reports_tab_reports', 'give_reports_tab_reports');
125 125
 
126 126
 /**
127 127
  * Renders the Reports Page Views Drop Downs
@@ -131,25 +131,25 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function give_report_views() {
133 133
 	$views        = give_reports_default_views();
134
-	$current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings';
135
-	do_action( 'give_report_view_actions_before' );
134
+	$current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings';
135
+	do_action('give_report_view_actions_before');
136 136
 	?>
137 137
 	<form id="give-reports-filter" method="get">
138 138
 		<select id="give-reports-view" name="view">
139
-			<option value="-1"><?php _e( 'Report Type', 'give' ); ?></option>
140
-			<?php foreach ( $views as $view_id => $label ) : ?>
141
-				<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
139
+			<option value="-1"><?php _e('Report Type', 'give'); ?></option>
140
+			<?php foreach ($views as $view_id => $label) : ?>
141
+				<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
142 142
 			<?php endforeach; ?>
143 143
 		</select>
144 144
 
145
-		<?php do_action( 'give_report_view_actions' ); ?>
145
+		<?php do_action('give_report_view_actions'); ?>
146 146
 
147 147
 		<input type="hidden" name="post_type" value="give_forms" />
148 148
 		<input type="hidden" name="page" value="give-reports" />
149
-		<?php submit_button( __( 'Show', 'give' ), 'secondary', 'submit', false ); ?>
149
+		<?php submit_button(__('Show', 'give'), 'secondary', 'submit', false); ?>
150 150
 	</form>
151 151
 	<?php
152
-	do_action( 'give_report_view_actions_after' );
152
+	do_action('give_report_view_actions_after');
153 153
 }
154 154
 
155 155
 /**
@@ -162,18 +162,18 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function give_reports_forms_table() {
164 164
 
165
-	if ( isset( $_GET['form-id'] ) ) {
165
+	if (isset($_GET['form-id'])) {
166 166
 		return;
167 167
 	}
168 168
 
169
-	include( dirname( __FILE__ ) . '/class-form-reports-table.php' );
169
+	include(dirname(__FILE__).'/class-form-reports-table.php');
170 170
 
171 171
 	$give_table = new Give_Form_Reports_Table();
172 172
 	$give_table->prepare_items();
173 173
 	$give_table->display();
174 174
 }
175 175
 
176
-add_action( 'give_reports_view_forms', 'give_reports_forms_table' );
176
+add_action('give_reports_view_forms', 'give_reports_forms_table');
177 177
 
178 178
 /**
179 179
  * Renders the detailed report for a specific give form
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
  * @return void
183 183
  */
184 184
 function give_reports_form_details() {
185
-	if ( ! isset( $_GET['form-id'] ) ) {
185
+	if ( ! isset($_GET['form-id'])) {
186 186
 		return;
187 187
 	}
188 188
 	?>
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
 		<div class="actions bulkactions">
191 191
 			<?php give_report_views(); ?>
192 192
 			&nbsp;
193
-			<button onclick="history.go(-1);" class="button-secondary"><?php _e( 'Go Back', 'give' ); ?></button>
193
+			<button onclick="history.go(-1);" class="button-secondary"><?php _e('Go Back', 'give'); ?></button>
194 194
 		</div>
195 195
 	</div>
196 196
 	<?php
197
-	give_reports_graph_of_form( absint( $_GET['form-id'] ) );
197
+	give_reports_graph_of_form(absint($_GET['form-id']));
198 198
 }
199 199
 
200
-add_action( 'give_reports_view_forms', 'give_reports_form_details' );
200
+add_action('give_reports_view_forms', 'give_reports_form_details');
201 201
 
202 202
 /**
203 203
  * Renders the Reports Donors Table
@@ -208,28 +208,28 @@  discard block
 block discarded – undo
208 208
  * @return void
209 209
  */
210 210
 function give_reports_donors_table() {
211
-	include( dirname( __FILE__ ) . '/class-donor-reports-table.php' );
211
+	include(dirname(__FILE__).'/class-donor-reports-table.php');
212 212
 
213 213
 	$give_table = new Give_Donor_Reports_Table();
214 214
 	$give_table->prepare_items();
215 215
 	?>
216 216
 	<div class="wrap give-reports-donors-wrap">
217
-		<?php do_action( 'give_logs_donors_table_top' ); ?>
218
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=donors' ); ?>">
217
+		<?php do_action('give_logs_donors_table_top'); ?>
218
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-reports&view=donors'); ?>">
219 219
 			<?php
220
-			$give_table->search_box( __( 'Search', 'give' ), 'give-donors' );
220
+			$give_table->search_box(__('Search', 'give'), 'give-donors');
221 221
 			$give_table->display();
222 222
 			?>
223 223
 			<input type="hidden" name="post_type" value="give_forms" />
224 224
 			<input type="hidden" name="page" value="give-reports" />
225 225
 			<input type="hidden" name="view" value="donors" />
226 226
 		</form>
227
-		<?php do_action( 'give_logs_donors_table_bottom' ); ?>
227
+		<?php do_action('give_logs_donors_table_bottom'); ?>
228 228
 	</div>
229 229
 	<?php
230 230
 }
231 231
 
232
-add_action( 'give_reports_view_donors', 'give_reports_donors_table' );
232
+add_action('give_reports_view_donors', 'give_reports_donors_table');
233 233
 
234 234
 
235 235
 /**
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
  * @return void
242 242
  */
243 243
 function give_reports_gateways_table() {
244
-	include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' );
244
+	include(dirname(__FILE__).'/class-gateways-reports-table.php');
245 245
 
246 246
 	$give_table = new Give_Gateawy_Reports_Table();
247 247
 	$give_table->prepare_items();
248 248
 	$give_table->display();
249 249
 }
250 250
 
251
-add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' );
251
+add_action('give_reports_view_gateways', 'give_reports_gateways_table');
252 252
 
253 253
 
254 254
 /**
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 function give_reports_earnings() {
261 261
 	?>
262 262
 	<div class="tablenav top reports-table-nav">
263
-		<h3 class="alignleft reports-earnings-title"><span><?php _e( 'Income Over Time', 'give' ); ?></span></h3>
263
+		<h3 class="alignleft reports-earnings-title"><span><?php _e('Income Over Time', 'give'); ?></span></h3>
264 264
 
265 265
 		<div class="alignright actions reports-views-wrap"><?php give_report_views(); ?></div>
266 266
 	</div>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	give_reports_graph();
269 269
 }
270 270
 
271
-add_action( 'give_reports_view_earnings', 'give_reports_earnings' );
271
+add_action('give_reports_view_earnings', 'give_reports_earnings');
272 272
 
273 273
 
274 274
 /**
@@ -283,51 +283,51 @@  discard block
 block discarded – undo
283 283
 		<div id="post-body">
284 284
 			<div id="post-body-content">
285 285
 
286
-				<?php do_action( 'give_reports_tab_export_content_top' ); ?>
286
+				<?php do_action('give_reports_tab_export_content_top'); ?>
287 287
 
288 288
 
289 289
 				<table class="widefat export-options-table give-table">
290 290
 					<thead>
291 291
 					<tr>
292
-						<th class="row-title"><?php _e( 'Export Type', 'give' ); ?></th>
293
-						<th><?php _e( 'Export Options', 'give' ); ?></th>
292
+						<th class="row-title"><?php _e('Export Type', 'give'); ?></th>
293
+						<th><?php _e('Export Options', 'give'); ?></th>
294 294
 					</tr>
295 295
 					</thead>
296 296
 					<tbody>
297
-					<?php do_action( 'give_reports_tab_export_table_top' ); ?>
297
+					<?php do_action('give_reports_tab_export_table_top'); ?>
298 298
 					<tr class="give-export-pdf-sales-earnings">
299 299
 						<td class="row-title">
300
-							<h3><span><?php _e( 'Export PDF of Donations and Income', 'give' ); ?></span></h3>
300
+							<h3><span><?php _e('Export PDF of Donations and Income', 'give'); ?></span></h3>
301 301
 
302
-							<p><?php _e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
302
+							<p><?php _e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
303 303
 						</td>
304 304
 						<td>
305
-							<a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"><?php _e( 'Generate PDF', 'give' ); ?></a>
305
+							<a class="button" href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>"><?php _e('Generate PDF', 'give'); ?></a>
306 306
 						</td>
307 307
 					</tr>
308 308
 					<tr class="alternate give-export-sales-earnings">
309 309
 						<td class="row-title">
310
-							<h3><span><?php _e( 'Export Income and Donation Stats', 'give' ); ?></span></h3>
310
+							<h3><span><?php _e('Export Income and Donation Stats', 'give'); ?></span></h3>
311 311
 
312
-							<p><?php _e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
312
+							<p><?php _e('Download a CSV of income and donations over time.', 'give'); ?></p>
313 313
 						</td>
314 314
 						<td>
315 315
 							<form method="post">
316
-								<?php echo Give()->html->year_dropdown( 'start_year' ); ?>
317
-								<?php echo Give()->html->month_dropdown( 'start_month' ); ?>
318
-								<?php echo _x( 'to', 'Date one to date two', 'give' ); ?>
319
-								<?php echo Give()->html->year_dropdown( 'end_year' ); ?>
320
-								<?php echo Give()->html->month_dropdown( 'end_month' ); ?>
316
+								<?php echo Give()->html->year_dropdown('start_year'); ?>
317
+								<?php echo Give()->html->month_dropdown('start_month'); ?>
318
+								<?php echo _x('to', 'Date one to date two', 'give'); ?>
319
+								<?php echo Give()->html->year_dropdown('end_year'); ?>
320
+								<?php echo Give()->html->month_dropdown('end_month'); ?>
321 321
 								<input type="hidden" name="give-action" value="earnings_export" />
322
-								<input type="submit" value="<?php _e( 'Generate CSV', 'give' ); ?>" class="button-secondary" />
322
+								<input type="submit" value="<?php _e('Generate CSV', 'give'); ?>" class="button-secondary" />
323 323
 							</form>
324 324
 						</td>
325 325
 					</tr>
326 326
 					<tr class="give-export-payment-history">
327 327
 						<td class="row-title">
328
-							<h3><span><?php _e( 'Export Donation History', 'give' ); ?></span></h3>
328
+							<h3><span><?php _e('Export Donation History', 'give'); ?></span></h3>
329 329
 
330
-							<p><?php _e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
330
+							<p><?php _e('Download a CSV of all donations recorded.', 'give'); ?></p>
331 331
 						</td>
332 332
 						<td>
333 333
 
@@ -335,57 +335,57 @@  discard block
 block discarded – undo
335 335
 								<?php echo Give()->html->year_dropdown(); ?>
336 336
 								<?php echo Give()->html->month_dropdown(); ?>
337 337
 								<select name="give_export_payment_status">
338
-									<option value="0"><?php _e( 'All Statuses', 'give' ); ?></option>
338
+									<option value="0"><?php _e('All Statuses', 'give'); ?></option>
339 339
 									<?php
340 340
 									$statuses = give_get_payment_statuses();
341
-									foreach ( $statuses as $status => $label ) {
342
-										echo '<option value="' . $status . '">' . $label . '</option>';
341
+									foreach ($statuses as $status => $label) {
342
+										echo '<option value="'.$status.'">'.$label.'</option>';
343 343
 									}
344 344
 									?>
345 345
 								</select>
346 346
 								<input type="hidden" name="give-action" value="payment_export" />
347
-								<input type="submit" value="<?php _e( 'Generate CSV', 'give' ); ?>" class="button-secondary" />
347
+								<input type="submit" value="<?php _e('Generate CSV', 'give'); ?>" class="button-secondary" />
348 348
 							</form>
349 349
 
350 350
 						</td>
351 351
 					</tr>
352 352
 					<tr class="alt give-export-donors">
353 353
 						<td class="row-title">
354
-							<h3><span><?php _e( 'Export Donors in CSV', 'give' ); ?></span></h3>
354
+							<h3><span><?php _e('Export Donors in CSV', 'give'); ?></span></h3>
355 355
 
356
-							<p><?php _e( 'Download a CSV of all donors\' emails. Optionally export only donors that have donated to a particular form. Note: if you have a large number of donors, exporting the donation stats may fail.', 'give' ); ?></p>
356
+							<p><?php _e('Download a CSV of all donors\' emails. Optionally export only donors that have donated to a particular form. Note: if you have a large number of donors, exporting the donation stats may fail.', 'give'); ?></p>
357 357
 						</td>
358 358
 						<td>
359 359
 							<form method="post" id="give_donor_export">
360 360
 								<select name="give_export_download" id="give_donor_export_download">
361
-									<option value="0"><?php printf( __( 'All %s', 'give' ), give_get_forms_label_plural() ); ?></option>
361
+									<option value="0"><?php printf(__('All %s', 'give'), give_get_forms_label_plural()); ?></option>
362 362
 									<?php
363
-									$forms = get_posts( array(
363
+									$forms = get_posts(array(
364 364
 										'post_type'      => 'give_forms',
365
-										'posts_per_page' => - 1
366
-									) );
367
-									if ( $forms ) {
368
-										foreach ( $forms as $form ) {
369
-											echo '<option value="' . $form->ID . '">' . get_the_title( $form->ID ) . '</option>';
365
+										'posts_per_page' => -1
366
+									));
367
+									if ($forms) {
368
+										foreach ($forms as $form) {
369
+											echo '<option value="'.$form->ID.'">'.get_the_title($form->ID).'</option>';
370 370
 										}
371 371
 									}
372 372
 									?>
373 373
 								</select>
374 374
 								<select name="give_export_option" id="give_donor_export_option">
375
-									<option value="emails"><?php _e( 'Emails', 'give' ); ?></option>
376
-									<option value="emails_and_names"><?php _e( 'Emails and Names', 'give' ); ?></option>
377
-									<option value="full"><?php _e( 'Emails, Names, and Purchase Stats', 'give' ); ?></option>
375
+									<option value="emails"><?php _e('Emails', 'give'); ?></option>
376
+									<option value="emails_and_names"><?php _e('Emails and Names', 'give'); ?></option>
377
+									<option value="full"><?php _e('Emails, Names, and Purchase Stats', 'give'); ?></option>
378 378
 								</select>
379 379
 								<input type="hidden" name="give-action" value="email_export" />
380
-								<input type="submit" value="<?php _e( 'Generate CSV', 'give' ); ?>" class="button-secondary" />
380
+								<input type="submit" value="<?php _e('Generate CSV', 'give'); ?>" class="button-secondary" />
381 381
 							</form>
382 382
 						</td>
383 383
 					</tr>
384
-					<?php do_action( 'give_reports_tab_export_table_bottom' ); ?>
384
+					<?php do_action('give_reports_tab_export_table_bottom'); ?>
385 385
 					</tbody>
386 386
 				</table>
387 387
 
388
-				<?php do_action( 'give_reports_tab_export_content_bottom' ); ?>
388
+				<?php do_action('give_reports_tab_export_content_bottom'); ?>
389 389
 
390 390
 			</div>
391 391
 			<!-- .post-body-content -->
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	<?php
396 396
 }
397 397
 
398
-add_action( 'give_reports_tab_export', 'give_reports_tab_export' );
398
+add_action('give_reports_tab_export', 'give_reports_tab_export');
399 399
 
400 400
 /**
401 401
  * Renders the Reports page
@@ -404,19 +404,19 @@  discard block
 block discarded – undo
404 404
  * @return void
405 405
  */
406 406
 function give_reports_tab_logs() {
407
-	require( GIVE_PLUGIN_DIR . 'includes/admin/reporting/logs.php' );
407
+	require(GIVE_PLUGIN_DIR.'includes/admin/reporting/logs.php');
408 408
 
409 409
 	$current_view = 'sales';
410 410
 	$log_views    = give_log_default_views();
411 411
 
412
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $log_views ) ) {
412
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $log_views)) {
413 413
 		$current_view = $_GET['view'];
414 414
 	}
415 415
 
416
-	do_action( 'give_logs_view_' . $current_view );
416
+	do_action('give_logs_view_'.$current_view);
417 417
 }
418 418
 
419
-add_action( 'give_reports_tab_logs', 'give_reports_tab_logs' );
419
+add_action('give_reports_tab_logs', 'give_reports_tab_logs');
420 420
 
421 421
 /**
422 422
  * Retrieves estimated monthly earnings and sales
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
  */
427 427
 function give_estimated_monthly_stats() {
428 428
 
429
-	$estimated = get_transient( 'give_estimated_monthly_stats' );
429
+	$estimated = get_transient('give_estimated_monthly_stats');
430 430
 
431
-	if ( false === $estimated ) {
431
+	if (false === $estimated) {
432 432
 
433 433
 		$estimated = array(
434 434
 			'earnings' => 0,
@@ -437,20 +437,20 @@  discard block
 block discarded – undo
437 437
 
438 438
 		$stats = new Give_Payment_Stats;
439 439
 
440
-		$to_date_earnings = $stats->get_earnings( 0, 'this_month' );
441
-		$to_date_sales    = $stats->get_sales( 0, 'this_month' );
440
+		$to_date_earnings = $stats->get_earnings(0, 'this_month');
441
+		$to_date_sales    = $stats->get_sales(0, 'this_month');
442 442
 
443
-		$current_day   = date( 'd', current_time( 'timestamp' ) );
444
-		$current_month = date( 'n', current_time( 'timestamp' ) );
445
-		$current_year  = date( 'Y', current_time( 'timestamp' ) );
446
-		$days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year );
443
+		$current_day   = date('d', current_time('timestamp'));
444
+		$current_month = date('n', current_time('timestamp'));
445
+		$current_year  = date('Y', current_time('timestamp'));
446
+		$days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year);
447 447
 
448
-		$estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month;
449
-		$estimated['sales']    = ( $to_date_sales / $current_day ) * $days_in_month;
448
+		$estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month;
449
+		$estimated['sales']    = ($to_date_sales / $current_day) * $days_in_month;
450 450
 
451 451
 		// Cache for one day
452
-		set_transient( 'give_estimated_monthly_stats', $estimated, 86400 );
452
+		set_transient('give_estimated_monthly_stats', $estimated, 86400);
453 453
 	}
454 454
 
455
-	return maybe_unserialize( $estimated );
455
+	return maybe_unserialize($estimated);
456 456
 }
Please login to merge, or discard this patch.
includes/admin/shortcodes/class-shortcode-button.php 2 patches
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @since       1.3.0
12 12
  */
13 13
 
14
-defined( 'ABSPATH' ) or exit;
14
+defined('ABSPATH') or exit;
15 15
 
16 16
 final class Give_Shortcode_Button {
17 17
 
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function __construct() {
29 29
 
30
-		if ( is_admin() ) {
31
-			add_filter( 'mce_external_plugins', array( $this, 'mce_external_plugins' ), 15 );
30
+		if (is_admin()) {
31
+			add_filter('mce_external_plugins', array($this, 'mce_external_plugins'), 15);
32 32
 
33
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ) );
34
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_localize_scripts' ), 13 );
35
-			add_action( 'media_buttons', array( $this, 'shortcode_button' ) );
33
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_assets'));
34
+			add_action('admin_enqueue_scripts', array($this, 'admin_localize_scripts'), 13);
35
+			add_action('media_buttons', array($this, 'shortcode_button'));
36 36
 		}
37 37
 
38
-		add_action( "wp_ajax_give_shortcode", array( $this, 'shortcode_ajax' ) );
39
-		add_action( "wp_ajax_nopriv_give_shortcode", array( $this, 'shortcode_ajax' ) );
38
+		add_action("wp_ajax_give_shortcode", array($this, 'shortcode_ajax'));
39
+		add_action("wp_ajax_nopriv_give_shortcode", array($this, 'shortcode_ajax'));
40 40
 	}
41 41
 
42 42
 	/**
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
 	 *
49 49
 	 * @since 1.0
50 50
 	 */
51
-	public function mce_external_plugins( $plugin_array ) {
51
+	public function mce_external_plugins($plugin_array) {
52 52
 
53
-		if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
53
+		if (current_user_can('edit_posts') && current_user_can('edit_pages')) {
54 54
 
55
-			$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
55
+			$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
56 56
 
57
-			$plugin_array['give_shortcode'] = GIVE_PLUGIN_URL . 'assets/js/admin/tinymce/mce-plugin' . $suffix . '.js';
57
+			$plugin_array['give_shortcode'] = GIVE_PLUGIN_URL.'assets/js/admin/tinymce/mce-plugin'.$suffix.'.js';
58 58
 		}
59 59
 
60 60
 		return $plugin_array;
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function admin_enqueue_assets() {
71 71
 
72
-		$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
72
+		$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
73 73
 
74 74
 		wp_enqueue_script(
75 75
 			'give_shortcode',
76
-			GIVE_PLUGIN_URL . 'assets/js/admin/admin-shortcodes' . $suffix . '.js',
77
-			array( 'jquery' ),
76
+			GIVE_PLUGIN_URL.'assets/js/admin/admin-shortcodes'.$suffix.'.js',
77
+			array('jquery'),
78 78
 			GIVE_VERSION,
79 79
 			true
80 80
 		);
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function admin_localize_scripts() {
91 91
 
92
-		if ( ! empty( self::$shortcodes ) ) {
92
+		if ( ! empty(self::$shortcodes)) {
93 93
 
94 94
 			$variables = array();
95 95
 
96
-			foreach ( self::$shortcodes as $shortcode => $values ) {
97
-				if ( ! empty( $values['required'] ) ) {
98
-					$variables[ $shortcode ] = $values['required'];
96
+			foreach (self::$shortcodes as $shortcode => $values) {
97
+				if ( ! empty($values['required'])) {
98
+					$variables[$shortcode] = $values['required'];
99 99
 				}
100 100
 			}
101 101
 
102
-			wp_localize_script( 'give_shortcode', 'scShortcodes', $variables );
102
+			wp_localize_script('give_shortcode', 'scShortcodes', $variables);
103 103
 		}
104 104
 	}
105 105
 
@@ -114,24 +114,24 @@  discard block
 block discarded – undo
114 114
 
115 115
 		global $pagenow, $wp_version;
116 116
 
117
-		$shortcode_button_pages = array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' );
117
+		$shortcode_button_pages = array('post.php', 'page.php', 'post-new.php', 'post-edit.php');
118 118
 		// Only run in admin post/page creation and edit screens
119
-		if ( in_array( $pagenow, $shortcode_button_pages )
120
-		     && apply_filters( 'give_shortcode_button_condition', true )
121
-		     && ! empty( self::$shortcodes )
119
+		if (in_array($pagenow, $shortcode_button_pages)
120
+		     && apply_filters('give_shortcode_button_condition', true)
121
+		     && ! empty(self::$shortcodes)
122 122
 		) {
123 123
 
124 124
 			$shortcodes = array();
125 125
 
126
-			foreach ( self::$shortcodes as $shortcode => $values ) {
126
+			foreach (self::$shortcodes as $shortcode => $values) {
127 127
 				/**
128 128
 				 * Filters the condition for including the current shortcode
129 129
 				 *
130 130
 				 * @since 1.0
131 131
 				 */
132
-				if ( apply_filters( sanitize_title( $shortcode ) . '_condition', true ) ) {
132
+				if (apply_filters(sanitize_title($shortcode).'_condition', true)) {
133 133
 
134
-					$shortcodes[ $shortcode ] = sprintf(
134
+					$shortcodes[$shortcode] = sprintf(
135 135
 						'<div class="sc-shortcode mce-menu-item give-shortcode-item-%1$s" data-shortcode="%s">%s</div>',
136 136
 						$shortcode,
137 137
 						$values['label'],
@@ -140,37 +140,37 @@  discard block
 block discarded – undo
140 140
 				}
141 141
 			}
142 142
 
143
-			if ( ! empty( $shortcodes ) ) {
143
+			if ( ! empty($shortcodes)) {
144 144
 
145 145
 				// check current WP version
146
-				$img = ( version_compare( $wp_version, '3.5', '<' ) )
147
-					? '<img src="' . GIVE_PLUGIN_URL . 'assets/images/give-media.png" />'
148
-					: '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url(' . give_svg_icons( 'give_grey' ) . ');"></span>';
146
+				$img = (version_compare($wp_version, '3.5', '<'))
147
+					? '<img src="'.GIVE_PLUGIN_URL.'assets/images/give-media.png" />'
148
+					: '<span class="wp-media-buttons-icon" id="give-media-button" style="background-image: url('.give_svg_icons('give_grey').');"></span>';
149 149
 
150
-				reset( $shortcodes );
150
+				reset($shortcodes);
151 151
 
152
-				if ( count( $shortcodes ) == 1 ) {
152
+				if (count($shortcodes) == 1) {
153 153
 
154
-					$shortcode = key( $shortcodes );
154
+					$shortcode = key($shortcodes);
155 155
 
156 156
 					printf(
157 157
 						'<button class="button sc-shortcode" data-shortcode="%s">%s</button>',
158 158
 						$shortcode,
159
-						sprintf( '%s %s %s',
159
+						sprintf('%s %s %s',
160 160
 							$img,
161
-							__( 'Insert', 'give' ),
162
-							self::$shortcodes[ $shortcode ]['label']
161
+							__('Insert', 'give'),
162
+							self::$shortcodes[$shortcode]['label']
163 163
 						)
164 164
 					);
165 165
 				} else {
166 166
 					printf(
167
-						'<div class="sc-wrap">' .
168
-						'<button class="button sc-button">%s %s</button>' .
169
-						'<div class="sc-menu mce-menu">%s</div>' .
167
+						'<div class="sc-wrap">'.
168
+						'<button class="button sc-button">%s %s</button>'.
169
+						'<div class="sc-menu mce-menu">%s</div>'.
170 170
 						'</div>',
171 171
 						$img,
172
-						__( 'Give Shortcodes', 'give' ),
173
-						implode( '', array_values( $shortcodes ) )
172
+						__('Give Shortcodes', 'give'),
173
+						implode('', array_values($shortcodes))
174 174
 					);
175 175
 				}
176 176
 			}
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
 	 */
187 187
 	public function shortcode_ajax() {
188 188
 
189
-		$shortcode = isset( $_POST['shortcode'] ) ? $_POST['shortcode'] : false;
189
+		$shortcode = isset($_POST['shortcode']) ? $_POST['shortcode'] : false;
190 190
 		$response  = false;
191 191
 
192
-		if ( $shortcode && array_key_exists( $shortcode, self::$shortcodes ) ) {
192
+		if ($shortcode && array_key_exists($shortcode, self::$shortcodes)) {
193 193
 
194
-			$data = self::$shortcodes[ $shortcode ];
194
+			$data = self::$shortcodes[$shortcode];
195 195
 
196
-			if ( ! empty( $data['errors'] ) ) {
197
-				$data['btn_okay'] = array( __( 'Okay', 'give' ) );
196
+			if ( ! empty($data['errors'])) {
197
+				$data['btn_okay'] = array(__('Okay', 'give'));
198 198
 			}
199 199
 
200 200
 			$response = array(
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
 			);
207 207
 		} else {
208 208
 			// todo: handle error
209
-			error_log( print_r( 'AJAX error!', 1 ) );
209
+			error_log(print_r('AJAX error!', 1));
210 210
 		}
211 211
 
212
-		wp_send_json( $response );
212
+		wp_send_json($response);
213 213
 	}
214 214
 }
215 215
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@
 block discarded – undo
117 117
 		$shortcode_button_pages = array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' );
118 118
 		// Only run in admin post/page creation and edit screens
119 119
 		if ( in_array( $pagenow, $shortcode_button_pages )
120
-		     && apply_filters( 'give_shortcode_button_condition', true )
121
-		     && ! empty( self::$shortcodes )
120
+			 && apply_filters( 'give_shortcode_button_condition', true )
121
+			 && ! empty( self::$shortcodes )
122 122
 		) {
123 123
 
124 124
 			$shortcodes = array();
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-donation-history.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_History extends Give_Shortcode_Generator {
15 15
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['label'] = __( 'Donation History', 'give' );
21
+		$this->shortcode['label'] = __('Donation History', 'give');
22 22
 
23
-		parent::__construct( 'donation_history' );
23
+		parent::__construct('donation_history');
24 24
 	}
25 25
 }
26 26
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-form.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Form extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title']   = __( 'Donation Form', 'give' );
22
-		$this->shortcode['label']   = __( 'Donation Form', 'give' );
21
+		$this->shortcode['title']   = __('Donation Form', 'give');
22
+		$this->shortcode['label']   = __('Donation Form', 'give');
23 23
 
24
-		parent::__construct( 'give_form' );
24
+		parent::__construct('give_form');
25 25
 	}
26 26
 
27 27
 	/**
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function define_fields() {
33 33
 
34
-		$create_form_link = sprintf( __( '%sClick here%s to create a new Donation Form.', 'give' ),
35
-			'<a href="' . admin_url( 'post-new.php?post_type=give_forms' ) . '">',
34
+		$create_form_link = sprintf(__('%sClick here%s to create a new Donation Form.', 'give'),
35
+			'<a href="'.admin_url('post-new.php?post_type=give_forms').'">',
36 36
 			'</a>'
37 37
 		);
38 38
 
@@ -43,68 +43,68 @@  discard block
 block discarded – undo
43 43
 					'post_type' => 'give_forms',
44 44
 				),
45 45
 				'name'        => 'id',
46
-				'tooltip'     => __( 'Select a Donation Form', 'give' ),
47
-				'placeholder' => sprintf( '– %s –', __( 'Select a Form', 'give' ) ),
46
+				'tooltip'     => __('Select a Donation Form', 'give'),
47
+				'placeholder' => sprintf('– %s –', __('Select a Form', 'give')),
48 48
 				'required'    => array(
49
-					'alert' => __( 'You must first select a Form!', 'give' ),
50
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ),
49
+					'alert' => __('You must first select a Form!', 'give'),
50
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link),
51 51
 				),
52 52
 			),
53 53
 			array(
54 54
 				'type' => 'container',
55
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional form settings', 'give' ) ),
55
+				'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional form settings', 'give')),
56 56
 			),
57 57
 			array(
58 58
 				'type'    => 'listbox',
59 59
 				'name'    => 'show_title',
60
-				'label'   => __( 'Show Title:', 'give' ),
61
-				'tooltip' => __( 'Do you want to display the form title?', 'give' ),
60
+				'label'   => __('Show Title:', 'give'),
61
+				'tooltip' => __('Do you want to display the form title?', 'give'),
62 62
 				'options' => array(
63
-					'true'  => __( 'Show', 'give' ),
64
-					'false' => __( 'Hide', 'give' ),
63
+					'true'  => __('Show', 'give'),
64
+					'false' => __('Hide', 'give'),
65 65
 				),
66 66
 			),
67 67
 			array(
68 68
 				'type'    => 'listbox',
69 69
 				'name'    => 'show_goal',
70
-				'label'   => __( 'Show Goal:', 'give' ),
71
-				'tooltip' => __( 'Do you want to display the donation goal?', 'give' ),
70
+				'label'   => __('Show Goal:', 'give'),
71
+				'tooltip' => __('Do you want to display the donation goal?', 'give'),
72 72
 				'options' => array(
73
-					'true'  => __( 'Show', 'give' ),
74
-					'false' => __( 'Hide', 'give' ),
73
+					'true'  => __('Show', 'give'),
74
+					'false' => __('Hide', 'give'),
75 75
 				),
76 76
 			),
77 77
 			array(
78 78
 				'type'    => 'listbox',
79 79
 				'name'    => 'show_content',
80 80
 				'minWidth' => 240,
81
-				'label'   => __( 'Display Content:', 'give' ),
82
-				'tooltip' => __( 'Do you want to display the form content?', 'give' ),
81
+				'label'   => __('Display Content:', 'give'),
82
+				'tooltip' => __('Do you want to display the form content?', 'give'),
83 83
 				'options' => array(
84
-					'none'  => __( 'No Content', 'give' ),
85
-					'above' => __( 'Display above the form fields', 'give' ),
86
-					'below' => __( 'Display below the form fields', 'give' ),
84
+					'none'  => __('No Content', 'give'),
85
+					'above' => __('Display above the form fields', 'give'),
86
+					'below' => __('Display below the form fields', 'give'),
87 87
 				),
88 88
 			),
89 89
 			array(
90 90
 				'type'    => 'listbox',
91 91
 				'name'    => 'display_style',
92
-				'label'   => __( 'Payment Fields:', 'give' ),
93
-				'tooltip' => __( 'How would you like to display payment information?', 'give' ),
92
+				'label'   => __('Payment Fields:', 'give'),
93
+				'tooltip' => __('How would you like to display payment information?', 'give'),
94 94
 				'options' => array(
95
-					'onpage' => __( 'Show on Page', 'give' ),
96
-					'reveal' => __( 'Reveal Upon Click', 'give' ),
97
-					'modal'  => __( 'Modal Window Upon Click', 'give' ),
95
+					'onpage' => __('Show on Page', 'give'),
96
+					'reveal' => __('Reveal Upon Click', 'give'),
97
+					'modal'  => __('Modal Window Upon Click', 'give'),
98 98
 				),
99 99
 			),
100 100
 			array(
101 101
 				'type'    => 'listbox',
102 102
 				'name'    => 'float_labels',
103
-				'label'   => __( 'Floating Labels:', 'give' ),
104
-				'tooltip' => __( 'Override the default floating labels setting for this form?', 'give' ),
103
+				'label'   => __('Floating Labels:', 'give'),
104
+				'tooltip' => __('Override the default floating labels setting for this form?', 'give'),
105 105
 				'options' => array(
106
-					'enabled'  => __( 'Enabled', 'give' ),
107
-					'disabled' => __( 'Disabled', 'give' ),
106
+					'enabled'  => __('Enabled', 'give'),
107
+					'disabled' => __('Disabled', 'give'),
108 108
 				),
109 109
 			),
110 110
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-goal.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Form_Goal extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = __( 'Donation Form Goal', 'give' );
22
-		$this->shortcode['label'] = __( 'Donation Form Goal', 'give' );
21
+		$this->shortcode['title'] = __('Donation Form Goal', 'give');
22
+		$this->shortcode['label'] = __('Donation Form Goal', 'give');
23 23
 
24
-		parent::__construct( 'give_goal' );
24
+		parent::__construct('give_goal');
25 25
 	}
26 26
 
27 27
 	/**
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function define_fields() {
33 33
 
34
-		$create_form_link = sprintf( __( '%sClick here%s to create a new Donation Form.', 'give' ),
35
-			'<a href="' . admin_url( 'post-new.php?post_type=give_forms' ) . '">',
34
+		$create_form_link = sprintf(__('%sClick here%s to create a new Donation Form.', 'give'),
35
+			'<a href="'.admin_url('post-new.php?post_type=give_forms').'">',
36 36
 			'</a>'
37 37
 		);
38 38
 
@@ -43,35 +43,35 @@  discard block
 block discarded – undo
43 43
 					'post_type' => 'give_forms',
44 44
 				),
45 45
 				'name'        => 'id',
46
-				'tooltip'     => __( 'Select a Donation Form', 'give' ),
47
-				'placeholder' => sprintf( '– %s –', __( 'Select a Form', 'give' ) ),
46
+				'tooltip'     => __('Select a Donation Form', 'give'),
47
+				'placeholder' => sprintf('– %s –', __('Select a Form', 'give')),
48 48
 				'required'    => array(
49
-					'alert' => __( 'You must first select a Form!', 'give' ),
50
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', __( 'No donation forms were found!', 'give' ), $create_form_link ),
49
+					'alert' => __('You must first select a Form!', 'give'),
50
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', __('No donation forms were found!', 'give'), $create_form_link),
51 51
 				),
52 52
 			),
53 53
 			array(
54 54
 				'type' => 'container',
55
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', __( 'Optional settings', 'give' ) ),
55
+				'html' => sprintf('<p class="strong margin-top">%s</p>', __('Optional settings', 'give')),
56 56
 			),
57 57
 			array(
58 58
 				'type'    => 'listbox',
59 59
 				'name'    => 'show_text',
60
-				'label'   => __( 'Show Text:', 'give' ),
61
-				'tooltip' => __( 'This text displays the amount of income raised compared to the goal.', 'give' ),
60
+				'label'   => __('Show Text:', 'give'),
61
+				'tooltip' => __('This text displays the amount of income raised compared to the goal.', 'give'),
62 62
 				'options' => array(
63
-					'true'  => __( 'Show', 'give' ),
64
-					'false' => __( 'Hide', 'give' ),
63
+					'true'  => __('Show', 'give'),
64
+					'false' => __('Hide', 'give'),
65 65
 				),
66 66
 			),
67 67
 			array(
68 68
 				'type'    => 'listbox',
69 69
 				'name'    => 'show_bar',
70
-				'label'   => __( 'Show Progress Bar:', 'give' ),
71
-				'tooltip' => __( 'Do you want to display the goal\'s progress bar?', 'give' ),
70
+				'label'   => __('Show Progress Bar:', 'give'),
71
+				'tooltip' => __('Do you want to display the goal\'s progress bar?', 'give'),
72 72
 				'options' => array(
73
-					'true'  => __( 'Show', 'give' ),
74
-					'false' => __( 'Hide', 'give' ),
73
+					'true'  => __('Show', 'give'),
74
+					'false' => __('Hide', 'give'),
75 75
 				),
76 76
 			),
77 77
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-login.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Login extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = __( 'Login', 'give' );
22
-		$this->shortcode['label'] = __( 'Login', 'give' );
21
+		$this->shortcode['title'] = __('Login', 'give');
22
+		$this->shortcode['label'] = __('Login', 'give');
23 23
 
24
-		parent::__construct( 'give_login' );
24
+		parent::__construct('give_login');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', __( 'Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', __('Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => __( 'Enter an URL here to redirect to after login.', 'give' ),
43
+				'tooltip'  => __('Enter an URL here to redirect to after login.', 'give'),
44 44
 			),
45 45
 		);
46 46
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-profile-editor.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Profile_Editor extends Give_Shortcode_Generator {
15 15
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['label'] = __( 'Profile Editor', 'give' );
21
+		$this->shortcode['label'] = __('Profile Editor', 'give');
22 22
 
23
-		parent::__construct( 'give_profile_editor' );
23
+		parent::__construct('give_profile_editor');
24 24
 	}
25 25
 }
26 26
 
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The [give_profile_editor] Shortcode Generator class
4
- *
5
- * @package     Give
6
- * @subpackage  Admin
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.3.0
10
- */
3
+	 * The [give_profile_editor] Shortcode Generator class
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Admin
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.3.0
10
+	 */
11 11
 
12 12
 defined( 'ABSPATH' ) or exit;
13 13
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-receipt.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = __( 'Donation Receipt', 'give' );
22
-		$this->shortcode['label'] = __( 'Donation Receipt', 'give' );
21
+		$this->shortcode['title'] = __('Donation Receipt', 'give');
22
+		$this->shortcode['label'] = __('Donation Receipt', 'give');
23 23
 
24
-		parent::__construct( 'give_receipt' );
24
+		parent::__construct('give_receipt');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,51 +34,51 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="strong">%s</p>', __( 'Optional settings', 'give' ) ),
37
+				'html' => sprintf('<p class="strong">%s</p>', __('Optional settings', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'    => 'listbox',
41 41
 				'name'    => 'price',
42
-				'label'   => __( 'Show Price:', 'give' ),
42
+				'label'   => __('Show Price:', 'give'),
43 43
 				'options' => array(
44
-					'true'  => __( 'Show', 'give' ),
45
-					'false' => __( 'Hide', 'give' ),
44
+					'true'  => __('Show', 'give'),
45
+					'false' => __('Hide', 'give'),
46 46
 				),
47 47
 			),
48 48
 			array(
49 49
 				'type'    => 'listbox',
50 50
 				'name'    => 'date',
51
-				'label'   => __( 'Show Date:', 'give' ),
51
+				'label'   => __('Show Date:', 'give'),
52 52
 				'options' => array(
53
-					'true'  => __( 'Show', 'give' ),
54
-					'false' => __( 'Hide', 'give' ),
53
+					'true'  => __('Show', 'give'),
54
+					'false' => __('Hide', 'give'),
55 55
 				),
56 56
 			),
57 57
 			array(
58 58
 				'type'    => 'listbox',
59 59
 				'name'    => 'payment_key',
60
-				'label'   => __( 'Show Payment Key:', 'give' ),
60
+				'label'   => __('Show Payment Key:', 'give'),
61 61
 				'options' => array(
62
-					'true'  => __( 'Show', 'give' ),
63
-					'false' => __( 'Hide', 'give' ),
62
+					'true'  => __('Show', 'give'),
63
+					'false' => __('Hide', 'give'),
64 64
 				),
65 65
 			),
66 66
 			array(
67 67
 				'type'    => 'listbox',
68 68
 				'name'    => 'payment_method',
69
-				'label'   => __( 'Show Payment Method:', 'give' ),
69
+				'label'   => __('Show Payment Method:', 'give'),
70 70
 				'options' => array(
71
-					'true'  => __( 'Show', 'give' ),
72
-					'false' => __( 'Hide', 'give' ),
71
+					'true'  => __('Show', 'give'),
72
+					'false' => __('Hide', 'give'),
73 73
 				),
74 74
 			),
75 75
 			array(
76 76
 				'type'    => 'listbox',
77 77
 				'name'    => 'payment_id',
78
-				'label'   => __( 'Show Payment ID:', 'give' ),
78
+				'label'   => __('Show Payment ID:', 'give'),
79 79
 				'options' => array(
80
-					'true'  => __( 'Show', 'give' ),
81
-					'false' => __( 'Hide', 'give' ),
80
+					'true'  => __('Show', 'give'),
81
+					'false' => __('Hide', 'give'),
82 82
 				),
83 83
 			),
84 84
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-register.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Register extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = __( 'Register', 'give' );
22
-		$this->shortcode['label'] = __( 'Register', 'give' );
21
+		$this->shortcode['title'] = __('Register', 'give');
22
+		$this->shortcode['label'] = __('Register', 'give');
23 23
 
24
-		parent::__construct( 'give_register' );
24
+		parent::__construct('give_register');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', __( 'Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', __('Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => __( 'Enter an URL here to redirect to after registering.', 'give' ),
43
+				'tooltip'  => __('Enter an URL here to redirect to after registering.', 'give'),
44 44
 			),
45 45
 		);
46 46
 	}
Please login to merge, or discard this patch.