Completed
Push — master ( 4562c5...8fef4a )
by Devin
10s
created
includes/scripts.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Scripts
4
- *
5
- * @package     Give
6
- * @subpackage  Functions
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+	 * Scripts
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Functions
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +130 added lines, -130 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,93 +28,93 @@  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'          => __( 'Please select a payment method', 'give' ),
47
-		'bad_minimum'         => __( 'The minimum donation amount for this form is', 'give' ),
48
-		'general_loading'     => __( 'Loading...', 'give' ),
49
-		'purchase_loading'    => __( 'Please Wait...', 'give' ),
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'          => __('Please select a payment method', 'give'),
47
+		'bad_minimum'         => __('The minimum donation amount for this form is', 'give'),
48
+		'general_loading'     => __('Loading...', 'give'),
49
+		'purchase_loading'    => __('Please Wait...', 'give'),
50 50
 		'give_version'        => GIVE_VERSION
51
-	) );
52
-	$localize_give_ajax     = apply_filters( 'give_global_ajax_vars', array(
51
+	));
52
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
53 53
 		'ajaxurl'          => give_get_ajax_url(),
54
-		'loading'          => __( 'Loading', 'give' ),
54
+		'loading'          => __('Loading', 'give'),
55 55
 		// General loading message
56
-		'select_option'    => __( 'Please select an option', 'give' ),
56
+		'select_option'    => __('Please select an option', 'give'),
57 57
 		// Variable pricing error with multi-purchase option enabled
58
-		'default_gateway'  => give_get_default_gateway( null ),
59
-		'permalinks'       => get_option( 'permalink_structure' ) ? '1' : '0',
60
-		'number_decimals'  => apply_filters( 'give_format_amount_decimals', 2 )
61
-	) );
58
+		'default_gateway'  => give_get_default_gateway(null),
59
+		'permalinks'       => get_option('permalink_structure') ? '1' : '0',
60
+		'number_decimals'  => apply_filters('give_format_amount_decimals', 2)
61
+	));
62 62
 
63 63
 	//DEBUG is On
64
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
64
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
65 65
 
66
-		if ( give_is_cc_verify_enabled() ) {
67
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
68
-			wp_enqueue_script( 'give-cc-validator' );
66
+		if (give_is_cc_verify_enabled()) {
67
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
68
+			wp_enqueue_script('give-cc-validator');
69 69
 		}
70 70
 
71
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
72
-		wp_enqueue_script( 'give-float-labels' );
71
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
72
+		wp_enqueue_script('give-float-labels');
73 73
 
74
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
75
-		wp_enqueue_script( 'give-blockui' );
74
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
75
+		wp_enqueue_script('give-blockui');
76 76
 
77
-		wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
78
-		wp_enqueue_script( 'give-qtip' );
77
+		wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
78
+		wp_enqueue_script('give-qtip');
79 79
 
80
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
81
-		wp_enqueue_script( 'give-accounting' );
80
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
81
+		wp_enqueue_script('give-accounting');
82 82
 
83
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
84
-		wp_enqueue_script( 'give-magnific' );
83
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
84
+		wp_enqueue_script('give-magnific');
85 85
 
86
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
87
-		wp_enqueue_script( 'give-checkout-global' );
86
+		wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
87
+		wp_enqueue_script('give-checkout-global');
88 88
 
89 89
 		//General scripts
90
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
91
-		wp_enqueue_script( 'give-scripts' );
90
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
91
+		wp_enqueue_script('give-scripts');
92 92
 
93 93
 		// Load AJAX scripts, if enabled
94
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
95
-		wp_enqueue_script( 'give-ajax' );
94
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
95
+		wp_enqueue_script('give-ajax');
96 96
 
97 97
 		//Localize / Pass AJAX vars from PHP
98
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_checkout );
99
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
98
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_checkout);
99
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
100 100
 
101 101
 
102 102
 	} else {
103 103
 
104 104
 		//DEBUG is OFF (one JS file to rule them all!)
105
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
106
-		wp_enqueue_script( 'give' );
105
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
106
+		wp_enqueue_script('give');
107 107
 
108 108
 		//Localize / Pass AJAX vars from PHP
109
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_checkout );
110
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
109
+		wp_localize_script('give', 'give_global_vars', $localize_give_checkout);
110
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
111 111
 
112 112
 	}
113 113
 
114 114
 
115 115
 }
116 116
 
117
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
117
+add_action('wp_enqueue_scripts', 'give_load_scripts');
118 118
 
119 119
 /**
120 120
  * Register Styles
@@ -126,47 +126,47 @@  discard block
 block discarded – undo
126 126
  */
127 127
 function give_register_styles() {
128 128
 
129
-	if ( give_get_option( 'disable_css', false ) ) {
129
+	if (give_get_option('disable_css', false)) {
130 130
 		return;
131 131
 	}
132 132
 
133 133
 	// Use minified libraries if SCRIPT_DEBUG is turned off
134
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
134
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
135 135
 
136
-	$file          = 'give' . $suffix . '.css';
136
+	$file          = 'give'.$suffix.'.css';
137 137
 	$templates_dir = give_get_theme_template_dir_name();
138 138
 
139
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
140
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give.css';
141
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
142
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give.css';
143
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
139
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
140
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give.css';
141
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
142
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give.css';
143
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
144 144
 
145 145
 	// Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory
146 146
 	// Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled.
147 147
 	// This allows users to copy just give.css to their theme
148
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
149
-		if ( ! empty( $nonmin ) ) {
150
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give.css';
148
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
149
+		if ( ! empty($nonmin)) {
150
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give.css';
151 151
 		} else {
152
-			$url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
152
+			$url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
153 153
 		}
154
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
155
-		if ( ! empty( $nonmin ) ) {
156
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give.css';
154
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
155
+		if ( ! empty($nonmin)) {
156
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.'give.css';
157 157
 		} else {
158
-			$url = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
158
+			$url = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
159 159
 		}
160
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
161
-		$url = trailingslashit( give_get_templates_url() ) . $file;
160
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
161
+		$url = trailingslashit(give_get_templates_url()).$file;
162 162
 	}
163 163
 
164
-	wp_register_style( 'give-styles', $url, array(), GIVE_VERSION, 'all' );
165
-	wp_enqueue_style( 'give-styles' );
164
+	wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all');
165
+	wp_enqueue_style('give-styles');
166 166
 
167 167
 }
168 168
 
169
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
169
+add_action('wp_enqueue_scripts', 'give_register_styles');
170 170
 
171 171
 /**
172 172
  * Load Admin Scripts
@@ -180,93 +180,93 @@  discard block
 block discarded – undo
180 180
  *
181 181
  * @return void
182 182
  */
183
-function give_load_admin_scripts( $hook ) {
183
+function give_load_admin_scripts($hook) {
184 184
 
185 185
 	global $wp_version, $post, $post_type;
186 186
 
187 187
 	//Directories of assets
188
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
189
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
190
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
188
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
189
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
190
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
191 191
 
192 192
 	// Use minified libraries if SCRIPT_DEBUG is turned off
193
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
193
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
194 194
 
195 195
 	//Global Admin:
196
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
197
-	wp_enqueue_style( 'give-admin-bar-notification' );
196
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
197
+	wp_enqueue_style('give-admin-bar-notification');
198 198
 
199 199
 	//Give Admin Only:
200
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
200
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
201 201
 		return;
202 202
 	}
203 203
 
204 204
 	//CSS
205
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
206
-	wp_enqueue_style( 'jquery-ui-css' );
207
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION );
208
-	wp_enqueue_style( 'give-admin' );
209
-	wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION );
210
-	wp_enqueue_style( 'jquery-chosen' );
211
-	wp_enqueue_style( 'thickbox' );
205
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
206
+	wp_enqueue_style('jquery-ui-css');
207
+	wp_register_style('give-admin', $css_dir.'give-admin'.$suffix.'.css', GIVE_VERSION);
208
+	wp_enqueue_style('give-admin');
209
+	wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION);
210
+	wp_enqueue_style('jquery-chosen');
211
+	wp_enqueue_style('thickbox');
212 212
 
213 213
 	//JS
214
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
215
-	wp_enqueue_script( 'jquery-chosen' );
214
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
215
+	wp_enqueue_script('jquery-chosen');
216 216
 
217
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
218
-	wp_enqueue_script( 'give-admin-scripts' );
217
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
218
+	wp_enqueue_script('give-admin-scripts');
219 219
 
220
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
221
-	wp_enqueue_script( 'jquery-flot' );
220
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
221
+	wp_enqueue_script('jquery-flot');
222 222
 
223
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
224
-	wp_enqueue_script( 'give-qtip' );
223
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
224
+	wp_enqueue_script('give-qtip');
225 225
 
226
-	wp_enqueue_script( 'jquery-ui-datepicker' );
227
-	wp_enqueue_script( 'thickbox' );
226
+	wp_enqueue_script('jquery-ui-datepicker');
227
+	wp_enqueue_script('thickbox');
228 228
 
229 229
 	//Forms CPT Script
230
-	if ( $post_type === 'give_forms' ) {
231
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
232
-		wp_enqueue_script( 'give-admin-forms-scripts' );
230
+	if ($post_type === 'give_forms') {
231
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
232
+		wp_enqueue_script('give-admin-forms-scripts');
233 233
 	}
234 234
 
235 235
 	//Localize strings & variables for JS
236
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
237
-		'post_id'                 => isset( $post->ID ) ? $post->ID : null,
236
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
237
+		'post_id'                 => isset($post->ID) ? $post->ID : null,
238 238
 		'give_version'            => GIVE_VERSION,
239
-		'quick_edit_warning'      => __( 'Sorry, not available for variable priced forms.', 'give' ),
240
-		'delete_payment'          => __( 'Are you sure you wish to delete this payment?', 'give' ),
241
-		'delete_payment_note'     => __( 'Are you sure you wish to delete this note?', 'give' ),
242
-		'revoke_api_key'          => __( 'Are you sure you wish to revoke this API key?', 'give' ),
243
-		'regenerate_api_key'      => __( 'Are you sure you wish to regenerate this API key?', 'give' ),
244
-		'resend_receipt'          => __( 'Are you sure you wish to resend the donation receipt?', 'give' ),
245
-		'copy_download_link_text' => __( 'Copy these links to your clipboard and give them to your donor', 'give' ),
246
-		'delete_payment_download' => sprintf( __( 'Are you sure you wish to delete this %s?', 'give' ), give_get_forms_label_singular() ),
247
-		'one_price_min'           => __( 'You must have at least one price', 'give' ),
248
-		'one_file_min'            => __( 'You must have at least one file', 'give' ),
249
-		'one_field_min'           => __( 'You must have at least one field', 'give' ),
250
-		'one_option'              => sprintf( __( 'Choose a %s', 'give' ), give_get_forms_label_singular() ),
251
-		'one_or_more_option'      => sprintf( __( 'Choose one or more %s', 'give' ), give_get_forms_label_plural() ),
252
-		'numeric_item_price'      => __( 'Item price must be numeric', 'give' ),
253
-		'numeric_quantity'        => __( 'Quantity must be numeric', 'give' ),
254
-		'currency_sign'           => give_currency_filter( '' ),
255
-		'currency_pos'            => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
239
+		'quick_edit_warning'      => __('Sorry, not available for variable priced forms.', 'give'),
240
+		'delete_payment'          => __('Are you sure you wish to delete this payment?', 'give'),
241
+		'delete_payment_note'     => __('Are you sure you wish to delete this note?', 'give'),
242
+		'revoke_api_key'          => __('Are you sure you wish to revoke this API key?', 'give'),
243
+		'regenerate_api_key'      => __('Are you sure you wish to regenerate this API key?', 'give'),
244
+		'resend_receipt'          => __('Are you sure you wish to resend the donation receipt?', 'give'),
245
+		'copy_download_link_text' => __('Copy these links to your clipboard and give them to your donor', 'give'),
246
+		'delete_payment_download' => sprintf(__('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()),
247
+		'one_price_min'           => __('You must have at least one price', 'give'),
248
+		'one_file_min'            => __('You must have at least one file', 'give'),
249
+		'one_field_min'           => __('You must have at least one field', 'give'),
250
+		'one_option'              => sprintf(__('Choose a %s', 'give'), give_get_forms_label_singular()),
251
+		'one_or_more_option'      => sprintf(__('Choose one or more %s', 'give'), give_get_forms_label_plural()),
252
+		'numeric_item_price'      => __('Item price must be numeric', 'give'),
253
+		'numeric_quantity'        => __('Quantity must be numeric', 'give'),
254
+		'currency_sign'           => give_currency_filter(''),
255
+		'currency_pos'            => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
256 256
 		'currency_decimals'       => give_currency_decimal_filter(),
257
-		'new_media_ui'            => apply_filters( 'give_use_35_media_ui', 1 ),
258
-		'remove_text'             => __( 'Remove', 'give' ),
259
-		'type_to_search'          => sprintf( __( 'Type to search %s', 'give' ), give_get_forms_label_plural() ),
260
-	) );
257
+		'new_media_ui'            => apply_filters('give_use_35_media_ui', 1),
258
+		'remove_text'             => __('Remove', 'give'),
259
+		'type_to_search'          => sprintf(__('Type to search %s', 'give'), give_get_forms_label_plural()),
260
+	));
261 261
 
262
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) {
262
+	if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) {
263 263
 		//call for new media manager
264 264
 		wp_enqueue_media();
265 265
 	}
266 266
 
267 267
 }
268 268
 
269
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
269
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
270 270
 
