Completed
Pull Request — master (#1201)
by Ravinder
23:20
created
includes/admin/upgrades/upgrades.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,11 +64,14 @@
 block discarded – undo
64 64
 				}, 250 );
65 65
 			</script>
66 66
 
67
-		<?php else : ?>
67
+		<?php else {
68
+	: ?>
68 69
 
69 70
 			<div id="give-upgrade-status">
70 71
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
+					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' );
73
+}
74
+?>
72 75
 					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 76
 				</p>
74 77
 			</div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 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,12 +21,12 @@  discard block
 block discarded – undo
21 21
  * @return void
22 22
  */
23 23
 function give_upgrades_screen() {
24
-	$action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : '';
25
-	$step   = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
26
-	$total  = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false;
27
-	$custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0;
28
-	$number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100;
29
-	$steps  = round( ( $total / $number ), 0 );
24
+	$action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : '';
25
+	$step   = isset($_GET['step']) ? absint($_GET['step']) : 1;
26
+	$total  = isset($_GET['total']) ? absint($_GET['total']) : false;
27
+	$custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0;
28
+	$number = isset($_GET['number']) ? absint($_GET['number']) : 100;
29
+	$steps  = round(($total / $number), 0);
30 30
 
31 31
 	$doing_upgrade_args = array(
32 32
 		'page'         => 'give-upgrades',
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
 		'custom'       => $custom,
37 37
 		'steps'        => $steps
38 38
 	);
39
-	update_option( 'give_doing_upgrade', $doing_upgrade_args );
40
-	if ( $step > $steps ) {
39
+	update_option('give_doing_upgrade', $doing_upgrade_args);
40
+	if ($step > $steps) {
41 41
 		// Prevent a weird case where the estimate was off. Usually only a couple.
42 42
 		$steps = $step;
43 43
 	}
44 44
 	?>
45 45
 	<div class="wrap">
46
-		<h1><?php esc_html_e( 'Give - Upgrades', 'give' ); ?></h1>
46
+		<h1><?php esc_html_e('Give - Upgrades', 'give'); ?></h1>
47 47
 
48
-		<?php if ( ! empty( $action ) ) : ?>
48
+		<?php if ( ! empty($action)) : ?>
49 49
 
50 50
 			<div id="give-upgrade-status">
51
-				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
52
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
51
+				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
52
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
53 53
 				</p>
54 54
 
55
-				<?php if ( ! empty( $total ) ) : ?>
55
+				<?php if ( ! empty($total)) : ?>
56 56
 					<p>
57
-						<strong><?php printf( esc_html__( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong>
57
+						<strong><?php printf(esc_html__('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong>
58 58
 					</p>
59 59
 				<?php endif; ?>
60 60
 			</div>
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 
69 69
 			<div id="give-upgrade-status">
70 70
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
71
+					<?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
72
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 73
 				</p>
74 74
 			</div>
75 75
 			<script type="text/javascript">
Please login to merge, or discard this patch.
includes/admin/reporting/export/export-functions.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  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
 
18
-require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php';
19
-require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php';
18
+require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php';
19
+require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php';
20 20
 
21 21
 /**
22 22
  * Process batch exports via ajax
@@ -26,79 +26,79 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function give_do_ajax_export() {
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31
-	parse_str( $_POST['form'], $form );
31
+	parse_str($_POST['form'], $form);
32 32
 
33 33
 	$_REQUEST = $form = (array) $form;
34 34
 
35
-	if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) {
36
-		die( '-2' );
35
+	if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) {
36
+		die('-2');
37 37
 	}
38 38
 
39
-	do_action( 'give_batch_export_class_include', $form['give-export-class'] );
39
+	do_action('give_batch_export_class_include', $form['give-export-class']);
40 40
 
41
-	$step   = absint( $_POST['step'] );
42
-	$class  = sanitize_text_field( $form['give-export-class'] );
41
+	$step   = absint($_POST['step']);
42
+	$class  = sanitize_text_field($form['give-export-class']);
43 43
 
44
-	$export = new $class( $step );
44
+	$export = new $class($step);
45 45
 
46
-	if ( ! $export->can_export() ) {
47
-		die( '-1' );
46
+	if ( ! $export->can_export()) {
47
+		die('-1');
48 48
 	}
49 49
 
50
-	if ( ! $export->is_writable ) {
50
+	if ( ! $export->is_writable) {
51 51
 		$json_args = array(
52 52
 			'error'   => true,
53
-			'message' => esc_html__( 'Export location or file not writable.', 'give' )
53
+			'message' => esc_html__('Export location or file not writable.', 'give')
54 54
 		);
55 55
 		echo json_encode($json_args);
56 56
 		exit;
57 57
 	}
58 58
 
59
-	$export->set_properties( $_REQUEST );
59
+	$export->set_properties($_REQUEST);
60 60
 
61 61
 	$export->pre_fetch();
62 62
 
63
-	$ret = $export->process_step( $step );
63
+	$ret = $export->process_step($step);
64 64
 
65 65
 	$percentage = $export->get_percentage_complete();
66 66
 
67
-	if ( $ret ) {
67
+	if ($ret) {
68 68
 
69 69
 		$step += 1;
70
-		echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) );
70
+		echo json_encode(array('step' => $step, 'percentage' => $percentage));
71 71
 		exit;
72 72
 
73
-	} elseif ( true === $export->is_empty ) {
73
+	} elseif (true === $export->is_empty) {
74 74
 
75
-		echo json_encode( array(
75
+		echo json_encode(array(
76 76
 			'error'   => true,
77
-			'message' => esc_html__( 'No data found for export parameters.', 'give' )
78
-		) );
77
+			'message' => esc_html__('No data found for export parameters.', 'give')
78
+		));
79 79
 		exit;
80 80
 
81
-	} elseif ( true === $export->done && true === $export->is_void ) {
81
+	} elseif (true === $export->done && true === $export->is_void) {
82 82
 
83
-		$message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete', 'give' );
84
-		echo json_encode( array( 'success' => true, 'message' => $message ) );
83
+		$message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete', 'give');
84
+		echo json_encode(array('success' => true, 'message' => $message));
85 85
 		exit;
86 86
 
87 87
 	} else {
88 88
 		
89
-		$args = array_merge( $_REQUEST, array(
89
+		$args = array_merge($_REQUEST, array(
90 90
 			'step'        => $step,
91 91
 			'class'       => $class,
92
-			'nonce'       => wp_create_nonce( 'give-batch-export' ),
92
+			'nonce'       => wp_create_nonce('give-batch-export'),
93 93
 			'give_action' => 'form_batch_export',
94
-		) );
94
+		));
95 95
 
96
-		$download_url = add_query_arg( $args, admin_url() );
96
+		$download_url = add_query_arg($args, admin_url());
97 97
 
98
-		echo json_encode( array( 'step' => 'done', 'url' => $download_url ) );
98
+		echo json_encode(array('step' => 'done', 'url' => $download_url));
99 99
 		exit;
100 100
 
101 101
 	}
102 102
 }
103 103
 
104
-add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' );
104
+add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export');
Please login to merge, or discard this patch.
includes/admin/admin-pages.php 1 patch
Spacing   +65 added lines, -65 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
 
@@ -29,31 +29,31 @@  discard block
 block discarded – undo
29 29
 	global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_upgrades_screen, $give_donors_page;
30 30
 
31 31
 	//Payments
32
-	$give_payment       = get_post_type_object( 'give_payment' );
33
-	$give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' );
32
+	$give_payment       = get_post_type_object('give_payment');
33
+	$give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page');
34 34
 
35 35
 	//Donors
36
-	$give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_customers_page' );
36
+	$give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_customers_page');
37 37
 
38 38
 	//Reports`
39
-	$give_reports_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donation Reports', 'give' ), esc_html__( 'Reports', 'give' ), 'view_give_reports', 'give-reports', 'give_reports_page' );
39
+	$give_reports_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donation Reports', 'give'), esc_html__('Reports', 'give'), 'view_give_reports', 'give-reports', 'give_reports_page');
40 40
 
41 41
 	//Settings
42
-	$give_settings_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Settings', 'give' ), esc_html__( 'Settings', 'give' ), 'manage_give_settings', 'give-settings', array(
42
+	$give_settings_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Settings', 'give'), esc_html__('Settings', 'give'), 'manage_give_settings', 'give-settings', array(
43 43
 		Give()->give_settings,
44 44
 		'admin_page_display'
45
-	) );
45
+	));
46 46
 
47 47
 	//Add-ons
48
-	$give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' );
48
+	$give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page');
49 49
 
50 50
 	//Upgrades
51
-	$give_upgrades_screen = add_submenu_page( null, esc_html__( 'Give Upgrades', 'give' ), esc_html__( 'Give Upgrades', 'give' ), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen' );
51
+	$give_upgrades_screen = add_submenu_page(null, esc_html__('Give Upgrades', 'give'), esc_html__('Give Upgrades', 'give'), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen');
52 52
 
53 53
 
54 54
 }
55 55
 
56
-add_action( 'admin_menu', 'give_add_options_links', 10 );
56
+add_action('admin_menu', 'give_add_options_links', 10);
57 57
 
58 58
 /**
59 59
  *  Determines whether the current admin page is a Give admin page.
@@ -68,224 +68,224 @@  discard block
 block discarded – undo
68 68
  *
69 69
  * @return bool True if Give admin page.
70 70
  */
71
-function give_is_admin_page( $passed_page = '', $passed_view = '' ) {
71
+function give_is_admin_page($passed_page = '', $passed_view = '') {
72 72
 
73 73
 	global $pagenow, $typenow;
74 74
 
75 75
 	$found     = false;
76
-	$post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false;
77
-	$action    = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false;
78
-	$taxonomy  = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false;
79
-	$page      = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false;
80
-	$view      = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false;
81
-	$tab       = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false;
76
+	$post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false;
77
+	$action    = isset($_GET['action']) ? strtolower($_GET['action']) : false;
78
+	$taxonomy  = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false;
79
+	$page      = isset($_GET['page']) ? strtolower($_GET['page']) : false;
80
+	$view      = isset($_GET['view']) ? strtolower($_GET['view']) : false;
81
+	$tab       = isset($_GET['tab']) ? strtolower($_GET['tab']) : false;
82 82
 
83
-	switch ( $passed_page ) {
83
+	switch ($passed_page) {
84 84
 		case 'give_forms':
85
-			switch ( $passed_view ) {
85
+			switch ($passed_view) {
86 86
 				case 'list-table':
87
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) {
87
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') {
88 88
 						$found = true;
89 89
 					}
90 90
 					break;
91 91
 				case 'edit':
92
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) {
92
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') {
93 93
 						$found = true;
94 94
 					}
95 95
 					break;
96 96
 				case 'new':
97
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) {
97
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') {
98 98
 						$found = true;
99 99
 					}
100 100
 					break;
101 101
 				default:
102
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) {
102
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) {
103 103
 						$found = true;
104 104
 					}
105 105
 					break;
106 106
 			}
107 107
 			break;
108 108
 		case 'categories':
109
-			switch ( $passed_view ) {
109
+			switch ($passed_view) {
110 110
 				case 'list-table':
111 111
 				case 'new':
112
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) {
112
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) {
113 113
 						$found = true;
114 114
 					}
115 115
 					break;
116 116
 				case 'edit':
117
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) {
117
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) {
118 118
 						$found = true;
119 119
 					}
120 120
 					break;
121 121
 				default:
122
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) {
122
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) {
123 123
 						$found = true;
124 124
 					}
125 125
 					break;
126 126
 			}
127 127
 			break;
128 128
 		case 'tags':
129
-			switch ( $passed_view ) {
129
+			switch ($passed_view) {
130 130
 				case 'list-table':
131 131
 				case 'new':
132
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) {
132
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) {
133 133
 						$found = true;
134 134
 					}
135 135
 					break;
136 136
 				case 'edit':
137
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) {
137
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) {
138 138
 						$found = true;
139 139
 					}
140 140
 					break;
141 141
 				default:
142
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) {
142
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) {
143 143
 						$found = true;
144 144
 					}
145 145
 					break;
146 146
 			}
147 147
 			break;
148 148
 		case 'payments':
149
-			switch ( $passed_view ) {
149
+			switch ($passed_view) {
150 150
 				case 'list-table':
151
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) {
151
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) {
152 152
 						$found = true;
153 153
 					}
154 154
 					break;
155 155
 				case 'edit':
156
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view ) {
156
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view) {
157 157
 						$found = true;
158 158
 					}
159 159
 					break;
160 160
 				default:
161
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) {
161
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) {
162 162
 						$found = true;
163 163
 					}
164 164
 					break;
165 165
 			}
166 166
 			break;
167 167
 		case 'reports':
168
-			switch ( $passed_view ) {
168
+			switch ($passed_view) {
169 169
 				// If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ]
170 170
 				case 'earnings':
171
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) {
171
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) {
172 172
 						$found = true;
173 173
 					}
174 174
 					break;
175 175
 				case 'donors':
176
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) {
176
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) {
177 177
 						$found = true;
178 178
 					}
179 179
 					break;
180 180
 				case 'gateways':
181
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) {
181
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) {
182 182
 						$found = true;
183 183
 					}
184 184
 					break;
185 185
 				case 'export':
186
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) {
186
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) {
187 187
 						$found = true;
188 188
 					}
189 189
 					break;
190 190
 				case 'logs':
191
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) {
191
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) {
192 192
 						$found = true;
193 193
 					}
194 194
 					break;
195 195
 				default:
196
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
196
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
197 197
 						$found = true;
198 198
 					}
199 199
 					break;
200 200
 			}
201 201
 			break;
202 202
 		case 'settings':
203
-			switch ( $passed_view ) {
203
+			switch ($passed_view) {
204 204
 				case 'general':
205
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) {
205
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) {
206 206
 						$found = true;
207 207
 					}
208 208
 					break;
209 209
 				case 'gateways':
210
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) {
210
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) {
211 211
 						$found = true;
212 212
 					}
213 213
 					break;
214 214
 				case 'emails':
215
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) {
215
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) {
216 216
 						$found = true;
217 217
 					}
218 218
 					break;
219 219
 				case 'display':
220
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) {
220
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) {
221 221
 						$found = true;
222 222
 					}
223 223
 					break;
224 224
 				case 'licenses':
225
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) {
225
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) {
226 226
 						$found = true;
227 227
 					}
228 228
 					break;
229 229
 				case 'api':
230
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) {
230
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) {
231 231
 						$found = true;
232 232
 					}
233 233
 					break;
234 234
 				case 'advanced':
235
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) {
235
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) {
236 236
 						$found = true;
237 237
 					}
238 238
 					break;
239 239
 				case 'system_info':
240
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) {
240
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) {
241 241
 						$found = true;
242 242
 					}
243 243
 					break;
244 244
 				default:
245
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) {
245
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) {
246 246
 						$found = true;
247 247
 					}
248 248
 					break;
249 249
 			}
250 250
 			break;
251 251
 		case 'addons':
252
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) {
252
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) {
253 253
 				$found = true;
254 254
 			}
255 255
 			break;
256 256
 		case 'donors':
257
-			switch ( $passed_view ) {
257
+			switch ($passed_view) {
258 258
 				case 'list-table':
259
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) {
259
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) {
260 260
 						$found = true;
261 261
 					}
262 262
 					break;
263 263
 				case 'overview':
264
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) {
264
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) {
265 265
 						$found = true;
266 266
 					}
267 267
 					break;
268 268
 				case 'notes':
269
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) {
269
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) {
270 270
 						$found = true;
271 271
 					}
272 272
 					break;
273 273
 				default:
274
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) {
274
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) {
275 275
 						$found = true;
276 276
 					}
277 277
 					break;
278 278
 			}
279 279
 			break;
280 280
 		case 'reports':
281
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
281
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
282 282
 				$found = true;
283 283
 			}
284 284
 			break;
285 285
 		default:
286 286
 			global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_upgrades_screen, $give_customers_page;
287 287
 
