|
@@ -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,14 +24,14 @@ 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
|
?> |
31
|
31
|
<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> |
32
|
32
|
<p class="submit"> |
33
|
33
|
<input type="hidden" name="give-action" value="download_sysinfo"/> |
34
|
|
- <?php submit_button( 'Download System Info File', 'secondary', 'give-download-sysinfo', false ); ?> |
|
34
|
+ <?php submit_button('Download System Info File', 'secondary', 'give-download-sysinfo', false); ?> |
35
|
35
|
</p> |
36
|
36
|
<style> |
37
|
37
|
.give_forms_page_give-settings .give-submit-wrap { |
|
@@ -52,12 +52,12 @@ discard block |
|
|
block discarded – undo |
52
|
52
|
* @return bool |
53
|
53
|
*/ |
54
|
54
|
function give_allow_sessions_for_sysinfo() { |
55
|
|
- if ( is_admin() && ( isset( $_GET['page'] ) && isset( $_GET['tab'] ) ) && ( $_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings' ) ) { |
|
55
|
+ if (is_admin() && (isset($_GET['page']) && isset($_GET['tab'])) && ($_GET['tab'] == 'system_info' && $_GET['page'] == 'give-settings')) { |
56
|
56
|
return true; |
57
|
57
|
} |
58
|
58
|
} |
59
|
59
|
|
60
|
|
-add_filter( 'give_start_session', 'give_allow_sessions_for_sysinfo' ); |
|
60
|
+add_filter('give_start_session', 'give_allow_sessions_for_sysinfo'); |
61
|
61
|
|
62
|
62
|
|
63
|
63
|
/** |
|
@@ -72,63 +72,63 @@ discard block |
|
|
block discarded – undo |
72
|
72
|
function give_tools_sysinfo_get() { |
73
|
73
|
global $wpdb, $give_options; |
74
|
74
|
|
75
|
|
- if ( ! class_exists( 'Browser' ) ) { |
76
|
|
- require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php'; |
|
75
|
+ if ( ! class_exists('Browser')) { |
|
76
|
+ require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php'; |
77
|
77
|
} |
78
|
78
|
|
79
|
79
|
$browser = new Browser(); |
80
|
80
|
|
81
|
81
|
// Get theme info |
82
|
|
- if ( get_bloginfo( 'version' ) < '3.4' ) { |
83
|
|
- $theme_data = wp_get_theme( get_stylesheet_directory() . '/style.css' ); |
84
|
|
- $theme = $theme_data['Name'] . ' ' . $theme_data['Version']; |
|
82
|
+ if (get_bloginfo('version') < '3.4') { |
|
83
|
+ $theme_data = wp_get_theme(get_stylesheet_directory().'/style.css'); |
|
84
|
+ $theme = $theme_data['Name'].' '.$theme_data['Version']; |
85
|
85
|
} else { |
86
|
86
|
$theme_data = wp_get_theme(); |
87
|
|
- $theme = $theme_data->Name . ' ' . $theme_data->Version; |
|
87
|
+ $theme = $theme_data->Name.' '.$theme_data->Version; |
88
|
88
|
} |
89
|
89
|
|
90
|
90
|
// Try to identify the hosting provider |
91
|
91
|
$host = give_get_host(); |
92
|
92
|
|
93
|
|
- $return = '### Begin System Info ###' . "\n\n"; |
|
93
|
+ $return = '### Begin System Info ###'."\n\n"; |
94
|
94
|
|
95
|
95
|
// Start with the basics... |
96
|
|
- $return .= '-- Site Info' . "\n\n"; |
97
|
|
- $return .= 'Site URL: ' . site_url() . "\n"; |
98
|
|
- $return .= 'Home URL: ' . home_url() . "\n"; |
99
|
|
- $return .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n"; |
|
96
|
+ $return .= '-- Site Info'."\n\n"; |
|
97
|
+ $return .= 'Site URL: '.site_url()."\n"; |
|
98
|
+ $return .= 'Home URL: '.home_url()."\n"; |
|
99
|
+ $return .= 'Multisite: '.(is_multisite() ? 'Yes' : 'No')."\n"; |
100
|
100
|
|
101
|
|
- $return = apply_filters( 'give_sysinfo_after_site_info', $return ); |
|
101
|
+ $return = apply_filters('give_sysinfo_after_site_info', $return); |
102
|
102
|
|
103
|
103
|
// Can we determine the site's host? |
104
|
|
- if ( $host ) { |
105
|
|
- $return .= "\n" . '-- Hosting Provider' . "\n\n"; |
106
|
|
- $return .= 'Host: ' . $host . "\n"; |
|
104
|
+ if ($host) { |
|
105
|
+ $return .= "\n".'-- Hosting Provider'."\n\n"; |
|
106
|
+ $return .= 'Host: '.$host."\n"; |
107
|
107
|
|
108
|
|
- $return = apply_filters( 'give_sysinfo_after_host_info', $return ); |
|
108
|
+ $return = apply_filters('give_sysinfo_after_host_info', $return); |
109
|
109
|
} |
110
|
110
|
|
111
|
111
|
// The local users' browser information, handled by the Browser class |
112
|
|
- $return .= "\n" . '-- User Browser' . "\n\n"; |
|
112
|
+ $return .= "\n".'-- User Browser'."\n\n"; |
113
|
113
|
$return .= $browser; |
114
|
114
|
|
115
|
|
- $return = apply_filters( 'give_sysinfo_after_user_browser', $return ); |
|
115
|
+ $return = apply_filters('give_sysinfo_after_user_browser', $return); |
116
|
116
|
|
117
|
117
|
// WordPress configuration |
118
|
|
- $return .= "\n" . '-- WordPress Configuration' . "\n\n"; |
119
|
|
- $return .= 'Version: ' . get_bloginfo( 'version' ) . "\n"; |
120
|
|
- $return .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n"; |
121
|
|
- $return .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n"; |
122
|
|
- $return .= 'Active Theme: ' . $theme . "\n"; |
123
|
|
- $return .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n"; |
|
118
|
+ $return .= "\n".'-- WordPress Configuration'."\n\n"; |
|
119
|
+ $return .= 'Version: '.get_bloginfo('version')."\n"; |
|
120
|
+ $return .= 'Language: '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n"; |
|
121
|
+ $return .= 'Permalink Structure: '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n"; |
|
122
|
+ $return .= 'Active Theme: '.$theme."\n"; |
|
123
|
+ $return .= 'Show On Front: '.get_option('show_on_front')."\n"; |
124
|
124
|
|
125
|
125
|
// Only show page specs if frontpage is set to 'page' |
126
|
|
- if ( get_option( 'show_on_front' ) == 'page' ) { |
127
|
|
- $front_page_id = get_option( 'page_on_front' ); |
128
|
|
- $blog_page_id = get_option( 'page_for_posts' ); |
|
126
|
+ if (get_option('show_on_front') == 'page') { |
|
127
|
+ $front_page_id = get_option('page_on_front'); |
|
128
|
+ $blog_page_id = get_option('page_for_posts'); |
129
|
129
|
|
130
|
|
- $return .= 'Page On Front: ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n"; |
131
|
|
- $return .= 'Page For Posts: ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n"; |
|
130
|
+ $return .= 'Page On Front: '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n"; |
|
131
|
+ $return .= 'Page For Posts: '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n"; |
132
|
132
|
} |
133
|
133
|
|
134
|
134
|
// Make sure wp_remote_post() is working |
|
@@ -137,203 +137,203 @@ discard block |
|
|
block discarded – undo |
137
|
137
|
$params = array( |
138
|
138
|
'sslverify' => false, |
139
|
139
|
'timeout' => 60, |
140
|
|
- 'user-agent' => 'Give/' . GIVE_VERSION, |
|
140
|
+ 'user-agent' => 'Give/'.GIVE_VERSION, |
141
|
141
|
'body' => $request |
142
|
142
|
); |
143
|
143
|
|
144
|
|
- $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params ); |
|
144
|
+ $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params); |
145
|
145
|
|
146
|
|
- if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
146
|
+ if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
147
|
147
|
$WP_REMOTE_POST = 'wp_remote_post() works'; |
148
|
148
|
} else { |
149
|
149
|
$WP_REMOTE_POST = 'wp_remote_post() does not work'; |
150
|
150
|
} |
151
|
151
|
|
152
|
|
- $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n"; |
153
|
|
- $return .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n"; |
154
|
|
- $return .= 'Admin AJAX: ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n"; |
155
|
|
- $return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n"; |
156
|
|
- $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; |
157
|
|
- $return .= 'Registered Post Stati: ' . implode( ', ', get_post_stati() ) . "\n"; |
|
152
|
+ $return .= 'Remote Post: '.$WP_REMOTE_POST."\n"; |
|
153
|
+ $return .= 'Table Prefix: '.'Length: '.strlen($wpdb->prefix).' Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n"; |
|
154
|
+ $return .= 'Admin AJAX: '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n"; |
|
155
|
+ $return .= 'WP_DEBUG: '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n"; |
|
156
|
+ $return .= 'Memory Limit: '.WP_MEMORY_LIMIT."\n"; |
|
157
|
+ $return .= 'Registered Post Stati: '.implode(', ', get_post_stati())."\n"; |
158
|
158
|
|
159
|
|
- $return = apply_filters( 'give_sysinfo_after_wordpress_config', $return ); |
|
159
|
+ $return = apply_filters('give_sysinfo_after_wordpress_config', $return); |
160
|
160
|
|
161
|
161
|
// GIVE configuration |
162
|
|
- $return .= "\n" . '-- Give Configuration' . "\n\n"; |
163
|
|
- $return .= 'Version: ' . GIVE_VERSION . "\n"; |
164
|
|
- $return .= 'Upgraded From: ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n"; |
165
|
|
- $return .= 'Test Mode: ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" ); |
166
|
|
- $return .= 'Currency Code: ' . give_get_currency() . "\n"; |
167
|
|
- $return .= 'Currency Position: ' . give_get_option( 'currency_position', 'before' ) . "\n"; |
168
|
|
- $return .= 'Decimal Separator: ' . give_get_option( 'decimal_separator', '.' ) . "\n"; |
169
|
|
- $return .= 'Thousands Separator: ' . give_get_option( 'thousands_separator', ',' ) . "\n"; |
|
162
|
+ $return .= "\n".'-- Give Configuration'."\n\n"; |
|
163
|
+ $return .= 'Version: '.GIVE_VERSION."\n"; |
|
164
|
+ $return .= 'Upgraded From: '.get_option('give_version_upgraded_from', 'None')."\n"; |
|
165
|
+ $return .= 'Test Mode: '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n"); |
|
166
|
+ $return .= 'Currency Code: '.give_get_currency()."\n"; |
|
167
|
+ $return .= 'Currency Position: '.give_get_option('currency_position', 'before')."\n"; |
|
168
|
+ $return .= 'Decimal Separator: '.give_get_option('decimal_separator', '.')."\n"; |
|
169
|
+ $return .= 'Thousands Separator: '.give_get_option('thousands_separator', ',')."\n"; |
170
|
170
|
|
171
|
|
- $return = apply_filters( 'give_sysinfo_after_give_config', $return ); |
|
171
|
+ $return = apply_filters('give_sysinfo_after_give_config', $return); |
172
|
172
|
|
173
|
173
|
// GIVE pages |
174
|
|
- $return .= "\n" . '-- Give Page Configuration' . "\n\n"; |
175
|
|
- $return .= 'Success Page: ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" ); |
176
|
|
- $return .= 'Failure Page: ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" ); |
177
|
|
- $return .= 'Give Forms Slug: ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" ); |
|
174
|
+ $return .= "\n".'-- Give Page Configuration'."\n\n"; |
|
175
|
+ $return .= 'Success Page: '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n"); |
|
176
|
+ $return .= 'Failure Page: '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n"); |
|
177
|
+ $return .= 'Give Forms Slug: '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n"); |
178
|
178
|
|
179
|
|
- $return = apply_filters( 'give_sysinfo_after_give_pages', $return ); |
|
179
|
+ $return = apply_filters('give_sysinfo_after_give_pages', $return); |
180
|
180
|
|
181
|
181
|
// GIVE gateways |
182
|
|
- $return .= "\n" . '-- Give Gateway Configuration' . "\n\n"; |
|
182
|
+ $return .= "\n".'-- Give Gateway Configuration'."\n\n"; |
183
|
183
|
|
184
|
184
|
$active_gateways = give_get_enabled_payment_gateways(); |
185
|
|
- if ( $active_gateways ) { |
186
|
|
- $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) ); |
187
|
|
- if ( $default_gateway_is_active ) { |
188
|
|
- $default_gateway = give_get_default_gateway( null ); |
189
|
|
- $default_gateway = $active_gateways[ $default_gateway ]['admin_label']; |
|
185
|
+ if ($active_gateways) { |
|
186
|
+ $default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null)); |
|
187
|
+ if ($default_gateway_is_active) { |
|
188
|
+ $default_gateway = give_get_default_gateway(null); |
|
189
|
+ $default_gateway = $active_gateways[$default_gateway]['admin_label']; |
190
|
190
|
} else { |
191
|
191
|
$default_gateway = 'Test Payment'; |
192
|
192
|
} |
193
|
193
|
|
194
|
194
|
$gateways = array(); |
195
|
|
- foreach ( $active_gateways as $gateway ) { |
|
195
|
+ foreach ($active_gateways as $gateway) { |
196
|
196
|
$gateways[] = $gateway['admin_label']; |
197
|
197
|
} |
198
|
198
|
|
199
|
|
- $return .= 'Enabled Gateways: ' . implode( ', ', $gateways ) . "\n"; |
200
|
|
- $return .= 'Default Gateway: ' . $default_gateway . "\n"; |
|
199
|
+ $return .= 'Enabled Gateways: '.implode(', ', $gateways)."\n"; |
|
200
|
+ $return .= 'Default Gateway: '.$default_gateway."\n"; |
201
|
201
|
} else { |
202
|
|
- $return .= 'Enabled Gateways: None' . "\n"; |
|
202
|
+ $return .= 'Enabled Gateways: None'."\n"; |
203
|
203
|
} |
204
|
204
|
|
205
|
|
- $return = apply_filters( 'give_sysinfo_after_give_gateways', $return ); |
|
205
|
+ $return = apply_filters('give_sysinfo_after_give_gateways', $return); |
206
|
206
|
|
207
|
207
|
// GIVE Templates |
208
|
|
- $dir = get_stylesheet_directory() . '/give_templates/*'; |
209
|
|
- if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) { |
210
|
|
- $return .= "\n" . '-- Give Template Overrides' . "\n\n"; |
|
208
|
+ $dir = get_stylesheet_directory().'/give_templates/*'; |
|
209
|
+ if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) { |
|
210
|
+ $return .= "\n".'-- Give Template Overrides'."\n\n"; |
211
|
211
|
|
212
|
|
- foreach ( glob( $dir ) as $file ) { |
213
|
|
- $return .= 'Filename: ' . basename( $file ) . "\n"; |
|
212
|
+ foreach (glob($dir) as $file) { |
|
213
|
+ $return .= 'Filename: '.basename($file)."\n"; |
214
|
214
|
} |
215
|
215
|
|
216
|
|
- $return = apply_filters( 'give_sysinfo_after_give_templates', $return ); |
|
216
|
+ $return = apply_filters('give_sysinfo_after_give_templates', $return); |
217
|
217
|
} |
218
|
218
|
|
219
|
219
|
// Must-use plugins |
220
|
220
|
$muplugins = get_mu_plugins(); |
221
|
|
- if ( count( $muplugins > 0 ) ) { |
222
|
|
- $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; |
|
221
|
+ if (count($muplugins > 0)) { |
|
222
|
+ $return .= "\n".'-- Must-Use Plugins'."\n\n"; |
223
|
223
|
|
224
|
|
- foreach ( $muplugins as $plugin => $plugin_data ) { |
225
|
|
- $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; |
|
224
|
+ foreach ($muplugins as $plugin => $plugin_data) { |
|
225
|
+ $return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n"; |
226
|
226
|
} |
227
|
227
|
|
228
|
|
- $return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return ); |
|
228
|
+ $return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return); |
229
|
229
|
} |
230
|
230
|
|
231
|
231
|
// WordPress active plugins |
232
|
|
- $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; |
|
232
|
+ $return .= "\n".'-- WordPress Active Plugins'."\n\n"; |
233
|
233
|
|
234
|
234
|
$plugins = get_plugins(); |
235
|
|
- $active_plugins = get_option( 'active_plugins', array() ); |
|
235
|
+ $active_plugins = get_option('active_plugins', array()); |
236
|
236
|
|
237
|
|
- foreach ( $plugins as $plugin_path => $plugin ) { |
238
|
|
- if ( ! in_array( $plugin_path, $active_plugins ) ) { |
|
237
|
+ foreach ($plugins as $plugin_path => $plugin) { |
|
238
|
+ if ( ! in_array($plugin_path, $active_plugins)) { |
239
|
239
|
continue; |
240
|
240
|
} |
241
|
241
|
|
242
|
|
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
242
|
+ $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
243
|
243
|
} |
244
|
244
|
|
245
|
|
- $return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return ); |
|
245
|
+ $return = apply_filters('give_sysinfo_after_wordpress_plugins', $return); |
246
|
246
|
|
247
|
247
|
// WordPress inactive plugins |
248
|
|
- $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; |
|
248
|
+ $return .= "\n".'-- WordPress Inactive Plugins'."\n\n"; |
249
|
249
|
|
250
|
|
- foreach ( $plugins as $plugin_path => $plugin ) { |
251
|
|
- if ( in_array( $plugin_path, $active_plugins ) ) { |
|
250
|
+ foreach ($plugins as $plugin_path => $plugin) { |
|
251
|
+ if (in_array($plugin_path, $active_plugins)) { |
252
|
252
|
continue; |
253
|
253
|
} |
254
|
254
|
|
255
|
|
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
255
|
+ $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
256
|
256
|
} |
257
|
257
|
|
258
|
|
- $return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return ); |
|
258
|
+ $return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return); |
259
|
259
|
|
260
|
|
- if ( is_multisite() ) { |
|
260
|
+ if (is_multisite()) { |
261
|
261
|
// WordPress Multisite active plugins |
262
|
|
- $return .= "\n" . '-- Network Active Plugins' . "\n\n"; |
|
262
|
+ $return .= "\n".'-- Network Active Plugins'."\n\n"; |
263
|
263
|
|
264
|
264
|
$plugins = wp_get_active_network_plugins(); |
265
|
|
- $active_plugins = get_site_option( 'active_sitewide_plugins', array() ); |
|
265
|
+ $active_plugins = get_site_option('active_sitewide_plugins', array()); |
266
|
266
|
|
267
|
|
- foreach ( $plugins as $plugin_path ) { |
268
|
|
- $plugin_base = plugin_basename( $plugin_path ); |
|
267
|
+ foreach ($plugins as $plugin_path) { |
|
268
|
+ $plugin_base = plugin_basename($plugin_path); |
269
|
269
|
|
270
|
|
- if ( ! array_key_exists( $plugin_base, $active_plugins ) ) { |
|
270
|
+ if ( ! array_key_exists($plugin_base, $active_plugins)) { |
271
|
271
|
continue; |
272
|
272
|
} |
273
|
273
|
|
274
|
|
- $plugin = get_plugin_data( $plugin_path ); |
275
|
|
- $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
274
|
+ $plugin = get_plugin_data($plugin_path); |
|
275
|
+ $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
276
|
276
|
} |
277
|
277
|
|
278
|
|
- $return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return ); |
|
278
|
+ $return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return); |
279
|
279
|
} |
280
|
280
|
|
281
|
281
|
// Server configuration (really just versioning) |
282
|
|
- $return .= "\n" . '-- Webserver Configuration' . "\n\n"; |
283
|
|
- $return .= 'PHP Version: ' . PHP_VERSION . "\n"; |
284
|
|
- $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; |
285
|
|
- $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; |
|
282
|
+ $return .= "\n".'-- Webserver Configuration'."\n\n"; |
|
283
|
+ $return .= 'PHP Version: '.PHP_VERSION."\n"; |
|
284
|
+ $return .= 'MySQL Version: '.$wpdb->db_version()."\n"; |
|
285
|
+ $return .= 'Webserver Info: '.$_SERVER['SERVER_SOFTWARE']."\n"; |
286
|
286
|
|
287
|
|
- $return = apply_filters( 'give_sysinfo_after_webserver_config', $return ); |
|
287
|
+ $return = apply_filters('give_sysinfo_after_webserver_config', $return); |
288
|
288
|
|
289
|
289
|
// PHP configs... now we're getting to the important stuff |
290
|
|
- $return .= "\n" . '-- PHP Configuration' . "\n\n"; |
291
|
|
- $return .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" ); |
292
|
|
- $return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n"; |
293
|
|
- $return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n"; |
294
|
|
- $return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n"; |
295
|
|
- $return .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n"; |
296
|
|
- $return .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n"; |
297
|
|
- $return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n"; |
298
|
|
- $return .= 'URL-aware fopen: ' . ( ini_get( 'allow_url_fopen' ) ? 'On (' . ini_get( 'allow_url_fopen' ) . ')' : 'N/A' ) . "\n"; |
299
|
|
- $return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n"; |
300
|
|
- |
301
|
|
- $return = apply_filters( 'give_sysinfo_after_php_config', $return ); |
|
290
|
+ $return .= "\n".'-- PHP Configuration'."\n\n"; |
|
291
|
+ $return .= 'Safe Mode: '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n"); |
|
292
|
+ $return .= 'Memory Limit: '.ini_get('memory_limit')."\n"; |
|
293
|
+ $return .= 'Upload Max Size: '.ini_get('upload_max_filesize')."\n"; |
|
294
|
+ $return .= 'Post Max Size: '.ini_get('post_max_size')."\n"; |
|
295
|
+ $return .= 'Upload Max Filesize: '.ini_get('upload_max_filesize')."\n"; |
|
296
|
+ $return .= 'Time Limit: '.ini_get('max_execution_time')."\n"; |
|
297
|
+ $return .= 'Max Input Vars: '.ini_get('max_input_vars')."\n"; |
|
298
|
+ $return .= 'URL-aware fopen: '.(ini_get('allow_url_fopen') ? 'On ('.ini_get('allow_url_fopen').')' : 'N/A')."\n"; |
|
299
|
+ $return .= 'Display Errors: '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n"; |
|
300
|
+ |
|
301
|
+ $return = apply_filters('give_sysinfo_after_php_config', $return); |
302
|
302
|
|
303
|
303
|
// PHP extensions and such |
304
|
|
- $return .= "\n" . '-- PHP Extensions' . "\n\n"; |
305
|
|
- $return .= 'cURL: ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n"; |
|
304
|
+ $return .= "\n".'-- PHP Extensions'."\n\n"; |
|
305
|
+ $return .= 'cURL: '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n"; |
306
|
306
|
|
307
|
307
|
//cURL version |
308
|
|
- if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) { |
|
308
|
+ if (function_exists('curl_init') && function_exists('curl_version')) { |
309
|
309
|
$curl_values = curl_version(); |
310
|
|
- $return .= 'cURL Version: ' . $curl_values["version"] . "\n"; |
|
310
|
+ $return .= 'cURL Version: '.$curl_values["version"]."\n"; |
311
|
311
|
} |
312
|
|
- $return .= 'zlib: ' . ( function_exists( 'gzcompress' ) ? 'Supported' : 'Not Supported' ) . "\n"; |
313
|
|
- $return .= 'GD: ' . ( ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) ? 'Supported' : 'Not Supported' ) . "\n"; |
314
|
|
- $return .= 'fsockopen: ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n"; |
315
|
|
- $return .= 'SOAP Client: ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n"; |
316
|
|
- $return .= 'Suhosin: ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n"; |
|
312
|
+ $return .= 'zlib: '.(function_exists('gzcompress') ? 'Supported' : 'Not Supported')."\n"; |
|
313
|
+ $return .= 'GD: '.((extension_loaded('gd') && function_exists('gd_info')) ? 'Supported' : 'Not Supported')."\n"; |
|
314
|
+ $return .= 'fsockopen: '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n"; |
|
315
|
+ $return .= 'SOAP Client: '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n"; |
|
316
|
+ $return .= 'Suhosin: '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n"; |
317
|
317
|
|
318
|
|
- $return = apply_filters( 'give_sysinfo_after_php_ext', $return ); |
|
318
|
+ $return = apply_filters('give_sysinfo_after_php_ext', $return); |
319
|
319
|
|
320
|
320
|
// Session stuff |
321
|
|
- $return .= "\n" . '-- Session Configuration' . "\n\n"; |
322
|
|
- $return .= 'Give Use Sessions: ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n"; |
323
|
|
- $return .= 'Session: ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n"; |
|
321
|
+ $return .= "\n".'-- Session Configuration'."\n\n"; |
|
322
|
+ $return .= 'Give Use Sessions: '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n"; |
|
323
|
+ $return .= 'Session: '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n"; |
324
|
324
|
|
325
|
325
|
// The rest of this is only relevant is session is enabled |
326
|
|
- if ( isset( $_SESSION ) ) { |
327
|
|
- $return .= 'Session Name: ' . esc_html( ini_get( 'session.name' ) ) . "\n"; |
328
|
|
- $return .= 'Cookie Path: ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n"; |
329
|
|
- $return .= 'Save Path: ' . esc_html( ini_get( 'session.save_path' ) ) . "\n"; |
330
|
|
- $return .= 'Use Cookies: ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n"; |
331
|
|
- $return .= 'Use Only Cookies: ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n"; |
|
326
|
+ if (isset($_SESSION)) { |
|
327
|
+ $return .= 'Session Name: '.esc_html(ini_get('session.name'))."\n"; |
|
328
|
+ $return .= 'Cookie Path: '.esc_html(ini_get('session.cookie_path'))."\n"; |
|
329
|
+ $return .= 'Save Path: '.esc_html(ini_get('session.save_path'))."\n"; |
|
330
|
+ $return .= 'Use Cookies: '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n"; |
|
331
|
+ $return .= 'Use Only Cookies: '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n"; |
332
|
332
|
} |
333
|
333
|
|
334
|
|
- $return = apply_filters( 'give_sysinfo_after_session_config', $return ); |
|
334
|
+ $return = apply_filters('give_sysinfo_after_session_config', $return); |
335
|
335
|
|
336
|
|
- $return .= "\n" . '### End System Info ###'; |
|
336
|
+ $return .= "\n".'### End System Info ###'; |
337
|
337
|
|
338
|
338
|
return $return; |
339
|
339
|
} |
|
@@ -347,17 +347,17 @@ discard block |
|
|
block discarded – undo |
347
|
347
|
*/ |
348
|
348
|
function give_tools_sysinfo_download() { |
349
|
349
|
|
350
|
|
- if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
350
|
+ if ( ! current_user_can('manage_give_settings')) { |
351
|
351
|
return; |
352
|
352
|
} |
353
|
353
|
|
354
|
354
|
nocache_headers(); |
355
|
355
|
|
356
|
|
- header( 'Content-Type: text/plain' ); |
357
|
|
- header( 'Content-Disposition: attachment; filename="give-system-info.txt"' ); |
|
356
|
+ header('Content-Type: text/plain'); |
|
357
|
+ header('Content-Disposition: attachment; filename="give-system-info.txt"'); |
358
|
358
|
|
359
|
|
- echo wp_strip_all_tags( $_POST['give-sysinfo'] ); |
|
359
|
+ echo wp_strip_all_tags($_POST['give-sysinfo']); |
360
|
360
|
give_die(); |
361
|
361
|
} |
362
|
362
|
|
363
|
|
-add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' ); |
364
|
363
|
\ No newline at end of file |
|
364
|
+add_action('give_download_sysinfo', 'give_tools_sysinfo_download'); |
365
|
365
|
\ No newline at end of file |