Completed
Push — master ( 36b4cc...47e416 )
by Devin
10s
created
includes/scripts.php 1 patch
Spacing   +137 added lines, -137 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
 
@@ -28,94 +28,94 @@  discard block
 block discarded – undo
28 28
 
29 29
 	global $give_options;
30 30
 
31
-	$js_dir         = GIVE_PLUGIN_URL . 'assets/js/frontend/';
32
-	$js_plugins     = GIVE_PLUGIN_URL . 'assets/js/plugins/';
33
-	$scripts_footer = ( give_get_option( 'scripts_footer' ) == 'on' ) ? true : false;
31
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
32
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
33
+	$scripts_footer = (give_get_option('scripts_footer') == 'on') ? true : false;
34 34
 
35 35
 	// Use minified libraries if SCRIPT_DEBUG is turned off
36
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
36
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
37 37
 
38 38
 	//Localize / PHP to AJAX vars
39
-	$localize_give_checkout = apply_filters( 'give_global_script_vars', array(
39
+	$localize_give_checkout = apply_filters('give_global_script_vars', array(
40 40
 		'ajaxurl'             => give_get_ajax_url(),
41
-		'checkout_nonce'      => wp_create_nonce( 'give_checkout_nonce' ),
42
-		'currency_sign'       => give_currency_filter( '' ),
41
+		'checkout_nonce'      => wp_create_nonce('give_checkout_nonce'),
42
+		'currency_sign'       => give_currency_filter(''),
43 43
 		'currency_pos'        => give_get_currency_position(),
44
-		'thousands_separator' => isset( $give_options['thousands_separator'] ) ? $give_options['thousands_separator'] : ',',
45
-		'decimal_separator'   => isset( $give_options['decimal_separator'] ) ? $give_options['decimal_separator'] : '.',
46
-		'no_gateway'          => esc_html( 'Please select a payment method.', 'give' ),
47
-		'bad_minimum'         => esc_html( 'The minimum donation amount for this form is', 'give' ),
48
-		'general_loading'     => esc_html( 'Loading...', 'give' ),
49
-		'purchase_loading'    => esc_html( 'Please Wait...', 'give' ),
50
-		'number_decimals'  => apply_filters( 'give_format_amount_decimals', 2 ),
44
+		'thousands_separator' => isset($give_options['thousands_separator']) ? $give_options['thousands_separator'] : ',',
45
+		'decimal_separator'   => isset($give_options['decimal_separator']) ? $give_options['decimal_separator'] : '.',
46
+		'no_gateway'          => esc_html('Please select a payment method.', 'give'),
47
+		'bad_minimum'         => esc_html('The minimum donation amount for this form is', 'give'),
48
+		'general_loading'     => esc_html('Loading...', 'give'),
49
+		'purchase_loading'    => esc_html('Please Wait...', 'give'),
50
+		'number_decimals'  => apply_filters('give_format_amount_decimals', 2),
51 51
 		'give_version'        => GIVE_VERSION
52
-	) );
53
-	$localize_give_ajax     = apply_filters( 'give_global_ajax_vars', array(
52
+	));
53
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
54 54
 		'ajaxurl'          => give_get_ajax_url(),
55
-		'loading'          => esc_html( 'Loading', 'give' ),
55
+		'loading'          => esc_html('Loading', 'give'),
56 56
 		// General loading message
57
-		'select_option'    => esc_html( 'Please select an option', 'give' ),
57
+		'select_option'    => esc_html('Please select an option', 'give'),
58 58
 		// Variable pricing error with multi-purchase option enabled
59
-		'default_gateway'  => give_get_default_gateway( null ),
60
-		'permalinks'       => get_option( 'permalink_structure' ) ? '1' : '0',
61
-		'number_decimals'  => apply_filters( 'give_format_amount_decimals', 2 )
62
-	) );
59
+		'default_gateway'  => give_get_default_gateway(null),
60
+		'permalinks'       => get_option('permalink_structure') ? '1' : '0',
61
+		'number_decimals'  => apply_filters('give_format_amount_decimals', 2)
62
+	));
63 63
 
64 64
 	//DEBUG is On
65
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
65
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
66 66
 
67
-		if ( give_is_cc_verify_enabled() ) {
68
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
69
-			wp_enqueue_script( 'give-cc-validator' );
67
+		if (give_is_cc_verify_enabled()) {
68
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
69
+			wp_enqueue_script('give-cc-validator');
70 70
 		}
71 71
 
72
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
73
-		wp_enqueue_script( 'give-float-labels' );
72
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
73
+		wp_enqueue_script('give-float-labels');
74 74
 
75
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
76
-		wp_enqueue_script( 'give-blockui' );
75
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
76
+		wp_enqueue_script('give-blockui');
77 77
 
78
-		wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
79
-		wp_enqueue_script( 'give-qtip' );
78
+		wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
79
+		wp_enqueue_script('give-qtip');
80 80
 
81
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
82
-		wp_enqueue_script( 'give-accounting' );
81
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
82
+		wp_enqueue_script('give-accounting');
83 83
 
84
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
85
-		wp_enqueue_script( 'give-magnific' );
84
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
85
+		wp_enqueue_script('give-magnific');
86 86
 
87
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
88
-		wp_enqueue_script( 'give-checkout-global' );
87
+		wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
88
+		wp_enqueue_script('give-checkout-global');
89 89
 
90 90
 		//General scripts
91
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
92
-		wp_enqueue_script( 'give-scripts' );
91
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
92
+		wp_enqueue_script('give-scripts');
93 93
 
94 94
 		// Load AJAX scripts, if enabled
95
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
96
-		wp_enqueue_script( 'give-ajax' );
95
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
96
+		wp_enqueue_script('give-ajax');
97 97
 
98 98
 		//Localize / Pass AJAX vars from PHP
99
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_checkout );
100
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
99
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_checkout);
100
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
101 101
 
102 102
 
103 103
 	} else {
104 104
 
105 105
 		//DEBUG is OFF (one JS file to rule them all!)
106
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
107
-		wp_enqueue_script( 'give' );
106
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
107
+		wp_enqueue_script('give');
108 108
 
109 109
 		//Localize / Pass AJAX vars from PHP
110
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_checkout );
111
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
110
+		wp_localize_script('give', 'give_global_vars', $localize_give_checkout);
111
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
112 112
 
113 113
 	}
114 114
 
115 115
 
116 116
 }
117 117
 
118
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
118
+add_action('wp_enqueue_scripts', 'give_load_scripts');
119 119
 
120 120
 /**
121 121
  * Register Styles
@@ -127,47 +127,47 @@  discard block
 block discarded – undo
127 127
  */
