Test Failed
Push — master ( 518013...c55ea3 )
by Devin
05:49
created
give.php 1 patch
Spacing   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
  */
40 40
 
41 41
 // Exit if accessed directly.
42
-if ( ! defined( 'ABSPATH' ) ) {
42
+if ( ! defined('ABSPATH')) {
43 43
 	exit;
44 44
 }
45 45
 
46
-if ( ! class_exists( 'Give' ) ) :
46
+if ( ! class_exists('Give')) :
47 47
 
48 48
 	/**
49 49
 	 * Main Give Class
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		 * @return    Give
281 281
 		 */
282 282
 		public static function instance() {
283
-			if ( is_null( self::$_instance ) ) {
283
+			if (is_null(self::$_instance)) {
284 284
 				self::$_instance = new self();
285 285
 			}
286 286
 
@@ -292,13 +292,13 @@  discard block
 block discarded – undo
292 292
 		 */
293 293
 		public function __construct() {
294 294
 			// PHP version
295
-			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
296
-				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
295
+			if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) {
296
+				define('GIVE_REQUIRED_PHP_VERSION', '5.3');
297 297
 			}
298 298
 
299 299
 			// Bailout: Need minimum php version to load plugin.
300
-			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
301
-				add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) );
300
+			if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) {
301
+				add_action('admin_notices', array($this, 'minimum_phpversion_notice'));
302 302
 
303 303
 				return;
304 304
 			}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 			$this->includes();
308 308
 			$this->init_hooks();
309 309
 
310
-			do_action( 'give_loaded' );
310
+			do_action('give_loaded');
311 311
 		}
312 312
 
313 313
 		/**
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
 		 * @since  1.8.9
317 317
 		 */
318 318
 		private function init_hooks() {
319
-			register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
320
-			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
319
+			register_activation_hook(GIVE_PLUGIN_FILE, 'give_install');
320
+			add_action('plugins_loaded', array($this, 'init'), 0);
321 321
 
322 322
 			// Set up localization on init Hook.
323
-			add_action( 'init', array( $this, 'load_textdomain' ), 0 );
323
+			add_action('init', array($this, 'load_textdomain'), 0);
324 324
 		}
325 325
 
326 326
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 			 *
337 337
 			 * @since 1.8.9
338 338
 			 */
339
-			do_action( 'before_give_init' );
339
+			do_action('before_give_init');
340 340
 
341 341
 			// Set up localization.
342 342
 			$this->load_textdomain();
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 			 *
372 372
 			 * @since 1.8.7
373 373
 			 */
374
-			do_action( 'give_init', $this );
374
+			do_action('give_init', $this);
375 375
 
376 376
 		}
377 377
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 		 */
389 389
 		public function __clone() {
390 390
 			// Cloning instances of the class is forbidden.
391
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
391
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
392 392
 		}
393 393
 
394 394
 		/**
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		 */
402 402
 		public function __wakeup() {
403 403
 			// Unserializing instances of the class is forbidden.
404
-			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
404
+			give_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
405 405
 		}
406 406
 
