Completed
Push — master ( 89f5bc...746bd1 )
by Devin
48:45 queued 31:41
created
includes/admin/system-info.php 1 patch
Spacing   +141 added lines, -141 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 = wp_get_theme( get_stylesheet_directory() . '/style.css' );
67
-		$theme      = $theme_data['Name'] . ' ' . $theme_data['Version'];
65
+	if (get_bloginfo('version') < '3.4') {
66
+		$theme_data = wp_get_theme(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,203 +120,203 @@  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 .= 'URL-aware fopen:          ' . ( ini_get( 'allow_url_fopen' ) ? 'On (' . ini_get( 'allow_url_fopen' ) . ')' : 'N/A' ) . "\n";
282
-	$return .= 'Display Errors:           ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n";
283
-
284
-	$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 .= 'URL-aware fopen:          '.(ini_get('allow_url_fopen') ? 'On ('.ini_get('allow_url_fopen').')' : 'N/A')."\n";
282
+	$return .= 'Display Errors:           '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n";
283
+
284
+	$return = apply_filters('give_sysinfo_after_php_config', $return);
285 285
 
286 286
 	// PHP extensions and such
287
-	$return .= "\n" . '-- PHP Extensions' . "\n\n";
288
-	$return .= 'cURL:                     ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n";
287
+	$return .= "\n".'-- PHP Extensions'."\n\n";
288
+	$return .= 'cURL:                     '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n";
289 289
 
290 290
 	//cURL version
291
-	if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) {
291
+	if (function_exists('curl_init') && function_exists('curl_version')) {
292 292
 		$curl_values = curl_version();
293
-		$return .= 'cURL Version:             ' . $curl_values["version"] . "\n";
293
+		$return .= 'cURL Version:             '.$curl_values["version"]."\n";
294 294
 	}
295
-	$return .= 'zlib:                     ' . ( function_exists( 'gzcompress' ) ? 'Supported' : 'Not Supported' ) . "\n";
296
-	$return .= 'GD:                       ' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'Supported' : 'Not Supported' ) . "\n";
297
-	$return .= 'fsockopen:                ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n";
298
-	$return .= 'SOAP Client:              ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n";
299
-	$return .= 'Suhosin:                  ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n";
295
+	$return .= 'zlib:                     '.(function_exists('gzcompress') ? 'Supported' : 'Not Supported')."\n";
296
+	$return .= 'GD:                       '.((extension_loaded('gd') && function_exists('gd_info')) ? 'Supported' : 'Not Supported')."\n";
297
+	$return .= 'fsockopen:                '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n";
298
+	$return .= 'SOAP Client:              '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n";
299
+	$return .= 'Suhosin:                  '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n";
300 300
 
301
-	$return = apply_filters( 'give_sysinfo_after_php_ext', $return );
301
+	$return = apply_filters('give_sysinfo_after_php_ext', $return);
302 302
 
303 303
 	// Session stuff
304
-	$return .= "\n" . '-- Session Configuration' . "\n\n";
305
-	$return .= 'Give Use Sessions:        ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n";
306
-	$return .= 'Session:                  ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n";
304
+	$return .= "\n".'-- Session Configuration'."\n\n";
305
+	$return .= 'Give Use Sessions:        '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n";
306
+	$return .= 'Session:                  '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n";
307 307
 
308 308
 	// The rest of this is only relevant is session is enabled
309
-	if ( isset( $_SESSION ) ) {
310
-		$return .= 'Session Name:             ' . esc_html( ini_get( 'session.name' ) ) . "\n";
311
-		$return .= 'Cookie Path:              ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n";
312
-		$return .= 'Save Path:                ' . esc_html( ini_get( 'session.save_path' ) ) . "\n";
313
-		$return .= 'Use Cookies:              ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n";
314
-		$return .= 'Use Only Cookies:         ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n";
309
+	if (isset($_SESSION)) {
310
+		$return .= 'Session Name:             '.esc_html(ini_get('session.name'))."\n";
311
+		$return .= 'Cookie Path:              '.esc_html(ini_get('session.cookie_path'))."\n";
312
+		$return .= 'Save Path:                '.esc_html(ini_get('session.save_path'))."\n";
313
+		$return .= 'Use Cookies:              '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n";
314
+		$return .= 'Use Only Cookies:         '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n";
315 315
 	}
316 316
 
317
-	$return = apply_filters( 'give_sysinfo_after_session_config', $return );
317
+	$return = apply_filters('give_sysinfo_after_session_config', $return);
318 318
 
319
-	$return .= "\n" . '### End System Info ###';
319
+	$return .= "\n".'### End System Info ###';
320 320
 
321 321
 	return $return;
322 322
 }
@@ -330,17 +330,17 @@  discard block
 block discarded – undo
330 330
  */
331 331
 function give_tools_sysinfo_download() {
332 332
 
333
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
333
+	if ( ! current_user_can('manage_give_settings')) {
334 334
 		return;
335 335
 	}
336 336
 
337 337
 	nocache_headers();
338 338
 
339
-	header( 'Content-Type: text/plain' );
340
-	header( 'Content-Disposition: attachment; filename="give-system-info.txt"' );
339
+	header('Content-Type: text/plain');
340
+	header('Content-Disposition: attachment; filename="give-system-info.txt"');
341 341
 
342
-	echo wp_strip_all_tags( $_POST['give-sysinfo'] );
342
+	echo wp_strip_all_tags($_POST['give-sysinfo']);
343 343
 	give_die();
344 344
 }
345 345
 
346
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' );
347 346
\ No newline at end of file
347
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download');
348 348
\ No newline at end of file
Please login to merge, or discard this patch.