128 128
 function give_register_styles() {
129 129
 
130
-	if ( give_get_option( 'disable_css', false ) ) {
130
+	if (give_get_option('disable_css', false)) {
131 131
 		return;
132 132
 	}
133 133
 
134 134
 	// Use minified libraries if SCRIPT_DEBUG is turned off
135
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
135
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
136 136
 
137
-	$file          = 'give' . $suffix . '.css';
137
+	$file          = 'give'.$suffix.'.css';
138 138
 	$templates_dir = give_get_theme_template_dir_name();
139 139
 
140
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
141
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give.css';
142
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
143
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give.css';
144
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
140
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
141
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give.css';
142
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
143
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give.css';
144
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
145 145
 
146 146
 	// Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory
147 147
 	// Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled.
148 148
 	// This allows users to copy just give.css to their theme
149
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
150
-		if ( ! empty( $nonmin ) ) {
151
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give.css';
149
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
150
+		if ( ! empty($nonmin)) {
151
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give.css';
152 152
 		} else {
153
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
153
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
154 154
 		}
155
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
156
-		if ( ! empty( $nonmin ) ) {
157
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give.css';
155
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
156
+		if ( ! empty($nonmin)) {
157
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.'give.css';
158 158
 		} else {
159
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
159
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
160 160
 		}
161
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
162
-		$url = trailingslashit( give_get_templates_url() ) . $file;
161
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
162
+		$url = trailingslashit(give_get_templates_url()).$file;
163 163
 	}
164 164
 
165
-	wp_register_style( 'give-styles', $url, array(), GIVE_VERSION, 'all' );
166
-	wp_enqueue_style( 'give-styles' );
165
+	wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all');
166
+	wp_enqueue_style('give-styles');
167 167
 
168 168
 }
169 169
 
170
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
170
+add_action('wp_enqueue_scripts', 'give_register_styles');
171 171
 
172 172
 /**
173 173
  * Load Admin Scripts
@@ -181,107 +181,107 @@  discard block
 block discarded – undo
181 181
  *
182 182
  * @return void
183 183
  */
184
-function give_load_admin_scripts( $hook ) {
184
+function give_load_admin_scripts($hook) {
185 185
 
186 186
 	global $wp_version, $post, $post_type;
187 187
 
188 188
 	//Directories of assets
189
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
190
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
191
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
189
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
190
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
191
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
192 192
 
193 193
 	// Use minified libraries if SCRIPT_DEBUG is turned off
194
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
194
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
195 195
 
196 196
 	//Global Admin:
197
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
198
-	wp_enqueue_style( 'give-admin-bar-notification' );
197
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
198
+	wp_enqueue_style('give-admin-bar-notification');
199 199
 
200 200
 	//Give Admin Only:
201
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
201
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
202 202
 		return;
203 203
 	}
204 204
 
205 205
 	//CSS
206
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
207
-	wp_enqueue_style( 'jquery-ui-css' );
208
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION );
209
-	wp_enqueue_style( 'give-admin' );
210
-	wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION );
211
-	wp_enqueue_style( 'jquery-chosen' );
212
-	wp_enqueue_style( 'thickbox' );
206
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
207
+	wp_enqueue_style('jquery-ui-css');
208
+	wp_register_style('give-admin', $css_dir.'give-admin'.$suffix.'.css', GIVE_VERSION);
209
+	wp_enqueue_style('give-admin');
210
+	wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION);
211
+	wp_enqueue_style('jquery-chosen');
212
+	wp_enqueue_style('thickbox');
213 213
 
214 214
 	//JS
215
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
216
-	wp_enqueue_script( 'jquery-chosen' );
215
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
216
+	wp_enqueue_script('jquery-chosen');
217 217
 
218
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
219
-	wp_enqueue_script( 'give-admin-scripts' );
218
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
219
+	wp_enqueue_script('give-admin-scripts');
220 220
 
221
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
222
-	wp_enqueue_script( 'jquery-flot' );
221
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
222
+	wp_enqueue_script('jquery-flot');
223 223
 
224
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
225
-	wp_enqueue_script( 'give-qtip' );
224
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
225
+	wp_enqueue_script('give-qtip');
226 226
 
227
-	wp_enqueue_script( 'jquery-ui-datepicker' );
228
-	wp_enqueue_script( 'thickbox' );
227
+	wp_enqueue_script('jquery-ui-datepicker');
228
+	wp_enqueue_script('thickbox');
229 229
 
230 230
 	//Forms CPT Script
231
-	if ( $post_type === 'give_forms' ) {
232
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
233
-		wp_enqueue_script( 'give-admin-forms-scripts' );
231
+	if ($post_type === 'give_forms') {
232
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
233
+		wp_enqueue_script('give-admin-forms-scripts');
234 234
 	}
235 235
 
236 236
 	//Settings Scripts
237
-	if (isset($_GET['page']) && $_GET['page'] == 'give-settings'  ) {
237
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
238 238
 		wp_enqueue_script('jquery-ui-sortable');
239
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
240
-		wp_enqueue_script( 'give-admin-settings-scripts' );
239
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
240
+		wp_enqueue_script('give-admin-settings-scripts');
241 241
 	}
242 242
 
243 243
 	//Localize strings & variables for JS
244
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
245
-		'post_id'                 => isset( $post->ID ) ? $post->ID : null,
244
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
245
+		'post_id'                 => isset($post->ID) ? $post->ID : null,
246 246
 		'give_version'            => GIVE_VERSION,
247
-		'quick_edit_warning'      => esc_html( 'Sorry, not available for variable priced forms.', 'give' ),
248
-		'delete_payment'          => esc_html( 'Are you sure you wish to delete this payment?', 'give' ),
249
-		'delete_payment_note'     => esc_html( 'Are you sure you wish to delete this note?', 'give' ),
250
-		'revoke_api_key'          => esc_html( 'Are you sure you wish to revoke this API key?', 'give' ),
251
-		'regenerate_api_key'      => esc_html( 'Are you sure you wish to regenerate this API key?', 'give' ),
252
-		'resend_receipt'          => esc_html( 'Are you sure you wish to resend the donation receipt?', 'give' ),
253
-		'copy_download_link_text' => esc_html( 'Copy these links to your clipboard and give them to your donor.', 'give' ),
247
+		'quick_edit_warning'      => esc_html('Sorry, not available for variable priced forms.', 'give'),
248
+		'delete_payment'          => esc_html('Are you sure you wish to delete this payment?', 'give'),
249
+		'delete_payment_note'     => esc_html('Are you sure you wish to delete this note?', 'give'),
250
+		'revoke_api_key'          => esc_html('Are you sure you wish to revoke this API key?', 'give'),
251
+		'regenerate_api_key'      => esc_html('Are you sure you wish to regenerate this API key?', 'give'),
252
+		'resend_receipt'          => esc_html('Are you sure you wish to resend the donation receipt?', 'give'),
253
+		'copy_download_link_text' => esc_html('Copy these links to your clipboard and give them to your donor.', 'give'),
254 254
 		/* translators: %s: form singular label */
255
-		'delete_payment_download' => sprintf( esc_html( 'Are you sure you wish to delete this %s?', 'give' ), give_get_forms_label_singular() ),
256
-		'one_price_min'           => esc_html( 'You must have at least one price.', 'give' ),
257
-		'one_file_min'            => esc_html( 'You must have at least one file.', 'give' ),
258
-		'one_field_min'           => esc_html( 'You must have at least one field.', 'give' ),
255
+		'delete_payment_download' => sprintf(esc_html('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()),
256
+		'one_price_min'           => esc_html('You must have at least one price.', 'give'),
257
+		'one_file_min'            => esc_html('You must have at least one file.', 'give'),
258
+		'one_field_min'           => esc_html('You must have at least one field.', 'give'),
259 259
 		/* translators: %s: form singular label */
260
-		'one_option'              => sprintf( esc_html( 'Choose a %s', 'give' ), give_get_forms_label_singular() ),
260
+		'one_option'              => sprintf(esc_html('Choose a %s', 'give'), give_get_forms_label_singular()),
261 261
 		/* translators: %s: form plural label */
262
-		'one_or_more_option'      => sprintf( esc_html( 'Choose one or more %s', 'give' ), give_get_forms_label_plural() ),
263
-		'numeric_item_price'      => esc_html( 'Item price must be numeric.', 'give' ),
264
-		'numeric_quantity'        => esc_html( 'Quantity must be numeric.', 'give' ),
265
-		'currency_sign'           => give_currency_filter( '' ),
266
-		'currency_pos'            => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
262
+		'one_or_more_option'      => sprintf(esc_html('Choose one or more %s', 'give'), give_get_forms_label_plural()),
263
+		'numeric_item_price'      => esc_html('Item price must be numeric.', 'give'),
264
+		'numeric_quantity'        => esc_html('Quantity must be numeric.', 'give'),
265
+		'currency_sign'           => give_currency_filter(''),
266
+		'currency_pos'            => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
267 267
 		'currency_decimals'       => give_currency_decimal_filter(),
268
-		'new_media_ui'            => apply_filters( 'give_use_35_media_ui', 1 ),
269
-		'remove_text'             => esc_html( 'Remove', 'give' ),
268
+		'new_media_ui'            => apply_filters('give_use_35_media_ui', 1),
269
+		'remove_text'             => esc_html('Remove', 'give'),
270 270
 		/* translators: %s: form plural label */
271
-		'type_to_search'          => sprintf( esc_html( 'Type to search %s', 'give' ), give_get_forms_label_plural() ),
272
-		'batch_export_no_class'   => esc_html( 'You must choose a method.', 'give' ),
273
-		'batch_export_no_reqs'    => esc_html( 'Required fields not completed.', 'give' ),
274
-		'reset_stats_warn'        => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
275
-	) );
271
+		'type_to_search'          => sprintf(esc_html('Type to search %s', 'give'), give_get_forms_label_plural()),
272
+		'batch_export_no_class'   => esc_html('You must choose a method.', 'give'),
273
+		'batch_export_no_reqs'    => esc_html('Required fields not completed.', 'give'),
274
+		'reset_stats_warn'        => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
275
+	));
276 276
 