288
-			$admin_pages = apply_filters( 'give_admin_pages', array(
288
+			$admin_pages = apply_filters('give_admin_pages', array(
289 289
 				$give_payments_page,
290 290
 				$give_settings_page,
291 291
 				$give_reports_page,
@@ -294,18 +294,18 @@  discard block
 block discarded – undo
294 294
 				$give_upgrades_screen,
295 295
 				$give_settings_export,
296 296
 				$give_customers_page
297
-			) );
298
-			if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) {
297
+			));
298
+			if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) {
299 299
 				$found = true;
300
-				if ( 'give-upgrades' === $page ) {
300
+				if ('give-upgrades' === $page) {
301 301
 					$found = false;
302 302
 				}
303
-			} elseif ( in_array( $pagenow, $admin_pages ) ) {
303
+			} elseif (in_array($pagenow, $admin_pages)) {
304 304
 				$found = true;
305 305
 			}
306 306
 			break;
307 307
 	}
308 308
 
309
-	return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view );
309
+	return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view);
310 310
 
311 311
 }
312 312
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-login.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@
 block discarded – undo
42 42
 				'minWidth' => 320,
43 43
 				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
44 44
 			),
45
-            array(
46
-                'type' => 'container',
47
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
-            ),
49
-            array(
50
-                'type'     => 'textbox',
51
-                'name'     => 'logout-redirect',
52
-                'minWidth' => 320,
53
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
-            ),
45
+			array(
46
+				'type' => 'container',
47
+				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
+			),
49
+			array(
50
+				'type'     => 'textbox',
51
+				'name'     => 'logout-redirect',
52
+				'minWidth' => 320,
53
+				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
+			),
55 55
 		);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title'] = esc_html__( 'Login', 'give' );
25
-		$this->shortcode['label'] = esc_html__( 'Login', 'give' );
24
+		$this->shortcode['title'] = esc_html__('Login', 'give');
25
+		$this->shortcode['label'] = esc_html__('Login', 'give');
26 26
 
27
-		parent::__construct( 'give_login' );
27
+		parent::__construct('give_login');
28 28
 	}
29 29
 
30 30
 	/**
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 		return array(
38 38
 			array(
39 39
 				'type' => 'container',
40
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ),
40
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')),
41 41
 			),
42 42
 			array(
43 43
 				'type'     => 'textbox',
44 44
 				'name'     => 'login-redirect',
45 45
 				'minWidth' => 320,
46
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
46
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after login.', 'give'),
47 47
 			),
48 48
             array(
49 49
                 'type' => 'container',
50
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
50
+                'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')),
51 51
             ),
52 52
             array(
53 53
                 'type'     => 'textbox',
54 54
                 'name'     => 'logout-redirect',
55 55
                 'minWidth' => 320,
56
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
56
+                'tooltip'  => esc_attr__('Enter an URL here to redirect to after logout.', 'give'),
57 57
             ),
58 58
 		);
59 59
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/abstract-shortcode-generator.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,8 +248,8 @@
 block discarded – undo
248 248
 
249 249
 			// do not reindex array!
250 250
 			$field['options'] = array(
251
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
-			                    ) + $field['options'];
251
+									'' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
+								) + $field['options'];
253 253
 
254 254
 			foreach ( $field['options'] as $value => $text ) {
255 255
 				$new_listbox['values'][] = array(
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 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
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @since 1.0
64 64
 	 */
