Completed
Pull Request — master (#1109)
by Rami
18:42
created
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html__( 'Welcome to Give', 'give' ),
55
-			esc_html__( 'Welcome to Give', 'give' ),
54
+			esc_html__('Welcome to Give', 'give'),
55
+			esc_html__('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html__( 'Give Changelog', 'give' ),
64
-			esc_html__( 'Give Changelog', 'give' ),
63
+			esc_html__('Give Changelog', 'give'),
64
+			esc_html__('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html__( 'Getting started with Give', 'give' ),
73
-			esc_html__( 'Getting started with Give', 'give' ),
72
+			esc_html__('Getting started with Give', 'give'),
73
+			esc_html__('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html__( 'The people that build Give', 'give' ),
82
-			esc_html__( 'The people that build Give', 'give' ),
81
+			esc_html__('The people that build Give', 'give'),
82
+			esc_html__('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h2 class="nav-tab-wrapper">
221
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
222
-				<?php esc_html_e( 'About Give', 'give' ); ?>
221
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
222
+				<?php esc_html_e('About Give', 'give'); ?>
223 223
 			</a>
224
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h2>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html__( 'Welcome to Give %s', 'give' ),
251
+					esc_html__('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<p class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr__( 'View the Give plugin documentation online', 'give' )
261
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr__('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></p>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html__( 'Version %s', 'give' ),
274
+					esc_html__('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -281,15 +281,15 @@  discard block
 block discarded – undo
281 281
 			<div class="feature-section clearfix introduction">
282 282
 
283 283
 				<div class="video feature-section-item">
284
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
284
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
285 285
 
286 286
 				</div>
287 287
 
288 288
 				<div class="content feature-section-item last-feature">
289 289
 
290
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
290
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
291 291
 
292
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
292
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
293 293
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
294 294
 						<span class="dashicons dashicons-external"></span></a>
295 295
 
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 
303 303
 				<div class="content feature-section-item">
304 304
 
305
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
305
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
306 306
 
307
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
307
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
308 308
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
309 309
 						<span class="dashicons dashicons-external"></span></a>
310 310
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 				<div class="content  feature-section-item last-feature">
314 314
 
315
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
315
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
316 316
 
317 317
 				</div>
318 318
 
@@ -332,22 +332,22 @@  discard block
 block discarded – undo
332 332
 	 * @return void
333 333
 	 */
334 334
 	public function changelog_screen() {
335
-		list( $display_version ) = explode( '-', GIVE_VERSION );
335
+		list($display_version) = explode('-', GIVE_VERSION);
336 336
 		?>
337 337
 		<div class="wrap about-wrap">
338
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
338
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
339 339
 
340 340
 			<p class="about-text"><?php
341 341
 				printf(
342 342
 					/* translators: %s: Give version */
343
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
343
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
344 344
 					$display_version
345 345
 				);
346 346
 			?></p>
347 347
 			<div class="give-badge"><?php
348 348
 				printf(
349 349
 					/* translators: %s: Give version */
350
-					esc_html__( 'Version %s', 'give' ),
350
+					esc_html__('Version %s', 'give'),
351 351
 					$display_version
352 352
 				);
353 353
 			?></div>
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			<?php $this->tabs(); ?>
356 356
 
357 357
 			<div class="changelog">
358
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
358
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
359 359
 
360 360
 				<div class="feature-section">
361 361
 					<?php echo $this->parse_readme(); ?>
@@ -363,10 +363,10 @@  discard block
 block discarded – undo
363 363
 			</div>
364 364
 
365 365
 			<div class="return-to-dashboard">
366
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
366
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
367 367
 					'post_type' => 'give_forms',
368 368
 					'page'      => 'give-settings'
369
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
369
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
370 370
 			</div>
371 371
 		</div>
372 372
 	<?php
@@ -380,45 +380,45 @@  discard block
 block discarded – undo
380 380
 	 * @return void
381 381
 	 */
382 382
 	public function getting_started_screen() {
383
-		list( $display_version ) = explode( '-', GIVE_VERSION );
383
+		list($display_version) = explode('-', GIVE_VERSION);
384 384
 		?>
385 385
 		<div class="wrap about-wrap get-started">
386 386
 			<h1 class="welcome-h1"><?php
387 387
 				printf(
388 388
 					/* translators: %s: Give version */
389
-					esc_html__( 'Give %s - Getting Started Guide', 'give' ),
389
+					esc_html__('Give %s - Getting Started Guide', 'give'),
390 390
 					$display_version
391 391
 				);
392 392
 			?></h1>
393 393
 
394 394
 			<?php give_social_media_elements() ?>
395 395
 
396
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
396
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
397 397
 
398
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
398
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
399 399
 
400 400
 			<?php give_get_newsletter() ?>
401 401
 
402 402
 			<div class="give-badge"><?php
403 403
 				printf(
404 404
 					/* translators: %s: Give version */
405
-					esc_html__( 'Version %s', 'give' ),
405
+					esc_html__('Version %s', 'give'),
406 406
 					$display_version
407 407
 				);
408 408
 			?></div>
409 409
 
410 410
 			<?php $this->tabs(); ?>
411 411
 
412
-			<p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
412
+			<p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p>
413 413
 
414 414
 			<div class="feature-section clearfix">
415 415
 
416 416
 				<div class="content feature-section-item">
417
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
417
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
418 418
 
419
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
419
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
420 420
 
421
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
421
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
422 422
 				</div>
423 423
 
424 424
 				<div class="content feature-section-item last-feature">
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
 				</div>
436 436
 
437 437
 				<div class="content feature-section-item last-feature">
438
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
438
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
439 439
 
440
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
440
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
441 441
 				</div>
442 442
 
443 443
 			</div>
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
 			<div class="feature-section clearfix">
447 447
 
448 448
 				<div class="content feature-section-item add-content">
449
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
449
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
450 450
 
451
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
451
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
452 452
 
453
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
453
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
454 454
 				</div>
455 455
 
456 456
 				<div class="content feature-section-item last-feature">
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
 				</div>
468 468
 
469 469
 				<div class="content feature-section-item last-feature">
470
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
470
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
471 471
 
472
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
472
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
473 473
 				</div>
474 474
 
475 475
 
@@ -489,38 +489,38 @@  discard block
 block discarded – undo
489 489
 	 * @return void
490 490
 	 */
491 491
 	public function credits_screen() {
492
-		list( $display_version ) = explode( '-', GIVE_VERSION );
492
+		list($display_version) = explode('-', GIVE_VERSION);
493 493
 		?>
494 494
 		<div class="wrap about-wrap">
495 495
 			<h1 class="welcome-h1"><?php
496 496
 				printf(
497 497
 					/* translators: %s: Give version */
498
-					esc_html__( 'Give %s - Credits', 'give' ),
498
+					esc_html__('Give %s - Credits', 'give'),
499 499
 					$display_version
500 500
 				);
501 501
 			?></h1>
502 502
 
503 503
 			<?php give_social_media_elements() ?>
504 504
 
505
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></p>
505
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></p>
506 506
 
507
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
507
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
508 508
 
509
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
509
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
510 510
 
511 511
 			<?php give_get_newsletter() ?>
512 512
 
513 513
 			<div class="give-badge"><?php
514 514
 				printf(
515 515
 					/* translators: %s: Give version */
516
-					esc_html__( 'Version %s', 'give' ),
516
+					esc_html__('Version %s', 'give'),
517 517
 					$display_version
518 518
 				);
519 519
 			?></div>
520 520
 
521 521
 			<?php $this->tabs(); ?>
522 522
 
523
-			<p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
523
+			<p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p>
524 524
 
525 525
 			<?php echo $this->contributors(); ?>
526 526
 		</div>
@@ -535,21 +535,21 @@  discard block
 block discarded – undo
535 535
 	 * @return string $readme HTML formatted readme file
536 536
 	 */
537 537
 	public function parse_readme() {
538
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
538
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
539 539
 
540
-		if ( ! $file ) {
541
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
540
+		if ( ! $file) {
541
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
542 542
 		} else {
543
-			$readme = file_get_contents( $file );
544
-			$readme = nl2br( esc_html( $readme ) );
545
-			$readme = explode( '== Changelog ==', $readme );
546
-			$readme = end( $readme );
547
-
548
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
549
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
550
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
551
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
552
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
543
+			$readme = file_get_contents($file);
544
+			$readme = nl2br(esc_html($readme));
545
+			$readme = explode('== Changelog ==', $readme);
546
+			$readme = end($readme);
547
+
548
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
549
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
550
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
551
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
552
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
553 553
 		}
554 554
 
555 555
 		return $readme;
@@ -566,27 +566,27 @@  discard block
 block discarded – undo
566 566
 	public function contributors() {
567 567
 		$contributors = $this->get_contributors();
568 568
 
569
-		if ( empty( $contributors ) ) {
569
+		if (empty($contributors)) {
570 570
 			return '';
571 571
 		}
572 572
 
573 573
 		$contributor_list = '<ul class="wp-people-group">';
574 574
 
575
-		foreach ( $contributors as $contributor ) {
575
+		foreach ($contributors as $contributor) {
576 576
 			$contributor_list .= '<li class="wp-person">';
577
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
578
-				esc_url( 'https://github.com/' . $contributor->login ),
577
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
578
+				esc_url('https://github.com/'.$contributor->login),
579 579
 				esc_html(
580 580
 					sprintf(
581 581
 						/* translators: %s: github contributor */
582
-						esc_html__( 'View %s', 'give' ),
582
+						esc_html__('View %s', 'give'),
583 583
 						$contributor->login
584 584
 					)
585 585
 				)
586 586
 			);
587
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
587
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login));
588 588
 			$contributor_list .= '</a>';
589
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
589
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login));
590 590
 			$contributor_list .= '</a>';
591 591
 			$contributor_list .= '</li>';
592 592
 		}
@@ -604,25 +604,25 @@  discard block
 block discarded – undo
604 604
 	 * @return array $contributors List of contributors
605 605
 	 */
606 606
 	public function get_contributors() {
607
-		$contributors = get_transient( 'give_contributors' );
607
+		$contributors = get_transient('give_contributors');
608 608
 
609
-		if ( false !== $contributors ) {
609
+		if (false !== $contributors) {
610 610
 			return $contributors;
611 611
 		}
612 612
 
613
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
613
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
614 614
 
615
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
615
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
616 616
 			return array();
617 617
 		}
618 618
 
619
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
619
+		$contributors = json_decode(wp_remote_retrieve_body($response));
620 620
 
621
-		if ( ! is_array( $contributors ) ) {
621
+		if ( ! is_array($contributors)) {
622 622
 			return array();
623 623
 		}
624 624
 
625
-		set_transient( 'give_contributors', $contributors, 3600 );
625
+		set_transient('give_contributors', $contributors, 3600);
626 626
 
627 627
 		return $contributors;
628 628
 	}
@@ -641,24 +641,24 @@  discard block
 block discarded – undo
641 641
 
642 642
 
643 643
 		// Bail if no activation redirect
644
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
644
+		if ( ! get_transient('_give_activation_redirect')) {
645 645
 			return;
646 646
 		}
647 647
 
648 648
 		// Delete the redirect transient
649
-		delete_transient( '_give_activation_redirect' );
649
+		delete_transient('_give_activation_redirect');
650 650
 
651 651
 		// Bail if activating from network, or bulk
652
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
652
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
653 653
 			return;
654 654
 		}
655 655
 
656
-		$upgrade = get_option( 'give_version_upgraded_from' );
656
+		$upgrade = get_option('give_version_upgraded_from');
657 657
 
658
-		if ( ! $upgrade ) { // First time install
659
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
658
+		if ( ! $upgrade) { // First time install
659
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
660 660
 			exit;
661
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
661
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
662 662
 
663 663
 		} else { // Welcome is NOT disabled in settings
664 664
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.
includes/admin/admin-footer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * @return      string
26 26
  */
27
-function give_admin_rate_us( $footer_text ) {
27
+function give_admin_rate_us($footer_text) {
28 28
 	global $typenow;
29 29
 
30
-	if ( $typenow == 'give_forms' ) {
30
+	if ($typenow == 'give_forms') {
31 31
 		$rate_text = sprintf(
32 32
 			/* translators: %s: Link to 5 star rating */
33
-			__( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ),
34
-			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
33
+			__('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'),
34
+			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="'.esc_attr__('Thanks :)', 'give').'">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
35 35
 		);
36 36
 
37 37
 		return $rate_text;
@@ -40,4 +40,4 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 }
42 42
 
43
-add_filter( 'admin_footer_text', 'give_admin_rate_us' );
43
+add_filter('admin_footer_text', 'give_admin_rate_us');
Please login to merge, or discard this patch.
includes/admin/reporting/reports.php 1 patch
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 
18 18
 // Exit if accessed directly
19
-if ( ! defined( 'ABSPATH' ) ) {
19
+if ( ! defined('ABSPATH')) {
20 20
 	exit;
21 21
 }
22 22
 
@@ -29,39 +29,39 @@  discard block
 block discarded – undo
29 29
  * @return void
30 30
  */
31 31
 function give_reports_page() {
32
-	$current_page = admin_url( 'edit.php?post_type=give_forms&page=give-reports' );
33
-	$active_tab   = isset( $_GET['tab'] ) ? $_GET['tab'] : 'reports';
32
+	$current_page = admin_url('edit.php?post_type=give_forms&page=give-reports');
33
+	$active_tab   = isset($_GET['tab']) ? $_GET['tab'] : 'reports';
34 34
 	?>
35 35
 	<div class="wrap">
36 36
 
37
-		<h1 class="screen-reader-text"><?php esc_html_e( 'Give Reports', 'give' ); ?></h1>
37
+		<h1 class="screen-reader-text"><?php esc_html_e('Give Reports', 'give'); ?></h1>
38 38
 
39 39
 		<h2 class="nav-tab-wrapper">
40
-			<a href="<?php echo esc_url( add_query_arg( array(
40
+			<a href="<?php echo esc_url(add_query_arg(array(
41 41
 				'tab'              => 'reports',
42 42
 				'settings-updated' => false
43
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Reports', 'give' ); ?></a>
44
-			<?php if ( current_user_can( 'export_give_reports' ) ) { ?>
45
-				<a href="<?php echo esc_url( add_query_arg( array(
43
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Reports', 'give'); ?></a>
44
+			<?php if (current_user_can('export_give_reports')) { ?>
45
+				<a href="<?php echo esc_url(add_query_arg(array(
46 46
 					'tab'              => 'export',
47 47
 					'settings-updated' => false
48
-				), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Export', 'give' ); ?></a>
48
+				), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Export', 'give'); ?></a>
49 49
 			<?php } ?>
50
-			<a href="<?php echo esc_url( add_query_arg( array(
50
+			<a href="<?php echo esc_url(add_query_arg(array(
51 51
 				'tab'              => 'logs',
52 52
 				'settings-updated' => false
53
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Logs', 'give' ); ?></a>
54
-			<a href="<?php echo esc_url( add_query_arg( array(
53
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Logs', 'give'); ?></a>
54
+			<a href="<?php echo esc_url(add_query_arg(array(
55 55
 				'tab'              => 'tools',
56 56
 				'settings-updated' => false
57
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'tools' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Tools', 'give' ); ?></a>
58
-			<?php do_action( 'give_reports_tabs' ); ?>
57
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'tools' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Tools', 'give'); ?></a>
58
+			<?php do_action('give_reports_tabs'); ?>
59 59
 		</h2>
60 60
 
61 61
 		<?php
62
-		do_action( 'give_reports_page_top' );
63
-		do_action( 'give_reports_tab_' . $active_tab );
64
-		do_action( 'give_reports_page_bottom' );
62
+		do_action('give_reports_page_top');
63
+		do_action('give_reports_tab_'.$active_tab);
64
+		do_action('give_reports_page_bottom');
65 65
 		?>
66 66
 	</div><!-- .wrap -->
67 67
 	<?php
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function give_reports_default_views() {
77 77
 	$views = array(
78
-		'earnings' => esc_html__( 'Income', 'give' ),
78
+		'earnings' => esc_html__('Income', 'give'),
79 79
 		'forms'    => give_get_forms_label_plural(),
80
-		'donors'   => esc_html__( 'Donors', 'give' ),
81
-		'gateways' => esc_html__( 'Payment Methods', 'give' )
80
+		'donors'   => esc_html__('Donors', 'give'),
81
+		'gateways' => esc_html__('Payment Methods', 'give')
82 82
 	);
83 83
 
84
-	$views = apply_filters( 'give_report_views', $views );
84
+	$views = apply_filters('give_report_views', $views);
85 85
 
86 86
 	return $views;
87 87
 }
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
  * @return string $view Report View
98 98
  *
99 99
  */
100
-function give_get_reporting_view( $default = 'earnings' ) {
100
+function give_get_reporting_view($default = 'earnings') {
101 101
 
102
-	if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) {
102
+	if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) {
103 103
 		$view = $default;
104 104
 	} else {
105 105
 		$view = $_GET['view'];
106 106
 	}
107 107
 
108
-	return apply_filters( 'give_get_reporting_view', $view );
108
+	return apply_filters('give_get_reporting_view', $view);
109 109
 }
110 110
 
111 111
 /**
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 	$current_view = 'earnings';
119 119
 	$views        = give_reports_default_views();
120 120
 
121
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) {
121
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $views)) {
122 122
 		$current_view = $_GET['view'];
123 123
 	}
124 124
 
125
-	do_action( 'give_reports_view_' . $current_view );
125
+	do_action('give_reports_view_'.$current_view);
126 126
 }
127 127
 
128
-add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' );
128
+add_action('give_reports_tab_reports', 'give_reports_tab_reports');
129 129
 
130 130
 /**
131 131
  * Renders the Reports Page Views Drop Downs
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function give_report_views() {
137 137
 	$views        = give_reports_default_views();
138
-	$current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings';
139
-	do_action( 'give_report_view_actions_before' );
138
+	$current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings';
139
+	do_action('give_report_view_actions_before');
140 140
 	?>
141 141
 	<form id="give-reports-filter" method="get">
142 142
 		<select id="give-reports-view" name="view">
143
-			<option value="-1"><?php esc_html_e( 'Report Type', 'give' ); ?></option>
144
-			<?php foreach ( $views as $view_id => $label ) : ?>
145
-				<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
143
+			<option value="-1"><?php esc_html_e('Report Type', 'give'); ?></option>
144
+			<?php foreach ($views as $view_id => $label) : ?>
145
+				<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
146 146
 			<?php endforeach; ?>
147 147
 		</select>
148 148
 
149
-		<?php do_action( 'give_report_view_actions' ); ?>
149
+		<?php do_action('give_report_view_actions'); ?>
150 150
 
151 151
 		<input type="hidden" name="post_type" value="give_forms"/>
152 152
 		<input type="hidden" name="page" value="give-reports"/>
153
-		<?php submit_button( esc_html__( 'Show', 'give' ), 'secondary', 'submit', false ); ?>
153
+		<?php submit_button(esc_html__('Show', 'give'), 'secondary', 'submit', false); ?>
154 154
 	</form>
155 155
 	<?php
156
-	do_action( 'give_report_view_actions_after' );
156
+	do_action('give_report_view_actions_after');
157 157
 }
158 158
 
159 159
 /**
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
  */
167 167
 function give_reports_forms_table() {
168 168
 
169
-	if ( isset( $_GET['form-id'] ) ) {
169
+	if (isset($_GET['form-id'])) {
170 170
 		return;
171 171
 	}
172 172
 
173
-	include( dirname( __FILE__ ) . '/class-form-reports-table.php' );
173
+	include(dirname(__FILE__).'/class-form-reports-table.php');
174 174
 
175 175
 	$give_table = new Give_Form_Reports_Table();
176 176
 	$give_table->prepare_items();
177 177
 	$give_table->display();
178 178
 }
179 179
 
180
-add_action( 'give_reports_view_forms', 'give_reports_forms_table' );
180
+add_action('give_reports_view_forms', 'give_reports_forms_table');
181 181
 
182 182
 /**
183 183
  * Renders the detailed report for a specific give form
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
  * @return void
187 187
  */
188 188
 function give_reports_form_details() {
189
-	if ( ! isset( $_GET['form-id'] ) ) {
189
+	if ( ! isset($_GET['form-id'])) {
190 190
 		return;
191 191
 	}
192 192
 	?>
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 		<div class="actions bulkactions">
195 195
 			<?php give_report_views(); ?>
196 196
 			&nbsp;
197
-			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e( 'Go Back', 'give' ); ?></button>
197
+			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e('Go Back', 'give'); ?></button>
198 198
 		</div>
199 199
 	</div>
200 200
 	<?php
201
-	give_reports_graph_of_form( absint( $_GET['form-id'] ) );
201
+	give_reports_graph_of_form(absint($_GET['form-id']));
202 202
 }
203 203
 
204
-add_action( 'give_reports_view_forms', 'give_reports_form_details' );
204
+add_action('give_reports_view_forms', 'give_reports_form_details');
205 205
 
206 206
 /**
207 207
  * Renders the Reports Donors Table
@@ -212,28 +212,28 @@  discard block
 block discarded – undo
212 212
  * @return void
213 213
  */
214 214
 function give_reports_donors_table() {
215
-	include( dirname( __FILE__ ) . '/class-donor-reports-table.php' );
215
+	include(dirname(__FILE__).'/class-donor-reports-table.php');
216 216
 
217 217
 	$give_table = new Give_Donor_Reports_Table();
218 218
 	$give_table->prepare_items();
219 219
 	?>
220 220
 	<div class="wrap give-reports-donors-wrap">
221
-		<?php do_action( 'give_logs_donors_table_top' ); ?>
222
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=donors' ); ?>">
221
+		<?php do_action('give_logs_donors_table_top'); ?>
222
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-reports&view=donors'); ?>">
223 223
 			<?php
224
-			$give_table->search_box( esc_html__( 'Search', 'give' ), 'give-donors' );
224
+			$give_table->search_box(esc_html__('Search', 'give'), 'give-donors');
225 225
 			$give_table->display();
226 226
 			?>
227 227
 			<input type="hidden" name="post_type" value="give_forms"/>
228 228
 			<input type="hidden" name="page" value="give-reports"/>
229 229
 			<input type="hidden" name="view" value="donors"/>
230 230
 		</form>
231
-		<?php do_action( 'give_logs_donors_table_bottom' ); ?>
231
+		<?php do_action('give_logs_donors_table_bottom'); ?>
232 232
 	</div>
233 233
 	<?php
234 234
 }
235 235
 
236
-add_action( 'give_reports_view_donors', 'give_reports_donors_table' );
236
+add_action('give_reports_view_donors', 'give_reports_donors_table');
237 237
 
238 238
 
239 239
 /**
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
  * @return void
246 246
  */
247 247
 function give_reports_gateways_table() {
248
-	include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' );
248
+	include(dirname(__FILE__).'/class-gateways-reports-table.php');
249 249
 
250 250
 	$give_table = new Give_Gateawy_Reports_Table();
251 251
 	$give_table->prepare_items();
252 252
 	$give_table->display();
253 253
 }
254 254
 
255
-add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' );
255
+add_action('give_reports_view_gateways', 'give_reports_gateways_table');
256 256
 
257 257
 
258 258
 /**
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 function give_reports_earnings() {
265 265
 	?>
266 266
 	<div class="tablenav top reports-table-nav">
267
-		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Income Over Time', 'give' ); ?></span></h3>
267
+		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Income Over Time', 'give'); ?></span></h3>
268 268
 
269 269
 		<div class="alignright actions reports-views-wrap"><?php give_report_views(); ?></div>
270 270
 	</div>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	give_reports_graph();
273 273
 }
274 274
 
275
-add_action( 'give_reports_view_earnings', 'give_reports_earnings' );
275
+add_action('give_reports_view_earnings', 'give_reports_earnings');
276 276
 
277 277
 
278 278
 /**
@@ -287,53 +287,53 @@  discard block
 block discarded – undo
287 287
 		<div id="post-body">
288 288
 			<div id="post-body-content">
289 289
 
290
-				<?php do_action( 'give_reports_tab_export_content_top' ); ?>
290
+				<?php do_action('give_reports_tab_export_content_top'); ?>
291 291
 
292 292
 				<table class="widefat export-options-table give-table">
293 293
 					<thead>
294 294
 					<tr>
295
-						<th class="row-title"><?php esc_html_e( 'Export Type', 'give' ); ?></th>
296
-						<th><?php esc_html_e( 'Export Options', 'give' ); ?></th>
295
+						<th class="row-title"><?php esc_html_e('Export Type', 'give'); ?></th>
296
+						<th><?php esc_html_e('Export Options', 'give'); ?></th>
297 297
 					</tr>
298 298
 					</thead>
299 299
 					<tbody>
300
-					<?php do_action( 'give_reports_tab_export_table_top' ); ?>
300
+					<?php do_action('give_reports_tab_export_table_top'); ?>
301 301
 					<tr class="give-export-pdf-sales-earnings">
302 302
 						<td class="row-title">
303
-							<h3><span><?php esc_html_e( 'Export PDF of Donations and Income', 'give' ); ?></span></h3>
303
+							<h3><span><?php esc_html_e('Export PDF of Donations and Income', 'give'); ?></span></h3>
304 304
 
305
-							<p><?php esc_html_e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
305
+							<p><?php esc_html_e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
306 306
 						</td>
307 307
 						<td>
308
-							<a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"><?php esc_html_e( 'Generate PDF', 'give' ); ?></a>
308
+							<a class="button" href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>"><?php esc_html_e('Generate PDF', 'give'); ?></a>
309 309
 						</td>
310 310
 					</tr>
311 311
 					<tr class="alternate give-export-sales-earnings">
312 312
 						<td class="row-title">
313
-							<h3><span><?php esc_html_e( 'Export Income and Donation Stats', 'give' ); ?></span></h3>
313
+							<h3><span><?php esc_html_e('Export Income and Donation Stats', 'give'); ?></span></h3>
314 314
 
315
-							<p><?php esc_html_e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
315
+							<p><?php esc_html_e('Download a CSV of income and donations over time.', 'give'); ?></p>
316 316
 						</td>
317 317
 						<td>
318 318
 							<form method="post">
319 319
 								<?php
320 320
 									printf(
321 321
 										/* translators: 1: start date dropdown 2: end date dropdown */
322
-										esc_html__( '%1$s to %2$s', 'give' ),
323
-										Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ),
324
-										Give()->html->year_dropdown( 'end_year' )   . ' ' . Give()->html->month_dropdown( 'end_month' )
322
+										esc_html__('%1$s to %2$s', 'give'),
323
+										Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'),
324
+										Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month')
325 325
 									);
326 326
 								?>
327 327
 								<input type="hidden" name="give-action" value="earnings_export"/>
328
-								<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
328
+								<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
329 329
 							</form>
330 330
 						</td>
331 331
 					</tr>
332 332
 					<tr class="give-export-payment-history">
333 333
 						<td class="row-title">
334
-							<h3><span><?php esc_html_e( 'Export Donation History', 'give' ); ?></span></h3>
334
+							<h3><span><?php esc_html_e('Export Donation History', 'give'); ?></span></h3>
335 335
 
336
-							<p><?php esc_html_e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
336
+							<p><?php esc_html_e('Download a CSV of all donations recorded.', 'give'); ?></p>
337 337
 						</td>
338 338
 						<td>
339 339
 							<form id="give-export-payments" class="give-export-form" method="post">
@@ -341,29 +341,29 @@  discard block
 block discarded – undo
341 341
 								$args = array(
342 342
 									'id'          => 'give-payment-export-start',
343 343
 									'name'        => 'start',
344
-									'placeholder' => esc_attr__( 'Start date', 'give' )
344
+									'placeholder' => esc_attr__('Start date', 'give')
345 345
 								);
346
-								echo Give()->html->date_field( $args ); ?>
346
+								echo Give()->html->date_field($args); ?>
347 347
 								<?php
348 348
 								$args = array(
349 349
 									'id'          => 'give-payment-export-end',
350 350
 									'name'        => 'end',
351
-									'placeholder' => esc_attr__( 'End date', 'give' )
351
+									'placeholder' => esc_attr__('End date', 'give')
352 352
 								);
353
-								echo Give()->html->date_field( $args ); ?>
353
+								echo Give()->html->date_field($args); ?>
354 354
 								<select name="status">
355
-									<option value="any"><?php esc_html_e( 'All Statuses', 'give' ); ?></option>
355
+									<option value="any"><?php esc_html_e('All Statuses', 'give'); ?></option>
356 356
 									<?php
357 357
 									$statuses = give_get_payment_statuses();
358
-									foreach ( $statuses as $status => $label ) {
359
-										echo '<option value="' . $status . '">' . $label . '</option>';
358
+									foreach ($statuses as $status => $label) {
359
+										echo '<option value="'.$status.'">'.$label.'</option>';
360 360
 									}
361 361
 									?>
362 362
 								</select>
363
-								<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
363
+								<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
364 364
 								<input type="hidden" name="give-export-class" value="Give_Batch_Payments_Export"/>
365 365
 								<span>
366
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
366
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
367 367
 									<span class="spinner"></span>
368 368
 								</span>
369 369
 							</form>
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
 					</tr>
373 373
 					<tr class="alternate give-export-donors">
374 374
 						<td class="row-title">
375
-							<h3><span><?php esc_html_e( 'Export Donors in CSV', 'give' ); ?></span></h3>
375
+							<h3><span><?php esc_html_e('Export Donors in CSV', 'give'); ?></span></h3>
376 376
 
377
-							<p><?php esc_html_e( 'Download an export of donors for all donation forms or only those who have given to a particular form.', 'give' ); ?></p>
377
+							<p><?php esc_html_e('Download an export of donors for all donation forms or only those who have given to a particular form.', 'give'); ?></p>
378 378
 						</td>
379 379
 						<td>
380 380
 							<form method="post" id="give_donor_export" class="give-export-form">
@@ -385,54 +385,54 @@  discard block
 block discarded – undo
385 385
 										'id'     => 'give_customer_export_form',
386 386
 										'chosen' => true
387 387
 									);
388
-									echo Give()->html->forms_dropdown( $args ); ?>
388
+									echo Give()->html->forms_dropdown($args); ?>
389 389
 								
390
-								<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
390
+								<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
391 391
 
392 392
 								<div id="export-donor-options-wrap" class="give-clearfix">
393
-									<p><?php esc_html_e( 'Export Columns', 'give' ); ?>:</p>
393
+									<p><?php esc_html_e('Export Columns', 'give'); ?>:</p>
394 394
 									<ul id="give-export-option-ul">
395 395
 										<li>
396
-											<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e( 'Name', 'give' ); ?>
396
+											<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e('Name', 'give'); ?>
397 397
 											</label>
398 398
 										</li>
399 399
 										<li>
400
-											<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e( 'Email', 'give' ); ?>
400
+											<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e('Email', 'give'); ?>
401 401
 											</label>
402 402
 										</li>
403 403
 										<li>
404
-											<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e( 'Address', 'give' ); ?>
404
+											<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e('Address', 'give'); ?>
405 405
 											</label>
406 406
 										</li>
407 407
 										<li>
408
-											<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e( 'User ID', 'give' ); ?>
408
+											<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e('User ID', 'give'); ?>
409 409
 											</label>
410 410
 										</li>
411 411
 										<li>
412
-											<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e( 'First Donation Date', 'give' ); ?>
412
+											<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e('First Donation Date', 'give'); ?>
413 413
 											</label>
414 414
 										</li>
415 415
 										<li>
416
-											<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e( 'Number of Donations', 'give' ); ?>
416
+											<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e('Number of Donations', 'give'); ?>
417 417
 											</label>
418 418
 										</li>
419 419
 										<li>
420
-											<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e( 'Total Donated', 'give' ); ?>
420
+											<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e('Total Donated', 'give'); ?>
421 421
 											</label>
422 422
 										</li>
423 423
 									</ul>
424 424
 								</div>
425
-								<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
425
+								<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
426 426
 								<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
427 427
 								<input type="hidden" name="give-action" value="email_export"/>
428 428
 							</form>
429 429
 						</td>
430 430
 					</tr>
431
-					<?php do_action( 'give_reports_tab_export_table_bottom' ); ?>
431
+					<?php do_action('give_reports_tab_export_table_bottom'); ?>
432 432
 					</tbody>
433 433
 				</table>
434 434
 
435
-				<?php do_action( 'give_reports_tab_export_content_bottom' ); ?>
435
+				<?php do_action('give_reports_tab_export_content_bottom'); ?>
436 436
 
437 437
 			</div>
438 438
 			<!-- .post-body-content -->
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<?php
443 443
 }
444 444
 
445
-add_action( 'give_reports_tab_export', 'give_reports_tab_export' );
445
+add_action('give_reports_tab_export', 'give_reports_tab_export');
446 446
 
447 447
 /**
448 448
  * Renders the Reports page
@@ -452,19 +452,19 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function give_reports_tab_logs() {
454 454
 
455
-	require( GIVE_PLUGIN_DIR . 'includes/admin/reporting/logs.php' );
455
+	require(GIVE_PLUGIN_DIR.'includes/admin/reporting/logs.php');
456 456
 
457 457
 	$current_view = 'sales';
458 458
 	$log_views    = give_log_default_views();
459 459
 
460
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $log_views ) ) {
460
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $log_views)) {
461 461
 		$current_view = $_GET['view'];
462 462
 	}
463 463
 
464
-	do_action( 'give_logs_view_' . $current_view );
464
+	do_action('give_logs_view_'.$current_view);
465 465
 }
466 466
 
467
-add_action( 'give_reports_tab_logs', 'give_reports_tab_logs' );
467
+add_action('give_reports_tab_logs', 'give_reports_tab_logs');
468 468
 
469 469
 /**
470 470
  * Retrieves estimated monthly earnings and sales
@@ -474,9 +474,9 @@  discard block
 block discarded – undo
474 474
  */
475 475
 function give_estimated_monthly_stats() {
476 476
 
477
-	$estimated = get_transient( 'give_estimated_monthly_stats' );
477
+	$estimated = get_transient('give_estimated_monthly_stats');
478 478
 
479
-	if ( false === $estimated ) {
479
+	if (false === $estimated) {
480 480
 
481 481
 		$estimated = array(
482 482
 			'earnings' => 0,
@@ -485,20 +485,20 @@  discard block
 block discarded – undo
485 485
 
486 486
 		$stats = new Give_Payment_Stats;
487 487
 
488
-		$to_date_earnings = $stats->get_earnings( 0, 'this_month' );
489
-		$to_date_sales    = $stats->get_sales( 0, 'this_month' );
488
+		$to_date_earnings = $stats->get_earnings(0, 'this_month');
489
+		$to_date_sales    = $stats->get_sales(0, 'this_month');
490 490
 
491
-		$current_day   = date( 'd', current_time( 'timestamp' ) );
492
-		$current_month = date( 'n', current_time( 'timestamp' ) );
493
-		$current_year  = date( 'Y', current_time( 'timestamp' ) );
494
-		$days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year );
491
+		$current_day   = date('d', current_time('timestamp'));
492
+		$current_month = date('n', current_time('timestamp'));
493
+		$current_year  = date('Y', current_time('timestamp'));
494
+		$days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year);
495 495
 
496
-		$estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month;
497
-		$estimated['sales']    = ( $to_date_sales / $current_day ) * $days_in_month;
496
+		$estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month;
497
+		$estimated['sales']    = ($to_date_sales / $current_day) * $days_in_month;
498 498
 
499 499
 		// Cache for one day
500
-		set_transient( 'give_estimated_monthly_stats', $estimated, 86400 );
500
+		set_transient('give_estimated_monthly_stats', $estimated, 86400);
501 501
 	}
502 502
 
503
-	return maybe_unserialize( $estimated );
503
+	return maybe_unserialize($estimated);
504 504
 }
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-payments.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function csv_cols() {
41 41
 		$cols = array(
42
-			'id'        => esc_html__( 'ID', 'give' ), // unaltered payment ID (use for querying).
43
-			'seq_id'    => esc_html__( 'Payment Number', 'give' ), // sequential payment ID.
44
-			'email'     => esc_html__( 'Email', 'give' ),
45
-			'first'     => esc_html__( 'First Name', 'give' ),
46
-			'last'      => esc_html__( 'Last Name', 'give' ),
47
-			'address1'  => esc_html__( 'Address', 'give' ),
48
-			'address2'  => esc_html__( 'Address (Line 2)', 'give' ),
49
-			'city'      => esc_html__( 'City', 'give' ),
50
-			'state'     => esc_html__( 'State', 'give' ),
51
-			'country'   => esc_html__( 'Country', 'give' ),
52
-			'zip'       => esc_html__( 'Zip / Postal Code', 'give' ),
53
-			'form_id'   => esc_html__( 'Form ID', 'give' ),
54
-			'form_name' => esc_html__( 'Form Name', 'give' ),
55
-			'amount'    => esc_html__( 'Amount', 'give' ) . ' (' . html_entity_decode( give_currency_filter( '' ) ) . ')',
56
-			'gateway'   => esc_html__( 'Payment Method', 'give' ),
57
-			'trans_id'  => esc_html__( 'Transaction ID', 'give' ),
58
-			'key'       => esc_html__( 'Purchase Key', 'give' ),
59
-			'date'      => esc_html__( 'Date', 'give' ),
60
-			'user'      => esc_html__( 'User', 'give' ),
61
-			'status'    => esc_html__( 'Status', 'give' )
42
+			'id'        => esc_html__('ID', 'give'), // unaltered payment ID (use for querying).
43
+			'seq_id'    => esc_html__('Payment Number', 'give'), // sequential payment ID.
44
+			'email'     => esc_html__('Email', 'give'),
45
+			'first'     => esc_html__('First Name', 'give'),
46
+			'last'      => esc_html__('Last Name', 'give'),
47
+			'address1'  => esc_html__('Address', 'give'),
48
+			'address2'  => esc_html__('Address (Line 2)', 'give'),
49
+			'city'      => esc_html__('City', 'give'),
50
+			'state'     => esc_html__('State', 'give'),
51
+			'country'   => esc_html__('Country', 'give'),
52
+			'zip'       => esc_html__('Zip / Postal Code', 'give'),
53
+			'form_id'   => esc_html__('Form ID', 'give'),
54
+			'form_name' => esc_html__('Form Name', 'give'),
55
+			'amount'    => esc_html__('Amount', 'give').' ('.html_entity_decode(give_currency_filter('')).')',
56
+			'gateway'   => esc_html__('Payment Method', 'give'),
57
+			'trans_id'  => esc_html__('Transaction ID', 'give'),
58
+			'key'       => esc_html__('Purchase Key', 'give'),
59
+			'date'      => esc_html__('Date', 'give'),
60
+			'user'      => esc_html__('User', 'give'),
61
+			'status'    => esc_html__('Status', 'give')
62 62
 		);
63 63
 
64
-		if ( ! give_get_option( 'enable_sequential' ) ) {
65
-			unset( $cols['seq_id'] );
64
+		if ( ! give_get_option('enable_sequential')) {
65
+			unset($cols['seq_id']);
66 66
 		}
67 67
 
68 68
 		return $cols;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			'status' => $this->status
88 88
 		);
89 89
 
90
-		if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
90
+		if ( ! empty($this->start) || ! empty($this->end)) {
91 91
 
92 92
 			$args['date_query'] = array(
93 93
 				array(
94
-					'after'     => date( 'Y-n-d 00:00:00', strtotime( $this->start ) ),
95
-					'before'    => date( 'Y-n-d 23:59:59', strtotime( $this->end ) ),
94
+					'after'     => date('Y-n-d 00:00:00', strtotime($this->start)),
95
+					'before'    => date('Y-n-d 23:59:59', strtotime($this->end)),
96 96
 					'inclusive' => true
97 97
 				)
98 98
 			);
@@ -101,52 +101,52 @@  discard block
 block discarded – undo
101 101
 
102 102
 		//echo json_encode($args ); exit;
103 103
 
104
-		$payments = give_get_payments( $args );
104
+		$payments = give_get_payments($args);
105 105
 
106
-		if ( $payments ) {
106
+		if ($payments) {
107 107
 
108
-			foreach ( $payments as $payment ) {
109
-				$payment_meta = give_get_payment_meta( $payment->ID );
110
-				$user_info    = give_get_payment_meta_user_info( $payment->ID );
111
-				$total        = give_get_payment_amount( $payment->ID );
112
-				$user_id      = isset( $user_info['id'] ) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
108
+			foreach ($payments as $payment) {
109
+				$payment_meta = give_get_payment_meta($payment->ID);
110
+				$user_info    = give_get_payment_meta_user_info($payment->ID);
111
+				$total        = give_get_payment_amount($payment->ID);
112
+				$user_id      = isset($user_info['id']) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
113 113
 				$products     = '';
114 114
 				$skus         = '';
115 115
 
116
-				if ( is_numeric( $user_id ) ) {
117
-					$user = get_userdata( $user_id );
116
+				if (is_numeric($user_id)) {
117
+					$user = get_userdata($user_id);
118 118
 				} else {
119 119
 					$user = false;
120 120
 				}
121 121
 
122 122
 				$data[] = array(
123 123
 					'id'        => $payment->ID,
124
-					'seq_id'    => give_get_payment_number( $payment->ID ),
124
+					'seq_id'    => give_get_payment_number($payment->ID),
125 125
 					'email'     => $payment_meta['email'],
126 126
 					'first'     => $user_info['first_name'],
127 127
 					'last'      => $user_info['last_name'],
128
-					'address1'  => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '',
129
-					'address2'  => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '',
130
-					'city'      => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '',
131
-					'state'     => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '',
132
-					'country'   => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '',
133
-					'zip'       => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '',
134
-					'form_id'   => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '',
135
-					'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '',
128
+					'address1'  => isset($user_info['address']['line1']) ? $user_info['address']['line1'] : '',
129
+					'address2'  => isset($user_info['address']['line2']) ? $user_info['address']['line2'] : '',
130
+					'city'      => isset($user_info['address']['city']) ? $user_info['address']['city'] : '',
131
+					'state'     => isset($user_info['address']['state']) ? $user_info['address']['state'] : '',
132
+					'country'   => isset($user_info['address']['country']) ? $user_info['address']['country'] : '',
133
+					'zip'       => isset($user_info['address']['zip']) ? $user_info['address']['zip'] : '',
134
+					'form_id'   => isset($payment_meta['form_id']) ? $payment_meta['form_id'] : '',
135
+					'form_name' => isset($payment_meta['form_title']) ? $payment_meta['form_title'] : '',
136 136
 					'skus'      => $skus,
137
-					'amount'    => html_entity_decode( give_format_amount( $total ) ),
138
-					'gateway'   => give_get_gateway_admin_label( get_post_meta( $payment->ID, '_give_payment_gateway', true ) ),
139
-					'trans_id'  => give_get_payment_transaction_id( $payment->ID ),
137
+					'amount'    => html_entity_decode(give_format_amount($total)),
138
+					'gateway'   => give_get_gateway_admin_label(get_post_meta($payment->ID, '_give_payment_gateway', true)),
139
+					'trans_id'  => give_get_payment_transaction_id($payment->ID),
140 140
 					'key'       => $payment_meta['key'],
141 141
 					'date'      => $payment->post_date,
142
-					'user'      => $user ? $user->display_name : __( 'guest', 'give' ),
143
-					'status'    => give_get_payment_status( $payment, true )
142
+					'user'      => $user ? $user->display_name : __('guest', 'give'),
143
+					'status'    => give_get_payment_status($payment, true)
144 144
 				);
145 145
 
146 146
 			}
147 147
 
148
-			$data = apply_filters( 'give_export_get_data', $data );
149
-			$data = apply_filters( 'give_export_get_data_' . $this->export_type, $data );
148
+			$data = apply_filters('give_export_get_data', $data);
149
+			$data = apply_filters('give_export_get_data_'.$this->export_type, $data);
150 150
 
151 151
 			return $data;
152 152
 
@@ -166,27 +166,27 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$status = $this->status;
168 168
 		$args   = array(
169
-			'start-date' => date( 'n/d/Y', strtotime( $this->start ) ),
170
-			'end-date'   => date( 'n/d/Y', strtotime( $this->end ) ),
169
+			'start-date' => date('n/d/Y', strtotime($this->start)),
170
+			'end-date'   => date('n/d/Y', strtotime($this->end)),
171 171
 		);
172 172
 
173
-		if ( 'any' == $status ) {
173
+		if ('any' == $status) {
174 174
 
175
-			$total = array_sum( (array) give_count_payments( $args ) );
175
+			$total = array_sum((array) give_count_payments($args));
176 176
 
177 177
 		} else {
178 178
 
179
-			$total = give_count_payments( $args )->$status;
179
+			$total = give_count_payments($args)->$status;
180 180
 
181 181
 		}
182 182
 
183 183
 		$percentage = 100;
184 184
 
185
-		if ( $total > 0 ) {
186
-			$percentage = ( ( 30 * $this->step ) / $total ) * 100;
185
+		if ($total > 0) {
186
+			$percentage = ((30 * $this->step) / $total) * 100;
187 187
 		}
188 188
 
189
-		if ( $percentage > 100 ) {
189
+		if ($percentage > 100) {
190 190
 			$percentage = 100;
191 191
 		}
192 192
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @param array $request The Form Data passed into the batch processing.
202 202
 	 */
203
-	public function set_properties( $request ) {
204
-		$this->start  = isset( $request['start'] ) ? sanitize_text_field( $request['start'] ) : '';
205
-		$this->end    = isset( $request['end'] ) ? sanitize_text_field( $request['end'] ) : '';
206
-		$this->status = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete';
203
+	public function set_properties($request) {
204
+		$this->start  = isset($request['start']) ? sanitize_text_field($request['start']) : '';
205
+		$this->end    = isset($request['end']) ? sanitize_text_field($request['end']) : '';
206
+		$this->status = isset($request['status']) ? sanitize_text_field($request['status']) : 'complete';
207 207
 	}
208 208
 }
Please login to merge, or discard this patch.
includes/admin/reporting/class-gateways-reports-table.php 1 patch
Spacing   +33 added lines, -33 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 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51 51
 			'ajax'     => false                        // Does this table support ajax?
52
-		) );
52
+		));
53 53
 
54 54
 	}
55 55
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string Column Name
66 66
 	 */
67
-	public function column_default( $item, $column_name ) {
68
-		switch ( $column_name ) {
67
+	public function column_default($item, $column_name) {
68
+		switch ($column_name) {
69 69
 			default:
70
-				return $item[ $column_name ];
70
+				return $item[$column_name];
71 71
 		}
72 72
 	}
73 73
 
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function get_columns() {
82 82
 		$columns = array(
83
-			'label'           => esc_attr__( 'Gateway', 'give' ),
84
-			'complete_sales'  => esc_attr__( 'Complete Transactions', 'give' ),
85
-			'pending_sales'   => esc_attr__( 'Pending / Failed Transactions', 'give' ),
86
-			'total_sales'     => esc_attr__( 'Total Transactions', 'give' ),
87
-			'total_donations' => esc_attr__( 'Total Donations', 'give' )
83
+			'label'           => esc_attr__('Gateway', 'give'),
84
+			'complete_sales'  => esc_attr__('Complete Transactions', 'give'),
85
+			'pending_sales'   => esc_attr__('Pending / Failed Transactions', 'give'),
86
+			'total_sales'     => esc_attr__('Total Transactions', 'give'),
87
+			'total_donations' => esc_attr__('Total Donations', 'give')
88 88
 		);
89 89
 
90 90
 		return $columns;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return int Current page number
100 100
 	 */
101 101
 	public function get_paged() {
102
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
102
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
103 103
 	}
104 104
 
105 105
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @since  1.0
111 111
 	 * @return void
112 112
 	 */
113
-	public function bulk_actions( $which = '' ) {
113
+	public function bulk_actions($which = '') {
114 114
 		// These aren't really bulk actions but this outputs the markup in the right place
115 115
 		give_report_views();
116 116
 	}
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @param string $which
125 125
 	 */
126
-	protected function display_tablenav( $which ) {
126
+	protected function display_tablenav($which) {
127 127
 
128
-		if ( 'top' == $which ) {
129
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
128
+		if ('top' == $which) {
129
+			wp_nonce_field('bulk-'.$this->_args['plural']);
130 130
 		}
131 131
 		?>
132
-		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>">
132
+		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>">
133 133
 
134
-			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Payment Methods Report', 'give' ); ?></span></h3>
134
+			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Payment Methods Report', 'give'); ?></span></h3>
135 135
 
136 136
 			<div class="alignright tablenav-right">
137 137
 				<div class="actions bulkactions">
138
-					<?php $this->bulk_actions( $which ); ?>
138
+					<?php $this->bulk_actions($which); ?>
139 139
 				</div>
140 140
 				<?php
141
-				$this->extra_tablenav( $which );
142
-				$this->pagination( $which );
141
+				$this->extra_tablenav($which);
142
+				$this->pagination($which);
143 143
 				?>
144 144
 			</div>
145 145
 
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 		$gateways     = give_get_payment_gateways();
165 165
 		$stats        = new Give_Payment_Stats();
166 166
 
167
-		foreach ( $gateways as $gateway_id => $gateway ) {
167
+		foreach ($gateways as $gateway_id => $gateway) {
168 168
 
169
-			$complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' );
170
-			$pending_count  = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) );
169
+			$complete_count = give_count_sales_by_gateway($gateway_id, 'publish');
170
+			$pending_count  = give_count_sales_by_gateway($gateway_id, array('pending', 'failed'));
171 171
 
172 172
 			$reports_data[] = array(
173 173
 				'ID'              => $gateway_id,
174 174
 				'label'           => $gateway['admin_label'],
175
-				'complete_sales'  => give_format_amount( $complete_count, false ),
176
-				'pending_sales'   => give_format_amount( $pending_count, false ),
177
-				'total_sales'     => give_format_amount( $complete_count + $pending_count, false ),
178
-				'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, 0, 0, $gateway_id ) ) )
175
+				'complete_sales'  => give_format_amount($complete_count, false),
176
+				'pending_sales'   => give_format_amount($pending_count, false),
177
+				'total_sales'     => give_format_amount($complete_count + $pending_count, false),
178
+				'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, 0, 0, $gateway_id)))
179 179
 			);
180 180
 		}
181 181
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$columns               = $this->get_columns();
198 198
 		$hidden                = array(); // No hidden columns
199 199
 		$sortable              = $this->get_sortable_columns();
200
-		$this->_column_headers = array( $columns, $hidden, $sortable );
200
+		$this->_column_headers = array($columns, $hidden, $sortable);
201 201
 		$this->items           = $this->reports_data();
202 202
 
203 203
 	}
Please login to merge, or discard this patch.
includes/admin/reporting/logs.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function give_logs_view_sales() {
26
-	include( dirname( __FILE__ ) . '/class-sales-logs-list-table.php' );
26
+	include(dirname(__FILE__).'/class-sales-logs-list-table.php');
27 27
 
28 28
 	$logs_table = new Give_Sales_Log_Table();
29 29
 	$logs_table->prepare_items();
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 }
33 33
 
34
-add_action( 'give_logs_view_sales', 'give_logs_view_sales' );
34
+add_action('give_logs_view_sales', 'give_logs_view_sales');
35 35
 
36 36
 
37 37
 /**
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  */
45 45
 function give_logs_view_gateway_errors() {
46
-	include( dirname( __FILE__ ) . '/class-gateway-error-logs-list-table.php' );
46
+	include(dirname(__FILE__).'/class-gateway-error-logs-list-table.php');
47 47
 
48 48
 	$logs_table = new Give_Gateway_Error_Log_Table();
49 49
 	$logs_table->prepare_items();
50 50
 	$logs_table->display();
51 51
 }
52 52
 
53
-add_action( 'give_logs_view_gateway_errors', 'give_logs_view_gateway_errors' );
53
+add_action('give_logs_view_gateway_errors', 'give_logs_view_gateway_errors');
54 54
 
55 55
 /**
56 56
  * API Request Logs
@@ -62,31 +62,31 @@  discard block
 block discarded – undo
62 62
  * @return void
63 63
  */
64 64
 function give_logs_view_api_requests() {
65
-	include( dirname( __FILE__ ) . '/class-api-requests-logs-list-table.php' );
65
+	include(dirname(__FILE__).'/class-api-requests-logs-list-table.php');
66 66
 
67 67
 	$logs_table = new Give_API_Request_Log_Table();
68 68
 	$logs_table->prepare_items();
69 69
 	?>
70 70
 	<div class="wrap">
71 71
 
72
-		<?php do_action( 'give_logs_api_requests_top' ); ?>
72
+		<?php do_action('give_logs_api_requests_top'); ?>
73 73
 
74
-		<form id="give-logs-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=logs' ); ?>">
74
+		<form id="give-logs-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-reports&tab=logs'); ?>">
75 75
 			<?php
76
-			$logs_table->search_box( esc_html__( 'Search', 'give' ), 'give-api-requests' );
76
+			$logs_table->search_box(esc_html__('Search', 'give'), 'give-api-requests');
77 77
 			$logs_table->display();
78 78
 			?>
79 79
 			<input type="hidden" name="post_type" value="give_forms"/>
80 80
 			<input type="hidden" name="page" value="give-reports"/>
81 81
 			<input type="hidden" name="tab" value="logs"/>
82 82
 		</form>
83
-		<?php do_action( 'give_logs_api_requests_bottom' ); ?>
83
+		<?php do_action('give_logs_api_requests_bottom'); ?>
84 84
 
85 85
 	</div>
86 86
 	<?php
87 87
 }
88 88
 
89
-add_action( 'give_logs_view_api_requests', 'give_logs_view_api_requests' );
89
+add_action('give_logs_view_api_requests', 'give_logs_view_api_requests');
90 90
 
91 91
 
92 92
 /**
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
  */
98 98
 function give_log_default_views() {
99 99
 	$views = array(
100
-		'sales'          => esc_html__( 'Donations', 'give' ),
101
-		'gateway_errors' => esc_html__( 'Payment Errors', 'give' ),
102
-		'api_requests'   => esc_html__( 'API Requests', 'give' )
100
+		'sales'          => esc_html__('Donations', 'give'),
101
+		'gateway_errors' => esc_html__('Payment Errors', 'give'),
102
+		'api_requests'   => esc_html__('API Requests', 'give')
103 103
 	);
104 104
 
105
-	$views = apply_filters( 'give_log_views', $views );
105
+	$views = apply_filters('give_log_views', $views);
106 106
 
107 107
 	return $views;
108 108
 }
@@ -115,24 +115,24 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function give_log_views() {
117 117
 	$views        = give_log_default_views();
118
-	$current_view = isset( $_GET['view'] ) && array_key_exists( $_GET['view'], give_log_default_views() ) ? sanitize_text_field( $_GET['view'] ) : 'sales';
118
+	$current_view = isset($_GET['view']) && array_key_exists($_GET['view'], give_log_default_views()) ? sanitize_text_field($_GET['view']) : 'sales';
119 119
 	?>
120 120
 	<form id="give-logs-filter" method="get" action="edit.php">
121 121
 		<select id="give-logs-view" name="view">
122 122
 			<optgroup label="Log Type:">
123
-				<?php foreach ( $views as $view_id => $label ): ?>
124
-					<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
123
+				<?php foreach ($views as $view_id => $label): ?>
124
+					<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
125 125
 				<?php endforeach; ?>
126 126
 			</optgroup>
127 127
 		</select>
128 128
 
129
-		<?php do_action( 'give_log_view_actions' ); ?>
129
+		<?php do_action('give_log_view_actions'); ?>
130 130
 
131 131
 		<input type="hidden" name="post_type" value="give_forms"/>
132 132
 		<input type="hidden" name="page" value="give-reports"/>
133 133
 		<input type="hidden" name="tab" value="logs"/>
134 134
 
135
-		<?php submit_button( esc_html__( 'Apply', 'give' ), 'secondary', 'submit', false ); ?>
135
+		<?php submit_button(esc_html__('Apply', 'give'), 'secondary', 'submit', false); ?>
136 136
 	</form>
137 137
 	<?php
138 138
 }
139 139
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrade-functions.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function give_do_automatic_upgrades() {
28 28
 	$did_upgrade  = false;
29
-	$give_version = preg_replace( '/[^0-9.].*/', '', get_option( 'give_version' ) );
30
-	if ( version_compare( $give_version, GIVE_VERSION, '<' ) ) {
29
+	$give_version = preg_replace('/[^0-9.].*/', '', get_option('give_version'));
30
+	if (version_compare($give_version, GIVE_VERSION, '<')) {
31 31
 		give_v16_upgrades();
32 32
 		$did_upgrade = true;
33 33
 	}
34
-	if ( $did_upgrade ) {
35
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
34
+	if ($did_upgrade) {
35
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
36 36
 	}
37 37
 }
38 38
 
39
-add_action( 'admin_init', 'give_do_automatic_upgrades' );
39
+add_action('admin_init', 'give_do_automatic_upgrades');
40 40
 
41 41
 /**
42 42
  * Display Upgrade Notices
@@ -46,18 +46,18 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function give_show_upgrade_notices() {
48 48
 
49
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-upgrades' ) {
49
+	if (isset($_GET['page']) && $_GET['page'] == 'give-upgrades') {
50 50
 		return;
51 51
 	} // Don't show notices on the upgrades page
52 52
 
53
-	$give_version = get_option( 'give_version' );
53
+	$give_version = get_option('give_version');
54 54
 
55
-	if ( ! $give_version ) {
55
+	if ( ! $give_version) {
56 56
 		// 1.0 is the first version to use this option so we must add it
57 57
 		$give_version = '1.0';
58 58
 	}
59 59
 
60
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
60
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
61 61
 
62 62
 	/*
63 63
 	 *  NOTICE:
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 
70 70
 	//v1.3.2 Upgrades
71
-	if ( version_compare( $give_version, '1.3.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) {
71
+	if (version_compare($give_version, '1.3.2', '<') || ! give_has_upgrade_completed('upgrade_give_payment_customer_id')) {
72 72
 		printf(
73 73
 		/* translators: %s: upgrade URL */
74
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
75
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id' ) )
74
+			'<div class="updated"><p>'.__('Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
75
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id'))
76 76
 		);
77 77
 	}
78 78
 
79 79
 	//v1.3.4 Upgrades //ensure the user has gone through 1.3.4
80
-	if ( version_compare( $give_version, '1.3.4', '<' ) || ( ! give_has_upgrade_completed( 'upgrade_give_offline_status' ) && give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) ) {
80
+	if (version_compare($give_version, '1.3.4', '<') || ( ! give_has_upgrade_completed('upgrade_give_offline_status') && give_has_upgrade_completed('upgrade_give_payment_customer_id'))) {
81 81
 		printf(
82 82
 		/* translators: %s: upgrade URL */
83
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
84
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status' ) )
83
+			'<div class="updated"><p>'.__('Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
84
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status'))
85 85
 		);
86 86
 	}
87 87
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 }
93 93
 
94
-add_action( 'admin_notices', 'give_show_upgrade_notices' );
94
+add_action('admin_notices', 'give_show_upgrade_notices');
95 95
 
96 96
 /**
97 97
  * Triggers all upgrade functions
@@ -103,26 +103,26 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function give_trigger_upgrades() {
105 105
 
106
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
107
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
106
+	if ( ! current_user_can('manage_give_settings')) {
107
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
108 108
 	}
109 109
 
110
-	$give_version = get_option( 'give_version' );
110
+	$give_version = get_option('give_version');
111 111
 
112
-	if ( ! $give_version ) {
112
+	if ( ! $give_version) {
113 113
 		// 1.0 is the first version to use this option so we must add it
114 114
 		$give_version = '1.0';
115
-		add_option( 'give_version', $give_version );
115
+		add_option('give_version', $give_version);
116 116
 	}
117 117
 
118
-	update_option( 'give_version', GIVE_VERSION );
118
+	update_option('give_version', GIVE_VERSION);
119 119
 
120
-	if ( DOING_AJAX ) {
121
-		die( 'complete' );
120
+	if (DOING_AJAX) {
121
+		die('complete');
122 122
 	} // Let AJAX know that the upgrade is complete
123 123
 }
124 124
 
125
-add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' );
125
+add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades');
126 126
 
127 127
 /**
128 128
  * Check if the upgrade routine has been run for a specific action
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return bool                   If the action has been added to the completed actions array
135 135
  */
136
-function give_has_upgrade_completed( $upgrade_action = '' ) {
136
+function give_has_upgrade_completed($upgrade_action = '') {
137 137
 
138
-	if ( empty( $upgrade_action ) ) {
138
+	if (empty($upgrade_action)) {
139 139
 		return false;
140 140
 	}
141 141
 
142 142
 	$completed_upgrades = give_get_completed_upgrades();
143 143
 
144
-	return in_array( $upgrade_action, $completed_upgrades );
144
+	return in_array($upgrade_action, $completed_upgrades);
145 145
 
146 146
 }
147 147
 
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
  *
155 155
  * @return bool                   If the function was successfully added
156 156
  */
157
-function give_set_upgrade_complete( $upgrade_action = '' ) {
157
+function give_set_upgrade_complete($upgrade_action = '') {
158 158
 
159
-	if ( empty( $upgrade_action ) ) {
159
+	if (empty($upgrade_action)) {
160 160
 		return false;
161 161
 	}
162 162
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 	$completed_upgrades[] = $upgrade_action;
165 165
 
166 166
 	// Remove any blanks, and only show uniques
167
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
167
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
168 168
 
169
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
169
+	return update_option('give_completed_upgrades', $completed_upgrades);
170 170
 }
171 171
 
172 172
 /**
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
  */
178 178
 function give_get_completed_upgrades() {
179 179
 
180
-	$completed_upgrades = get_option( 'give_completed_upgrades' );
180
+	$completed_upgrades = get_option('give_completed_upgrades');
181 181
 
182
-	if ( false === $completed_upgrades ) {
182
+	if (false === $completed_upgrades) {
183 183
 		$completed_upgrades = array();
184 184
 	}
185 185
 
@@ -197,30 +197,30 @@  discard block
 block discarded – undo
197 197
  */
198 198
 function give_v132_upgrade_give_payment_customer_id() {
199 199
 	global $wpdb;
200
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
201
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
200
+	if ( ! current_user_can('manage_give_settings')) {
201
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
202 202
 	}
203 203
 
204
-	ignore_user_abort( true );
204
+	ignore_user_abort(true);
205 205
 
206
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
207
-		@set_time_limit( 0 );
206
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
207
+		@set_time_limit(0);
208 208
 	}
209 209
 
210 210
 	//UPDATE DB METAKEYS
211 211
 	$sql   = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'";
212
-	$query = $wpdb->query( $sql );
212
+	$query = $wpdb->query($sql);
213 213
 
214
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
215
-	give_set_upgrade_complete( 'upgrade_give_payment_customer_id' );
216
-	delete_option( 'give_doing_upgrade' );
217
-	wp_redirect( admin_url() );
214
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
215
+	give_set_upgrade_complete('upgrade_give_payment_customer_id');
216
+	delete_option('give_doing_upgrade');
217
+	wp_redirect(admin_url());
218 218
 	exit;
219 219
 
220 220
 
221 221
 }
222 222
 
223
-add_action( 'give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id' );
223
+add_action('give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id');
224 224
 
225 225
 /**
226 226
  * Upgrades the Offline Status
@@ -234,14 +234,14 @@  discard block
 block discarded – undo
234 234
 
235 235
 	global $wpdb;
236 236
 
237
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
238
-		wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
237
+	if ( ! current_user_can('manage_give_settings')) {
238
+		wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
239 239
 	}
240 240
 
241
-	ignore_user_abort( true );
241
+	ignore_user_abort(true);
242 242
 
243
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
244
-		@set_time_limit( 0 );
243
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
244
+		@set_time_limit(0);
245 245
 	}
246 246
 
247 247
 	// Get abandoned offline payments
@@ -251,35 +251,35 @@  discard block
 block discarded – undo
251 251
 	$where .= "AND ( p.post_status = 'abandoned' )";
252 252
 	$where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )";
253 253
 
254
-	$sql            = $select . $join . $where;
255
-	$found_payments = $wpdb->get_col( $sql );
254
+	$sql            = $select.$join.$where;
255
+	$found_payments = $wpdb->get_col($sql);
256 256
 
257 257
 
258
-	foreach ( $found_payments as $payment ) {
258
+	foreach ($found_payments as $payment) {
259 259
 
260 260
 		//Only change ones marked abandoned since our release last week
261 261
 		//because the admin may have marked some abandoned themselves
262
-		$modified_time = get_post_modified_time( 'U', false, $payment );
262
+		$modified_time = get_post_modified_time('U', false, $payment);
263 263
 
264 264
 		//1450124863 =  12/10/2015 20:42:25
265
-		if ( $modified_time >= 1450124863 ) {
265
+		if ($modified_time >= 1450124863) {
266 266
 
267
-			give_update_payment_status( $payment, 'pending' );
267
+			give_update_payment_status($payment, 'pending');
268 268
 
269 269
 		}
270 270
 
271 271
 	}
272 272
 
273
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
274
-	give_set_upgrade_complete( 'upgrade_give_offline_status' );
275
-	delete_option( 'give_doing_upgrade' );
276
-	wp_redirect( admin_url() );
273
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
274
+	give_set_upgrade_complete('upgrade_give_offline_status');
275
+	delete_option('give_doing_upgrade');
276
+	wp_redirect(admin_url());
277 277
 	exit;
278 278
 
279 279
 
280 280
 }
281 281
 
282
-add_action( 'give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status' );
282
+add_action('give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status');
283 283
 
284 284
 /**
285 285
  * Cleanup User Roles
@@ -290,17 +290,17 @@  discard block
 block discarded – undo
290 290
  */
291 291
 function give_v152_cleanup_users() {
292 292
 
293
-	$give_version = get_option( 'give_version' );
293
+	$give_version = get_option('give_version');
294 294
 
295
-	if ( ! $give_version ) {
295
+	if ( ! $give_version) {
296 296
 		// 1.0 is the first version to use this option so we must add it
297 297
 		$give_version = '1.0';
298 298
 	}
299 299
 
300
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
300
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
301 301
 
302 302
 	//v1.5.2 Upgrades
303
-	if ( version_compare( $give_version, '1.5.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_user_caps_cleanup' ) ) {
303
+	if (version_compare($give_version, '1.5.2', '<') || ! give_has_upgrade_completed('upgrade_give_user_caps_cleanup')) {
304 304
 
305 305
 		//Delete all caps with "ss"
306 306
 		//Also delete all unused "campaign" roles
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 		);
348 348
 
349 349
 		global $wp_roles;
350
-		foreach ( $delete_caps as $cap ) {
351
-			foreach ( array_keys( $wp_roles->roles ) as $role ) {
352
-				$wp_roles->remove_cap( $role, $cap );
350
+		foreach ($delete_caps as $cap) {
351
+			foreach (array_keys($wp_roles->roles) as $role) {
352
+				$wp_roles->remove_cap($role, $cap);
353 353
 			}
354 354
 		}
355 355
 
@@ -359,15 +359,15 @@  discard block
 block discarded – undo
359 359
 		$roles->add_caps();
360 360
 
361 361
 		//The Update Ran
362
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
363
-		give_set_upgrade_complete( 'upgrade_give_user_caps_cleanup' );
364
-		delete_option( 'give_doing_upgrade' );
362
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
363
+		give_set_upgrade_complete('upgrade_give_user_caps_cleanup');
364
+		delete_option('give_doing_upgrade');
365 365
 
366 366
 	}
367 367
 
368 368
 }
369 369
 
370
-add_action( 'admin_init', 'give_v152_cleanup_users' );
370
+add_action('admin_init', 'give_v152_cleanup_users');
371 371
 
372 372
 /**
373 373
  * 1.6 Upgrade routine to create the customer meta table.
Please login to merge, or discard this patch.
includes/admin/add-ons.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 function give_add_ons_page() {
26 26
 	ob_start(); ?>
27 27
 	<div class="wrap" id="give-add-ons">
28
-		<h1><?php esc_html_e( 'Give Add-ons', 'give' ); ?>
29
-			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php esc_attr_e( 'Browse All Add-ons', 'give' ); ?>" target="_blank"><?php esc_html_e( 'View All Add-ons', 'give' ); ?>
28
+		<h1><?php esc_html_e('Give Add-ons', 'give'); ?>
29
+			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php esc_attr_e('Browse All Add-ons', 'give'); ?>" target="_blank"><?php esc_html_e('View All Add-ons', 'give'); ?>
30 30
 				<span class="dashicons dashicons-external"></span></a>
31 31
 		</h1>
32 32
 
33
-		<p><?php esc_html_e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p>
33
+		<p><?php esc_html_e('The following Add-ons extend the functionality of Give.', 'give'); ?></p>
34 34
 		<?php echo give_add_ons_get_feed(); ?>
35 35
 	</div>
36 36
 	<?php
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 function give_add_ons_get_feed() {
49 49
 
50 50
 	$addons_debug = false; //set to true to debug
51
-	$cache        = get_transient( 'give_add_ons_feed' );
51
+	$cache        = get_transient('give_add_ons_feed');
52 52
 
53
-	if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) {
54
-		$feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) );
53
+	if ($cache === false || $addons_debug === true && WP_DEBUG === true) {
54
+		$feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false));
55 55
 
56
-		if ( ! is_wp_error( $feed ) ) {
57
-			if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
58
-				$cache = wp_remote_retrieve_body( $feed );
59
-				set_transient( 'give_add_ons_feed', $cache, 3600 );
56
+		if ( ! is_wp_error($feed)) {
57
+			if (isset($feed['body']) && strlen($feed['body']) > 0) {
58
+				$cache = wp_remote_retrieve_body($feed);
59
+				set_transient('give_add_ons_feed', $cache, 3600);
60 60
 			}
61 61
 		} else {
62
-			$cache = '<div class="error"><p>' . esc_html__( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>';
62
+			$cache = '<div class="error"><p>'.esc_html__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>';
63 63
 		}
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-goal.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Form_Goal extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' );
22
-		$this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' );
21
+		$this->shortcode['title'] = esc_html__('Donation Form Goal', 'give');
22
+		$this->shortcode['label'] = esc_html__('Donation Form Goal', 'give');
23 23
 
24
-		parent::__construct( 'give_goal' );
24
+		parent::__construct('give_goal');
25 25
 	}
26 26
 
27 27
 	/**
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 
34 34
 		$create_form_link = sprintf(
35 35
 			/* translators: %s: create new form URL */
36
-			__( '<a href="%s">Create</a> a new Donation Form.', 'give' ),
37
-			admin_url( 'post-new.php?post_type=give_forms' )
36
+			__('<a href="%s">Create</a> a new Donation Form.', 'give'),
37
+			admin_url('post-new.php?post_type=give_forms')
38 38
 		);
39 39
 
40 40
 		return array(
@@ -44,35 +44,35 @@  discard block
 block discarded – undo
44 44
 					'post_type' => 'give_forms',
45 45
 				),
46 46
 				'name'        => 'id',
47
-				'tooltip'     => esc_attr__( 'Select a Donation Form', 'give' ),
48
-				'placeholder' => esc_attr__( '- Select a Form -', 'give' ),
47
+				'tooltip'     => esc_attr__('Select a Donation Form', 'give'),
48
+				'placeholder' => esc_attr__('- Select a Form -', 'give'),
49 49
 				'required'    => array(
50
-					'alert' => esc_html__( 'You must first select a Form!', 'give' ),
51
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No donation forms were found!', 'give' ), $create_form_link ),
50
+					'alert' => esc_html__('You must first select a Form!', 'give'),
51
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No donation forms were found!', 'give'), $create_form_link),
52 52
 				),
53 53
 			),
54 54
 			array(
55 55
 				'type' => 'container',
56
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
56
+				'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')),
57 57
 			),
58 58
 			array(
59 59
 				'type'    => 'listbox',
60 60
 				'name'    => 'show_text',
61
-				'label'   => esc_attr__( 'Show Text:', 'give' ),
62
-				'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ),
61
+				'label'   => esc_attr__('Show Text:', 'give'),
62
+				'tooltip' => esc_attr__('This text displays the amount of income raised compared to the goal.', 'give'),
63 63
 				'options' => array(
64
-					'true'  => esc_html__( 'Show', 'give' ),
65
-					'false' => esc_html__( 'Hide', 'give' ),
64
+					'true'  => esc_html__('Show', 'give'),
65
+					'false' => esc_html__('Hide', 'give'),
66 66
 				),
67 67
 			),
68 68
 			array(
69 69
 				'type'    => 'listbox',
70 70
 				'name'    => 'show_bar',
71
-				'label'   => esc_attr__( 'Show Progress Bar:', 'give' ),
72
-				'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ),
71
+				'label'   => esc_attr__('Show Progress Bar:', 'give'),
72
+				'tooltip' => esc_attr__('Do you want to display the goal\'s progress bar?', 'give'),
73 73
 				'options' => array(
74
-					'true'  => esc_html__( 'Show', 'give' ),
75
-					'false' => esc_html__( 'Hide', 'give' ),
74
+					'true'  => esc_html__('Show', 'give'),
75
+					'false' => esc_html__('Hide', 'give'),
76 76
 				),
77 77
 			),
78 78
 		);
Please login to merge, or discard this patch.