Completed
Push — master ( b9ae17...4096fc )
by Devin
07:53
created
includes/class-give-html-elements.php 1 patch
Spacing   +159 added lines, -159 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @return string       Donations dropdown.
37 37
 	 */
38
-	public function donations_dropdown( $args = array() ) {
38
+	public function donations_dropdown($args = array()) {
39 39
 
40 40
 		$defaults = array(
41 41
 			'name'        => 'donations',
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
 			'selected'    => 0,
46 46
 			'chosen'      => false,
47 47
 			'number'      => 30,
48
-			'placeholder' => __( 'Select a donation', 'give' ),
48
+			'placeholder' => __('Select a donation', 'give'),
49 49
 		);
50 50
 
51
-		$args = wp_parse_args( $args, $defaults );
51
+		$args = wp_parse_args($args, $defaults);
52 52
 
53
-		$payments = new Give_Payments_Query( array(
53
+		$payments = new Give_Payments_Query(array(
54 54
 			'number' => $args['number'],
55
-		) );
55
+		));
56 56
 
57 57
 		$payments = $payments->get_payments();
58 58
 
59 59
 		$options = array();
60 60
 
61 61
 		// Provide nice human readable options.
62
-		if ( $payments ) {
62
+		if ($payments) {
63 63
 			$options[0] = $args['placeholder'];
64
-			foreach ( $payments as $payment ) {
64
+			foreach ($payments as $payment) {
65 65
 
66
-				$options[ absint( $payment->ID ) ] = esc_html( '#' . $payment->ID . ' - ' . $payment->email . ' - ' . $payment->form_title );
66
+				$options[absint($payment->ID)] = esc_html('#'.$payment->ID.' - '.$payment->email.' - '.$payment->form_title);
67 67
 
68 68
 			}
69 69
 		} else {
70
-			$options[0] = __( 'No donations found.', 'give' );
70
+			$options[0] = __('No donations found.', 'give');
71 71
 		}
72 72
 
73
-		$output = $this->select( array(
73
+		$output = $this->select(array(
74 74
 			'name'             => $args['name'],
75 75
 			'selected'         => $args['selected'],
76 76
 			'id'               => $args['id'],
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			'select_atts'      => $args['select_atts'],
83 83
 			'show_option_all'  => false,
84 84
 			'show_option_none' => false,
85
-		) );
85
+		));
86 86
 
87 87
 		return $output;
88 88
 	}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 * @return string      Give forms dropdown.
101 101
 	 */
102
-	public function forms_dropdown( $args = array() ) {
102
+	public function forms_dropdown($args = array()) {
103 103
 
104 104
 		$defaults = array(
105 105
 			'name'        => 'forms',
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
 			'selected'    => 0,
110 110
 			'chosen'      => false,
111 111
 			'number'      => 30,
112
-			'placeholder' => esc_attr__( 'All Forms', 'give' ),
112
+			'placeholder' => esc_attr__('All Forms', 'give'),
113 113
 			'data'        => array(
114 114
 				'search-type' => 'form',
115 115
 			),
116 116
 			'query_args' => array()
117 117
 		);
118 118
 
119
-		$args = wp_parse_args( $args, $defaults );
119
+		$args = wp_parse_args($args, $defaults);
120 120
 
121 121
 		$form_args = wp_parse_args(
122 122
 			$args['query_args'],
@@ -128,37 +128,37 @@  discard block
 block discarded – undo
128 128
 			)
129 129
 		);
130 130
 
131
-		$cache_key   = Give_Cache::get_key( 'give_forms', $form_args, false );
131
+		$cache_key = Give_Cache::get_key('give_forms', $form_args, false);
132 132
 
133 133
 		// Get forms from cache.
134
-		$forms = Give_Cache::get_db_query( $cache_key );
134
+		$forms = Give_Cache::get_db_query($cache_key);
135 135
 
136
-		if ( is_null( $forms ) ) {
137
-			$forms = new WP_Query( $form_args );
136
+		if (is_null($forms)) {
137
+			$forms = new WP_Query($form_args);
138 138
 			$forms = $forms->posts;
139
-			Give_Cache::set_db_query( $cache_key, $forms );
139
+			Give_Cache::set_db_query($cache_key, $forms);
140 140
 		}
141 141
 
142 142
 		$options = array();
143 143
 
144 144
 		// Ensure the selected.
145
-		if ( false !== $args['selected'] && $args['selected'] !== 0 ) {
146
-			$options[ $args['selected'] ] = get_the_title( $args['selected'] );
145
+		if (false !== $args['selected'] && $args['selected'] !== 0) {
146
+			$options[$args['selected']] = get_the_title($args['selected']);
147 147
 		}
148 148
 
149
-		$options[0] = esc_html__( 'No forms found.', 'give' );
150
-		if ( ! empty( $forms ) ) {
149
+		$options[0] = esc_html__('No forms found.', 'give');
150
+		if ( ! empty($forms)) {
151 151
 			$options[0] = $args['placeholder'];
152
-			foreach ( $forms as $form ) {
153
-				$form_title = empty( $form->post_title )
154
-					? sprintf( __( 'Untitled (#%s)', 'give' ), $form->ID )
152
+			foreach ($forms as $form) {
153
+				$form_title = empty($form->post_title)
154
+					? sprintf(__('Untitled (#%s)', 'give'), $form->ID)
155 155
 					: $form->post_title;
156 156
 
157
-				$options[ absint( $form->ID ) ] = esc_html( $form_title );
157
+				$options[absint($form->ID)] = esc_html($form_title);
158 158
 			}
159 159
 		}
160 160
 
161
-		$output = $this->select( array(
161
+		$output = $this->select(array(
162 162
 			'name'             => $args['name'],
163 163
 			'selected'         => $args['selected'],
164 164
 			'id'               => $args['id'],
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			'show_option_all'  => false,
171 171
 			'show_option_none' => false,
172 172
 			'data'             => $args['data'],
173
-		) );
173
+		));
174 174
 
175 175
 		return $output;
176 176
 	}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 *
188 188
 	 * @return string      Donors dropdown.
189 189
 	 */
190
-	public function donor_dropdown( $args = array() ) {
190
+	public function donor_dropdown($args = array()) {
191 191
 
192 192
 		$defaults = array(
193 193
 			'name'        => 'donors',
@@ -196,58 +196,58 @@  discard block
 block discarded – undo
196 196
 			'multiple'    => false,
197 197
 			'selected'    => 0,
198 198
 			'chosen'      => true,
199
-			'placeholder' => esc_attr__( 'Select a Donor', 'give' ),
199
+			'placeholder' => esc_attr__('Select a Donor', 'give'),
200 200
 			'number'      => 30,
201 201
 			'data'        => array(
202 202
 				'search-type' => 'donor',
203 203
 			),
204 204
 		);
205 205
 
206
-		$args = wp_parse_args( $args, $defaults );
206
+		$args = wp_parse_args($args, $defaults);
207 207
 
208
-		$donors = Give()->donors->get_donors( array(
208
+		$donors = Give()->donors->get_donors(array(
209 209
 			'number' => $args['number'],
210
-		) );
210
+		));
211 211
 
212 212
 		$options = array();
213 213
 
214
-		if ( $donors ) {
215
-			$options[0] = esc_html__( 'No donor attached', 'give' );
216
-			foreach ( $donors as $donor ) {
217
-				$donor = give_get_name_with_title_prefixes( $donor );
218
-				$options[ absint( $donor->id ) ] = esc_html( $donor->name . ' (' . $donor->email . ')' );
214
+		if ($donors) {
215
+			$options[0] = esc_html__('No donor attached', 'give');
216
+			foreach ($donors as $donor) {
217
+				$donor = give_get_name_with_title_prefixes($donor);
218
+				$options[absint($donor->id)] = esc_html($donor->name.' ('.$donor->email.')');
219 219
 			}
220 220
 		} else {
221
-			$options[0] = esc_html__( 'No donors found.', 'give' );
221
+			$options[0] = esc_html__('No donors found.', 'give');
222 222
 		}
223 223
 
224
-		if ( ! empty( $args['selected'] ) ) {
224
+		if ( ! empty($args['selected'])) {
225 225
 
226 226
 			// If a selected customer has been specified, we need to ensure it's in the initial list of customers displayed.
227
-			if ( ! array_key_exists( $args['selected'], $options ) ) {
227
+			if ( ! array_key_exists($args['selected'], $options)) {
228 228
 
229
-				$donor = new Give_Donor( $args['selected'] );
229
+				$donor = new Give_Donor($args['selected']);
230 230
 
231
-				if ( $donor ) {
232
-					$donor = give_get_name_with_title_prefixes( $donor );
233
-					$options[ absint( $args['selected'] ) ] = esc_html( $donor->name . ' (' . $donor->email . ')' );
231
+				if ($donor) {
232
+					$donor = give_get_name_with_title_prefixes($donor);
233
+					$options[absint($args['selected'])] = esc_html($donor->name.' ('.$donor->email.')');
234 234
 
235 235
 				}
236 236
 			}
237 237
 		}
238 238
 
239
-		$output = $this->select( array(
239
+		$output = $this->select(array(
240 240
 			'name'             => $args['name'],
241 241
 			'selected'         => $args['selected'],
242 242
 			'id'               => $args['id'],
243
-			'class'            => $args['class'] . ' give-customer-select',
243
+			'class'            => $args['class'].' give-customer-select',
244 244
 			'options'          => $options,
245 245
 			'multiple'         => $args['multiple'],
246 246
 			'chosen'           => $args['chosen'],
247 247
 			'show_option_all'  => false,
248 248
 			'show_option_none' => false,
249 249
 			'data'             => $args['data'],
250
-		) );
250
+		));
251 251
 
252 252
 		return $output;
253 253
 	}
@@ -266,22 +266,22 @@  discard block
 block discarded – undo
266 266
 	 *
267 267
 	 * @return string           Categories dropdown.
268 268
 	 */
269
-	public function category_dropdown( $name = 'give_forms_categories', $selected = 0, $args = array() ) {
270
-		$categories = get_terms( 'give_forms_category', apply_filters( 'give_forms_category_dropdown', array() ) );
269
+	public function category_dropdown($name = 'give_forms_categories', $selected = 0, $args = array()) {
270
+		$categories = get_terms('give_forms_category', apply_filters('give_forms_category_dropdown', array()));
271 271
 
272 272
 		$options = array();
273 273
 
274
-		foreach ( $categories as $category ) {
275
-			$options[ absint( $category->term_id ) ] = esc_html( $category->name );
274
+		foreach ($categories as $category) {
275
+			$options[absint($category->term_id)] = esc_html($category->name);
276 276
 		}
277 277
 
278
-		$output = $this->select( wp_parse_args( $args, array(
278
+		$output = $this->select(wp_parse_args($args, array(
279 279
 			'name'             => $name,
280 280
 			'selected'         => $selected,
281 281
 			'options'          => $options,
282
-			'show_option_all'  => esc_html__( 'All Categories', 'give' ),
282
+			'show_option_all'  => esc_html__('All Categories', 'give'),
283 283
 			'show_option_none' => false,
284
-		) ) );
284
+		)));
285 285
 
286 286
 		return $output;
287 287
 	}
@@ -300,22 +300,22 @@  discard block
 block discarded – undo
300 300
 	 *
301 301
 	 * @return string           Tags dropdown.
302 302
 	 */
303
-	public function tags_dropdown( $name = 'give_forms_tags', $selected = 0, $args = array() ) {
304
-		$tags    = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) );
303
+	public function tags_dropdown($name = 'give_forms_tags', $selected = 0, $args = array()) {
304
+		$tags    = get_terms('give_forms_tag', apply_filters('give_forms_tag_dropdown', array()));
305 305
 
306 306
 		$options = array();
307 307
 
308
-		foreach ( $tags as $tag ) {
309
-			$options[ absint( $tag->term_id ) ] = esc_html( $tag->name );
308
+		foreach ($tags as $tag) {
309
+			$options[absint($tag->term_id)] = esc_html($tag->name);
310 310
 		}
311 311
 
312
-		$output = $this->select( wp_parse_args( $args, array(
312
+		$output = $this->select(wp_parse_args($args, array(
313 313
 			'name'             => $name,
314 314
 			'selected'         => $selected,
315 315
 			'options'          => $options,
316
-			'show_option_all'  => esc_html__( 'All Tags', 'give' ),
316
+			'show_option_all'  => esc_html__('All Tags', 'give'),
317 317
 			'show_option_none' => false,
318
-		) ) );
318
+		)));
319 319
 
320 320
 		return $output;
321 321
 	}
@@ -335,25 +335,25 @@  discard block
 block discarded – undo
335 335
 	 *
336 336
 	 * @return string               Years dropdown.
337 337
 	 */
338
-	public function year_dropdown( $name = 'year', $selected = 0, $years_before = 5, $years_after = 0 ) {
339
-		$current    = date( 'Y' );
340
-		$start_year = $current - absint( $years_before );
341
-		$end_year   = $current + absint( $years_after );
342
-		$selected   = empty( $selected ) ? date( 'Y' ) : $selected;
338
+	public function year_dropdown($name = 'year', $selected = 0, $years_before = 5, $years_after = 0) {
339
+		$current    = date('Y');
340
+		$start_year = $current - absint($years_before);
341
+		$end_year   = $current + absint($years_after);
342
+		$selected   = empty($selected) ? date('Y') : $selected;
343 343
 		$options    = array();
344 344
 
345
-		while ( $start_year <= $end_year ) {
346
-			$options[ absint( $start_year ) ] = $start_year;
347
-			$start_year ++;
345
+		while ($start_year <= $end_year) {
346
+			$options[absint($start_year)] = $start_year;
347
+			$start_year++;
348 348
 		}
349 349
 
350
-		$output = $this->select( array(
350
+		$output = $this->select(array(
351 351
 			'name'             => $name,
352 352
 			'selected'         => $selected,
353 353
 			'options'          => $options,
354 354
 			'show_option_all'  => false,
355 355
 			'show_option_none' => false,
356
-		) );
356
+		));
357 357
 
358 358
 		return $output;
359 359
 	}
@@ -371,23 +371,23 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @return string           Months dropdown.
373 373
 	 */
374
-	public function month_dropdown( $name = 'month', $selected = 0 ) {
374
+	public function month_dropdown($name = 'month', $selected = 0) {
375 375
 		$month    = 1;
376 376
 		$options  = array();
377
-		$selected = empty( $selected ) ? date( 'n' ) : $selected;
377
+		$selected = empty($selected) ? date('n') : $selected;
378 378
 
379
-		while ( $month <= 12 ) {
380
-			$options[ absint( $month ) ] = give_month_num_to_name( $month );
381
-			$month ++;
379
+		while ($month <= 12) {
380
+			$options[absint($month)] = give_month_num_to_name($month);
381
+			$month++;
382 382
 		}
383 383
 
384
-		$output = $this->select( array(
384
+		$output = $this->select(array(
385 385
 			'name'             => $name,
386 386
 			'selected'         => $selected,
387 387
 			'options'          => $options,
388 388
 			'show_option_all'  => false,
389 389
 			'show_option_none' => false,
390
-		) );
390
+		));
391 391
 
392 392
 		return $output;
393 393
 	}
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 	 *
405 405
 	 * @return string      The dropdown.
406 406
 	 */
407
-	public function select( $args = array() ) {
407
+	public function select($args = array()) {
408 408
 		$defaults = array(
409 409
 			'options'          => array(),
410 410
 			'name'             => null,
@@ -415,74 +415,74 @@  discard block
 block discarded – undo
415 415
 			'placeholder'      => null,
416 416
 			'multiple'         => false,
417 417
 			'select_atts'      => false,
418
-			'show_option_all'  => __( 'All', 'give' ),
419
-			'show_option_none' => __( 'None', 'give' ),
418
+			'show_option_all'  => __('All', 'give'),
419
+			'show_option_none' => __('None', 'give'),
420 420
 			'data'             => array(),
421 421
 			'readonly'         => false,
422 422
 			'disabled'         => false,
423 423
 		);
424 424
 
425
-		$args = wp_parse_args( $args, $defaults );
425
+		$args = wp_parse_args($args, $defaults);
426 426
 
427 427
 		$data_elements = '';
428
-		foreach ( $args['data'] as $key => $value ) {
429
-			$data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
428
+		foreach ($args['data'] as $key => $value) {
429
+			$data_elements .= ' data-'.esc_attr($key).'="'.esc_attr($value).'"';
430 430
 		}
431 431
 
432 432
 		$multiple = '';
433
-		if ( $args['multiple'] ) {
433
+		if ($args['multiple']) {
434 434
 			$multiple = 'MULTIPLE';
435 435
 		}
436 436
 
437
-		if ( $args['chosen'] ) {
437
+		if ($args['chosen']) {
438 438
 			$args['class'] .= ' give-select-chosen';
439 439
 		}
440 440
 
441 441
 		$placeholder = '';
442
-		if ( $args['placeholder'] ) {
442
+		if ($args['placeholder']) {
443 443
 			$placeholder = $args['placeholder'];
444 444
 		}
445 445
 
446 446
 		$output = sprintf(
447 447
 			'<select name="%1$s" id="%2$s" autocomplete="address-level4" class="give-select %3$s" %4$s %5$s placeholder="%6$s" data-placeholder="%6$s" %7$s>',
448
-			esc_attr( $args['name'] ),
449
-			esc_attr( sanitize_key( str_replace( '-', '_', $args['id'] ) ) ),
450
-			esc_attr( $args['class'] ),
448
+			esc_attr($args['name']),
449
+			esc_attr(sanitize_key(str_replace('-', '_', $args['id']))),
450
+			esc_attr($args['class']),
451 451
 			$multiple,
452 452
 			$args['select_atts'],
453 453
 			$placeholder,
454 454
 			$data_elements
455 455
 		);
456 456
 
457
-		if ( $args['show_option_all'] ) {
458
-			if ( $args['multiple'] ) {
459
-				$selected = selected( true, in_array( 0, $args['selected'] ), false );
457
+		if ($args['show_option_all']) {
458
+			if ($args['multiple']) {
459
+				$selected = selected(true, in_array(0, $args['selected']), false);
460 460
 			} else {
461
-				$selected = selected( $args['selected'], 0, false );
461
+				$selected = selected($args['selected'], 0, false);
462 462
 			}
463
-			$output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>';
463
+			$output .= '<option value="all"'.$selected.'>'.esc_html($args['show_option_all']).'</option>';
464 464
 		}
465 465
 
466
-		if ( ! empty( $args['options'] ) ) {
466
+		if ( ! empty($args['options'])) {
467 467
 
468
-			if ( $args['show_option_none'] ) {
469
-				if ( $args['multiple'] ) {
470
-					$selected = selected( true, in_array( - 1, $args['selected'] ), false );
468
+			if ($args['show_option_none']) {
469
+				if ($args['multiple']) {
470
+					$selected = selected(true, in_array( -1, $args['selected'] ), false);
471 471
 				} else {
472
-					$selected = selected( $args['selected'], - 1, false );
472
+					$selected = selected($args['selected'], - 1, false);
473 473
 				}
474
-				$output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
474
+				$output .= '<option value="-1"'.$selected.'>'.esc_html($args['show_option_none']).'</option>';
475 475
 			}
476 476
 
477
-			foreach ( $args['options'] as $key => $option ) {
477
+			foreach ($args['options'] as $key => $option) {
478 478
 
479
-				if ( $args['multiple'] && is_array( $args['selected'] ) ) {
480
-					$selected = selected( true, in_array( $key, $args['selected'] ), false );
479
+				if ($args['multiple'] && is_array($args['selected'])) {
480
+					$selected = selected(true, in_array($key, $args['selected']), false);
481 481
 				} else {
482
-					$selected = selected( $args['selected'], $key, false );
482
+					$selected = selected($args['selected'], $key, false);
483 483
 				}
484 484
 
485
-				$output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>';
485
+				$output .= '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option).'</option>';
486 486
 			}
487 487
 		}
488 488
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 	 *
504 504
 	 * @return string      The checkbox.
505 505
 	 */
506
-	public function checkbox( $args = array() ) {
506
+	public function checkbox($args = array()) {
507 507
 		$defaults = array(
508 508
 			'name'    => null,
509 509
 			'current' => null,
@@ -514,16 +514,16 @@  discard block
 block discarded – undo
514 514
 			),
515 515
 		);
516 516
 
517
-		$args = wp_parse_args( $args, $defaults );
517
+		$args = wp_parse_args($args, $defaults);
518 518
 
519 519
 		$options = '';
520
-		if ( ! empty( $args['options']['disabled'] ) ) {
520
+		if ( ! empty($args['options']['disabled'])) {
521 521
 			$options .= ' disabled="disabled"';
522
-		} elseif ( ! empty( $args['options']['readonly'] ) ) {
522
+		} elseif ( ! empty($args['options']['readonly'])) {
523 523
 			$options .= ' readonly';
524 524
 		}
525 525
 
526
-		$output = '<input type="checkbox"' . $options . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" class="' . $args['class'] . ' ' . esc_attr( $args['name'] ) . '" ' . checked( 1, $args['current'], false ) . ' />';
526
+		$output = '<input type="checkbox"'.$options.' name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" class="'.$args['class'].' '.esc_attr($args['name']).'" '.checked(1, $args['current'], false).' />';
527 527
 
528 528
 		return $output;
529 529
 	}
@@ -540,22 +540,22 @@  discard block
 block discarded – undo
540 540
 	 *
541 541
 	 * @return string      The text field.
542 542
 	 */
543
-	public function text( $args = array() ) {
543
+	public function text($args = array()) {
544 544
 		// Backwards compatibility.
545
-		if ( func_num_args() > 1 ) {
545
+		if (func_num_args() > 1) {
546 546
 			$args = func_get_args();
547 547
 
548 548
 			$name  = $args[0];
549
-			$value = isset( $args[1] ) ? $args[1] : '';
550
-			$label = isset( $args[2] ) ? $args[2] : '';
551
-			$desc  = isset( $args[3] ) ? $args[3] : '';
549
+			$value = isset($args[1]) ? $args[1] : '';
550
+			$label = isset($args[2]) ? $args[2] : '';
551
+			$desc  = isset($args[3]) ? $args[3] : '';
552 552
 		}
553 553
 
554 554
 		$defaults = array(
555
-			'name'         => isset( $name ) ? $name : 'text',
556
-			'value'        => isset( $value ) ? $value : null,
557
-			'label'        => isset( $label ) ? $label : null,
558
-			'desc'         => isset( $desc ) ? $desc : null,
555
+			'name'         => isset($name) ? $name : 'text',
556
+			'value'        => isset($value) ? $value : null,
557
+			'label'        => isset($label) ? $label : null,
558
+			'desc'         => isset($desc) ? $desc : null,
559 559
 			'placeholder'  => '',
560 560
 			'class'        => 'regular-text',
561 561
 			'disabled'     => false,
@@ -563,29 +563,29 @@  discard block
 block discarded – undo
563 563
 			'data'         => false,
564 564
 		);
565 565
 
566
-		$args = wp_parse_args( $args, $defaults );
566
+		$args = wp_parse_args($args, $defaults);
567 567
 
568 568
 		$disabled = '';
569
-		if ( $args['disabled'] ) {
569
+		if ($args['disabled']) {
570 570
 			$disabled = ' disabled="disabled"';
571 571
 		}
572 572
 
573 573
 		$data = '';
574
-		if ( ! empty( $args['data'] ) ) {
575
-			foreach ( $args['data'] as $key => $value ) {
576
-				$data .= 'data-' . $key . '="' . $value . '" ';
574
+		if ( ! empty($args['data'])) {
575
+			foreach ($args['data'] as $key => $value) {
576
+				$data .= 'data-'.$key.'="'.$value.'" ';
577 577
 			}
578 578
 		}
579 579
 
580
-		$output = '<span id="give-' . sanitize_key( $args['name'] ) . '-wrap">';
580
+		$output = '<span id="give-'.sanitize_key($args['name']).'-wrap">';
581 581
 
582
-		$output .= '<label class="give-label" for="give-' . sanitize_key( $args['name'] ) . '">' . esc_html( $args['label'] ) . '</label>';
582
+		$output .= '<label class="give-label" for="give-'.sanitize_key($args['name']).'">'.esc_html($args['label']).'</label>';
583 583
 
584
-		if ( ! empty( $args['desc'] ) ) {
585
-			$output .= '<span class="give-description">' . esc_html( $args['desc'] ) . '</span>';
584
+		if ( ! empty($args['desc'])) {
585
+			$output .= '<span class="give-description">'.esc_html($args['desc']).'</span>';
586 586
 		}
587 587
 
588
-		$output .= '<input type="text" name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" autocomplete="' . esc_attr( $args['autocomplete'] ) . '" value="' . esc_attr( $args['value'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" class="' . $args['class'] . '" ' . $data . '' . $disabled . '/>';
588
+		$output .= '<input type="text" name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" autocomplete="'.esc_attr($args['autocomplete']).'" value="'.esc_attr($args['value']).'" placeholder="'.esc_attr($args['placeholder']).'" class="'.$args['class'].'" '.$data.''.$disabled.'/>';
589 589
 
590 590
 		$output .= '</span>';
591 591
 
@@ -604,15 +604,15 @@  discard block
 block discarded – undo
604 604
 	 *
605 605
 	 * @return string      The date picker.
606 606
 	 */
607
-	public function date_field( $args = array() ) {
607
+	public function date_field($args = array()) {
608 608
 
609
-		if ( empty( $args['class'] ) ) {
609
+		if (empty($args['class'])) {
610 610
 			$args['class'] = 'give_datepicker';
611
-		} elseif ( ! strpos( $args['class'], 'give_datepicker' ) ) {
611
+		} elseif ( ! strpos($args['class'], 'give_datepicker')) {
612 612
 			$args['class'] .= ' give_datepicker';
613 613
 		}
614 614
 
615
-		return $this->text( $args );
615
+		return $this->text($args);
616 616
 	}
617 617
 
618 618
 	/**
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 	 *
628 628
 	 * @return string      The textarea.
629 629
 	 */
630
-	public function textarea( $args = array() ) {
630
+	public function textarea($args = array()) {
631 631
 		$defaults = array(
632 632
 			'name'     => 'textarea',
633 633
 			'value'    => null,
@@ -637,21 +637,21 @@  discard block
 block discarded – undo
637 637
 			'disabled' => false,
638 638
 		);
639 639
 
640
-		$args = wp_parse_args( $args, $defaults );
640
+		$args = wp_parse_args($args, $defaults);
641 641
 
642 642
 		$disabled = '';
643
-		if ( $args['disabled'] ) {
643
+		if ($args['disabled']) {
644 644
 			$disabled = ' disabled="disabled"';
645 645
 		}
646 646
 
647
-		$output = '<span id="give-' . sanitize_key( $args['name'] ) . '-wrap">';
647
+		$output = '<span id="give-'.sanitize_key($args['name']).'-wrap">';
648 648
 
649
-		$output .= '<label class="give-label" for="give-' . sanitize_key( $args['name'] ) . '">' . esc_html( $args['label'] ) . '</label>';
649
+		$output .= '<label class="give-label" for="give-'.sanitize_key($args['name']).'">'.esc_html($args['label']).'</label>';
650 650
 
651
-		$output .= '<textarea name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['name'] ) . '" class="' . $args['class'] . '"' . $disabled . '>' . esc_attr( $args['value'] ) . '</textarea>';
651
+		$output .= '<textarea name="'.esc_attr($args['name']).'" id="'.esc_attr($args['name']).'" class="'.$args['class'].'"'.$disabled.'>'.esc_attr($args['value']).'</textarea>';
652 652
 
653
-		if ( ! empty( $args['desc'] ) ) {
654
-			$output .= '<span class="give-description">' . esc_html( $args['desc'] ) . '</span>';
653
+		if ( ! empty($args['desc'])) {
654
+			$output .= '<span class="give-description">'.esc_html($args['desc']).'</span>';
655 655
 		}
656 656
 
657 657
 		$output .= '</span>';
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 	 *
672 672
 	 * @return string      The text field with ajax search.
673 673
 	 */
674
-	public function ajax_user_search( $args = array() ) {
674
+	public function ajax_user_search($args = array()) {
675 675
 
676 676
 		$defaults = array(
677 677
 			'name'        => 'users',
@@ -682,13 +682,13 @@  discard block
 block discarded – undo
682 682
 			'chosen'      => true,
683 683
 			'number'      => 30,
684 684
 			'select_atts' => '',
685
-			'placeholder' => __( 'Select a user', 'give' ),
685
+			'placeholder' => __('Select a user', 'give'),
686 686
 			'data'        => array(
687 687
 				'search-type' => 'user',
688 688
 			),
689 689
 		);
690 690
 
691
-		$args = wp_parse_args( $args, $defaults );
691
+		$args = wp_parse_args($args, $defaults);
692 692
 
693 693
 		// Set initial args.
694 694
 		$get_users_args = array(
@@ -697,31 +697,31 @@  discard block
 block discarded – undo
697 697
 
698 698
 		// Ensure selected user is not included in initial query.
699 699
 		// This is because sites with many users, it's not a guarantee the selected user will be returned.
700
-		if ( ! empty( $args['selected'] ) ) {
700
+		if ( ! empty($args['selected'])) {
701 701
 			$get_users_args['exclude'] = $args['selected'];
702 702
 		}
703 703
 
704 704
 		// Initial users array.
705
-		$users = apply_filters( 'give_ajax_user_search_initial_results', get_users( $get_users_args ), $args );
705
+		$users = apply_filters('give_ajax_user_search_initial_results', get_users($get_users_args), $args);
706 706
 
707 707
 		// Now add the selected user to the $users array if the arg is present.
708
-		if ( ! empty( $args['selected'] ) ) {
709
-			$selected_user =  apply_filters( 'give_ajax_user_search_selected_results', get_users( "include={$args['selected']}" ), $args );;
710
-			$users         = array_merge( $users, $selected_user );
708
+		if ( ! empty($args['selected'])) {
709
+			$selected_user = apply_filters('give_ajax_user_search_selected_results', get_users("include={$args['selected']}"), $args); ;
710
+			$users         = array_merge($users, $selected_user);
711 711
 		}
712 712
 
713 713
 		$options = array();
714 714
 
715
-		if ( $users ) {
715
+		if ($users) {
716 716
 			$options[0] = $args['placeholder'];
717
-			foreach ( $users as $user ) {
718
-				$options[ absint( $user->ID ) ] = esc_html( $user->user_login . ' (' . $user->user_email . ')' );
717
+			foreach ($users as $user) {
718
+				$options[absint($user->ID)] = esc_html($user->user_login.' ('.$user->user_email.')');
719 719
 			}
720 720
 		} else {
721
-			$options[0] = __( 'No users found.', 'give' );
721
+			$options[0] = __('No users found.', 'give');
722 722
 		}
723 723
 
724
-		$output = $this->select( array(
724
+		$output = $this->select(array(
725 725
 			'name'             => $args['name'],
726 726
 			'selected'         => $args['selected'],
727 727
 			'id'               => $args['id'],
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 			'show_option_all'  => false,
735 735
 			'show_option_none' => false,
736 736
 			'data'             => $args['data'],
737
-		) );
737
+		));
738 738
 
739 739
 		return $output;
740 740
 
Please login to merge, or discard this patch.
uninstall.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -10,61 +10,61 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
+if ( ! defined('WP_UNINSTALL_PLUGIN')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load Give file.
18
-include_once( 'give.php' );
18
+include_once('give.php');
19 19
 
20 20
 global $wpdb, $wp_roles;
21 21
 
22 22
 
23
-if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
23
+if (give_is_setting_enabled(give_get_option('uninstall_on_delete'))) {
24 24
 
25 25
 	// Delete All the Custom Post Types.
26
-	$give_taxonomies = array( 'form_category', 'form_tag' );
27
-	$give_post_types = array( 'give_forms', 'give_payment' );
28
-	foreach ( $give_post_types as $post_type ) {
26
+	$give_taxonomies = array('form_category', 'form_tag');
27
+	$give_post_types = array('give_forms', 'give_payment');
28
+	foreach ($give_post_types as $post_type) {
29 29
 
30
-		$give_taxonomies = array_merge( $give_taxonomies, get_object_taxonomies( $post_type ) );
31
-		$items           = get_posts( array(
30
+		$give_taxonomies = array_merge($give_taxonomies, get_object_taxonomies($post_type));
31
+		$items           = get_posts(array(
32 32
 			'post_type'   => $post_type,
33 33
 			'post_status' => 'any',
34
-			'numberposts' => - 1,
34
+			'numberposts' => -1,
35 35
 			'fields'      => 'ids',
36
-		) );
36
+		));
37 37
 
38
-		if ( $items ) {
39
-			foreach ( $items as $item ) {
40
-				wp_delete_post( $item, true );
38
+		if ($items) {
39
+			foreach ($items as $item) {
40
+				wp_delete_post($item, true);
41 41
 			}
42 42
 		}
43 43
 	}
44 44
 
45 45
 	// Delete All the Terms & Taxonomies.
46
-	foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) {
46
+	foreach (array_unique(array_filter($give_taxonomies)) as $taxonomy) {
47 47
 
48
-		$terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
48
+		$terms = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy));
49 49
 
50 50
 		// Delete Terms.
51
-		if ( $terms ) {
52
-			foreach ( $terms as $term ) {
53
-				$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
54
-				$wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) );
51
+		if ($terms) {
52
+			foreach ($terms as $term) {
53
+				$wpdb->delete($wpdb->term_taxonomy, array('term_taxonomy_id' => $term->term_taxonomy_id));
54
+				$wpdb->delete($wpdb->terms, array('term_id' => $term->term_id));
55 55
 			}
56 56
 		}
57 57
 
58 58
 		// Delete Taxonomies.
59
-		$wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) );
59
+		$wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => $taxonomy), array('%s'));
60 60
 	}
61 61
 
62 62
 	// Delete the Plugin Pages.
63
-	$give_created_pages = array( 'success_page', 'failure_page', 'history_page' );
64
-	foreach ( $give_created_pages as $p ) {
65
-		$page = give_get_option( $p, false );
66
-		if ( $page ) {
67
-			wp_delete_post( $page, true );
63
+	$give_created_pages = array('success_page', 'failure_page', 'history_page');
64
+	foreach ($give_created_pages as $p) {
65
+		$page = give_get_option($p, false);
66
+		if ($page) {
67
+			wp_delete_post($page, true);
68 68
 		}
69 69
 	}
70 70
 
@@ -73,28 +73,28 @@  discard block
 block discarded – undo
73 73
 	Give()->roles->remove_caps();
74 74
 
75 75
 	// Delete the Roles.
76
-	$give_roles = array( 'give_manager', 'give_accountant', 'give_worker', 'give_donor' );
77
-	foreach ( $give_roles as $role ) {
78
-		remove_role( $role );
76
+	$give_roles = array('give_manager', 'give_accountant', 'give_worker', 'give_donor');
77
+	foreach ($give_roles as $role) {
78
+		remove_role($role);
79 79
 	}
80 80
 
81 81
 	// Remove all database tables.
82
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donors' );
83
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donormeta' );
84
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customers' );
85
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customermeta' );
86
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_paymentmeta' );
87
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_formmeta' );
88
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logs' );
89
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_logmeta' );
90
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_sequential_ordering' );
91
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_sessions' );
82
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donors');
83
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donormeta');
84
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customers');
85
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customermeta');
86
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_paymentmeta');
87
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_formmeta');
88
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logs');
89
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_logmeta');
90
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_sequential_ordering');
91
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_sessions');
92 92
 
93 93
 	// Cleanup Cron Events.
94
-	wp_clear_scheduled_hook( 'give_daily_scheduled_events' );
95
-	wp_clear_scheduled_hook( 'give_weekly_scheduled_events' );
96
-	wp_clear_scheduled_hook( 'give_daily_cron' );
97
-	wp_clear_scheduled_hook( 'give_weekly_cron' );
94
+	wp_clear_scheduled_hook('give_daily_scheduled_events');
95
+	wp_clear_scheduled_hook('give_weekly_scheduled_events');
96
+	wp_clear_scheduled_hook('give_daily_cron');
97
+	wp_clear_scheduled_hook('give_weekly_cron');
98 98
 
99 99
 	// Get all options.
100 100
 	$give_option_names = $wpdb->get_col(
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 		)
105 105
 	);
106 106
 
107
-	if ( ! empty( $give_option_names ) ) {
107
+	if ( ! empty($give_option_names)) {
108 108
 		// Convert option name to transient or option name.
109 109
 		$new_give_option_names = array();
110 110
 
111 111
 		// Delete all the Plugin Options.
112
-		foreach ( $give_option_names as $option ) {
113
-			if ( false !== strpos( $option, 'give_cache' ) ) {
114
-				Give_Cache::delete( $option );
112
+		foreach ($give_option_names as $option) {
113
+			if (false !== strpos($option, 'give_cache')) {
114
+				Give_Cache::delete($option);
115 115
 			} else {
116
-				delete_option( $option );
116
+				delete_option($option);
117 117
 			}
118 118
 		}
119 119
 	}
Please login to merge, or discard this patch.
includes/class-give-db-payment-meta.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 		global $wpdb;
52 52
 
53 53
 		// @todo: We leave $wpdb->paymentmeta for backward compatibility, use $wpdb->donationmeta instead. We can remove it after 2.1.3.
54
-		$wpdb->paymentmeta = $wpdb->donationmeta = $this->table_name = $wpdb->prefix . 'give_donationmeta';
54
+		$wpdb->paymentmeta = $wpdb->donationmeta = $this->table_name = $wpdb->prefix.'give_donationmeta';
55 55
 		$this->version     = '1.0';
56 56
 
57 57
 		// Backward compatibility.
58
-		if ( ! give_has_upgrade_completed( 'v220_rename_donation_meta_type' ) ) {
58
+		if ( ! give_has_upgrade_completed('v220_rename_donation_meta_type')) {
59 59
 			$this->meta_type = 'payment';
60
-			$wpdb->paymentmeta = $wpdb->donationmeta = $this->table_name = $wpdb->prefix . 'give_paymentmeta';
60
+			$wpdb->paymentmeta = $wpdb->donationmeta = $this->table_name = $wpdb->prefix.'give_paymentmeta';
61 61
 		}
62 62
 
63 63
 		$this->register_table();
@@ -90,6 +90,6 @@  discard block
 block discarded – undo
90 90
 	 * @return bool
91 91
 	 */
92 92
 	protected function is_custom_meta_table_active() {
93
-		return give_has_upgrade_completed( 'v20_move_metadata_into_new_table' );
93
+		return give_has_upgrade_completed('v20_move_metadata_into_new_table');
94 94
 	}
95 95
 }
Please login to merge, or discard this patch.
includes/class-notices.php 1 patch
Spacing   +112 added lines, -113 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -53,21 +53,21 @@  discard block
 block discarded – undo
53 53
 	 * @since 1.8.9
54 54
 	 */
55 55
 	public function __construct() {
56
-		add_action( 'admin_notices', array( $this, 'render_admin_notices' ), 999 );
57
-		add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) );
56
+		add_action('admin_notices', array($this, 'render_admin_notices'), 999);
57
+		add_action('give_dismiss_notices', array($this, 'dismiss_notices'));
58 58
 
59
-		add_action( 'give_frontend_notices', array( $this, 'render_frontend_notices' ), 999 );
60
-		add_action( 'give_pre_form_output', array( $this, 'render_frontend_form_notices' ), 10, 1 );
61
-		add_action( 'give_ajax_donation_errors', array( $this, 'render_frontend_notices' ) );
59
+		add_action('give_frontend_notices', array($this, 'render_frontend_notices'), 999);
60
+		add_action('give_pre_form_output', array($this, 'render_frontend_form_notices'), 10, 1);
61
+		add_action('give_ajax_donation_errors', array($this, 'render_frontend_notices'));
62 62
 
63 63
 		/**
64 64
 		 * Backward compatibility for deprecated params.
65 65
 		 *
66 66
 		 * @since 1.8.14
67 67
 		 */
68
-		add_filter( 'give_register_notice_args', array( $this, 'bc_deprecated_params' ) );
69
-		add_filter( 'give_frontend_errors_args', array( $this, 'bc_deprecated_params' ) );
70
-		add_filter( 'give_frontend_notice_args', array( $this, 'bc_deprecated_params' ) );
68
+		add_filter('give_register_notice_args', array($this, 'bc_deprecated_params'));
69
+		add_filter('give_frontend_errors_args', array($this, 'bc_deprecated_params'));
70
+		add_filter('give_frontend_notice_args', array($this, 'bc_deprecated_params'));
71 71
 	}
72 72
 
73 73
 	/**
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @return array
82 82
 	 */
83
-	public function bc_deprecated_params( $args ) {
83
+	public function bc_deprecated_params($args) {
84 84
 		/**
85 85
 		 *  Param: auto_dismissible
86 86
 		 *  deprecated in 1.8.14
87 87
 		 *
88 88
 		 *  Check if auto_dismissible is set and it true then unset and change dismissible parameter value to auto
89 89
 		 */
90
-		if ( isset( $args['auto_dismissible'] ) ) {
91
-			if ( ! empty( $args['auto_dismissible'] ) ) {
90
+		if (isset($args['auto_dismissible'])) {
91
+			if ( ! empty($args['auto_dismissible'])) {
92 92
 				$args['dismissible'] = 'auto';
93 93
 			}
94 94
 			// unset auto_dismissible as it has been deprecated.
95
-			unset( $args['auto_dismissible'] );
95
+			unset($args['auto_dismissible']);
96 96
 		}
97 97
 
98 98
 		return $args;
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @return bool
110 110
 	 */
111
-	public function register_notice( $notice_args ) {
111
+	public function register_notice($notice_args) {
112 112
 		// Bailout.
113
-		if ( empty( $notice_args['id'] ) || array_key_exists( $notice_args['id'], self::$notices ) ) {
113
+		if (empty($notice_args['id']) || array_key_exists($notice_args['id'], self::$notices)) {
114 114
 			return false;
115 115
 		}
116 116
 
@@ -159,39 +159,39 @@  discard block
 block discarded – undo
159 159
 		 *
160 160
 		 * @since 1.8.14
161 161
 		 */
162
-		$notice_args = apply_filters( 'give_register_notice_args', $notice_args );
162
+		$notice_args = apply_filters('give_register_notice_args', $notice_args);
163 163
 
164 164
 		// Set extra dismiss links if any.
165
-		if ( false !== strpos( $notice_args['description'], 'data-dismiss-interval' ) ) {
165
+		if (false !== strpos($notice_args['description'], 'data-dismiss-interval')) {
166 166
 
167
-			preg_match_all( "/data-([^\"]*)=\"([^\"]*)\"/", $notice_args['description'], $extra_notice_dismiss_link );
167
+			preg_match_all("/data-([^\"]*)=\"([^\"]*)\"/", $notice_args['description'], $extra_notice_dismiss_link);
168 168
 
169
-			if ( ! empty( $extra_notice_dismiss_link ) ) {
170
-				$extra_notice_dismiss_links = array_chunk( current( $extra_notice_dismiss_link ), 3 );
171
-				foreach ( $extra_notice_dismiss_links as $extra_notice_dismiss_link ) {
169
+			if ( ! empty($extra_notice_dismiss_link)) {
170
+				$extra_notice_dismiss_links = array_chunk(current($extra_notice_dismiss_link), 3);
171
+				foreach ($extra_notice_dismiss_links as $extra_notice_dismiss_link) {
172 172
 					// Create array og key ==> value by parsing query string created after renaming data attributes.
173
-					$data_attribute_query_str = str_replace( array( 'data-', '-', '"' ), array(
173
+					$data_attribute_query_str = str_replace(array('data-', '-', '"'), array(
174 174
 						'',
175 175
 						'_',
176 176
 						'',
177
-					), implode( '&', $extra_notice_dismiss_link ) );
177
+					), implode('&', $extra_notice_dismiss_link));
178 178
 
179
-					$notice_args['extra_links'][] = wp_parse_args( $data_attribute_query_str );
179
+					$notice_args['extra_links'][] = wp_parse_args($data_attribute_query_str);
180 180
 				}
181 181
 			}
182 182
 		}
183 183
 
184 184
 
185
-		self::$notices[ $notice_args['id'] ] = $notice_args;
185
+		self::$notices[$notice_args['id']] = $notice_args;
186 186
 
187 187
 		// Auto set show param if not already set.
188
-		if ( ! isset( self::$notices[ $notice_args['id'] ]['show'] ) ) {
189
-			self::$notices[ $notice_args['id'] ]['show'] = $this->is_notice_dismissed( $notice_args ) ? false : true;
188
+		if ( ! isset(self::$notices[$notice_args['id']]['show'])) {
189
+			self::$notices[$notice_args['id']]['show'] = $this->is_notice_dismissed($notice_args) ? false : true;
190 190
 		}
191 191
 
192 192
 		// Auto set time interval for shortly.
193
-		if ( 'shortly' === self::$notices[ $notice_args['id'] ]['dismiss_interval'] ) {
194
-			self::$notices[ $notice_args['id'] ]['dismiss_interval_time'] = DAY_IN_SECONDS;
193
+		if ('shortly' === self::$notices[$notice_args['id']]['dismiss_interval']) {
194
+			self::$notices[$notice_args['id']]['dismiss_interval_time'] = DAY_IN_SECONDS;
195 195
 		}
196 196
 
197 197
 		return true;
@@ -205,51 +205,51 @@  discard block
 block discarded – undo
205 205
 	 */
206 206
 	public function render_admin_notices() {
207 207
 		// Bailout.
208
-		if ( empty( self::$notices ) ) {
208
+		if (empty(self::$notices)) {
209 209
 			return;
210 210
 		}
211 211
 
212 212
 		$output = '';
213 213
 
214
-		foreach ( self::$notices as $notice_id => $notice ) {
214
+		foreach (self::$notices as $notice_id => $notice) {
215 215
 			// Check flag set to true to show notice.
216
-			if ( ! $notice['show'] ) {
216
+			if ( ! $notice['show']) {
217 217
 				continue;
218 218
 			}
219 219
 
220 220
 
221 221
 			// Render custom html.
222
-			if( ! empty( $notice['description_html'] ) ) {
222
+			if ( ! empty($notice['description_html'])) {
223 223
 				$output .= "{$notice['description_html']} \n";
224 224
 				continue;
225 225
 			}
226 226
 
227 227
 			// Check if notice dismissible or not.
228
-			if ( ! self::$has_auto_dismissible_notice ) {
229
-				self::$has_auto_dismissible_notice = ( 'auto' === $notice['dismissible'] );
228
+			if ( ! self::$has_auto_dismissible_notice) {
229
+				self::$has_auto_dismissible_notice = ('auto' === $notice['dismissible']);
230 230
 			}
231 231
 
232 232
 			// Check if notice dismissible or not.
233
-			if ( ! self::$has_dismiss_interval_notice ) {
233
+			if ( ! self::$has_dismiss_interval_notice) {
234 234
 				self::$has_dismiss_interval_notice = $notice['dismiss_interval'];
235 235
 			}
236 236
 
237
-			$css_id = ( false === strpos( $notice['id'], 'give' ) ? "give-{$notice['id']}" : $notice['id'] );
237
+			$css_id = (false === strpos($notice['id'], 'give') ? "give-{$notice['id']}" : $notice['id']);
238 238
 
239
-			$css_class = 'give-notice notice ' . ( empty( $notice['dismissible'] ) ? 'non' : 'is' ) . "-dismissible {$notice['type']} notice-{$notice['type']}";
240
-			$output    .= sprintf(
241
-				'<div id="%1$s" class="%2$s" data-dismissible="%3$s" data-dismissible-type="%4$s" data-dismiss-interval="%5$s" data-notice-id="%6$s" data-security="%7$s" data-dismiss-interval-time="%8$s" style="display: none">' . " \n",
239
+			$css_class = 'give-notice notice '.(empty($notice['dismissible']) ? 'non' : 'is')."-dismissible {$notice['type']} notice-{$notice['type']}";
240
+			$output .= sprintf(
241
+				'<div id="%1$s" class="%2$s" data-dismissible="%3$s" data-dismissible-type="%4$s" data-dismiss-interval="%5$s" data-notice-id="%6$s" data-security="%7$s" data-dismiss-interval-time="%8$s" style="display: none">'." \n",
242 242
 				$css_id,
243 243
 				$css_class,
244
-				give_clean( $notice['dismissible'] ),
244
+				give_clean($notice['dismissible']),
245 245
 				$notice['dismissible_type'],
246 246
 				$notice['dismiss_interval'],
247 247
 				$notice['id'],
248
-				empty( $notice['dismissible_type'] ) ? '' : wp_create_nonce( "give_edit_{$notice_id}_notice" ),
248
+				empty($notice['dismissible_type']) ? '' : wp_create_nonce("give_edit_{$notice_id}_notice"),
249 249
 				$notice['dismiss_interval_time']
250 250
 			);
251 251
 
252
-			$output .= ( 0 === strpos( $notice['description'], '<div' ) || 0 === strpos( $notice['description'], '<p' ) ? $notice['description'] : "<p>{$notice['description']}</p>" );
252
+			$output .= (0 === strpos($notice['description'], '<div') || 0 === strpos($notice['description'], '<p') ? $notice['description'] : "<p>{$notice['description']}</p>");
253 253
 			$output .= "</div> \n";
254 254
 		}
255 255
 
@@ -267,18 +267,18 @@  discard block
 block discarded – undo
267 267
 	 *
268 268
 	 * @param int $form_id
269 269
 	 */
270
-	public function render_frontend_notices( $form_id = 0 ) {
270
+	public function render_frontend_notices($form_id = 0) {
271 271
 		$errors = give_get_errors();
272 272
 
273
-		$request_form_id = isset( $_REQUEST['form-id'] ) ? absint( $_REQUEST['form-id'] ) : 0;
273
+		$request_form_id = isset($_REQUEST['form-id']) ? absint($_REQUEST['form-id']) : 0;
274 274
 
275 275
 		// Sanity checks first: Ensure that gateway returned errors display on the appropriate form.
276
-		if ( ! isset( $_POST['give_ajax'] ) && $request_form_id !== $form_id ) {
276
+		if ( ! isset($_POST['give_ajax']) && $request_form_id !== $form_id) {
277 277
 			return;
278 278
 		}
279 279
 
280
-		if ( $errors ) {
281
-			self::print_frontend_errors( $errors );
280
+		if ($errors) {
281
+			self::print_frontend_errors($errors);
282 282
 
283 283
 			give_clear_errors();
284 284
 		}
@@ -295,13 +295,13 @@  discard block
 block discarded – undo
295 295
 	 *
296 296
 	 * @return void
297 297
 	 */
298
-	public function render_frontend_form_notices( $form_id ) {
299
-		$display_option = give_get_meta( $form_id, '_give_payment_display', true );
298
+	public function render_frontend_form_notices($form_id) {
299
+		$display_option = give_get_meta($form_id, '_give_payment_display', true);
300 300
 
301
-		if ( 'modal' === $display_option ) {
302
-			add_action( 'give_payment_mode_top', array( $this, 'render_frontend_notices' ) );
301
+		if ('modal' === $display_option) {
302
+			add_action('give_payment_mode_top', array($this, 'render_frontend_notices'));
303 303
 		} else {
304
-			add_action( 'give_pre_form', array( $this, 'render_frontend_notices' ), 11 );
304
+			add_action('give_pre_form', array($this, 'render_frontend_notices'), 11);
305 305
 		}
306 306
 	}
307 307
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 	 * @access private
313 313
 	 */
314 314
 	private function print_js() {
315
-		if ( self::$has_auto_dismissible_notice ) :
315
+		if (self::$has_auto_dismissible_notice) :
316 316
 			?>
317 317
 			<script>
318 318
 				jQuery(document).ready(function () {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 			<?php
329 329
 		endif;
330 330
 
331
-		if ( self::$has_dismiss_interval_notice ) :
331
+		if (self::$has_dismiss_interval_notice) :
332 332
 			?>
333 333
 			<script>
334 334
 				jQuery(document).ready(function () {
@@ -407,36 +407,36 @@  discard block
 block discarded – undo
407 407
 	 * @access public
408 408
 	 */
409 409
 	public function dismiss_notices() {
410
-		$_post     = give_clean( $_POST );
411
-		$notice_id = esc_attr( $_post['notice_id'] );
410
+		$_post     = give_clean($_POST);
411
+		$notice_id = esc_attr($_post['notice_id']);
412 412
 
413 413
 		// Bailout.
414 414
 		if (
415
-			empty( $notice_id ) ||
416
-			empty( $_post['dismissible_type'] ) ||
417
-			empty( $_post['dismiss_interval'] ) ||
418
-			! check_ajax_referer( "give_edit_{$notice_id}_notice", '_wpnonce' )
415
+			empty($notice_id) ||
416
+			empty($_post['dismissible_type']) ||
417
+			empty($_post['dismiss_interval']) ||
418
+			! check_ajax_referer("give_edit_{$notice_id}_notice", '_wpnonce')
419 419
 		) {
420 420
 			wp_send_json_error();
421 421
 		}
422 422
 
423
-		$notice_key = Give()->notices->get_notice_key( $notice_id, $_post['dismiss_interval'] );
424
-		if ( 'user' === $_post['dismissible_type'] ) {
423
+		$notice_key = Give()->notices->get_notice_key($notice_id, $_post['dismiss_interval']);
424
+		if ('user' === $_post['dismissible_type']) {
425 425
 			$current_user = wp_get_current_user();
426
-			$notice_key   = Give()->notices->get_notice_key( $notice_id, $_post['dismiss_interval'], $current_user->ID );
426
+			$notice_key   = Give()->notices->get_notice_key($notice_id, $_post['dismiss_interval'], $current_user->ID);
427 427
 		}
428 428
 
429
-		$notice_dismiss_time = ! empty( $_post['dismiss_interval_time'] ) ? $_post['dismiss_interval_time'] : null;
429
+		$notice_dismiss_time = ! empty($_post['dismiss_interval_time']) ? $_post['dismiss_interval_time'] : null;
430 430
 
431 431
 		// Save option to hide notice.
432
-		Give_Cache::set( $notice_key, true, $notice_dismiss_time, true );
432
+		Give_Cache::set($notice_key, true, $notice_dismiss_time, true);
433 433
 
434 434
 		/**
435 435
 		 * Fire the action when notice dismissed
436 436
 		 *
437 437
 		 * @since 2.2.0
438 438
 		 */
439
-		do_action( 'give_notice_dismissed', $_post );
439
+		do_action('give_notice_dismissed', $_post);
440 440
 
441 441
 		wp_send_json_success();
442 442
 	}
@@ -454,18 +454,18 @@  discard block
 block discarded – undo
454 454
 	 *
455 455
 	 * @return string
456 456
 	 */
457
-	public function get_notice_key( $notice_id, $dismiss_interval = null, $user_id = 0 ) {
457
+	public function get_notice_key($notice_id, $dismiss_interval = null, $user_id = 0) {
458 458
 		$notice_key = "_give_notice_{$notice_id}";
459 459
 
460
-		if ( ! empty( $dismiss_interval ) ) {
460
+		if ( ! empty($dismiss_interval)) {
461 461
 			$notice_key .= "_{$dismiss_interval}";
462 462
 		}
463 463
 
464
-		if ( $user_id ) {
464
+		if ($user_id) {
465 465
 			$notice_key .= "_{$user_id}";
466 466
 		}
467 467
 
468
-		$notice_key = sanitize_key( $notice_key );
468
+		$notice_key = sanitize_key($notice_key);
469 469
 
470 470
 		return $notice_key;
471 471
 	}
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 	 *
479 479
 	 * @return string
480 480
 	 */
481
-	public function get_dismiss_link( $notice_args ) {
481
+	public function get_dismiss_link($notice_args) {
482 482
 		$notice_args = wp_parse_args(
483 483
 			$notice_args,
484 484
 			array(
485
-				'title'                 => __( 'Click here', 'give' ),
485
+				'title'                 => __('Click here', 'give'),
486 486
 				'dismissible_type'      => '',
487 487
 				'dismiss_interval'      => '',
488 488
 				'dismiss_interval_time' => null,
@@ -509,31 +509,31 @@  discard block
 block discarded – undo
509 509
 	 *
510 510
 	 * @return bool|null
511 511
 	 */
512
-	public function is_notice_dismissed( $notice ) {
513
-		$notice_key          = $this->get_notice_key( $notice['id'], $notice['dismiss_interval'] );
512
+	public function is_notice_dismissed($notice) {
513
+		$notice_key          = $this->get_notice_key($notice['id'], $notice['dismiss_interval']);
514 514
 		$is_notice_dismissed = false;
515 515
 
516
-		if ( 'user' === $notice['dismissible_type'] ) {
516
+		if ('user' === $notice['dismissible_type']) {
517 517
 			$current_user = wp_get_current_user();
518
-			$notice_key   = Give()->notices->get_notice_key( $notice['id'], $notice['dismiss_interval'], $current_user->ID );
518
+			$notice_key   = Give()->notices->get_notice_key($notice['id'], $notice['dismiss_interval'], $current_user->ID);
519 519
 		}
520 520
 
521
-		$notice_data = Give_Cache::get( $notice_key, true );
521
+		$notice_data = Give_Cache::get($notice_key, true);
522 522
 
523 523
 		// Find notice dismiss link status if notice has extra dismissible links.
524
-		if ( ( empty( $notice_data ) || is_wp_error( $notice_data ) ) && ! empty( $notice['extra_links'] ) ) {
524
+		if ((empty($notice_data) || is_wp_error($notice_data)) && ! empty($notice['extra_links'])) {
525 525
 
526
-			foreach ( $notice['extra_links'] as $extra_link ) {
527
-				$new_notice_data = wp_parse_args( $extra_link, $notice );
528
-				unset( $new_notice_data['extra_links'] );
526
+			foreach ($notice['extra_links'] as $extra_link) {
527
+				$new_notice_data = wp_parse_args($extra_link, $notice);
528
+				unset($new_notice_data['extra_links']);
529 529
 
530
-				if ( $is_notice_dismissed = $this->is_notice_dismissed( $new_notice_data ) ) {
530
+				if ($is_notice_dismissed = $this->is_notice_dismissed($new_notice_data)) {
531 531
 					return $is_notice_dismissed;
532 532
 				}
533 533
 			}
534 534
 		}
535 535
 
536
-		$is_notice_dismissed = ! empty( $notice_data ) && ! is_wp_error( $notice_data );
536
+		$is_notice_dismissed = ! empty($notice_data) && ! is_wp_error($notice_data);
537 537
 
538 538
 		return $is_notice_dismissed;
539 539
 	}
@@ -547,9 +547,9 @@  discard block
 block discarded – undo
547 547
 	 *
548 548
 	 * @param array $errors
549 549
 	 */
550
-	public static function print_frontend_errors( $errors ) {
550
+	public static function print_frontend_errors($errors) {
551 551
 		// Bailout.
552
-		if ( ! $errors ) {
552
+		if ( ! $errors) {
553 553
 			return;
554 554
 		}
555 555
 
@@ -564,37 +564,37 @@  discard block
 block discarded – undo
564 564
 		);
565 565
 
566 566
 		// Note: we will remove give_errors class in future.
567
-		$classes = apply_filters( 'give_error_class', array( 'give_notices', 'give_errors' ) );
567
+		$classes = apply_filters('give_error_class', array('give_notices', 'give_errors'));
568 568
 
569
-		echo sprintf( '<div class="%s">', implode( ' ', $classes ) );
569
+		echo sprintf('<div class="%s">', implode(' ', $classes));
570 570
 
571 571
 		// Loop error codes and display errors.
572
-		foreach ( $errors as $error_id => $error ) {
572
+		foreach ($errors as $error_id => $error) {
573 573
 			// Backward compatibility v<1.8.11
574
-			if ( is_string( $error ) ) {
574
+			if (is_string($error)) {
575 575
 				$error = array(
576 576
 					'message'     => $error,
577 577
 					'notice_args' => array(),
578 578
 				);
579 579
 			}
580 580
 
581
-			$notice_args = wp_parse_args( $error['notice_args'], $default_notice_args );
581
+			$notice_args = wp_parse_args($error['notice_args'], $default_notice_args);
582 582
 
583 583
 			/**
584 584
 			 * Filter to modify Frontend Errors args before errors is display.
585 585
 			 *
586 586
 			 * @since 1.8.14
587 587
 			 */
588
-			$notice_args = apply_filters( 'give_frontend_errors_args', $notice_args );
588
+			$notice_args = apply_filters('give_frontend_errors_args', $notice_args);
589 589
 
590 590
 			echo sprintf(
591 591
 				'<div class="give_error give_notice" id="give_error_%1$s" data-dismissible="%2$s" data-dismiss-interval="%3$d">
592 592
 						<p><strong>%4$s</strong>: %5$s</p>
593 593
 					</div>',
594 594
 				$error_id,
595
-				give_clean( $notice_args['dismissible'] ),
596
-				absint( $notice_args['dismiss_interval'] ),
597
-				esc_html__( 'Error', 'give' ),
595
+				give_clean($notice_args['dismissible']),
596
+				absint($notice_args['dismiss_interval']),
597
+				esc_html__('Error', 'give'),
598 598
 				$error['message']
599 599
 			);
600 600
 		}
@@ -616,8 +616,8 @@  discard block
 block discarded – undo
616 616
 	 *
617 617
 	 * @return  string
618 618
 	 */
619
-	public static function print_frontend_notice( $message, $echo = true, $notice_type = 'warning', $notice_args = array() ) {
620
-		if ( empty( $message ) ) {
619
+	public static function print_frontend_notice($message, $echo = true, $notice_type = 'warning', $notice_args = array()) {
620
+		if (empty($message)) {
621 621
 			return '';
622 622
 		}
623 623
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 			'dismiss_interval' => 5000,
633 633
 		);
634 634
 
635
-		$notice_args = wp_parse_args( $notice_args, $default_notice_args );
635
+		$notice_args = wp_parse_args($notice_args, $default_notice_args);
636 636
 
637 637
 		// Notice dismissible must be true for dismiss type.
638 638
 		$notice_args['dismiss_type'] = ! $notice_args['dismissible'] ? '' : $notice_args['dismiss_type'];
@@ -642,15 +642,14 @@  discard block
 block discarded – undo
642 642
 		 *
643 643
 		 * @since 1.8.14
644 644
 		 */
645
-		$notice_args = apply_filters( 'give_frontend_notice_args', $notice_args );
645
+		$notice_args = apply_filters('give_frontend_notice_args', $notice_args);
646 646
 
647 647
 		$close_icon = 'manual' === $notice_args['dismiss_type'] ?
648 648
 			sprintf(
649 649
 				'<img class="notice-dismiss give-notice-close" src="%s" />',
650
-				esc_url( GIVE_PLUGIN_URL . 'assets/dist/images/close.svg' )
650
+				esc_url(GIVE_PLUGIN_URL.'assets/dist/images/close.svg')
651 651
 
652
-			) :
653
-			'';
652
+			) : '';
654 653
 
655 654
 		// Note: we will remove give_errors class in future.
656 655
 		$error = sprintf(
@@ -661,15 +660,15 @@  discard block
 block discarded – undo
661 660
 						%6$s
662 661
 					</div>',
663 662
 			$notice_type,
664
-			give_clean( $notice_args['dismissible'] ),
665
-			absint( $notice_args['dismiss_interval'] ),
666
-			give_clean( $notice_args['dismiss_type'] ),
663
+			give_clean($notice_args['dismissible']),
664
+			absint($notice_args['dismiss_interval']),
665
+			give_clean($notice_args['dismiss_type']),
667 666
 			$message,
668 667
 			$close_icon
669 668
 
670 669
 		);
671 670
 
672
-		if ( ! $echo ) {
671
+		if ( ! $echo) {
673 672
 			return $error;
674 673
 		}
675 674
 
@@ -689,24 +688,24 @@  discard block
 block discarded – undo
689 688
 	 *
690 689
 	 * @return string
691 690
 	 */
692
-	public function print_admin_notices( $notice_args = array() ) {
691
+	public function print_admin_notices($notice_args = array()) {
693 692
 		// Bailout.
694
-		if ( empty( $notice_args['description'] ) ) {
693
+		if (empty($notice_args['description'])) {
695 694
 			return '';
696 695
 		}
697 696
 
698
-		$defaults    = array(
697
+		$defaults = array(
699 698
 			'id'          => '',
700 699
 			'echo'        => true,
701 700
 			'notice_type' => 'warning',
702 701
 			'dismissible' => true,
703 702
 		);
704
-		$notice_args = wp_parse_args( $notice_args, $defaults );
703
+		$notice_args = wp_parse_args($notice_args, $defaults);
705 704
 
706 705
 		$output    = '';
707
-		$css_id    = ! empty( $notice_args['id'] ) ? $notice_args['id'] : uniqid( 'give-inline-notice-' );
706
+		$css_id    = ! empty($notice_args['id']) ? $notice_args['id'] : uniqid('give-inline-notice-');
708 707
 		$css_class = "notice-{$notice_args['notice_type']} give-notice notice inline";
709
-		$css_class .= ( $notice_args['dismissible'] ) ? ' is-dismissible' : '';
708
+		$css_class .= ($notice_args['dismissible']) ? ' is-dismissible' : '';
710 709
 		$output    .= sprintf(
711 710
 			'<div id="%1$s" class="%2$s"><p>%3$s</p></div>',
712 711
 			$css_id,
@@ -714,7 +713,7 @@  discard block
 block discarded – undo
714 713
 			$notice_args['description']
715 714
 		);
716 715
 
717
-		if ( ! $notice_args['echo'] ) {
716
+		if ( ! $notice_args['echo']) {
718 717
 			return $output;
719 718
 		}
720 719
 
Please login to merge, or discard this patch.
includes/class-give-scripts.php 1 patch
Spacing   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 * @since 2.1.0
38 38
 	 */
39 39
 	public function __construct() {
40
-		$this->direction      = ( is_rtl() || isset( $_GET['d'] ) && 'rtl' === $_GET['d'] ) ? '.rtl' : '';
41
-		$this->scripts_footer = give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ? true : false;
40
+		$this->direction      = (is_rtl() || isset($_GET['d']) && 'rtl' === $_GET['d']) ? '.rtl' : '';
41
+		$this->scripts_footer = give_is_setting_enabled(give_get_option('scripts_footer')) ? true : false;
42 42
 		$this->init();
43 43
 	}
44 44
 
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function init() {
51 51
 
52
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
54
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_styles' ) );
55
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
52
+		add_action('admin_enqueue_scripts', array($this, 'register_styles'));
53
+		add_action('admin_enqueue_scripts', array($this, 'register_scripts'));
54
+		add_action('wp_enqueue_scripts', array($this, 'register_styles'));
55
+		add_action('wp_enqueue_scripts', array($this, 'register_scripts'));
56 56
 
57
-		if ( is_admin() ) {
58
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
59
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ) );
60
-			add_action( 'enqueue_block_editor_assets', array( $this, 'gutenberg_admin_scripts' ) );
61
-			add_action( 'admin_head', array( $this, 'global_admin_head' ) );
57
+		if (is_admin()) {
58
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
59
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_styles'));
60
+			add_action('enqueue_block_editor_assets', array($this, 'gutenberg_admin_scripts'));
61
+			add_action('admin_head', array($this, 'global_admin_head'));
62 62
 
63 63
 		} else {
64
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_styles' ) );
65
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) );
64
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_styles'));
65
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_scripts'));
66 66
 		}
67 67
 	}
68 68
 
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
 	public function register_styles() {
75 75
 
76 76
 		// WP-admin.
77
-		wp_register_style( 'give-admin-styles', GIVE_PLUGIN_URL . 'assets/dist/css/admin' . $this->direction . '.css', array(), GIVE_VERSION );
77
+		wp_register_style('give-admin-styles', GIVE_PLUGIN_URL.'assets/dist/css/admin'.$this->direction.'.css', array(), GIVE_VERSION);
78 78
 
79 79
 		// WP-admin: plugin page.
80 80
 		wp_register_style(
81 81
 			'plugin-deactivation-survey-css',
82
-			GIVE_PLUGIN_URL . 'assets/dist/css/plugin-deactivation-survey.css',
82
+			GIVE_PLUGIN_URL.'assets/dist/css/plugin-deactivation-survey.css',
83 83
 			array(),
84 84
 			GIVE_VERSION
85 85
 		);
86 86
 
87 87
 		// Frontend.
88
-		if ( give_is_setting_enabled( give_get_option( 'css' ) ) ) {
89
-			wp_register_style( 'give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
88
+		if (give_is_setting_enabled(give_get_option('css'))) {
89
+			wp_register_style('give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all');
90 90
 		}
91 91
 	}
92 92
 
@@ -98,23 +98,23 @@  discard block
 block discarded – undo
98 98
 	public function register_scripts() {
99 99
 
100 100
 		// WP-Admin.
101
-		wp_register_script( 'give-admin-scripts', GIVE_PLUGIN_URL . 'assets/dist/js/admin.js', array(
101
+		wp_register_script('give-admin-scripts', GIVE_PLUGIN_URL.'assets/dist/js/admin.js', array(
102 102
 			'jquery',
103 103
 			'jquery-ui-datepicker',
104 104
 			'wp-color-picker',
105 105
 			'jquery-query',
106
-		), GIVE_VERSION );
106
+		), GIVE_VERSION);
107 107
 
108 108
 		// WP-admin: plugin page.
109
-		wp_register_script( 'plugin-deactivation-survey-js',
110
-			GIVE_PLUGIN_URL . 'assets/dist/js/plugin-deactivation-survey.js',
111
-			array( 'jquery' ),
109
+		wp_register_script('plugin-deactivation-survey-js',
110
+			GIVE_PLUGIN_URL.'assets/dist/js/plugin-deactivation-survey.js',
111
+			array('jquery'),
112 112
 			GIVE_VERSION,
113 113
 			true
114 114
 		);
115 115
 
116 116
 		// Frontend.
117
-		wp_register_script( 'give', GIVE_PLUGIN_URL . 'assets/dist/js/give.js', array( 'jquery' ), GIVE_VERSION, $this->scripts_footer );
117
+		wp_register_script('give', GIVE_PLUGIN_URL.'assets/dist/js/give.js', array('jquery'), GIVE_VERSION, $this->scripts_footer);
118 118
 	}
119 119
 
120 120
 	/**
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @param string $hook Page hook.
126 126
 	 */
127
-	public function admin_enqueue_styles( $hook ) {
127
+	public function admin_enqueue_styles($hook) {
128 128
 		// Give Admin Only.
129
-		if ( ! apply_filters( 'give_load_admin_styles', give_is_admin_page(), $hook ) ) {
129
+		if ( ! apply_filters('give_load_admin_styles', give_is_admin_page(), $hook)) {
130 130
 			return;
131 131
 		}
132 132
 
133 133
 		// Give enqueues.
134
-		wp_enqueue_style( 'give-admin-styles' );
135
-		wp_enqueue_style( 'give-admin-bar-notification' );
134
+		wp_enqueue_style('give-admin-styles');
135
+		wp_enqueue_style('give-admin-bar-notification');
136 136
 
137 137
 		// WP Core enqueues.
138
-		wp_enqueue_style( 'wp-color-picker' );
139
-		wp_enqueue_style( 'thickbox' ); // @TODO remove once we have modal API.
138
+		wp_enqueue_style('wp-color-picker');
139
+		wp_enqueue_style('thickbox'); // @TODO remove once we have modal API.
140 140
 
141 141
 	}
142 142
 
@@ -147,27 +147,27 @@  discard block
 block discarded – undo
147 147
 	 *
148 148
 	 * @param string $hook Page hook.
149 149
 	 */
150
-	public function admin_enqueue_scripts( $hook ) {
150
+	public function admin_enqueue_scripts($hook) {
151 151
 		global $pagenow;
152 152
 
153 153
 		// Plugin page script
154
-		if ( 'plugins.php' === $pagenow ) {
154
+		if ('plugins.php' === $pagenow) {
155 155
 			$this->plugin_equeue_scripts();
156 156
 		}
157 157
 
158 158
 		// Give Admin Only.
159
-		if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
159
+		if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
160 160
 			return;
161 161
 		}
162 162
 
163 163
 		// WP Scripts.
164
-		wp_enqueue_script( 'wp-color-picker' );
165
-		wp_enqueue_script( 'jquery-ui-datepicker' );
166
-		wp_enqueue_script( 'thickbox' );
164
+		wp_enqueue_script('wp-color-picker');
165
+		wp_enqueue_script('jquery-ui-datepicker');
166
+		wp_enqueue_script('thickbox');
167 167
 		wp_enqueue_media();
168 168
 
169 169
 		// Give admin scripts.
170
-		wp_enqueue_script( 'give-admin-scripts' );
170
+		wp_enqueue_script('give-admin-scripts');
171 171
 
172 172
 		// Localize admin scripts
173 173
 		$this->admin_localize_scripts();
@@ -183,19 +183,19 @@  discard block
 block discarded – undo
183 183
 	 *
184 184
 	 */
185 185
 	private function plugin_equeue_scripts() {
186
-		wp_enqueue_style( 'plugin-deactivation-survey-css' );
187
-		wp_enqueue_script( 'plugin-deactivation-survey-js' );
186
+		wp_enqueue_style('plugin-deactivation-survey-css');
187
+		wp_enqueue_script('plugin-deactivation-survey-js');
188 188
 
189 189
 		$localized_data = array(
190
-			'nonce'                           => wp_create_nonce( 'deactivation_survey_nonce' ),
191
-			'cancel'                          => __( 'Cancel', 'give' ),
192
-			'deactivation_no_option_selected' => __( 'Error: Please select at least one option.', 'give' ),
193
-			'submit_and_deactivate'           => __( 'Submit and Deactivate', 'give' ),
194
-			'skip_and_deactivate'             => __( 'Skip & Deactivate', 'give' ),
195
-			'please_fill_field'               => __( 'Error: Please fill the field.', 'give' ),
190
+			'nonce'                           => wp_create_nonce('deactivation_survey_nonce'),
191
+			'cancel'                          => __('Cancel', 'give'),
192
+			'deactivation_no_option_selected' => __('Error: Please select at least one option.', 'give'),
193
+			'submit_and_deactivate'           => __('Submit and Deactivate', 'give'),
194
+			'skip_and_deactivate'             => __('Skip & Deactivate', 'give'),
195
+			'please_fill_field'               => __('Error: Please fill the field.', 'give'),
196 196
 
197 197
 		);
198
-		wp_localize_script( 'plugin-deactivation-survey-js', 'give_vars', $localized_data );
198
+		wp_localize_script('plugin-deactivation-survey-js', 'give_vars', $localized_data);
199 199
 	}
200 200
 
201 201
 	/**
@@ -212,119 +212,119 @@  discard block
 block discarded – undo
212 212
 
213 213
 		// Localize strings & variables for JS.
214 214
 		$localized_data = array(
215
-			'post_id'                           => isset( $post->ID ) ? $post->ID : null,
215
+			'post_id'                           => isset($post->ID) ? $post->ID : null,
216 216
 			'give_version'                      => GIVE_VERSION,
217 217
 			'thousands_separator'               => $thousand_separator,
218 218
 			'decimal_separator'                 => $decimal_separator,
219
-			'quick_edit_warning'                => __( 'Not available for variable priced forms.', 'give' ),
220
-			'delete_payment'                    => __( 'Are you sure you want to <strong>permanently</strong> delete this donation?', 'give' ),
221
-			'delete_payment_note'               => __( 'Are you sure you want to delete this note?', 'give' ),
222
-			'revoke_api_key'                    => __( 'Are you sure you want to revoke this API key?', 'give' ),
223
-			'regenerate_api_key'                => __( 'Are you sure you want to regenerate this API key?', 'give' ),
224
-			'resend_receipt'                    => __( 'Are you sure you want to resend the donation receipt?', 'give' ),
225
-			'disconnect_user'                   => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ),
226
-			'one_option'                        => __( 'Choose a form', 'give' ),
227
-			'one_or_more_option'                => __( 'Choose one or more forms', 'give' ),
228
-			'currency_sign'                     => give_currency_filter( '' ),
229
-			'currency_pos'                      => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
219
+			'quick_edit_warning'                => __('Not available for variable priced forms.', 'give'),
220
+			'delete_payment'                    => __('Are you sure you want to <strong>permanently</strong> delete this donation?', 'give'),
221
+			'delete_payment_note'               => __('Are you sure you want to delete this note?', 'give'),
222
+			'revoke_api_key'                    => __('Are you sure you want to revoke this API key?', 'give'),
223
+			'regenerate_api_key'                => __('Are you sure you want to regenerate this API key?', 'give'),
224
+			'resend_receipt'                    => __('Are you sure you want to resend the donation receipt?', 'give'),
225
+			'disconnect_user'                   => __('Are you sure you want to disconnect the user from this donor?', 'give'),
226
+			'one_option'                        => __('Choose a form', 'give'),
227
+			'one_or_more_option'                => __('Choose one or more forms', 'give'),
228
+			'currency_sign'                     => give_currency_filter(''),
229
+			'currency_pos'                      => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
230 230
 			'currency_decimals'                 => give_get_price_decimals(),
231
-			'ok'                                => __( 'Ok', 'give' ),
232
-			'cancel'                            => __( 'Cancel', 'give' ),
233
-			'success'                           => __( 'Success', 'give' ),
234
-			'error'                             => __( 'Error', 'give' ),
235
-			'close'                             => __( 'Close', 'give' ),
236
-			'confirm'                           => __( 'Confirm', 'give' ),
237
-			'confirm_action'                    => __( 'Confirm Action', 'give' ),
238
-			'confirm_deletion'                  => __( 'Confirm Deletion', 'give' ),
239
-			'confirm_delete_donation'           => __( 'Confirm Delete Donation', 'give' ),
240
-			'confirm_resend'                    => __( 'Confirm re-send', 'give' ),
241
-			'confirm_bulk_action'               => __( 'Confirm bulk action', 'give' ),
242
-			'restart_upgrade'                   => __( 'Do you want to restart the update process?', 'give' ),
243
-			'restart_update'                    => __( 'It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give' ),
244
-			'stop_upgrade'                      => __( 'Do you want to stop the update process now?', 'give' ),
245
-			'import_failed'                     => __( 'Import failed', 'give' ),
246
-			'flush_success'                     => __( 'Flush success', 'give' ),
247
-			'flush_error'                       => __( 'Flush error', 'give' ),
248
-			'no_form_selected'                  => __( 'No form selected', 'give' ),
249
-			'batch_export_no_class'             => __( 'You must choose a method.', 'give' ),
250
-			'batch_export_no_reqs'              => __( 'Required fields not completed.', 'give' ),
251
-			'reset_stats_warn'                  => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
252
-			'delete_test_donor'                 => __( 'Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give' ),
253
-			'delete_import_donor'               => __( 'Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give' ),
254
-			'price_format_guide'                => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
231
+			'ok'                                => __('Ok', 'give'),
232
+			'cancel'                            => __('Cancel', 'give'),
233
+			'success'                           => __('Success', 'give'),
234
+			'error'                             => __('Error', 'give'),
235
+			'close'                             => __('Close', 'give'),
236
+			'confirm'                           => __('Confirm', 'give'),
237
+			'confirm_action'                    => __('Confirm Action', 'give'),
238
+			'confirm_deletion'                  => __('Confirm Deletion', 'give'),
239
+			'confirm_delete_donation'           => __('Confirm Delete Donation', 'give'),
240
+			'confirm_resend'                    => __('Confirm re-send', 'give'),
241
+			'confirm_bulk_action'               => __('Confirm bulk action', 'give'),
242
+			'restart_upgrade'                   => __('Do you want to restart the update process?', 'give'),
243
+			'restart_update'                    => __('It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give'),
244
+			'stop_upgrade'                      => __('Do you want to stop the update process now?', 'give'),
245
+			'import_failed'                     => __('Import failed', 'give'),
246
+			'flush_success'                     => __('Flush success', 'give'),
247
+			'flush_error'                       => __('Flush error', 'give'),
248
+			'no_form_selected'                  => __('No form selected', 'give'),
249
+			'batch_export_no_class'             => __('You must choose a method.', 'give'),
250
+			'batch_export_no_reqs'              => __('Required fields not completed.', 'give'),
251
+			'reset_stats_warn'                  => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
252
+			'delete_test_donor'                 => __('Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give'),
253
+			'delete_import_donor'               => __('Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give'),
254
+			'price_format_guide'                => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
255 255
 			/* translators : %s: Donation form options metabox */
256
-			'confirm_before_remove_row_text'    => __( 'Do you want to delete this item?', 'give' ),
257
-			'matched_success_failure_page'      => __( 'You cannot set the success and failed pages to the same page', 'give' ),
258
-			'dismiss_notice_text'               => __( 'Dismiss this notice.', 'give' ),
259
-			'search_placeholder'                => __( 'Type to search all forms', 'give' ),
260
-			'search_placeholder_donor'          => __( 'Type to search all donors', 'give' ),
261
-			'search_placeholder_country'        => __( 'Type to search all countries', 'give' ),
262
-			'search_placeholder_state'          => __( 'Type to search all states/provinces', 'give' ),
263
-			'unlock_donor_fields_title'         => __( 'Action forbidden', 'give' ),
264
-			'unlock_donor_fields_message'       => __( 'To edit first name and last name, please go to user profile of the donor.', 'give' ),
265
-			'remove_from_bulk_delete'           => __( 'Remove from Bulk Delete', 'give' ),
256
+			'confirm_before_remove_row_text'    => __('Do you want to delete this item?', 'give'),
257
+			'matched_success_failure_page'      => __('You cannot set the success and failed pages to the same page', 'give'),
258
+			'dismiss_notice_text'               => __('Dismiss this notice.', 'give'),
259
+			'search_placeholder'                => __('Type to search all forms', 'give'),
260
+			'search_placeholder_donor'          => __('Type to search all donors', 'give'),
261
+			'search_placeholder_country'        => __('Type to search all countries', 'give'),
262
+			'search_placeholder_state'          => __('Type to search all states/provinces', 'give'),
263
+			'unlock_donor_fields_title'         => __('Action forbidden', 'give'),
264
+			'unlock_donor_fields_message'       => __('To edit first name and last name, please go to user profile of the donor.', 'give'),
265
+			'remove_from_bulk_delete'           => __('Remove from Bulk Delete', 'give'),
266 266
 			'donors_bulk_action'                => array(
267 267
 				'no_donor_selected'  => array(
268
-					'title' => __( 'No donors selected', 'give' ),
269
-					'desc'  => __( 'You must choose at least one or more donors to delete.', 'give' )
268
+					'title' => __('No donors selected', 'give'),
269
+					'desc'  => __('You must choose at least one or more donors to delete.', 'give')
270 270
 				),
271 271
 				'no_action_selected' => array(
272
-					'title' => __( 'No action selected', 'give' ),
273
-					'desc'  => __( 'You must select a bulk action to proceed.', 'give' ),
272
+					'title' => __('No action selected', 'give'),
273
+					'desc'  => __('You must select a bulk action to proceed.', 'give'),
274 274
 				),
275 275
 			),
276 276
 			'donations_bulk_action'             => array(
277 277
 				'titles'         => array(
278
-					'zero' => __( 'No payments selected', 'give' ),
278
+					'zero' => __('No payments selected', 'give'),
279 279
 				),
280 280
 				'delete'         => array(
281
-					'zero'     => __( 'You must choose at least one or more donations to delete.', 'give' ),
282
-					'single'   => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
283
-					'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
281
+					'zero'     => __('You must choose at least one or more donations to delete.', 'give'),
282
+					'single'   => __('Are you sure you want to permanently delete this donation?', 'give'),
283
+					'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
284 284
 				),
285 285
 				'resend-receipt' => array(
286
-					'zero'     => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
287
-					'single'   => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
288
-					'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
286
+					'zero'     => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
287
+					'single'   => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
288
+					'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
289 289
 				),
290 290
 				'set-to-status'  => array(
291
-					'zero'     => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ),
292
-					'single'   => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ),
293
-					'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ),
291
+					'zero'     => __('You must choose at least one or more donations to set status to {status}.', 'give'),
292
+					'single'   => __('Are you sure you want to set status of this donation to {status}?', 'give'),
293
+					'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'),
294 294
 				),
295 295
 			),
296 296
 			'updates'                           => array(
297
-				'ajax_error' => __( 'Please reload this page and try again', 'give' ),
297
+				'ajax_error' => __('Please reload this page and try again', 'give'),
298 298
 			),
299 299
 			'metabox_fields'                    => array(
300 300
 				'media' => array(
301
-					'button_title' => __( 'Choose Image', 'give' ),
301
+					'button_title' => __('Choose Image', 'give'),
302 302
 				),
303 303
 				'file'  => array(
304
-					'button_title' => __( 'Choose File', 'give' ),
304
+					'button_title' => __('Choose File', 'give'),
305 305
 				),
306 306
 			),
307 307
 			'chosen'                            => array(
308
-				'no_results_msg'  => __( 'No results match {search_term}', 'give' ),
309
-				'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ),
308
+				'no_results_msg'  => __('No results match {search_term}', 'give'),
309
+				'ajax_search_msg' => __('Searching results for match {search_term}', 'give'),
310 310
 			),
311
-			'db_update_confirmation_msg_button' => __( 'Run Updates', 'give' ),
312
-			'db_update_confirmation_msg'        => __( 'The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give' ),
313
-			'error_message'                     => __( 'Something went wrong kindly try again!', 'give' ),
311
+			'db_update_confirmation_msg_button' => __('Run Updates', 'give'),
312
+			'db_update_confirmation_msg'        => __('The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give'),
313
+			'error_message'                     => __('Something went wrong kindly try again!', 'give'),
314 314
 			'give_donation_import'              => 'give_donation_import',
315 315
 			'core_settings_import'              => 'give_core_settings_import',
316
-			'setting_not_save_message'          => __( 'Changes you made may not be saved.', 'give' ),
316
+			'setting_not_save_message'          => __('Changes you made may not be saved.', 'give'),
317 317
 			'give_donation_amounts'             => array(
318
-				'minimum' => apply_filters( 'give_donation_minimum_limit', 1 ),
319
-				'maximum' => apply_filters( 'give_donation_maximum_limit', 999999.99 ),
318
+				'minimum' => apply_filters('give_donation_minimum_limit', 1),
319
+				'maximum' => apply_filters('give_donation_maximum_limit', 999999.99),
320 320
 			),
321
-			'chosen_add_title_prefix'           => __( 'No result found. Press enter to add', 'give' ),
322
-			'db_update_nonce'                   => wp_create_nonce( Give_Updates::$background_updater->get_identifier() ),
321
+			'chosen_add_title_prefix'           => __('No result found. Press enter to add', 'give'),
322
+			'db_update_nonce'                   => wp_create_nonce(Give_Updates::$background_updater->get_identifier()),
323 323
 			'ajax'                              => give_test_ajax_works(),
324 324
 			'date_format'                       => give_get_localized_date_format_to_js(),
325 325
 		);
326 326
 
327
-		wp_localize_script( 'give-admin-scripts', 'give_vars', $localized_data );
327
+		wp_localize_script('give-admin-scripts', 'give_vars', $localized_data);
328 328
 	}
329 329
 
330 330
 	/**
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
 		<style type="text/css" media="screen">
336 336
 			@font-face {
337 337
 				font-family: 'give-icomoon';
338
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
339
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
340
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
341
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
338
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
339
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
340
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
341
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
342 342
 				font-weight: normal;
343 343
 				font-style: normal;
344 344
 			}
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 * @since 2.1.0
362 362
 	 */
363 363
 	public function public_enqueue_styles() {
364
-		wp_enqueue_style( 'give-styles' );
364
+		wp_enqueue_style('give-styles');
365 365
 	}
366 366
 
367 367
 
@@ -373,17 +373,17 @@  discard block
 block discarded – undo
373 373
 	public function public_enqueue_scripts() {
374 374
 
375 375
 		// Call Babel Polyfill with common handle so that it is compatible with plugins and themes.
376
-		if ( ! wp_script_is( 'babel-polyfill', 'enqueued' ) ) {
376
+		if ( ! wp_script_is('babel-polyfill', 'enqueued')) {
377 377
 			wp_enqueue_script(
378 378
 				'babel-polyfill',
379
-				GIVE_PLUGIN_URL . 'assets/dist/js/babel-polyfill.js',
380
-				array( 'jquery' ),
379
+				GIVE_PLUGIN_URL.'assets/dist/js/babel-polyfill.js',
380
+				array('jquery'),
381 381
 				GIVE_VERSION,
382 382
 				false
383 383
 			);
384 384
 		}
385 385
 
386
-		wp_enqueue_script( 'give' );
386
+		wp_enqueue_script('give');
387 387
 
388 388
 		$this->public_localize_scripts();
389 389
 	}
@@ -402,22 +402,22 @@  discard block
 block discarded – undo
402 402
 		 *
403 403
 		 * @return  string $message Send notice message for email access.
404 404
 		 */
405
-		$message = (string) apply_filters( 'give_email_access_mail_send_notice', __( 'Please check your email and click on the link to access your complete donation history.', 'give' ) );
405
+		$message = (string) apply_filters('give_email_access_mail_send_notice', __('Please check your email and click on the link to access your complete donation history.', 'give'));
406 406
 
407
-		$localize_give_vars = apply_filters( 'give_global_script_vars', array(
407
+		$localize_give_vars = apply_filters('give_global_script_vars', array(
408 408
 			'ajaxurl'                     => give_get_ajax_url(),
409
-			'checkout_nonce'              => wp_create_nonce( 'give_checkout_nonce' ),
409
+			'checkout_nonce'              => wp_create_nonce('give_checkout_nonce'),
410 410
 			// Do not use this nonce. Its deprecated.
411 411
 			'currency'                    => give_get_currency(),
412
-			'currency_sign'               => give_currency_filter( '' ),
412
+			'currency_sign'               => give_currency_filter(''),
413 413
 			'currency_pos'                => give_get_currency_position(),
414 414
 			'thousands_separator'         => give_get_price_thousand_separator(),
415 415
 			'decimal_separator'           => give_get_price_decimal_separator(),
416
-			'no_gateway'                  => __( 'Please select a payment method.', 'give' ),
417
-			'bad_minimum'                 => __( 'The minimum custom donation amount for this form is', 'give' ),
418
-			'bad_maximum'                 => __( 'The maximum custom donation amount for this form is', 'give' ),
419
-			'general_loading'             => __( 'Loading...', 'give' ),
420
-			'purchase_loading'            => __( 'Please Wait...', 'give' ),
416
+			'no_gateway'                  => __('Please select a payment method.', 'give'),
417
+			'bad_minimum'                 => __('The minimum custom donation amount for this form is', 'give'),
418
+			'bad_maximum'                 => __('The maximum custom donation amount for this form is', 'give'),
419
+			'general_loading'             => __('Loading...', 'give'),
420
+			'purchase_loading'            => __('Please Wait...', 'give'),
421 421
 			'number_decimals'             => give_get_price_decimals(),
422 422
 			'give_version'                => GIVE_VERSION,
423 423
 			'magnific_options'            => apply_filters(
@@ -431,32 +431,32 @@  discard block
 block discarded – undo
431 431
 				'give_form_translation_js',
432 432
 				array(
433 433
 					// Field name               Validation message.
434
-					'payment-mode'           => __( 'Please select payment mode.', 'give' ),
435
-					'give_first'             => __( 'Please enter your first name.', 'give' ),
436
-					'give_email'             => __( 'Please enter a valid email address.', 'give' ),
437
-					'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
438
-					'give_user_pass'         => __( 'Enter a password.', 'give' ),
439
-					'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
440
-					'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
434
+					'payment-mode'           => __('Please select payment mode.', 'give'),
435
+					'give_first'             => __('Please enter your first name.', 'give'),
436
+					'give_email'             => __('Please enter a valid email address.', 'give'),
437
+					'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
438
+					'give_user_pass'         => __('Enter a password.', 'give'),
439
+					'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
440
+					'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
441 441
 				)
442 442
 			),
443 443
 			'confirm_email_sent_message'  => $message,
444
-			'ajax_vars'                   => apply_filters( 'give_global_ajax_vars', array(
444
+			'ajax_vars'                   => apply_filters('give_global_ajax_vars', array(
445 445
 				'ajaxurl'         => give_get_ajax_url(),
446
-				'ajaxNonce'       => wp_create_nonce( 'give_ajax_nonce' ),
447
-				'loading'         => __( 'Loading', 'give' ),
446
+				'ajaxNonce'       => wp_create_nonce('give_ajax_nonce'),
447
+				'loading'         => __('Loading', 'give'),
448 448
 				// General loading message.
449
-				'select_option'   => __( 'Please select an option', 'give' ),
449
+				'select_option'   => __('Please select an option', 'give'),
450 450
 				// Variable pricing error with multi-donation option enabled.
451
-				'default_gateway' => give_get_default_gateway( null ),
452
-				'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
451
+				'default_gateway' => give_get_default_gateway(null),
452
+				'permalinks'      => get_option('permalink_structure') ? '1' : '0',
453 453
 				'number_decimals' => give_get_price_decimals(),
454
-			) ),
454
+			)),
455 455
 			'cookie_hash'                 => COOKIEHASH,
456
-			'delete_session_nonce_cookie' => absint( Give()->session->is_delete_nonce_cookie() )
457
-		) );
456
+			'delete_session_nonce_cookie' => absint(Give()->session->is_delete_nonce_cookie())
457
+		));
458 458
 
459
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
459
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
460 460
 
461 461
 	}
462 462
 
@@ -470,15 +470,15 @@  discard block
 block discarded – undo
470 470
 	 */
471 471
 	public function get_frontend_stylesheet_uri() {
472 472
 
473
-		$file          = 'give' . $this->direction . '.css';
473
+		$file          = 'give'.$this->direction.'.css';
474 474
 		$templates_dir = give_get_theme_template_dir_name();
475 475
 
476 476
 		// Directory paths to CSS files to support checking via file_exists().
477
-		$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
478
-		$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
479
-		$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
480
-		$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
481
-		$give_plugin_style_sheet    = trailingslashit( GIVE_PLUGIN_DIR ) . 'assets/dist/css/' . $file;
477
+		$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
478
+		$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$this->direction.'.css';
479
+		$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
480
+		$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$this->direction.'.css';
481
+		$give_plugin_style_sheet    = trailingslashit(GIVE_PLUGIN_DIR).'assets/dist/css/'.$file;
482 482
 		$uri                        = false;
483 483
 
484 484
 		/**
@@ -489,23 +489,23 @@  discard block
 block discarded – undo
489 489
 		 * c. followed by non minified version, even if SCRIPT_DEBUG is not enabled. This allows users to copy just give.css to their theme.
490 490
 		 * d. Finally, fallback to the standard Give version. This is the default styles included within the plugin.
491 491
 		 */
492
-		if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
493
-			if ( ! empty( $nonmin ) ) {
494
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
492
+		if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
493
+			if ( ! empty($nonmin)) {
494
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
495 495
 			} else {
496
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
496
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
497 497
 			}
498
-		} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
499
-			if ( ! empty( $nonmin ) ) {
500
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
498
+		} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
499
+			if ( ! empty($nonmin)) {
500
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
501 501
 			} else {
502
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
502
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
503 503
 			}
504
-		} elseif ( file_exists( $give_plugin_style_sheet ) ) {
505
-			$uri = trailingslashit( GIVE_PLUGIN_URL ) . 'assets/dist/css/' . $file;
504
+		} elseif (file_exists($give_plugin_style_sheet)) {
505
+			$uri = trailingslashit(GIVE_PLUGIN_URL).'assets/dist/css/'.$file;
506 506
 		}
507 507
 
508
-		return apply_filters( 'give_get_stylesheet_uri', $uri );
508
+		return apply_filters('give_get_stylesheet_uri', $uri);
509 509
 
510 510
 	}
511 511
 
@@ -517,19 +517,19 @@  discard block
 block discarded – undo
517 517
 		// Enqueue the bundled block JS file
518 518
 		wp_enqueue_script(
519 519
 			'give-blocks-js',
520
-			GIVE_PLUGIN_URL . 'assets/dist/js/gutenberg.js',
521
-			array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ),
520
+			GIVE_PLUGIN_URL.'assets/dist/js/gutenberg.js',
521
+			array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api'),
522 522
 			GIVE_VERSION
523 523
 		);
524 524
 
525 525
 		// Enqueue public styles
526
-		wp_enqueue_style( 'give-styles' );
526
+		wp_enqueue_style('give-styles');
527 527
 
528 528
 		// Enqueue the bundled block css file
529 529
 		wp_enqueue_style(
530 530
 			'give-blocks-css',
531
-			GIVE_PLUGIN_URL . 'assets/dist/css/gutenberg.css',
532
-			array( 'wp-blocks' ),
531
+			GIVE_PLUGIN_URL.'assets/dist/css/gutenberg.css',
532
+			array('wp-blocks'),
533 533
 			GIVE_VERSION
534 534
 		);
535 535
 
Please login to merge, or discard this patch.
templates/shortcode-donor-wall.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // Exit if accessed directly.
7
-if ( ! defined( 'ABSPATH' ) ) {
7
+if ( ! defined('ABSPATH')) {
8 8
 	exit;
9 9
 }
10 10
 
11 11
 /** @var $donor Give_Donor */
12 12
 $donor = $args[0];
13
-$donor = new Give_Donor( $donor->id );
13
+$donor = new Give_Donor($donor->id);
14 14
 
15 15
 $give_settings = $args[1]; // Give settings.
16 16
 $atts          = $args[2]; // Shortcode attributes.
@@ -21,24 +21,24 @@  discard block
 block discarded – undo
21 21
 		<div class="give-donor__header">
22 22
 			<?php
23 23
 			// Maybe display the Avatar.
24
-			if ( true === $atts['show_avatar'] ) {
25
-				echo give_get_donor_avatar( $donor );
24
+			if (true === $atts['show_avatar']) {
25
+				echo give_get_donor_avatar($donor);
26 26
 			}
27 27
 			?>
28 28
 
29 29
 			<div class="give-donor__details">
30
-				<?php if ( true === $atts['show_name'] ) : ?>
31
-					<h3 class="give-donor__name"><?php esc_html_e( $donor->name ); ?></h3>
30
+				<?php if (true === $atts['show_name']) : ?>
31
+					<h3 class="give-donor__name"><?php esc_html_e($donor->name); ?></h3>
32 32
 				<?php endif; ?>
33 33
 
34
-				<?php if ( true === $atts['show_total'] ) : ?>
34
+				<?php if (true === $atts['show_total']) : ?>
35 35
 					<span class="give-donor__total">
36 36
 						<?php
37 37
 						// If not filtered by form ID then display total donations
38 38
 						// Else filtered by form ID, only display donations made for this form.
39 39
 						$donated_amount = $donor->purchase_value;
40 40
 
41
-						if ( ! empty( $atts['form_id'] ) ) {
41
+						if ( ! empty($atts['form_id'])) {
42 42
 							$donated_amount = Give_Donor_Stats::donated(
43 43
 								array(
44 44
 									'donor'      => $donor->id,
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
 							);
48 48
 						}
49 49
 
50
-						echo give_currency_filter( give_format_amount( $donated_amount, array( 'sanitize' => false ) ) );
50
+						echo give_currency_filter(give_format_amount($donated_amount, array('sanitize' => false)));
51 51
 						?>
52 52
 					</span>
53 53
 				<?php endif; ?>
54 54
 
55
-				<?php if ( true === $atts['show_time'] ) : ?>
55
+				<?php if (true === $atts['show_time']) : ?>
56 56
 					<span class="give-donor__timestamp">
57 57
 						<?php
58 58
 						// If not filtered by form ID then display the "Donor Since" text.
59 59
 						// If filtered by form ID then display the last donation date.
60
-						echo $donor->get_last_donation_date( true );
60
+						echo $donor->get_last_donation_date(true);
61 61
 						?>
62 62
 					</span>
63 63
 				<?php endif; ?>
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
 		</div>
66 66
 
67 67
 		<?php
68
-		$comment = give_get_donor_latest_comment( $donor->id, $atts['form_id'] );
68
+		$comment = give_get_donor_latest_comment($donor->id, $atts['form_id']);
69 69
 
70
-		if ( true === $atts['show_comments'] && absint( $atts['comment_length'] ) && $comment instanceof WP_Comment ) :
70
+		if (true === $atts['show_comments'] && absint($atts['comment_length']) && $comment instanceof WP_Comment) :
71 71
 		?>
72 72
 			<div class="give-donor__content">
73 73
 					<?php
74
-					if ( $atts['comment_length'] < strlen( $comment->comment_content ) ) {
74
+					if ($atts['comment_length'] < strlen($comment->comment_content)) {
75 75
 						echo sprintf(
76 76
 							'<p class="give-donor__comment_excerpt">%s&hellip;<span>&nbsp;<a class="give-donor__read-more">%s</a></span></p>',
77
-							substr( $comment->comment_content, 0, $atts['comment_length'] ),
77
+							substr($comment->comment_content, 0, $atts['comment_length']),
78 78
 							$atts['readmore_text']
79 79
 						);
80 80
 
81 81
 						echo sprintf(
82 82
 							'<div class="give-donor__comment" style="display: none">%s</div>',
83
-							apply_filters( 'the_content', $comment->comment_content )
83
+							apply_filters('the_content', $comment->comment_content)
84 84
 						);
85 85
 					} else {
86
-						echo apply_filters( 'the_content', $comment->comment_content );
86
+						echo apply_filters('the_content', $comment->comment_content);
87 87
 					}
88 88
 					?>
89 89
 			</div>
Please login to merge, or discard this patch.
give.php 1 patch
Spacing   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
  */
40 40
 
41 41
 // Exit if accessed directly.
42
-if ( ! defined( 'ABSPATH' ) ) {
42
+if ( ! defined('ABSPATH')) {
43 43
 	exit;
44 44
 }
45 45
 
46
-if ( ! class_exists( 'Give' ) ) :
46
+if ( ! class_exists('Give')) :
47 47
 
48 48
 	/**
49 49
 	 * Main Give Class
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		 * @return    Give
281 281
 		 */
282 282
 		public static function instance() {
283
-			if ( is_null( self::$_instance ) ) {
283
+			if (is_null(self::$_instance)) {
284 284
 				self::$_instance = new self();
285 285
 			}
286 286
 
@@ -292,13 +292,13 @@  discard block
 block discarded – undo
292 292
 		 */
293 293
 		public function __construct() {
294 294
 			// PHP version
295
-			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
296
-				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
295
+			if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) {
296
+				define('GIVE_REQUIRED_PHP_VERSION', '5.3');
297 297
 			}
298 298
 
299 299
 			// Bailout: Need minimum php version to load plugin.
300
-			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
301
-				add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) );
300
+			if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) {
301
+				add_action('admin_notices', array($this, 'minimum_phpversion_notice'));
302 302
 
303 303
 				return;
304 304
 			}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 			$this->includes();
308 308
 			$this->init_hooks();
309 309
 
310
-			do_action( 'give_loaded' );
310
+			do_action('give_loaded');
311 311
 		}
312 312
 
313 313
 		/**
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
 		 * @since  1.8.9
317 317
 		 */
318 318
 		private function init_hooks() {
319
-			register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
320
-			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
319
+			register_activation_hook(GIVE_PLUGIN_FILE, 'give_install');
320
+			add_action('plugins_loaded', array($this, 'init'), 0);
321 321
 
322 322
 			// Set up localization on init Hook.
323
-			add_action( 'init', array( $this, 'load_textdomain' ), 0 );
323
+			add_action('init', array($this, 'load_textdomain'), 0);
324 324
 		}
325 325
 
326 326
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 			 *
337 337
 			 * @since 1.8.9
338 338
 			 */
339
-			do_action( 'before_give_init' );
339
+			do_action('before_give_init');
340 340
 
341 341
 			// Set up localization.
342 342
 			$this->load_textdomain();
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			 *
372 372
 			 * @since 1.8.7
373 373
 			 */
374
-			do_action( 'give_init', $this );
374
+			do_action('give_init', $this);
375 375
 
376 376
 		}
377 377
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		 */
389 389
 		public function __clone() {
390 390
 			// Cloning instances of the class is forbidden.
391
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
391
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
392 392
 		}
393 393
 
394 394
 		/**
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		 */
402 402
 		public function __wakeup() {
403 403
 			// Unserializing instances of the class is forbidden.
404
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
404
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin&#8217; huh?', 'give'), '1.0');
405 405
 		}
406 406
 
407 407
 		/**
@@ -415,33 +415,33 @@  discard block
 block discarded – undo
415 415
 		private function setup_constants() {
416 416
 
417 417
 			// Plugin version
418
-			if ( ! defined( 'GIVE_VERSION' ) ) {
419
-				define( 'GIVE_VERSION', '2.2.1' );
418
+			if ( ! defined('GIVE_VERSION')) {
419
+				define('GIVE_VERSION', '2.2.1');
420 420
 			}
421 421
 
422 422
 			// Plugin Root File
423
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
424
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
423
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
424
+				define('GIVE_PLUGIN_FILE', __FILE__);
425 425
 			}
426 426
 
427 427
 			// Plugin Folder Path
428
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
429
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
428
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
429
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(GIVE_PLUGIN_FILE));
430 430
 			}
431 431
 
432 432
 			// Plugin Folder URL
433
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
434
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
433
+			if ( ! defined('GIVE_PLUGIN_URL')) {
434
+				define('GIVE_PLUGIN_URL', plugin_dir_url(GIVE_PLUGIN_FILE));
435 435
 			}
436 436
 
437 437
 			// Plugin Basename aka: "give/give.php"
438
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
439
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
438
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
439
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(GIVE_PLUGIN_FILE));
440 440
 			}
441 441
 
442 442
 			// Make sure CAL_GREGORIAN is defined
443
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
444
-				define( 'CAL_GREGORIAN', 1 );
443
+			if ( ! defined('CAL_GREGORIAN')) {
444
+				define('CAL_GREGORIAN', 1);
445 445
 			}
446 446
 		}
447 447
 
@@ -459,170 +459,170 @@  discard block
 block discarded – undo
459 459
 			/**
460 460
 			 * Load libraries.
461 461
 			 */
462
-			if ( ! class_exists( 'WP_Async_Request' ) ) {
463
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
462
+			if ( ! class_exists('WP_Async_Request')) {
463
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-async-request.php');
464 464
 			}
465 465
 
466
-			if ( ! class_exists( 'WP_Background_Process' ) ) {
467
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
466
+			if ( ! class_exists('WP_Background_Process')) {
467
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-background-process.php');
468 468
 			}
469 469
 
470 470
 			/**
471 471
 			 * Load plugin files
472 472
 			 */
473
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
474
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
473
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
474
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
475 475
 			$give_options = give_get_settings();
476 476
 
477
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
478
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
479
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
480
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
481
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
482
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
483
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
484
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
485
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
486
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php';
487
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
488
-			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
489
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
490
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php';
491
-
492
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
493
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
494
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
495
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
496
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
497
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
498
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
499
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
500
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
501
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php';
502
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
503
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor-wall-widget.php';
504
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
505
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sessions.php';
506
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
507
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
508
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
509
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
510
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
511
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
512
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-comment.php';
513
-
514
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
515
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
516
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
517
-			require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
518
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
519
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
520
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
521
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
522
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
523
-			require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
524
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
525
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
526
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
527
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
528
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
529
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
530
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
531
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
532
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
533
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
534
-
535
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
536
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
537
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
538
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
539
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
540
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
541
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php';
542
-
543
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
544
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
545
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
546
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
547
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
548
-
549
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
550
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
551
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
552
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
553
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
554
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
555
-
556
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
557
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-wall.php';
558
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-stats.php';
559
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
560
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/frontend-donor-functions.php';
561
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/actions.php';
562
-
563
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
564
-
565
-			require_once GIVE_PLUGIN_DIR . 'blocks/load.php';
566
-
567
-			if ( defined( 'WP_CLI' ) && WP_CLI ) {
568
-				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
477
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
478
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-async-process.php';
479
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
480
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php';
481
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
482
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
483
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
484
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
485
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
486
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api-v2.php';
487
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-tooltips.php';
488
+			require_once GIVE_PLUGIN_DIR.'includes/class-notices.php';
489
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-translation.php';
490
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-readme-parser.php';
491
+
492
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-scripts.php';
493
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
494
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
495
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
496
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
497
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-meta.php';
498
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php';
499
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php';
500
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-form-meta.php';
501
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-sequential-ordering.php';
502
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php';
503
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor-wall-widget.php';
504
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
505
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-sessions.php';
506
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
507
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
508
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
509
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
510
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
511
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-payment-meta.php';
512
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-comment.php';
513
+
514
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
515
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
516
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
517
+			require_once GIVE_PLUGIN_DIR.'includes/import-functions.php';
518
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
519
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
520
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
521
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
522
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
523
+			require_once GIVE_PLUGIN_DIR.'includes/currency-functions.php';
524
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
525
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
526
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
527
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
528
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
529
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
530
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php';
531
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
532
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
533
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
534
+
535
+			require_once GIVE_PLUGIN_DIR.'includes/payments/backward-compatibility.php';
536
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
537
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
538
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
539
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
540
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
541
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-sequential-donation-number.php';
542
+
543
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
544
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
545
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
546
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
547
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
548
+
549
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
550
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
551
+			require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notifications.php';
552
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
553
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
554
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
555
+
556
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donors-query.php';
557
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donor-wall.php';
558
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donor-stats.php';
559
+			require_once GIVE_PLUGIN_DIR.'includes/donors/backward-compatibility.php';
560
+			require_once GIVE_PLUGIN_DIR.'includes/donors/frontend-donor-functions.php';
561
+			require_once GIVE_PLUGIN_DIR.'includes/donors/actions.php';
562
+
563
+			require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php';
564
+
565
+			require_once GIVE_PLUGIN_DIR.'blocks/load.php';
566
+
567
+			if (defined('WP_CLI') && WP_CLI) {
568
+				require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
569 569
 			}
570 570
 
571
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
572
-
573
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
574
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
575
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
576
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
577
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
578
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
579
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
580
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
581
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
582
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
583
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
584
-
585
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
586
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
587
-
588
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
589
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
590
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
591
-
592
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
593
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-give-form-duplicator.php';
594
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
595
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
596
-
597
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
598
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
599
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
600
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
601
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php';
602
-
603
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
604
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
605
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
606
-
607
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
608
-
609
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
610
-
611
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
612
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
613
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
614
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
615
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
616
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
617
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
618
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php';
619
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
620
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
621
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php';
622
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donor-wall.php';
571
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
572
+
573
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
574
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
575
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
576
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
577
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
578
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
579
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
580
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
581
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
582
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
583
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-blank-slate.php';
584
+
585
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
586
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
587
+
588
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php';
589
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php';
590
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php';
591
+
592
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
593
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-give-form-duplicator.php';
594
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
595
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
596
+
597
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php';
598
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php';
599
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php';
600
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php';
601
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/give-export-donations-functions.php';
602
+
603
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php';
604
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php';
605
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php';
606
+
607
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php';
608
+
609
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php';
610
+
611
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
612
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
613
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
614
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
615
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
616
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
617
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
618
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-grid.php';
619
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
620
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
621
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-totals.php';
622
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donor-wall.php';
623 623
 			}// End if().
624 624
 
625
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
625
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
626 626
 
627 627
 		}
628 628
 
@@ -637,16 +637,16 @@  discard block
 block discarded – undo
637 637
 		public function load_textdomain() {
638 638
 
639 639
 			// Set filter for Give's languages directory
640
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
641
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
640
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
641
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
642 642
 
643 643
 			// Traditional WordPress plugin locale filter.
644
-			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
645
-			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
644
+			$locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
645
+			$locale = apply_filters('plugin_locale', $locale, 'give');
646 646
 
647
-			unload_textdomain( 'give' );
648
-			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
649
-			load_plugin_textdomain( 'give', false, $give_lang_dir );
647
+			unload_textdomain('give');
648
+			load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo');
649
+			load_plugin_textdomain('give', false, $give_lang_dir);
650 650
 
651 651
 		}
652 652
 
@@ -659,21 +659,21 @@  discard block
 block discarded – undo
659 659
 		 */
660 660
 		public function minimum_phpversion_notice() {
661 661
 			// Bailout.
662
-			if ( ! is_admin() ) {
662
+			if ( ! is_admin()) {
663 663
 				return;
664 664
 			}
665 665
 
666
-			$notice_desc  = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
667
-			$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
668
-			$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
669
-			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
670
-			$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
671
-			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
672
-			$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
666
+			$notice_desc  = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>';
667
+			$notice_desc .= '<p>'.__('Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give').'</p>';
668
+			$notice_desc .= '<p>'.__('Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give').'</p>';
669
+			$notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>';
670
+			$notice_desc .= '<p>'.__('You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give').'</p>';
671
+			$notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>';
672
+			$notice_desc .= '<p>'.sprintf(__('If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give'), sprintf('<a href="%1$s" target="_blank">', esc_url('https://wordpress.org/hosting/')), '</a>').'</p>';
673 673
 
674 674
 			echo sprintf(
675 675
 				'<div class="notice notice-error">%1$s</div>',
676
-				wp_kses_post( $notice_desc )
676
+				wp_kses_post($notice_desc)
677 677
 			);
678 678
 		}
679 679
 
Please login to merge, or discard this patch.
includes/forms/widget.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
 	 * Instantiate the class
33 33
 	 */
34 34
 	public function __construct() {
35
-		$this->self = get_class( $this );
35
+		$this->self = get_class($this);
36 36
 
37 37
 		parent::__construct(
38
-			strtolower( $this->self ),
39
-			esc_html__( 'Give - Donation Form', 'give' ),
38
+			strtolower($this->self),
39
+			esc_html__('Give - Donation Form', 'give'),
40 40
 			array(
41
-				'description' => esc_html__( 'Display a Give Donation Form in your theme\'s widget powered sidebar.', 'give' ),
41
+				'description' => esc_html__('Display a Give Donation Form in your theme\'s widget powered sidebar.', 'give'),
42 42
 			)
43 43
 		);
44 44
 
45
-		add_action( 'widgets_init', array( $this, 'widget_init' ) );
46
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_widget_scripts' ) );
45
+		add_action('widgets_init', array($this, 'widget_init'));
46
+		add_action('admin_enqueue_scripts', array($this, 'admin_widget_scripts'));
47 47
 	}
48 48
 
49 49
 	/**
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return void
55 55
 	 */
56
-	public function admin_widget_scripts( $hook ) {
56
+	public function admin_widget_scripts($hook) {
57 57
 
58 58
 		// Directories of assets.
59
-		$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
60
-		$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
61
-		$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
59
+		$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
60
+		$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
61
+		$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
62 62
 
63 63
 		// Use minified libraries if SCRIPT_DEBUG is turned off.
64
-		$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
64
+		$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
65 65
 
66 66
 		// Widget Script.
67
-		if ( 'widgets.php' === $hook ) {
67
+		if ('widgets.php' === $hook) {
68 68
 
69
-			wp_enqueue_script( 'give-admin-widgets-scripts', $js_dir . 'admin-widgets' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
69
+			wp_enqueue_script('give-admin-widgets-scripts', $js_dir.'admin-widgets'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
70 70
 		}
71 71
 	}
72 72
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 *                        before_widget, and after_widget.
78 78
 	 * @param array $instance The settings for the particular instance of the widget.
79 79
 	 */
80
-	public function widget( $args, $instance ) {
81
-		$title   = ! empty( $instance['title'] ) ? $instance['title'] : '';
82
-		$title   = apply_filters( 'widget_title', $title, $instance, $this->id_base );
80
+	public function widget($args, $instance) {
81
+		$title   = ! empty($instance['title']) ? $instance['title'] : '';
82
+		$title   = apply_filters('widget_title', $title, $instance, $this->id_base);
83 83
 		$form_id = (int) $instance['id'];
84 84
 
85 85
 		echo $args['before_widget']; // XSS ok.
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 		 *
92 92
 		 * @since 1.0
93 93
 		 */
94
-		do_action( 'give_before_forms_widget', $form_id );
94
+		do_action('give_before_forms_widget', $form_id);
95 95
 
96
-		echo $title ? $args['before_title'] . $title . $args['after_title'] : ''; // XSS ok.
96
+		echo $title ? $args['before_title'].$title.$args['after_title'] : ''; // XSS ok.
97 97
 
98
-		give_get_donation_form( $instance );
98
+		give_get_donation_form($instance);
99 99
 
100 100
 		echo $args['after_widget']; // XSS ok.
101 101
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 		 *
107 107
 		 * @since 1.0
108 108
 		 */
109
-		do_action( 'give_after_forms_widget', $form_id );
109
+		do_action('give_after_forms_widget', $form_id);
110 110
 	}
111 111
 
112 112
 	/**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 *
115 115
 	 * @param array $instance Current settings.
116 116
 	 */
117
-	public function form( $instance ) {
117
+	public function form($instance) {
118 118
 		$defaults = array(
119 119
 			'title'                 => '',
120 120
 			'id'                    => '',
@@ -124,74 +124,74 @@  discard block
 block discarded – undo
124 124
 			'continue_button_title' => '',
125 125
 		);
126 126
 
127
-		$instance = wp_parse_args( (array) $instance, $defaults );
127
+		$instance = wp_parse_args((array) $instance, $defaults);
128 128
 
129 129
 		// Backward compatibility: Set float labels as default if, it was set as empty previous.
130
-		$instance['float_labels'] = empty( $instance['float_labels'] ) ? 'global' : $instance['float_labels'];
130
+		$instance['float_labels'] = empty($instance['float_labels']) ? 'global' : $instance['float_labels'];
131 131
 
132 132
 		// Query Give Forms.
133 133
 		$args = array(
134 134
 			'post_type'      => 'give_forms',
135
-			'posts_per_page' => - 1,
135
+			'posts_per_page' => -1,
136 136
 			'post_status'    => 'publish',
137 137
 		);
138 138
 
139
-		$give_forms = get_posts( $args );
139
+		$give_forms = get_posts($args);
140 140
 		?>
141 141
 		<div class="give_forms_widget_container">
142 142
 
143 143
 			<?php // Widget: widget Title. ?>
144 144
 			<p>
145
-				<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'give' ); ?></label>
146
-				<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" /><br>
147
-				<small class="give-field-description"><?php esc_html_e( 'Leave blank to hide the widget title.', 'give' ); ?></small>
145
+				<label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'give'); ?></label>
146
+				<input type="text" class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" value="<?php echo esc_attr($instance['title']); ?>" /><br>
147
+				<small class="give-field-description"><?php esc_html_e('Leave blank to hide the widget title.', 'give'); ?></small>
148 148
 			</p>
149 149
 
150 150
 			<?php // Widget: Give Form. ?>
151 151
 			<p>
152
-				<label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php esc_html_e( 'Give Form:', 'give' ); ?></label>
153
-				<select class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'id' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>">
154
-					<option value="current"><?php esc_html_e( '- Select -', 'give' ); ?></option>
155
-					<?php foreach ( $give_forms as $give_form ) { ?>
152
+				<label for="<?php echo esc_attr($this->get_field_id('id')); ?>"><?php esc_html_e('Give Form:', 'give'); ?></label>
153
+				<select class="widefat" name="<?php echo esc_attr($this->get_field_name('id')); ?>" id="<?php echo esc_attr($this->get_field_id('id')); ?>">
154
+					<option value="current"><?php esc_html_e('- Select -', 'give'); ?></option>
155
+					<?php foreach ($give_forms as $give_form) { ?>
156 156
 						<?php /* translators: %s: Title */ ?>
157
-						<?php $form_title = empty( $give_form->post_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $give_form->ID ) : $give_form->post_title; ?>
158
-						<option <?php selected( absint( $instance['id'] ), $give_form->ID ); ?> value="<?php echo esc_attr( $give_form->ID ); ?>"><?php echo esc_html( $form_title ); ?></option>
157
+						<?php $form_title = empty($give_form->post_title) ? sprintf(__('Untitled (#%s)', 'give'), $give_form->ID) : $give_form->post_title; ?>
158
+						<option <?php selected(absint($instance['id']), $give_form->ID); ?> value="<?php echo esc_attr($give_form->ID); ?>"><?php echo esc_html($form_title); ?></option>
159 159
 					<?php } ?>
160 160
 				</select><br>
161
-				<small class="give-field-description"><?php esc_html_e( 'Select a Give Form to embed in this widget.', 'give' ); ?></small>
161
+				<small class="give-field-description"><?php esc_html_e('Select a Give Form to embed in this widget.', 'give'); ?></small>
162 162
 			</p>
163 163
 
164 164
 			<?php // Widget: Display Style. ?>
165 165
 			<p class="give_forms_display_style_setting_row">
166
-				<label for="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>"><?php esc_html_e( 'Display Style:', 'give' ); ?></label><br>
167
-				<label for="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-onpage"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-onpage" name="<?php echo esc_attr( $this->get_field_name( 'display_style' ) ); ?>" value="onpage" <?php checked( $instance['display_style'], 'onpage' ); ?>> <?php echo esc_html__( 'All Fields', 'give' ); ?></label>
168
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-reveal"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-reveal" name="<?php echo esc_attr( $this->get_field_name( 'display_style' ) ); ?>" value="reveal" <?php checked( $instance['display_style'], 'reveal' ); ?>> <?php echo esc_html__( 'Reveal', 'give' ); ?></label>
169
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-modal"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-modal" name="<?php echo esc_attr( $this->get_field_name( 'display_style' ) ); ?>" value="modal" <?php checked( $instance['display_style'], 'modal' ); ?>> <?php echo esc_html__( 'Modal', 'give' ); ?></label>
170
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-button"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'display_style' ) ); ?>-button" name="<?php echo esc_attr( $this->get_field_name( 'display_style' ) ); ?>" value="button" <?php checked( $instance['display_style'], 'button' ); ?>> <?php echo esc_html__( 'Button', 'give' ); ?></label><br>
166
+				<label for="<?php echo esc_attr($this->get_field_id('display_style')); ?>"><?php esc_html_e('Display Style:', 'give'); ?></label><br>
167
+				<label for="<?php echo esc_attr($this->get_field_id('display_style')); ?>-onpage"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('display_style')); ?>-onpage" name="<?php echo esc_attr($this->get_field_name('display_style')); ?>" value="onpage" <?php checked($instance['display_style'], 'onpage'); ?>> <?php echo esc_html__('All Fields', 'give'); ?></label>
168
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('display_style')); ?>-reveal"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('display_style')); ?>-reveal" name="<?php echo esc_attr($this->get_field_name('display_style')); ?>" value="reveal" <?php checked($instance['display_style'], 'reveal'); ?>> <?php echo esc_html__('Reveal', 'give'); ?></label>
169
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('display_style')); ?>-modal"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('display_style')); ?>-modal" name="<?php echo esc_attr($this->get_field_name('display_style')); ?>" value="modal" <?php checked($instance['display_style'], 'modal'); ?>> <?php echo esc_html__('Modal', 'give'); ?></label>
170
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('display_style')); ?>-button"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('display_style')); ?>-button" name="<?php echo esc_attr($this->get_field_name('display_style')); ?>" value="button" <?php checked($instance['display_style'], 'button'); ?>> <?php echo esc_html__('Button', 'give'); ?></label><br>
171 171
 				<small class="give-field-description">
172
-					<?php echo esc_html__( 'Select a Give Form style.', 'give' ); ?>
172
+					<?php echo esc_html__('Select a Give Form style.', 'give'); ?>
173 173
 				</small>
174 174
 			</p>
175 175
 
176 176
 			<?php // Widget: Continue Button Title. ?>
177 177
 			<p class="give_forms_continue_button_title_setting_row">
178
-				<label for="<?php echo esc_attr( $this->get_field_id( 'continue_button_title' ) ); ?>"><?php esc_html_e( 'Button Text:', 'give' ); ?></label>
179
-				<input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'continue_button_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'continue_button_title' ) ); ?>" value="<?php echo esc_attr( $instance['continue_button_title'] ); ?>" /><br>
180
-				<small class="give-field-description"><?php esc_html_e( 'The button label for displaying the additional payment fields.', 'give' ); ?></small>
178
+				<label for="<?php echo esc_attr($this->get_field_id('continue_button_title')); ?>"><?php esc_html_e('Button Text:', 'give'); ?></label>
179
+				<input type="text" class="widefat" id="<?php echo esc_attr($this->get_field_id('continue_button_title')); ?>" name="<?php echo esc_attr($this->get_field_name('continue_button_title')); ?>" value="<?php echo esc_attr($instance['continue_button_title']); ?>" /><br>
180
+				<small class="give-field-description"><?php esc_html_e('The button label for displaying the additional payment fields.', 'give'); ?></small>
181 181
 			</p>
182 182
 
183 183
 			<?php // Widget: Floating Labels. ?>
184 184
 			<p>
185
-				<label for="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>"><?php esc_html_e( 'Floating Labels (optional):', 'give' ); ?></label><br>
186
-				<label for="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-global"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-global" name="<?php echo esc_attr( $this->get_field_name( 'float_labels' ) ); ?>" value="global" <?php checked( $instance['float_labels'], 'global' ); ?>> <?php echo esc_html__( 'Global Option', 'give' ); ?></label>
187
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-enabled"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-enabled" name="<?php echo esc_attr( $this->get_field_name( 'float_labels' ) ); ?>" value="enabled" <?php checked( $instance['float_labels'], 'enabled' ); ?>> <?php echo esc_html__( 'Yes', 'give' ); ?></label>
188
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-disabled"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>-disabled" name="<?php echo esc_attr( $this->get_field_name( 'float_labels' ) ); ?>" value="disabled" <?php checked( $instance['float_labels'], 'disabled' ); ?>> <?php echo esc_html__( 'No', 'give' ); ?></label><br>
185
+				<label for="<?php echo esc_attr($this->get_field_id('float_labels')); ?>"><?php esc_html_e('Floating Labels (optional):', 'give'); ?></label><br>
186
+				<label for="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-global"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-global" name="<?php echo esc_attr($this->get_field_name('float_labels')); ?>" value="global" <?php checked($instance['float_labels'], 'global'); ?>> <?php echo esc_html__('Global Option', 'give'); ?></label>
187
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-enabled"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-enabled" name="<?php echo esc_attr($this->get_field_name('float_labels')); ?>" value="enabled" <?php checked($instance['float_labels'], 'enabled'); ?>> <?php echo esc_html__('Yes', 'give'); ?></label>
188
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-disabled"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('float_labels')); ?>-disabled" name="<?php echo esc_attr($this->get_field_name('float_labels')); ?>" value="disabled" <?php checked($instance['float_labels'], 'disabled'); ?>> <?php echo esc_html__('No', 'give'); ?></label><br>
189 189
 				<small class="give-field-description">
190 190
 					<?php
191 191
 					printf(
192 192
 						/* translators: %s: http://docs.givewp.com/form-floating-labels */
193
-						esc_html__( 'Override the <a href="%s" target="_blank">floating labels</a> setting for this Give form.', 'give' ),
194
-						esc_url( 'http://docs.givewp.com/form-floating-labels' )
193
+						esc_html__('Override the <a href="%s" target="_blank">floating labels</a> setting for this Give form.', 'give'),
194
+						esc_url('http://docs.givewp.com/form-floating-labels')
195 195
 					);
196 196
 					?>
197 197
 					</small>
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
 
200 200
 			<?php // Widget: Display Content. ?>
201 201
 			<p>
202
-				<label for="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>"><?php esc_html_e( 'Display Content (optional):', 'give' ); ?></label><br>
203
-				<label for="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-none"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-none" name="<?php echo esc_attr( $this->get_field_name( 'show_content' ) ); ?>" value="none" <?php checked( $instance['show_content'], 'none' ); ?>> <?php echo esc_html__( 'None', 'give' ); ?></label>
204
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-above"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-above" name="<?php echo esc_attr( $this->get_field_name( 'show_content' ) ); ?>" value="above" <?php checked( $instance['show_content'], 'above' ); ?>> <?php echo esc_html__( 'Above', 'give' ); ?></label>
205
-				&nbsp;&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-below"><input type="radio" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'show_content' ) ); ?>-below" name="<?php echo esc_attr( $this->get_field_name( 'show_content' ) ); ?>" value="below" <?php checked( $instance['show_content'], 'below' ); ?>> <?php echo esc_html__( 'Below', 'give' ); ?></label><br>
206
-				<small class="give-field-description"><?php esc_html_e( 'Override the display content setting for this Give form.', 'give' ); ?></small>
202
+				<label for="<?php echo esc_attr($this->get_field_id('show_content')); ?>"><?php esc_html_e('Display Content (optional):', 'give'); ?></label><br>
203
+				<label for="<?php echo esc_attr($this->get_field_id('show_content')); ?>-none"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('show_content')); ?>-none" name="<?php echo esc_attr($this->get_field_name('show_content')); ?>" value="none" <?php checked($instance['show_content'], 'none'); ?>> <?php echo esc_html__('None', 'give'); ?></label>
204
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('show_content')); ?>-above"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('show_content')); ?>-above" name="<?php echo esc_attr($this->get_field_name('show_content')); ?>" value="above" <?php checked($instance['show_content'], 'above'); ?>> <?php echo esc_html__('Above', 'give'); ?></label>
205
+				&nbsp;&nbsp;<label for="<?php echo esc_attr($this->get_field_id('show_content')); ?>-below"><input type="radio" class="widefat" id="<?php echo esc_attr($this->get_field_id('show_content')); ?>-below" name="<?php echo esc_attr($this->get_field_name('show_content')); ?>" value="below" <?php checked($instance['show_content'], 'below'); ?>> <?php echo esc_html__('Below', 'give'); ?></label><br>
206
+				<small class="give-field-description"><?php esc_html_e('Override the display content setting for this Give form.', 'give'); ?></small>
207 207
 		</div>
208 208
 		<?php
209 209
 	}
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 * @return void
215 215
 	 */
216 216
 	public function widget_init() {
217
-		register_widget( $this->self );
217
+		register_widget($this->self);
218 218
 	}
219 219
 
220 220
 	/**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 *
226 226
 	 * @return array
227 227
 	 */
228
-	public function update( $new_instance, $old_instance ) {
228
+	public function update($new_instance, $old_instance) {
229 229
 		$this->flush_widget_cache();
230 230
 
231 231
 		return $new_instance;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @return void
238 238
 	 */
239 239
 	public function flush_widget_cache() {
240
-		wp_cache_delete( $this->self, 'widget' );
240
+		wp_cache_delete($this->self, 'widget');
241 241
 	}
242 242
 }
243 243
 
Please login to merge, or discard this patch.
includes/admin/payments/view-payment-details.php 1 patch
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-if ( ! current_user_can( 'view_give_payments' ) ) {
17
+if ( ! current_user_can('view_give_payments')) {
18 18
 	wp_die(
19
-		__( 'Sorry, you are not allowed to access this page.', 'give' ), __( 'Error', 'give' ), array(
19
+		__('Sorry, you are not allowed to access this page.', 'give'), __('Error', 'give'), array(
20 20
 			'response' => 403,
21 21
 		)
22 22
 	);
@@ -28,35 +28,35 @@  discard block
 block discarded – undo
28 28
  * @since 1.0
29 29
  * @return void
30 30
  */
31
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
32
-	wp_die( __( 'Donation ID not supplied. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
31
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
32
+	wp_die(__('Donation ID not supplied. Please try again.', 'give'), __('Error', 'give'), array('response' => 400));
33 33
 }
34 34
 
35 35
 // Setup the variables
36
-$payment_id = absint( $_GET['id'] );
37
-$payment    = new Give_Payment( $payment_id );
36
+$payment_id = absint($_GET['id']);
37
+$payment    = new Give_Payment($payment_id);
38 38
 
39 39
 // Sanity check... fail if donation ID is invalid
40 40
 $payment_exists = $payment->ID;
41
-if ( empty( $payment_exists ) ) {
42
-	wp_die( __( 'The specified ID does not belong to a donation. Please try again.', 'give' ), __( 'Error', 'give' ), array( 'response' => 400 ) );
41
+if (empty($payment_exists)) {
42
+	wp_die(__('The specified ID does not belong to a donation. Please try again.', 'give'), __('Error', 'give'), array('response' => 400));
43 43
 }
44 44
 
45 45
 $number       = $payment->number;
46 46
 $payment_meta = $payment->get_meta();
47 47
 
48
-$company_name   = ! empty( $payment_meta['_give_donation_company'] ) ? esc_attr( $payment_meta['_give_donation_company'] ) : '';
49
-$transaction_id = esc_attr( $payment->transaction_id );
48
+$company_name   = ! empty($payment_meta['_give_donation_company']) ? esc_attr($payment_meta['_give_donation_company']) : '';
49
+$transaction_id = esc_attr($payment->transaction_id);
50 50
 $user_id        = $payment->user_id;
51 51
 $donor_id       = $payment->customer_id;
52
-$payment_date   = strtotime( $payment->date );
53
-$user_info      = give_get_payment_meta_user_info( $payment_id );
52
+$payment_date   = strtotime($payment->date);
53
+$user_info      = give_get_payment_meta_user_info($payment_id);
54 54
 $address        = $payment->address;
55 55
 $currency_code  = $payment->currency;
56 56
 $gateway        = $payment->gateway;
57 57
 $currency_code  = $payment->currency;
58 58
 $payment_mode   = $payment->mode;
59
-$base_url       = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
59
+$base_url       = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
60 60
 
61 61
 ?>
62 62
 <div class="wrap give-wrap">
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 		<?php
66 66
 		printf(
67 67
 		/* translators: %s: donation number */
68
-			esc_html__( 'Donation %s', 'give' ),
68
+			esc_html__('Donation %s', 'give'),
69 69
 			$number
70 70
 		);
71
-		if ( $payment_mode == 'test' ) {
71
+		if ($payment_mode == 'test') {
72 72
 			echo Give()->tooltips->render_span(array(
73
-				'label' => __( 'This donation was made in test mode.', 'give' ),
74
-				'tag_content' => __( 'Test Donation', 'give' ),
73
+				'label' => __('This donation was made in test mode.', 'give'),
74
+				'tag_content' => __('Test Donation', 'give'),
75 75
 				'position'=> 'right',
76 76
 				'attributes' => array(
77 77
 					'id' => 'test-payment-label',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 *
91 91
 	 * @param int $payment_id Payment id.
92 92
 	 */
93
-	do_action( 'give_view_donation_details_before', $payment_id );
93
+	do_action('give_view_donation_details_before', $payment_id);
94 94
 	?>
95 95
 
96 96
 	<hr class="wp-header-end">
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		 *
105 105
 		 * @param int $payment_id Payment id.
106 106
 		 */
107
-		do_action( 'give_view_donation_details_form_top', $payment_id );
107
+		do_action('give_view_donation_details_form_top', $payment_id);
108 108
 		?>
109 109
 		<div id="poststuff">
110 110
 			<div id="give-dashboard-widgets-wrap">
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
 							 *
121 121
 							 * @param int $payment_id Payment id.
122 122
 							 */
123
-							do_action( 'give_view_donation_details_sidebar_before', $payment_id );
123
+							do_action('give_view_donation_details_sidebar_before', $payment_id);
124 124
 							?>
125 125
 
126 126
 							<div id="give-order-update" class="postbox give-order-data">
127 127
 
128 128
 								<div class="give-order-top">
129
-									<h3 class="hndle"><?php _e( 'Update Donation', 'give' ); ?></h3>
129
+									<h3 class="hndle"><?php _e('Update Donation', 'give'); ?></h3>
130 130
 
131 131
 									<?php
132
-									if ( current_user_can( 'view_give_payments' ) ) {
132
+									if (current_user_can('view_give_payments')) {
133 133
 										echo sprintf(
134 134
 											'<span class="delete-donation" id="delete-donation-%d"><a class="delete-single-donation delete-donation-button dashicons dashicons-trash" href="%s" aria-label="%s"></a></span>',
135 135
 											$payment_id,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 													), $base_url
142 142
 												), 'give_donation_nonce'
143 143
 											),
144
-											sprintf( __( 'Delete Donation %s', 'give' ), $payment_id )
144
+											sprintf(__('Delete Donation %s', 'give'), $payment_id)
145 145
 										);
146 146
 									}
147 147
 									?>
@@ -158,34 +158,34 @@  discard block
 block discarded – undo
158 158
 										 *
159 159
 										 * @param int $payment_id Payment id.
160 160
 										 */
161
-										do_action( 'give_view_donation_details_totals_before', $payment_id );
161
+										do_action('give_view_donation_details_totals_before', $payment_id);
162 162
 										?>
163 163
 
164 164
 										<div class="give-admin-box-inside">
165 165
 											<p>
166
-												<label for="give-payment-status" class="strong"><?php _e( 'Status:', 'give' ); ?></label>&nbsp;
166
+												<label for="give-payment-status" class="strong"><?php _e('Status:', 'give'); ?></label>&nbsp;
167 167
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
168
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
169
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
168
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
169
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
170 170
 													<?php endforeach; ?>
171 171
 												</select>
172
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
172
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
173 173
 											</p>
174 174
 										</div>
175 175
 
176 176
 										<div class="give-admin-box-inside">
177 177
 											<?php $localized_date_format = give_get_localized_date_format_to_js(); ?>
178 178
 											<p>
179
-												<label for="give-payment-date" class="strong"><?php _e( 'Date:', 'give' ); ?></label>&nbsp;
180
-												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( get_option( 'date_format' ), $payment_date ) ); ?>" class="medium-text give_datepicker" placeholder="<?php printf( esc_attr( $localized_date_format ) ); ?>"/>
179
+												<label for="give-payment-date" class="strong"><?php _e('Date:', 'give'); ?></label>&nbsp;
180
+												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date(get_option('date_format'), $payment_date)); ?>" class="medium-text give_datepicker" placeholder="<?php printf(esc_attr($localized_date_format)); ?>"/>
181 181
 											</p>
182 182
 										</div>
183 183
 
184 184
 										<div class="give-admin-box-inside">
185 185
 											<p>
186
-												<label for="give-payment-time-hour" class="strong"><?php _e( 'Time:', 'give' ); ?></label>&nbsp;
187
-												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
188
-												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
186
+												<label for="give-payment-time-hour" class="strong"><?php _e('Time:', 'give'); ?></label>&nbsp;
187
+												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
188
+												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
189 189
 											</p>
190 190
 										</div>
191 191
 
@@ -199,14 +199,14 @@  discard block
 block discarded – undo
199 199
 										 *
200 200
 										 * @param int $payment_id Payment id.
201 201
 										 */
202
-										do_action( 'give_view_donation_details_update_inner', $payment_id );
202
+										do_action('give_view_donation_details_update_inner', $payment_id);
203 203
 										?>
204 204
 
205 205
 										<div class="give-order-payment give-admin-box-inside">
206 206
 											<p>
207
-												<label for="give-payment-total" class="strong"><?php _e( 'Total Donation:', 'give' ); ?></label>&nbsp;
208
-												<?php echo give_currency_symbol( $payment->currency ); ?>
209
-												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_donation_amount( $payment_id ), false, false ) ); ?>"/>
207
+												<label for="give-payment-total" class="strong"><?php _e('Total Donation:', 'give'); ?></label>&nbsp;
208
+												<?php echo give_currency_symbol($payment->currency); ?>
209
+												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_donation_amount($payment_id), false, false)); ?>"/>
210 210
 											</p>
211 211
 										</div>
212 212
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 										 *
219 219
 										 * @param int $payment_id Payment id.
220 220
 										 */
221
-										do_action( 'give_view_donation_details_totals_after', $payment_id );
221
+										do_action('give_view_donation_details_totals_after', $payment_id);
222 222
 										?>
223 223
 
224 224
 									</div>
@@ -236,26 +236,26 @@  discard block
 block discarded – undo
236 236
 									 *
237 237
 									 * @param int $payment_id Payment id.
238 238
 									 */
239
-									do_action( 'give_view_donation_details_update_before', $payment_id );
239
+									do_action('give_view_donation_details_update_before', $payment_id);
240 240
 									?>
241 241
 
242 242
 									<div id="major-publishing-actions">
243 243
 										<div id="publishing-action">
244
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/>
244
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/>
245 245
 											<?php
246
-											if ( give_is_payment_complete( $payment_id ) ) {
246
+											if (give_is_payment_complete($payment_id)) {
247 247
 												$url = add_query_arg(
248 248
 													array(
249 249
 														'give-action' => 'email_links',
250 250
 														'purchase_id' => $payment_id,
251 251
 													),
252
-													admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment_id )
252
+													admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment_id)
253 253
 												);
254 254
 
255 255
 												echo sprintf(
256 256
 													'<a href="%1$s" id="give-resend-receipt" class="button-secondary right">%2$s</a>',
257
-													esc_url( $url ),
258
-													esc_html__( 'Resend Receipt', 'give' )
257
+													esc_url($url),
258
+													esc_html__('Resend Receipt', 'give')
259 259
 												);
260 260
 											}
261 261
 											?>
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 									 *
271 271
 									 * @param int $payment_id Payment id.
272 272
 									 */
273
-									do_action( 'give_view_donation_details_update_after', $payment_id );
273
+									do_action('give_view_donation_details_update_after', $payment_id);
274 274
 									?>
275 275
 
276 276
 								</div>
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
 							<div id="give-order-details" class="postbox give-order-data">
283 283
 
284
-								<h3 class="hndle"><?php _e( 'Donation Meta', 'give' ); ?></h3>
284
+								<h3 class="hndle"><?php _e('Donation Meta', 'give'); ?></h3>
285 285
 
286 286
 								<div class="inside">
287 287
 									<div class="give-admin-box">
@@ -294,30 +294,30 @@  discard block
 block discarded – undo
294 294
 										 *
295 295
 										 * @param int $payment_id Payment id.
296 296
 										 */
297
-										do_action( 'give_view_donation_details_payment_meta_before', $payment_id );
297
+										do_action('give_view_donation_details_payment_meta_before', $payment_id);
298 298
 
299
-										$gateway = give_get_payment_gateway( $payment_id );
300
-										if ( $gateway ) :
299
+										$gateway = give_get_payment_gateway($payment_id);
300
+										if ($gateway) :
301 301
 											?>
302 302
 											<div class="give-order-gateway give-admin-box-inside">
303 303
 												<p>
304
-													<strong><?php _e( 'Gateway:', 'give' ); ?></strong>&nbsp;
305
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
304
+													<strong><?php _e('Gateway:', 'give'); ?></strong>&nbsp;
305
+													<?php echo give_get_gateway_admin_label($gateway); ?>
306 306
 												</p>
307 307
 											</div>
308 308
 										<?php endif; ?>
309 309
 
310 310
 										<div class="give-order-payment-key give-admin-box-inside">
311 311
 											<p>
312
-												<strong><?php _e( 'Key:', 'give' ); ?></strong>&nbsp;
313
-												<?php echo give_get_payment_key( $payment_id ); ?>
312
+												<strong><?php _e('Key:', 'give'); ?></strong>&nbsp;
313
+												<?php echo give_get_payment_key($payment_id); ?>
314 314
 											</p>
315 315
 										</div>
316 316
 
317 317
 										<div class="give-order-ip give-admin-box-inside">
318 318
 											<p>
319
-												<strong><?php _e( 'IP:', 'give' ); ?></strong>&nbsp;
320
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
319
+												<strong><?php _e('IP:', 'give'); ?></strong>&nbsp;
320
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
321 321
 											</p>
322 322
 										</div>
323 323
 
@@ -325,18 +325,18 @@  discard block
 block discarded – undo
325 325
 										// Display the transaction ID present.
326 326
 										// The transaction ID is the charge ID from the gateway.
327 327
 										// For instance, stripe "ch_BzvwYCchqOy5Nt".
328
-										if ( $transaction_id != $payment_id ) : ?>
328
+										if ($transaction_id != $payment_id) : ?>
329 329
 											<div class="give-order-tx-id give-admin-box-inside">
330 330
 												<p>
331
-													<strong><?php _e( 'Transaction ID:', 'give' ); ?> <span class="give-tooltip give-icon give-icon-question"  data-tooltip="<?php echo sprintf( esc_attr__( 'The transaction ID within %s.', 'give' ), $gateway); ?>"></span></strong>&nbsp;
332
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
331
+													<strong><?php _e('Transaction ID:', 'give'); ?> <span class="give-tooltip give-icon give-icon-question"  data-tooltip="<?php echo sprintf(esc_attr__('The transaction ID within %s.', 'give'), $gateway); ?>"></span></strong>&nbsp;
332
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
333 333
 												</p>
334 334
 											</div>
335 335
 										<?php endif; ?>
336 336
 
337 337
 										<div class="give-admin-box-inside">
338
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( give_get_payment_donor_id( $payment_id ) ) ); ?>
339
-												<a href="<?php echo $purchase_url; ?>"><?php _e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
338
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint(give_get_payment_donor_id($payment_id))); ?>
339
+												<a href="<?php echo $purchase_url; ?>"><?php _e('View all donations for this donor &raquo;', 'give'); ?></a>
340 340
 											</p>
341 341
 										</div>
342 342
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 										 *
349 349
 										 * @param int $payment_id Payment id.
350 350
 										 */
351
-										do_action( 'give_view_donation_details_payment_meta_after', $payment_id );
351
+										do_action('give_view_donation_details_payment_meta_after', $payment_id);
352 352
 										?>
353 353
 
354 354
 									</div>
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 							 *
369 369
 							 * @param int $payment_id Payment id.
370 370
 							 */
371
-							do_action( 'give_view_donation_details_sidebar_after', $payment_id );
371
+							do_action('give_view_donation_details_sidebar_after', $payment_id);
372 372
 							?>
373 373
 
374 374
 						</div>
@@ -388,31 +388,31 @@  discard block
 block discarded – undo
388 388
 							 *
389 389
 							 * @param int $payment_id Payment id.
390 390
 							 */
391
-							do_action( 'give_view_donation_details_main_before', $payment_id );
391
+							do_action('give_view_donation_details_main_before', $payment_id);
392 392
 							?>
393 393
 
394 394
 							<?php $column_count = 'columns-3'; ?>
395 395
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
396
-								<h3 class="hndle"><?php _e( 'Donation Information', 'give' ); ?></h3>
396
+								<h3 class="hndle"><?php _e('Donation Information', 'give'); ?></h3>
397 397
 
398 398
 								<div class="inside">
399 399
 
400 400
 									<div class="column-container">
401 401
 										<div class="column">
402 402
 											<p>
403
-												<strong><?php _e( 'Donation Form ID:', 'give' ); ?></strong><br>
403
+												<strong><?php _e('Donation Form ID:', 'give'); ?></strong><br>
404 404
 												<?php
405
-												if ( $payment_meta['form_id'] ) :
405
+												if ($payment_meta['form_id']) :
406 406
 													printf(
407 407
 														'<a href="%1$s">%2$s</a>',
408
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
408
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
409 409
 														$payment_meta['form_id']
410 410
 													);
411 411
 												endif;
412 412
 												?>
413 413
 											</p>
414 414
 											<p>
415
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
415
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
416 416
 												<?php
417 417
 												echo Give()->html->forms_dropdown(
418 418
 													array(
@@ -428,21 +428,21 @@  discard block
 block discarded – undo
428 428
 										</div>
429 429
 										<div class="column">
430 430
 											<p>
431
-												<strong><?php _e( 'Donation Date:', 'give' ); ?></strong><br>
432
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
431
+												<strong><?php _e('Donation Date:', 'give'); ?></strong><br>
432
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
433 433
 											</p>
434 434
 											<p>
435
-												<strong><?php _e( 'Donation Level:', 'give' ); ?></strong><br>
435
+												<strong><?php _e('Donation Level:', 'give'); ?></strong><br>
436 436
 												<span class="give-donation-level">
437 437
 													<?php
438
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
439
-													if ( empty( $var_prices ) ) {
440
-														_e( 'n/a', 'give' );
438
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
439
+													if (empty($var_prices)) {
440
+														_e('n/a', 'give');
441 441
 													} else {
442 442
 														$prices_atts = array();
443
-														if ( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
444
-															foreach ( $variable_prices as $variable_price ) {
445
-																$prices_atts[ $variable_price['_give_id']['level_id'] ] = give_format_amount( $variable_price['_give_amount'], array( 'sanitize' => false ) );
443
+														if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) {
444
+															foreach ($variable_prices as $variable_price) {
445
+																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount'], array('sanitize' => false));
446 446
 															}
447 447
 														}
448 448
 														// Variable price dropdown options.
@@ -451,12 +451,12 @@  discard block
 block discarded – undo
451 451
 															'name'             => 'give-variable-price',
452 452
 															'chosen'           => true,
453 453
 															'show_option_all'  => '',
454
-															'show_option_none' => ( '' === get_post_meta( $payment_id, '_give_payment_price_id', true ) ? __( 'None', 'give' ) : '' ),
455
-															'select_atts'      => 'data-prices=' . esc_attr( wp_json_encode( $prices_atts ) ),
454
+															'show_option_none' => ('' === get_post_meta($payment_id, '_give_payment_price_id', true) ? __('None', 'give') : ''),
455
+															'select_atts'      => 'data-prices='.esc_attr(wp_json_encode($prices_atts)),
456 456
 															'selected'         => $payment_meta['price_id'],
457 457
 														);
458 458
 														// Render variable prices select tag html.
459
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
459
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
460 460
 													}
461 461
 													?>
462 462
 												</span>
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
 										</div>
465 465
 										<div class="column">
466 466
 											<p>
467
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
468
-												<?php echo give_donation_amount( $payment, true ); ?>
467
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
468
+												<?php echo give_donation_amount($payment, true); ?>
469 469
 											</p>
470 470
 
471
-											<?php if ( give_is_anonymous_donation_field_enabled( $payment->form_id ) ):  ?>
471
+											<?php if (give_is_anonymous_donation_field_enabled($payment->form_id)):  ?>
472 472
 												<div>
473
-													<strong><?php esc_html_e( 'Anonymous Donation:', 'give' ); ?></strong>
473
+													<strong><?php esc_html_e('Anonymous Donation:', 'give'); ?></strong>
474 474
 													<ul class="give-radio-inline">
475 475
 														<li>
476 476
 															<label>
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
 																	name="give_anonymous_donation"
479 479
 																	value="1"
480 480
 																	type="radio"
481
-																	<?php checked( 1, absint( give_get_meta( $payment_id, '_give_anonymous_donation', true ) ) ) ?>
482
-																><?php _e( 'Yes', 'give' ); ?>
481
+																	<?php checked(1, absint(give_get_meta($payment_id, '_give_anonymous_donation', true))) ?>
482
+																><?php _e('Yes', 'give'); ?>
483 483
 															</label>
484 484
 														</li>
485 485
 														<li>
@@ -488,8 +488,8 @@  discard block
 block discarded – undo
488 488
 																	name="give_anonymous_donation"
489 489
 																	value="0"
490 490
 																	type="radio"
491
-																	<?php checked( 0, absint( give_get_meta( $payment_id, '_give_anonymous_donation', true ) ) ) ?>
492
-																><?php _e( 'No', 'give' ); ?>
491
+																	<?php checked(0, absint(give_get_meta($payment_id, '_give_anonymous_donation', true))) ?>
492
+																><?php _e('No', 'give'); ?>
493 493
 															</label>
494 494
 														</li>
495 495
 													</ul>
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 												 *
507 507
 												 * @param int $payment_id Payment id.
508 508
 												 */
509
-												do_action( 'give_donation_details_thead_before', $payment_id );
509
+												do_action('give_donation_details_thead_before', $payment_id);
510 510
 
511 511
 
512 512
 												/**
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 												 *
519 519
 												 * @param int $payment_id Payment id.
520 520
 												 */
521
-												do_action( 'give_donation_details_thead_after', $payment_id );
521
+												do_action('give_donation_details_thead_after', $payment_id);
522 522
 
523 523
 												/**
524 524
 												 * Fires in donation details page, in the donation-information metabox, before the body elements.
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 												 *
530 530
 												 * @param int $payment_id Payment id.
531 531
 												 */
532
-												do_action( 'give_donation_details_tbody_before', $payment_id );
532
+												do_action('give_donation_details_tbody_before', $payment_id);
533 533
 
534 534
 												/**
535 535
 												 * Fires in donation details page, in the donation-information metabox, after the body elements.
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 												 *
541 541
 												 * @param int $payment_id Payment id.
542 542
 												 */
543
-												do_action( 'give_donation_details_tbody_after', $payment_id );
543
+												do_action('give_donation_details_tbody_after', $payment_id);
544 544
 												?>
545 545
 											</p>
546 546
 										</div>
@@ -560,66 +560,66 @@  discard block
 block discarded – undo
560 560
 							 *
561 561
 							 * @param int $payment_id Payment id.
562 562
 							 */
563
-							do_action( 'give_view_donation_details_donor_detail_before', $payment_id );
563
+							do_action('give_view_donation_details_donor_detail_before', $payment_id);
564 564
 							?>
565 565
 
566 566
 							<div id="give-donor-details" class="postbox">
567
-								<h3 class="hndle"><?php _e( 'Donor Details', 'give' ); ?></h3>
567
+								<h3 class="hndle"><?php _e('Donor Details', 'give'); ?></h3>
568 568
 
569 569
 								<div class="inside">
570 570
 
571
-									<?php $donor = new Give_Donor( $donor_id ); ?>
571
+									<?php $donor = new Give_Donor($donor_id); ?>
572 572
 
573 573
 									<div class="column-container donor-info">
574 574
 										<div class="column">
575 575
 											<p>
576
-												<strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br>
576
+												<strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br>
577 577
 												<?php
578
-												if ( ! empty( $donor->id ) ) {
578
+												if ( ! empty($donor->id)) {
579 579
 													printf(
580 580
 														'<a href="%1$s">%2$s</a>',
581
-														esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ) ),
582
-														intval( $donor->id )
581
+														esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id)),
582
+														intval($donor->id)
583 583
 													);
584 584
 												}
585 585
 												?>
586
-												<span>(<a href="#new" class="give-payment-new-donor"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a>)</span>
586
+												<span>(<a href="#new" class="give-payment-new-donor"><?php esc_html_e('Create New Donor', 'give'); ?></a>)</span>
587 587
 											</p>
588 588
 											<p>
589
-												<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
590
-												<?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?>
589
+												<strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br>
590
+												<?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?>
591 591
 											</p>
592 592
 										</div>
593 593
 										<div class="column">
594 594
 											<p>
595
-												<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br>
595
+												<strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br>
596 596
 												<?php
597
-												$donor_billing_name = give_get_donor_name_by( $payment_id, 'donation' );
598
-												$donor_name         = give_get_donor_name_by( $donor_id, 'donor' );
597
+												$donor_billing_name = give_get_donor_name_by($payment_id, 'donation');
598
+												$donor_name         = give_get_donor_name_by($donor_id, 'donor');
599 599
 
600 600
 												// Check whether the donor name and WP_User name is same or not.
601
-												if ( $donor_billing_name !== $donor_name ) {
601
+												if ($donor_billing_name !== $donor_name) {
602 602
 													echo sprintf(
603 603
 														'%1$s (<a href="%2$s" target="_blank">%3$s</a>)',
604
-														esc_html( $donor_billing_name ),
605
-														esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}" ) ),
606
-														esc_html( $donor_name )
604
+														esc_html($donor_billing_name),
605
+														esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}")),
606
+														esc_html($donor_name)
607 607
 													);
608 608
 												} else {
609
-													echo esc_html( $donor_name );
609
+													echo esc_html($donor_name);
610 610
 												}
611 611
 												?>
612 612
 											</p>
613 613
 											<p>
614
-												<strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br>
614
+												<strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br>
615 615
 												<?php
616 616
 												// Show Donor donation email first and Primary email on parenthesis if not match both email.
617
-												echo hash_equals( $donor->email, $payment->email )
617
+												echo hash_equals($donor->email, $payment->email)
618 618
 													? $payment->email
619 619
 													: sprintf(
620 620
 														'%1$s (<a href="%2$s" target="_blank">%3$s</a>)',
621 621
 														$payment->email,
622
-														esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}" ) ),
622
+														esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id={$donor_id}")),
623 623
 														$donor->email
624 624
 													);
625 625
 												?>
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 										</div>
628 628
 										<div class="column">
629 629
 											<p>
630
-												<strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br>
630
+												<strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br>
631 631
 												<?php
632 632
 												echo Give()->html->donor_dropdown(
633 633
 													array(
@@ -638,9 +638,9 @@  discard block
 block discarded – undo
638 638
 												?>
639 639
 											</p>
640 640
 											<p>
641
-												<?php if ( ! empty( $company_name ) ) {
641
+												<?php if ( ! empty($company_name)) {
642 642
 													?>
643
-													<strong><?php esc_html_e( 'Company Name:', 'give' ); ?></strong><br>
643
+													<strong><?php esc_html_e('Company Name:', 'give'); ?></strong><br>
644 644
 													<?php
645 645
 													echo $company_name;
646 646
 												} ?>
@@ -651,19 +651,19 @@  discard block
 block discarded – undo
651 651
 									<div class="column-container new-donor" style="display: none">
652 652
 										<div class="column">
653 653
 											<p>
654
-												<label for="give-new-donor-first-name"><?php _e( 'New Donor First Name:', 'give' ); ?></label>
654
+												<label for="give-new-donor-first-name"><?php _e('New Donor First Name:', 'give'); ?></label>
655 655
 												<input id="give-new-donor-first-name" type="text" name="give-new-donor-first-name" value="" class="medium-text"/>
656 656
 											</p>
657 657
 										</div>
658 658
 										<div class="column">
659 659
 											<p>
660
-												<label for="give-new-donor-last-name"><?php _e( 'New Donor Last Name:', 'give' ); ?></label>
660
+												<label for="give-new-donor-last-name"><?php _e('New Donor Last Name:', 'give'); ?></label>
661 661
 												<input id="give-new-donor-last-name" type="text" name="give-new-donor-last-name" value="" class="medium-text"/>
662 662
 											</p>
663 663
 										</div>
664 664
 										<div class="column">
665 665
 											<p>
666
-												<label for="give-new-donor-email"><?php _e( 'New Donor Email:', 'give' ); ?></label>
666
+												<label for="give-new-donor-email"><?php _e('New Donor Email:', 'give'); ?></label>
667 667
 												<input id="give-new-donor-email" type="email" name="give-new-donor-email" value="" class="medium-text"/>
668 668
 											</p>
669 669
 										</div>
@@ -671,9 +671,9 @@  discard block
 block discarded – undo
671 671
 											<p>
672 672
 												<input type="hidden" name="give-current-donor" value="<?php echo $donor->id; ?>"/>
673 673
 												<input type="hidden" id="give-new-donor" name="give-new-donor" value="0"/>
674
-												<a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php _e( 'Cancel', 'give' ); ?></a>
674
+												<a href="#cancel" class="give-payment-new-donor-cancel give-delete"><?php _e('Cancel', 'give'); ?></a>
675 675
 												<br>
676
-												<em><?php _e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
676
+												<em><?php _e('Click "Save Donation" to create new donor.', 'give'); ?></em>
677 677
 											</p>
678 678
 										</div>
679 679
 									</div>
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 									 * @param array $payment_meta Payment meta.
689 689
 									 * @param array $user_info    User information.
690 690
 									 */
691
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
691
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
692 692
 
693 693
 									/**
694 694
 									 * Fires on the donation details page, in the donor-details metabox.
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 									 *
698 698
 									 * @param int $payment_id Payment id.
699 699
 									 */
700
-									do_action( 'give_payment_view_details', $payment_id );
700
+									do_action('give_payment_view_details', $payment_id);
701 701
 									?>
702 702
 
703 703
 								</div>
@@ -713,11 +713,11 @@  discard block
 block discarded – undo
713 713
 							 *
714 714
 							 * @param int $payment_id Payment id.
715 715
 							 */
716
-							do_action( 'give_view_donation_details_billing_before', $payment_id );
716
+							do_action('give_view_donation_details_billing_before', $payment_id);
717 717
 							?>
718 718
 
719 719
 							<div id="give-billing-details" class="postbox">
720
-								<h3 class="hndle"><?php _e( 'Billing Address', 'give' ); ?></h3>
720
+								<h3 class="hndle"><?php _e('Billing Address', 'give'); ?></h3>
721 721
 
722 722
 								<div class="inside">
723 723
 
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
 											<div class="data column-container">
728 728
 
729 729
 												<?php
730
-												$address['country'] = ( ! empty( $address['country'] ) ? $address['country'] : give_get_country() );
730
+												$address['country'] = ( ! empty($address['country']) ? $address['country'] : give_get_country());
731 731
 
732
-												$address['state'] = ( ! empty( $address['state'] ) ? $address['state'] : '' );
732
+												$address['state'] = ( ! empty($address['state']) ? $address['state'] : '');
733 733
 
734 734
 												// Get the country list that does not have any states init.
735 735
 												$no_states_country = give_no_states_country_list();
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 
738 738
 												<div class="row">
739 739
 													<div id="give-order-address-country-wrap">
740
-														<label class="order-data-address-line"><?php _e( 'Country:', 'give' ); ?></label>
740
+														<label class="order-data-address-line"><?php _e('Country:', 'give'); ?></label>
741 741
 														<?php
742 742
 														echo Give()->html->select(
743 743
 															array(
@@ -747,8 +747,8 @@  discard block
 block discarded – undo
747 747
 																'show_option_all'  => false,
748 748
 																'show_option_none' => false,
749 749
 																'chosen'           => true,
750
-																'placeholder'      => esc_attr__( 'Select a country', 'give' ),
751
-																'data'             => array( 'search-type' => 'no_ajax' ),
750
+																'placeholder'      => esc_attr__('Select a country', 'give'),
751
+																'data'             => array('search-type' => 'no_ajax'),
752 752
 															)
753 753
 														);
754 754
 														?>
@@ -757,35 +757,35 @@  discard block
 block discarded – undo
757 757
 
758 758
 												<div class="row">
759 759
 													<div class="give-wrap-address-line1">
760
-														<label for="give-payment-address-line1" class="order-data-address"><?php _e( 'Address 1:', 'give' ); ?></label>
761
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
760
+														<label for="give-payment-address-line1" class="order-data-address"><?php _e('Address 1:', 'give'); ?></label>
761
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
762 762
 													</div>
763 763
 												</div>
764 764
 
765 765
 												<div class="row">
766 766
 													<div class="give-wrap-address-line2">
767
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php _e( 'Address 2:', 'give' ); ?></label>
768
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
767
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php _e('Address 2:', 'give'); ?></label>
768
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
769 769
 													</div>
770 770
 												</div>
771 771
 
772 772
 												<div class="row">
773 773
 													<div class="give-wrap-address-city">
774
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
775
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
774
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
775
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
776 776
 													</div>
777 777
 												</div>
778 778
 
779 779
 												<?php
780
-												$state_exists = ( ! empty( $address['country'] ) && array_key_exists( $address['country'], $no_states_country ) ? true : false );
780
+												$state_exists = ( ! empty($address['country']) && array_key_exists($address['country'], $no_states_country) ? true : false);
781 781
 												?>
782 782
 												<div class="row">
783
-													<div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-state">
784
-														<div id="give-order-address-state-wrap" class="<?php echo( ! empty( $state_exists ) ? 'give-hidden' : '' ); ?>">
785
-															<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province / County:', 'give' ); ?></label>
783
+													<div class="<?php echo( ! empty($state_exists) ? 'column-full' : 'column'); ?> give-column give-column-state">
784
+														<div id="give-order-address-state-wrap" class="<?php echo( ! empty($state_exists) ? 'give-hidden' : ''); ?>">
785
+															<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province / County:', 'give'); ?></label>
786 786
 															<?php
787
-															$states = give_get_states( $address['country'] );
788
-															if ( ! empty( $states ) ) {
787
+															$states = give_get_states($address['country']);
788
+															if ( ! empty($states)) {
789 789
 																echo Give()->html->select(
790 790
 																	array(
791 791
 																		'options'          => $states,
@@ -794,23 +794,23 @@  discard block
 block discarded – undo
794 794
 																		'show_option_all'  => false,
795 795
 																		'show_option_none' => false,
796 796
 																		'chosen'           => true,
797
-																		'placeholder'      => esc_attr__( 'Select a state', 'give' ),
798
-																		'data'             => array( 'search-type' => 'no_ajax' ),
797
+																		'placeholder'      => esc_attr__('Select a state', 'give'),
798
+																		'data'             => array('search-type' => 'no_ajax'),
799 799
 																	)
800 800
 																);
801 801
 															} else {
802 802
 																?>
803
-																<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
803
+																<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
804 804
 																<?php
805 805
 															}
806 806
 															?>
807 807
 														</div>
808 808
 													</div>
809 809
 
810
-													<div class="<?php echo( ! empty( $state_exists ) ? 'column-full' : 'column' ); ?> give-column give-column-zip">
810
+													<div class="<?php echo( ! empty($state_exists) ? 'column-full' : 'column'); ?> give-column give-column-zip">
811 811
 														<div class="give-wrap-address-zip">
812
-															<label for="give-payment-address-zip" class="order-data-address-line"><?php _e( 'Zip / Postal Code:', 'give' ); ?></label>
813
-															<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
812
+															<label for="give-payment-address-zip" class="order-data-address-line"><?php _e('Zip / Postal Code:', 'give'); ?></label>
813
+															<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
814 814
 														</div>
815 815
 													</div>
816 816
 												</div>
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 									 *
830 830
 									 * @param int $payment_id Payment id.
831 831
 									 */
832
-									do_action( 'give_payment_billing_details', $payment_id );
832
+									do_action('give_payment_billing_details', $payment_id);
833 833
 									?>
834 834
 
835 835
 								</div>
@@ -845,34 +845,34 @@  discard block
 block discarded – undo
845 845
 							 *
846 846
 							 * @param int $payment_id Payment id.
847 847
 							 */
848
-							do_action( 'give_view_donation_details_billing_after', $payment_id );
848
+							do_action('give_view_donation_details_billing_after', $payment_id);
849 849
 							?>
850 850
 
851 851
 							<div id="give-payment-notes" class="postbox">
852
-								<h3 class="hndle"><?php _e( 'Donation Notes', 'give' ); ?></h3>
852
+								<h3 class="hndle"><?php _e('Donation Notes', 'give'); ?></h3>
853 853
 
854 854
 								<div class="inside">
855 855
 									<div id="give-payment-notes-inner">
856 856
 										<?php
857
-										$notes = give_get_payment_notes( $payment_id );
858
-										if ( ! empty( $notes ) ) {
857
+										$notes = give_get_payment_notes($payment_id);
858
+										if ( ! empty($notes)) {
859 859
 											$no_notes_display = ' style="display:none;"';
860
-											foreach ( $notes as $note ) :
860
+											foreach ($notes as $note) :
861 861
 
862
-												echo give_get_payment_note_html( $note, $payment_id );
862
+												echo give_get_payment_note_html($note, $payment_id);
863 863
 
864 864
 											endforeach;
865 865
 										} else {
866 866
 											$no_notes_display = '';
867 867
 										}
868 868
 
869
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>';
869
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>';
870 870
 										?>
871 871
 									</div>
872 872
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
873 873
 
874 874
 									<div class="give-clearfix">
875
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php _e( 'Add Note', 'give' ); ?></button>
875
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php _e('Add Note', 'give'); ?></button>
876 876
 									</div>
877 877
 
878 878
 								</div>
@@ -888,18 +888,18 @@  discard block
 block discarded – undo
888 888
 							 *
889 889
 							 * @param int $payment_id Payment id.
890 890
 							 */
891
-							do_action( 'give_view_donation_details_main_after', $payment_id );
891
+							do_action('give_view_donation_details_main_after', $payment_id);
892 892
 							?>
893 893
 
894
-							<?php if ( give_is_donor_comment_field_enabled( $payment->form_id ) ) : ?>
894
+							<?php if (give_is_donor_comment_field_enabled($payment->form_id)) : ?>
895 895
 								<div id="give-payment-donor-comment" class="postbox">
896
-									<h3 class="hndle"><?php _e( 'Donor Comment', 'give' ); ?></h3>
896
+									<h3 class="hndle"><?php _e('Donor Comment', 'give'); ?></h3>
897 897
 
898 898
 									<div class="inside">
899 899
 										<div id="give-payment-donor-comment-inner">
900 900
 											<p>
901 901
 												<?php
902
-												$donor_comment = give_get_donor_donation_comment( $payment_id, $payment->donor_id );
902
+												$donor_comment = give_get_donor_donation_comment($payment_id, $payment->donor_id);
903 903
 
904 904
 												echo sprintf(
905 905
 													'<input type="hidden" name="give_comment_id" value="%s">',
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
 
909 909
 												echo sprintf(
910 910
 													'<textarea name="give_comment" id="give_comment" placeholder="%s" class="large-text">%s</textarea>',
911
-													__( 'Add a comment', 'give' ),
911
+													__('Add a comment', 'give'),
912 912
 													$donor_comment instanceof WP_Comment ? $donor_comment->comment_content : ''
913 913
 												);
914 914
 												?>
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 							 *
930 930
 							 * @param int $payment_id Payment id.
931 931
 							 */
932
-							do_action( 'give_view_donation_details_main_after', $payment_id );
932
+							do_action('give_view_donation_details_main_after', $payment_id);
933 933
 							?>
934 934
 
935 935
 						</div>
@@ -951,11 +951,11 @@  discard block
 block discarded – undo
951 951
 		 *
952 952
 		 * @param int $payment_id Payment id.
953 953
 		 */
954
-		do_action( 'give_view_donation_details_form_bottom', $payment_id );
954
+		do_action('give_view_donation_details_form_bottom', $payment_id);
955 955
 
956
-		wp_nonce_field( 'give_update_payment_details_nonce' );
956
+		wp_nonce_field('give_update_payment_details_nonce');
957 957
 		?>
958
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
958
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
959 959
 		<input type="hidden" name="give_action" value="update_payment_details"/>
960 960
 	</form>
961 961
 	<?php
@@ -966,6 +966,6 @@  discard block
 block discarded – undo
966 966
 	 *
967 967
 	 * @param int $payment_id Payment id.
968 968
 	 */
969
-	do_action( 'give_view_donation_details_after', $payment_id );
969
+	do_action('give_view_donation_details_after', $payment_id);
970 970
 	?>
971 971
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.