277
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) {
277
+	if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
278 278
 		//call for new media manager
279 279
 		wp_enqueue_media();
280 280
 	}
281 281
 
282 282
 }
283 283
 
284
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
284
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
285 285
 
286 286
 /**
287 287
  * Admin Give Icon
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 	?>
299 299
 	<style type="text/css" media="screen">
300 300
 
301
-		<?php if( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) { ?>
301
+		<?php if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) { ?>
302 302
 		@font-face {
303 303
 			font-family: 'give-icomoon';
304
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>');
305
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
306
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
307
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
308
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
304
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>');
305
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
306
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
307
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
308
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
309 309
 			font-weight: normal;
310 310
 			font-style: normal;
311 311
 		}
@@ -324,4 +324,4 @@  discard block
 block discarded – undo
324 324
 	<?php
325 325
 }
326 326
 
327
-add_action( 'admin_head', 'give_admin_icon' );
327
+add_action('admin_head', 'give_admin_icon');
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html( 'Welcome to Give', 'give' ),
55
-			esc_html( 'Welcome to Give', 'give' ),
54
+			esc_html('Welcome to Give', 'give'),
55
+			esc_html('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html( 'Give Changelog', 'give' ),
64
-			esc_html( 'Give Changelog', 'give' ),
63
+			esc_html('Give Changelog', 'give'),
64
+			esc_html('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html( 'Getting started with Give', 'give' ),
73
-			esc_html( 'Getting started with Give', 'give' ),
72
+			esc_html('Getting started with Give', 'give'),
73
+			esc_html('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html( 'The people that build Give', 'give' ),
82
-			esc_html( 'The people that build Give', 'give' ),
81
+			esc_html('The people that build Give', 'give'),
82
+			esc_html('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h1 class="nav-tab-wrapper">
221
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
222
-				<?php esc_html_e( "About Give", 'give' ); ?>
221
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
222
+				<?php esc_html_e("About Give", 'give'); ?>
223 223
 			</a>
224
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h1>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html( 'Welcome to Give %s', 'give' ),
251
+					esc_html('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<div class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr( 'View the Give plugin documentation online', 'give' )
261
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></div>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html( 'Version %s', 'give' ),
274
+					esc_html('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -283,15 +283,15 @@  discard block
 block discarded – undo
283 283
 			<div class="feature-section clearfix introduction">
284 284
 
285 285
 				<div class="video feature-section-item">
286
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
286
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
287 287
 
288 288
 				</div>
289 289
 
290 290
 				<div class="content feature-section-item last-feature">
291 291
 
292
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
292
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
293 293
 
294
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
294
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
295 295
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
296 296
 						<span class="dashicons dashicons-external"></span></a>
297 297
 
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
 
305 305
 				<div class="content feature-section-item">
306 306
 
307
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
307
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
308 308
 
309
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
309
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
310 310
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
311 311
 						<span class="dashicons dashicons-external"></span></a>
312 312
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 				<div class="content  feature-section-item last-feature">
316 316
 
317
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
317
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
318 318
 
319 319
 				</div>
320 320
 
@@ -334,22 +334,22 @@  discard block
 block discarded – undo
334 334
 	 * @return void
335 335
 	 */
