Test Failed
Push — master ( fa2c4d...3bcd4b )
by Devin
01:06
created
give.php 1 patch
Spacing   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  */
41 41
 
42 42
 // Exit if accessed directly.
43
-if ( ! defined( 'ABSPATH' ) ) {
43
+if ( ! defined('ABSPATH')) {
44 44
 	exit;
45 45
 }
46 46
 
47
-if ( ! class_exists( 'Give' ) ) :
47
+if ( ! class_exists('Give')) :
48 48
 
49 49
 	/**
50 50
 	 * Main Give Class
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		 * @return    Give
203 203
 		 */
204 204
 		public static function instance() {
205
-			if ( is_null( self::$_instance ) ) {
205
+			if (is_null(self::$_instance)) {
206 206
 				self::$_instance = new self();
207 207
 			}
208 208
 
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 		 */
215 215
 		public function __construct() {
216 216
 			// PHP version
217
-			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
218
-				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
217
+			if ( ! defined('GIVE_REQUIRED_PHP_VERSION')) {
218
+				define('GIVE_REQUIRED_PHP_VERSION', '5.3');
219 219
 			}
220 220
 
221 221
 			// Bailout: Need minimum php version to load plugin.
222
-			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
223
-				add_action( 'admin_notices', array( $this, 'minmum_phpversion_notice' ) );
222
+			if (function_exists('phpversion') && version_compare(GIVE_REQUIRED_PHP_VERSION, phpversion(), '>')) {
223
+				add_action('admin_notices', array($this, 'minmum_phpversion_notice'));
224 224
 
225 225
 				return;
226 226
 			}
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			$this->includes();
231 231
 			$this->init_hooks();
232 232
 
233
-			do_action( 'give_loaded' );
233
+			do_action('give_loaded');
234 234
 		}
235 235
 
236 236
 		/**
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 		 * @since  1.8.9
240 240
 		 */
241 241
 		private function init_hooks() {
242
-			register_activation_hook( __FILE__, 'give_install' );
243
-			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
242
+			register_activation_hook(__FILE__, 'give_install');
243
+			add_action('plugins_loaded', array($this, 'init'), 0);
244 244
 		}
245 245
 		/**
246 246
 		 * Init Give when WordPress Initializes.
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			 *
255 255
 			 * @since 1.8.9
256 256
 			 */
257
-			do_action( 'before_give_init' );
257
+			do_action('before_give_init');
258 258
 
259 259
 			// Set up localization.
260 260
 			$this->load_textdomain();
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			 *
280 280
 			 * @since 1.8.7
281 281
 			 */
282
-			do_action( 'give_init', $this );
282
+			do_action('give_init', $this);
283 283
 
284 284
 		}
285 285
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 		 */
297 297
 		public function __clone() {
298 298
 			// Cloning instances of the class is forbidden.
299
-			_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
299
+			_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
300 300
 		}
301 301
 
302 302
 		/**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 		 */
310 310
 		public function __wakeup() {
311 311
 			// Unserializing instances of the class is forbidden.
312
-			_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' );
312
+			_doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0');
313 313
 		}
314 314
 
315 315
 		/**
@@ -323,33 +323,33 @@  discard block
 block discarded – undo
323 323
 		private function setup_constants() {
324 324
 
325 325
 			// Plugin version
326
-			if ( ! defined( 'GIVE_VERSION' ) ) {
327
-				define( 'GIVE_VERSION', '1.8.12' );
326
+			if ( ! defined('GIVE_VERSION')) {
327
+				define('GIVE_VERSION', '1.8.12');
328 328
 			}
329 329
 
330 330
 			// Plugin Folder Path
331
-			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
332
-				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
331
+			if ( ! defined('GIVE_PLUGIN_DIR')) {
332
+				define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__));
333 333
 			}
334 334
 
335 335
 			// Plugin Folder URL
336
-			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
337
-				define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
336
+			if ( ! defined('GIVE_PLUGIN_URL')) {
337
+				define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__));
338 338
 			}
339 339
 
340 340
 			// Plugin Basename aka: "give/give.php"
341
-			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
342
-				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
341
+			if ( ! defined('GIVE_PLUGIN_BASENAME')) {
342
+				define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__));
343 343
 			}
344 344
 
345 345
 			// Plugin Root File
346
-			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
347
-				define( 'GIVE_PLUGIN_FILE', __FILE__ );
346
+			if ( ! defined('GIVE_PLUGIN_FILE')) {
347
+				define('GIVE_PLUGIN_FILE', __FILE__);
348 348
 			}
349 349
 
350 350
 			// Make sure CAL_GREGORIAN is defined
351
-			if ( ! defined( 'CAL_GREGORIAN' ) ) {
352
-				define( 'CAL_GREGORIAN', 1 );
351
+			if ( ! defined('CAL_GREGORIAN')) {
352
+				define('CAL_GREGORIAN', 1);
353 353
 			}
354 354
 		}
355 355
 
@@ -364,128 +364,128 @@  discard block
 block discarded – undo
364 364
 		private function includes() {
365 365
 			global $give_options;
366 366
 
367
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
368
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
367
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-settings.php';
368
+			require_once GIVE_PLUGIN_DIR.'includes/admin/class-give-settings.php';
369 369
 			$give_options = give_get_settings();
370 370
 
371
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
372
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
373
-			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
374
-			require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
375
-			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
376
-			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
377
-			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
378
-			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
379
-			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
380
-
381
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
382
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
383
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
384
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
385
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
386
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
387
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
388
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
389
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
390
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
391
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
392
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
393
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
394
-			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
395
-
396
-			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
397
-			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
398
-			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
399
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
400
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
401
-			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
402
-			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
403
-			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
404
-			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
405
-			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
406
-			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
407
-			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
408
-			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
409
-			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
410
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
411
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
412
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
413
-			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
414
-
415
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
416
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
417
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
418
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
419
-			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
420
-
421
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
422
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
423
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
424
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
425
-			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
426
-
427
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
428
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
429
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
430
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
431
-			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
432
-
433
-			if ( defined( 'WP_CLI' ) && WP_CLI ) {
434
-				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
371
+			require_once GIVE_PLUGIN_DIR.'includes/admin/give-metabox-functions.php';
372
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cache.php';
373
+			require_once GIVE_PLUGIN_DIR.'includes/post-types.php';
374
+			require_once GIVE_PLUGIN_DIR.'includes/scripts.php';
375
+			require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php';
376
+			require_once GIVE_PLUGIN_DIR.'includes/actions.php';
377
+			require_once GIVE_PLUGIN_DIR.'includes/filters.php';
378
+			require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php';
379
+			require_once GIVE_PLUGIN_DIR.'includes/class-notices.php';
380
+
381
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php';
382
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php';
383
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php';
384
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php';
385
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donors.php';
386
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-db-donor-meta.php';
387
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-donor.php';
388
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php';
389
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php';
390
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php';
391
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php';
392
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php';
393
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php';
394
+			require_once GIVE_PLUGIN_DIR.'includes/class-give-email-access.php';
395
+
396
+			require_once GIVE_PLUGIN_DIR.'includes/country-functions.php';
397
+			require_once GIVE_PLUGIN_DIR.'includes/template-functions.php';
398
+			require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php';
399
+			require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php';
400
+			require_once GIVE_PLUGIN_DIR.'includes/forms/template.php';
401
+			require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php';
402
+			require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php';
403
+			require_once GIVE_PLUGIN_DIR.'includes/formatting.php';
404
+			require_once GIVE_PLUGIN_DIR.'includes/price-functions.php';
405
+			require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php';
406
+			require_once GIVE_PLUGIN_DIR.'includes/process-donation.php';
407
+			require_once GIVE_PLUGIN_DIR.'includes/login-register.php';
408
+			require_once GIVE_PLUGIN_DIR.'includes/user-functions.php';
409
+			require_once GIVE_PLUGIN_DIR.'includes/plugin-compatibility.php';
410
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-classes.php';
411
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-functions.php';
412
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-actions.php';
413
+			require_once GIVE_PLUGIN_DIR.'includes/deprecated/deprecated-filters.php';
414
+
415
+			require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php';
416
+			require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php';
417
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php';
418
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php';
419
+			require_once GIVE_PLUGIN_DIR.'includes/payments/class-give-payment.php';
420
+
421
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php';
422
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php';
423
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php';
424
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php';
425
+			require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php';
426
+
427
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php';
428
+			require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php';
429
+			require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php';
430
+			require_once GIVE_PLUGIN_DIR.'includes/emails/template.php';
431
+			require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php';
432
+
433
+			if (defined('WP_CLI') && WP_CLI) {
434
+				require_once GIVE_PLUGIN_DIR.'includes/class-give-cli-commands.php';
435 435
 			}
436 436
 
437
-			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
437
+			if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
438 438
 
439
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
440
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
441
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
442
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
443
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
444
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
445
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
446
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
447
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
448
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
439
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php';
440
+				require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php';
441
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php';
442
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
443
+				require_once GIVE_PLUGIN_DIR.'includes/admin/class-i18n-module.php';
444
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php';
445
+				require_once GIVE_PLUGIN_DIR.'includes/admin/admin-filters.php';
446
+				require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php';
447
+				require_once GIVE_PLUGIN_DIR.'includes/admin/plugins.php';
448
+				require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php';
449 449
 
450
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
451
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
450
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php';
451
+				require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php';
452 452
 
453
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
454
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
455
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
453
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donors.php';
454
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-functions.php';
455
+				require_once GIVE_PLUGIN_DIR.'includes/admin/donors/donor-actions.php';
456 456
 
457
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
458
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
459
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
457
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php';
458
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/class-metabox-form-data.php';
459
+				require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php';
460 460
 
461
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
462
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
463
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
464
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
461
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-functions.php';
462
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/class-export.php';
463
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/export-actions.php';
464
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/export/pdf-reports.php';
465 465
 
466
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
467
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
468
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
466
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/reports.php';
467
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/class-give-graph.php';
468
+				require_once GIVE_PLUGIN_DIR.'includes/admin/reports/graphing.php';
469 469
 
470
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
470
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/logs/logs.php';
471 471
 
472
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
472
+				require_once GIVE_PLUGIN_DIR.'includes/admin/tools/data/tools-actions.php';
473 473
 
474
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
475
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
476
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
477
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
478
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
479
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
480
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
481
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
482
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
474
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php';
475
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php';
476
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php';
477
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php';
478
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php';
479
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php';
480
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php';
481
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php';
482
+				require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php';
483 483
 
484
-				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
484
+				require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/class-give-updates.php';
485 485
 
486 486
 			}// End if().
487 487
 
488
-			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
488
+			require_once GIVE_PLUGIN_DIR.'includes/install.php';
489 489
 
490 490
 		}
491 491
 
@@ -500,16 +500,16 @@  discard block
 block discarded – undo
500 500
 		public function load_textdomain() {
501 501
 
502 502
 			// Set filter for Give's languages directory
503
-			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
504
-			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
503
+			$give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/';
504
+			$give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir);
505 505
 
506 506
 			// Traditional WordPress plugin locale filter.
507
-			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
508
-			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
507
+			$locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
508
+			$locale = apply_filters('plugin_locale', $locale, 'give');
509 509
 
510
-			unload_textdomain( 'give' );
511
-			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
512
-			load_plugin_textdomain( 'give', false, $give_lang_dir );
510
+			unload_textdomain('give');
511
+			load_textdomain('give', WP_LANG_DIR.'/give/give-'.$locale.'.mo');
512
+			load_plugin_textdomain('give', false, $give_lang_dir);
513 513
 
514 514
 		}
515 515
 
@@ -522,17 +522,17 @@  discard block
 block discarded – undo
522 522
 		 */
523 523
 		public function minmum_phpversion_notice() {
524 524
 			// Bailout.
525
-			if ( ! is_admin() ) {
525
+			if ( ! is_admin()) {
526 526
 				return;
527 527
 			}
528 528
 
529
-			$notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
530
-			$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>';
531
-			$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>';
532
-			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
533
-			$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>';
534
-			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
535
-			$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>';
529
+			$notice_desc = '<p><strong>'.__('Your site could be faster and more secure with a newer PHP version.', 'give').'</strong></p>';
530
+			$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>';
531
+			$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>';
532
+			$notice_desc .= '<p><strong>'.__('To which version should I update?', 'give').'</strong></p>';
533
+			$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>';
534
+			$notice_desc .= '<p><strong>'.__('Can\'t update? Ask your host!', 'give').'</strong></p>';
535
+			$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>';
536 536
 
537 537
 			echo sprintf(
538 538
 				'<div class="notice notice-error">%1$s</div>',
Please login to merge, or discard this patch.
includes/admin/admin-actions.php 1 patch
Spacing   +107 added lines, -108 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
 
@@ -20,19 +20,19 @@  discard block
 block discarded – undo
20 20
  * @since 1.8
21 21
  */
22 22
 function give_load_wp_editor() {
23
-	if ( ! isset( $_POST['wp_editor'] ) ) {
23
+	if ( ! isset($_POST['wp_editor'])) {
24 24
 		die();
25 25
 	}
26 26
 
27
-	$wp_editor                     = json_decode( base64_decode( $_POST['wp_editor'] ), true );
27
+	$wp_editor                     = json_decode(base64_decode($_POST['wp_editor']), true);
28 28
 	$wp_editor[2]['textarea_name'] = $_POST['textarea_name'];
29 29
 
30
-	wp_editor( $wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2] );
30
+	wp_editor($wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2]);
31 31
 
32 32
 	die();
33 33
 }
34 34
 
35
-add_action( 'wp_ajax_give_load_wp_editor', 'give_load_wp_editor' );
35
+add_action('wp_ajax_give_load_wp_editor', 'give_load_wp_editor');
36 36
 
37 37
 
38 38
 /**
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	);
53 53
 
54 54
 	// Get current page.
55
-	$current_page = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : '';
55
+	$current_page = isset($_GET['page']) ? esc_attr($_GET['page']) : '';
56 56
 
57 57
 	// Bailout.
58 58
 	if (
59
-		empty( $current_page )
60
-		|| empty( $_GET['_wp_http_referer'] )
61
-		|| ! in_array( $current_page, $give_pages )
59
+		empty($current_page)
60
+		|| empty($_GET['_wp_http_referer'])
61
+		|| ! in_array($current_page, $give_pages)
62 62
 	) {
63 63
 		return false;
64 64
 	}
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @since 1.8
70 70
 	 */
71
-	$redirect = apply_filters( "give_validate_{$current_page}", true );
71
+	$redirect = apply_filters("give_validate_{$current_page}", true);
72 72
 
73
-	if ( $redirect ) {
73
+	if ($redirect) {
74 74
 		// Redirect.
75 75
 		wp_redirect(
76 76
 			remove_query_arg(
77
-				array( '_wp_http_referer', '_wpnonce' ),
78
-				wp_unslash( $_SERVER['REQUEST_URI'] )
77
+				array('_wp_http_referer', '_wpnonce'),
78
+				wp_unslash($_SERVER['REQUEST_URI'])
79 79
 			)
80 80
 		);
81 81
 		exit;
82 82
 	}
83 83
 }
84 84
 
85
-add_action( 'admin_init', 'give_redirect_to_clean_url_admin_pages' );
85
+add_action('admin_init', 'give_redirect_to_clean_url_admin_pages');
86 86
 
87 87
 
88 88
 /**
@@ -96,25 +96,25 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function give_hide_outdated_php_notice() {
98 98
 
99
-	if ( ! isset( $_POST['_give_hide_outdated_php_notices_shortly'] ) ) {
99
+	if ( ! isset($_POST['_give_hide_outdated_php_notices_shortly'])) {
100 100
 		give_die();
101 101
 	}
102 102
 
103 103
 	// Transient key name.
104 104
 	$transient_key = "_give_hide_outdated_php_notices_shortly";
105 105
 
106
-	if ( Give_Cache::get( $transient_key, true ) ) {
106
+	if (Give_Cache::get($transient_key, true)) {
107 107
 		return;
108 108
 	}
109 109
 
110 110
 	// Hide notice for 24 hours.
111
-	Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );
111
+	Give_Cache::set($transient_key, true, DAY_IN_SECONDS, true);
112 112
 
113 113
 	give_die();
114 114
 
115 115
 }
116 116
 
117
-add_action( 'wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice' );
117
+add_action('wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice');
118 118
 
119 119
 /**
120 120
  * Register admin notices.
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
  */
124 124
 function _give_register_admin_notices() {
125 125
 	// Bailout.
126
-	if( ! is_admin() ) {
126
+	if ( ! is_admin()) {
127 127
 		return;
128 128
 	}
129 129
 
130 130
 	// Add payment bulk notice.
131 131
 	if (
132
-		current_user_can( 'edit_give_payments' )
133
-		&& isset( $_GET['action'] )
134
-		&& ! empty( $_GET['action'] )
135
-		&& isset( $_GET['payment'] )
136
-		&& ! empty( $_GET['payment'] )
132
+		current_user_can('edit_give_payments')
133
+		&& isset($_GET['action'])
134
+		&& ! empty($_GET['action'])
135
+		&& isset($_GET['payment'])
136
+		&& ! empty($_GET['payment'])
137 137
 	) {
138
-		$payment_count = isset( $_GET['payment'] ) ? count( $_GET['payment'] ) : 0;
138
+		$payment_count = isset($_GET['payment']) ? count($_GET['payment']) : 0;
139 139
 
140
-		switch ( $_GET['action'] ) {
140
+		switch ($_GET['action']) {
141 141
 			case 'delete':
142
-				Give()->notices->register_notice( array(
142
+				Give()->notices->register_notice(array(
143 143
 					'id'          => 'bulk_action_delete',
144 144
 					'type'        => 'updated',
145 145
 					'description' => sprintf(
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 						),
152 152
 						$payment_count ),
153 153
 					'show'        => true,
154
-				) );
154
+				));
155 155
 
156 156
 				break;
157 157
 
158 158
 			case 'resend-receipt':
159
-				Give()->notices->register_notice( array(
159
+				Give()->notices->register_notice(array(
160 160
 					'id'          => 'bulk_action_resend_receipt',
161 161
 					'type'        => 'updated',
162 162
 					'description' => sprintf(
@@ -169,196 +169,196 @@  discard block
 block discarded – undo
169 169
 						$payment_count
170 170
 					),
171 171
 					'show'        => true,
172
-				) );
172
+				));
173 173
 				break;
174 174
 		}
175 175
 	}
176 176
 
177 177
 	// Add give message notices.
178
-	if ( ! empty( $_GET['give-message'] ) ) {
178
+	if ( ! empty($_GET['give-message'])) {
179 179
 		// Donation reports errors.
180
-		if ( current_user_can( 'view_give_reports' ) ) {
181
-			switch ( $_GET['give-message'] ) {
180
+		if (current_user_can('view_give_reports')) {
181
+			switch ($_GET['give-message']) {
182 182
 				case 'donation_deleted' :
183
-					Give()->notices->register_notice( array(
183
+					Give()->notices->register_notice(array(
184 184
 						'id'          => 'give-donation-deleted',
185 185
 						'type'        => 'updated',
186
-						'description' => __( 'The donation has been deleted.', 'give' ),
186
+						'description' => __('The donation has been deleted.', 'give'),
187 187
 						'show'        => true,
188
-					) );
188
+					));
189 189
 					break;
190 190
 				case 'email_sent' :
191
-					Give()->notices->register_notice( array(
191
+					Give()->notices->register_notice(array(
192 192
 						'id'          => 'give-payment-sent',
193 193
 						'type'        => 'updated',
194
-						'description' => __( 'The donation receipt has been resent.', 'give' ),
194
+						'description' => __('The donation receipt has been resent.', 'give'),
195 195
 						'show'        => true,
196
-					) );
196
+					));
197 197
 					break;
198 198
 				case 'refreshed-reports' :
199
-					Give()->notices->register_notice( array(
199
+					Give()->notices->register_notice(array(
200 200
 						'id'          => 'give-refreshed-reports',
201 201
 						'type'        => 'updated',
202
-						'description' => __( 'The reports cache has been cleared.', 'give' ),
202
+						'description' => __('The reports cache has been cleared.', 'give'),
203 203
 						'show'        => true,
204
-					) );
204
+					));
205 205
 					break;
206 206
 				case 'donation-note-deleted' :
207
-					Give()->notices->register_notice( array(
207
+					Give()->notices->register_notice(array(
208 208
 						'id'          => 'give-donation-note-deleted',
209 209
 						'type'        => 'updated',
210
-						'description' => __( 'The donation note has been deleted.', 'give' ),
210
+						'description' => __('The donation note has been deleted.', 'give'),
211 211
 						'show'        => true,
212
-					) );
212
+					));
213 213
 					break;
214 214
 			}
215 215
 		}
216 216
 
217 217
 		// Give settings notices and errors.
218
-		if ( current_user_can( 'manage_give_settings' ) ) {
219
-			switch ( $_GET['give-message'] ) {
218
+		if (current_user_can('manage_give_settings')) {
219
+			switch ($_GET['give-message']) {
220 220
 				case 'settings-imported' :
221
-					Give()->notices->register_notice( array(
221
+					Give()->notices->register_notice(array(
222 222
 						'id'          => 'give-settings-imported',
223 223
 						'type'        => 'updated',
224
-						'description' => __( 'The settings have been imported.', 'give' ),
224
+						'description' => __('The settings have been imported.', 'give'),
225 225
 						'show'        => true,
226
-					) );
226
+					));
227 227
 					break;
228 228
 				case 'api-key-generated' :
229
-					Give()->notices->register_notice( array(
229
+					Give()->notices->register_notice(array(
230 230
 						'id'          => 'give-api-key-generated',
231 231
 						'type'        => 'updated',
232
-						'description' => __( 'API keys have been generated.', 'give' ),
232
+						'description' => __('API keys have been generated.', 'give'),
233 233
 						'show'        => true,
234
-					) );
234
+					));
235 235
 					break;
236 236
 				case 'api-key-exists' :
237
-					Give()->notices->register_notice( array(
237
+					Give()->notices->register_notice(array(
238 238
 						'id'          => 'give-api-key-exists',
239 239
 						'type'        => 'updated',
240
-						'description' => __( 'The specified user already has API keys.', 'give' ),
240
+						'description' => __('The specified user already has API keys.', 'give'),
241 241
 						'show'        => true,
242
-					) );
242
+					));
243 243
 					break;
244 244
 				case 'api-key-regenerated' :
245
-					Give()->notices->register_notice( array(
245
+					Give()->notices->register_notice(array(
246 246
 						'id'          => 'give-api-key-regenerated',
247 247
 						'type'        => 'updated',
248
-						'description' => __( 'API keys have been regenerated.', 'give' ),
248
+						'description' => __('API keys have been regenerated.', 'give'),
249 249
 						'show'        => true,
250
-					) );
250
+					));
251 251
 					break;
252 252
 				case 'api-key-revoked' :
253
-					Give()->notices->register_notice( array(
253
+					Give()->notices->register_notice(array(
254 254
 						'id'          => 'give-api-key-revoked',
255 255
 						'type'        => 'updated',
256
-						'description' => __( 'API keys have been revoked.', 'give' ),
256
+						'description' => __('API keys have been revoked.', 'give'),
257 257
 						'show'        => true,
258
-					) );
258
+					));
259 259
 					break;
260 260
 				case 'sent-test-email' :
261
-					Give()->notices->register_notice( array(
261
+					Give()->notices->register_notice(array(
262 262
 						'id'          => 'give-sent-test-email',
263 263
 						'type'        => 'updated',
264
-						'description' => __( 'The test email has been sent.', 'give' ),
264
+						'description' => __('The test email has been sent.', 'give'),
265 265
 						'show'        => true,
266
-					) );
266
+					));
267 267
 					break;
268 268
 				case 'matched-success-failure-page':
269
-					Give()->notices->register_notice( array(
269
+					Give()->notices->register_notice(array(
270 270
 						'id'          => 'give-matched-success-failure-page',
271 271
 						'type'        => 'updated',
272
-						'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
272
+						'description' => __('You cannot set the success and failed pages to the same page', 'give'),
273 273
 						'show'        => true,
274
-					) );
274
+					));
275 275
 					break;
276 276
 			}
277 277
 		}
278 278
 		// Payments errors.
279
-		if ( current_user_can( 'edit_give_payments' ) ) {
280
-			switch ( $_GET['give-message'] ) {
279
+		if (current_user_can('edit_give_payments')) {
280
+			switch ($_GET['give-message']) {
281 281
 				case 'note-added' :
282
-					Give()->notices->register_notice( array(
282
+					Give()->notices->register_notice(array(
283 283
 						'id'          => 'give-note-added',
284 284
 						'type'        => 'updated',
285
-						'description' => __( 'The donation note has been added.', 'give' ),
285
+						'description' => __('The donation note has been added.', 'give'),
286 286
 						'show'        => true,
287
-					) );
287
+					));
288 288
 					break;
289 289
 				case 'payment-updated' :
290
-					Give()->notices->register_notice( array(
290
+					Give()->notices->register_notice(array(
291 291
 						'id'          => 'give-payment-updated',
292 292
 						'type'        => 'updated',
293
-						'description' => __( 'The donation has been updated.', 'give' ),
293
+						'description' => __('The donation has been updated.', 'give'),
294 294
 						'show'        => true,
295
-					) );
295
+					));
296 296
 					break;
297 297
 			}
298 298
 		}
299 299
 
300 300
 		// Donor Notices.
301
-		if ( current_user_can( 'edit_give_payments' ) ) {
302
-			switch ( $_GET['give-message'] ) {
301
+		if (current_user_can('edit_give_payments')) {
302
+			switch ($_GET['give-message']) {
303 303
 				case 'donor-deleted' :
304
-					Give()->notices->register_notice( array(
304
+					Give()->notices->register_notice(array(
305 305
 						'id'          => 'give-donor-deleted',
306 306
 						'type'        => 'updated',
307
-						'description' => __( 'The donor has been deleted.', 'give' ),
307
+						'description' => __('The donor has been deleted.', 'give'),
308 308
 						'show'        => true,
309
-					) );
309
+					));
310 310
 					break;
311 311
 
312 312
 				case 'email-added' :
313
-					Give()->notices->register_notice( array(
313
+					Give()->notices->register_notice(array(
314 314
 						'id'          => 'give-donor-email-added',
315 315
 						'type'        => 'updated',
316
-						'description' => __( 'Donor email added.', 'give' ),
316
+						'description' => __('Donor email added.', 'give'),
317 317
 						'show'        => true,
318
-					) );
318
+					));
319 319
 					break;
320 320
 
321 321
 				case 'email-removed' :
322
-					Give()->notices->register_notice( array(
322
+					Give()->notices->register_notice(array(
323 323
 						'id'          => 'give-donor-email-removed',
324 324
 						'type'        => 'updated',
325
-						'description' => __( 'Donor email removed.', 'give' ),
325
+						'description' => __('Donor email removed.', 'give'),
326 326
 						'show'        => true,
327
-					) );
327
+					));
328 328
 					break;
329 329
 
330 330
 				case 'email-remove-failed' :
331
-					Give()->notices->register_notice( array(
331
+					Give()->notices->register_notice(array(
332 332
 						'id'          => 'give-donor-email-remove-failed',
333 333
 						'type'        => 'updated',
334
-						'description' => __( 'Failed to remove donor email.', 'give' ),
334
+						'description' => __('Failed to remove donor email.', 'give'),
335 335
 						'show'        => true,
336
-					) );
336
+					));
337 337
 					break;
338 338
 
339 339
 				case 'primary-email-updated' :
340
-					Give()->notices->register_notice( array(
340
+					Give()->notices->register_notice(array(
341 341
 						'id'          => 'give-donor-primary-email-updated',
342 342
 						'type'        => 'updated',
343
-						'description' => __( 'Primary email updated for donor.', 'give' ),
343
+						'description' => __('Primary email updated for donor.', 'give'),
344 344
 						'show'        => true,
345
-					) );
345
+					));
346 346
 					break;
347 347
 
348 348
 				case 'primary-email-failed' :
349
-					Give()->notices->register_notice( array(
349
+					Give()->notices->register_notice(array(
350 350
 						'id'          => 'give-donor-primary-email-failed',
351 351
 						'type'        => 'updated',
352
-						'description' => __( 'Failed to set primary email.', 'give' ),
352
+						'description' => __('Failed to set primary email.', 'give'),
353 353
 						'show'        => true,
354
-					) );
354
+					));
355 355
 					break;
356 356
 			}
357 357
 		}
358 358
 	}
359 359
 }
360 360
 
361
-add_action( 'admin_notices', '_give_register_admin_notices', - 1 );
361
+add_action('admin_notices', '_give_register_admin_notices', - 1);
362 362
 
363 363
 
364 364
 /**
@@ -368,27 +368,26 @@  discard block
 block discarded – undo
368 368
  *
369 369
  * @return bool
370 370
  */
371
-function _give_show_test_mode_notice_in_admin_bar( $wp_admin_bar ) {
372
-	$is_test_mode = ! empty( $_POST['test_mode'] ) ?
373
-		give_is_setting_enabled( $_POST['test_mode'] ) :
374
-		give_is_test_mode();
371
+function _give_show_test_mode_notice_in_admin_bar($wp_admin_bar) {
372
+	$is_test_mode = ! empty($_POST['test_mode']) ?
373
+		give_is_setting_enabled($_POST['test_mode']) : give_is_test_mode();
375 374
 
376 375
 	if (
377
-		! current_user_can( 'view_give_reports' ) ||
376
+		! current_user_can('view_give_reports') ||
378 377
 		! $is_test_mode
379 378
 	) {
380 379
 		return false;
381 380
 	}
382 381
 
383 382
 	// Add the main siteadmin menu item.
384
-	$wp_admin_bar->add_menu( array(
383
+	$wp_admin_bar->add_menu(array(
385 384
 		'id'     => 'give-test-notice',
386
-		'href'   => admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways' ),
385
+		'href'   => admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'),
387 386
 		'parent' => 'top-secondary',
388
-		'title'  => esc_html__( 'Give Test Mode Active', 'give' ),
389
-		'meta'   => array( 'class' => 'give-test-mode-active' ),
390
-	) );
387
+		'title'  => esc_html__('Give Test Mode Active', 'give'),
388
+		'meta'   => array('class' => 'give-test-mode-active'),
389
+	));
391 390
 
392 391
 	return true;
393 392
 }
394
-add_action( 'admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1 );
395 393
\ No newline at end of file
394
+add_action('admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1);
396 395
\ No newline at end of file
Please login to merge, or discard this patch.