PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.4.5
GiveWP – Donation Plugin and Fundraising Platform v2.4.5
4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / tools / views / html-admin-page-system-info.php
give / includes / admin / tools / views Last commit date
html-admin-page-data.php 7 years ago html-admin-page-exports.php 7 years ago html-admin-page-import-core-settings.php 8 years ago html-admin-page-import-donations.php 8 years ago html-admin-page-imports.php 8 years ago html-admin-page-system-info.php 7 years ago
html-admin-page-system-info.php
1016 lines
1 <?php
2 /**
3 * Admin View: System Info
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit;
8 }
9
10 /**
11 * The following code is a derivative work of the code from the WooCommerce
12 * plugin, which is licensed GPLv3. This code therefore is also licensed under
13 * the terms of the GNU Public License, version 3.
14 *
15 * Copyright (c) 2015 WooThemes
16 * Copyright (c) 2016 GiveWP
17 */
18
19 global $wpdb;
20 $give_options = give_get_settings();
21 $plugins = give_get_plugins();
22
23 $give_plugin_authors = array( 'WordImpress', 'GiveWP' );
24
25 /* @var Give_Updates $give_updates */
26 $give_updates = Give_Updates::get_instance();
27 ?>
28
29 <div class="give-debug-report-wrapper">
30 <p class="give-debug-report-text"><?php echo sprintf(__( 'Please copy and paste this information in your ticket when contacting support:', 'give' )); ?> </p>
31 <div class="give-debug-report-actions">
32 <a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a>
33 <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?> <span class="dashicons dashicons-external"></span></a>
34 </div>
35 <div class="give-debug-report js-give-debug-report">
36 <textarea readonly="readonly"></textarea>
37 </div>
38 </div>
39
40 <table class="give-status-table widefat" cellspacing="0" id="status">
41 <thead>
42 <tr>
43 <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th>
44 </tr>
45 </thead>
46 <tbody>
47 <tr>
48 <td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td>
49 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The URL of your site\'s homepage.', 'give' ) ); ?></td>
50 <td><?php form_option( 'home' ); ?></td>
51 </tr>
52 <tr>
53 <td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td>
54 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The root URL of your site.', 'give' ) ); ?></td>
55 <td><?php form_option( 'siteurl' ); ?></td>
56 </tr>
57 <tr>
58 <td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td>
59 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of WordPress installed on your site.', 'give' ) ); ?></td>
60 <td><?php bloginfo( 'version' ); ?></td>
61 </tr>
62 <tr>
63 <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td>
64 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?></td>
65 <td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '&ndash;'; ?></td>
66
67 </tr>
68 <tr>
69 <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td>
70 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The maximum amount of memory (RAM) that your site can use at one time.', 'give' ) ); ?></td>
71 <td>
72 <?php
73 $memory = give_let_to_num( WP_MEMORY_LIMIT );
74
75 if ( function_exists( 'memory_get_usage' ) ) {
76 $system_memory = give_let_to_num( @ini_get( 'memory_limit' ) );
77 $memory = max( $memory, $system_memory );
78 }
79
80 if ( $memory < 67108864 ) {
81 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend setting memory to at least 64 MB. See: %s', 'give' ), size_format( $memory ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>';
82 } else {
83 echo '<mark class="yes">' . size_format( $memory ) . '</mark>';
84 }
85 ?>
86 </td>
87 </tr>
88 <tr>
89 <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td>
90 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?></td>
91 <td>
92 <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?>
93 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
94 <?php else : ?>
95 <mark class="no">&ndash;</mark>
96 <?php endif; ?>
97 </td>
98 </tr>
99 <tr>
100 <td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td>
101 <td class="help"><?php echo Give()->tooltips->render( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?></td>
102 <td>
103 <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
104 <mark class="no">&ndash;</mark>
105 <?php else : ?>
106 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
107 <?php endif; ?>
108 </td>
109 </tr>
110 <tr>
111 <td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td>
112 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?></td>
113 <td><?php echo get_locale(); ?></td>
114 </tr>
115 <tr>
116 <td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td>
117 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?></td>
118 <td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td>
119 </tr>
120 <tr>
121 <td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td>
122 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?></td>
123 <td><?php echo esc_html( get_option( 'show_on_front', '&ndash;' ) ); ?></td>
124 </tr>
125 <?php if ( 'page' === get_option( 'show_on_front' ) ) : ?>
126 <?php
127 $front_page_id = absint( get_option( 'page_on_front' ) );
128 $blog_page_id = absint( get_option( 'page_for_posts' ) );
129 ?>
130 <tr>
131 <td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td>
132 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display as your front page.', 'give' ) ); ?></td>
133 <td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
134 </tr>
135 <tr>
136 <td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td>
137 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display your posts.', 'give' ) ); ?></td>
138 <td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
139 </tr>
140 <?php endif;?>
141 <tr>
142 <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix', 'give' ); ?>:</td>
143 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The table prefix used in your WordPress database.', 'give' ) ); ?></td>
144 <td><?php echo esc_html( $wpdb->prefix ); ?></td>
145 </tr>
146 <tr>
147 <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td>
148 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
149 <td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td>
150 </tr>
151 <tr>
152 <td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td>
153 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
154 <td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td>
155 </tr>
156 <tr>
157 <td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td>
158 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?></td>
159 <td><?php echo give_test_ajax_works( true ) ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td>
160 </tr>
161 <tr>
162 <td data-export-label="Registered Post Statuses"><?php _e( 'Registered Post Statuses', 'give' ); ?>:</td>
163 <td class="help"><?php echo Give()->tooltips->render_help( __( 'A list of all registered post statuses.', 'give' ) ); ?></td>
164 <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td>
165 </tr>
166 </tbody>
167 </table>
168
169 <table class="give-status-table widefat" cellspacing="0">
170 <thead>
171 <tr>
172 <th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2></th>
173 </tr>
174 </thead>
175 <tbody>
176 <tr>
177 <td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td>
178 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?></td>
179 <td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td>
180 </tr>
181 <tr>
182 <td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td>
183 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give' ) ); ?></td>
184 <td>
185 <?php
186 $tls_check = false;
187
188 // Get the SSL status.
189 if ( ini_get( 'allow_url_fopen' ) ) {
190 $tls_check = file_get_contents( 'https://www.howsmyssl.com/a/check' );
191 }
192
193 if ( false !== $tls_check ) {
194 $tls_check = json_decode( $tls_check );
195 /* translators: %s: SSL connection response */
196 printf( __( 'Connection uses %s', 'give' ), esc_html( $tls_check->tls_version ) );
197 }
198 ?>
199 </td>
200 </tr>
201 <tr>
202 <td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td>
203 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?></td>
204 <td>
205 <?php
206 if ( false !== $tls_check ) {
207 esc_html_e( property_exists( $tls_check, 'rating' ) ? $tls_check->rating : $tls_check->tls_version );
208 }
209 ?>
210 </td>
211 </tr>
212 <tr>
213 <td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td>
214 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?></td>
215 <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
216 </tr>
217 <tr>
218 <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td>
219 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?></td>
220 <td>
221 <?php
222 // Check if phpversion function exists.
223 if ( function_exists( 'phpversion' ) ) {
224 $php_version = phpversion();
225
226 if ( version_compare( $php_version, '5.6', '<' ) ) {
227 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>';
228 } else {
229 echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>';
230 }
231 } else {
232 _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' );
233 }
234 ?></td>
235 </tr>
236 <?php if ( function_exists( 'ini_get' ) ) : ?>
237 <tr>
238 <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td>
239 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?></td>
240 <td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td>
241 </tr>
242 <tr>
243 <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td>
244 <td class="help"><?php echo Give() ->tooltips->render_help( __( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give' ) ); ?></td>
245 <td><?php echo ini_get( 'max_execution_time' ); ?></td>
246 </tr>
247 <tr>
248 <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td>
249 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'give' ) ); ?></td>
250 <td><?php echo ini_get( 'max_input_vars' ); ?></td>
251 </tr>
252 <tr>
253 <td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td>
254 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?></td>
255 <td><?php echo size_format( wp_max_upload_size() ); ?></td>
256 </tr>
257 <tr>
258 <td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td>
259 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of cURL installed on your server.', 'give' ) ); ?></td>
260 <td>
261 <?php
262 if ( function_exists( 'curl_version' ) ) {
263 $curl_version = curl_version();
264
265 if ( version_compare( $curl_version['version'], '7.40', '<' ) ) {
266 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum cURL version of 7.40.', 'give' ), esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) ) . '</mark>';
267 } else {
268 echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>';
269 }
270 } else {
271 echo '&ndash';
272 }
273 ?>
274 </td>
275 </tr>
276 <tr>
277 <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td>
278 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give' ) ); ?></td>
279 <td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '&ndash;'; ?></td>
280 </tr>
281 <?php endif;
282
283 if ( $wpdb->use_mysqli ) {
284 $ver = mysqli_get_server_info( $wpdb->dbh );
285 } else {
286 $ver = mysql_get_server_info();
287 }
288
289 if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?>
290 <tr>
291 <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td>
292 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?></td>
293 <td>
294 <?php
295 $mysql_version = $wpdb->db_version();
296
297 if ( version_compare( $mysql_version, '5.6', '<' ) ) {
298 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>';
299 } else {
300 echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>';
301 }
302 ?>
303 </td>
304 </tr>
305 <?php endif; ?>
306 <tr>
307 <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td>
308 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The default timezone for your server.', 'give' ) ); ?></td>
309 <td><?php
310 $default_timezone = date_default_timezone_get();
311 if ( 'UTC' !== $default_timezone ) {
312 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>';
313 } else {
314 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
315 } ?>
316 </td>
317 </tr>
318 <?php
319 $posting = array();
320
321 // fsockopen/cURL.
322 $posting['fsockopen_curl']['name'] = 'fsockopen/cURL';
323 $posting['fsockopen_curl']['help'] = __( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give' );
324
325 if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {
326 $posting['fsockopen_curl']['success'] = true;
327 } else {
328 $posting['fsockopen_curl']['success'] = false;
329 $posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give' );
330 }
331
332 // SOAP.
333 $posting['soap_client']['name'] = 'SoapClient';
334 $posting['soap_client']['help'] = __( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give' );
335
336 if ( class_exists( 'SoapClient' ) ) {
337 $posting['soap_client']['success'] = true;
338 } else {
339 $posting['soap_client']['success'] = false;
340 $posting['soap_client']['note'] = sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' );
341 }
342
343 // DOMDocument.
344 $posting['dom_document']['name'] = 'DOMDocument';
345 $posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' );
346
347 if ( class_exists( 'DOMDocument' ) ) {
348 $posting['dom_document']['success'] = true;
349 } else {
350 $posting['dom_document']['success'] = false;
351 $posting['dom_document']['note'] = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' );
352 }
353
354 // gzip.
355 $posting['gzip']['name'] = 'gzip';
356 $posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' );
357
358 if ( is_callable( 'gzopen' ) ) {
359 $posting['gzip']['success'] = true;
360 } else {
361 $posting['gzip']['success'] = false;
362 $posting['gzip']['note'] = sprintf( __( 'Your server does not support the %s function - this is used for file compression and decompression.', 'give' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' );
363 }
364
365
366 // GD Graphics Library.
367 $posting['gd']['name'] = 'GD Graphics Library';
368 $posting['gd']['help'] = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' );
369 $posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false;
370
371 // Multibyte String.
372 $posting['mbstring']['name'] = 'Multibyte String';
373 $posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' );
374
375 if ( extension_loaded( 'mbstring' ) ) {
376 $posting['mbstring']['success'] = true;
377 } else {
378 $posting['mbstring']['success'] = false;
379 $posting['mbstring']['note'] = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' );
380 }
381
382 // WP Remote Post Check.
383 $posting['wp_remote_post']['name'] = __( 'Remote Post', 'give' );
384 $posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' );
385
386 $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array(
387 'timeout' => 60,
388 'user-agent' => 'Give/' . GIVE_VERSION,
389 'httpversion' => '1.1',
390 'body' => array(
391 'cmd' => '_notify-validate',
392 ),
393 ) );
394
395 if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
396 $posting['wp_remote_post']['success'] = true;
397 } else {
398 $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' );
399 if ( is_wp_error( $response ) ) {
400 $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) );
401 } else {
402 $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) );
403 }
404 $posting['wp_remote_post']['success'] = false;
405 }
406
407 // WP Remote Get Check.
408 $posting['wp_remote_get']['name'] = __( 'Remote Get', 'give' );
409 $posting['wp_remote_get']['help'] = __( 'Give plugins may use this method of communication when checking for plugin updates.', 'give' );
410
411 $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) );
412
413 if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
414 $posting['wp_remote_get']['success'] = true;
415 } else {
416 $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give' );
417 if ( is_wp_error( $response ) ) {
418 $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) );
419 } else {
420 $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) );
421 }
422 $posting['wp_remote_get']['success'] = false;
423 }
424
425 $posting = apply_filters( 'give_debug_posting', $posting );
426
427 foreach ( $posting as $post ) {
428 $mark = ! empty( $post['success'] ) ? 'yes' : 'error';
429 ?>
430 <tr>
431 <td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td>
432 <td class="help"><?php echo Give()->tooltips->render_help( esc_attr( isset( $post['help'] ) ? $post['help'] : '' ) ); ?></td>
433 <td>
434 <mark class="<?php echo $mark; ?>">
435 <?php echo ! empty( $post['success'] ) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty( $post['note'] ) ? wp_kses_data( $post['note'] ) : ''; ?>
436 </mark>
437 </td>
438 </tr>
439 <?php
440 }
441 ?>
442 </tbody>
443 </table>
444
445 <table class="give-status-table widefat" cellspacing="0">
446 <thead>
447 <tr>
448 <th colspan="3" data-export-label="Give Configuration"><h2><?php _e( 'Give Configuration', 'give' ); ?></h2></th>
449 </tr>
450 </thead>
451 <tbody>
452 <tr>
453 <td data-export-label="Give Version"><?php _e( 'Give Version', 'give' ); ?>:</td>
454 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed on your site.', 'give' ) ); ?></td>
455 <td><?php echo esc_html( get_option( 'give_version' )); ?></td>
456 </tr>
457 <tr>
458 <td data-export-label="Give Cache"><?php _e( 'Give Cache', 'give' ); ?>:</td>
459 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in Give settings.', 'give' ) ); ?></td>
460 <td><?php echo give_is_setting_enabled( give_get_option('cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
461 </tr>
462 <tr>
463 <td data-export-label="Database Updates"><?php _e( 'Database Updates', 'give' ); ?>:</td>
464 <td class="help"><?php echo Give()->tooltips->render_help( __( 'This will show the number of pending database updates.', 'give' ) ); ?></td>
465 <td>
466 <?php
467 $updates_text = __( 'All DB Updates Completed.', 'give' );
468 $pending_updates = $give_updates->get_total_new_db_update_count();
469 $total_updates = $give_updates->get_total_db_update_count();
470
471 if( Give_Updates::$background_updater->is_paused_process() ) {
472 // When all the db updates are pending.
473 $updates_text = sprintf(
474 __( '%1$s updates still need to run. (Paused) ', 'give' ),
475 count( $give_updates->get_updates('database', 'new' ) )
476 );
477 } elseif( $pending_updates === $total_updates ) {
478
479 // When all the db updates are pending.
480 $updates_text = sprintf(
481 __( '%1$s updates still need to run.', 'give' ),
482 $total_updates
483 );
484 } elseif( $pending_updates > 0 ) {
485
486 // When some of the db updates are completed and some are pending.
487 $updates_text = sprintf(
488 __( '%1$s of %2$s updates still need to run.', 'give' ),
489 $pending_updates,
490 $total_updates
491 );
492 }
493
494 echo $updates_text;
495 ?>
496 </td>
497 </tr>
498 <tr>
499 <td data-export-label="Database Tables"><?php _e( 'Database Tables', 'give' ); ?>:</td>
500 <td class="help"><?php echo Give()->tooltips->render_help( __( 'This will show list of installed database tables.', 'give' ) ); ?></td>
501 <td>
502 <?php
503 $db_table_list = '';
504
505 /* @var Give_DB $table */
506 foreach ( __give_get_tables() as $table ) {
507 $db_table_list .= sprintf(
508 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark> %3$s - %4$s</li>',
509 $table->installed()
510 ? 'yes'
511 : 'error',
512 $table->installed()
513 ? 'yes'
514 : 'no-alt',
515 $table->table_name,
516 $table->version
517 );
518 }
519
520 echo "<ul>{$db_table_list}</ul>";
521 ?>
522 </td>
523 </tr>
524 <tr>
525 <td data-export-label="Give Cache"><?php _e( 'Give Cache', 'give' ); ?>:</td>
526 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in Give settings.', 'give' ) ); ?></td>
527 <td><?php echo give_is_setting_enabled( give_get_option('cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
528 </tr>
529 <tr>
530 <td data-export-label="Give Cache"><?php _e( 'Give Emails', 'give' ); ?>:</td>
531 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether emails is enabled in Give settings.', 'give' ) ); ?></td>
532 <td>
533 <?php
534 /* @var Give_Email_Notification $email_notification */
535 if( $email_notifications = Give_Email_Notifications::get_instance()->get_email_notifications() ) {
536 ob_start();
537
538 foreach ( Give_Email_Notifications::get_instance()->get_email_notifications() as $email_notification ) {
539 $status = Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ?
540 'yes' :
541 'error';
542
543 echo sprintf(
544 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark></span>%3$s</li>',
545 Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'error',
546 Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'no-alt',
547 $email_notification->config['label']
548 );
549 }
550
551 echo sprintf( '<ul>%s</ul>', ob_get_clean() );
552 }
553 ?>
554 </td>
555 </tr>
556 <tr>
557 <td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td>
558 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?></td>
559 <td><?php echo esc_html( get_option( 'give_version_upgraded_from', '&ndash;' ) ); ?></td>
560 </tr>
561 <tr>
562 <td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td>
563 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Test Mode is enabled in Give settings.', 'give' ) ); ?></td>
564 <td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
565 </tr>
566 <tr>
567 <td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td>
568 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency code selected in Give settings.', 'give' ) ); ?></td>
569 <td><?php echo esc_html( give_get_currency() ); ?></td>
570 </tr>
571 <tr>
572 <td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td>
573 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency position selected in Give settings.', 'give' ) ); ?></td>
574 <td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td>
575 </tr>
576 <tr>
577 <td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td>
578 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The decimal separator defined in Give settings.', 'give' ) ); ?></td>
579 <td><?php echo esc_html( give_get_price_decimal_separator() ); ?></td>
580 </tr>
581 <tr>
582 <td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td>
583 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The thousands separator defined in Give settings.', 'give' ) ); ?></td>
584 <td><?php echo esc_html( give_get_price_thousand_separator() ); ?></td>
585 </tr>
586 <tr>
587 <td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td>
588 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?></td>
589 <td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '&ndash;'; ?></td>
590 </tr>
591 <tr>
592 <td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td>
593 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?></td>
594 <td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '&ndash;'; ?></td>
595 </tr>
596 <tr>
597 <td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td>
598 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where past donations are listed.', 'give' ) ); ?></td>
599 <td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '&ndash;'; ?></td>
600 </tr>
601 <tr>
602 <td data-export-label="Give Forms Slug"><?php _e( 'Give Forms Slug', 'give' ); ?>:</td>
603 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The slug used for Give donation forms.', 'give' ) ); ?></td>
604 <td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td>
605 </tr>
606 <?php
607 $active_gateways = give_get_enabled_payment_gateways();
608 $enabled_gateways = $default_gateway = '';
609
610 if ( $active_gateways ) {
611 $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
612
613 if ( $default_gateway_is_active ) {
614 $default_gateway = give_get_default_gateway( null );
615 $default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
616 } else {
617 $default_gateway = __( 'Test Donation', 'give' );
618 }
619
620 $gateways = array();
621
622 foreach ( $active_gateways as $gateway ) {
623 $gateways[] = $gateway['admin_label'];
624 }
625
626 $enabled_gateways = implode( ', ', $gateways );
627 }
628 ?>
629 <tr>
630 <td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td>
631 <td class="help"><?php echo Give()->tooltips->render_help( __( 'All payment gateways enabled in Give settings.', 'give' ) ); ?></td>
632 <td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '&ndash;' ); ?></td>
633 </tr>
634 <tr>
635 <td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td>
636 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The default payment gateway selected in Give settings.', 'give' ) ); ?></td>
637 <td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '&ndash;' ); ?></td>
638 </tr>
639 <tr>
640 <td data-export-label="PayPal IPN Verification"><?php _e( 'PayPal IPN Verification', 'give' ); ?>:</td>
641 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether admins requires verification of IPN notifications with PayPal.', 'give' ) ); ?></td>
642 <td><?php echo 'enabled' === give_get_option( 'paypal_verification' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
643 </tr>
644 <tr>
645 <td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td>
646 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?></td>
647 <td>
648 <?php
649 $last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received' );
650 $donation_id = $last_paypal_ipn_received['payment_id'];
651 if (
652 is_array( $last_paypal_ipn_received )
653 && count( $last_paypal_ipn_received ) > 0
654 && get_post( $donation_id ) instanceof WP_Post
655 ) {
656 $ipn_timestamp = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true );
657 $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id'];
658 $donation_url = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id;
659 echo sprintf(
660 __( 'IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give' ),
661 $donation_url,
662 $donation_id,
663 $transaction_url,
664 $last_paypal_ipn_received['transaction_id'],
665 date_i18n( 'm/d/Y', $ipn_timestamp ),
666 date_i18n( 'H:i', $ipn_timestamp ),
667 $last_paypal_ipn_received['auth_status']
668 );
669 } else {
670 echo 'N/A';
671 }
672 ?>
673 </td>
674 </tr>
675 <tr>
676 <td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td>
677 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?></td>
678 <td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
679 </tr>
680 </tbody>
681 </table>
682
683 <table class="give-status-table widefat" cellspacing="0">
684 <thead>
685 <tr>
686 <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e( 'Active Give Add-ons', 'give' ); ?></h2></th>
687 </tr>
688 </thead>
689 <tbody>
690 <?php
691 foreach ( $plugins as $plugin_data ) {
692 // Only show Give Core Activated Add-Ons.
693 if (
694 'active' !== $plugin_data['Status']
695 || false !== strpos( $plugin_data['Name'], 'Give - Donation Plugin' )
696 || ! in_array( $plugin_data['AuthorName'], $give_plugin_authors )
697 ) {
698 continue;
699 }
700
701 $plugin_name = $plugin_data['Name'];
702 $author_name = $plugin_data['Author'];
703
704 // Link the plugin name to the plugin URL if available.
705 if ( ! empty( $plugin_data['PluginURI'] ) ) {
706 $plugin_name = sprintf(
707 '<a href="%s" title="%s">%s</a>',
708 esc_url( $plugin_data['PluginURI'] ),
709 esc_attr__( 'Visit plugin homepage', 'give' ),
710 $plugin_name
711 );
712 }
713
714 // Link the author name to the author URL if available.
715 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
716 $author_name = sprintf(
717 '<a href="%s" title="%s">%s</a>',
718 esc_url( $plugin_data['AuthorURI'] ),
719 esc_attr__( 'Visit author homepage', 'give' ),
720 $author_name
721 );
722 }
723 ?>
724 <tr>
725 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
726 <td class="help">&nbsp;</td>
727 <td>
728 <?php
729 if ( isset( $plugin_data['License'] ) && true === $plugin_data['License'] ) {
730 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __( 'Licensed', 'give' );
731 } else {
732 echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __( 'Unlicensed', 'give' );
733 }
734
735 echo ' &ndash; '
736 . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) )
737 . ' &ndash; '
738 . esc_html( $plugin_data['Version'] );
739 ?>
740 </td>
741 </tr>
742 <?php
743 }
744 ?>
745 </tbody>
746 </table>
747
748 <table class="give-status-table widefat" cellspacing="0">
749 <thead>
750 <tr>
751 <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2></th>
752 </tr>
753 </thead>
754 <tbody>
755 <?php
756 foreach ( $plugins as $plugin_data ) {
757 // Do not show Give Core and it's Add-On plugins.
758 if (
759 'active' !== $plugin_data['Status']
760 || in_array( $plugin_data['AuthorName'], $give_plugin_authors )
761 ) {
762 continue;
763 }
764
765 $plugin_name = $plugin_data['Name'];
766 $author_name = $plugin_data['Author'];
767
768 // Link the plugin name to the plugin URL if available.
769 if ( ! empty( $plugin_data['PluginURI'] ) ) {
770 $plugin_name = sprintf(
771 '<a href="%s" title="%s">%s</a>',
772 esc_url( $plugin_data['PluginURI'] ),
773 esc_attr__( 'Visit plugin homepage', 'give' ),
774 $plugin_name
775 );
776 }
777
778 // Link the author name to the author URL if available.
779 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
780 $author_name = sprintf(
781 '<a href="%s" title="%s">%s</a>',
782 esc_url( $plugin_data['AuthorURI'] ),
783 esc_attr__( 'Visit author homepage', 'give' ),
784 $author_name
785 );
786 }
787 ?>
788 <tr>
789 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
790 <td class="help">&nbsp;</td>
791 <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' &ndash; ' . esc_html( $plugin_data['Version'] ); ?></td>
792 </tr>
793 <?php
794 }
795 ?>
796 </tbody>
797 </table>
798
799 <table class="give-status-table widefat" cellspacing="0">
800 <thead>
801 <tr>
802 <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th>
803 </tr>
804 </thead>
805 <tbody>
806 <?php
807 foreach ( $plugins as $plugin_data ) {
808 if ( 'inactive' !== $plugin_data['Status'] ) {
809 continue;
810 }
811
812 $plugin_name = $plugin_data['Name'];
813 $author_name = $plugin_data['Author'];
814
815 // Link the plugin name to the plugin URL if available.
816 if ( ! empty( $plugin_data['PluginURI'] ) ) {
817 $plugin_name = sprintf(
818 '<a href="%s" title="%s">%s</a>',
819 esc_url( $plugin_data['PluginURI'] ),
820 esc_attr__( 'Visit plugin homepage', 'give' ),
821 $plugin_name
822 );
823 }
824
825 // Link the author name to the author URL if available.
826 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
827 $author_name = sprintf(
828 '<a href="%s" title="%s">%s</a>',
829 esc_url( $plugin_data['AuthorURI'] ),
830 esc_attr__( 'Visit author homepage', 'give' ),
831 $author_name
832 );
833 }
834 ?>
835 <tr>
836 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
837 <td class="help">&nbsp;</td>
838 <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' &ndash; ' . esc_html( $plugin_data['Version'] ); ?></td>
839 </tr>
840 <?php
841 }
842 ?>
843 </tbody>
844 </table>
845
846 <?php
847 $active_mu_plugins = (array) get_mu_plugins();
848 if ( ! empty( $active_mu_plugins ) ) {
849 ?>
850 <table class="give-status-table widefat" cellspacing="0">
851 <thead>
852 <tr>
853 <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2></th>
854 </tr>
855 </thead>
856 <tbody>
857 <?php
858
859 foreach ( $active_mu_plugins as $mu_plugin_data ) {
860 if ( ! empty( $mu_plugin_data['Name'] ) ) {
861 // Link the plugin name to the plugin URL if available.
862 $plugin_name = esc_html( $mu_plugin_data['Name'] );
863
864 if ( ! empty( $mu_plugin_data['PluginURI'] ) ) {
865 $plugin_name = sprintf(
866 '<a href="%s" title="%s">%s</a>',
867 esc_url( $mu_plugin_data['PluginURI'] ),
868 esc_attr__( 'Visit plugin homepage', 'give' ),
869 $plugin_name
870 );
871 }
872
873 // Link the author name to the author URL if available.
874 $author_name = esc_html( $mu_plugin_data['Author'] );
875
876 if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) {
877 $author_name = sprintf(
878 '<a href="%s">%s</a>',
879 esc_url( $mu_plugin_data['AuthorURI'] ),
880 $author_name
881 );
882 }
883 ?>
884 <tr>
885 <td><?php echo $plugin_name; ?></td>
886 <td class="help">&nbsp;</td>
887 <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' &ndash; ' . esc_html( $mu_plugin_data['Version'] ); ?></td>
888 </tr>
889 <?php
890 }
891 }
892 ?>
893 </tbody>
894 </table>
895 <?php } ?>
896
897 <table class="give-status-table widefat" cellspacing="0">
898 <thead>
899 <tr>
900 <th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th>
901 </tr>
902 </thead>
903 <?php
904 include_once( ABSPATH . 'wp-admin/includes/theme-install.php' );
905 $active_theme = wp_get_theme();
906 ?>
907 <tbody>
908 <tr>
909 <td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td>
910 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the current active theme.', 'give' ) ); ?></td>
911 <td><?php echo esc_html( $active_theme->Name ); ?></td>
912 </tr>
913 <tr>
914 <td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td>
915 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the current active theme.', 'give' ) ); ?></td>
916 <td><?php echo esc_html( $active_theme->Version ); ?></td>
917 </tr>
918 <tr>
919 <td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td>
920 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The theme developer\'s URL.', 'give' ) ); ?></td>
921 <td><?php echo $active_theme->{'Author URI'}; ?></td>
922 </tr>
923 <tr>
924 <td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td>
925 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether the current theme is a child theme.', 'give' ) ); ?></td>
926 <td><?php
927 echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' &ndash; ' . sprintf( __( 'If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give' ), 'https://codex.wordpress.org/Child_Themes' );
928 ?></td>
929 </tr>
930 <?php
931 if( is_child_theme() ) {
932 $parent_theme = wp_get_theme( $active_theme->Template );
933 ?>
934 <tr>
935 <td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td>
936 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the parent theme.', 'give' ) ); ?></td>
937 <td><?php echo esc_html( $parent_theme->Name ); ?></td>
938 </tr>
939 <tr>
940 <td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td>
941 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the parent theme.', 'give' ) ); ?></td>
942 <td><?php echo esc_html( $parent_theme->Version ); ?></td>
943 </tr>
944 <tr>
945 <td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td>
946 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The parent theme developers URL.', 'give' ) ); ?></td>
947 <td><?php echo $parent_theme->{'Author URI'}; ?></td>
948 </tr>
949 <?php } ?>
950 </tbody>
951 </table>
952
953 <script type="text/javascript">
954 jQuery('.js-give-debug-report-button').click(function () {
955 var report = '';
956 var first_row = true;
957
958 jQuery('.give-status-table thead, .give-status-table tbody').each(function () {
959 if (jQuery(this).is('thead')) {
960
961 var label = jQuery(this).find('th:eq(0)').data('export-label') || jQuery(this).text();
962
963 if (true === first_row) {
964 report = '### ' + jQuery.trim(label) + ' ###\n\n';
965 first_row = false;
966 } else {
967 report = report + '\n### ' + jQuery.trim(label) + ' ###\n\n';
968 }
969 } else {
970
971 jQuery('tr', jQuery(this)).each(function () {
972
973 var label = jQuery(this).find('td:eq(0)').data('export-label') || jQuery(this).find('td:eq(0)').text();
974 var the_name = jQuery.trim(label).replace(/(<([^>]+)>)/ig, ''); // Remove HTML.
975
976 // Find value
977 var $value_html = jQuery(this).find('td:eq(2)').clone();
978 $value_html.find('.private').remove();
979 $value_html.find('.dashicons-yes').replaceWith('&#10004;');
980 $value_html.find('.dashicons-no-alt, .dashicons-warning').replaceWith('&#10060;');
981
982 // Format value
983 var the_value = jQuery.trim($value_html.text());
984 // var value_array = the_value.split( ', ' );
985 //
986 // if ( value_array.length > 1 ) {
987 // // If value have a list of plugins ','.
988 // // Split to add new line.
989 // var temp_line ='';
990 // jQuery.each( value_array, function( key, line ) {
991 // temp_line = temp_line + line + '\n';
992 // });
993 //
994 // the_value = temp_line;
995 // }
996
997 report = report + '' + the_name + ': ' + the_value + '\n';
998 });
999
1000 }
1001 });
1002
1003 try {
1004 jQuery('.js-give-debug-report').slideDown();
1005 jQuery('.js-give-debug-report').find('textarea').val(report).focus().select();
1006 jQuery(this).hide();
1007 return false;
1008 } catch (e) {
1009 /* jshint devel: true */
1010 console.log(e);
1011 }
1012
1013 return false;
1014 });
1015 </script>
1016