336 336
 	public function changelog_screen() {
337
-		list( $display_version ) = explode( '-', GIVE_VERSION );
337
+		list($display_version) = explode('-', GIVE_VERSION);
338 338
 		?>
339 339
 		<div class="wrap about-wrap">
340
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
340
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
341 341
 
342 342
 			<div class="about-text"><?php
343 343
 				printf(
344 344
 					/* translators: %s: Give version */
345
-					esc_html( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
345
+					esc_html('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
346 346
 					$display_version
347 347
 				);
348 348
 			?></div>
349 349
 			<div class="give-badge"><?php
350 350
 				printf(
351 351
 					/* translators: %s: Give version */
352
-					esc_html( 'Version %s', 'give' ),
352
+					esc_html('Version %s', 'give'),
353 353
 					$display_version
354 354
 				);
355 355
 			?></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 			<?php $this->tabs(); ?>
358 358
 
359 359
 			<div class="changelog">
360
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
360
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
361 361
 
362 362
 				<div class="feature-section">
363 363
 					<?php echo $this->parse_readme(); ?>
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
 			</div>
366 366
 
367 367
 			<div class="return-to-dashboard">
368
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
368
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
369 369
 					'post_type' => 'give_forms',
370 370
 					'page'      => 'give-settings'
371
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
371
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
372 372
 			</div>
373 373
 		</div>
374 374
 	<?php
@@ -382,29 +382,29 @@  discard block
 block discarded – undo
382 382
 	 * @return void
383 383
 	 */
384 384
 	public function getting_started_screen() {
385
-		list( $display_version ) = explode( '-', GIVE_VERSION );
385
+		list($display_version) = explode('-', GIVE_VERSION);
386 386
 		?>
387 387
 		<div class="wrap about-wrap get-started">
388 388
 			<h1 class="welcome-h1"><?php
389 389
 				printf(
390 390
 					/* translators: %s: Give version */
391
-					esc_html( 'Give %s - Getting Started Guide', 'give' ),
391
+					esc_html('Give %s - Getting Started Guide', 'give'),
392 392
 					$display_version
393 393
 				);
394 394
 			?></h1>
395 395
 
396 396
 			<?php give_social_media_elements() ?>
397 397
 
398
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
398
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
399 399
 
400
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
400
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
401 401
 
402 402
 			<?php give_get_newsletter() ?>
403 403
 
404 404
 			<div class="give-badge"><?php
405 405
 				printf(
406 406
 					/* translators: %s: Give version */
407
-					esc_html( 'Version %s', 'give' ),
407
+					esc_html('Version %s', 'give'),
408 408
 					$display_version
409 409
 				);
410 410
 			?></div>
@@ -412,17 +412,17 @@  discard block
 block discarded – undo
412 412
 			<?php $this->tabs(); ?>
413 413
 
414 414
 
415
-			<div class="about-text"><?php printf( esc_html( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></div>
415
+			<div class="about-text"><?php printf(esc_html('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></div>
416 416
 
417 417
 
418 418
 			<div class="feature-section clearfix">
419 419
 
420 420
 				<div class="content feature-section-item">
421
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
421
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
422 422
 
423
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
423
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
424 424
 
425
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
425
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
426 426
 				</div>
427 427
 
428 428
 				<div class="content feature-section-item last-feature">
@@ -439,9 +439,9 @@  discard block
 block discarded – undo
439 439
 				</div>
440 440
 
441 441
 				<div class="content feature-section-item last-feature">
442
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
442
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
443 443
 
444
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
444
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
445 445
 				</div>
446 446
 
447 447
 			</div>
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
 			<div class="feature-section clearfix">
451 451
 
452 452
 				<div class="content feature-section-item add-content">
453
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
453
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
454 454
 
455
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
455
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
456 456
 
457
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
457
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
458 458
 				</div>
459 459
 
460 460
 				<div class="content feature-section-item last-feature">
@@ -471,9 +471,9 @@  discard block
 block discarded – undo
471 471
 				</div>
472 472
 
473 473
 				<div class="content feature-section-item last-feature">
474
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
474
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
475 475
 
476
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
476
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
477 477
 				</div>
478 478
 
479 479
 
@@ -493,38 +493,38 @@  discard block
 block discarded – undo
493 493
 	 * @return void
494 494
 	 */
495 495
 	public function credits_screen() {
496
-		list( $display_version ) = explode( '-', GIVE_VERSION );
496
+		list($display_version) = explode('-', GIVE_VERSION);
497 497
 		?>
498 498
 		<div class="wrap about-wrap">
499 499
 			<h1 class="welcome-h1"><?php
500 500
 				printf(
501 501
 					/* translators: %s: Give version */
502
-					esc_html( 'Give %s - Credits', 'give' ),
502
+					esc_html('Give %s - Credits', 'give'),
503 503
 					$display_version
504 504
 				);
505 505
 			?></h1>
506 506
 
507 507
 			<?php give_social_media_elements() ?>
508 508
 
509
-			<div class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></div>
509
+			<div class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></div>
510 510
 
511
-			<div class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></div>
511
+			<div class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></div>
512 512
 
513
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
513
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
514 514
 
515 515
 			<?php give_get_newsletter() ?>
516 516
 
517 517
 			<div class="give-badge"><?php
518 518
 				printf(
519 519
 					/* translators: %s: Give version */
520
-					esc_html( 'Version %s', 'give' ),
520
+					esc_html('Version %s', 'give'),
521 521
 					$display_version
522 522
 				);
523 523
 			?></div>
524 524
 
525 525
 			<?php $this->tabs(); ?>
526 526
 
527
-			<p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
527
+			<p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p>
528 528
 
529 529
 			<?php echo $this->contributors(); ?>
530 530
 		</div>
@@ -539,21 +539,21 @@  discard block
 block discarded – undo
539 539
 	 * @return string $readme HTML formatted readme file
540 540
 	 */
541 541
 	public function parse_readme() {
542
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
542
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
543 543
 
544
-		if ( ! $file ) {
545
-			$readme = '<p>' . esc_html( 'No valid changlog was found.', 'give' ) . '</p>';
544
+		if ( ! $file) {
545
+			$readme = '<p>'.esc_html('No valid changlog was found.', 'give').'</p>';
546 546
 		} else {
547
-			$readme = file_get_contents( $file );
548
-			$readme = nl2br( esc_html( $readme ) );
549
-			$readme = explode( '== Changelog ==', $readme );
550
-			$readme = end( $readme );
551
-
552
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
553
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
554
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
555
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
556
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
547
+			$readme = file_get_contents($file);
548
+			$readme = nl2br(esc_html($readme));
549
+			$readme = explode('== Changelog ==', $readme);
550
+			$readme = end($readme);
551
+
552
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
553
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
554
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
555
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
556
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
557 557
 		}
558 558
 
559 559
 		return $readme;
@@ -570,27 +570,27 @@  discard block
 block discarded – undo
570 570
 	public function contributors() {
571 571
 		$contributors = $this->get_contributors();
572 572
 
573
-		if ( empty( $contributors ) ) {
573
+		if (empty($contributors)) {
574 574
 			return '';
575 575
 		}
576 576
 
577 577
 		$contributor_list = '<ul class="wp-people-group">';
578 578
 
579
-		foreach ( $contributors as $contributor ) {
579
+		foreach ($contributors as $contributor) {
580 580
 			$contributor_list .= '<li class="wp-person">';
581
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
582
-				esc_url( 'https://github.com/' . $contributor->login ),
581
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
582
+				esc_url('https://github.com/'.$contributor->login),
583 583
 				esc_html(
584 584
 					sprintf(
585 585
 						/* translators: %s: github contributor */
586
-						esc_html( 'View %s', 'give' ),
586
+						esc_html('View %s', 'give'),
587 587
 						$contributor->login
588 588
 					)
589 589
 				)
590 590
 			);
591
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
591
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login));
592 592
 			$contributor_list .= '</a>';
593
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
593
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login));
594 594
 			$contributor_list .= '</a>';
595 595
 			$contributor_list .= '</li>';
596 596
 		}
@@ -608,25 +608,25 @@  discard block
 block discarded – undo
608 608
 	 * @return array $contributors List of contributors
609 609
 	 */
610 610
 	public function get_contributors() {
611
-		$contributors = get_transient( 'give_contributors' );
611
+		$contributors = get_transient('give_contributors');
612 612
 
613
-		if ( false !== $contributors ) {
613
+		if (false !== $contributors) {
614 614
 			return $contributors;
615 615
 		}
616 616
 
617
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
617
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
618 618
 
619
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
619
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
620 620
 			return array();
621 621
 		}
622 622
 
623
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
623
+		$contributors = json_decode(wp_remote_retrieve_body($response));
624 624
 
625
-		if ( ! is_array( $contributors ) ) {
625
+		if ( ! is_array($contributors)) {
626 626
 			return array();
627 627
 		}
628 628
 
629
-		set_transient( 'give_contributors', $contributors, 3600 );
629
+		set_transient('give_contributors', $contributors, 3600);
630 630
 
631 631
 		return $contributors;
632 632
 	}
@@ -645,24 +645,24 @@  discard block
 block discarded – undo
645 645
 
646 646
 
647 647
 		// Bail if no activation redirect
648
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
648
+		if ( ! get_transient('_give_activation_redirect')) {
649 649
 			return;
650 650
 		}
651 651
 
652 652
 		// Delete the redirect transient
653
-		delete_transient( '_give_activation_redirect' );
653
+		delete_transient('_give_activation_redirect');
654 654
 
655 655
 		// Bail if activating from network, or bulk
656
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
656
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
657 657
 			return;
658 658
 		}
659 659
 
660
-		$upgrade = get_option( 'give_version_upgraded_from' );
660
+		$upgrade = get_option('give_version_upgraded_from');
661 661
 
662
-		if ( ! $upgrade ) { // First time install
663
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
662
+		if ( ! $upgrade) { // First time install
663
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
664 664
 			exit;
665
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
665
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
666 666
 
667 667
 		} else { // Welcome is NOT disabled in settings
668 668
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.
includes/admin/reporting/tools.php 1 patch
Spacing   +29 added lines, -29 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
 
@@ -22,80 +22,80 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_tools_recount_stats_display() {
24 24
 
25
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
25
+	if ( ! current_user_can('manage_give_settings')) {
26 26
 		return;
27 27
 	}
28 28
 
29
-	do_action( 'give_tools_recount_stats_before' );
29
+	do_action('give_tools_recount_stats_before');
30 30
 	?>
31 31
 	<div id="poststuff">
32 32
 		<div class="postbox">
33 33
 
34
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
34
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
35 35
 
36 36
 			<div class="inside recount-stats-controls">
37
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
37
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
38 38
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
39 39
 
40
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
40
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
41 41
 
42 42
 					<select name="give-export-class" id="recount-stats-type">
43
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
44
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
45
-						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option>
46
-						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option>
47
-						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
48
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option>
49
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
50
-						<?php do_action( 'give_recount_tool_options' ); ?>
43
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
44
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
45
+						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option>
46
+						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option>
47
+						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
48
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option>
49
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
50
+						<?php do_action('give_recount_tool_options'); ?>
51 51
 					</select>
52 52
 
53 53
 					<span id="tools-form-dropdown" style="display: none">
54 54
 						<?php
55 55
 						$args = array(
56 56
 							'name'   => 'form_id',
57
-							'number' => - 1,
57
+							'number' => -1,
58 58
 							'chosen' => true,
59 59
 						);
60
-						echo Give()->html->forms_dropdown( $args );
60
+						echo Give()->html->forms_dropdown($args);
61 61
 						?>
62 62
 					</span>
63 63
 
64
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
64
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
65 65
 
66 66
 					<br/>
67 67
 
68 68
 					<span class="give-recount-stats-descriptions">
69
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
69
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
70 70
 						<span id="recount-form"><?php
71 71
 							printf(
72 72
 								/* translators: %s: form singular label */
73
-								esc_html( 'Recalculates the donation and income stats for a specific %s.', 'give' ),
74
-								give_get_forms_label_singular( true )
73
+								esc_html('Recalculates the donation and income stats for a specific %s.', 'give'),
74
+								give_get_forms_label_singular(true)
75 75
 							);
76 76
 						?></span>
77 77
 						<span id="recount-all"><?php
78 78
 							printf(
79 79
 								/* translators: %s: form plural label */
80
-								esc_html( 'Recalculates the earnings and sales stats for all %s.', 'give' ),
81
-								give_get_forms_label_plural( true )
80
+								esc_html('Recalculates the earnings and sales stats for all %s.', 'give'),
81
+								give_get_forms_label_plural(true)
82 82
 							);
83 83
 						?></span>
84
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
85
-						<?php do_action( 'give_recount_tool_descriptions' ); ?>
86
-						<span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span>
87
-						<span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
84
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
85
+						<?php do_action('give_recount_tool_descriptions'); ?>
86
+						<span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span>
87
+						<span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
88 88
 					</span>
89 89
 
90 90
 					<span class="spinner"></span>
91 91
 
92 92
 				</form>
93
-				<?php do_action( 'give_tools_recount_forms' ); ?>
93
+				<?php do_action('give_tools_recount_forms'); ?>
94 94
 			</div><!-- .inside -->
95 95
 		</div><!-- .postbox -->
96 96
 	</div><!-- #poststuff -->
97 97
 	<?php
98
-	do_action( 'give_tools_recount_stats_after' );
98
+	do_action('give_tools_recount_stats_after');
99 99
 }
100 100
 
101
-add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' );
101
+add_action('give_reports_tab_tools', 'give_tools_recount_stats_display');
Please login to merge, or discard this patch.
includes/admin/customers/customers.php 1 patch
Spacing   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_customers_page() {
26 26
 	$default_views  = give_customer_views();
27
-	$requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'customers';
28
-	if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) {
29
-		give_render_customer_view( $requested_view, $default_views );
27
+	$requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'customers';
28
+	if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) {
29
+		give_render_customer_view($requested_view, $default_views);
30 30
 	} else {
31 31
 		give_customers_list();
32 32
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	$views = array();
44 44
 
45
-	return apply_filters( 'give_customer_views', $views );
45
+	return apply_filters('give_customer_views', $views);
46 46
 
47 47
 }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	$tabs = array();
58 58
 
59
-	return apply_filters( 'give_customer_tabs', $tabs );
59
+	return apply_filters('give_customer_tabs', $tabs);
60 60
 
61 61
 }
62 62
 
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
  * @return void
68 68
  */
69 69
 function give_customers_list() {
70
-	include( dirname( __FILE__ ) . '/class-customer-table.php' );
70
+	include(dirname(__FILE__).'/class-customer-table.php');
71 71
 
72 72
 	$customers_table = new Give_Customer_Reports_Table();
73 73
 	$customers_table->prepare_items();
74 74
 	?>
75 75
 	<div class="wrap">
76
-		<h2><?php esc_html_e( 'Donors', 'give' ); ?></h2>
77
-		<?php do_action( 'give_donors_table_top' ); ?>
78
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>">
76
+		<h2><?php esc_html_e('Donors', 'give'); ?></h2>
77
+		<?php do_action('give_donors_table_top'); ?>
78
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>">
79 79
 			<?php
80
-			$customers_table->search_box( esc_html( 'Search Donors', 'give' ), 'give-donors' );
80
+			$customers_table->search_box(esc_html('Search Donors', 'give'), 'give-donors');
81 81
 			$customers_table->display();
82 82
 			?>
83 83
 			<input type="hidden" name="post_type" value="give_forms" />
84 84
 			<input type="hidden" name="page" value="give-donors" />
85 85
 			<input type="hidden" name="view" value="customers" />
86 86
 		</form>
87
-		<?php do_action( 'give_donors_table_bottom' ); ?>
87
+		<?php do_action('give_donors_table_bottom'); ?>
88 88
 	</div>
89 89
 	<?php
90 90
 }
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
  *
100 100
  * @return void
101 101
  */
102
-function give_render_customer_view( $view, $callbacks ) {
102
+function give_render_customer_view($view, $callbacks) {
103 103
 
104 104
 	$render = true;
105 105
 
106
-	$customer_view_role = apply_filters( 'give_view_customers_role', 'view_give_reports' );
106
+	$customer_view_role = apply_filters('give_view_customers_role', 'view_give_reports');
107 107
 
108
-	if ( ! current_user_can( $customer_view_role ) ) {
109
-		give_set_error( 'give-no-access', esc_html( 'You are not permitted to view this data.', 'give' ) );
108
+	if ( ! current_user_can($customer_view_role)) {
109
+		give_set_error('give-no-access', esc_html('You are not permitted to view this data.', 'give'));
110 110
 		$render = false;
111 111
 	}
112 112
  
113
-	if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
114
-		give_set_error( 'give-invalid_customer', esc_html( 'Invalid Donor ID Provided.', 'give' ) );
113
+	if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
114
+		give_set_error('give-invalid_customer', esc_html('Invalid Donor ID Provided.', 'give'));
115 115
 		$render = false;
116 116
 	}
117 117
 
118 118
 	$customer_id = (int) $_GET['id'];
119
-	$customer    = new Give_Customer( $customer_id );
119
+	$customer    = new Give_Customer($customer_id);
120 120
 
121
-	if ( empty( $customer->id ) ) {
122
-		give_set_error( 'give-invalid_customer', esc_html( 'Invalid Donor ID Provided.', 'give' ) );
121
+	if (empty($customer->id)) {
122
+		give_set_error('give-invalid_customer', esc_html('Invalid Donor ID Provided.', 'give'));
123 123
 		$render = false;
124 124
 	}
125 125
 
@@ -128,27 +128,27 @@  discard block
 block discarded – undo
128 128
 
129 129
 	<div class='wrap'>
130 130
 
131
-		<?php if ( give_get_errors() ) : ?>
131
+		<?php if (give_get_errors()) : ?>
132 132
 			<div class="error settings-error">
133
-				<?php give_print_errors( 0 ); ?>
133
+				<?php give_print_errors(0); ?>
134 134
 			</div>
135 135
 		<?php endif; ?>
136 136
 
137
-		<?php if ( $customer && $render ) : ?>
137
+		<?php if ($customer && $render) : ?>
138 138
 
139 139
 			<div id="customer-tab-wrapper">
140 140
 				<ul id="customer-tab-wrapper-list" class="nav-tab-wrapper">
141
-					<?php foreach ( $customer_tabs as $key => $tab ) : ?>
141
+					<?php foreach ($customer_tabs as $key => $tab) : ?>
142 142
 						<?php $active = $key === $view ? true : false; ?>
143 143
 						<?php $class = $active ? 'active' : 'inactive'; ?>
144 144
 
145
-						<li class="<?php echo sanitize_html_class( $class ); ?>">
146
-							<?php if ( ! $active ) : ?>
147
-							<a title="<?php esc_attr_e( $tab['title'] ); ?>" aria-label="<?php esc_attr_e( $tab['title'] ); ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $customer->id ) ); ?>">
145
+						<li class="<?php echo sanitize_html_class($class); ?>">
146
+							<?php if ( ! $active) : ?>
147
+							<a title="<?php esc_attr_e($tab['title']); ?>" aria-label="<?php esc_attr_e($tab['title']); ?>" href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$customer->id)); ?>">
148 148
 								<?php endif; ?>
149 149
 
150
-								<span class="dashicons <?php echo sanitize_html_class( $tab['dashicon'] ); ?>"></span> <?php esc_html_e( $tab['title'] ); ?>
151
-								<?php if ( ! $active ) : ?>
150
+								<span class="dashicons <?php echo sanitize_html_class($tab['dashicon']); ?>"></span> <?php esc_html_e($tab['title']); ?>
151
+								<?php if ( ! $active) : ?>
152 152
 							</a>
153 153
 						<?php endif; ?>
154 154
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			</div>
161 161
 
162 162
 			<div id="give-customer-card-wrapper">
163
-				<?php $callbacks[ $view ]( $customer ) ?>
163
+				<?php $callbacks[$view]($customer) ?>
164 164
 			</div>
165 165
 
166 166
 		<?php endif; ?>
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
  *
181 181
  * @return void
182 182
  */
183
-function give_customers_view( $customer ) {
183
+function give_customers_view($customer) {
184 184
 
185
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
185
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
186 186
 
187 187
 	?>
188 188
 
189
-	<?php do_action( 'give_donor_card_top', $customer ); ?>
189
+	<?php do_action('give_donor_card_top', $customer); ?>
190 190
 
191 191
 	<div id="donor-summary" class="info-wrapper customer-section postbox">
192 192
 
193
-		<form id="edit-customer-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>">
193
+		<form id="edit-customer-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>">
194 194
 
195 195
 			<div class="customer-info">
196 196
 
@@ -198,22 +198,22 @@  discard block
 block discarded – undo
198 198
 				<div class="donor-bio-header clearfix">
199 199
 
200 200
 					<div class="avatar-wrap left" id="customer-avatar">
201
-						<?php echo get_avatar( $customer->email ); ?>
201
+						<?php echo get_avatar($customer->email); ?>
202 202
 					</div>
203 203
 
204 204
 					<div class="customer-id" class="left">
205 205
 						#<?php echo $customer->id; ?>
206 206
 					</div>
207 207
 					<div id="customer-name-wrap" class="left">
208
-						<span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e( $customer->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span>
208
+						<span class="customer-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php esc_attr_e($customer->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span>
209 209
 						<span class="customer-name info-item editable"><span data-key="name"><?php echo $customer->name; ?></span></span>
210 210
 					</div>
211 211
 					<p class="customer-since info-item">
212
-						<?php esc_html_e( 'Donor since', 'give' ); ?>
213
-						<?php echo date_i18n( get_option( 'date_format' ), strtotime( $customer->date_created ) ) ?>
212
+						<?php esc_html_e('Donor since', 'give'); ?>
213
+						<?php echo date_i18n(get_option('date_format'), strtotime($customer->date_created)) ?>
214 214
 					</p>
215
-					<?php if ( current_user_can( $customer_edit_role ) ): ?>
216
-						<a title="<?php esc_attr_e( 'Edit Donor', 'give' ); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a>
215
+					<?php if (current_user_can($customer_edit_role)): ?>
216
+						<a title="<?php esc_attr_e('Edit Donor', 'give'); ?>" href="#" id="edit-customer" class="button info-item editable customer-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a>
217 217
 					<?php endif; ?>
218 218
 				</div>
219 219
 				<!-- /donor-bio-header -->
@@ -223,14 +223,14 @@  discard block
 block discarded – undo
223 223
 					<table class="widefat">
224 224
 						<tbody>
225 225
 						<tr>
226
-							<td><label for="tablecell"><?php esc_html_e( 'Email', 'give' ); ?></label>:</td>
226
+							<td><label for="tablecell"><?php esc_html_e('Email', 'give'); ?></label>:</td>
227 227
 							<td class="row-title">
228
-								<span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e( 'Donor Email', 'give' ); ?>" /></span>
228
+								<span class="customer-name info-item edit-item"><input size="20" data-key="email" name="customerinfo[email]" type="text" value="<?php echo $customer->email; ?>" placeholder="<?php esc_attr_e('Donor Email', 'give'); ?>" /></span>
229 229
 								<span class="customer-email info-item editable" data-key="email"><?php echo $customer->email; ?></span>
230 230
 							</td>
231 231
 						</tr>
232 232
 						<tr class="alternate">
233
-							<td><label for="tablecell"><?php esc_html_e( 'User ID', 'give' ); ?></label>:</td>
233
+							<td><label for="tablecell"><?php esc_html_e('User ID', 'give'); ?></label>:</td>
234 234
 							<td class="row-title">
235 235
 								<span class="customer-user-id info-item edit-item">
236 236
 									<?php
@@ -246,38 +246,38 @@  discard block
 block discarded – undo
246 246
 										'data'  => $data_atts,
247 247
 									);
248 248
 
249
-									if ( ! empty( $user_id ) ) {
250
-										$userdata           = get_userdata( $user_id );
249
+									if ( ! empty($user_id)) {
250
+										$userdata           = get_userdata($user_id);
251 251
 										$user_args['value'] = $userdata->user_login;
252 252
 									}
253 253
 
254
-									echo Give()->html->ajax_user_search( $user_args );
254
+									echo Give()->html->ajax_user_search($user_args);
255 255
 									?>
256 256
 									<input type="hidden" name="customerinfo[user_id]" data-key="user_id" value="<?php echo $customer->user_id; ?>" />
257 257
 								</span>
258 258
 			
259 259
 								<span class="customer-user-id info-item editable">
260
-									<?php if ( intval( $customer->user_id ) > 0 ) : ?>
260
+									<?php if (intval($customer->user_id) > 0) : ?>
261 261
 										<span data-key="user_id"><?php echo $customer->user_id; ?></span>
262 262
 									<?php else : ?>
263
-										<span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span>
263
+										<span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span>
264 264
 									<?php endif; ?>
265
-									<?php if ( current_user_can( $customer_edit_role ) && intval( $customer->user_id ) > 0 ) : ?>
266
-										<span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e( 'Disconnects the current user ID from this customer record', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span>
265
+									<?php if (current_user_can($customer_edit_role) && intval($customer->user_id) > 0) : ?>
266
+										<span class="disconnect-user"> - <a id="disconnect-customer" href="#disconnect" title="<?php esc_attr_e('Disconnects the current user ID from this customer record', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span>
267 267
 									<?php endif; ?>
268 268
 								</span>
269 269
 							</td>
270 270
 						</tr>
271
-						<?php if ( isset( $customer->user_id ) && $customer->user_id > 0 ) : ?>
271
+						<?php if (isset($customer->user_id) && $customer->user_id > 0) : ?>
272 272
 
273 273
 							<tr>
274
-								<td><?php esc_html_e( 'Address', 'give' ); ?>:</td>
274
+								<td><?php esc_html_e('Address', 'give'); ?>:</td>
275 275
 								<td class="row-title">
276 276
 
277 277
 									<div class="customer-address-wrapper">
278 278
 
279 279
 										<?php
280
-										$address  = get_user_meta( $customer->user_id, '_give_user_address', true );
280
+										$address  = get_user_meta($customer->user_id, '_give_user_address', true);
281 281
 										$defaults = array(
282 282
 											'line1'   => '',
283 283
 											'line2'   => '',
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 											'zip'     => ''
288 288
 										);
289 289
 
290
-										$address = wp_parse_args( $address, $defaults );
290
+										$address = wp_parse_args($address, $defaults);
291 291
 										?>
292 292
 
293
-										<?php if ( ! empty( $address ) ) { ?>
293
+										<?php if ( ! empty($address)) { ?>
294 294
 											<span class="customer-address info-item editable">
295 295
 												<span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span>
296 296
 												<span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span>
@@ -301,38 +301,38 @@  discard block
 block discarded – undo
301 301
 											</span>
302 302
 										<?php } ?>
303 303
 										<span class="customer-address info-item edit-item">
304
-											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" />
305
-											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" />
306
-											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" />
304
+											<input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" />
305
+											<input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" />
306
+											<input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" />
307 307
 											<select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item">
308 308
 												<?php
309 309
 
310 310
 												$selected_country = $address['country'];
311 311
 
312 312
 												$countries = give_get_country_list();
313
-												foreach ( $countries as $country_code => $country ) {
314
-													echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';
313
+												foreach ($countries as $country_code => $country) {
314
+													echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>';
315 315
 												}
316 316
 												?>
317 317
 											</select>
318 318
 											<?php
319 319
 											$selected_state = give_get_state();
320
-											$states         = give_get_states( $selected_country );
320
+											$states         = give_get_states($selected_country);
321 321
 
322
-											$selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state;
322
+											$selected_state = isset($address['state']) ? $address['state'] : $selected_state;
323 323
 
324
-											if ( ! empty( $states ) ) : ?>
324
+											if ( ! empty($states)) : ?>
325 325
 												<select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item">
326 326
 													<?php
327
-													foreach ( $states as $state_code => $state ) {
328
-														echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';
327
+													foreach ($states as $state_code => $state) {
328
+														echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>';
329 329
 													}
330 330
 													?>
331 331
 												</select>
332 332
 											<?php else : ?>
333
-												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province', 'give' ); ?>" />
333
+												<input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province', 'give'); ?>" />
334 334
 											<?php endif; ?>
335
-											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Postal', 'give' ); ?>" value="<?php echo $address['zip']; ?>" />
335
+											<input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Postal', 'give'); ?>" value="<?php echo $address['zip']; ?>" />
336 336
 													</span>
337 337
 
338 338
 									</div>
@@ -350,112 +350,112 @@  discard block
 block discarded – undo
350 350
 
351 351
 			<span id="customer-edit-actions" class="edit-item">
352 352
 				<input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $customer->id; ?>" />
353
-				<?php wp_nonce_field( 'edit-customer', '_wpnonce', false, true ); ?>
353
+				<?php wp_nonce_field('edit-customer', '_wpnonce', false, true); ?>
354 354
 				<input type="hidden" name="give_action" value="edit-customer" />
355
-				<input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" />
356
-				<a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
355
+				<input type="submit" id="give-edit-customer-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" />
356
+				<a id="give-edit-customer-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a>
357 357
 			</span>
358 358
 
359 359
 		</form>
360 360
 	</div>
361 361
 
362
-	<?php do_action( 'give_donor_before_stats', $customer ); ?>
362
+	<?php do_action('give_donor_before_stats', $customer); ?>
363 363
 
364 364
 	<div id="customer-stats-wrapper" class="customer-section postbox clear">
365 365
 		<ul>
366 366
 			<li>
367
-				<a title="<?php esc_attr_e( 'View All Donations', 'give' ); ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $customer->email ) ); ?>">
367
+				<a title="<?php esc_attr_e('View All Donations', 'give'); ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($customer->email)); ?>">
368 368
 					<span class="dashicons dashicons-heart"></span>
369 369
 					<?php
370 370
 					//Completed Donations
371
-					$completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give' ), $customer->purchase_count );
372
-					echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $customer );
371
+					$completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $customer->purchase_count, 'give'), $customer->purchase_count);
372
+					echo apply_filters('give_donor_completed_donations', $completed_donations_text, $customer);
373 373
 					?>
374 374
 				</a>
375 375
 			</li>
376 376
 			<li>
377 377
 				<span class="dashicons dashicons-chart-area"></span>
378
-				<?php echo give_currency_filter( give_format_amount( $customer->purchase_value ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?>
378
+				<?php echo give_currency_filter(give_format_amount($customer->purchase_value)); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?>
379 379
 			</li>
380
-			<?php do_action( 'give_donor_stats_list', $customer ); ?>
380
+			<?php do_action('give_donor_stats_list', $customer); ?>
381 381
 		</ul>
382 382
 	</div>
383 383
 
384
-	<?php do_action( 'give_donor_before_tables_wrapper', $customer ); ?>
384
+	<?php do_action('give_donor_before_tables_wrapper', $customer); ?>
385 385
 
386 386
 	<div id="customer-tables-wrapper" class="customer-section">
387 387
 
388
-		<?php do_action( 'give_donor_before_tables', $customer ); ?>
388
+		<?php do_action('give_donor_before_tables', $customer); ?>
389 389
 
390
-		<h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3>
390
+		<h3><?php esc_html_e('Recent Donations', 'give'); ?></h3>
391 391
 		<?php
392
-		$payment_ids = explode( ',', $customer->payment_ids );
393
-		$payments    = give_get_payments( array( 'post__in' => $payment_ids ) );
394
-		$payments    = array_slice( $payments, 0, 10 );
392
+		$payment_ids = explode(',', $customer->payment_ids);
393
+		$payments    = give_get_payments(array('post__in' => $payment_ids));
394
+		$payments    = array_slice($payments, 0, 10);
395 395
 		?>
396 396
 		<table class="wp-list-table widefat striped payments">
397 397
 			<thead>
398 398
 			<tr>
399
-				<th><?php esc_html_e( 'ID', 'give' ); ?></th>
400
-				<th><?php esc_html_e( 'Amount', 'give' ); ?></th>
401
-				<th><?php esc_html_e( 'Date', 'give' ); ?></th>
402
-				<th><?php esc_html_e( 'Status', 'give' ); ?></th>
403
-				<th><?php esc_html_e( 'Actions', 'give' ); ?></th>
399
+				<th><?php esc_html_e('ID', 'give'); ?></th>
400
+				<th><?php esc_html_e('Amount', 'give'); ?></th>
401
+				<th><?php esc_html_e('Date', 'give'); ?></th>
402
+				<th><?php esc_html_e('Status', 'give'); ?></th>
403
+				<th><?php esc_html_e('Actions', 'give'); ?></th>
404 404
 			</tr>
405 405
 			</thead>
406 406
 			<tbody>
407
-			<?php if ( ! empty( $payments ) ) : ?>
408
-				<?php foreach ( $payments as $payment ) : ?>
407
+			<?php if ( ! empty($payments)) : ?>
408
+				<?php foreach ($payments as $payment) : ?>
409 409
 					<tr>
410 410
 						<td><?php echo $payment->ID; ?></td>
411
-						<td><?php echo give_payment_amount( $payment->ID ); ?></td>
412
-						<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $payment->post_date ) ); ?></td>
413
-						<td><?php echo give_get_payment_status( $payment, true ); ?></td>
411
+						<td><?php echo give_payment_amount($payment->ID); ?></td>
412
+						<td><?php echo date_i18n(get_option('date_format'), strtotime($payment->post_date)); ?></td>
413
+						<td><?php echo give_get_payment_status($payment, true); ?></td>
414 414
 						<td>
415
-							<a title="<?php esc_attr_e( 'View Details for Donation', 'give' );
416
-							echo ' ' . $payment->ID; ?>" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment->ID ); ?>">
417
-								<?php esc_html_e( 'View Details', 'give' ); ?>
415
+							<a title="<?php esc_attr_e('View Details for Donation', 'give');
416
+							echo ' '.$payment->ID; ?>" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment->ID); ?>">
417
+								<?php esc_html_e('View Details', 'give'); ?>
418 418
 							</a>
419
-							<?php do_action( 'give_donor_recent_purchases_actions', $customer, $payment ); ?>
419
+							<?php do_action('give_donor_recent_purchases_actions', $customer, $payment); ?>
420 420
 						</td>
421 421
 					</tr>
422 422
 				<?php endforeach; ?>
423 423
 			<?php else: ?>
424 424
 				<tr>
425
-					<td colspan="5"><?php esc_html_e( 'No Donations Found', 'give' ); ?></td>
425
+					<td colspan="5"><?php esc_html_e('No Donations Found', 'give'); ?></td>
426 426
 				</tr>
427 427
 			<?php endif; ?>
428 428
 			</tbody>
429 429
 		</table>
430 430
 
431
-		<h3><?php esc_html_e( 'Completed Donations', 'give' ); ?></h3>
431
+		<h3><?php esc_html_e('Completed Donations', 'give'); ?></h3>
432 432
 		<?php
433
-		$donations = give_get_users_completed_donations( $customer->email );
433
+		$donations = give_get_users_completed_donations($customer->email);
434 434
 		?>
435 435
 		<table class="wp-list-table widefat striped donations">
436 436
 			<thead>
437 437
 			<tr>
438 438
 				<th><?php echo give_get_forms_label_singular(); ?></th>
439
-				<th width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th>
439
+				<th width="120px"><?php esc_html_e('Actions', 'give'); ?></th>
440 440
 			</tr>
441 441
 			</thead>
442 442
 			<tbody>
443
-			<?php if ( ! empty( $donations ) ) : ?>
444
-				<?php foreach ( $donations as $donation ) : ?>
443
+			<?php if ( ! empty($donations)) : ?>
444
+				<?php foreach ($donations as $donation) : ?>
445 445
 					<tr>
446 446
 						<td><?php echo $donation->post_title; ?></td>
447 447
 						<td>
448 448
 							<a title="<?php
449 449
 								printf(
450 450
 									/* translators: %s: post title */
451
-									esc_attr( 'View %s', 'give' ),
451
+									esc_attr('View %s', 'give'),
452 452
 									$donation->post_title
453
-								); ?>" href="<?php echo esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) );
453
+								); ?>" href="<?php echo esc_url(admin_url('post.php?action=edit&post='.$donation->ID));
454 454
 							?>">
455 455
 								<?php
456 456
 									printf(
457 457
 										/* translators: %s: forms singular label */
458
-										esc_html( 'View %s', 'give' ),
458
+										esc_html('View %s', 'give'),
459 459
 										give_get_forms_label_singular()
460 460
 									);
461 461
 								?>
@@ -465,17 +465,17 @@  discard block
 block discarded – undo
465 465
 				<?php endforeach; ?>
466 466
 			<?php else: ?>
467 467
 				<tr>
468
-					<td colspan="2"><?php esc_html_e( 'No Completed Donations Found', 'give' ); ?></td>
468
+					<td colspan="2"><?php esc_html_e('No Completed Donations Found', 'give'); ?></td>
469 469
 				</tr>
470 470
 			<?php endif; ?>
471 471
 			</tbody>
472 472
 		</table>
473 473
 
474
-		<?php do_action( 'give_donor_after_tables', $customer ); ?>
474
+		<?php do_action('give_donor_after_tables', $customer); ?>
475 475
 
476 476
 	</div>
477 477
 
478
-	<?php do_action( 'give_donor_card_bottom', $customer ); ?>
478
+	<?php do_action('give_donor_card_bottom', $customer); ?>
479 479
 
480 480
 	<?php
481 481
 }
@@ -489,30 +489,30 @@  discard block
 block discarded – undo
489 489
  *
490 490
  * @return void
491 491
  */
492
-function give_customer_notes_view( $customer ) {
492
+function give_customer_notes_view($customer) {
493 493
 
494
-	$paged          = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1;
495
-	$paged          = absint( $paged );
494
+	$paged          = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1;
495
+	$paged          = absint($paged);
496 496
 	$note_count     = $customer->get_notes_count();
497
-	$per_page       = apply_filters( 'give_customer_notes_per_page', 20 );
498
-	$total_pages    = ceil( $note_count / $per_page );
499
-	$customer_notes = $customer->get_notes( $per_page, $paged );
497
+	$per_page       = apply_filters('give_customer_notes_per_page', 20);
498
+	$total_pages    = ceil($note_count / $per_page);
499
+	$customer_notes = $customer->get_notes($per_page, $paged);
500 500
 	?>
501 501
 
502 502
 	<div id="customer-notes-wrapper">
503 503
 		<div class="customer-notes-header">
504
-			<?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span>
504
+			<?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span>
505 505
 		</div>
506
-		<h3><?php esc_html_e( 'Notes', 'give' ); ?></h3>
506
+		<h3><?php esc_html_e('Notes', 'give'); ?></h3>
507 507
 
508
-		<?php if ( 1 == $paged ) : ?>
508
+		<?php if (1 == $paged) : ?>
509 509
 			<div style="display: block; margin-bottom: 55px;">
510
-				<form id="give-add-customer-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $customer->id ); ?>">
510
+				<form id="give-add-customer-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$customer->id); ?>">
511 511
 					<textarea id="customer-note" name="customer_note" class="customer-note-input" rows="10"></textarea>
512 512
 					<br />
513 513
 					<input type="hidden" id="customer-id" name="customer_id" value="<?php echo $customer->id; ?>" />
514 514
 					<input type="hidden" name="give_action" value="add-customer-note" />
515
-					<?php wp_nonce_field( 'add-customer-note', 'add_customer_note_nonce', true, true ); ?>
515
+					<?php wp_nonce_field('add-customer-note', 'add_customer_note_nonce', true, true); ?>
516 516
 					<input id="add-customer-note" class="right button-primary" type="submit" value="Add Note" />
517 517
 				</form>
518 518
 			</div>
@@ -527,46 +527,46 @@  discard block
 block discarded – undo
527 527
 			'show_all' => true
528 528
 		);
529 529
 
530
-		echo paginate_links( $pagination_args );
530
+		echo paginate_links($pagination_args);
531 531
 		?>
532 532
 
533 533
 		<div id="give-customer-notes" class="postbox">
534
-			<?php if ( count( $customer_notes ) > 0 ) : ?>
535
-				<?php foreach ( $customer_notes as $key => $note ) : ?>
534
+			<?php if (count($customer_notes) > 0) : ?>
535
+				<?php foreach ($customer_notes as $key => $note) : ?>
536 536
 					<div class="customer-note-wrapper dashboard-comment-wrap comment-item">
537 537
 					<span class="note-content-wrap">
538
-						<?php echo stripslashes( $note ); ?>
538
+						<?php echo stripslashes($note); ?>
539 539
 					</span>
540 540
 					</div>
541 541
 				<?php endforeach; ?>
542 542
 			<?php else: ?>
543 543
 				<div class="give-no-customer-notes">
544
-					<?php esc_html_e( 'No Donor Notes', 'give' ); ?>
544
+					<?php esc_html_e('No Donor Notes', 'give'); ?>
545 545
 				</div>
546 546
 			<?php endif; ?>
547 547
 		</div>
548 548
 
549
-		<?php echo paginate_links( $pagination_args ); ?>
549
+		<?php echo paginate_links($pagination_args); ?>
550 550
 
551 551
 	</div>
552 552
 
553 553
 	<?php
554 554
 }
555 555
 
556
-function give_customers_delete_view( $customer ) {
556
+function give_customers_delete_view($customer) {
557 557
 
558
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
558
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
559 559
 
560 560
 	?>
561 561
 
562
-	<?php do_action( 'give_customer_delete_top', $customer ); ?>
562
+	<?php do_action('give_customer_delete_top', $customer); ?>
563 563
 
564 564
 	<div class="info-wrapper customer-section">
565 565
 
566
-		<form id="delete-customer" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer->id ); ?>">
566
+		<form id="delete-customer" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$customer->id); ?>">
567 567
 
568 568
 			<div class="customer-notes-header">
569
-				<?php echo get_avatar( $customer->email, 30 ); ?> <span><?php echo $customer->name; ?></span>
569
+				<?php echo get_avatar($customer->email, 30); ?> <span><?php echo $customer->name; ?></span>
570 570
 			</div>
571 571
 
572 572
 
@@ -574,27 +574,27 @@  discard block
 block discarded – undo
574 574
 
575 575
 				<span class="delete-customer-options">
576 576
 					<p>
577
-						<?php echo Give()->html->checkbox( array( 'name' => 'give-customer-delete-confirm' ) ); ?>
578
-						<label for="give-customer-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label>
577
+						<?php echo Give()->html->checkbox(array('name' => 'give-customer-delete-confirm')); ?>
578
+						<label for="give-customer-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label>
579 579
 					</p>
580 580
 
581 581
 					<p>
582
-						<?php echo Give()->html->checkbox( array(
582
+						<?php echo Give()->html->checkbox(array(
583 583
 							'name'    => 'give-customer-delete-records',
584
-							'options' => array( 'disabled' => true )
585
-						) ); ?>
586
-						<label for="give-customer-delete-records"><?php esc_html_e( 'Delete all associated payments and records?', 'give' ); ?></label>
584
+							'options' => array('disabled' => true)
585
+						)); ?>
586
+						<label for="give-customer-delete-records"><?php esc_html_e('Delete all associated payments and records?', 'give'); ?></label>
587 587
 					</p>
588 588
 
589
-					<?php do_action( 'give_customer_delete_inputs', $customer ); ?>
589
+					<?php do_action('give_customer_delete_inputs', $customer); ?>
590 590
 				</span>
591 591
 
592 592
 				<span id="customer-edit-actions">
593 593
 					<input type="hidden" name="customer_id" value="<?php echo $customer->id; ?>" />
594
-					<?php wp_nonce_field( 'delete-customer', '_wpnonce', false, true ); ?>
594
+					<?php wp_nonce_field('delete-customer', '_wpnonce', false, true); ?>
595 595
 					<input type="hidden" name="give_action" value="delete-customer" />
596
-					<input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" />
597
-					<a id="give-delete-customer-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
596
+					<input type="submit" disabled="disabled" id="give-delete-customer" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" />
597
+					<a id="give-delete-customer-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a>
598 598
 				</span>
599 599
 
600 600
 			</div>
@@ -604,5 +604,5 @@  discard block
 block discarded – undo
604 604
 
605 605
 	<?php
606 606
 
607
-	do_action( 'give_customer_delete_bottom', $customer );
607
+	do_action('give_customer_delete_bottom', $customer);
608 608
 }
Please login to merge, or discard this patch.