407 407
 		/**
@@ -415,33 +415,33 @@  discard block
 block discarded – undo
415 415
 		private function setup_constants() {
416 416
 
417 417
 			// Plugin version
418
-			if ( ! defined( 'GIVE_VERSION' ) ) {
419
-				define( 'GIVE_VERSION', '2.2.2' );
418
+			if ( ! defined('GIVE_VERSION')) {
419
+				define('GIVE_VERSION', '2.2.2');
420 420
 			}
421 421
 
422 422
 			// Plugin Root File
423
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
424
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
423
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
424
+				define('GIVE_PLUGIN_FILE', __FILE__);
425 425
 			}
426 426
 
427 427
 			// Plugin Folder Path
428
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
429
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
428
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
429
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(GIVE_PLUGIN_FILE));
430 430
 			}
431 431
 
432 432
 			// Plugin Folder URL
433
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
434
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
433
+			if ( ! defined('GIVE_PLUGIN_URL')) {
434
+				define('GIVE_PLUGIN_URL', plugin_dir_url(GIVE_PLUGIN_FILE));
435 435
 			}
436 436
 
437 437
 			// Plugin Basename aka: "give/give.php"
438
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
439
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
438
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
439
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(GIVE_PLUGIN_FILE));
440 440
 			}
441 441
 
442 442
 			// Make sure CAL_GREGORIAN is defined
443
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
444
-				define( 'CAL_GREGORIAN', 1 );
443
+			if ( ! defined('CAL_GREGORIAN')) {
444
+				define('CAL_GREGORIAN', 1);
445 445
 			}
446 446
 		}
447 447
 
@@ -459,170 +459,170 @@  discard block
 block discarded – undo
459 459
 			/**
460 460
 			 * Load libraries.
461 461
 			 */