271 271
 /**
272 272
  * Admin Give Icon
@@ -283,14 +283,14 @@  discard block
 block discarded – undo
283 283
 	?>
284 284
 	<style type="text/css" media="screen">
285 285
 
286
-		<?php if( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) { ?>
286
+		<?php if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) { ?>
287 287
 		@font-face {
288 288
 			font-family: 'give-icomoon';
289
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>');
290
-			src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
291
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
292
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
293
-			url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
289
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>');
290
+			src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'),
291
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'),
292
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'),
293
+			url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg');
294 294
 			font-weight: normal;
295 295
 			font-style: normal;
296 296
 		}
@@ -309,4 +309,4 @@  discard block
 block discarded – undo
309 309
 	<?php
310 310
 }
311 311
 
312
-add_action( 'admin_head', 'give_admin_icon' );
312
+add_action('admin_head', 'give_admin_icon');
Please login to merge, or discard this patch.
includes/payments/class-payment-stats.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Earnings / Sales Stats
4
- *
5
- * @package     Give
6
- * @subpackage  Classes/Stats
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+	 * Earnings / Sales Stats
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Classes/Stats
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 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
 
@@ -39,46 +39,46 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @return float|int
41 41
 	 */
42
-	public function get_sales( $form_id = 0, $start_date = false, $end_date = false, $status = 'publish' ) {
42
+	public function get_sales($form_id = 0, $start_date = false, $end_date = false, $status = 'publish') {
43 43
 
44
-		$this->setup_dates( $start_date, $end_date );
44
+		$this->setup_dates($start_date, $end_date);
45 45
 
46 46
 		// Make sure start date is valid
47
-		if ( is_wp_error( $this->start_date ) ) {
47
+		if (is_wp_error($this->start_date)) {
48 48
 			return $this->start_date;
49 49
 		}
50 50
 
51 51
 		// Make sure end date is valid
52
-		if ( is_wp_error( $this->end_date ) ) {
52
+		if (is_wp_error($this->end_date)) {
53 53
 			return $this->end_date;
54 54
 		}
55 55
 
56
-		if ( empty( $form_id ) ) {
56
+		if (empty($form_id)) {
57 57
 
58 58
 			// Global sale stats
59
-			add_filter( 'give_count_payments_where', array( $this, 'count_where' ) );
59
+			add_filter('give_count_payments_where', array($this, 'count_where'));
60 60
 
61
-			if ( is_array( $status ) ) {
61
+			if (is_array($status)) {
62 62
 				$count = 0;
63
-				foreach ( $status as $payment_status ) {
63
+				foreach ($status as $payment_status) {
64 64
 					$count += give_count_payments()->$payment_status;
65 65
 				}
66 66
 			} else {
67 67
 				$count = give_count_payments()->$status;
68 68
 			}
69 69
 
70
-			remove_filter( 'give_count_payments_where', array( $this, 'count_where' ) );
70
+			remove_filter('give_count_payments_where', array($this, 'count_where'));
71 71
 
72 72
 		} else {
73 73
 
74 74
 			// Product specific stats
75 75
 			global $give_logs;
76 76
 
77
-			add_filter( 'posts_where', array( $this, 'payments_where' ) );
77
+			add_filter('posts_where', array($this, 'payments_where'));
78 78
 
79
-			$count = $give_logs->get_log_count( $form_id, 'sale' );
79
+			$count = $give_logs->get_log_count($form_id, 'sale');
80 80
 
81
-			remove_filter( 'posts_where', array( $this, 'payments_where' ) );
81
+			remove_filter('posts_where', array($this, 'payments_where'));
82 82
 
83 83
 		}
84 84
 
@@ -100,31 +100,31 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @return float|int
102 102
 	 */
103
-	public function get_earnings( $form_id = 0, $start_date = false, $end_date = false, $gateway_id = false ) {
103
+	public function get_earnings($form_id = 0, $start_date = false, $end_date = false, $gateway_id = false) {
104 104
 
105 105
 		global $wpdb;
106 106
 
107
-		$this->setup_dates( $start_date, $end_date );
107
+		$this->setup_dates($start_date, $end_date);
108 108
 
109 109
 		// Make sure start date is valid
110
-		if ( is_wp_error( $this->start_date ) ) {
110
+		if (is_wp_error($this->start_date)) {
111 111
 			return $this->start_date;
112 112
 		}
113 113
 
114 114
 		// Make sure end date is valid
115
-		if ( is_wp_error( $this->end_date ) ) {
115
+		if (is_wp_error($this->end_date)) {
116 116
 			return $this->end_date;
117 117
 		}
118 118
 
119
-		add_filter( 'posts_where', array( $this, 'payments_where' ) );
119
+		add_filter('posts_where', array($this, 'payments_where'));
120 120
 
121
-		if ( empty( $form_id ) ) {
121
+		if (empty($form_id)) {
122 122
 
123 123
 			// Global earning stats
124 124
 			$args = array(
125 125
 				'post_type'              => 'give_payment',
126 126
 				'nopaging'               => true,
127
-				'post_status'            => array( 'publish', 'revoked' ),
127
+				'post_status'            => array('publish', 'revoked'),
128 128
 				'fields'                 => 'ids',
129 129
 				'update_post_term_cache' => false,
130 130
 				'suppress_filters'       => false,
@@ -136,24 +136,24 @@  discard block
 block discarded – undo
136 136
 			);
137 137
 
138 138
 			//Filter by Gateway ID meta_key
139
-			if ( $gateway_id !== false ) {
139
+			if ($gateway_id !== false) {
140 140
 				$args['meta_key']   = '_give_payment_gateway';
141 141
 				$args['meta_value'] = $gateway_id;
142 142
 			}
143 143
 
144
-			$args = apply_filters( 'give_stats_earnings_args', $args );
145
-			$key  = 'give_stats_' . substr( md5( serialize( $args ) ), 0, 15 );
144
+			$args = apply_filters('give_stats_earnings_args', $args);
145
+			$key  = 'give_stats_'.substr(md5(serialize($args)), 0, 15);
146 146
 
147
-			$earnings = get_transient( $key );
148
-			if ( false === $earnings ) {
149
-				$sales    = get_posts( $args );
147
+			$earnings = get_transient($key);
148
+			if (false === $earnings) {
149
+				$sales    = get_posts($args);
150 150
 				$earnings = 0;
151
-				if ( $sales ) {
152
-					$sales = implode( ',', $sales );
153
-					$earnings += $wpdb->get_var( "SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN({$sales})" );
151
+				if ($sales) {
152
+					$sales = implode(',', $sales);
153
+					$earnings += $wpdb->get_var("SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_give_payment_total' AND post_id IN({$sales})");
154 154
 				}
155 155
 				// Cache the results for one hour
156
-				set_transient( $key, $earnings, HOUR_IN_SECONDS );
156
+				set_transient($key, $earnings, HOUR_IN_SECONDS);
157 157
 			}
158 158
 
159 159
 		} else {
@@ -174,34 +174,34 @@  discard block
 block discarded – undo
174 174
 				// This is not a valid query arg, but is used for cache keying
175 175
 			);
176 176
 
177
-			$args = apply_filters( 'give_stats_earnings_args', $args );
178
-			$key  = 'give_stats_' . substr( md5( serialize( $args ) ), 0, 15 );
177
+			$args = apply_filters('give_stats_earnings_args', $args);
178
+			$key  = 'give_stats_'.substr(md5(serialize($args)), 0, 15);
179 179
 			//Set transient for faster stats
180
-			$earnings = get_transient( $key );
180
+			$earnings = get_transient($key);
181 181
 
182
-			if ( false === $earnings ) {
182
+			if (false === $earnings) {
183 183
 
184
-				$log_ids  = $give_logs->get_connected_logs( $args, 'sale' );
184
+				$log_ids  = $give_logs->get_connected_logs($args, 'sale');
185 185
 				$earnings = 0;
186 186
 
187
-				if ( $log_ids ) {
188
-					$log_ids     = implode( ',', $log_ids );
189
-					$payment_ids = $wpdb->get_col( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key='_give_log_payment_id' AND post_id IN ($log_ids);" );
190
-					foreach ( $payment_ids as $payment_id ) {
191
-						$earnings += give_get_payment_amount( $payment_id );
187
+				if ($log_ids) {
188
+					$log_ids     = implode(',', $log_ids);
189
+					$payment_ids = $wpdb->get_col("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key='_give_log_payment_id' AND post_id IN ($log_ids);");
190
+					foreach ($payment_ids as $payment_id) {
191
+						$earnings += give_get_payment_amount($payment_id);
192 192
 					}
193 193
 				}
194 194
 
195 195
 				// Cache the results for one hour
196
-				set_transient( $key, $earnings, 60 * 60 );
196
+				set_transient($key, $earnings, 60 * 60);
197 197
 			}
198 198
 		}
199 199
 
200 200
 		//remove our filter
201
-		remove_filter( 'posts_where', array( $this, 'payments_where' ) );
201
+		remove_filter('posts_where', array($this, 'payments_where'));
202 202
 
203 203
 		//return earnings
204
-		return round( $earnings, give_currency_decimal_filter() );
204
+		return round($earnings, give_currency_decimal_filter());
205 205
 
206 206
 	}
207 207
 
@@ -215,16 +215,16 @@  discard block
 block discarded – undo
215 215
 	 *
216 216
 	 * @return array
217 217
 	 */
218
-	public function get_best_selling( $number = 10 ) {
218
+	public function get_best_selling($number = 10) {
219 219
 
220 220
 		global $wpdb;
221 221
 
222
-		$give_forms = $wpdb->get_results( $wpdb->prepare(
222
+		$give_forms = $wpdb->get_results($wpdb->prepare(
223 223
 			"SELECT post_id as form_id, max(meta_value) as sales
224 224
 				FROM $wpdb->postmeta WHERE meta_key='_give_form_sales' AND meta_value > 0
225 225
 				GROUP BY meta_value+0
226 226
 				DESC LIMIT %d;", $number
227
-		) );
227
+		));
228 228
 
229 229
 		return $give_forms;
230 230
 	}
Please login to merge, or discard this patch.
includes/class-give-cron.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 * @see   Give_Cron::weekly_events()
30 30
 	 */
31 31
 	public function __construct() {
32
-		add_filter( 'cron_schedules', array( $this, 'add_schedules' ) );
33
-		add_action( 'wp', array( $this, 'schedule_Events' ) );
32
+		add_filter('cron_schedules', array($this, 'add_schedules'));
33
+		add_action('wp', array($this, 'schedule_Events'));
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @return array
44 44
 	 */
45
-	public function add_schedules( $schedules = array() ) {
45
+	public function add_schedules($schedules = array()) {
46 46
 		// Adds once weekly to the existing schedules.
47 47
 		$schedules['weekly'] = array(
48 48
 			'interval' => 604800,
49
-			'display'  => __( 'Once Weekly', 'easy-digital-downloads' )
49
+			'display'  => __('Once Weekly', 'easy-digital-downloads')
50 50
 		);
51 51
 
52 52
 		return $schedules;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 * @return void
73 73
 	 */
74 74
 	private function weekly_events() {
75
-		if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) {
76
-			wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' );
75
+		if ( ! wp_next_scheduled('give_weekly_scheduled_events')) {
76
+			wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events');
77 77
 		}
78 78
 	}
79 79
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 * @return void
86 86
 	 */
87 87
 	private function daily_events() {
88
-		if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) {
89
-			wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' );
88
+		if ( ! wp_next_scheduled('give_daily_scheduled_events')) {
89
+			wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events');
90 90
 		}
91 91
 	}
92 92
 
Please login to merge, or discard this patch.
includes/install.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Install Function
4
- *
5
- * @package     Give
6
- * @subpackage  Functions/Install
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+	 * Install Function
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Functions/Install
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 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
 
@@ -32,25 +32,25 @@  discard block
 block discarded – undo
32 32
 	give_setup_post_types();
33 33
 
34 34
 	// Clear the permalinks
35
-	flush_rewrite_rules( false );
35
+	flush_rewrite_rules(false);
36 36
 
37 37
 	// Add Upgraded From Option
38
-	$current_version = get_option( 'give_version' );
39
-	if ( $current_version ) {
40
-		update_option( 'give_version_upgraded_from', $current_version );
38
+	$current_version = get_option('give_version');
39
+	if ($current_version) {
40
+		update_option('give_version_upgraded_from', $current_version);
41 41
 	}
42 42
 
43 43
 	// Setup some default options
44 44
 	$options = array();
45 45
 
46 46
 	// Checks if the Success Page option exists AND that the page exists
47
-	if ( ! get_post( give_get_option( 'success_page' ) ) ) {
47
+	if ( ! get_post(give_get_option('success_page'))) {
48 48
 
49 49
 		// Purchase Confirmation (Success) Page
50 50
 		$success = wp_insert_post(
51 51
 			array(
52
-				'post_title'     => __( 'Donation Confirmation', 'give' ),
53
-				'post_content'   => __( 'Thank you for your donation! [give_receipt]', 'give' ),
52
+				'post_title'     => __('Donation Confirmation', 'give'),
53
+				'post_content'   => __('Thank you for your donation! [give_receipt]', 'give'),
54 54
 				'post_status'    => 'publish',
55 55
 				'post_author'    => 1,
56 56
 				'post_type'      => 'page',
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	// Checks if the Failure Page option exists AND that the page exists
66
-	if ( ! get_post( give_get_option( 'failure_page' ) ) ) {
66
+	if ( ! get_post(give_get_option('failure_page'))) {
67 67
 
68 68
 		// Failed Purchase Page
69 69
 		$failed = wp_insert_post(
70 70
 			array(
71
-				'post_title'     => __( 'Transaction Failed', 'give' ),
72
-				'post_content'   => __( 'Your transaction failed, please try again or contact site support.', 'give' ),
71
+				'post_title'     => __('Transaction Failed', 'give'),
72
+				'post_content'   => __('Your transaction failed, please try again or contact site support.', 'give'),
73 73
 				'post_status'    => 'publish',
74 74
 				'post_author'    => 1,
75 75
 				'post_type'      => 'page',
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	// Checks if the History Page option exists AND that the page exists
84
-	if ( ! get_post( give_get_option( 'history_page' ) ) ) {
84
+	if ( ! get_post(give_get_option('history_page'))) {
85 85
 		// Purchase History (History) Page
86 86
 		$history = wp_insert_post(
87 87
 			array(
88
-				'post_title'     => __( 'Donation History', 'give' ),
88
+				'post_title'     => __('Donation History', 'give'),
89 89
 				'post_content'   => '[donation_history]',
90 90
 				'post_status'    => 'publish',
91 91
 				'post_author'    => 1,
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	//Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency
101
-	if ( empty( $current_version ) ) {
101
+	if (empty($current_version)) {
102 102
 		$options['base_country']       = 'US';
103 103
 		$options['test_mode']          = 1;
104 104
 		$options['currency']           = 'USD';
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
 	}
116 116
 
117 117
 	// Populate some default values
118
-	update_option( 'give_settings', array_merge( $give_options, $options ) );
119
-	update_option( 'give_version', GIVE_VERSION );
118
+	update_option('give_settings', array_merge($give_options, $options));
119
+	update_option('give_version', GIVE_VERSION);
120 120
 
121 121
 	//Update Version Number
122
-	if ( $current_version ) {
123
-		update_option( 'give_version_upgraded_from', $current_version );
122
+	if ($current_version) {
123
+		update_option('give_version_upgraded_from', $current_version);
124 124
 	}
125 125
 
126 126
 	// Create Give roles
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	$roles->add_caps();
130 130
 
131 131
 	$api = new Give_API();
132
-	update_option( 'give_default_api_version', 'v' . $api->get_version() );
132
+	update_option('give_default_api_version', 'v'.$api->get_version());
133 133
 
134 134
 	// Create the customers database
135 135
 	@Give()->customers->create_table();
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 	Give()->session->use_php_sessions();
139 139
 
140 140
 	// Add a temporary option to note that Give pages have been created
141
-	set_transient( '_give_installed', $options, 30 );
141
+	set_transient('_give_installed', $options, 30);
142 142
 
143 143
 
144
-	if ( ! $current_version ) {
145
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
144
+	if ( ! $current_version) {
145
+		require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php';
146 146
 
147 147
 		// When new upgrade routines are added, mark them as complete on fresh install
148 148
 		$upgrade_routines = array(
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
 			'upgrade_give_offline_status'
151 151
 		);
152 152
 
153
-		foreach ( $upgrade_routines as $upgrade ) {
154
-			give_set_upgrade_complete( $upgrade );
153
+		foreach ($upgrade_routines as $upgrade) {
154
+			give_set_upgrade_complete($upgrade);
155 155
 		}
156 156
 	}
157 157
 	// Bail if activating from network, or bulk
158
-	if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
158
+	if (is_network_admin() || isset($_GET['activate-multi'])) {
159 159
 		return;
160 160
 	}
161 161
 	// Add the transient to redirect
162
-	set_transient( '_give_activation_redirect', true, 30 );
162
+	set_transient('_give_activation_redirect', true, 30);
163 163
 
164 164
 }
165 165
 
166
-register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
166
+register_activation_hook(GIVE_PLUGIN_FILE, 'give_install');
167 167
 
168 168
 /**
169 169
  * Post-installation
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function give_after_install() {
177 177
 
178
-	if ( ! is_admin() ) {
178
+	if ( ! is_admin()) {
179 179
 		return;
180 180
 	}
181 181
 
182
-	$give_options = get_transient( '_give_installed' );
182
+	$give_options = get_transient('_give_installed');
183 183
 
184 184
 	// Exit if not in admin or the transient doesn't exist
185
-	if ( false === $give_options ) {
185
+	if (false === $give_options) {
186 186
 		return;
187 187
 	}
188 188
 
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
 	@Give()->customers->create_table();
191 191
 
192 192
 	// Delete the transient
193
-	delete_transient( '_give_installed' );
193
+	delete_transient('_give_installed');
194 194
 
195
-	do_action( 'give_after_install', $give_options );
195
+	do_action('give_after_install', $give_options);
196 196
 
197 197
 }
198 198
 
199
-add_action( 'admin_init', 'give_after_install' );
199
+add_action('admin_init', 'give_after_install');
200 200
 
201 201
 
202 202
 /**
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
 
212 212
 	global $wp_roles;
213 213
 
214
-	if ( ! is_object( $wp_roles ) ) {
214
+	if ( ! is_object($wp_roles)) {
215 215
 		return;
216 216
 	}
217 217
 
218
-	if ( ! array_key_exists( 'give_manager', $wp_roles->roles ) ) {
218
+	if ( ! array_key_exists('give_manager', $wp_roles->roles)) {
219 219
 
220 220
 		// Create Give shop roles
221 221
 		$roles = new Give_Roles;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 }
228 228
 
229
-add_action( 'admin_init', 'give_install_roles_on_network' );
229
+add_action('admin_init', 'give_install_roles_on_network');
230 230
 
231 231
 /**
232 232
  * Network Activated New Site Setup
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
  * @param $site_id
243 243
  * @param $meta
244 244
  */
245
-function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
246
-	if ( is_plugin_active_for_network( GIVE_PLUGIN_BASENAME ) ) {
247
-		switch_to_blog( $blog_id );
245
+function on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) {
246
+	if (is_plugin_active_for_network(GIVE_PLUGIN_BASENAME)) {
247
+		switch_to_blog($blog_id);
248 248
 		give_install();
249 249
 		restore_current_blog();
250 250
 	}
251 251
 }
252 252
 
253
-add_action( 'wpmu_new_blog', 'on_create_blog', 10, 6 );
254 253
\ No newline at end of file
254
+add_action('wpmu_new_blog', 'on_create_blog', 10, 6);
255 255
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrade-functions.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Upgrade Functions
4
- *
5
- * @package     Give
6
- * @subpackage  Admin/Upgrades
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- *
11
- * NOTICE: When adding new upgrade notices, please be sure to put the action into the upgrades array during install: /includes/install.php @ Appox Line 156
12
- *
13
- */
3
+	 * Upgrade Functions
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Admin/Upgrades
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 *
11
+	 * NOTICE: When adding new upgrade notices, please be sure to put the action into the upgrades array during install: /includes/install.php @ Appox Line 156
12
+	 *
13
+	 */
14 14
 
15 15
 // Exit if accessed directly
16 16
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_show_upgrade_notices() {
27 27
 
28
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-upgrades' ) {
28
+	if (isset($_GET['page']) && $_GET['page'] == 'give-upgrades') {
29 29
 		return;
30 30
 	} // Don't show notices on the upgrades page
31 31
 
32
-	$give_version = get_option( 'give_version' );
32
+	$give_version = get_option('give_version');
33 33
 
34
-	if ( ! $give_version ) {
34
+	if ( ! $give_version) {
35 35
 		// 1.0 is the first version to use this option so we must add it
36 36
 		$give_version = '1.0';
37 37
 	}
38 38
 
39
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
39
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
40 40
 
41 41
 	/*
42 42
 	 *  NOTICE:
@@ -47,18 +47,18 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 
49 49
 	//v1.3.2 Upgrades
50
-	if ( version_compare( $give_version, '1.3.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) {
50
+	if (version_compare($give_version, '1.3.2', '<') || ! give_has_upgrade_completed('upgrade_give_payment_customer_id')) {
51 51
 		printf(
52
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
53
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id' ) )
52
+			'<div class="updated"><p>'.__('Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
53
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id'))
54 54
 		);
55 55
 	}
56 56
 
57 57
 	//v1.3.4 Upgrades //ensure the user has gone through 1.3.4
58
-	if ( version_compare( $give_version, '1.3.4', '<' ) || ( ! give_has_upgrade_completed( 'upgrade_give_offline_status' ) && give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) ) {
58
+	if (version_compare($give_version, '1.3.4', '<') || ( ! give_has_upgrade_completed('upgrade_give_offline_status') && give_has_upgrade_completed('upgrade_give_payment_customer_id'))) {
59 59
 		printf(
60
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
61
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status' ) )
60
+			'<div class="updated"><p>'.__('Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
61
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status'))
62 62
 		);
63 63
 	}
64 64
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 }
70 70
 
71
-add_action( 'admin_notices', 'give_show_upgrade_notices' );
71
+add_action('admin_notices', 'give_show_upgrade_notices');
72 72
 
73 73
 /**
74 74
  * Triggers all upgrade functions
@@ -80,26 +80,26 @@  discard block
 block discarded – undo
80 80
  */
81 81
 function give_trigger_upgrades() {
82 82
 
83
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
84
-		wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
83
+	if ( ! current_user_can('manage_give_settings')) {
84
+		wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403));
85 85
 	}
86 86
 
87
-	$give_version = get_option( 'give_version' );
87
+	$give_version = get_option('give_version');
88 88
 
89
-	if ( ! $give_version ) {
89
+	if ( ! $give_version) {
90 90
 		// 1.0 is the first version to use this option so we must add it
91 91
 		$give_version = '1.0';
92
-		add_option( 'give_version', $give_version );
92
+		add_option('give_version', $give_version);
93 93
 	}
94 94
 
95
-	update_option( 'give_version', GIVE_VERSION );
95
+	update_option('give_version', GIVE_VERSION);
96 96
 
97
-	if ( DOING_AJAX ) {
98
-		die( 'complete' );
97
+	if (DOING_AJAX) {
98
+		die('complete');
99 99
 	} // Let AJAX know that the upgrade is complete
100 100
 }
101 101
 
102
-add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' );
102
+add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades');
103 103
 
104 104
 /**
105 105
  * Check if the upgrade routine has been run for a specific action
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
  *
111 111
  * @return bool                   If the action has been added to the completed actions array
112 112
  */
113
-function give_has_upgrade_completed( $upgrade_action = '' ) {
113
+function give_has_upgrade_completed($upgrade_action = '') {
114 114
 
115
-	if ( empty( $upgrade_action ) ) {
115
+	if (empty($upgrade_action)) {
116 116
 		return false;
117 117
 	}
118 118
 
119 119
 	$completed_upgrades = give_get_completed_upgrades();
120 120
 
121
-	return in_array( $upgrade_action, $completed_upgrades );
121
+	return in_array($upgrade_action, $completed_upgrades);
122 122
 
123 123
 }
124 124
 
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
  *
132 132
  * @return bool                   If the function was successfully added
133 133
  */
134
-function give_set_upgrade_complete( $upgrade_action = '' ) {
134
+function give_set_upgrade_complete($upgrade_action = '') {
135 135
 
136
-	if ( empty( $upgrade_action ) ) {
136
+	if (empty($upgrade_action)) {
137 137
 		return false;
138 138
 	}
139 139
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 	$completed_upgrades[] = $upgrade_action;
142 142
 
143 143
 	// Remove any blanks, and only show uniques
144
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
144
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
145 145
 
146
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
146
+	return update_option('give_completed_upgrades', $completed_upgrades);
147 147
 }
148 148
 
149 149
 /**
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
  */
155 155
 function give_get_completed_upgrades() {
156 156
 
157
-	$completed_upgrades = get_option( 'give_completed_upgrades' );
157
+	$completed_upgrades = get_option('give_completed_upgrades');
158 158
 
159
-	if ( false === $completed_upgrades ) {
159
+	if (false === $completed_upgrades) {
160 160
 		$completed_upgrades = array();
161 161
 	}
162 162
 
@@ -175,30 +175,30 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function give_v132_upgrade_give_payment_customer_id() {
177 177
 	global $wpdb;
178
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
179
-		wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
178
+	if ( ! current_user_can('manage_give_settings')) {
179
+		wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403));
180 180
 	}
181 181
 
182
-	ignore_user_abort( true );
182
+	ignore_user_abort(true);
183 183
 
184
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
185
-		@set_time_limit( 0 );
184
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
185
+		@set_time_limit(0);
186 186
 	}
187 187
 
188 188
 	//UPDATE DB METAKEYS
189 189
 	$sql   = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'";
190
-	$query = $wpdb->query( $sql );
190
+	$query = $wpdb->query($sql);
191 191
 
192
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
193
-	give_set_upgrade_complete( 'upgrade_give_payment_customer_id' );
194
-	delete_option( 'give_doing_upgrade' );
195
-	wp_redirect( admin_url() );
192
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
193
+	give_set_upgrade_complete('upgrade_give_payment_customer_id');
194
+	delete_option('give_doing_upgrade');
195
+	wp_redirect(admin_url());
196 196
 	exit;
197 197
 
198 198
 
199 199
 }
200 200
 
201
-add_action( 'give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id' );
201
+add_action('give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id');
202 202
 
203 203
 /**
204 204
  * Upgrades the Offline Status
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
 
213 213
 	global $wpdb;
214 214
 
215
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
216
-		wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
215
+	if ( ! current_user_can('manage_give_settings')) {
216
+		wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403));
217 217
 	}
218 218
 
219
-	ignore_user_abort( true );
219
+	ignore_user_abort(true);
220 220
 
221
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
222
-		@set_time_limit( 0 );
221
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
222
+		@set_time_limit(0);
223 223
 	}
224 224
 
225 225
 	// Get abandoned offline payments
@@ -229,32 +229,32 @@  discard block
 block discarded – undo
229 229
 	$where .= "AND ( p.post_status = 'abandoned' )";
230 230
 	$where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )";
231 231
 
232
-	$sql            = $select . $join . $where;
233
-	$found_payments = $wpdb->get_col( $sql );
232
+	$sql            = $select.$join.$where;
233
+	$found_payments = $wpdb->get_col($sql);
234 234
 
235 235
 
236
-	foreach ( $found_payments as $payment ) {
236
+	foreach ($found_payments as $payment) {
237 237
 
238 238
 		//Only change ones marked abandoned since our release last week
239 239
 		//because the admin may have marked some abandoned themselves
240
-		$modified_time = get_post_modified_time( 'U', false, $payment );
240
+		$modified_time = get_post_modified_time('U', false, $payment);
241 241
 
242 242
 		//1450124863 =  12/10/2015 20:42:25
243
-		if ( $modified_time >= 1450124863 ) {
243
+		if ($modified_time >= 1450124863) {
244 244
 
245
-			give_update_payment_status( $payment, 'pending' );
245
+			give_update_payment_status($payment, 'pending');
246 246
 
247 247
 		}
248 248
 
249 249
 	}
250 250
 
251
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
252
-	give_set_upgrade_complete( 'upgrade_give_offline_status' );
253
-	delete_option( 'give_doing_upgrade' );
254
-	wp_redirect( admin_url() );
251
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
252
+	give_set_upgrade_complete('upgrade_give_offline_status');
253
+	delete_option('give_doing_upgrade');
254
+	wp_redirect(admin_url());
255 255
 	exit;
256 256
 
257 257
 
258 258
 }
259 259
 
260
-add_action( 'give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status' );
260
+add_action('give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status');
Please login to merge, or discard this patch.
includes/admin/system-info.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * System Info
4
- *
5
- * These are functions
6
- *
7
- * @package     Give
8
- * @subpackage  Admin/System
9
- * @copyright   Copyright (c) 2015, WordImpress
10
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
- */
3
+	 * System Info
4
+	 *
5
+	 * These are functions
6
+	 *
7
+	 * @package     Give
8
+	 * @subpackage  Admin/System
9
+	 * @copyright   Copyright (c) 2015, WordImpress
10
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
+	 */
12 12
 
13 13
 // Exit if accessed directly
14 14
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +138 added lines, -138 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
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  */
25 25
 function give_system_info_callback() {
26 26
 
27
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
27
+	if ( ! current_user_can('manage_give_settings')) {
28 28
 		return;
29 29
 	}
30 30
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo give_tools_sysinfo_get(); ?></textarea>
33 33
 	<p class="submit">
34 34
 		<input type="hidden" name="give-action" value="download_sysinfo" />
35
-		<?php submit_button( 'Download System Info File', 'secondary', 'give-download-sysinfo', false ); ?>
35
+		<?php submit_button('Download System Info File', 'secondary', 'give-download-sysinfo', false); ?>
36 36
 	</p>
37 37
 	<style>
38 38
 		.give_forms_page_give-settings .give-submit-wrap {
@@ -55,63 +55,63 @@  discard block
 block discarded – undo
55 55
 function give_tools_sysinfo_get() {
56 56
 	global $wpdb, $give_options;
57 57
 
58
-	if ( ! class_exists( 'Browser' ) ) {
59
-		require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php';
58
+	if ( ! class_exists('Browser')) {
59
+		require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php';
60 60
 	}
61 61
 
62 62
 	$browser = new Browser();
63 63
 
64 64
 	// Get theme info
65
-	if ( get_bloginfo( 'version' ) < '3.4' ) {
66
-		$theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
67
-		$theme      = $theme_data['Name'] . ' ' . $theme_data['Version'];
65
+	if (get_bloginfo('version') < '3.4') {
66
+		$theme_data = get_theme_data(get_stylesheet_directory().'/style.css');
67
+		$theme      = $theme_data['Name'].' '.$theme_data['Version'];
68 68
 	} else {
69 69
 		$theme_data = wp_get_theme();
70
-		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
70
+		$theme      = $theme_data->Name.' '.$theme_data->Version;
71 71
 	}
72 72
 
73 73
 	// Try to identify the hosting provider
74 74
 	$host = give_get_host();
75 75
 
76
-	$return = '### Begin System Info ###' . "\n\n";
76
+	$return = '### Begin System Info ###'."\n\n";
77 77
 
78 78
 	// Start with the basics...
79
-	$return .= '-- Site Info' . "\n\n";
80
-	$return .= 'Site URL:                 ' . site_url() . "\n";
81
-	$return .= 'Home URL:                 ' . home_url() . "\n";
82
-	$return .= 'Multisite:                ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n";
79
+	$return .= '-- Site Info'."\n\n";
80
+	$return .= 'Site URL:                 '.site_url()."\n";
81
+	$return .= 'Home URL:                 '.home_url()."\n";
82
+	$return .= 'Multisite:                '.(is_multisite() ? 'Yes' : 'No')."\n";
83 83
 
84
-	$return = apply_filters( 'give_sysinfo_after_site_info', $return );
84
+	$return = apply_filters('give_sysinfo_after_site_info', $return);
85 85
 
86 86
 	// Can we determine the site's host?
87
-	if ( $host ) {
88
-		$return .= "\n" . '-- Hosting Provider' . "\n\n";
89
-		$return .= 'Host:                     ' . $host . "\n";
87
+	if ($host) {
88
+		$return .= "\n".'-- Hosting Provider'."\n\n";
89
+		$return .= 'Host:                     '.$host."\n";
90 90
 
91
-		$return = apply_filters( 'give_sysinfo_after_host_info', $return );
91
+		$return = apply_filters('give_sysinfo_after_host_info', $return);
92 92
 	}
93 93
 
94 94
 	// The local users' browser information, handled by the Browser class
95
-	$return .= "\n" . '-- User Browser' . "\n\n";
95
+	$return .= "\n".'-- User Browser'."\n\n";
96 96
 	$return .= $browser;
97 97
 
98
-	$return = apply_filters( 'give_sysinfo_after_user_browser', $return );
98
+	$return = apply_filters('give_sysinfo_after_user_browser', $return);
99 99
 
100 100
 	// WordPress configuration
101
-	$return .= "\n" . '-- WordPress Configuration' . "\n\n";
102
-	$return .= 'Version:                  ' . get_bloginfo( 'version' ) . "\n";
103
-	$return .= 'Language:                 ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n";
104
-	$return .= 'Permalink Structure:      ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n";
105
-	$return .= 'Active Theme:             ' . $theme . "\n";
106
-	$return .= 'Show On Front:            ' . get_option( 'show_on_front' ) . "\n";
101
+	$return .= "\n".'-- WordPress Configuration'."\n\n";
102
+	$return .= 'Version:                  '.get_bloginfo('version')."\n";
103
+	$return .= 'Language:                 '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n";
104
+	$return .= 'Permalink Structure:      '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n";
105
+	$return .= 'Active Theme:             '.$theme."\n";
106
+	$return .= 'Show On Front:            '.get_option('show_on_front')."\n";
107 107
 
108 108
 	// Only show page specs if frontpage is set to 'page'
109
-	if ( get_option( 'show_on_front' ) == 'page' ) {
110
-		$front_page_id = get_option( 'page_on_front' );
111
-		$blog_page_id  = get_option( 'page_for_posts' );
109
+	if (get_option('show_on_front') == 'page') {
110
+		$front_page_id = get_option('page_on_front');
111
+		$blog_page_id  = get_option('page_for_posts');
112 112
 
113
-		$return .= 'Page On Front:            ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n";
114
-		$return .= 'Page For Posts:           ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n";
113
+		$return .= 'Page On Front:            '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n";
114
+		$return .= 'Page For Posts:           '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n";
115 115
 	}
116 116
 
117 117
 	// Make sure wp_remote_post() is working
@@ -120,200 +120,200 @@  discard block
 block discarded – undo
120 120
 	$params = array(
121 121
 		'sslverify'  => false,
122 122
 		'timeout'    => 60,
123
-		'user-agent' => 'Give/' . GIVE_VERSION,
123
+		'user-agent' => 'Give/'.GIVE_VERSION,
124 124
 		'body'       => $request
125 125
 	);
126 126
 
127
-	$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
127
+	$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params);
128 128
 
129
-	if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
129
+	if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
130 130
 		$WP_REMOTE_POST = 'wp_remote_post() works';
131 131
 	} else {
132 132
 		$WP_REMOTE_POST = 'wp_remote_post() does not work';
133 133
 	}
134 134
 
135
-	$return .= 'Remote Post:              ' . $WP_REMOTE_POST . "\n";
136
-	$return .= 'Table Prefix:             ' . 'Length: ' . strlen( $wpdb->prefix ) . '   Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n";
137
-	$return .= 'Admin AJAX:               ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n";
138
-	$return .= 'WP_DEBUG:                 ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n";
139
-	$return .= 'Memory Limit:             ' . WP_MEMORY_LIMIT . "\n";
140
-	$return .= 'Registered Post Stati:    ' . implode( ', ', get_post_stati() ) . "\n";
135
+	$return .= 'Remote Post:              '.$WP_REMOTE_POST."\n";
136
+	$return .= 'Table Prefix:             '.'Length: '.strlen($wpdb->prefix).'   Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n";
137
+	$return .= 'Admin AJAX:               '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n";
138
+	$return .= 'WP_DEBUG:                 '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n";
139
+	$return .= 'Memory Limit:             '.WP_MEMORY_LIMIT."\n";
140
+	$return .= 'Registered Post Stati:    '.implode(', ', get_post_stati())."\n";
141 141
 
142
-	$return = apply_filters( 'give_sysinfo_after_wordpress_config', $return );
142
+	$return = apply_filters('give_sysinfo_after_wordpress_config', $return);
143 143
 
144 144
 	// GIVE configuration
145
-	$return .= "\n" . '-- Give Configuration' . "\n\n";
146
-	$return .= 'Version:                  ' . GIVE_VERSION . "\n";
147
-	$return .= 'Upgraded From:            ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n";
148
-	$return .= 'Test Mode:                ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" );
149
-	$return .= 'Currency Code:            ' . give_get_currency() . "\n";
150
-	$return .= 'Currency Position:        ' . give_get_option( 'currency_position', 'before' ) . "\n";
151
-	$return .= 'Decimal Separator:        ' . give_get_option( 'decimal_separator', '.' ) . "\n";
152
-	$return .= 'Thousands Separator:      ' . give_get_option( 'thousands_separator', ',' ) . "\n";
145
+	$return .= "\n".'-- Give Configuration'."\n\n";
146
+	$return .= 'Version:                  '.GIVE_VERSION."\n";
147
+	$return .= 'Upgraded From:            '.get_option('give_version_upgraded_from', 'None')."\n";
148
+	$return .= 'Test Mode:                '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n");
149
+	$return .= 'Currency Code:            '.give_get_currency()."\n";
150
+	$return .= 'Currency Position:        '.give_get_option('currency_position', 'before')."\n";
151
+	$return .= 'Decimal Separator:        '.give_get_option('decimal_separator', '.')."\n";
152
+	$return .= 'Thousands Separator:      '.give_get_option('thousands_separator', ',')."\n";
153 153
 
154
-	$return = apply_filters( 'give_sysinfo_after_give_config', $return );
154
+	$return = apply_filters('give_sysinfo_after_give_config', $return);
155 155
 
156 156
 	// GIVE pages
157
-	$return .= "\n" . '-- Give Page Configuration' . "\n\n";
158
-	$return .= 'Success Page:             ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" );
159
-	$return .= 'Failure Page:             ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" );
160
-	$return .= 'Give Forms Slug:           ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" );
157
+	$return .= "\n".'-- Give Page Configuration'."\n\n";
158
+	$return .= 'Success Page:             '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n");
159
+	$return .= 'Failure Page:             '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n");
160
+	$return .= 'Give Forms Slug:           '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n");
161 161
 
162
-	$return = apply_filters( 'give_sysinfo_after_give_pages', $return );
162
+	$return = apply_filters('give_sysinfo_after_give_pages', $return);
163 163
 
164 164
 	// GIVE gateways
165
-	$return .= "\n" . '-- Give Gateway Configuration' . "\n\n";
165
+	$return .= "\n".'-- Give Gateway Configuration'."\n\n";
166 166
 
167 167
 	$active_gateways = give_get_enabled_payment_gateways();
168
-	if ( $active_gateways ) {
169
-		$default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
170
-		if ( $default_gateway_is_active ) {
171
-			$default_gateway = give_get_default_gateway( null );
172
-			$default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
168
+	if ($active_gateways) {
169
+		$default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null));
170
+		if ($default_gateway_is_active) {
171
+			$default_gateway = give_get_default_gateway(null);
172
+			$default_gateway = $active_gateways[$default_gateway]['admin_label'];
173 173
 		} else {
174 174
 			$default_gateway = 'Test Payment';
175 175
 		}
176 176
 
177 177
 		$gateways = array();
178
-		foreach ( $active_gateways as $gateway ) {
178
+		foreach ($active_gateways as $gateway) {
179 179
 			$gateways[] = $gateway['admin_label'];
180 180
 		}
181 181
 
182
-		$return .= 'Enabled Gateways:         ' . implode( ', ', $gateways ) . "\n";
183
-		$return .= 'Default Gateway:          ' . $default_gateway . "\n";
182
+		$return .= 'Enabled Gateways:         '.implode(', ', $gateways)."\n";
183
+		$return .= 'Default Gateway:          '.$default_gateway."\n";
184 184
 	} else {
185
-		$return .= 'Enabled Gateways:         None' . "\n";
185
+		$return .= 'Enabled Gateways:         None'."\n";
186 186
 	}
187 187
 
188
-	$return = apply_filters( 'give_sysinfo_after_give_gateways', $return );
188
+	$return = apply_filters('give_sysinfo_after_give_gateways', $return);
189 189
 
190 190
 	// GIVE Templates
191
-	$dir = get_stylesheet_directory() . '/give_templates/*';
192
-	if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) {
193
-		$return .= "\n" . '-- Give Template Overrides' . "\n\n";
191
+	$dir = get_stylesheet_directory().'/give_templates/*';
192
+	if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) {
193
+		$return .= "\n".'-- Give Template Overrides'."\n\n";
194 194
 
195
-		foreach ( glob( $dir ) as $file ) {
196
-			$return .= 'Filename:                 ' . basename( $file ) . "\n";
195
+		foreach (glob($dir) as $file) {
196
+			$return .= 'Filename:                 '.basename($file)."\n";
197 197
 		}
198 198
 
199
-		$return = apply_filters( 'give_sysinfo_after_give_templates', $return );
199
+		$return = apply_filters('give_sysinfo_after_give_templates', $return);
200 200
 	}
201 201
 
202 202
 	// Must-use plugins
203 203
 	$muplugins = get_mu_plugins();
204
-	if ( count( $muplugins > 0 ) ) {
205
-		$return .= "\n" . '-- Must-Use Plugins' . "\n\n";
204
+	if (count($muplugins > 0)) {
205
+		$return .= "\n".'-- Must-Use Plugins'."\n\n";
206 206
 
207
-		foreach ( $muplugins as $plugin => $plugin_data ) {
208
-			$return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n";
207
+		foreach ($muplugins as $plugin => $plugin_data) {
208
+			$return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n";
209 209
 		}
210 210
 
211
-		$return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return );
211
+		$return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return);
212 212
 	}
213 213
 
214 214
 	// WordPress active plugins
215
-	$return .= "\n" . '-- WordPress Active Plugins' . "\n\n";
215
+	$return .= "\n".'-- WordPress Active Plugins'."\n\n";
216 216
 
217 217
 	$plugins        = get_plugins();
218
-	$active_plugins = get_option( 'active_plugins', array() );
218
+	$active_plugins = get_option('active_plugins', array());
219 219
 
220
-	foreach ( $plugins as $plugin_path => $plugin ) {
221
-		if ( ! in_array( $plugin_path, $active_plugins ) ) {
220
+	foreach ($plugins as $plugin_path => $plugin) {
221
+		if ( ! in_array($plugin_path, $active_plugins)) {
222 222
 			continue;
223 223
 		}
224 224
 
225
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
225
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
226 226
 	}
227 227
 
228
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return );
228
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins', $return);
229 229
 
230 230
 	// WordPress inactive plugins
231
-	$return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n";
231
+	$return .= "\n".'-- WordPress Inactive Plugins'."\n\n";
232 232
 
233
-	foreach ( $plugins as $plugin_path => $plugin ) {
234
-		if ( in_array( $plugin_path, $active_plugins ) ) {
233
+	foreach ($plugins as $plugin_path => $plugin) {
234
+		if (in_array($plugin_path, $active_plugins)) {
235 235
 			continue;
236 236
 		}
237 237
 
238
-		$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
238
+		$return .= $plugin['Name'].': '.$plugin['Version']."\n";
239 239
 	}
240 240
 
241
-	$return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return );
241
+	$return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return);
242 242
 
243
-	if ( is_multisite() ) {
243
+	if (is_multisite()) {
244 244
 		// WordPress Multisite active plugins
245
-		$return .= "\n" . '-- Network Active Plugins' . "\n\n";
245
+		$return .= "\n".'-- Network Active Plugins'."\n\n";
246 246
 
247 247
 		$plugins        = wp_get_active_network_plugins();
248
-		$active_plugins = get_site_option( 'active_sitewide_plugins', array() );
248
+		$active_plugins = get_site_option('active_sitewide_plugins', array());
249 249
 
250
-		foreach ( $plugins as $plugin_path ) {
251
-			$plugin_base = plugin_basename( $plugin_path );
250
+		foreach ($plugins as $plugin_path) {
251
+			$plugin_base = plugin_basename($plugin_path);
252 252
 
253
-			if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
253
+			if ( ! array_key_exists($plugin_base, $active_plugins)) {
254 254
 				continue;
255 255
 			}
256 256
 
257
-			$plugin = get_plugin_data( $plugin_path );
258
-			$return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
257
+			$plugin = get_plugin_data($plugin_path);
258
+			$return .= $plugin['Name'].': '.$plugin['Version']."\n";
259 259
 		}
260 260
 
261
-		$return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return );
261
+		$return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return);
262 262
 	}
263 263
 
264 264
 	// Server configuration (really just versioning)
265
-	$return .= "\n" . '-- Webserver Configuration' . "\n\n";
266
-	$return .= 'PHP Version:              ' . PHP_VERSION . "\n";
267
-	$return .= 'MySQL Version:            ' . $wpdb->db_version() . "\n";
268
-	$return .= 'Webserver Info:           ' . $_SERVER['SERVER_SOFTWARE'] . "\n";
265
+	$return .= "\n".'-- Webserver Configuration'."\n\n";
266
+	$return .= 'PHP Version:              '.PHP_VERSION."\n";
267
+	$return .= 'MySQL Version:            '.$wpdb->db_version()."\n";
268
+	$return .= 'Webserver Info:           '.$_SERVER['SERVER_SOFTWARE']."\n";
269 269
 
270
-	$return = apply_filters( 'give_sysinfo_after_webserver_config', $return );
270
+	$return = apply_filters('give_sysinfo_after_webserver_config', $return);
271 271
 
272 272
 	// PHP configs... now we're getting to the important stuff
273
-	$return .= "\n" . '-- PHP Configuration' . "\n\n";
274
-	$return .= 'Safe Mode:                ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" );
275
-	$return .= 'Memory Limit:             ' . ini_get( 'memory_limit' ) . "\n";
276
-	$return .= 'Upload Max Size:          ' . ini_get( 'upload_max_filesize' ) . "\n";
277
-	$return .= 'Post Max Size:            ' . ini_get( 'post_max_size' ) . "\n";
278
-	$return .= 'Upload Max Filesize:      ' . ini_get( 'upload_max_filesize' ) . "\n";
279
-	$return .= 'Time Limit:               ' . ini_get( 'max_execution_time' ) . "\n";
280
-	$return .= 'Max Input Vars:           ' . ini_get( 'max_input_vars' ) . "\n";
281
-	$return .= 'Display Errors:           ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
282
-
283
-	$return = apply_filters( 'give_sysinfo_after_php_config', $return );
273
+	$return .= "\n".'-- PHP Configuration'."\n\n";
274
+	$return .= 'Safe Mode:                '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n");
275
+	$return .= 'Memory Limit:             '.ini_get('memory_limit')."\n";
276
+	$return .= 'Upload Max Size:          '.ini_get('upload_max_filesize')."\n";
277
+	$return .= 'Post Max Size:            '.ini_get('post_max_size')."\n";
278
+	$return .= 'Upload Max Filesize:      '.ini_get('upload_max_filesize')."\n";
279
+	$return .= 'Time Limit:               '.ini_get('max_execution_time')."\n";
280
+	$return .= 'Max Input Vars:           '.ini_get('max_input_vars')."\n";
281
+	$return .= 'Display Errors:           '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
282
+
283
+	$return = apply_filters('give_sysinfo_after_php_config', $return);
284 284
 
285 285
 	// PHP extensions and such
286
-	$return .= "\n" . '-- PHP Extensions' . "\n\n";
287
-	$return .= 'cURL:                     ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
286
+	$return .= "\n".'-- PHP Extensions'."\n\n";
287
+	$return .= 'cURL:                     '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
288 288
 
289 289
 	//cURL version
290
-	if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) {
290
+	if (function_exists('curl_init') && function_exists('curl_version')) {
291 291
 		$curl_values = curl_version();
292
-		$return .= 'cURL Version:             ' . $curl_values["version"] . "\n";
292
+		$return .= 'cURL Version:             '.$curl_values["version"]."\n";
293 293
 	}
294
-	$return .= 'fsockopen:                ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
295
-	$return .= 'SOAP Client:              ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n";
296
-	$return .= 'Suhosin:                  ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
294
+	$return .= 'fsockopen:                '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
295
+	$return .= 'SOAP Client:              '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
296
+	$return .= 'Suhosin:                  '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
297 297
 
298
-	$return = apply_filters( 'give_sysinfo_after_php_ext', $return );
298
+	$return = apply_filters('give_sysinfo_after_php_ext', $return);
299 299
 
300 300
 	// Session stuff
301
-	$return .= "\n" . '-- Session Configuration' . "\n\n";
302
-	$return .= 'Give Use Sessions:        ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n";
303
-	$return .= 'Session:                  ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
301
+	$return .= "\n".'-- Session Configuration'."\n\n";
302
+	$return .= 'Give Use Sessions:        '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n";
303
+	$return .= 'Session:                  '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n";
304 304
 
305 305
 	// The rest of this is only relevant is session is enabled
306
-	if ( isset( $_SESSION ) ) {
307
-		$return .= 'Session Name:             ' . esc_html( ini_get( 'session.name' ) ) . "\n";
308
-		$return .= 'Cookie Path:              ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
309
-		$return .= 'Save Path:                ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
310
-		$return .= 'Use Cookies:              ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
311
-		$return .= 'Use Only Cookies:         ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
306
+	if (isset($_SESSION)) {
307
+		$return .= 'Session Name:             '.esc_html(ini_get('session.name'))."\n";
308
+		$return .= 'Cookie Path:              '.esc_html(ini_get('session.cookie_path'))."\n";
309
+		$return .= 'Save Path:                '.esc_html(ini_get('session.save_path'))."\n";
310
+		$return .= 'Use Cookies:              '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
311
+		$return .= 'Use Only Cookies:         '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
312 312
 	}
313 313
 
314
-	$return = apply_filters( 'give_sysinfo_after_session_config', $return );
314
+	$return = apply_filters('give_sysinfo_after_session_config', $return);
315 315
 
316
-	$return .= "\n" . '### End System Info ###';
316
+	$return .= "\n".'### End System Info ###';
317 317
 
318 318
 	return $return;
319 319
 }
@@ -327,17 +327,17 @@  discard block
 block discarded – undo
327 327
  */
328 328
 function give_tools_sysinfo_download() {
329 329
 
330
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
330
+	if ( ! current_user_can('manage_give_settings')) {
331 331
 		return;
332 332
 	}
333 333
 
334 334
 	nocache_headers();
335 335
 
336
-	header( 'Content-Type: text/plain' );
337
-	header( 'Content-Disposition: attachment; filename="give-system-info.txt"' );
336
+	header('Content-Type: text/plain');
337
+	header('Content-Disposition: attachment; filename="give-system-info.txt"');
338 338
 
339
-	echo wp_strip_all_tags( $_POST['give-sysinfo'] );
339
+	echo wp_strip_all_tags($_POST['give-sysinfo']);
340 340
 	give_die();
341 341
 }
342 342
 
343
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' );
344 343
\ No newline at end of file
344
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download');
345 345
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/add-ons.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 function give_add_ons_page() {
26 26
 	ob_start(); ?>
27 27
 	<div class="wrap" id="give-add-ons">
28
-		<h2><?php _e( 'Give Add-ons', 'give' ); ?>
29
-			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php _e( 'Browse All Add-ons', 'give' ); ?>" target="_blank"><?php _e( 'View All Add-ons', 'give' ); ?>
28
+		<h2><?php _e('Give Add-ons', 'give'); ?>
29
+			&nbsp;&mdash;&nbsp;<a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php _e('Browse All Add-ons', 'give'); ?>" target="_blank"><?php _e('View All Add-ons', 'give'); ?>
30 30
 				<span class="dashicons dashicons-external"></span></a>
31 31
 		</h2>
32 32
 
33
-		<p><?php _e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p>
33
+		<p><?php _e('The following Add-ons extend the functionality of Give.', 'give'); ?></p>
34 34
 		<?php echo give_add_ons_get_feed(); ?>
35 35
 	</div>
36 36
 	<?php
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 function give_add_ons_get_feed() {
49 49
 
50 50
 	$addons_debug = false; //set to true to debug
51
-	$cache        = get_transient( 'give_add_ons_feed' );
51
+	$cache        = get_transient('give_add_ons_feed');
52 52
 
53
-	if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) {
54
-		$feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) );
53
+	if ($cache === false || $addons_debug === true && WP_DEBUG === true) {
54
+		$feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false));
55 55
 
56
-		if ( ! is_wp_error( $feed ) ) {
57
-			if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
58
-				$cache = wp_remote_retrieve_body( $feed );
59
-				set_transient( 'give_add_ons_feed', $cache, 3600 );
56
+		if ( ! is_wp_error($feed)) {
57
+			if (isset($feed['body']) && strlen($feed['body']) > 0) {
58
+				$cache = wp_remote_retrieve_body($feed);
59
+				set_transient('give_add_ons_feed', $cache, 3600);
60 60
 			}
61 61
 		} else {
62
-			$cache = '<div class="error"><p>' . __( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>';
62
+			$cache = '<div class="error"><p>'.__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>';
63 63
 		}
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
includes/gateways/paypal-standard.php 1 patch
Spacing   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.0
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @access private
22 22
  * @since  1.0
23 23
  */
24
-add_action( 'give_paypal_cc_form', '__return_false' );
24
+add_action('give_paypal_cc_form', '__return_false');
25 25
 
26 26
 /**
27 27
  * Process PayPal Purchase
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
  *
33 33
  * @return void
34 34
  */
35
-function give_process_paypal_purchase( $purchase_data ) {
35
+function give_process_paypal_purchase($purchase_data) {
36 36
 
37
-	if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) {
38
-		wp_die( __( 'Nonce verification has failed', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
37
+	if ( ! wp_verify_nonce($purchase_data['gateway_nonce'], 'give-gateway')) {
38
+		wp_die(__('Nonce verification has failed', 'give'), __('Error', 'give'), array('response' => 403));
39 39
 	}
40 40
 
41
-	$form_id = intval( $purchase_data['post_data']['give-form-id'] );
41
+	$form_id = intval($purchase_data['post_data']['give-form-id']);
42 42
 
43 43
 	// Collect payment data
44 44
 	$payment_data = array(
@@ -55,59 +55,59 @@  discard block
 block discarded – undo
55 55
 	);
56 56
 
57 57
 	// Record the pending payment
58
-	$payment = give_insert_payment( $payment_data );
58
+	$payment = give_insert_payment($payment_data);
59 59
 
60 60
 	// Check payment
61
-	if ( ! $payment ) {
61
+	if ( ! $payment) {
62 62
 		// Record the error
63
-		give_record_gateway_error( __( 'Payment Error', 'give' ), sprintf( __( 'Payment creation failed before sending buyer to PayPal. Payment data: %s', 'give' ), json_encode( $payment_data ) ), $payment );
63
+		give_record_gateway_error(__('Payment Error', 'give'), sprintf(__('Payment creation failed before sending buyer to PayPal. Payment data: %s', 'give'), json_encode($payment_data)), $payment);
64 64
 		// Problems? send back
65
-		give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] );
65
+		give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']);
66 66
 	} else {
67 67
 		// Only send to PayPal if the pending payment is created successfully
68
-		$listener_url = add_query_arg( 'give-listener', 'IPN', home_url( 'index.php' ) );
68
+		$listener_url = add_query_arg('give-listener', 'IPN', home_url('index.php'));
69 69
 
70 70
 		// Get the success url
71
-		$return_url = add_query_arg( array(
71
+		$return_url = add_query_arg(array(
72 72
 			'payment-confirmation' => 'paypal',
73 73
 			'payment-id'           => $payment
74 74
 
75
-		), get_permalink( give_get_option( 'success_page' ) ) );
75
+		), get_permalink(give_get_option('success_page')));
76 76
 
77 77
 		// Get the PayPal redirect uri
78
-		$paypal_redirect = trailingslashit( give_get_paypal_redirect() ) . '?';
78
+		$paypal_redirect = trailingslashit(give_get_paypal_redirect()).'?';
79 79
 
80 80
 		//Item name - pass level name if variable priced
81 81
 		$item_name = $purchase_data['post_data']['give-form-title'];
82 82
 
83 83
 		//Verify has variable prices
84
-		if ( give_has_variable_prices( $form_id ) && isset( $purchase_data['post_data']['give-price-id'] ) ) {
84
+		if (give_has_variable_prices($form_id) && isset($purchase_data['post_data']['give-price-id'])) {
85 85
 
86
-			$item_price_level_text = give_get_price_option_name( $form_id, $purchase_data['post_data']['give-price-id'] );
86
+			$item_price_level_text = give_get_price_option_name($form_id, $purchase_data['post_data']['give-price-id']);
87 87
 
88
-			$price_level_amount = give_get_price_option_amount( $form_id, $purchase_data['post_data']['give-price-id'] );
88
+			$price_level_amount = give_get_price_option_amount($form_id, $purchase_data['post_data']['give-price-id']);
89 89
 
90 90
 			//Donation given doesn't match selected level (must be a custom amount)
91
-			if ( $price_level_amount != give_sanitize_amount( $purchase_data['price'] ) ) {
92
-				$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
91
+			if ($price_level_amount != give_sanitize_amount($purchase_data['price'])) {
92
+				$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
93 93
 				//user custom amount text if any, fallback to default if not
94
-				$item_name .= ' - ' . ( ! empty( $custom_amount_text ) ? $custom_amount_text : __( 'Custom Amount', 'give' ) );
94
+				$item_name .= ' - '.( ! empty($custom_amount_text) ? $custom_amount_text : __('Custom Amount', 'give'));
95 95
 
96 96
 			} //Is there any donation level text?
97
-			elseif ( ! empty( $item_price_level_text ) ) {
98
-				$item_name .= ' - ' . $item_price_level_text;
97
+			elseif ( ! empty($item_price_level_text)) {
98
+				$item_name .= ' - '.$item_price_level_text;
99 99
 			}
100 100
 
101 101
 		} //Single donation: Custom Amount
102
-		elseif ( give_get_form_price( $form_id ) !== give_sanitize_amount( $purchase_data['price'] ) ) {
103
-			$custom_amount_text = get_post_meta( $form_id, '_give_custom_amount_text', true );
102
+		elseif (give_get_form_price($form_id) !== give_sanitize_amount($purchase_data['price'])) {
103
+			$custom_amount_text = get_post_meta($form_id, '_give_custom_amount_text', true);
104 104
 			//user custom amount text if any, fallback to default if not
105
-			$item_name .= ' - ' . ( ! empty( $custom_amount_text ) ? $custom_amount_text : __( 'Custom Amount', 'give' ) );
105
+			$item_name .= ' - '.( ! empty($custom_amount_text) ? $custom_amount_text : __('Custom Amount', 'give'));
106 106
 		}
107 107
 
108 108
 		// Setup PayPal arguments
109 109
 		$paypal_args = array(
110
-			'business'      => give_get_option( 'paypal_email', false ),
110
+			'business'      => give_get_option('paypal_email', false),
111 111
 			'email'         => $purchase_data['user_email'],
112 112
 			'invoice'       => $purchase_data['purchase_key'],
113 113
 			'amount'        => $purchase_data['price'],
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
 			'shipping'      => '0',
119 119
 			'no_note'       => '1',
120 120
 			'currency_code' => give_get_currency(),
121
-			'charset'       => get_bloginfo( 'charset' ),
121
+			'charset'       => get_bloginfo('charset'),
122 122
 			'custom'        => $payment,
123 123
 			'rm'            => '2',
124 124
 			'return'        => $return_url,
125
-			'cancel_return' => give_get_failed_transaction_uri( '?payment-id=' . $payment ),
125
+			'cancel_return' => give_get_failed_transaction_uri('?payment-id='.$payment),
126 126
 			'notify_url'    => $listener_url,
127 127
 			'page_style'    => give_get_paypal_page_style(),
128
-			'cbt'           => get_bloginfo( 'name' ),
128
+			'cbt'           => get_bloginfo('name'),
129 129
 			'bn'            => 'givewp_SP'
130 130
 		);
131 131
 
132
-		if ( ! empty( $purchase_data['user_info']['address'] ) ) {
132
+		if ( ! empty($purchase_data['user_info']['address'])) {
133 133
 			$paypal_args['address1'] = $purchase_data['user_info']['address']['line1'];
134 134
 			$paypal_args['address2'] = $purchase_data['user_info']['address']['line2'];
135 135
 			$paypal_args['city']     = $purchase_data['user_info']['address']['city'];
136 136
 			$paypal_args['country']  = $purchase_data['user_info']['address']['country'];
137 137
 		}
138 138
 
139
-		if ( give_get_option( 'paypal_button_type' ) === 'standard' ) {
139
+		if (give_get_option('paypal_button_type') === 'standard') {
140 140
 			$paypal_extra_args = array(
141 141
 				'cmd' => '_xclick',
142 142
 			);
@@ -146,25 +146,25 @@  discard block
 block discarded – undo
146 146
 			);
147 147
 		}
148 148
 
149
-		$paypal_args = array_merge( $paypal_extra_args, $paypal_args );
149
+		$paypal_args = array_merge($paypal_extra_args, $paypal_args);
150 150
 
151 151
 
152
-		$paypal_args = apply_filters( 'give_paypal_redirect_args', $paypal_args, $purchase_data );
152
+		$paypal_args = apply_filters('give_paypal_redirect_args', $paypal_args, $purchase_data);
153 153
 
154 154
 		// Build query
155
-		$paypal_redirect .= http_build_query( $paypal_args );
155
+		$paypal_redirect .= http_build_query($paypal_args);
156 156
 
157 157
 		// Fix for some sites that encode the entities
158
-		$paypal_redirect = str_replace( '&amp;', '&', $paypal_redirect );
158
+		$paypal_redirect = str_replace('&amp;', '&', $paypal_redirect);
159 159
 
160 160
 		// Redirect to PayPal
161
-		wp_redirect( $paypal_redirect );
161
+		wp_redirect($paypal_redirect);
162 162
 		exit;
163 163
 	}
164 164
 
165 165
 }
166 166
 
167
-add_action( 'give_gateway_paypal', 'give_process_paypal_purchase' );
167
+add_action('give_gateway_paypal', 'give_process_paypal_purchase');
168 168
 
169 169
 /**
170 170
  * Listens for a PayPal IPN requests and then sends to the processing function
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function give_listen_for_paypal_ipn() {
176 176
 	// Regular PayPal IPN
177
-	if ( isset( $_GET['give-listener'] ) && $_GET['give-listener'] == 'IPN' ) {
178
-		do_action( 'give_verify_paypal_ipn' );
177
+	if (isset($_GET['give-listener']) && $_GET['give-listener'] == 'IPN') {
178
+		do_action('give_verify_paypal_ipn');
179 179
 	}
180 180
 }
181 181
 
182
-add_action( 'init', 'give_listen_for_paypal_ipn' );
182
+add_action('init', 'give_listen_for_paypal_ipn');
183 183
 
184 184
 /**
185 185
  * Process PayPal IPN
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 function give_process_paypal_ipn() {
191 191
 
192 192
 	// Check the request method is POST
193
-	if ( isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] != 'POST' ) {
193
+	if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'POST') {
194 194
 		return;
195 195
 	}
196 196
 
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	$post_data = '';
199 199
 
200 200
 	// Fallback just in case post_max_size is lower than needed
201
-	if ( ini_get( 'allow_url_fopen' ) ) {
202
-		$post_data = file_get_contents( 'php://input' );
201
+	if (ini_get('allow_url_fopen')) {
202
+		$post_data = file_get_contents('php://input');
203 203
 	} else {
204 204
 		// If allow_url_fopen is not enabled, then make sure that post_max_size is large enough
205
-		ini_set( 'post_max_size', '12M' );
205
+		ini_set('post_max_size', '12M');
206 206
 	}
207 207
 	// Start the encoded data collection with notification command
208 208
 	$encoded_data = 'cmd=_notify-validate';
@@ -211,27 +211,27 @@  discard block
 block discarded – undo
211 211
 	$arg_separator = give_get_php_arg_separator_output();
212 212
 
213 213
 	// Verify there is a post_data
214
-	if ( $post_data || strlen( $post_data ) > 0 ) {
214
+	if ($post_data || strlen($post_data) > 0) {
215 215
 		// Append the data
216
-		$encoded_data .= $arg_separator . $post_data;
216
+		$encoded_data .= $arg_separator.$post_data;
217 217
 	} else {
218 218
 		// Check if POST is empty
219
-		if ( empty( $_POST ) ) {
219
+		if (empty($_POST)) {
220 220
 			// Nothing to do
221 221
 			return;
222 222
 		} else {
223 223
 			// Loop through each POST
224
-			foreach ( $_POST as $key => $value ) {
224
+			foreach ($_POST as $key => $value) {
225 225
 				// Encode the value and append the data
226
-				$encoded_data .= $arg_separator . "$key=" . urlencode( $value );
226
+				$encoded_data .= $arg_separator."$key=".urlencode($value);
227 227
 			}
228 228
 		}
229 229
 	}
230 230
 
231 231
 	// Convert collected post data to an array
232
-	parse_str( $encoded_data, $encoded_data_array );
232
+	parse_str($encoded_data, $encoded_data_array);
233 233
 
234
-	if ( ! give_get_option( 'disable_paypal_verification' ) ) {
234
+	if ( ! give_get_option('disable_paypal_verification')) {
235 235
 
236 236
 		// Validate the IPN
237 237
 
@@ -253,16 +253,16 @@  discard block
 block discarded – undo
253 253
 		);
254 254
 
255 255
 		// Get response
256
-		$api_response = wp_remote_post( give_get_paypal_redirect(), $remote_post_vars );
256
+		$api_response = wp_remote_post(give_get_paypal_redirect(), $remote_post_vars);
257 257
 
258
-		if ( is_wp_error( $api_response ) ) {
259
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) );
258
+		if (is_wp_error($api_response)) {
259
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response)));
260 260
 
261 261
 			return; // Something went wrong
262 262
 		}
263 263
 
264
-		if ( $api_response['body'] !== 'VERIFIED' && give_get_option( 'disable_paypal_verification', false ) ) {
265
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid IPN verification response. IPN data: %s', 'give' ), json_encode( $api_response ) ) );
264
+		if ($api_response['body'] !== 'VERIFIED' && give_get_option('disable_paypal_verification', false)) {
265
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid IPN verification response. IPN data: %s', 'give'), json_encode($api_response)));
266 266
 
267 267
 			return; // Response not okay
268 268
 		}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	}
271 271
 
272 272
 	// Check if $post_data_array has been populated
273
-	if ( ! is_array( $encoded_data_array ) && ! empty( $encoded_data_array ) ) {
273
+	if ( ! is_array($encoded_data_array) && ! empty($encoded_data_array)) {
274 274
 		return;
275 275
 	}
276 276
 
@@ -279,21 +279,21 @@  discard block
 block discarded – undo
279 279
 		'payment_status' => ''
280 280
 	);
281 281
 
282
-	$encoded_data_array = wp_parse_args( $encoded_data_array, $defaults );
282
+	$encoded_data_array = wp_parse_args($encoded_data_array, $defaults);
283 283
 
284
-	$payment_id = isset( $encoded_data_array['custom'] ) ? absint( $encoded_data_array['custom'] ) : 0;
284
+	$payment_id = isset($encoded_data_array['custom']) ? absint($encoded_data_array['custom']) : 0;
285 285
 
286
-	if ( has_action( 'give_paypal_' . $encoded_data_array['txn_type'] ) ) {
286
+	if (has_action('give_paypal_'.$encoded_data_array['txn_type'])) {
287 287
 		// Allow PayPal IPN types to be processed separately
288
-		do_action( 'give_paypal_' . $encoded_data_array['txn_type'], $encoded_data_array, $payment_id );
288
+		do_action('give_paypal_'.$encoded_data_array['txn_type'], $encoded_data_array, $payment_id);
289 289
 	} else {
290 290
 		// Fallback to web accept just in case the txn_type isn't present
291
-		do_action( 'give_paypal_web_accept', $encoded_data_array, $payment_id );
291
+		do_action('give_paypal_web_accept', $encoded_data_array, $payment_id);
292 292
 	}
293 293
 	exit;
294 294
 }
295 295
 
296
-add_action( 'give_verify_paypal_ipn', 'give_process_paypal_ipn' );
296
+add_action('give_verify_paypal_ipn', 'give_process_paypal_ipn');
297 297
 
298 298
 /**
299 299
  * Process web accept (one time) payment IPNs
@@ -304,185 +304,185 @@  discard block
 block discarded – undo
304 304
  *
305 305
  * @return void
306 306
  */
307
-function give_process_paypal_web_accept_and_cart( $data, $payment_id ) {
307
+function give_process_paypal_web_accept_and_cart($data, $payment_id) {
308 308
 
309
-	if ( $data['txn_type'] != 'web_accept' && $data['txn_type'] != 'cart' && $data['payment_status'] != 'Refunded' ) {
309
+	if ($data['txn_type'] != 'web_accept' && $data['txn_type'] != 'cart' && $data['payment_status'] != 'Refunded') {
310 310
 		return;
311 311
 	}
312 312
 
313
-	if ( empty( $payment_id ) ) {
313
+	if (empty($payment_id)) {
314 314
 		return;
315 315
 	}
316 316
 
317 317
 	// Collect payment details
318
-	$purchase_key   = isset( $data['invoice'] ) ? $data['invoice'] : $data['item_number'];
318
+	$purchase_key   = isset($data['invoice']) ? $data['invoice'] : $data['item_number'];
319 319
 	$paypal_amount  = $data['mc_gross'];
320
-	$payment_status = strtolower( $data['payment_status'] );
321
-	$currency_code  = strtolower( $data['mc_currency'] );
322
-	$business_email = isset( $data['business'] ) && is_email( $data['business'] ) ? trim( $data['business'] ) : trim( $data['receiver_email'] );
323
-	$payment_meta   = give_get_payment_meta( $payment_id );
320
+	$payment_status = strtolower($data['payment_status']);
321
+	$currency_code  = strtolower($data['mc_currency']);
322
+	$business_email = isset($data['business']) && is_email($data['business']) ? trim($data['business']) : trim($data['receiver_email']);
323
+	$payment_meta   = give_get_payment_meta($payment_id);
324 324
 
325 325
 
326
-	if ( give_get_payment_gateway( $payment_id ) != 'paypal' ) {
326
+	if (give_get_payment_gateway($payment_id) != 'paypal') {
327 327
 		return; // this isn't a PayPal standard IPN
328 328
 	}
329 329
 
330 330
 	// Verify payment recipient
331
-	if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) != 0 ) {
331
+	if (strcasecmp($business_email, trim(give_get_option('paypal_email'))) != 0) {
332 332
 
333
-		give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid business email in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
334
-		give_update_payment_status( $payment_id, 'failed' );
335
-		give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'give' ) );
333
+		give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid business email in IPN response. IPN data: %s', 'give'), json_encode($data)), $payment_id);
334
+		give_update_payment_status($payment_id, 'failed');
335
+		give_insert_payment_note($payment_id, __('Payment failed due to invalid PayPal business email.', 'give'));
336 336
 
337 337
 		return;
338 338
 	}
339 339
 
340 340
 	// Verify payment currency
341
-	if ( $currency_code != strtolower( $payment_meta['currency'] ) ) {
341
+	if ($currency_code != strtolower($payment_meta['currency'])) {
342 342
 
343
-		give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid currency in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
344
-		give_update_payment_status( $payment_id, 'failed' );
345
-		give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid currency in PayPal IPN.', 'give' ) );
343
+		give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid currency in IPN response. IPN data: %s', 'give'), json_encode($data)), $payment_id);
344
+		give_update_payment_status($payment_id, 'failed');
345
+		give_insert_payment_note($payment_id, __('Payment failed due to invalid currency in PayPal IPN.', 'give'));
346 346
 
347 347
 		return;
348 348
 	}
349 349
 
350
-	if ( ! give_get_payment_user_email( $payment_id ) ) {
350
+	if ( ! give_get_payment_user_email($payment_id)) {
351 351
 
352 352
 		// No email associated with purchase, so store from PayPal
353
-		give_update_payment_meta( $payment_id, '_give_payment_user_email', $data['payer_email'] );
353
+		give_update_payment_meta($payment_id, '_give_payment_user_email', $data['payer_email']);
354 354
 
355 355
 		// Setup and store the donors's details
356 356
 		$address            = array();
357
-		$address['line1']   = ! empty( $data['address_street'] ) ? sanitize_text_field( $data['address_street'] ) : false;
358
-		$address['city']    = ! empty( $data['address_city'] ) ? sanitize_text_field( $data['address_city'] ) : false;
359
-		$address['state']   = ! empty( $data['address_state'] ) ? sanitize_text_field( $data['address_state'] ) : false;
360
-		$address['country'] = ! empty( $data['address_country_code'] ) ? sanitize_text_field( $data['address_country_code'] ) : false;
361
-		$address['zip']     = ! empty( $data['address_zip'] ) ? sanitize_text_field( $data['address_zip'] ) : false;
357
+		$address['line1']   = ! empty($data['address_street']) ? sanitize_text_field($data['address_street']) : false;
358
+		$address['city']    = ! empty($data['address_city']) ? sanitize_text_field($data['address_city']) : false;
359
+		$address['state']   = ! empty($data['address_state']) ? sanitize_text_field($data['address_state']) : false;
360
+		$address['country'] = ! empty($data['address_country_code']) ? sanitize_text_field($data['address_country_code']) : false;
361
+		$address['zip']     = ! empty($data['address_zip']) ? sanitize_text_field($data['address_zip']) : false;
362 362
 
363 363
 		$user_info = array(
364 364
 			'id'         => '-1',
365
-			'email'      => sanitize_text_field( $data['payer_email'] ),
366
-			'first_name' => sanitize_text_field( $data['first_name'] ),
367
-			'last_name'  => sanitize_text_field( $data['last_name'] ),
365
+			'email'      => sanitize_text_field($data['payer_email']),
366
+			'first_name' => sanitize_text_field($data['first_name']),
367
+			'last_name'  => sanitize_text_field($data['last_name']),
368 368
 			'discount'   => '',
369 369
 			'address'    => $address
370 370
 		);
371 371
 
372 372
 		$payment_meta['user_info'] = $user_info;
373
-		give_update_payment_meta( $payment_id, '_give_payment_meta', $payment_meta );
373
+		give_update_payment_meta($payment_id, '_give_payment_meta', $payment_meta);
374 374
 	}
375 375
 
376
-	if ( $payment_status == 'refunded' || $payment_status == 'reversed' ) {
376
+	if ($payment_status == 'refunded' || $payment_status == 'reversed') {
377 377
 
378 378
 		// Process a refund
379
-		give_process_paypal_refund( $data, $payment_id );
379
+		give_process_paypal_refund($data, $payment_id);
380 380
 
381 381
 	} else {
382 382
 
383
-		if ( get_post_status( $payment_id ) == 'publish' ) {
383
+		if (get_post_status($payment_id) == 'publish') {
384 384
 			return; // Only complete payments once
385 385
 		}
386 386
 
387 387
 		// Retrieve the total purchase amount (before PayPal)
388
-		$payment_amount = give_get_payment_amount( $payment_id );
388
+		$payment_amount = give_get_payment_amount($payment_id);
389 389
 
390
-		if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
390
+		if (number_format((float) $paypal_amount, 2) < number_format((float) $payment_amount, 2)) {
391 391
 			// The prices don't match
392
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
393
-			give_update_payment_status( $payment_id, 'failed' );
394
-			give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) );
392
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid payment amount in IPN response. IPN data: %s', 'give'), json_encode($data)), $payment_id);
393
+			give_update_payment_status($payment_id, 'failed');
394
+			give_insert_payment_note($payment_id, __('Payment failed due to invalid amount in PayPal IPN.', 'give'));
395 395
 
396 396
 			return;
397 397
 		}
398
-		if ( $purchase_key != give_get_payment_key( $payment_id ) ) {
398
+		if ($purchase_key != give_get_payment_key($payment_id)) {
399 399
 			// Purchase keys don't match
400
-			give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( __( 'Invalid purchase key in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id );
401
-			give_update_payment_status( $payment_id, 'failed' );
402
-			give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid purchase key in PayPal IPN.', 'give' ) );
400
+			give_record_gateway_error(__('IPN Error', 'give'), sprintf(__('Invalid purchase key in IPN response. IPN data: %s', 'give'), json_encode($data)), $payment_id);
401
+			give_update_payment_status($payment_id, 'failed');
402
+			give_insert_payment_note($payment_id, __('Payment failed due to invalid purchase key in PayPal IPN.', 'give'));
403 403
 
404 404
 			return;
405 405
 		}
406 406
 
407
-		if ( $payment_status == 'completed' || give_is_test_mode() ) {
408
-			give_insert_payment_note( $payment_id, sprintf( __( 'PayPal Transaction ID: %s', 'give' ), $data['txn_id'] ) );
409
-			give_set_payment_transaction_id( $payment_id, $data['txn_id'] );
410
-			give_update_payment_status( $payment_id, 'publish' );
411
-		} else if ( 'pending' == $payment_status && isset( $data['pending_reason'] ) ) {
407
+		if ($payment_status == 'completed' || give_is_test_mode()) {
408
+			give_insert_payment_note($payment_id, sprintf(__('PayPal Transaction ID: %s', 'give'), $data['txn_id']));
409
+			give_set_payment_transaction_id($payment_id, $data['txn_id']);
410
+			give_update_payment_status($payment_id, 'publish');
411
+		} else if ('pending' == $payment_status && isset($data['pending_reason'])) {
412 412
 
413 413
 			// Look for possible pending reasons, such as an echeck
414 414
 
415 415
 			$note = '';
416 416
 
417
-			switch ( strtolower( $data['pending_reason'] ) ) {
417
+			switch (strtolower($data['pending_reason'])) {
418 418
 
419 419
 				case 'echeck' :
420 420
 
421
-					$note = __( 'Payment made via eCheck and will clear automatically in 5-8 days', 'give' );
421
+					$note = __('Payment made via eCheck and will clear automatically in 5-8 days', 'give');
422 422
 
423 423
 					break;
424 424
 
425 425
 				case 'address' :
426 426
 
427
-					$note = __( 'Payment requires a confirmed donor address and must be accepted manually through PayPal', 'give' );
427
+					$note = __('Payment requires a confirmed donor address and must be accepted manually through PayPal', 'give');
428 428
 
429 429
 					break;
430 430
 
431 431
 				case 'intl' :
432 432
 
433
-					$note = __( 'Payment must be accepted manually through PayPal due to international account regulations', 'give' );
433
+					$note = __('Payment must be accepted manually through PayPal due to international account regulations', 'give');
434 434
 
435 435
 					break;
436 436
 
437 437
 				case 'multi-currency' :
438 438
 
439
-					$note = __( 'Payment received in non-shop currency and must be accepted manually through PayPal', 'give' );
439
+					$note = __('Payment received in non-shop currency and must be accepted manually through PayPal', 'give');
440 440
 
441 441
 					break;
442 442
 
443 443
 				case 'paymentreview' :
444 444
 				case 'regulatory_review' :
445 445
 
446
-					$note = __( 'Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations', 'give' );
446
+					$note = __('Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations', 'give');
447 447
 
448 448
 					break;
449 449
 
450 450
 				case 'unilateral' :
451 451
 
452
-					$note = __( 'Payment was sent to non-confirmed or non-registered email address.', 'give' );
452
+					$note = __('Payment was sent to non-confirmed or non-registered email address.', 'give');
453 453
 
454 454
 					break;
455 455
 
456 456
 				case 'upgrade' :
457 457
 
458
-					$note = __( 'PayPal account must be upgraded before this payment can be accepted', 'give' );
458
+					$note = __('PayPal account must be upgraded before this payment can be accepted', 'give');
459 459
 
460 460
 					break;
461 461
 
462 462
 				case 'verify' :
463 463
 
464
-					$note = __( 'PayPal account is not verified. Verify account in order to accept this payment', 'give' );
464
+					$note = __('PayPal account is not verified. Verify account in order to accept this payment', 'give');
465 465
 
466 466
 					break;
467 467
 
468 468
 				case 'other' :
469 469
 
470
-					$note = __( 'Payment is pending for unknown reasons. Contact PayPal support for assistance', 'give' );
470
+					$note = __('Payment is pending for unknown reasons. Contact PayPal support for assistance', 'give');
471 471
 
472 472
 					break;
473 473
 
474 474
 			}
475 475
 
476
-			if ( ! empty( $note ) ) {
476
+			if ( ! empty($note)) {
477 477
 
478
-				give_insert_payment_note( $payment_id, $note );
478
+				give_insert_payment_note($payment_id, $note);
479 479
 
480 480
 			}
481 481
 		}
482 482
 	}
483 483
 }
484 484
 
485
-add_action( 'give_paypal_web_accept', 'give_process_paypal_web_accept_and_cart', 10, 2 );
485
+add_action('give_paypal_web_accept', 'give_process_paypal_web_accept_and_cart', 10, 2);
486 486
 
487 487
 /**
488 488
  * Process PayPal IPN Refunds
@@ -493,32 +493,32 @@  discard block
 block discarded – undo
493 493
  *
494 494
  * @return void
495 495
  */
496
-function give_process_paypal_refund( $data, $payment_id = 0 ) {
496
+function give_process_paypal_refund($data, $payment_id = 0) {
497 497
 
498 498
 	// Collect payment details
499 499
 
500
-	if ( empty( $payment_id ) ) {
500
+	if (empty($payment_id)) {
501 501
 		return;
502 502
 	}
503 503
 
504
-	if ( get_post_status( $payment_id ) == 'refunded' ) {
504
+	if (get_post_status($payment_id) == 'refunded') {
505 505
 		return; // Only refund payments once
506 506
 	}
507 507
 
508
-	$payment_amount = give_get_payment_amount( $payment_id );
508
+	$payment_amount = give_get_payment_amount($payment_id);
509 509
 	$refund_amount  = $data['payment_gross'] * - 1;
510 510
 
511
-	if ( number_format( (float) $refund_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) {
511
+	if (number_format((float) $refund_amount, 2) < number_format((float) $payment_amount, 2)) {
512 512
 
513
-		give_insert_payment_note( $payment_id, sprintf( __( 'Partial PayPal refund processed: %s', 'give' ), $data['parent_txn_id'] ) );
513
+		give_insert_payment_note($payment_id, sprintf(__('Partial PayPal refund processed: %s', 'give'), $data['parent_txn_id']));
514 514
 
515 515
 		return; // This is a partial refund
516 516
 
517 517
 	}
518 518
 
519
-	give_insert_payment_note( $payment_id, sprintf( __( 'PayPal Payment #%s Refunded for reason: %s', 'give' ), $data['parent_txn_id'], $data['reason_code'] ) );
520
-	give_insert_payment_note( $payment_id, sprintf( __( 'PayPal Refund Transaction ID: %s', 'give' ), $data['txn_id'] ) );
521
-	give_update_payment_status( $payment_id, 'refunded' );
519
+	give_insert_payment_note($payment_id, sprintf(__('PayPal Payment #%s Refunded for reason: %s', 'give'), $data['parent_txn_id'], $data['reason_code']));
520
+	give_insert_payment_note($payment_id, sprintf(__('PayPal Refund Transaction ID: %s', 'give'), $data['txn_id']));
521
+	give_update_payment_status($payment_id, 'refunded');
522 522
 }
523 523
 
524 524
 /**
@@ -530,24 +530,24 @@  discard block
 block discarded – undo
530 530
  *
531 531
  * @return string
532 532
  */
533
-function give_get_paypal_redirect( $ssl_check = false ) {
533
+function give_get_paypal_redirect($ssl_check = false) {
534 534
 
535
-	if ( is_ssl() || ! $ssl_check ) {
535
+	if (is_ssl() || ! $ssl_check) {
536 536
 		$protocal = 'https://';
537 537
 	} else {
538 538
 		$protocal = 'http://';
539 539
 	}
540 540
 
541 541
 	// Check the current payment mode
542
-	if ( give_is_test_mode() ) {
542
+	if (give_is_test_mode()) {
543 543
 		// Test mode
544
-		$paypal_uri = $protocal . 'www.sandbox.paypal.com/cgi-bin/webscr';
544
+		$paypal_uri = $protocal.'www.sandbox.paypal.com/cgi-bin/webscr';
545 545
 	} else {
546 546
 		// Live mode
547
-		$paypal_uri = $protocal . 'www.paypal.com/cgi-bin/webscr';
547
+		$paypal_uri = $protocal.'www.paypal.com/cgi-bin/webscr';
548 548
 	}
549 549
 
550
-	return apply_filters( 'give_paypal_uri', $paypal_uri );
550
+	return apply_filters('give_paypal_uri', $paypal_uri);
551 551
 }
552 552
 
553 553
 /**
@@ -558,9 +558,9 @@  discard block
 block discarded – undo
558 558
  */
559 559
 function give_get_paypal_page_style() {
560 560
 
561
-	$page_style = trim( give_get_option( 'paypal_page_style', 'PayPal' ) );
561
+	$page_style = trim(give_get_option('paypal_page_style', 'PayPal'));
562 562
 
563
-	return apply_filters( 'give_paypal_page_style', $page_style );
563
+	return apply_filters('give_paypal_page_style', $page_style);
564 564
 }
565 565
 
566 566
 /**
@@ -575,29 +575,29 @@  discard block
 block discarded – undo
575 575
  * @return string
576 576
  *
577 577
  */
578
-function give_paypal_success_page_content( $content ) {
578
+function give_paypal_success_page_content($content) {
579 579
 
580 580
 	global $payment;
581 581
 
582
-	if ( ! isset( $_GET['payment-id'] ) && ! give_get_purchase_session() ) {
582
+	if ( ! isset($_GET['payment-id']) && ! give_get_purchase_session()) {
583 583
 		return $content;
584 584
 	}
585 585
 
586
-	$payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false;
586
+	$payment_id = isset($_GET['payment-id']) ? absint($_GET['payment-id']) : false;
587 587
 
588
-	if ( ! $payment_id ) {
588
+	if ( ! $payment_id) {
589 589
 		$session    = give_get_purchase_session();
590
-		$payment_id = give_get_purchase_id_by_key( $session['purchase_key'] );
590
+		$payment_id = give_get_purchase_id_by_key($session['purchase_key']);
591 591
 	}
592 592
 
593
-	$payment = get_post( $payment_id );
593
+	$payment = get_post($payment_id);
594 594
 
595
-	if ( $payment && 'pending' == $payment->post_status ) {
595
+	if ($payment && 'pending' == $payment->post_status) {
596 596
 
597 597
 		// Payment is still pending so show processing indicator to fix the Race Condition, issue #
598 598
 		ob_start();
599 599
 
600
-		give_get_template_part( 'payment', 'processing' );
600
+		give_get_template_part('payment', 'processing');
601 601
 
602 602
 		$content = ob_get_clean();
603 603
 
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 
608 608
 }
609 609
 
610
-add_filter( 'give_payment_confirm_paypal', 'give_paypal_success_page_content' );
610
+add_filter('give_payment_confirm_paypal', 'give_paypal_success_page_content');
611 611
 
612 612
 /**
613 613
  * Given a Payment ID, extract the transaction ID
@@ -618,22 +618,22 @@  discard block
 block discarded – undo
618 618
  *
619 619
  * @return string                   Transaction ID
620 620
  */
621
-function give_paypal_get_payment_transaction_id( $payment_id ) {
621
+function give_paypal_get_payment_transaction_id($payment_id) {
622 622
 
623 623
 	$transaction_id = '';
624
-	$notes          = give_get_payment_notes( $payment_id );
624
+	$notes          = give_get_payment_notes($payment_id);
625 625
 
626
-	foreach ( $notes as $note ) {
627
-		if ( preg_match( '/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match ) ) {
626
+	foreach ($notes as $note) {
627
+		if (preg_match('/^PayPal Transaction ID: ([^\s]+)/', $note->comment_content, $match)) {
628 628
 			$transaction_id = $match[1];
629 629
 			continue;
630 630
 		}
631 631
 	}
632 632
 
633
-	return apply_filters( 'give_paypal_set_payment_transaction_id', $transaction_id, $payment_id );
633
+	return apply_filters('give_paypal_set_payment_transaction_id', $transaction_id, $payment_id);
634 634
 }
635 635
 
636
-add_filter( 'give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1 );
636
+add_filter('give_get_payment_transaction_id-paypal', 'give_paypal_get_payment_transaction_id', 10, 1);
637 637
 
638 638
 /**
639 639
  * Given a transaction ID, generate a link to the PayPal transaction ID details
@@ -645,13 +645,13 @@  discard block
 block discarded – undo
645 645
  *
646 646
  * @return string                 A link to the PayPal transaction details
647 647
  */
648
-function give_paypal_link_transaction_id( $transaction_id, $payment_id ) {
648
+function give_paypal_link_transaction_id($transaction_id, $payment_id) {
649 649
 
650 650
 	$paypal_base_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=';
651
-	$transaction_url = '<a href="' . esc_url( $paypal_base_url . $transaction_id ) . '" target="_blank">' . $transaction_id . '</a>';
651
+	$transaction_url = '<a href="'.esc_url($paypal_base_url.$transaction_id).'" target="_blank">'.$transaction_id.'</a>';
652 652
 
653
-	return apply_filters( 'give_paypal_link_payment_details_transaction_id', $transaction_url );
653
+	return apply_filters('give_paypal_link_payment_details_transaction_id', $transaction_url);
654 654
 
655 655
 }
656 656
 
657
-add_filter( 'give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2 );
657
+add_filter('give_payment_details_transaction_id-paypal', 'give_paypal_link_transaction_id', 10, 2);
Please login to merge, or discard this patch.
includes/admin/reporting/class-gateways-reports-table.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Gateways Reports Table Class
4
- *
5
- * @package     Give
6
- * @subpackage  Admin/Reports
7
- * @copyright   Copyright (c) 2016, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+	 * Gateways Reports Table Class
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Admin/Reports
7
+	 * @copyright   Copyright (c) 2016, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51 51
 			'ajax'     => false                        // Does this table support ajax?
52
-		) );
52
+		));
53 53
 
54 54
 	}
55 55
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string Column Name
66 66
 	 */
67
-	public function column_default( $item, $column_name ) {
68
-		switch ( $column_name ) {
67
+	public function column_default($item, $column_name) {
68
+		switch ($column_name) {
69 69
 			default:
70
-				return $item[ $column_name ];
70
+				return $item[$column_name];
71 71
 		}
72 72
 	}
73 73
 
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function get_columns() {
82 82
 		$columns = array(
83
-			'label'           => esc_attr__( 'Gateway', 'give' ),
84
-			'complete_sales'  => esc_attr__( 'Complete Transactions', 'give' ),
85
-			'pending_sales'   => esc_attr__( 'Pending / Failed Transactions', 'give' ),
86
-			'total_sales'     => esc_attr__( 'Total Transactions', 'give' ),
87
-			'total_donations' => esc_attr__( 'Total Donations', 'give' )
83
+			'label'           => esc_attr__('Gateway', 'give'),
84
+			'complete_sales'  => esc_attr__('Complete Transactions', 'give'),
85
+			'pending_sales'   => esc_attr__('Pending / Failed Transactions', 'give'),
86
+			'total_sales'     => esc_attr__('Total Transactions', 'give'),
87
+			'total_donations' => esc_attr__('Total Donations', 'give')
88 88
 		);
89 89
 
90 90
 		return $columns;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return int Current page number
100 100
 	 */
101 101
 	public function get_paged() {
102
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
102
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
103 103
 	}
104 104
 
105 105
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @since  1.0
111 111
 	 * @return void
112 112
 	 */
113
-	public function bulk_actions( $which = '' ) {
113
+	public function bulk_actions($which = '') {
114 114
 		// These aren't really bulk actions but this outputs the markup in the right place
115 115
 		give_report_views();
116 116
 	}
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @param string $which
125 125
 	 */
126
-	protected function display_tablenav( $which ) {
126
+	protected function display_tablenav($which) {
127 127
 
128
-		if ( 'top' == $which ) {
129
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
128
+		if ('top' == $which) {
129
+			wp_nonce_field('bulk-'.$this->_args['plural']);
130 130
 		}
131 131
 		?>
132
-		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>">
132
+		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>">
133 133
 
134
-			<h3 class="alignleft reports-earnings-title"><span><?php _e( 'Payment Methods Report', 'give' ); ?></span></h3>
134
+			<h3 class="alignleft reports-earnings-title"><span><?php _e('Payment Methods Report', 'give'); ?></span></h3>
135 135
 
136 136
 			<div class="alignright tablenav-right">
137 137
 				<div class="actions bulkactions">
138
-					<?php $this->bulk_actions( $which ); ?>
138
+					<?php $this->bulk_actions($which); ?>
139 139
 				</div>
140 140
 				<?php
141
-				$this->extra_tablenav( $which );
142
-				$this->pagination( $which );
141
+				$this->extra_tablenav($which);
142
+				$this->pagination($which);
143 143
 				?>
144 144
 			</div>
145 145
 
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 		$gateways     = give_get_payment_gateways();
165 165
 		$stats        = new Give_Payment_Stats();
166 166
 
167
-		foreach ( $gateways as $gateway_id => $gateway ) {
167
+		foreach ($gateways as $gateway_id => $gateway) {
168 168
 
169
-			$complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' );
170
-			$pending_count  = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) );
169
+			$complete_count = give_count_sales_by_gateway($gateway_id, 'publish');
170
+			$pending_count  = give_count_sales_by_gateway($gateway_id, array('pending', 'failed'));
171 171
 
172 172
 			$reports_data[] = array(
173 173
 				'ID'              => $gateway_id,
174 174
 				'label'           => $gateway['admin_label'],
175
-				'complete_sales'  => give_format_amount( $complete_count, false ),
176
-				'pending_sales'   => give_format_amount( $pending_count, false ),
177
-				'total_sales'     => give_format_amount( $complete_count + $pending_count, false ),
178
-				'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, 0, 0, $gateway_id ) ) )
175
+				'complete_sales'  => give_format_amount($complete_count, false),
176
+				'pending_sales'   => give_format_amount($pending_count, false),
177
+				'total_sales'     => give_format_amount($complete_count + $pending_count, false),
178
+				'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, 0, 0, $gateway_id)))
179 179
 			);
180 180
 		}
181 181
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$columns               = $this->get_columns();
198 198
 		$hidden                = array(); // No hidden columns
199 199
 		$sortable              = $this->get_sortable_columns();
200
-		$this->_column_headers = array( $columns, $hidden, $sortable );
200
+		$this->_column_headers = array($columns, $hidden, $sortable);
201 201
 		$this->items           = $this->reports_data();
202 202
 
203 203
 	}
Please login to merge, or discard this patch.