65
-	public function __construct( $shortcode ) {
65
+	public function __construct($shortcode) {
66 66
 
67 67
 
68 68
 		$this->shortcode_tag = $shortcode;
69 69
 
70
-		add_action( 'admin_init', array( $this, 'init' ) );
70
+		add_action('admin_init', array($this, 'init'));
71 71
 
72 72
 	}
73 73
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function init() {
80 80
 
81
-		if ( $this->shortcode_tag ) {
81
+		if ($this->shortcode_tag) {
82 82
 
83
-			$this->self = get_class( $this );
83
+			$this->self = get_class($this);
84 84
 
85 85
 			$this->errors   = array();
86 86
 			$this->required = array();
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
 			$fields = $this->get_fields();
90 90
 
91 91
 			$defaults = array(
92
-				'btn_close' => esc_html__( 'Close', 'give' ),
93
-				'btn_okay'  => esc_html__( 'Insert Shortcode', 'give' ),
92
+				'btn_close' => esc_html__('Close', 'give'),
93
+				'btn_okay'  => esc_html__('Insert Shortcode', 'give'),
94 94
 				'errors'    => $this->errors,
95 95
 				'fields'    => $fields,
96
-				'label'     => '[' . $this->shortcode_tag . ']',
96
+				'label'     => '['.$this->shortcode_tag.']',
97 97
 				'required'  => $this->required,
98
-				'title'     => esc_html__( 'Insert Shortcode', 'give' ),
98
+				'title'     => esc_html__('Insert Shortcode', 'give'),
99 99
 			);
100 100
 
101
-			if ( user_can_richedit() ) {
101
+			if (user_can_richedit()) {
102 102
 
103
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
103
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
104 104
 
105 105
 			}
106 106
 		}
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 * @since 1.0
131 131
 	 */
132
-	protected function generate_fields( $defined_fields ) {
132
+	protected function generate_fields($defined_fields) {
133 133
 
134 134
 		$fields = array();
135 135
 
136
-		if ( is_array( $defined_fields ) ) {
136
+		if (is_array($defined_fields)) {
137 137
 
138
-			foreach ( $defined_fields as $field ) {
138
+			foreach ($defined_fields as $field) {
139 139
 
140 140
 				$defaults = array(
141 141
 					'label'       => false,
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 					'type'        => '',
147 147
 				);
148 148
 
149
-				$field  = wp_parse_args( (array) $field, $defaults );
150
-				$method = 'generate_' . strtolower( $field['type'] );
149
+				$field  = wp_parse_args((array) $field, $defaults);
150
+				$method = 'generate_'.strtolower($field['type']);
151 151
 
152
-				if ( method_exists( $this, $method ) ) {
152
+				if (method_exists($this, $method)) {
153 153
 
154
-					$field = call_user_func( array( $this, $method ), $field );
154
+					$field = call_user_func(array($this, $method), $field);
155 155
 
156
-					if ( $field ) {
156
+					if ($field) {
157 157
 						$fields[] = $field;
158 158
 					}
159 159
 				}
@@ -173,22 +173,22 @@  discard block
 block discarded – undo
173 173
 	protected function get_fields() {
174 174
 
175 175
 		$defined_fields   = $this->define_fields();
176
-		$generated_fields = $this->generate_fields( $defined_fields );
176
+		$generated_fields = $this->generate_fields($defined_fields);
177 177
 
178 178
 		$errors = array();
179 179
 
180
-		if ( ! empty( $this->errors ) ) {
181
-			foreach ( $this->required as $name => $alert ) {
182
-				if ( false === array_search( $name, array_column( $generated_fields, 'name' ) ) ) {
180
+		if ( ! empty($this->errors)) {
181
+			foreach ($this->required as $name => $alert) {
182
+				if (false === array_search($name, array_column($generated_fields, 'name'))) {
183 183
 
184
-					$errors[] = $this->errors[ $name ];
184
+					$errors[] = $this->errors[$name];
185 185
 				}
186 186
 			}
187 187
 
188 188
 			$this->errors = $errors;
189 189
 		}
190 190
 
191
-		if ( ! empty( $errors ) ) {
191
+		if ( ! empty($errors)) {
192 192
 
193 193
 			return $errors;
194 194
 		}
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @since 1.0
207 207
 	 */
208
-	protected function generate_container( $field ) {
208
+	protected function generate_container($field) {
209 209
 
210
-		if ( array_key_exists( 'html', $field ) ) {
210
+		if (array_key_exists('html', $field)) {
211 211
 
212 212
 			return array(
213 213
 				'type' => $field['type'],
@@ -227,36 +227,36 @@  discard block
 block discarded – undo
227 227
 	 *
228 228
 	 * @since 1.0
229 229
 	 */
230
-	protected function generate_listbox( $field ) {
230
+	protected function generate_listbox($field) {
231 231
 
232
-		$listbox = shortcode_atts( array(
232
+		$listbox = shortcode_atts(array(
233 233
 			'label'    => '',
234 234
 			'minWidth' => '',
235 235
 			'name'     => false,
236 236
 			'tooltip'  => '',
237 237
 			'type'     => '',
238 238
 			'value'    => '',
239
-		), $field );
239
+		), $field);
240 240
 
241
-		if ( $this->validate( $field ) ) {
241
+		if ($this->validate($field)) {
242 242
 
243 243
 			$new_listbox = array();
244 244
 
245
-			foreach ( $listbox as $key => $value ) {
245
+			foreach ($listbox as $key => $value) {
246 246
 
247
-				if ( $key == 'value' && empty( $value ) ) {
248
-					$new_listbox[ $key ] = $listbox['name'];
249
-				} else if ( $value ) {
250
-					$new_listbox[ $key ] = $value;
247
+				if ($key == 'value' && empty($value)) {
248
+					$new_listbox[$key] = $listbox['name'];
249
+				} else if ($value) {
250
+					$new_listbox[$key] = $value;
251 251
 				}
252 252
 			}
253 253
 
254 254
 			// do not reindex array!
255 255
 			$field['options'] = array(
256
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
256
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')),
257 257
 			                    ) + $field['options'];
258 258
 
259
-			foreach ( $field['options'] as $value => $text ) {
259
+			foreach ($field['options'] as $value => $text) {
260 260
 				$new_listbox['values'][] = array(
261 261
 					'text'  => $text,
262 262
 					'value' => $value,
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 *
279 279
 	 * @since 1.0
280 280
 	 */
281
-	protected function generate_post( $field ) {
281
+	protected function generate_post($field) {
282 282
 
283 283
 		$args = array(
284 284
 			'post_type'      => 'post',
@@ -287,23 +287,23 @@  discard block
 block discarded – undo
287 287
 			'posts_per_page' => 30,
288 288
 		);
289 289
 
290
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
291
-		$posts   = get_posts( $args );
290
+		$args    = wp_parse_args((array) $field['query_args'], $args);
291
+		$posts   = get_posts($args);
292 292
 		$options = array();
293 293
 
294
-		if ( $posts ) {
295
-			foreach ( $posts as $post ) {
296
-				$options[ absint( $post->ID ) ] = $post->post_title;
294
+		if ($posts) {
295
+			foreach ($posts as $post) {
296
+				$options[absint($post->ID)] = $post->post_title;
297 297
 			}
298 298
 
299 299
 			$field['type']    = 'listbox';
300 300
 			$field['options'] = $options;
301 301
 
302
-			return $this->generate_listbox( $field );
302
+			return $this->generate_listbox($field);
303 303
 		}
304 304
 
305 305
 		// perform validation here before returning false
306
-		$this->validate( $field );
306
+		$this->validate($field);
307 307
 
308 308
 		return false;
309 309
 	}
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 	 *
318 318
 	 * @since 1.0
319 319
 	 */
320
-	protected function generate_textbox( $field ) {
320
+	protected function generate_textbox($field) {
321 321
 
322
-		$textbox = shortcode_atts( array(
322
+		$textbox = shortcode_atts(array(
323 323
 			'label'     => '',
324 324
 			'maxLength' => '',
325 325
 			'minHeight' => '',
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
 			'tooltip'   => '',
330 330
 			'type'      => '',
331 331
 			'value'     => '',
332
-		), $field );
332
+		), $field);
333 333
 
334
-		if ( $this->validate( $field ) ) {
335
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
334
+		if ($this->validate($field)) {
335
+			return array_filter($textbox, array($this, 'return_textbox_value'));
336 336
 		}
337 337
 
338 338
 		return false;
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	 *
346 346
 	 * @return bool
347 347
 	 */
348
-	function return_textbox_value( $value ) {
348
+	function return_textbox_value($value) {
349 349
 		return $value !== '';
350 350
 	}
351 351
 
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
 	 *
362 362
 	 * @since 1.0
363 363
 	 */
364
-	protected function validate( $field ) {
364
+	protected function validate($field) {
365 365
 
366
-		extract( shortcode_atts(
366
+		extract(shortcode_atts(
367 367
 				array(
368 368
 					'name'     => false,
369 369
 					'required' => false,
@@ -371,36 +371,36 @@  discard block
 block discarded – undo
371 371
 				), $field )
372 372
 		);
373 373
 
374
-		if ( $name ) {
374
+		if ($name) {
375 375
 
376
-			if ( isset( $required['error'] ) ) {
376
+			if (isset($required['error'])) {
377 377
 
378 378
 				$error = array(
379 379
 					'type' => 'container',
380 380
 					'html' => $required['error'],
381 381
 				);
382 382
 
383
-				$this->errors[ $name ] = $this->generate_container( $error );
383
+				$this->errors[$name] = $this->generate_container($error);
384 384
 			}
385 385
 
386
-			if ( ! ! $required || is_array( $required ) ) {
386
+			if ( ! ! $required || is_array($required)) {
387 387
 
388
-				$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );
388
+				$alert = esc_html__('Some of the shortcode options are required.', 'give');
389 389
 
390
-				if ( isset( $required['alert'] ) ) {
390
+				if (isset($required['alert'])) {
391 391
 
392 392
 					$alert = $required['alert'];
393 393
 
394
-				} else if ( ! empty( $label ) ) {
394
+				} else if ( ! empty($label)) {
395 395
 
396 396
 					$alert = sprintf(
397 397
 					/* translators: %s: option label */
398
-						esc_html__( 'The "%s" option is required.', 'give' ),
399
-						str_replace( ':', '', $label )
398
+						esc_html__('The "%s" option is required.', 'give'),
399
+						str_replace(':', '', $label)
400 400
 					);
401 401
 				}
402 402
 
403
-				$this->required[ $name ] = $alert;
403
+				$this->required[$name] = $alert;
404 404
 			}
405 405
 
406 406
 			return true;
Please login to merge, or discard this patch.
includes/admin/customers/customer-functions.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
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array        The altered list of views
25 25
  */
26
-function give_register_default_customer_views( $views ) {
26
+function give_register_default_customer_views($views) {
27 27
 
28 28
 	$default_views = array(
29 29
 		'overview' => 'give_customers_view',
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
 		'notes'    => 'give_customer_notes_view'
32 32
 	);
33 33
 
34
-	return array_merge( $views, $default_views );
34
+	return array_merge($views, $default_views);
35 35
 
36 36
 }
37 37
 
38
-add_filter( 'give_customer_views', 'give_register_default_customer_views', 1, 1 );
38
+add_filter('give_customer_views', 'give_register_default_customer_views', 1, 1);
39 39
 
40 40
 /**
41 41
  * Register a tab for the single customer view
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return array       The altered list of tabs
48 48
  */
49
-function give_register_default_customer_tabs( $tabs ) {
49
+function give_register_default_customer_tabs($tabs) {
50 50
 
51 51
 	$default_tabs = array(
52
-		'overview' => array( 'dashicon' => 'dashicons-admin-users', 'title' => esc_html__( 'Donor Profile', 'give' ) ),
53
-		'notes'    => array( 'dashicon' => 'dashicons-admin-comments', 'title' => esc_html__( 'Donor Notes', 'give' ) )
52
+		'overview' => array('dashicon' => 'dashicons-admin-users', 'title' => esc_html__('Donor Profile', 'give')),
53
+		'notes'    => array('dashicon' => 'dashicons-admin-comments', 'title' => esc_html__('Donor Notes', 'give'))
54 54
 	);
55 55
 
56
-	return array_merge( $tabs, $default_tabs );
56
+	return array_merge($tabs, $default_tabs);
57 57
 }
58 58
 
59
-add_filter( 'give_customer_tabs', 'give_register_default_customer_tabs', 1, 1 );
59
+add_filter('give_customer_tabs', 'give_register_default_customer_tabs', 1, 1);
60 60
 
61 61
 /**
62 62
  * Register the Delete icon as late as possible so it's at the bottom
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
  *
68 68
  * @return array       The altered list of tabs, with 'delete' at the bottom
69 69
  */
70
-function give_register_delete_customer_tab( $tabs ) {
70
+function give_register_delete_customer_tab($tabs) {
71 71
 
72
-	$tabs['delete'] = array( 'dashicon' => 'dashicons-trash', 'title' => esc_html__( 'Delete Donor', 'give' ) );
72
+	$tabs['delete'] = array('dashicon' => 'dashicons-trash', 'title' => esc_html__('Delete Donor', 'give'));
73 73
 
74 74
 	return $tabs;
75 75
 }
76 76
 
77
-add_filter( 'give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1 );
77
+add_filter('give_customer_tabs', 'give_register_delete_customer_tab', PHP_INT_MAX, 1);
Please login to merge, or discard this patch.
includes/class-give-cron.php 1 patch
Spacing   +9 added lines, -9 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
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 * @see   Give_Cron::weekly_events()
30 30
 	 */
31 31
 	public function __construct() {
32
-		add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
33
-		add_action( 'wp', array( $this, 'schedule_Events' ) );
32
+		add_filter('cron_schedules', array($this, 'add_schedules'));
33
+		add_action('wp', array($this, 'schedule_Events'));
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @return array
44 44
 	 */
45
-	public function add_schedules( $schedules = array() ) {
45
+	public function add_schedules($schedules = array()) {
46 46
 		// Adds once weekly to the existing schedules.
47 47
 		$schedules['weekly'] = array(
48 48
 			'interval' => 604800,
49
-			'display'  => esc_html__( 'Once Weekly', 'give' )
49
+			'display'  => esc_html__('Once Weekly', 'give')
50 50
 		);
51 51
 
52 52
 		return $schedules;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @return void
73 73
 	 */
74 74
 	private function weekly_events() {
75
-		if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) {
76
-			wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' );
75
+		if ( ! wp_next_scheduled('give_weekly_scheduled_events')) {
76
+			wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events');
77 77
 		}
78 78
 	}
79 79
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @return void
86 86
 	 */
87 87
 	private function daily_events() {
88
-		if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) {
89
-			wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' );
88
+		if ( ! wp_next_scheduled('give_daily_scheduled_events')) {
89
+			wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events');
90 90
 		}
91 91
 	}
92 92
 
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @param $url
91 91
 	 *
92
-	 * @return mixed
92
+	 * @return string
93 93
 	 */
94 94
 	public function give_update_cmb_meta_box_url( $url ) {
95 95
 		//Path to Give's CMB
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
  * @since 1.0
874 874
  *
875 875
  * @param string          $key The Key to update
876
- * @param string|bool|int $value The value to set the key to
876
+ * @param integer $value The value to set the key to
877 877
  *
878 878
  * @return boolean True if updated, false if not.
879 879
  */
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
  * @since      1.3.5
975 975
  *
976 976
  * @param $array
977
- * @param $position |int|string Expects an array key or 'id' of the settings field to appear after
977
+ * @param string $position |int|string Expects an array key or 'id' of the settings field to appear after
978 978
  * @param $insert |array a valid array of options to insert
979 979
  *
980 980
  * @return array
Please login to merge, or discard this patch.
Indentation   +171 added lines, -171 removed lines patch added patch discarded remove patch
@@ -1196,26 +1196,26 @@  discard block
 block discarded – undo
1196 1196
  * @return void
1197 1197
  */
1198 1198
 function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1199
-    /* @var CMB2_Types $field_type_object*/
1199
+	/* @var CMB2_Types $field_type_object*/
1200 1200
 
1201
-    $id                   = $field_type_object->field->args['id'];
1201
+	$id                   = $field_type_object->field->args['id'];
1202 1202
 	$field_description    = $field_type_object->field->args['desc'];
1203 1203
 	$license              = $field_type_object->field->args['options']['license'];
1204
-    $license_key          = $escaped_value;
1205
-    $is_license_key       = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1206
-    $is_valid_license     = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1207
-    $shortname            = $field_type_object->field->args['options']['shortname'];
1204
+	$license_key          = $escaped_value;
1205
+	$is_license_key       = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1206
+	$is_valid_license     = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1207
+	$shortname            = $field_type_object->field->args['options']['shortname'];
1208 1208
 	$field_classes        = 'regular-text give-license-field';
1209 1209
 	$type                 = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1210
-    $custom_html          = '';
1211
-    $value                = $escaped_value;
1212
-    $messages             = array();
1213
-    $class                = '';
1214
-    $account_page_link    = $field_type_object->field->args['options']['account_url'];
1215
-    $checkout_page_link   = $field_type_object->field->args['options']['checkout_url'];
1216
-    $addon_name           = $field_type_object->field->args['options']['item_name'];
1217
-    $license_status       = null;
1218
-    $is_in_subscription   = null;
1210
+	$custom_html          = '';
1211
+	$value                = $escaped_value;
1212
+	$messages             = array();
1213
+	$class                = '';
1214
+	$account_page_link    = $field_type_object->field->args['options']['account_url'];
1215
+	$checkout_page_link   = $field_type_object->field->args['options']['checkout_url'];
1216
+	$addon_name           = $field_type_object->field->args['options']['item_name'];
1217
+	$license_status       = null;
1218
+	$is_in_subscription   = null;
1219 1219
 
1220 1220
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1221 1221
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
@@ -1224,142 +1224,142 @@  discard block
 block discarded – undo
1224 1224
 	}
1225 1225
 
1226 1226
 
1227
-    // Check if current license is part of subscription or not.
1228
-    $subscriptions = get_option( 'give_subscriptions' );
1229
-
1230
-    if( $is_license_key && $subscriptions ) {
1231
-        foreach ( $subscriptions as $subscription ) {
1232
-            if( in_array( $license_key, $subscription['licenses'] ) ) {
1233
-                $is_in_subscription = $subscription['id'];
1234
-                break;
1235
-            }
1236
-        }
1237
-    }
1238
-
1239
-
1240
-    if( $is_license_key ) {
1241
-        if( $is_in_subscription ) {
1242
-            $subscription_expires = strtotime( $subscriptions[$is_in_subscription]['expires'] );
1243
-            $subscription_status  = esc_html__( 'renew', 'give' );
1244
-
1245
-            if( ( 'active' !== $subscriptions[$is_in_subscription]['status'] ) ){
1246
-                $subscription_status = esc_html__( 'expire', 'give' );
1247
-            }
1248
-
1249
-            if( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1250
-                $messages[] = sprintf(
1251
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) expired. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1252
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1253
-                    $subscriptions[$is_in_subscription]['payment_id'],
1254
-                    $checkout_page_link . '?edd_license_key=' . $subscriptions[$is_in_subscription]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1255
-                );
1256
-                $license_status = 'license-expired';
1257
-            } elseif( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1258
-                $messages[] = sprintf(
1259
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s in %s.', 'give' ),
1260
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1261
-                    $subscriptions[$is_in_subscription]['payment_id'],
1262
-                    $subscription_status,
1263
-                    human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[$is_in_subscription]['expires'] ) )
1264
-                );
1265
-                $license_status = 'license-expires-soon';
1266
-            } else {
1267
-                $messages[] = sprintf(
1268
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s on %s.', 'give' ),
1269
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1270
-                    $subscriptions[$is_in_subscription]['payment_id'],
1271
-                    $subscription_status,
1272
-                    date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[$is_in_subscription]['expires'], current_time( 'timestamp' ) ) )
1273
-                );
1274
-                $license_status = 'license-expiration-date';
1275
-            }
1276
-
1277
-
1278
-        } elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1279
-
1280
-            // activate_license 'invalid' on anything other than valid, so if there was an error capture it
1281
-            switch(   $license->error ) {
1282
-                case 'expired' :
1227
+	// Check if current license is part of subscription or not.
1228
+	$subscriptions = get_option( 'give_subscriptions' );
1229
+
1230
+	if( $is_license_key && $subscriptions ) {
1231
+		foreach ( $subscriptions as $subscription ) {
1232
+			if( in_array( $license_key, $subscription['licenses'] ) ) {
1233
+				$is_in_subscription = $subscription['id'];
1234
+				break;
1235
+			}
1236
+		}
1237
+	}
1238
+
1239
+
1240
+	if( $is_license_key ) {
1241
+		if( $is_in_subscription ) {
1242
+			$subscription_expires = strtotime( $subscriptions[$is_in_subscription]['expires'] );
1243
+			$subscription_status  = esc_html__( 'renew', 'give' );
1244
+
1245
+			if( ( 'active' !== $subscriptions[$is_in_subscription]['status'] ) ){
1246
+				$subscription_status = esc_html__( 'expire', 'give' );
1247
+			}
1248
+
1249
+			if( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1250
+				$messages[] = sprintf(
1251
+					__( 'Your subscription (<a href="%s" target="_blank">#%d</a>) expired. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1252
+					urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1253
+					$subscriptions[$is_in_subscription]['payment_id'],
1254
+					$checkout_page_link . '?edd_license_key=' . $subscriptions[$is_in_subscription]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1255
+				);
1256
+				$license_status = 'license-expired';
1257
+			} elseif( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1258
+				$messages[] = sprintf(
1259
+					__( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s in %s.', 'give' ),
1260
+					urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1261
+					$subscriptions[$is_in_subscription]['payment_id'],
1262
+					$subscription_status,
1263
+					human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[$is_in_subscription]['expires'] ) )
1264
+				);
1265
+				$license_status = 'license-expires-soon';
1266
+			} else {
1267
+				$messages[] = sprintf(
1268
+					__( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s on %s.', 'give' ),
1269
+					urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1270
+					$subscriptions[$is_in_subscription]['payment_id'],
1271
+					$subscription_status,
1272
+					date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[$is_in_subscription]['expires'], current_time( 'timestamp' ) ) )
1273
+				);
1274
+				$license_status = 'license-expiration-date';
1275
+			}
1276
+
1277
+
1278
+		} elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1279
+
1280
+			// activate_license 'invalid' on anything other than valid, so if there was an error capture it
1281
+			switch(   $license->error ) {
1282
+				case 'expired' :
1283 1283
 					error_log(print_r( $license->error, true) . "\n", 3, WP_CONTENT_DIR . '/debug_new.log');
1284
-                    $class = $license->error;
1285
-                    $messages[] = sprintf(
1286
-                        __( 'Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1287
-                        date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1288
-                        $checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1289
-                    );
1290
-                    $license_status = 'license-' . $class;
1291
-                    break;
1292
-
1293
-                case 'missing' :
1294
-                    $class = $license->error;
1295
-                    $messages[] = sprintf(
1296
-                        __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1297
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1298
-                    );
1299
-                    $license_status = 'license-' . $class;
1300
-                    break;
1301
-
1302
-                case 'invalid' :
1303
-                    $class = $license->error;
1304
-                    $messages[] = sprintf(
1305
-                        __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1306
-                        $addon_name,
1307
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1308
-                    );
1309
-                    $license_status = 'license-' . $class;
1310
-                    break;
1311
-
1312
-                case 'site_inactive' :
1313
-                    $class = $license->error;
1314
-                    $messages[] = sprintf(
1315
-                        __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1316
-                        $addon_name,
1317
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1318
-                    );
1319
-                    $license_status = 'license-' . $class;
1320
-                    break;
1321
-
1322
-                case 'item_name_mismatch' :
1323
-                    $class = $license->error;
1324
-                    $messages[] = sprintf( __( 'This license %s does not belong to %s.', 'give' ), $value, $addon_name );
1325
-                    $license_status = 'license-' . $class;
1326
-                    break;
1327
-
1328
-                case 'no_activations_left':
1329
-                    $class = $license->error;
1330
-                    $messages[] = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1331
-                    $license_status = 'license-' . $class;
1332
-                    break;
1333
-            }
1334
-        } else {
1335
-            switch( $license->license ) {
1336
-                case 'valid' :
1337
-                default:
1338
-                    $class = 'valid';
1339
-                    $now        = current_time( 'timestamp' );
1340
-                    $expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1341
-
1342
-                    if( 'lifetime' === $license->expires ) {
1343
-                        $messages[] = esc_html__( 'License key never expires.', 'give' );
1344
-                        $license_status = 'license-lifetime-notice';
1345
-                    } elseif( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1346
-                        $messages[] = sprintf(
1347
-                            __( 'Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1348
-                            date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1349
-                            $checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1350
-                        );
1351
-                        $license_status = 'license-expires-soon';
1352
-                    } else {
1353
-                        $messages[] = sprintf(
1354
-                            __( 'Your license key expires on %s.', 'give' ),
1355
-                            date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1356
-                        );
1357
-                        $license_status = 'license-expiration-date';
1358
-                    }
1359
-                    break;
1360
-            }
1361
-        }
1362
-    } else{
1284
+					$class = $license->error;
1285
+					$messages[] = sprintf(
1286
+						__( 'Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1287
+						date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1288
+						$checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1289
+					);
1290
+					$license_status = 'license-' . $class;
1291
+					break;
1292
+
1293
+				case 'missing' :
1294
+					$class = $license->error;
1295
+					$messages[] = sprintf(
1296
+						__( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1297
+						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1298
+					);
1299
+					$license_status = 'license-' . $class;
1300
+					break;
1301
+
1302
+				case 'invalid' :
1303
+					$class = $license->error;
1304
+					$messages[] = sprintf(
1305
+						__( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1306
+						$addon_name,
1307
+						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1308
+					);
1309
+					$license_status = 'license-' . $class;
1310
+					break;
1311
+
1312
+				case 'site_inactive' :
1313
+					$class = $license->error;
1314
+					$messages[] = sprintf(
1315
+						__( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1316
+						$addon_name,
1317
+						$account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1318
+					);
1319
+					$license_status = 'license-' . $class;
1320
+					break;
1321
+
1322
+				case 'item_name_mismatch' :
1323
+					$class = $license->error;
1324
+					$messages[] = sprintf( __( 'This license %s does not belong to %s.', 'give' ), $value, $addon_name );
1325
+					$license_status = 'license-' . $class;
1326
+					break;
1327
+
1328
+				case 'no_activations_left':
1329
+					$class = $license->error;
1330
+					$messages[] = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1331
+					$license_status = 'license-' . $class;
1332
+					break;
1333
+			}
1334
+		} else {
1335
+			switch( $license->license ) {
1336
+				case 'valid' :
1337
+				default:
1338
+					$class = 'valid';
1339
+					$now        = current_time( 'timestamp' );
1340
+					$expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1341
+
1342
+					if( 'lifetime' === $license->expires ) {
1343
+						$messages[] = esc_html__( 'License key never expires.', 'give' );
1344
+						$license_status = 'license-lifetime-notice';
1345
+					} elseif( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1346
+						$messages[] = sprintf(
1347
+							__( 'Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1348
+							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1349
+							$checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1350
+						);
1351
+						$license_status = 'license-expires-soon';
1352
+					} else {
1353
+						$messages[] = sprintf(
1354
+							__( 'Your license key expires on %s.', 'give' ),
1355
+							date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1356
+						);
1357
+						$license_status = 'license-expiration-date';
1358
+					}
1359
+					break;
1360
+			}
1361
+		}
1362
+	} else{
1363 1363
 		$class = 'empty';
1364 1364
 		$messages[] = sprintf(
1365 1365
 			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 	}
1370 1370
 
1371 1371
 
1372
-    // Add class for input field if license is active.
1372
+	// Add class for input field if license is active.
1373 1373
 	if ( $is_valid_license ) {
1374 1374
 		$field_classes .= ' give-license-active';
1375 1375
 	}
@@ -1382,12 +1382,12 @@  discard block
 block discarded – undo
1382 1382
 
1383 1383
 	// If license is active so show deactivate button
1384 1384
 	if ( $is_valid_license ) {
1385
-        // Get input filed html.
1386
-        $input_field_html = $field_type_object->input( array(
1387
-            'class' => $field_classes,
1388
-            'type'  => $type,
1389
-            'readonly' => 'readonly',
1390
-        ) );
1385
+		// Get input filed html.
1386
+		$input_field_html = $field_type_object->input( array(
1387
+			'class' => $field_classes,
1388
+			'type'  => $type,
1389
+			'readonly' => 'readonly',
1390
+		) );
1391 1391
 
1392 1392
 		$custom_html = '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1393 1393
 	}
@@ -1395,27 +1395,27 @@  discard block
 block discarded – undo
1395 1395
 	// Field description.
1396 1396
 	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1397 1397
 
1398
-    // If no messages found then inform user that to get updated in future register yourself.
1399
-    if ( empty( $messages ) ) {
1400
-        $messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid Software Licensing license key.', 'give' ) );
1401
-    }
1398
+	// If no messages found then inform user that to get updated in future register yourself.
1399
+	if ( empty( $messages ) ) {
1400
+		$messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid Software Licensing license key.', 'give' ) );
1401
+	}
1402 1402
 
1403
-    foreach( $messages as $message ) {
1404
-        $custom_html .= '<div class="give-license-notice give-' . $license_status . '">';
1405
-        $custom_html .= '<p>' . $message . '</p>';
1406
-        $custom_html .= '</div>';
1407
-    }
1403
+	foreach( $messages as $message ) {
1404
+		$custom_html .= '<div class="give-license-notice give-' . $license_status . '">';
1405
+		$custom_html .= '<p>' . $message . '</p>';
1406
+		$custom_html .= '</div>';
1407
+	}
1408 1408
 
1409 1409
 
1410 1410
 
1411
-    // Field html.
1412
-    $custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object );
1411
+	// Field html.
1412
+	$custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object );
1413 1413
 
1414
-    // Nonce.
1414
+	// Nonce.
1415 1415
 	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1416 1416
 
1417
-    // Print field html.
1418
-    echo '<div>' . $custom_html . '</div>';
1417
+	// Print field html.
1418
+	echo '<div>' . $custom_html . '</div>';
1419 1419
 }
1420 1420
 
1421 1421
 
Please login to merge, or discard this patch.
Spacing   +368 added lines, -368 removed lines patch added patch discarded remove patch
@@ -41,26 +41,26 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function __construct() {
43 43
 
44
-		add_action( 'admin_init', array( $this, 'init' ) );
44
+		add_action('admin_init', array($this, 'init'));
45 45
 
46 46
 		//Customize CMB2 URL
47
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
47
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
48 48
 
49 49
 		//Custom CMB2 Settings Fields
50
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
51
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
52
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
53
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
54
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
55
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
56
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
57
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
58
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
50
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
51
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
52
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
53
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
54
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
55
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
56
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
57
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
58
+		add_action('admin_notices', array($this, 'settings_notices'));
59 59
 
60 60
 		// Include CMB CSS in the head to avoid FOUC
61
-		add_action( 'admin_print_styles-give_forms_page_give-settings', array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
61
+		add_action('admin_print_styles-give_forms_page_give-settings', array('CMB2_hookup', 'enqueue_cmb_css'));
62 62
 
63
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'give_modify_cmb2_form_output' ), 10, 3 );
63
+		add_filter('cmb2_get_metabox_form_format', array($this, 'give_modify_cmb2_form_output'), 10, 3);
64 64
 
65 65
 	}
66 66
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @since  1.0
72 72
 	 */
73 73
 	public function init() {
74
-		register_setting( $this->key, $this->key );
74
+		register_setting($this->key, $this->key);
75 75
 
76 76
 	}
77 77
 
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return mixed
87 87
 	 */
88
-	public function give_update_cmb_meta_box_url( $url ) {
88
+	public function give_update_cmb_meta_box_url($url) {
89 89
 		//Path to Give's CMB
90
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
90
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
91 91
 	}
92 92
 
93 93
 
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function give_get_settings_tabs() {
101 101
 
102
-		$settings = $this->give_settings( null );
102
+		$settings = $this->give_settings(null);
103 103
 
104 104
 		$tabs             = array();
105
-		$tabs['general']  = esc_html__( 'General', 'give' );
106
-		$tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' );
107
-		$tabs['display']  = esc_html__( 'Display Options', 'give' );
108
-		$tabs['emails']   = esc_html__( 'Emails', 'give' );
105
+		$tabs['general']  = esc_html__('General', 'give');
106
+		$tabs['gateways'] = esc_html__('Payment Gateways', 'give');
107
+		$tabs['display']  = esc_html__('Display Options', 'give');
108
+		$tabs['emails']   = esc_html__('Emails', 'give');
109 109
 
110
-		if ( ! empty( $settings['addons']['fields'] ) ) {
111
-			$tabs['addons'] = esc_html__( 'Add-ons', 'give' );
110
+		if ( ! empty($settings['addons']['fields'])) {
111
+			$tabs['addons'] = esc_html__('Add-ons', 'give');
112 112
 		}
113 113
 
114
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
115
-			$tabs['licenses'] = esc_html__( 'Licenses', 'give' );
114
+		if ( ! empty($settings['licenses']['fields'])) {
115
+			$tabs['licenses'] = esc_html__('Licenses', 'give');
116 116
 		}
117 117
 
118
-		$tabs['advanced']    = esc_html__( 'Advanced', 'give' );
119
-		$tabs['api']         = esc_html__( 'API', 'give' );
120
-		$tabs['system_info'] = esc_html__( 'System Info', 'give' );
118
+		$tabs['advanced']    = esc_html__('Advanced', 'give');
119
+		$tabs['api']         = esc_html__('API', 'give');
120
+		$tabs['system_info'] = esc_html__('System Info', 'give');
121 121
 
122
-		return apply_filters( 'give_settings_tabs', $tabs );
122
+		return apply_filters('give_settings_tabs', $tabs);
123 123
 	}
124 124
 
125 125
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function admin_page_display() {
131 131
 
132
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
132
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
133 133
 
134 134
 		?>
135 135
 
@@ -139,22 +139,22 @@  discard block
 block discarded – undo
139 139
 
140 140
 			<h2 class="nav-tab-wrapper">
141 141
 				<?php
142
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
142
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
143 143
 
144
-					$tab_url = esc_url( add_query_arg( array(
144
+					$tab_url = esc_url(add_query_arg(array(
145 145
 						'settings-updated' => false,
146 146
 						'tab'              => $tab_id
147
-					) ) );
147
+					)));
148 148
 
149 149
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
150 150
 
151
-					echo '<a href="' . esc_url( $tab_url ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
151
+					echo '<a href="'.esc_url($tab_url).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
152 152
 
153 153
 				}
154 154
 				?>
155 155
 			</h2>
156 156
 
157
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
157
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
158 158
 
159 159
 		</div><!-- .wrap -->
160 160
 
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 	 *
177 177
 	 * @return string
178 178
 	 */
179
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
179
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
180 180
 
181 181
 		//only modify the give settings form
182
-		if ( 'give_settings' == $object_id ) {
182
+		if ('give_settings' == $object_id) {
183 183
 
184
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
184
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div></form>';
185 185
 
186 186
 		}
187 187
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 *
199 199
 	 * @return array
200 200
 	 */
201
-	public function give_settings( $active_tab ) {
201
+	public function give_settings($active_tab) {
202 202
 
203 203
 		$give_settings = array(
204 204
 			/**
@@ -206,99 +206,99 @@  discard block
 block discarded – undo
206 206
 			 */
207 207
 			'general'     => array(
208 208
 				'id'         => 'general_settings',
209
-				'give_title' => esc_html__( 'General Settings', 'give' ),
210
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
211
-				'fields'     => apply_filters( 'give_settings_general', array(
209
+				'give_title' => esc_html__('General Settings', 'give'),
210
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
211
+				'fields'     => apply_filters('give_settings_general', array(
212 212
 						array(
213
-							'name' => esc_html__( 'General Settings', 'give' ),
213
+							'name' => esc_html__('General Settings', 'give'),
214 214
 							'desc' => '',
215 215
 							'type' => 'give_title',
216 216
 							'id'   => 'give_title_general_settings_1'
217 217
 						),
218 218
 						array(
219
-							'name'    => esc_html__( 'Success Page', 'give' ),
219
+							'name'    => esc_html__('Success Page', 'give'),
220 220
 							/* translators: %s: [give_receipt] */
221
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
221
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
222 222
 							'id'      => 'success_page',
223 223
 							'type'    => 'select',
224
-							'options' => give_cmb2_get_post_options( array(
224
+							'options' => give_cmb2_get_post_options(array(
225 225
 								'post_type'   => 'page',
226
-								'numberposts' => - 1
227
-							) ),
226
+								'numberposts' => -1
227
+							)),
228 228
 						),
229 229
 						array(
230
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
231
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
230
+							'name'    => esc_html__('Failed Donation Page', 'give'),
231
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
232 232
 							'id'      => 'failure_page',
233 233
 							'type'    => 'select',
234
-							'options' => give_cmb2_get_post_options( array(
234
+							'options' => give_cmb2_get_post_options(array(
235 235
 								'post_type'   => 'page',
236
-								'numberposts' => - 1
237
-							) ),
236
+								'numberposts' => -1
237
+							)),
238 238
 						),
239 239
 						array(
240
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
240
+							'name'    => esc_html__('Donation History Page', 'give'),
241 241
 							/* translators: %s: [donation_history] */
242
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
242
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
243 243
 							'id'      => 'history_page',
244 244
 							'type'    => 'select',
245
-							'options' => give_cmb2_get_post_options( array(
245
+							'options' => give_cmb2_get_post_options(array(
246 246
 								'post_type'   => 'page',
247
-								'numberposts' => - 1
248
-							) ),
247
+								'numberposts' => -1
248
+							)),
249 249
 						),
250 250
 						array(
251
-							'name'    => esc_html__( 'Base Country', 'give' ),
252
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
251
+							'name'    => esc_html__('Base Country', 'give'),
252
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
253 253
 							'id'      => 'base_country',
254 254
 							'type'    => 'select',
255 255
 							'options' => give_get_country_list(),
256 256
 						),
257 257
 						array(
258
-							'name' => esc_html__( 'Currency Settings', 'give' ),
258
+							'name' => esc_html__('Currency Settings', 'give'),
259 259
 							'desc' => '',
260 260
 							'type' => 'give_title',
261 261
 							'id'   => 'give_title_general_settings_2'
262 262
 						),
263 263
 						array(
264
-							'name'    => esc_html__( 'Currency', 'give' ),
265
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
264
+							'name'    => esc_html__('Currency', 'give'),
265
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
266 266
 							'id'      => 'currency',
267 267
 							'type'    => 'select',
268 268
 							'options' => give_get_currencies(),
269 269
 							'default' => 'USD',
270 270
 						),
271 271
 						array(
272
-							'name'    => esc_html__( 'Currency Position', 'give' ),
273
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
272
+							'name'    => esc_html__('Currency Position', 'give'),
273
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
274 274
 							'id'      => 'currency_position',
275 275
 							'type'    => 'select',
276 276
 							'options' => array(
277 277
 								/* translators: %s: currency symbol */
278
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
278
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
279 279
 								/* translators: %s: currency symbol */
280
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
280
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
281 281
 							),
282 282
 							'default' => 'before',
283 283
 						),
284 284
 						array(
285
-							'name'            => esc_html__( 'Thousands Separator', 'give' ),
286
-							'desc'            => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
285
+							'name'            => esc_html__('Thousands Separator', 'give'),
286
+							'desc'            => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
287 287
 							'id'              => 'thousands_separator',
288 288
 							'type'            => 'text_small',
289 289
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
290 290
 							'default'         => ',',
291 291
 						),
292 292
 						array(
293
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
294
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
293
+							'name'    => esc_html__('Decimal Separator', 'give'),
294
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
295 295
 							'id'      => 'decimal_separator',
296 296
 							'type'    => 'text_small',
297 297
 							'default' => '.',
298 298
 						),
299 299
 						array(
300
-							'name'            => esc_html__( 'Number of Decimals', 'give' ),
301
-							'desc'            => esc_html__( 'The number of decimal points displayed in amounts.', 'give' ),
300
+							'name'            => esc_html__('Number of Decimals', 'give'),
301
+							'desc'            => esc_html__('The number of decimal points displayed in amounts.', 'give'),
302 302
 							'id'              => 'number_decimals',
303 303
 							'type'            => 'text_small',
304 304
 							'default'         => 2,
@@ -312,83 +312,83 @@  discard block
 block discarded – undo
312 312
 			 */
313 313
 			'gateways'    => array(
314 314
 				'id'         => 'payment_gateways',
315
-				'give_title' => esc_html__( 'Payment Gateways', 'give' ),
316
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
317
-				'fields'     => apply_filters( 'give_settings_gateways', array(
315
+				'give_title' => esc_html__('Payment Gateways', 'give'),
316
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
317
+				'fields'     => apply_filters('give_settings_gateways', array(
318 318
 						array(
319
-							'name' => esc_html__( 'Gateways Settings', 'give' ),
319
+							'name' => esc_html__('Gateways Settings', 'give'),
320 320
 							'desc' => '',
321 321
 							'id'   => 'give_title_gateway_settings_1',
322 322
 							'type' => 'give_title'
323 323
 						),
324 324
 						array(
325
-							'name' => esc_html__( 'Test Mode', 'give' ),
326
-							'desc' => esc_html__( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
325
+							'name' => esc_html__('Test Mode', 'give'),
326
+							'desc' => esc_html__('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
327 327
 							'id'   => 'test_mode',
328 328
 							'type' => 'checkbox'
329 329
 						),
330 330
 						array(
331
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
332
-							'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
331
+							'name' => esc_html__('Enabled Gateways', 'give'),
332
+							'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'),
333 333
 							'id'   => 'gateways',
334 334
 							'type' => 'enabled_gateways'
335 335
 						),
336 336
 						array(
337
-							'name' => esc_html__( 'Default Gateway', 'give' ),
338
-							'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ),
337
+							'name' => esc_html__('Default Gateway', 'give'),
338
+							'desc' => esc_html__('The gateway that will be selected by default.', 'give'),
339 339
 							'id'   => 'default_gateway',
340 340
 							'type' => 'default_gateway'
341 341
 						),
342 342
 						array(
343
-							'name' => esc_html__( 'PayPal Standard', 'give' ),
343
+							'name' => esc_html__('PayPal Standard', 'give'),
344 344
 							'desc' => '',
345 345
 							'type' => 'give_title',
346 346
 							'id'   => 'give_title_gateway_settings_2',
347 347
 						),
348 348
 						array(
349
-							'name' => esc_html__( 'PayPal Email', 'give' ),
350
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
349
+							'name' => esc_html__('PayPal Email', 'give'),
350
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
351 351
 							'id'   => 'paypal_email',
352 352
 							'type' => 'text_email',
353 353
 						),
354 354
 						array(
355
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
356
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
355
+							'name' => esc_html__('PayPal Page Style', 'give'),
356
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
357 357
 							'id'   => 'paypal_page_style',
358 358
 							'type' => 'text',
359 359
 						),
360 360
 						array(
361
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
362
-							'desc'    => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
361
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
362
+							'desc'    => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
363 363
 							'id'      => 'paypal_button_type',
364 364
 							'type'    => 'radio_inline',
365 365
 							'options' => array(
366
-								'donation' => esc_html__( 'Donation', 'give' ),
367
-								'standard' => esc_html__( 'Standard Transaction', 'give' )
366
+								'donation' => esc_html__('Donation', 'give'),
367
+								'standard' => esc_html__('Standard Transaction', 'give')
368 368
 							),
369 369
 							'default' => 'donation',
370 370
 						),
371 371
 						array(
372
-							'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ),
373
-							'desc' => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
372
+							'name' => esc_html__('Disable PayPal IPN Verification', 'give'),
373
+							'desc' => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
374 374
 							'id'   => 'disable_paypal_verification',
375 375
 							'type' => 'checkbox'
376 376
 						),
377 377
 						array(
378
-							'name' => esc_html__( 'Offline Donations', 'give' ),
378
+							'name' => esc_html__('Offline Donations', 'give'),
379 379
 							'desc' => '',
380 380
 							'type' => 'give_title',
381 381
 							'id'   => 'give_title_gateway_settings_3',
382 382
 						),
383 383
 						array(
384
-							'name' => esc_html__( 'Collect Billing Details', 'give' ),
385
-							'desc' => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
384
+							'name' => esc_html__('Collect Billing Details', 'give'),
385
+							'desc' => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
386 386
 							'id'   => 'give_offline_donation_enable_billing_fields',
387 387
 							'type' => 'checkbox'
388 388
 						),
389 389
 						array(
390
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
391
-							'desc'    => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
390
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
391
+							'desc'    => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
392 392
 							'id'      => 'global_offline_donation_content',
393 393
 							'default' => give_get_default_offline_donation_content(),
394 394
 							'type'    => 'wysiwyg',
@@ -397,15 +397,15 @@  discard block
 block discarded – undo
397 397
 							)
398 398
 						),
399 399
 						array(
400
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
401
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
400
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
401
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
402 402
 							'id'      => 'offline_donation_subject',
403
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
403
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
404 404
 							'type'    => 'text'
405 405
 						),
406 406
 						array(
407
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
408
-							'desc'    => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
407
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
408
+							'desc'    => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
409 409
 							'id'      => 'global_offline_donation_email',
410 410
 							'default' => give_get_default_offline_donation_email_content(),
411 411
 							'type'    => 'wysiwyg',
@@ -419,95 +419,95 @@  discard block
 block discarded – undo
419 419
 			/** Display Settings */
420 420
 			'display'     => array(
421 421
 				'id'         => 'display_settings',
422
-				'give_title' => esc_html__( 'Display Settings', 'give' ),
423
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
424
-				'fields'     => apply_filters( 'give_settings_display', array(
422
+				'give_title' => esc_html__('Display Settings', 'give'),
423
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
424
+				'fields'     => apply_filters('give_settings_display', array(
425 425
 						array(
426
-							'name' => esc_html__( 'Display Settings', 'give' ),
426
+							'name' => esc_html__('Display Settings', 'give'),
427 427
 							'desc' => '',
428 428
 							'id'   => 'give_title_display_settings_1',
429 429
 							'type' => 'give_title'
430 430
 						),
431 431
 						array(
432
-							'name' => esc_html__( 'Disable CSS', 'give' ),
433
-							'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
432
+							'name' => esc_html__('Disable CSS', 'give'),
433
+							'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
434 434
 							'id'   => 'disable_css',
435 435
 							'type' => 'checkbox'
436 436
 						),
437 437
 						array(
438
-							'name' => esc_html__( 'Enable Floating Labels', 'give' ),
438
+							'name' => esc_html__('Enable Floating Labels', 'give'),
439 439
 							/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
440
-							'desc' => sprintf( wp_kses( __( 'Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
440
+							'desc' => sprintf(wp_kses(__('Enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
441 441
 							'id'   => 'enable_floatlabels',
442 442
 							'type' => 'checkbox'
443 443
 						),
444 444
 						array(
445
-							'name' => esc_html__( 'Disable Welcome Screen', 'give' ),
445
+							'name' => esc_html__('Disable Welcome Screen', 'give'),
446 446
 							/* translators: %s: about page URL */
447
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
447
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> every time Give is activated and/or updated.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('index.php?page=give-about'))),
448 448
 							'id'   => 'disable_welcome',
449 449
 							'type' => 'checkbox'
450 450
 						),
451 451
 						array(
452
-							'name' => esc_html__( 'Post Types', 'give' ),
452
+							'name' => esc_html__('Post Types', 'give'),
453 453
 							'desc' => '',
454 454
 							'id'   => 'give_title_display_settings_2',
455 455
 							'type' => 'give_title'
456 456
 						),
457 457
 						array(
458
-							'name' => esc_html__( 'Disable Form Single Views', 'give' ),
459
-							'desc' => esc_html__( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
458
+							'name' => esc_html__('Disable Form Single Views', 'give'),
459
+							'desc' => esc_html__('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
460 460
 							'id'   => 'disable_forms_singular',
461 461
 							'type' => 'checkbox'
462 462
 						),
463 463
 						array(
464
-							'name' => esc_html__( 'Disable Form Archives', 'give' ),
465
-							'desc' => esc_html__( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
464
+							'name' => esc_html__('Disable Form Archives', 'give'),
465
+							'desc' => esc_html__('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
466 466
 							'id'   => 'disable_forms_archives',
467 467
 							'type' => 'checkbox'
468 468
 						),
469 469
 						array(
470
-							'name' => esc_html__( 'Disable Form Excerpts', 'give' ),
471
-							'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
470
+							'name' => esc_html__('Disable Form Excerpts', 'give'),
471
+							'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
472 472
 							'id'   => 'disable_forms_excerpt',
473 473
 							'type' => 'checkbox'
474 474
 						),
475 475
 
476 476
 						array(
477
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
478
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give' ),
477
+							'name'    => esc_html__('Featured Image Size', 'give'),
478
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give'),
479 479
 							'id'      => 'featured_image_size',
480 480
 							'type'    => 'select',
481 481
 							'default' => 'large',
482 482
 							'options' => give_get_featured_image_sizes()
483 483
 						),
484 484
 						array(
485
-							'name' => esc_html__( 'Disable Form Featured Image', 'give' ),
486
-							'desc' => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
485
+							'name' => esc_html__('Disable Form Featured Image', 'give'),
486
+							'desc' => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
487 487
 							'id'   => 'disable_form_featured_img',
488 488
 							'type' => 'checkbox'
489 489
 						),
490 490
 						array(
491
-							'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ),
492
-							'desc' => esc_html__( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
491
+							'name' => esc_html__('Disable Single Form Sidebar', 'give'),
492
+							'desc' => esc_html__('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
493 493
 							'id'   => 'disable_form_sidebar',
494 494
 							'type' => 'checkbox'
495 495
 						),
496 496
 						array(
497
-							'name' => esc_html__( 'Taxonomies', 'give' ),
497
+							'name' => esc_html__('Taxonomies', 'give'),
498 498
 							'desc' => '',
499 499
 							'id'   => 'give_title_display_settings_3',
500 500
 							'type' => 'give_title'
501 501
 						),
502 502
 						array(
503
-							'name' => esc_html__( 'Enable Form Categories', 'give' ),
504
-							'desc' => esc_html__( 'Enables the "Category" taxonomy for all Give forms.', 'give' ),
503
+							'name' => esc_html__('Enable Form Categories', 'give'),
504
+							'desc' => esc_html__('Enables the "Category" taxonomy for all Give forms.', 'give'),
505 505
 							'id'   => 'enable_categories',
506 506
 							'type' => 'checkbox'
507 507
 						),
508 508
 						array(
509
-							'name' => esc_html__( 'Enable Form Tags', 'give' ),
510
-							'desc' => esc_html__( 'Enables the "Tag" taxonomy for all Give forms.', 'give' ),
509
+							'name' => esc_html__('Enable Form Tags', 'give'),
510
+							'desc' => esc_html__('Enables the "Tag" taxonomy for all Give forms.', 'give'),
511 511
 							'id'   => 'enable_tags',
512 512
 							'type' => 'checkbox'
513 513
 						),
@@ -541,85 +541,85 @@  discard block
 block discarded – undo
541 541
 			 */
542 542
 			'emails'      => array(
543 543
 				'id'         => 'email_settings',
544
-				'give_title' => esc_html__( 'Email Settings', 'give' ),
545
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
546
-				'fields'     => apply_filters( 'give_settings_emails', array(
544
+				'give_title' => esc_html__('Email Settings', 'give'),
545
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
546
+				'fields'     => apply_filters('give_settings_emails', array(
547 547
 						array(
548
-							'name' => esc_html__( 'Email Settings', 'give' ),
548
+							'name' => esc_html__('Email Settings', 'give'),
549 549
 							'desc' => '',
550 550
 							'id'   => 'give_title_email_settings_1',
551 551
 							'type' => 'give_title'
552 552
 						),
553 553
 						array(
554 554
 							'id'      => 'email_template',
555
-							'name'    => esc_html__( 'Email Template', 'give' ),
556
-							'desc'    => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
555
+							'name'    => esc_html__('Email Template', 'give'),
556
+							'desc'    => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
557 557
 							'type'    => 'select',
558 558
 							'options' => give_get_email_templates()
559 559
 						),
560 560
 						array(
561 561
 							'id'   => 'email_logo',
562
-							'name' => esc_html__( 'Logo', 'give' ),
563
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
562
+							'name' => esc_html__('Logo', 'give'),
563
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
564 564
 							'type' => 'file'
565 565
 						),
566 566
 						array(
567 567
 							'id'      => 'from_name',
568
-							'name'    => esc_html__( 'From Name', 'give' ),
569
-							'desc'    => esc_html__( 'The name which appears in the "From" field in donation receipt emails.', 'give' ),
570
-							'default' => get_bloginfo( 'name' ),
568
+							'name'    => esc_html__('From Name', 'give'),
569
+							'desc'    => esc_html__('The name which appears in the "From" field in donation receipt emails.', 'give'),
570
+							'default' => get_bloginfo('name'),
571 571
 							'type'    => 'text'
572 572
 						),
573 573
 						array(
574 574
 							'id'      => 'from_email',
575
-							'name'    => esc_html__( 'From Email', 'give' ),
576
-							'desc'    => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
577
-							'default' => get_bloginfo( 'admin_email' ),
575
+							'name'    => esc_html__('From Email', 'give'),
576
+							'desc'    => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
577
+							'default' => get_bloginfo('admin_email'),
578 578
 							'type'    => 'text'
579 579
 						),
580 580
 						array(
581
-							'name' => esc_html__( 'Donation Receipt', 'give' ),
581
+							'name' => esc_html__('Donation Receipt', 'give'),
582 582
 							'desc' => '',
583 583
 							'id'   => 'give_title_email_settings_2',
584 584
 							'type' => 'give_title'
585 585
 						),
586 586
 						array(
587 587
 							'id'      => 'donation_subject',
588
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
589
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
590
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
588
+							'name'    => esc_html__('Donation Email Subject', 'give'),
589
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
590
+							'default' => esc_attr__('Donation Receipt', 'give'),
591 591
 							'type'    => 'text'
592 592
 						),
593 593
 						array(
594 594
 							'id'      => 'donation_receipt',
595
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
595
+							'name'    => esc_html__('Donation Receipt', 'give'),
596 596
 							'desc'    => sprintf(
597 597
 								/* translators: %s: emails tags list */
598
-								esc_html__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ),
598
+								esc_html__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'),
599 599
 								'<br/>'.give_get_emails_tags_list()
600 600
 							),
601 601
 							'type'    => 'wysiwyg',
602 602
 							'default' => give_get_default_donation_receipt_email()
603 603
 						),
604 604
 						array(
605
-							'name' => esc_html__( 'New Donation Notification', 'give' ),
605
+							'name' => esc_html__('New Donation Notification', 'give'),
606 606
 							'desc' => '',
607 607
 							'id'   => 'give_title_email_settings_3',
608 608
 							'type' => 'give_title'
609 609
 						),
610 610
 						array(
611 611
 							'id'      => 'donation_notification_subject',
612
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
613
-							'desc'    => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ),
612
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
613
+							'desc'    => esc_html__('Enter the subject line for the donation notification email.', 'give'),
614 614
 							'type'    => 'text',
615
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
615
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
616 616
 						),
617 617
 						array(
618 618
 							'id'      => 'donation_notification',
619
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
619
+							'name'    => esc_html__('Donation Notification', 'give'),
620 620
 							'desc'    => sprintf(
621 621
 								/* translators: %s: emails tags list */
622
-								esc_html__( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ),
622
+								esc_html__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'),
623 623
 								'<br/>'.give_get_emails_tags_list()
624 624
 							),
625 625
 							'type'    => 'wysiwyg',
@@ -627,15 +627,15 @@  discard block
 block discarded – undo
627 627
 						),
628 628
 						array(
629 629
 							'id'      => 'admin_notice_emails',
630
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
631
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
630
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
631
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
632 632
 							'type'    => 'textarea',
633
-							'default' => get_bloginfo( 'admin_email' )
633
+							'default' => get_bloginfo('admin_email')
634 634
 						),
635 635
 						array(
636 636
 							'id'   => 'disable_admin_notices',
637
-							'name' => esc_html__( 'Disable Admin Notifications', 'give' ),
638
-							'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
637
+							'name' => esc_html__('Disable Admin Notifications', 'give'),
638
+							'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'),
639 639
 							'type' => 'checkbox'
640 640
 						)
641 641
 					)
@@ -644,99 +644,99 @@  discard block
 block discarded – undo
644 644
 			/** Extension Settings */
645 645
 			'addons'      => array(
646 646
 				'id'         => 'addons',
647
-				'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ),
648
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
649
-				'fields'     => apply_filters( 'give_settings_addons', array()
647
+				'give_title' => esc_html__('Give Add-ons Settings', 'give'),
648
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
649
+				'fields'     => apply_filters('give_settings_addons', array()
650 650
 				)
651 651
 			),
652 652
 			/** Licenses Settings */
653 653
 			'licenses'    => array(
654 654
 				'id'         => 'licenses',
655
-				'give_title' => esc_html__( 'Give Licenses', 'give' ),
656
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
657
-				'fields'     => apply_filters( 'give_settings_licenses', array()
655
+				'give_title' => esc_html__('Give Licenses', 'give'),
656
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
657
+				'fields'     => apply_filters('give_settings_licenses', array()
658 658
 				)
659 659
 			),
660 660
 			/** Advanced Options */
661 661
 			'advanced'    => array(
662 662
 				'id'         => 'advanced_options',
663
-				'give_title' => esc_html__( 'Advanced Options', 'give' ),
664
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
665
-				'fields'     => apply_filters( 'give_settings_advanced', array(
663
+				'give_title' => esc_html__('Advanced Options', 'give'),
664
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
665
+				'fields'     => apply_filters('give_settings_advanced', array(
666 666
 						array(
667
-							'name' => esc_html__( 'Access Control', 'give' ),
667
+							'name' => esc_html__('Access Control', 'give'),
668 668
 							'desc' => '',
669 669
 							'id'   => 'give_title_session_control_1',
670 670
 							'type' => 'give_title'
671 671
 						),
672 672
 						array(
673 673
 							'id'      => 'session_lifetime',
674
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
675
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
674
+							'name'    => esc_html__('Session Lifetime', 'give'),
675
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
676 676
 							'type'    => 'select',
677 677
 							'options' => array(
678
-								'86400'  => esc_html__( '24 Hours', 'give' ),
679
-								'172800' => esc_html__( '48 Hours', 'give' ),
680
-								'259200' => esc_html__( '72 Hours', 'give' ),
681
-								'604800' => esc_html__( '1 Week', 'give' ),
678
+								'86400'  => esc_html__('24 Hours', 'give'),
679
+								'172800' => esc_html__('48 Hours', 'give'),
680
+								'259200' => esc_html__('72 Hours', 'give'),
681
+								'604800' => esc_html__('1 Week', 'give'),
682 682
 							)
683 683
 						),
684 684
 						array(
685
-							'name' => esc_html__( 'Email Access', 'give' ),
686
-							'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
685
+							'name' => esc_html__('Email Access', 'give'),
686
+							'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
687 687
 							'id'   => 'email_access',
688 688
 							'type' => 'checkbox',
689 689
 						),
690 690
 						array(
691 691
 							'id'      => 'recaptcha_key',
692
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
692
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
693 693
 							/* translators: %s: https://www.google.com/recaptcha/ */
694
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
694
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
695 695
 							'default' => '',
696 696
 							'type'    => 'text'
697 697
 						),
698 698
 						array(
699 699
 							'id'      => 'recaptcha_secret',
700
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
701
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
700
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
701
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
702 702
 							'default' => '',
703 703
 							'type'    => 'text'
704 704
 						),
705 705
 						array(
706
-							'name' => esc_html__( 'Data Control', 'give' ),
706
+							'name' => esc_html__('Data Control', 'give'),
707 707
 							'desc' => '',
708 708
 							'id'   => 'give_title_data_control_2',
709 709
 							'type' => 'give_title'
710 710
 						),
711 711
 						array(
712
-							'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ),
713
-							'desc' => esc_html__( 'When the plugin is deleted, completely remove all Give data.', 'give' ),
712
+							'name' => esc_html__('Remove All Data on Uninstall?', 'give'),
713
+							'desc' => esc_html__('When the plugin is deleted, completely remove all Give data.', 'give'),
714 714
 							'id'   => 'uninstall_on_delete',
715 715
 							'type' => 'checkbox'
716 716
 						),
717 717
 						array(
718
-							'name' => esc_html__( 'Filter Control', 'give' ),
718
+							'name' => esc_html__('Filter Control', 'give'),
719 719
 							'desc' => '',
720 720
 							'id'   => 'give_title_filter_control',
721 721
 							'type' => 'give_title'
722 722
 						),
723 723
 						array(
724 724
 							/* translators: %s: the_content */
725
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
725
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
726 726
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
727
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
727
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
728 728
 							'id'   => 'disable_the_content_filter',
729 729
 							'type' => 'checkbox'
730 730
 						),
731 731
 						array(
732
-							'name' => esc_html__( 'Script Loading', 'give' ),
732
+							'name' => esc_html__('Script Loading', 'give'),
733 733
 							'desc' => '',
734 734
 							'id'   => 'give_title_script_control',
735 735
 							'type' => 'give_title'
736 736
 						),
737 737
 						array(
738
-							'name' => esc_html__( 'Load Scripts in Footer?', 'give' ),
739
-							'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
738
+							'name' => esc_html__('Load Scripts in Footer?', 'give'),
739
+							'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
740 740
 							'id'   => 'scripts_footer',
741 741
 							'type' => 'checkbox'
742 742
 						)
@@ -746,13 +746,13 @@  discard block
 block discarded – undo
746 746
 			/** API Settings */
747 747
 			'api'         => array(
748 748
 				'id'         => 'api',
749
-				'give_title' => esc_html__( 'API', 'give' ),
750
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
749
+				'give_title' => esc_html__('API', 'give'),
750
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
751 751
 				'show_names' => false, // Hide field names on the left
752
-				'fields'     => apply_filters( 'give_settings_system', array(
752
+				'fields'     => apply_filters('give_settings_system', array(
753 753
 						array(
754 754
 							'id'   => 'api',
755
-							'name' => esc_html__( 'API', 'give' ),
755
+							'name' => esc_html__('API', 'give'),
756 756
 							'type' => 'api'
757 757
 						)
758 758
 					)
@@ -761,13 +761,13 @@  discard block
 block discarded – undo
761 761
 			/** Licenses Settings */
762 762
 			'system_info' => array(
763 763
 				'id'         => 'system_info',
764
-				'give_title' => esc_html__( 'System Info', 'give' ),
765
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
766
-				'fields'     => apply_filters( 'give_settings_system', array(
764
+				'give_title' => esc_html__('System Info', 'give'),
765
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
766
+				'fields'     => apply_filters('give_settings_system', array(
767 767
 						array(
768 768
 							'id'   => 'system-info-textarea',
769
-							'name' => esc_html__( 'System Info', 'give' ),
770
-							'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
769
+							'name' => esc_html__('System Info', 'give'),
770
+							'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'),
771 771
 							'type' => 'system_info'
772 772
 						)
773 773
 					)
@@ -776,15 +776,15 @@  discard block
 block discarded – undo
776 776
 		);
777 777
 
778 778
 		//Return all settings array if no active tab
779
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
779
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
780 780
 
781
-			return apply_filters( 'give_registered_settings', $give_settings );
781
+			return apply_filters('give_registered_settings', $give_settings);
782 782
 
783 783
 		}
784 784
 
785 785
 
786 786
 		// Add other tabs and settings fields as needed
787
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
787
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
788 788
 
789 789
 	}
790 790
 
@@ -793,11 +793,11 @@  discard block
 block discarded – undo
793 793
 	 */
794 794
 	public function settings_notices() {
795 795
 
796
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
796
+		if ( ! isset($_POST['give_settings_saved'])) {
797 797
 			return;
798 798
 		}
799 799
 
800
-		add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' );
800
+		add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated');
801 801
 
802 802
 	}
803 803
 
@@ -812,17 +812,17 @@  discard block
 block discarded – undo
812 812
 	 * @return mixed         Field value or exception is thrown.
813 813
 	 * @throws Exception     Throws an exception if the field is invalid.
814 814
 	 */
815
-	public function __get( $field ) {
815
+	public function __get($field) {
816 816
 
817 817
 		// Allowed fields to retrieve
818
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
818
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
819 819
 			return $this->{$field};
820 820
 		}
821
-		if ( 'option_metabox' === $field ) {
821
+		if ('option_metabox' === $field) {
822 822
 			return $this->option_metabox();
823 823
 		}
824 824
 
825
-		throw new Exception( sprintf( esc_html__( 'Invalid property: %s', 'give' ), $field ) );
825
+		throw new Exception(sprintf(esc_html__('Invalid property: %s', 'give'), $field));
826 826
 	}
827 827
 
828 828
 
@@ -840,12 +840,12 @@  discard block
 block discarded – undo
840 840
  *
841 841
  * @return mixed        Option value
842 842
  */
843
-function give_get_option( $key = '', $default = false ) {
843
+function give_get_option($key = '', $default = false) {
844 844
 	$give_options = give_get_settings();
845
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
846
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
845
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
846
+	$value = apply_filters('give_get_option', $value, $key, $default);
847 847
 
848
-	return apply_filters( "give_get_option_{$key}", $value, $key, $default );
848
+	return apply_filters("give_get_option_{$key}", $value, $key, $default);
849 849
 }
850 850
 
851 851
 
@@ -865,33 +865,33 @@  discard block
 block discarded – undo
865 865
  *
866 866
  * @return boolean True if updated, false if not.
867 867
  */
868
-function give_update_option( $key = '', $value = false ) {
868
+function give_update_option($key = '', $value = false) {
869 869
 
870 870
 	// If no key, exit
871
-	if ( empty( $key ) ) {
871
+	if (empty($key)) {
872 872
 		return false;
873 873
 	}
874 874
 
875
-	if ( empty( $value ) ) {
876
-		$remove_option = give_delete_option( $key );
875
+	if (empty($value)) {
876
+		$remove_option = give_delete_option($key);
877 877
 
878 878
 		return $remove_option;
879 879
 	}
880 880
 
881 881
 	// First let's grab the current settings
882
-	$options = get_option( 'give_settings' );
882
+	$options = get_option('give_settings');
883 883
 
884 884
 	// Let's let devs alter that value coming in
885
-	$value = apply_filters( 'give_update_option', $value, $key );
885
+	$value = apply_filters('give_update_option', $value, $key);
886 886
 
887 887
 	// Next let's try to update the value
888
-	$options[ $key ] = $value;
889
-	$did_update      = update_option( 'give_settings', $options );
888
+	$options[$key] = $value;
889
+	$did_update      = update_option('give_settings', $options);
890 890
 
891 891
 	// If it updated, let's update the global variable
892
-	if ( $did_update ) {
892
+	if ($did_update) {
893 893
 		global $give_options;
894
-		$give_options[ $key ] = $value;
894
+		$give_options[$key] = $value;
895 895
 	}
896 896
 
897 897
 	return $did_update;
@@ -910,27 +910,27 @@  discard block
 block discarded – undo
910 910
  *
911 911
  * @return boolean True if updated, false if not.
912 912
  */
913
-function give_delete_option( $key = '' ) {
913
+function give_delete_option($key = '') {
914 914
 
915 915
 	// If no key, exit
916
-	if ( empty( $key ) ) {
916
+	if (empty($key)) {
917 917
 		return false;
918 918
 	}
919 919
 
920 920
 	// First let's grab the current settings
921
-	$options = get_option( 'give_settings' );
921
+	$options = get_option('give_settings');
922 922
 
923 923
 	// Next let's try to update the value
924
-	if ( isset( $options[ $key ] ) ) {
924
+	if (isset($options[$key])) {
925 925
 
926
-		unset( $options[ $key ] );
926
+		unset($options[$key]);
927 927
 
928 928
 	}
929 929
 
930
-	$did_update = update_option( 'give_settings', $options );
930
+	$did_update = update_option('give_settings', $options);
931 931
 
932 932
 	// If it updated, let's update the global variable
933
-	if ( $did_update ) {
933
+	if ($did_update) {
934 934
 		global $give_options;
935 935
 		$give_options = $options;
936 936
 	}
@@ -949,9 +949,9 @@  discard block
 block discarded – undo
949 949
  */
950 950
 function give_get_settings() {
951 951
 
952
-	$settings = get_option( 'give_settings' );
952
+	$settings = get_option('give_settings');
953 953
 
954
-	return (array) apply_filters( 'give_get_settings', $settings );
954
+	return (array) apply_filters('give_get_settings', $settings);
955 955
 
956 956
 }
957 957
 
@@ -969,25 +969,25 @@  discard block
 block discarded – undo
969 969
  *
970 970
  * @return array
971 971
  */
972
-function give_settings_array_insert( $array, $position, $insert ) {
973
-	if ( is_int( $position ) ) {
974
-		array_splice( $array, $position, 0, $insert );
972
+function give_settings_array_insert($array, $position, $insert) {
973
+	if (is_int($position)) {
974
+		array_splice($array, $position, 0, $insert);
975 975
 	} else {
976 976
 
977
-		foreach ( $array as $index => $subarray ) {
978
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
977
+		foreach ($array as $index => $subarray) {
978
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
979 979
 				$pos = $index;
980 980
 			}
981 981
 		}
982 982
 
983
-		if ( ! isset( $pos ) ) {
983
+		if ( ! isset($pos)) {
984 984
 			return $array;
985 985
 		}
986 986
 
987 987
 		$array = array_merge(
988
-			array_slice( $array, 0, $pos ),
988
+			array_slice($array, 0, $pos),
989 989
 			$insert,
990
-			array_slice( $array, $pos )
990
+			array_slice($array, $pos)
991 991
 		);
992 992
 	}
993 993
 
@@ -1010,31 +1010,31 @@  discard block
 block discarded – undo
1010 1010
  *
1011 1011
  * @return void
1012 1012
  */
1013
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1013
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1014 1014
 
1015 1015
 	$id                = $field_type_object->field->args['id'];
1016 1016
 	$field_description = $field_type_object->field->args['desc'];
1017
-	$gateways          = give_get_ordered_payment_gateways( give_get_payment_gateways() );
1017
+	$gateways          = give_get_ordered_payment_gateways(give_get_payment_gateways());
1018 1018
 
1019 1019
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
1020 1020
 
1021
-	foreach ( $gateways as $key => $option ) :
1021
+	foreach ($gateways as $key => $option) :
1022 1022
 
1023
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
1023
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
1024 1024
 			$enabled = '1';
1025 1025
 		} else {
1026 1026
 			$enabled = null;
1027 1027
 		}
1028 1028
 
1029
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
1030
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1029
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
1030
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1031 1031
 
1032 1032
 	endforeach;
1033 1033
 
1034 1034
 	echo '</ul>';
1035 1035
 
1036
-	if ( $field_description ) {
1037
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1036
+	if ($field_description) {
1037
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1038 1038
 	}
1039 1039
 
1040 1040
 }
@@ -1050,31 +1050,31 @@  discard block
 block discarded – undo
1050 1050
  *
1051 1051
  * @return void
1052 1052
  */
1053
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1053
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1054 1054
 
1055 1055
 	$id                = $field_type_object->field->args['id'];
1056 1056
 	$field_description = $field_type_object->field->args['desc'];
1057 1057
 	$gateways          = give_get_enabled_payment_gateways();
1058 1058
 
1059
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
1059
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
1060 1060
 
1061 1061
 	//Add a field to the Give Form admin single post view of this field
1062
-	if ( $field_type_object->field->object_type === 'post' ) {
1063
-		echo '<option value="global">' . esc_html__( 'Global Default', 'give' ) . '</option>';
1062
+	if ($field_type_object->field->object_type === 'post') {
1063
+		echo '<option value="global">'.esc_html__('Global Default', 'give').'</option>';
1064 1064
 	}
1065 1065
 
1066
-	foreach ( $gateways as $key => $option ) :
1066
+	foreach ($gateways as $key => $option) :
1067 1067
 
1068
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
1068
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
1069 1069
 
1070 1070
 
1071
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1071
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1072 1072
 
1073 1073
 	endforeach;
1074 1074
 
1075 1075
 	echo '</select>';
1076 1076
 
1077
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1077
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1078 1078
 
1079 1079
 }
1080 1080
 
@@ -1089,13 +1089,13 @@  discard block
 block discarded – undo
1089 1089
  *
1090 1090
  * @return void
1091 1091
  */
1092
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1092
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1093 1093
 
1094 1094
 	$id                = $field_type_object->field->args['id'];
1095 1095
 	$title             = $field_type_object->field->args['name'];
1096 1096
 	$field_description = $field_type_object->field->args['desc'];
1097 1097
 
1098
-	echo '<hr>' . $field_description;
1098
+	echo '<hr>'.$field_description;
1099 1099
 
1100 1100
 }
1101 1101
 
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
  *
1111 1111
  * @return void
1112 1112
  */
1113
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1113
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1114 1114
 
1115 1115
 	$id                = $field_type_object->field->args['id'];
1116 1116
 	$title             = $field_type_object->field->args['name'];
@@ -1130,25 +1130,25 @@  discard block
 block discarded – undo
1130 1130
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1131 1131
  * @return array An array of options that matches the CMB2 options array
1132 1132
  */
1133
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1133
+function give_cmb2_get_post_options($query_args, $force = false) {
1134 1134
 
1135
-	$post_options = array( '' => '' ); // Blank option
1135
+	$post_options = array('' => ''); // Blank option
1136 1136
 
1137
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1137
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1138 1138
 		return $post_options;
1139 1139
 	}
1140 1140
 
1141
-	$args = wp_parse_args( $query_args, array(
1141
+	$args = wp_parse_args($query_args, array(
1142 1142
 		'post_type'   => 'page',
1143 1143
 		'numberposts' => 10,
1144
-	) );
1144
+	));
1145 1145
 
1146
-	$posts = get_posts( $args );
1146
+	$posts = get_posts($args);
1147 1147
 
1148
-	if ( $posts ) {
1149
-		foreach ( $posts as $post ) {
1148
+	if ($posts) {
1149
+		foreach ($posts as $post) {
1150 1150
 
1151
-			$post_options[ $post->ID ] = $post->post_title;
1151
+			$post_options[$post->ID] = $post->post_title;
1152 1152
 
1153 1153
 		}
1154 1154
 	}
@@ -1170,17 +1170,17 @@  discard block
 block discarded – undo
1170 1170
 	global $_wp_additional_image_sizes;
1171 1171
 	$sizes = array();
1172 1172
 
1173
-	foreach ( get_intermediate_image_sizes() as $_size ) {
1173
+	foreach (get_intermediate_image_sizes() as $_size) {
1174 1174
 
1175
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1176
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1177
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1178
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1175
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1176
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1177
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1178
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1179 1179
 		}
1180 1180
 
1181 1181
 	}
1182 1182
 
1183
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1183
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1184 1184
 }
1185 1185
 
1186 1186
 
@@ -1195,18 +1195,18 @@  discard block
 block discarded – undo
1195 1195
  *
1196 1196
  * @return void
1197 1197
  */
1198
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1198
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1199 1199
     /* @var CMB2_Types $field_type_object*/
1200 1200
 
1201 1201
     $id                   = $field_type_object->field->args['id'];
1202 1202
 	$field_description    = $field_type_object->field->args['desc'];
1203 1203
 	$license              = $field_type_object->field->args['options']['license'];
1204 1204
     $license_key          = $escaped_value;
1205
-    $is_license_key       = apply_filters( 'give_is_license_key', ( is_object( $license ) && ! empty( $license ) ) );
1206
-    $is_valid_license     = apply_filters( 'give_is_valid_license', ( $is_license_key && property_exists( $license, 'license' ) && 'valid' === $license->license ) );
1205
+    $is_license_key       = apply_filters('give_is_license_key', (is_object($license) && ! empty($license)));
1206
+    $is_valid_license     = apply_filters('give_is_valid_license', ($is_license_key && property_exists($license, 'license') && 'valid' === $license->license));
1207 1207
     $shortname            = $field_type_object->field->args['options']['shortname'];
1208 1208
 	$field_classes        = 'regular-text give-license-field';
1209
-	$type                 = empty( $escaped_value ) || ! $is_valid_license ? 'text' : 'password';
1209
+	$type                 = empty($escaped_value) || ! $is_valid_license ? 'text' : 'password';
1210 1210
     $custom_html          = '';
1211 1211
     $value                = $escaped_value;
1212 1212
     $messages             = array();
@@ -1219,17 +1219,17 @@  discard block
 block discarded – undo
1219 1219
 
1220 1220
 	// By default query on edd api url will return license object which contain status and message property, this can break below functionality.
1221 1221
 	// To combat that check if status is set to error or not, if yes then set $is_license_key to false.
1222
-	if( $is_license_key && property_exists( $license, 'status' ) && 'error' === $license->status ) {
1222
+	if ($is_license_key && property_exists($license, 'status') && 'error' === $license->status) {
1223 1223
 		$is_license_key = false;
1224 1224
 	}
1225 1225
 
1226 1226
 
1227 1227
     // Check if current license is part of subscription or not.
1228
-    $subscriptions = get_option( 'give_subscriptions' );
1228
+    $subscriptions = get_option('give_subscriptions');
1229 1229
 
1230
-    if( $is_license_key && $subscriptions ) {
1231
-        foreach ( $subscriptions as $subscription ) {
1232
-            if( in_array( $license_key, $subscription['licenses'] ) ) {
1230
+    if ($is_license_key && $subscriptions) {
1231
+        foreach ($subscriptions as $subscription) {
1232
+            if (in_array($license_key, $subscription['licenses'])) {
1233 1233
                 $is_in_subscription = $subscription['id'];
1234 1234
                 break;
1235 1235
             }
@@ -1237,132 +1237,132 @@  discard block
 block discarded – undo
1237 1237
     }
1238 1238
 
1239 1239
 
1240
-    if( $is_license_key ) {
1241
-        if( $is_in_subscription ) {
1242
-            $subscription_expires = strtotime( $subscriptions[$is_in_subscription]['expires'] );
1243
-            $subscription_status  = esc_html__( 'renew', 'give' );
1240
+    if ($is_license_key) {
1241
+        if ($is_in_subscription) {
1242
+            $subscription_expires = strtotime($subscriptions[$is_in_subscription]['expires']);
1243
+            $subscription_status  = esc_html__('renew', 'give');
1244 1244
 
1245
-            if( ( 'active' !== $subscriptions[$is_in_subscription]['status'] ) ){
1246
-                $subscription_status = esc_html__( 'expire', 'give' );
1245
+            if (('active' !== $subscriptions[$is_in_subscription]['status'])) {
1246
+                $subscription_status = esc_html__('expire', 'give');
1247 1247
             }
1248 1248
 
1249
-            if( $subscription_expires < current_time( 'timestamp', 1 ) ) {
1249
+            if ($subscription_expires < current_time('timestamp', 1)) {
1250 1250
                 $messages[] = sprintf(
1251
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) expired. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>', 'give' ),
1252
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1251
+                    __('Your subscription (<a href="%s" target="_blank">#%d</a>) expired. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>', 'give'),
1252
+                    urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1253 1253
                     $subscriptions[$is_in_subscription]['payment_id'],
1254
-                    $checkout_page_link . '?edd_license_key=' . $subscriptions[$is_in_subscription]['license_key'] . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1254
+                    $checkout_page_link.'?edd_license_key='.$subscriptions[$is_in_subscription]['license_key'].'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1255 1255
                 );
1256 1256
                 $license_status = 'license-expired';
1257
-            } elseif( strtotime( '- 7 days', $subscription_expires ) < current_time( 'timestamp', 1 ) ) {
1257
+            } elseif (strtotime('- 7 days', $subscription_expires) < current_time('timestamp', 1)) {
1258 1258
                 $messages[] = sprintf(
1259
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s in %s.', 'give' ),
1260
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1259
+                    __('Your subscription (<a href="%s" target="_blank">#%d</a>) will %s in %s.', 'give'),
1260
+                    urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1261 1261
                     $subscriptions[$is_in_subscription]['payment_id'],
1262 1262
                     $subscription_status,
1263
-                    human_time_diff( current_time( 'timestamp', 1 ), strtotime( $subscriptions[$is_in_subscription]['expires'] ) )
1263
+                    human_time_diff(current_time('timestamp', 1), strtotime($subscriptions[$is_in_subscription]['expires']))
1264 1264
                 );
1265 1265
                 $license_status = 'license-expires-soon';
1266 1266
             } else {
1267 1267
                 $messages[] = sprintf(
1268
-                    __( 'Your subscription (<a href="%s" target="_blank">#%d</a>) will %s on %s.', 'give' ),
1269
-                    urldecode( $subscriptions[$is_in_subscription]['invoice_url'] ),
1268
+                    __('Your subscription (<a href="%s" target="_blank">#%d</a>) will %s on %s.', 'give'),
1269
+                    urldecode($subscriptions[$is_in_subscription]['invoice_url']),
1270 1270
                     $subscriptions[$is_in_subscription]['payment_id'],
1271 1271
                     $subscription_status,
1272
-                    date_i18n( get_option( 'date_format' ), strtotime( $subscriptions[$is_in_subscription]['expires'], current_time( 'timestamp' ) ) )
1272
+                    date_i18n(get_option('date_format'), strtotime($subscriptions[$is_in_subscription]['expires'], current_time('timestamp')))
1273 1273
                 );
1274 1274
                 $license_status = 'license-expiration-date';
1275 1275
             }
1276 1276
 
1277 1277
 
1278
-        } elseif ( empty( $license->success ) && property_exists( $license, 'error' ) ) {
1278
+        } elseif (empty($license->success) && property_exists($license, 'error')) {
1279 1279
 
1280 1280
             // activate_license 'invalid' on anything other than valid, so if there was an error capture it
1281
-            switch(   $license->error ) {
1281
+            switch ($license->error) {
1282 1282
                 case 'expired' :
1283
-					error_log(print_r( $license->error, true) . "\n", 3, WP_CONTENT_DIR . '/debug_new.log');
1283
+					error_log(print_r($license->error, true)."\n", 3, WP_CONTENT_DIR.'/debug_new.log');
1284 1284
                     $class = $license->error;
1285 1285
                     $messages[] = sprintf(
1286
-                        __( 'Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give' ),
1287
-                        date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1288
-                        $checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1286
+                        __('Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'give'),
1287
+                        date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1288
+                        $checkout_page_link.'?edd_license_key='.$value.'&utm_campaign=admin&utm_source=licenses&utm_medium=expired'
1289 1289
                     );
1290
-                    $license_status = 'license-' . $class;
1290
+                    $license_status = 'license-'.$class;
1291 1291
                     break;
1292 1292
 
1293 1293
                 case 'missing' :
1294 1294
                     $class = $license->error;
1295 1295
                     $messages[] = sprintf(
1296
-                        __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give' ),
1297
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1296
+                        __('Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'give'),
1297
+                        $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=missing'
1298 1298
                     );
1299
-                    $license_status = 'license-' . $class;
1299
+                    $license_status = 'license-'.$class;
1300 1300
                     break;
1301 1301
 
1302 1302
                 case 'invalid' :
1303 1303
                     $class = $license->error;
1304 1304
                     $messages[] = sprintf(
1305
-                        __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1305
+                        __('Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1306 1306
                         $addon_name,
1307
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1307
+                        $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1308 1308
                     );
1309
-                    $license_status = 'license-' . $class;
1309
+                    $license_status = 'license-'.$class;
1310 1310
                     break;
1311 1311
 
1312 1312
                 case 'site_inactive' :
1313 1313
                     $class = $license->error;
1314 1314
                     $messages[] = sprintf(
1315
-                        __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give' ),
1315
+                        __('Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'give'),
1316 1316
                         $addon_name,
1317
-                        $account_page_link . '?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1317
+                        $account_page_link.'?utm_campaign=admin&utm_source=licenses&utm_medium=invalid'
1318 1318
                     );
1319
-                    $license_status = 'license-' . $class;
1319
+                    $license_status = 'license-'.$class;
1320 1320
                     break;
1321 1321
 
1322 1322
                 case 'item_name_mismatch' :
1323 1323
                     $class = $license->error;
1324
-                    $messages[] = sprintf( __( 'This license %s does not belong to %s.', 'give' ), $value, $addon_name );
1325
-                    $license_status = 'license-' . $class;
1324
+                    $messages[] = sprintf(__('This license %s does not belong to %s.', 'give'), $value, $addon_name);
1325
+                    $license_status = 'license-'.$class;
1326 1326
                     break;
1327 1327
 
1328 1328
                 case 'no_activations_left':
1329 1329
                     $class = $license->error;
1330
-                    $messages[] = sprintf( __( 'Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give' ), $account_page_link );
1331
-                    $license_status = 'license-' . $class;
1330
+                    $messages[] = sprintf(__('Your license key has reached it\'s activation limit. <a href="%s">View possible upgrades</a> now.', 'give'), $account_page_link);
1331
+                    $license_status = 'license-'.$class;
1332 1332
                     break;
1333 1333
             }
1334 1334
         } else {
1335
-            switch( $license->license ) {
1335
+            switch ($license->license) {
1336 1336
                 case 'valid' :
1337 1337
                 default:
1338 1338
                     $class = 'valid';
1339
-                    $now        = current_time( 'timestamp' );
1340
-                    $expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1339
+                    $now        = current_time('timestamp');
1340
+                    $expiration = strtotime($license->expires, current_time('timestamp'));
1341 1341
 
1342
-                    if( 'lifetime' === $license->expires ) {
1343
-                        $messages[] = esc_html__( 'License key never expires.', 'give' );
1342
+                    if ('lifetime' === $license->expires) {
1343
+                        $messages[] = esc_html__('License key never expires.', 'give');
1344 1344
                         $license_status = 'license-lifetime-notice';
1345
-                    } elseif( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1345
+                    } elseif ($expiration > $now && $expiration - $now < (DAY_IN_SECONDS * 30)) {
1346 1346
                         $messages[] = sprintf(
1347
-                            __( 'Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'give' ),
1348
-                            date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ),
1349
-                            $checkout_page_link . '?edd_license_key=' . $value . '&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1347
+                            __('Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'give'),
1348
+                            date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp'))),
1349
+                            $checkout_page_link.'?edd_license_key='.$value.'&utm_campaign=admin&utm_source=licenses&utm_medium=renew'
1350 1350
                         );
1351 1351
                         $license_status = 'license-expires-soon';
1352 1352
                     } else {
1353 1353
                         $messages[] = sprintf(
1354
-                            __( 'Your license key expires on %s.', 'give' ),
1355
-                            date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1354
+                            __('Your license key expires on %s.', 'give'),
1355
+                            date_i18n(get_option('date_format'), strtotime($license->expires, current_time('timestamp')))
1356 1356
                         );
1357 1357
                         $license_status = 'license-expiration-date';
1358 1358
                     }
1359 1359
                     break;
1360 1360
             }
1361 1361
         }
1362
-    } else{
1362
+    } else {
1363 1363
 		$class = 'empty';
1364 1364
 		$messages[] = sprintf(
1365
-			__( 'To receive updates, please enter your valid %s license key.', 'give' ),
1365
+			__('To receive updates, please enter your valid %s license key.', 'give'),
1366 1366
 			$addon_name
1367 1367
 		);
1368 1368
 		$license_status = null;
@@ -1370,52 +1370,52 @@  discard block
 block discarded – undo
1370 1370
 
1371 1371
 
1372 1372
     // Add class for input field if license is active.
1373
-	if ( $is_valid_license ) {
1373
+	if ($is_valid_license) {
1374 1374
 		$field_classes .= ' give-license-active';
1375 1375
 	}
1376 1376
 
1377 1377
 	// Get input filed html.
1378
-	$input_field_html = $field_type_object->input( array(
1378
+	$input_field_html = $field_type_object->input(array(
1379 1379
 		'class' => $field_classes,
1380 1380
 		'type'  => $type
1381
-	) );
1381
+	));
1382 1382
 
1383 1383
 	// If license is active so show deactivate button
1384
-	if ( $is_valid_license ) {
1384
+	if ($is_valid_license) {
1385 1385
         // Get input filed html.
1386
-        $input_field_html = $field_type_object->input( array(
1386
+        $input_field_html = $field_type_object->input(array(
1387 1387
             'class' => $field_classes,
1388 1388
             'type'  => $type,
1389 1389
             'readonly' => 'readonly',
1390
-        ) );
1390
+        ));
1391 1391
 
1392
-		$custom_html = '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1392
+		$custom_html = '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1393 1393
 	}
1394 1394
 
1395 1395
 	// Field description.
1396
-	$custom_html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1396
+	$custom_html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1397 1397
 
1398 1398
     // If no messages found then inform user that to get updated in future register yourself.
1399
-    if ( empty( $messages ) ) {
1400
-        $messages[] = apply_filters( "{$shortname}_default_addon_notice", esc_html__( 'To receive updates, please enter your valid Software Licensing license key.', 'give' ) );
1399
+    if (empty($messages)) {
1400
+        $messages[] = apply_filters("{$shortname}_default_addon_notice", esc_html__('To receive updates, please enter your valid Software Licensing license key.', 'give'));
1401 1401
     }
1402 1402
 
1403
-    foreach( $messages as $message ) {
1404
-        $custom_html .= '<div class="give-license-notice give-' . $license_status . '">';
1405
-        $custom_html .= '<p>' . $message . '</p>';
1403
+    foreach ($messages as $message) {
1404
+        $custom_html .= '<div class="give-license-notice give-'.$license_status.'">';
1405
+        $custom_html .= '<p>'.$message.'</p>';
1406 1406
         $custom_html .= '</div>';
1407 1407
     }
1408 1408
 
1409 1409
 
1410 1410
 
1411 1411
     // Field html.
1412
-    $custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object );
1412
+    $custom_html = apply_filters('give_license_key_field_html', $input_field_html.$custom_html, $field_type_object);
1413 1413
 
1414 1414
     // Nonce.
1415
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1415
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1416 1416
 
1417 1417
     // Print field html.
1418
-    echo '<div>' . $custom_html . '</div>';
1418
+    echo '<div>'.$custom_html.'</div>';
1419 1419
 }
1420 1420
 
1421 1421
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
  */
1428 1428
 function give_api_callback() {
1429 1429
 
1430
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1430
+	if ( ! current_user_can('manage_give_settings')) {
1431 1431
 		return;
1432 1432
 	}
1433 1433
 
@@ -1436,9 +1436,9 @@  discard block
 block discarded – undo
1436 1436
 	 *
1437 1437
 	 * @since 1.0
1438 1438
 	 */
1439
-	do_action( 'give_tools_api_keys_before' );
1439
+	do_action('give_tools_api_keys_before');
1440 1440
 
1441
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1441
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1442 1442
 
1443 1443
 	$api_keys_table = new Give_API_Keys_Table();
1444 1444
 	$api_keys_table->prepare_items();
@@ -1447,9 +1447,9 @@  discard block
 block discarded – undo
1447 1447
 	<span class="cmb2-metabox-description api-description">
1448 1448
 		<?php echo sprintf(
1449 1449
 		/* translators: 1: https://givewp.com/documentation/give-api-reference/ 2: https://givewp.com/addons/zapier/ */
1450
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1451
-			esc_url( 'https://givewp.com/documentation/give-api-reference/' ),
1452
-			esc_url( 'https://givewp.com/addons/zapier/' )
1450
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1451
+			esc_url('https://givewp.com/documentation/give-api-reference/'),
1452
+			esc_url('https://givewp.com/addons/zapier/')
1453 1453
 		); ?>
1454 1454
 	</span>
1455 1455
 	<?php
@@ -1459,10 +1459,10 @@  discard block
 block discarded – undo
1459 1459
 	 *
1460 1460
 	 * @since 1.0
1461 1461
 	 */
1462
-	do_action( 'give_tools_api_keys_after' );
1462
+	do_action('give_tools_api_keys_after');
1463 1463
 }
1464 1464
 
1465
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1465
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1466 1466
 
1467 1467
 /**
1468 1468
  * Hook Callback
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
  *
1476 1476
  * @return void
1477 1477
  */
1478
-function give_hook_callback( $args ) {
1478
+function give_hook_callback($args) {
1479 1479
 
1480 1480
 	$id = $args['id'];
1481 1481
 
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
 	 *
1485 1485
 	 * @since 1.0
1486 1486
 	 */
1487
-	do_action( "give_{$id}" );
1487
+	do_action("give_{$id}");
1488 1488
 
1489 1489
 }
1490 1490
 
@@ -1496,10 +1496,10 @@  discard block
 block discarded – undo
1496 1496
  * This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin.
1497 1497
  */
1498 1498
 
1499
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1500
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1501
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1502
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1503
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1504
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1499
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1500
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1501
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1502
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1503
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1504
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1505 1505
 }
1506 1506
\ No newline at end of file
Please login to merge, or discard this patch.
includes/ajax-functions.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -408,30 +408,30 @@
 block discarded – undo
408 408
 		die( '-2' );
409 409
 	}
410 410
 
411
-    if ( ! give_has_variable_prices( $form_id ) ) {
412
-        esc_html_e( 'n/a', 'give' );
413
-    } else {
414
-        // Payment object.
415
-        $payment = new Give_Payment( $payment_id );
416
-
417
-        // Payment meta.
418
-        $payment_meta = $payment->get_meta();
419
-
420
-
421
-        // Variable price dropdown options.
422
-        $variable_price_dropdown_option =  array(
423
-            'id'                => $form_id,
424
-            'name'              => 'give-variable-price',
425
-            'chosen'            => true,
426
-            'show_option_all'   => '',
427
-            'selected'          => $payment_meta['price_id'],
428
-        );
429
-
430
-        // Render variable prices select tag html.
431
-        give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
432
-    }
433
-
434
-    give_die();
411
+	if ( ! give_has_variable_prices( $form_id ) ) {
412
+		esc_html_e( 'n/a', 'give' );
413
+	} else {
414
+		// Payment object.
415
+		$payment = new Give_Payment( $payment_id );
416
+
417
+		// Payment meta.
418
+		$payment_meta = $payment->get_meta();
419
+
420
+
421
+		// Variable price dropdown options.
422
+		$variable_price_dropdown_option =  array(
423
+			'id'                => $form_id,
424
+			'name'              => 'give-variable-price',
425
+			'chosen'            => true,
426
+			'show_option_all'   => '',
427
+			'selected'          => $payment_meta['price_id'],
428
+		);
429
+
430
+		// Render variable prices select tag html.
431
+		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
432
+	}
433
+
434
+	give_die();
435 435
 }
436 436
 
437 437
 add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 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
 
@@ -26,27 +26,27 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 
39 39
 		} else {
40 40
 
41
-			if ( $airplane->check_status() == 'on' ) {
41
+			if ($airplane->check_status() == 'on') {
42 42
 				return true;
43 43
 			}
44 44
 		}
45 45
 	}
46 46
 
47
-	add_filter( 'block_local_requests', '__return_false' );
47
+	add_filter('block_local_requests', '__return_false');
48 48
 
49
-	if ( get_transient( '_give_ajax_works' ) ) {
49
+	if (get_transient('_give_ajax_works')) {
50 50
 		return true;
51 51
 	}
52 52
 
@@ -58,35 +58,35 @@  discard block
 block discarded – undo
58 58
 		)
59 59
 	);
60 60
 
61
-	$ajax  = wp_remote_post( give_get_ajax_url(), $params );
61
+	$ajax  = wp_remote_post(give_get_ajax_url(), $params);
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 
86 86
 	}
87 87
 
88
-	if ( $works ) {
89
-		set_transient( '_give_ajax_works', '1', DAY_IN_SECONDS );
88
+	if ($works) {
89
+		set_transient('_give_ajax_works', '1', DAY_IN_SECONDS);
90 90
 	}
91 91
 
92 92
 	return $works;
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
  * @return string
102 102
  */
103 103
 function give_get_ajax_url() {
104
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
104
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
105 105
 
106 106
 	$current_url = give_get_current_page_url();
107
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
107
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
108 108
 
109
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
110
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
109
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
110
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
111 111
 	}
112 112
 
113
-	return apply_filters( 'give_ajax_url', $ajax_url );
113
+	return apply_filters('give_ajax_url', $ajax_url);
114 114
 }
115 115
 
116 116
 /**
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @since 1.7
128 128
 	 */
129
-	do_action( 'give_donation_form_login_fields' );
129
+	do_action('give_donation_form_login_fields');
130 130
 
131 131
 	give_die();
132 132
 }
133 133
 
134
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
134
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
135 135
 
136 136
 /**
137 137
  * Load Checkout Fields
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
  * @return void
142 142
  */
143 143
 function give_load_checkout_fields() {
144
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
144
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
145 145
 
146 146
 	ob_start();
147 147
 
@@ -150,18 +150,18 @@  discard block
 block discarded – undo
150 150
 	 *
151 151
 	 * @since 1.7
152 152
 	 */
153
-	do_action( 'give_donation_form_register_login_fields', $form_id );
153
+	do_action('give_donation_form_register_login_fields', $form_id);
154 154
 
155 155
 	$fields = ob_get_clean();
156 156
 
157
-	wp_send_json( array(
158
-		'fields' => wp_json_encode( $fields ),
159
-		'submit' => wp_json_encode( give_checkout_button_purchase( $form_id ) ),
160
-	) );
157
+	wp_send_json(array(
158
+		'fields' => wp_json_encode($fields),
159
+		'submit' => wp_json_encode(give_checkout_button_purchase($form_id)),
160
+	));
161 161
 }
162 162
 
163
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
164
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
163
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
164
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
165 165
 
166 166
 /**
167 167
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
  * @return void
172 172
  */
173 173
 function give_ajax_get_form_title() {
174
-	if ( isset( $_POST['form_id'] ) ) {
175
-		$title = get_the_title( $_POST['form_id'] );
176
-		if ( $title ) {
174
+	if (isset($_POST['form_id'])) {
175
+		$title = get_the_title($_POST['form_id']);
176
+		if ($title) {
177 177
 			echo $title;
178 178
 		} else {
179 179
 			echo 'fail';
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 	give_die();
183 183
 }
184 184
 
185
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
186
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
185
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
186
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
187 187
 
188 188
 /**
189 189
  * Retrieve a states drop down
@@ -194,23 +194,23 @@  discard block
 block discarded – undo
194 194
  */
195 195
 function give_ajax_get_states_field() {
196 196
 
197
-	if ( empty( $_POST['country'] ) ) {
197
+	if (empty($_POST['country'])) {
198 198
 		$_POST['country'] = give_get_country();
199 199
 	}
200
-	$states = give_get_states( $_POST['country'] );
200
+	$states = give_get_states($_POST['country']);
201 201
 
202
-	if ( ! empty( $states ) ) {
202
+	if ( ! empty($states)) {
203 203
 
204 204
 		$args = array(
205 205
 			'name'             => $_POST['field_name'],
206 206
 			'id'               => $_POST['field_name'],
207
-			'class'            => $_POST['field_name'] . '  give-select',
208
-			'options'          => give_get_states( $_POST['country'] ),
207
+			'class'            => $_POST['field_name'].'  give-select',
208
+			'options'          => give_get_states($_POST['country']),
209 209
 			'show_option_all'  => false,
210 210
 			'show_option_none' => false
211 211
 		);
212 212
 
213
-		$response = Give()->html->select( $args );
213
+		$response = Give()->html->select($args);
214 214
 
215 215
 	} else {
216 216
 
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	give_die();
223 223
 }
224 224
 
225
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
226
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
225
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
226
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
227 227
 
228 228
 /**
229 229
  * Retrieve a states drop down
@@ -235,17 +235,17 @@  discard block
 block discarded – undo
235 235
 function give_ajax_form_search() {
236 236
 	global $wpdb;
237 237
 
238
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
238
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
239 239
 	$results = array();
240
-	if ( current_user_can( 'edit_give_forms' ) ) {
241
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
240
+	if (current_user_can('edit_give_forms')) {
241
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
242 242
 	} else {
243
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
243
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
244 244
 	}
245 245
 
246
-	if ( $items ) {
246
+	if ($items) {
247 247
 
248
-		foreach ( $items as $item ) {
248
+		foreach ($items as $item) {
249 249
 
250 250
 			$results[] = array(
251 251
 				'id'   => $item->ID,
@@ -257,18 +257,18 @@  discard block
 block discarded – undo
257 257
 
258 258
 		$items[] = array(
259 259
 			'id'   => 0,
260
-			'name' => esc_html__( 'No forms found.', 'give' )
260
+			'name' => esc_html__('No forms found.', 'give')
261 261
 		);
262 262
 
263 263
 	}
264 264
 
265
-	echo json_encode( $results );
265
+	echo json_encode($results);
266 266
 
267 267
 	give_die();
268 268
 }
269 269
 
270
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
271
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
270
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
271
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
272 272
 
273 273
 /**
274 274
  * Search the donors database via Ajax
@@ -280,21 +280,21 @@  discard block
 block discarded – undo
280 280
 function give_ajax_donor_search() {
281 281
 	global $wpdb;
282 282
 
283
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
283
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
284 284
 	$results = array();
285
-	if ( ! current_user_can( 'view_give_reports' ) ) {
285
+	if ( ! current_user_can('view_give_reports')) {
286 286
 		$donors = array();
287 287
 	} else {
288
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
288
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
289 289
 	}
290 290
 
291
-	if ( $donors ) {
291
+	if ($donors) {
292 292
 
293
-		foreach ( $donors as $donor ) {
293
+		foreach ($donors as $donor) {
294 294
 
295 295
 			$results[] = array(
296 296
 				'id'   => $donor->id,
297
-				'name' => $donor->name . '(' . $donor->email . ')'
297
+				'name' => $donor->name.'('.$donor->email.')'
298 298
 			);
299 299
 		}
300 300
 
@@ -302,17 +302,17 @@  discard block
 block discarded – undo
302 302
 
303 303
 		$donors[] = array(
304 304
 			'id'   => 0,
305
-			'name' => esc_html__( 'No donors found.', 'give' )
305
+			'name' => esc_html__('No donors found.', 'give')
306 306
 		);
307 307
 
308 308
 	}
309 309
 
310
-	echo json_encode( $results );
310
+	echo json_encode($results);
311 311
 
312 312
 	give_die();
313 313
 }
314 314
 
315
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
315
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
316 316
 
317 317
 
318 318
 /**
@@ -324,42 +324,42 @@  discard block
 block discarded – undo
324 324
  */
325 325
 function give_ajax_search_users() {
326 326
 
327
-	if ( current_user_can( 'manage_give_settings' ) ) {
327
+	if (current_user_can('manage_give_settings')) {
328 328
 
329
-		$search_query = trim( $_POST['user_name'] );
330
-		$exclude      = trim( $_POST['exclude'] );
329
+		$search_query = trim($_POST['user_name']);
330
+		$exclude      = trim($_POST['exclude']);
331 331
 
332 332
 		$get_users_args = array(
333 333
 			'number' => 9999,
334
-			'search' => $search_query . '*'
334
+			'search' => $search_query.'*'
335 335
 		);
336 336
 
337
-		if ( ! empty( $exclude ) ) {
338
-			$exclude_array             = explode( ',', $exclude );
337
+		if ( ! empty($exclude)) {
338
+			$exclude_array             = explode(',', $exclude);
339 339
 			$get_users_args['exclude'] = $exclude_array;
340 340
 		}
341 341
 
342
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
342
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
343 343
 
344
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search_query );
344
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search_query);
345 345
 
346 346
 		$user_list = '<ul>';
347
-		if ( $found_users ) {
348
-			foreach ( $found_users as $user ) {
349
-				$user_list .= '<li><a href="#" data-userid="' . esc_attr( $user->ID ) . '" data-login="' . esc_attr( $user->user_login ) . '">' . esc_html( $user->user_login ) . '</a></li>';
347
+		if ($found_users) {
348
+			foreach ($found_users as $user) {
349
+				$user_list .= '<li><a href="#" data-userid="'.esc_attr($user->ID).'" data-login="'.esc_attr($user->user_login).'">'.esc_html($user->user_login).'</a></li>';
350 350
 			}
351 351
 		} else {
352
-			$user_list .= '<li>' . esc_html__( 'No users found.', 'give' ) . '</li>';
352
+			$user_list .= '<li>'.esc_html__('No users found.', 'give').'</li>';
353 353
 		}
354 354
 		$user_list .= '</ul>';
355 355
 
356
-		echo json_encode( array( 'results' => $user_list ) );
356
+		echo json_encode(array('results' => $user_list));
357 357
 
358 358
 	}
359 359
 	die();
360 360
 }
361 361
 
362
-add_action( 'wp_ajax_give_search_users', 'give_ajax_search_users' );
362
+add_action('wp_ajax_give_search_users', 'give_ajax_search_users');
363 363
 
364 364
 
365 365
 /**
@@ -371,32 +371,32 @@  discard block
 block discarded – undo
371 371
  */
372 372
 function give_check_for_form_price_variations() {
373 373
 
374
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
375
-		die( '-1' );
374
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
375
+		die('-1');
376 376
 	}
377 377
 
378
-	$form_id = intval( $_POST['form_id'] );
379
-	$form    = get_post( $form_id );
378
+	$form_id = intval($_POST['form_id']);
379
+	$form    = get_post($form_id);
380 380
 
381
-	if ( 'give_forms' != $form->post_type ) {
382
-		die( '-2' );
381
+	if ('give_forms' != $form->post_type) {
382
+		die('-2');
383 383
 	}
384 384
 
385
-	if ( give_has_variable_prices( $form_id ) ) {
386
-		$variable_prices = give_get_variable_prices( $form_id );
385
+	if (give_has_variable_prices($form_id)) {
386
+		$variable_prices = give_get_variable_prices($form_id);
387 387
 
388
-		if ( $variable_prices ) {
388
+		if ($variable_prices) {
389 389
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
390 390
 
391
-			if ( isset( $_POST['all_prices'] ) ) {
392
-				$ajax_response .= '<option value="">' . esc_html__( 'All Levels', 'give' ) . '</option>';
391
+			if (isset($_POST['all_prices'])) {
392
+				$ajax_response .= '<option value="">'.esc_html__('All Levels', 'give').'</option>';
393 393
 			}
394 394
 
395
-			foreach ( $variable_prices as $key => $price ) {
395
+			foreach ($variable_prices as $key => $price) {
396 396
 
397
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) );
397
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount']));
398 398
 				
399
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
399
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
400 400
 			}
401 401
 			$ajax_response .= '</select>';
402 402
 			echo $ajax_response;
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 	give_die();
408 408
 }
409 409
 
410
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
410
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
411 411
 
412 412
 
413 413
 /**
@@ -418,30 +418,30 @@  discard block
 block discarded – undo
418 418
  * @return void
419 419
  */
420 420
 function give_check_for_form_price_variations_html() {
421
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
421
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
422 422
 		wp_die();
423 423
 	}
424 424
 
425
-	$form_id = intval( $_POST['form_id'] );
426
-	$payment_id = intval( $_POST['payment_id'] );
427
-	$form    = get_post( $form_id );
425
+	$form_id = intval($_POST['form_id']);
426
+	$payment_id = intval($_POST['payment_id']);
427
+	$form    = get_post($form_id);
428 428
 
429
-	if ( 'give_forms' != $form->post_type ) {
429
+	if ('give_forms' != $form->post_type) {
430 430
 		wp_die();
431 431
 	}
432 432
 
433
-    if ( ! give_has_variable_prices( $form_id ) ) {
434
-        esc_html_e( 'n/a', 'give' );
433
+    if ( ! give_has_variable_prices($form_id)) {
434
+        esc_html_e('n/a', 'give');
435 435
     } else {
436 436
         // Payment object.
437
-        $payment = new Give_Payment( $payment_id );
437
+        $payment = new Give_Payment($payment_id);
438 438
 
439 439
         // Payment meta.
440 440
         $payment_meta = $payment->get_meta();
441 441
 
442 442
 
443 443
         // Variable price dropdown options.
444
-        $variable_price_dropdown_option =  array(
444
+        $variable_price_dropdown_option = array(
445 445
             'id'                => $form_id,
446 446
             'name'              => 'give-variable-price',
447 447
             'chosen'            => true,
@@ -450,10 +450,10 @@  discard block
 block discarded – undo
450 450
         );
451 451
 
452 452
         // Render variable prices select tag html.
453
-        give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
453
+        give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
454 454
     }
455 455
 
456 456
     give_die();
457 457
 }
458 458
 
459
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
459
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.