462
-			if ( ! class_exists( 'WP_Async_Request' ) ) {
463
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
462
+			if ( ! class_exists('WP_Async_Request')) {
463
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-async-request.php');
464 464
 			}
465 465
 
466
-			if ( ! class_exists( 'WP_Background_Process' ) ) {
467
-				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
466
+			if ( ! class_exists('WP_Background_Process')) {
467
+				include_once(GIVE_PLUGIN_DIR.'includes/libraries/wp-background-process.php');
468 468
 			}
469 469
 
470 470
 			/**
471 471
 			 * Load plugin files
472 472
 			 */
473
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
474
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
473
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
474
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
475 475
 			$give_options = give_get_settings();
476 476
 
477
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
478
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
479
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
480
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
481
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
482
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
483
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
484
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
485
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
486
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php';
487
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
488
-			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
489
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
490
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php';
491
-
492
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
493
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
494
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
495
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
496
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
497
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
498
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
499
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
500
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
501
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php';
502
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
503
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor-wall-widget.php';
504
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
505
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sessions.php';
506
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
507
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
508
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
509
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
510
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
511
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
512
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-comment.php';
513
-
514
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
515
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
516
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
517
-			require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
518
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
519
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
520
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
521
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
522
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
523
-			require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
524
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
525
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
526
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
527
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
528
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
529
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
530
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
531
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
532
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
533
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
534
-
535
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
536
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
537
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
538
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
539
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
540
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
541
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php';
542
-
543
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
544
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
545
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
546
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
547
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
548
-
549
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
550
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
551
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
552
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
553
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
554
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
555
-
556
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
557
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-wall.php';
558
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-stats.php';
559
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
560
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/frontend-donor-functions.php';
561
-			require_once GIVE_PLUGIN_DIR . 'includes/donors/actions.php';
562
-
563
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
564
-
565
-			require_once GIVE_PLUGIN_DIR . 'blocks/load.php';
566
-
567
-			if ( defined( 'WP_CLI' ) && WP_CLI ) {
568
-				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
477
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
478
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-async-process.php';
479
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
480
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php';
481
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
482
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
483
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
484
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
485
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
486
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api-v2.php';
487
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-tooltips.php';
488
+			require_once GIVE_PLUGIN_DIR.'includes/class-notices.php';
489
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-translation.php';
490
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-readme-parser.php';
491
+
492
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-scripts.php';
493
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
494
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
495
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
496
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
497
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-meta.php';
498
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php';
499
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php';
500
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-form-meta.php';
501
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-sequential-ordering.php';
502
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php';
503
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor-wall-widget.php';
504
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
505
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-sessions.php';
506
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
507
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
508
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
509
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
510
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
511
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-payment-meta.php';
512
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-comment.php';
513
+
514
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
515
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
516
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
517
+			require_once GIVE_PLUGIN_DIR.'includes/import-functions.php';
518
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
519
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
520
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
521
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
522
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
523
+			require_once GIVE_PLUGIN_DIR.'includes/currency-functions.php';
524
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
525
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
526
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
527
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
528
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
529
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
530
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php';
531
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
532
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
533
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
534
+
535
+			require_once GIVE_PLUGIN_DIR.'includes/payments/backward-compatibility.php';
536
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
537
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
538
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
539
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
540
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
541
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-sequential-donation-number.php';
542
+
543
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
544
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
545
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
546
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
547
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
548
+
549
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
550
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
551
+			require_once GIVE_PLUGIN_DIR.'includes/admin/emails/class-email-notifications.php';
552
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
553
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
554
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
555
+
556
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donors-query.php';
557
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donor-wall.php';
558
+			require_once GIVE_PLUGIN_DIR.'includes/donors/class-give-donor-stats.php';
559
+			require_once GIVE_PLUGIN_DIR.'includes/donors/backward-compatibility.php';
560
+			require_once GIVE_PLUGIN_DIR.'includes/donors/frontend-donor-functions.php';
561
+			require_once GIVE_PLUGIN_DIR.'includes/donors/actions.php';
562
+
563
+			require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php';
564
+
565
+			require_once GIVE_PLUGIN_DIR.'blocks/load.php';
566
+
567
+			if (defined('WP_CLI') && WP_CLI) {
568
+				require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
569 569
 			}
570 570
 
571
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
572
-
573
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
574
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
575
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
576
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
577
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
578
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
579
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
580
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
581
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
582
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
583
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
584
-
585
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
586
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
587
-
588
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
589
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
590
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
591
-
592
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
593
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-give-form-duplicator.php';
594
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
595
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
596
-
597
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
598
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
599
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
600
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
601
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php';
602
-
603
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
604
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
605
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
606
-
607
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
608
-
609
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
610
-
611
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
612
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
613
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
614
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
615
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
616
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
617
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
618
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php';
619
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
620
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
621
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php';
622
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donor-wall.php';
571
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
572
+
573
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
574
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
575
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
576
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
577
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
578
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
579
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
580
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
581
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
582
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
583
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-blank-slate.php';
584
+
585
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
586
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
587
+
588
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php';
589
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php';
590
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php';
591
+
592
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
593
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-give-form-duplicator.php';
594
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
595
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
596
+
597
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php';
598
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php';
599
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php';
600
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php';
601
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/give-export-donations-functions.php';
602
+
603
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php';
604
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php';
605
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php';
606
+
607
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php';
608
+
609
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php';
610
+
611
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
612
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
613
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
614
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
615
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
616
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
617
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
618
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-grid.php';
619
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
620
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
621
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-totals.php';
622
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donor-wall.php';
623 623
 			}// End if().
624 624
 
625
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
625
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
626 626
 
627 627
 		}
628 628
 
@@ -637,16 +637,16 @@  discard block
 block discarded – undo
637 637
 		public function load_textdomain() {
638 638
 
639 639
 			// Set filter for Give's languages directory
640
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
641
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
640
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
641
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
642 642
 
643 643
 			// Traditional WordPress plugin locale filter.
644
-			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
645
-			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
644
+			$locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
645
+			$locale = apply_filters('plugin_locale', $locale, 'give');
646 646
 
647
-			unload_textdomain( 'give' );
648
-			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
649
-			load_plugin_textdomain( 'give', false, $give_lang_dir );
647
+			unload_textdomain('give');
648
+			load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo');
649
+			load_plugin_textdomain('give', false, $give_lang_dir);
650 650
 
651 651
 		}
652 652
 
@@ -659,21 +659,21 @@  discard block
 block discarded – undo
659 659
 		 */
660 660
 		public function minimum_phpversion_notice() {
661 661
 			// Bailout.
662
-			if ( ! is_admin() ) {
662
+			if ( ! is_admin()) {
663 663
 				return;
664 664
 			}
665 665
 
666
-			$notice_desc  = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
667
-			$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
668
-			$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
669
-			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
670
-			$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
671
-			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
672
-			$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
666
+			$notice_desc  = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>';
667
+			$notice_desc .= '<p>'.__('Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give').'</p>';
668
+			$notice_desc .= '<p>'.__('Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give').'</p>';
669
+			$notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>';
670
+			$notice_desc .= '<p>'.__('You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give').'</p>';
671
+			$notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>';
672
+			$notice_desc .= '<p>'.sprintf(__('If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give'), sprintf('<a href="%1$s" target="_blank">', esc_url('https://wordpress.org/hosting/')), '</a>').'</p>';
673 673
 
674 674
 			echo sprintf(
675 675
 				'<div class="notice notice-error">%1$s</div>',
676
-				wp_kses_post( $notice_desc )
676
+				wp_kses_post($notice_desc)
677 677
 			);
678 678
 		}
679 679
 
Please login to merge, or discard this patch.
includes/gateways/actions.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @param $data
23 23
  */
24
-function give_process_gateway_select( $data ) {
25
-	if ( isset( $_POST['gateway_submit'] ) ) {
26
-		wp_redirect( esc_url( add_query_arg( 'payment-mode', $_POST['payment-mode'] ) ) );
24
+function give_process_gateway_select($data) {
25
+	if (isset($_POST['gateway_submit'])) {
26
+		wp_redirect(esc_url(add_query_arg('payment-mode', $_POST['payment-mode'])));
27 27
 		exit;
28 28
 	}
29 29
 }
30 30
 
31
-add_action( 'give_gateway_select', 'give_process_gateway_select' );
31
+add_action('give_gateway_select', 'give_process_gateway_select');
32 32
 
33 33
 /**
34 34
  * Loads a payment gateway via AJAX.
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
  */
40 40
 function give_load_ajax_gateway() {
41 41
 
42
-	$post_data = give_clean( $_POST ); // WPCS: input var ok, CSRF ok.
42
+	$post_data = give_clean($_POST); // WPCS: input var ok, CSRF ok.
43 43
 
44
-	if ( isset( $post_data['give_payment_mode'] ) ) {
44
+	if (isset($post_data['give_payment_mode'])) {
45 45
 
46
-		$form_id_prefix = ! empty( $post_data['give_form_id_prefix'] ) ? $post_data['give_form_id_prefix'] : '';
46
+		$form_id_prefix = ! empty($post_data['give_form_id_prefix']) ? $post_data['give_form_id_prefix'] : '';
47 47
 
48 48
 		$args = array(
49 49
 			'id_prefix' => $form_id_prefix,
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 		 *
55 55
 		 * @since 1.7
56 56
 		 */
57
-		do_action( 'give_donation_form', $post_data['give_form_id'], $args );
57
+		do_action('give_donation_form', $post_data['give_form_id'], $args);
58 58
 
59 59
 		exit();
60 60
 	}
61 61
 }
62 62
 
63
-add_action( 'wp_ajax_give_load_gateway', 'give_load_ajax_gateway' );
64
-add_action( 'wp_ajax_nopriv_give_load_gateway', 'give_load_ajax_gateway' );
63
+add_action('wp_ajax_give_load_gateway', 'give_load_ajax_gateway');
64
+add_action('wp_ajax_nopriv_give_load_gateway', 'give_load_ajax_gateway');
65 65
 
66 66
 /**
67 67
  * Create wp nonce using Ajax call.
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
  * @return void
74 74
  */
75 75
 function give_donation_form_nonce() {
76
-	if ( isset( $_POST['give_form_id'] ) ) {
76
+	if (isset($_POST['give_form_id'])) {
77 77
 
78 78
 		// Get donation form id.
79
-		$form_id = is_numeric( $_POST['give_form_id'] ) ? absint( $_POST['give_form_id'] ) : 0;
79
+		$form_id = is_numeric($_POST['give_form_id']) ? absint($_POST['give_form_id']) : 0;
80 80
 
81 81
 		// Send nonce json data.
82
-		wp_send_json_success( wp_create_nonce( "give_donation_form_nonce_{$form_id}" ) );
82
+		wp_send_json_success(wp_create_nonce("give_donation_form_nonce_{$form_id}"));
83 83
 	}
84 84
 }
85 85
 
86
-add_action( 'wp_ajax_give_donation_form_nonce', 'give_donation_form_nonce' );
87
-add_action( 'wp_ajax_nopriv_give_donation_form_nonce', 'give_donation_form_nonce' );
86
+add_action('wp_ajax_give_donation_form_nonce', 'give_donation_form_nonce');
87
+add_action('wp_ajax_nopriv_give_donation_form_nonce', 'give_donation_form_nonce');
88 88
 
89 89
 
90 90
 /**
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
  * @return void
97 97
  */
98 98
 function __give_donation_form_reset_all_nonce() {
99
-	if ( isset( $_POST['give_form_id'] ) ) {
99
+	if (isset($_POST['give_form_id'])) {
100 100
 
101 101
 		// Get donation form id.
102
-		$form_id = is_numeric( $_POST['give_form_id'] ) ? absint( $_POST['give_form_id'] ) : 0;
102
+		$form_id = is_numeric($_POST['give_form_id']) ? absint($_POST['give_form_id']) : 0;
103 103
 
104 104
 		$data = array(
105
-			'give_form_hash'               => wp_create_nonce( "give_donation_form_nonce_{$form_id}" ),
106
-			'give_form_user_register_hash' => wp_create_nonce( "give_form_create_user_nonce_{$form_id}" )
105
+			'give_form_hash'               => wp_create_nonce("give_donation_form_nonce_{$form_id}"),
106
+			'give_form_user_register_hash' => wp_create_nonce("give_form_create_user_nonce_{$form_id}")
107 107
 		);
108 108
 
109 109
 		/**
@@ -112,17 +112,17 @@  discard block
 block discarded – undo
112 112
 		 * @since  2.2.0
113 113
 		 *
114 114
 		 */
115
-		$data = apply_filters( 'give_donation_form_reset_all_nonce_data', $data );
115
+		$data = apply_filters('give_donation_form_reset_all_nonce_data', $data);
116 116
 
117 117
 		// Send nonce json data.
118
-		wp_send_json_success( $data );
118
+		wp_send_json_success($data);
119 119
 	}
120 120
 
121 121
 	wp_send_json_error();
122 122
 }
123 123
 
124
-add_action( 'wp_ajax_give_donation_form_reset_all_nonce', '__give_donation_form_reset_all_nonce' );
125
-add_action( 'wp_ajax_nopriv_give_donation_form_reset_all_nonce', '__give_donation_form_reset_all_nonce' );
124
+add_action('wp_ajax_give_donation_form_reset_all_nonce', '__give_donation_form_reset_all_nonce');
125
+add_action('wp_ajax_nopriv_give_donation_form_reset_all_nonce', '__give_donation_form_reset_all_nonce');
126 126
 
127 127
 /**
128 128
  * Sets an error within the donation form if no gateways are enabled.
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
 function give_no_gateway_error() {
136 136
 	$gateways = give_get_enabled_payment_gateways();
137 137
 
138
-	if ( empty( $gateways ) ) {
139
-		give_set_error( 'no_gateways', esc_html__( 'You must enable a payment gateway to use Give.', 'give' ) );
138
+	if (empty($gateways)) {
139
+		give_set_error('no_gateways', esc_html__('You must enable a payment gateway to use Give.', 'give'));
140 140
 	} else {
141
-		give_unset_error( 'no_gateways' );
141
+		give_unset_error('no_gateways');
142 142
 	}
143 143
 }
144 144
 
145
-add_action( 'init', 'give_no_gateway_error' );
145
+add_action('init', 'give_no_gateway_error');
Please login to merge, or discard this patch.