PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 3.1.1
GiveWP – Donation Plugin and Fundraising Platform v3.1.1
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 5 years ago html-admin-page-exports.php 4 years ago html-admin-page-import-core-settings.php 6 years ago html-admin-page-import-donations.php 6 years ago html-admin-page-imports.php 4 years ago html-admin-page-system-info.php 2 years ago
html-admin-page-system-info.php
1114 lines
1 <?php
2 /**
3 * Admin View: System Info
4 */
5
6 use Give\Framework\Migrations\MigrationsRunner;
7 use Give\Helpers\Table;
8 use Give\License\PremiumAddonsListManager;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 /**
15 * The following code is a derivative work of the code from the WooCommerce
16 * plugin, which is licensed GPLv3. This code therefore is also licensed under
17 * the terms of the GNU Public License, version 3.
18 *
19 * Copyright (c) 2015 WooThemes
20 * Copyright (c) 2016 GiveWP
21 */
22
23 global $wpdb;
24 $give_options = give_get_settings();
25 $plugins = give_get_plugins();
26 $give_add_ons = give_get_plugins( [ 'only_add_on' => true ] );
27
28 $give_plugin_authors = [ 'WordImpress', 'GiveWP' ];
29
30 /* @var Give_Updates $give_updates */
31 $give_updates = Give_Updates::get_instance();
32 ?>
33
34 <div class="give-debug-report-wrapper">
35 <p class="give-debug-report-text"><?php echo sprintf( __( 'Please copy and paste this information in your ticket when contacting support:', 'give' ) ); ?> </p>
36 <div class="give-debug-report-actions">
37 <a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a>
38 <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info"
39 target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?> <span
40 class="dashicons dashicons-external"></span></a>
41 </div>
42 <div class="give-debug-report js-give-debug-report">
43 <textarea readonly="readonly"></textarea>
44 </div>
45 </div>
46
47 <table class="give-status-table widefat" cellspacing="0" id="status">
48 <thead>
49 <tr>
50 <th colspan="3" data-export-label="WordPress Environment">
51 <h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th>
52 </tr>
53 </thead>
54 <tbody>
55 <tr>
56 <td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td>
57 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The URL of your site\'s homepage.', 'give' ) ); ?></td>
58 <td><?php form_option( 'home' ); ?></td>
59 </tr>
60 <tr>
61 <td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td>
62 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The root URL of your site.', 'give' ) ); ?></td>
63 <td><?php form_option( 'siteurl' ); ?></td>
64 </tr>
65 <tr>
66 <td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td>
67 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of WordPress installed on your site.', 'give' ) ); ?></td>
68 <td><?php bloginfo( 'version' ); ?></td>
69 </tr>
70 <tr>
71 <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td>
72 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?></td>
73 <td>
74 <?php
75 if ( is_multisite() ) {
76 echo '<span class="dashicons dashicons-yes"></span>';
77 } else {
78 echo '&ndash;';
79 }
80 ?>
81 </td>
82
83 </tr>
84 <tr>
85 <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td>
86 <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>
87 <td>
88 <?php
89 $memory = give_let_to_num( WP_MEMORY_LIMIT );
90
91 if ( function_exists( 'memory_get_usage' ) ) {
92 $system_memory = give_let_to_num( @ini_get( 'memory_limit' ) );
93 $memory = max( $memory, $system_memory );
94 }
95
96 if ( $memory < 67108864 ) {
97 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%1$s - We recommend setting memory to at least 64 MB. See: %2$s', 'give' ), size_format( $memory ), '<a href="https://developer.wordpress.org/apis/wp-config-php/#increasing-memory-allocated-to-php" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>';
98 } else {
99 echo '<mark class="yes">' . size_format( $memory ) . '</mark>';
100 }
101 ?>
102 </td>
103 </tr>
104 <tr>
105 <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td>
106 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?></td>
107 <td>
108 <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?>
109 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
110 <?php else : ?>
111 <mark class="no">&ndash;</mark>
112 <?php endif; ?>
113 </td>
114 </tr>
115 <tr>
116 <td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td>
117 <td class="help"><?php echo Give()->tooltips->render( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?></td>
118 <td>
119 <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
120 <mark class="no">&ndash;</mark>
121 <?php else : ?>
122 <mark class="yes"><span class="dashicons dashicons-yes"></span></mark>
123 <?php endif; ?>
124 </td>
125 </tr>
126 <tr>
127 <td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td>
128 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?></td>
129 <td><?php echo get_locale(); ?></td>
130 </tr>
131 <tr>
132 <td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td>
133 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?></td>
134 <td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td>
135 </tr>
136 <tr>
137 <td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td>
138 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?></td>
139 <td><?php echo esc_html( get_option( 'show_on_front', '&ndash;' ) ); ?></td>
140 </tr>
141 <?php if ( 'page' === get_option( 'show_on_front' ) ) : ?>
142 <?php
143 $front_page_id = absint( get_option( 'page_on_front' ) );
144 $blog_page_id = absint( get_option( 'page_for_posts' ) );
145 ?>
146 <tr>
147 <td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td>
148 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display as your front page.', 'give' ) ); ?></td>
149 <td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
150 </tr>
151 <tr>
152 <td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td>
153 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page set to display your posts.', 'give' ) ); ?></td>
154 <td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td>
155 </tr>
156 <?php endif; ?>
157 <tr>
158 <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix', 'give' ); ?>:</td>
159 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The table prefix used in your WordPress database.', 'give' ) ); ?></td>
160 <td><?php echo esc_html( $wpdb->prefix ); ?></td>
161 </tr>
162 <tr>
163 <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td>
164 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
165 <td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td>
166 </tr>
167 <tr>
168 <td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td>
169 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?></td>
170 <td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td>
171 </tr>
172 <tr>
173 <td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td>
174 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?></td>
175 <td><?php echo give_test_ajax_works( true ) ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td>
176 </tr>
177 <tr>
178 <td data-export-label="Registered Post Statuses"><?php _e( 'Registered Post Statuses', 'give' ); ?>:</td>
179 <td class="help"><?php echo Give()->tooltips->render_help( __( 'A list of all registered post statuses.', 'give' ) ); ?></td>
180 <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td>
181 </tr>
182 </tbody>
183 </table>
184
185 <table class="give-status-table widefat" cellspacing="0">
186 <thead>
187 <tr>
188 <th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2>
189 </th>
190 </tr>
191 </thead>
192 <tbody>
193 <tr>
194 <td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td>
195 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?></td>
196 <td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td>
197 </tr>
198 <tr>
199 <td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td>
200 <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>
201 <td>
202 <?php
203 $tls_check = false;
204
205 // Get the SSL status.
206 if ( ini_get( 'allow_url_fopen' ) ) {
207 $tls_check = wp_remote_get( 'https://www.howsmyssl.com/a/check' );
208 }
209
210 if ( ! is_wp_error( $tls_check ) ) {
211 $tls_check = json_decode( wp_remote_retrieve_body( $tls_check ), false );
212
213 /* translators: %s: SSL connection response */
214 printf( __( 'Connection uses %s', 'give' ), esc_html( $tls_check->tls_version ) );
215 }
216 ?>
217 </td>
218 </tr>
219 <tr>
220 <td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td>
221 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?></td>
222 <td>
223 <?php
224 if ( ! is_wp_error( $tls_check ) ) {
225 esc_html_e( property_exists( $tls_check, 'rating' ) ? $tls_check->rating : $tls_check->tls_version, 'give' );
226 }
227 ?>
228 </td>
229 </tr>
230 <tr>
231 <td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td>
232 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?></td>
233 <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
234 </tr>
235 <tr>
236 <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td>
237 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?></td>
238 <td>
239 <?php
240 // Check if phpversion function exists.
241 if ( function_exists( 'phpversion' ) ) {
242 $php_version = phpversion();
243
244 if ( version_compare( $php_version, '5.6', '<' ) ) {
245 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%1$s - We recommend a minimum PHP version of 5.6. See: %2$s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>';
246 } else {
247 echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>';
248 }
249 } else {
250 _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' );
251 }
252 ?>
253 </td>
254 </tr>
255 <?php if ( function_exists( 'ini_get' ) ) : ?>
256 <tr>
257 <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td>
258 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?></td>
259 <td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td>
260 </tr>
261 <tr>
262 <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td>
263 <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>
264 <td><?php echo ini_get( 'max_execution_time' ); ?></td>
265 </tr>
266 <tr>
267 <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td>
268 <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>
269 <td><?php echo ini_get( 'max_input_vars' ); ?></td>
270 </tr>
271 <tr>
272 <td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td>
273 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?></td>
274 <td><?php echo size_format( wp_max_upload_size() ); ?></td>
275 </tr>
276 <tr>
277 <td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td>
278 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of cURL installed on your server.', 'give' ) ); ?></td>
279 <td>
280 <?php
281 if ( function_exists( 'curl_version' ) ) {
282 $curl_version = curl_version();
283
284 if ( version_compare( $curl_version['version'], '7.40', '<' ) ) {
285 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>';
286 } else {
287 echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>';
288 }
289 } else {
290 echo '&ndash';
291 }
292 ?>
293 </td>
294 </tr>
295 <tr>
296 <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td>
297 <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>
298 <td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '&ndash;'; ?></td>
299 </tr>
300 <?php
301 endif;
302
303 $ver = mysqli_get_server_info($wpdb->dbh);
304
305 if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) :
306 ?>
307 <tr>
308 <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td>
309 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?></td>
310 <td>
311 <?php
312 $mysql_version = $wpdb->db_version();
313
314 if ( version_compare( $mysql_version, '5.6', '<' ) ) {
315 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%1$s - We recommend a minimum MySQL version of 5.6. See: %2$s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>';
316 } else {
317 echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>';
318 }
319 ?>
320 </td>
321 </tr>
322 <?php endif; ?>
323 <tr>
324 <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td>
325 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The default timezone for your server.', 'give' ) ); ?></td>
326 <td>
327 <?php
328 $default_timezone = date_default_timezone_get();
329 if ( 'UTC' !== $default_timezone ) {
330 echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>';
331 } else {
332 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
333 }
334 ?>
335 </td>
336 </tr>
337 <?php
338 $posting = [];
339
340 // fsockopen/cURL.
341 $posting['fsockopen_curl']['name'] = 'fsockopen/cURL';
342 $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' );
343
344 if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {
345 $posting['fsockopen_curl']['success'] = true;
346 } else {
347 $posting['fsockopen_curl']['success'] = false;
348 $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' );
349 }
350
351 // SOAP.
352 $posting['soap_client']['name'] = 'SoapClient';
353 $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' );
354
355 if ( class_exists( 'SoapClient' ) ) {
356 $posting['soap_client']['success'] = true;
357 } else {
358 $posting['soap_client']['success'] = false;
359 $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>' );
360 }
361
362 // DOMDocument.
363 $posting['dom_document']['name'] = 'DOMDocument';
364 $posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' );
365
366 if ( class_exists( 'DOMDocument' ) ) {
367 $posting['dom_document']['success'] = true;
368 } else {
369 $posting['dom_document']['success'] = false;
370 $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>' );
371 }
372
373 // gzip.
374 $posting['gzip']['name'] = 'gzip';
375 $posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' );
376
377 if ( is_callable( 'gzopen' ) ) {
378 $posting['gzip']['success'] = true;
379 } else {
380 $posting['gzip']['success'] = false;
381 $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>' );
382 }
383
384
385 // GD Graphics Library.
386 $posting['gd']['name'] = 'GD Graphics Library';
387 $posting['gd']['help'] = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' );
388 $posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false;
389
390 // Multibyte String.
391 $posting['mbstring']['name'] = 'Multibyte String';
392 $posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' );
393
394 if ( extension_loaded( 'mbstring' ) ) {
395 $posting['mbstring']['success'] = true;
396 } else {
397 $posting['mbstring']['success'] = false;
398 $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>' );
399 }
400
401 // WP Remote Post Check.
402 $posting['wp_remote_post']['name'] = __( 'Remote Post', 'give' );
403 $posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' );
404
405 $response = wp_safe_remote_post(
406 'https://www.paypal.com/cgi-bin/webscr',
407 [
408 'timeout' => 60,
409 'user-agent' => 'Give/' . GIVE_VERSION,
410 'httpversion' => '1.1',
411 'body' => [
412 'cmd' => '_notify-validate',
413 ],
414 ]
415 );
416
417 if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
418 $posting['wp_remote_post']['success'] = true;
419 } else {
420 $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' );
421 if ( is_wp_error( $response ) ) {
422 $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) );
423 } else {
424 $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) );
425 }
426 $posting['wp_remote_post']['success'] = false;
427 }
428
429 // WP Remote Get Check.
430 $posting['wp_remote_get']['name'] = __( 'Remote Get', 'give' );
431 $posting['wp_remote_get']['help'] = __( 'GiveWP plugins may use this method of communication when checking for plugin updates.', 'give' );
432
433 $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) );
434
435 if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
436 $posting['wp_remote_get']['success'] = true;
437 } else {
438 $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The GiveWP plugin updater won\'t work with your server. Contact your hosting provider.', 'give' );
439 if ( is_wp_error( $response ) ) {
440 $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) );
441 } else {
442 $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) );
443 }
444 $posting['wp_remote_get']['success'] = false;
445 }
446
447 $posting = apply_filters( 'give_debug_posting', $posting );
448
449 foreach ( $posting as $post ) {
450 $mark = ! empty( $post['success'] ) ? 'yes' : 'error';
451 ?>
452 <tr>
453 <td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td>
454 <td class="help"><?php echo Give()->tooltips->render_help( esc_attr( isset( $post['help'] ) ? $post['help'] : '' ) ); ?></td>
455 <td>
456 <mark class="<?php echo $mark; ?>">
457 <?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'] ) : ''; ?>
458 </mark>
459 </td>
460 </tr>
461 <?php
462 }
463 ?>
464 </tbody>
465 </table>
466
467 <table class="give-status-table widefat" cellspacing="0">
468 <thead>
469 <tr>
470 <th colspan="3" data-export-label="GiveWP Configuration"><h2><?php _e( 'GiveWP Configuration', 'give' ); ?></h2>
471 </th>
472 </tr>
473 </thead>
474 <tbody>
475 <tr>
476 <td data-export-label="GiveWP Version"><?php _e( 'GiveWP Version', 'give' ); ?>:</td>
477 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of GiveWP installed on your site.', 'give' ) ); ?></td>
478 <td><?php echo esc_html( get_option( 'give_version' ) ); ?></td>
479 </tr>
480 <tr>
481 <td data-export-label="GiveWP Cache"><?php _e( 'GiveWP Cache', 'give' ); ?>:</td>
482 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in GiveWP settings.', 'give' ) ); ?></td>
483 <td><?php echo give_is_setting_enabled( give_get_option( 'cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
484 </tr>
485 <tr>
486 <td data-export-label="Database Updates"><?php _e( 'Database Updates', 'give' ); ?>:</td>
487 <td class="help"><?php echo Give()->tooltips->render_help( __( 'This will show the number of pending database updates.', 'give' ) ); ?></td>
488 <td>
489 <?php
490 $updates_text = __( 'All DB Updates Completed.', 'give' );
491 $pending_updates = $give_updates->get_total_new_db_update_count();
492 $total_updates = $give_updates->get_total_db_update_count();
493
494 if ( Give_Updates::$background_updater->is_paused_process() ) {
495 // When all the db updates are pending.
496 $updates_text = sprintf(
497 __( '%1$s updates still need to run. (Paused) ', 'give' ),
498 count( $give_updates->get_updates( 'database', 'new' ) )
499 );
500 } elseif ( $pending_updates === $total_updates ) {
501
502 // When all the db updates are pending.
503 $updates_text = sprintf(
504 __( '%1$s updates still need to run.', 'give' ),
505 $total_updates
506 );
507 } elseif ( $pending_updates > 0 ) {
508
509 // When some of the db updates are completed and some are pending.
510 $updates_text = sprintf(
511 __( '%1$s of %2$s updates still need to run.', 'give' ),
512 $pending_updates,
513 $total_updates
514 );
515 }
516
517 echo $updates_text;
518 ?>
519 </td>
520 </tr>
521 <tr>
522 <td data-export-label="Database Updates"><?php _e( 'Database Migrations', 'give' ); ?>:</td>
523 <td class="help"><?php echo Give()->tooltips->render_help( __( 'This will inform you whether database migration completed or not.', 'give' ) ); ?></td>
524 <td>
525 <?php
526 /* @var MigrationsRunner $migrationRunner */
527 $migrationRunner = give( MigrationsRunner::class );
528
529 echo $migrationRunner->hasMigrationToRun() ?
530 esc_html__( 'Few Database Migrations still need to run.', 'give' ) :
531 esc_html__( 'All Database Migrations Completed.', 'give' );
532 ?>
533 </td>
534 </tr>
535 <tr>
536 <td data-export-label="Database Tables"><?php _e( 'Database Tables', 'give' ); ?>:</td>
537 <td class="help"><?php echo Give()->tooltips->render_help( __( 'This will show list of installed database tables.', 'give' ) ); ?></td>
538 <td>
539 <?php
540 $db_table_list = '';
541
542 /* @var Give_DB $table */
543 foreach ( __give_get_tables() as $table ) {
544 $db_table_list .= sprintf(
545 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark> %3$s</li>',
546 $table->installed()
547 ? 'yes'
548 : 'error',
549 $table->installed()
550 ? 'yes'
551 : 'no-alt',
552 $table->table_name
553 );
554 }
555
556 $isRevenueTableExist = Table::tableExists( Table::prefixTableName( 'give_revenue' ) );
557 $db_table_list .= sprintf(
558 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark> %3$s</li>',
559 $isRevenueTableExist ? 'yes' : 'error',
560 $isRevenueTableExist ? 'yes' : 'no-alt',
561 Table::prefixTableName( 'give_revenue' )
562 );
563
564 $isMigrationTableExist = Table::tableExists(Table::prefixTableName('give_migrations'));
565 $db_table_list .= sprintf(
566 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark> %3$s</li>',
567 $isMigrationTableExist ? 'yes' : 'error',
568 $isMigrationTableExist ? 'yes' : 'no-alt',
569 Table::prefixTableName('give_migrations')
570 );
571
572 $isLogTableExist = Table::tableExists(Table::prefixTableName('give_log'));
573 $db_table_list .= sprintf(
574 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark> %3$s</li>',
575 $isLogTableExist ? 'yes' : 'error',
576 $isLogTableExist ? 'yes' : 'no-alt',
577 Table::prefixTableName('give_log')
578 );
579
580 echo "<ul>{$db_table_list}</ul>";
581 ?>
582 </td>
583 </tr>
584 <tr>
585 <td data-export-label="GiveWP Cache"><?php _e( 'GiveWP Cache', 'give' ); ?>:</td>
586 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether cache is enabled in GiveWP settings.', 'give' ) ); ?></td>
587 <td><?php echo give_is_setting_enabled( give_get_option( 'cache', 'enabled' ) ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
588 </tr>
589 <tr>
590 <td data-export-label="GiveWP Cache"><?php _e( 'GiveWP Emails', 'give' ); ?>:</td>
591 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether emails is enabled in GiveWP settings.', 'give' ) ); ?></td>
592 <td>
593 <?php
594 /* @var Give_Email_Notification $email_notification */
595 if ( $email_notifications = Give_Email_Notifications::get_instance()->get_email_notifications() ) {
596 ob_start();
597
598 foreach ( Give_Email_Notifications::get_instance()->get_email_notifications() as $email_notification ) {
599 $status = Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ?
600 'yes' :
601 'error';
602
603 echo sprintf(
604 '<li><mark class="%1$s"><span class="dashicons dashicons-%2$s"></mark></span>%3$s</li>',
605 Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'error',
606 Give_Email_Notification_Util::is_email_notification_active( $email_notification ) ? 'yes' : 'no-alt',
607 $email_notification->config['label']
608 );
609 }
610
611 echo sprintf( '<ul>%s</ul>', ob_get_clean() );
612 }
613 ?>
614 </td>
615 </tr>
616 <tr>
617 <td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td>
618 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The version of GiveWP installed prior to the last update.', 'give' ) ); ?></td>
619 <td><?php echo esc_html( get_option( 'give_version_upgraded_from', '&ndash;' ) ); ?></td>
620 </tr>
621 <tr>
622 <td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td>
623 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether Test Mode is enabled in GiveWP settings.', 'give' ) ); ?></td>
624 <td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
625 </tr>
626 <tr>
627 <td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td>
628 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency code selected in GiveWP settings.', 'give' ) ); ?></td>
629 <td><?php echo esc_html( give_get_currency() ); ?></td>
630 </tr>
631 <tr>
632 <td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td>
633 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The currency position selected in GiveWP settings.', 'give' ) ); ?></td>
634 <td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td>
635 </tr>
636 <tr>
637 <td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td>
638 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The decimal separator defined in GiveWP settings.', 'give' ) ); ?></td>
639 <td><?php echo esc_html( give_get_price_decimal_separator() ); ?></td>
640 </tr>
641 <tr>
642 <td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td>
643 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The thousands separator defined in GiveWP settings.', 'give' ) ); ?></td>
644 <td><?php echo esc_html( give_get_price_thousand_separator() ); ?></td>
645 </tr>
646 <tr>
647 <td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td>
648 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?></td>
649 <td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '&ndash;'; ?></td>
650 </tr>
651 <tr>
652 <td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td>
653 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?></td>
654 <td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '&ndash;'; ?></td>
655 </tr>
656 <tr>
657 <td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td>
658 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The page where past donations are listed.', 'give' ) ); ?></td>
659 <td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '&ndash;'; ?></td>
660 </tr>
661 <tr>
662 <td data-export-label="GiveWP Forms Slug"><?php _e( 'GiveWP Forms Slug', 'give' ); ?>:</td>
663 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The slug used for GiveWP donation forms.', 'give' ) ); ?></td>
664 <td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td>
665 </tr>
666 <?php
667 $active_gateways = give_get_enabled_payment_gateways();
668 $enabled_gateways = $default_gateway = '';
669
670 if ( $active_gateways ) {
671 $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) );
672
673 if ( $default_gateway_is_active ) {
674 $default_gateway = give_get_default_gateway( null );
675 $default_gateway = $active_gateways[ $default_gateway ]['admin_label'];
676 } else {
677 $default_gateway = __( 'Test Donation', 'give' );
678 }
679
680 $gateways = [];
681
682 foreach ( $active_gateways as $gateway ) {
683 $gateways[] = $gateway['admin_label'];
684 }
685
686 $enabled_gateways = implode( ', ', $gateways );
687 }
688 ?>
689 <tr>
690 <td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td>
691 <td class="help"><?php echo Give()->tooltips->render_help( __( 'All payment gateways enabled in GiveWP settings.', 'give' ) ); ?></td>
692 <td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '&ndash;' ); ?></td>
693 </tr>
694 <tr>
695 <td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td>
696 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The default payment gateway selected in GiveWP settings.', 'give' ) ); ?></td>
697 <td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '&ndash;' ); ?></td>
698 </tr>
699 <tr>
700 <td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td>
701 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?></td>
702 <td>
703 <?php
704 $last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received', [] );
705 $donation_id = isset( $last_paypal_ipn_received['payment_id'] ) ? $last_paypal_ipn_received['payment_id'] : null;
706 if (
707 is_array( $last_paypal_ipn_received )
708 && count( $last_paypal_ipn_received ) > 0
709 && $donation_id !== null
710 && get_post( $donation_id ) instanceof WP_Post
711 ) {
712 $ipn_timestamp = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true );
713 $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id'];
714 $donation_url = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id;
715 echo sprintf(
716 __( 'IPN received for <a href="%1$s">#%2$s</a> ( <a href="%3$s" target="_blank">%4$s</a> ) on %5$s at %6$s. Status %7$s', 'give' ),
717 $donation_url,
718 $donation_id,
719 $transaction_url,
720 $last_paypal_ipn_received['transaction_id'],
721 date_i18n( 'm/d/Y', $ipn_timestamp ),
722 date_i18n( 'H:i', $ipn_timestamp ),
723 $last_paypal_ipn_received['auth_status']
724 );
725 } else {
726 echo 'N/A';
727 }
728 ?>
729 </td>
730 </tr>
731 <tr>
732 <td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td>
733 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?></td>
734 <td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td>
735 </tr>
736 <tr>
737 <td data-export-label="Stripe Webhook Notifications"><?php _e( 'Stripe Webhook Notifications', 'give' ); ?>:</td>
738 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Displays whether when last Stripe Webhook is received with which donation or transaction.', 'give' ) ); ?></td>
739 <td>
740 <?php
741 $webhook_received_on = give_get_option( 'give_stripe_last_webhook_received_timestamp' );
742 if ( ! empty( $webhook_received_on ) ) {
743 $date_time_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
744 echo date_i18n( esc_html( $date_time_format ), $webhook_received_on );
745 } else {
746 echo 'N/A';
747 }
748 ?>
749 </td>
750 </tr>
751 <?php
752 /**
753 * This action hook will be used to add system info configuration for GiveWP.
754 *
755 * @since 2.5.14
756 *
757 * @param array $give_options List of Give Settings.
758 *
759 */
760 do_action( 'give_add_system_info_configuration', $give_options );
761 ?>
762 </tbody>
763 </table>
764
765 <table class="give-status-table widefat" cellspacing="0">
766 <thead>
767 <tr>
768 <th colspan="3" data-export-label="Active GiveWP Add-ons">
769 <h2><?php _e( 'Active GiveWP Add-ons', 'give' ); ?></h2></th>
770 </tr>
771 </thead>
772 <tbody>
773 <?php
774 foreach ( $give_add_ons as $plugin_data ) {
775 // Only show Give Core Activated Add-Ons.
776 if (
777 'active' !== $plugin_data['Status']
778 || false !== strpos( $plugin_data['Name'], 'GiveWP - Donation Plugin' )
779 ) {
780 continue;
781 }
782
783 $plugin_name = $plugin_data['Name'];
784 $author_name = $plugin_data['Author'];
785
786 // Link the plugin name to the plugin URL if available.
787 if ( ! empty( $plugin_data['PluginURI'] ) ) {
788 $plugin_name = sprintf(
789 '<a href="%s" title="%s">%s</a>',
790 esc_url( $plugin_data['PluginURI'] ),
791 esc_attr__( 'Visit plugin homepage', 'give' ),
792 $plugin_name
793 );
794 }
795
796 // Link the author name to the author URL if available.
797 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
798 $author_name = sprintf(
799 '<a href="%s" title="%s">%s</a>',
800 esc_url( $plugin_data['AuthorURI'] ),
801 esc_attr__( 'Visit author homepage', 'give' ),
802 $author_name
803 );
804 }
805 ?>
806 <tr>
807 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
808 <td class="help">&nbsp;</td>
809 <td>
810 <?php
811 if (!give(PremiumAddonsListManager::class)->isPremiumAddons($plugin_data['PluginURI'])) {
812 echo '<mark class="error"><span class="dashicons dashicons-heart"></span></mark> ' . __(
813 'Free addon',
814 'give'
815 );
816 } elseif (isset($plugin_data['License']) && true === $plugin_data['License']) {
817 echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __(
818 'Licensed',
819 'give'
820 );
821 } else {
822 echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __(
823 'Unlicensed',
824 'give'
825 );
826 }
827
828 echo ' &ndash; '
829 . sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post')))
830 . ' &ndash; '
831 . esc_html($plugin_data['Version']);
832 ?>
833 </td>
834 </tr>
835 <?php
836 }
837 ?>
838 </tbody>
839 </table>
840
841 <table class="give-status-table widefat" cellspacing="0">
842 <thead>
843 <tr>
844 <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2>
845 </th>
846 </tr>
847 </thead>
848 <tbody>
849 <?php
850 foreach ( $plugins as $plugin_data ) {
851 // Do not show Give Core and it's Add-On plugins.
852 if (
853 'active' !== $plugin_data['Status']
854 || in_array( $plugin_data['AuthorName'], $give_plugin_authors )
855 || false !== strpos( $plugin_data['PluginURI'], 'givewp.com' )
856 ) {
857 continue;
858 }
859
860 $plugin_name = $plugin_data['Name'];
861 $author_name = $plugin_data['Author'];
862
863 // Link the plugin name to the plugin URL if available.
864 if ( ! empty( $plugin_data['PluginURI'] ) ) {
865 $plugin_name = sprintf(
866 '<a href="%s" title="%s">%s</a>',
867 esc_url( $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 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
875 $author_name = sprintf(
876 '<a href="%s" title="%s">%s</a>',
877 esc_url( $plugin_data['AuthorURI'] ),
878 esc_attr__( 'Visit author homepage', 'give' ),
879 $author_name
880 );
881 }
882 ?>
883 <tr>
884 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
885 <td class="help">&nbsp;</td>
886 <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>
887 </tr>
888 <?php
889 }
890 ?>
891 </tbody>
892 </table>
893
894 <table class="give-status-table widefat" cellspacing="0">
895 <thead>
896 <tr>
897 <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th>
898 </tr>
899 </thead>
900 <tbody>
901 <?php
902 foreach ( $plugins as $plugin_data ) {
903 if ( 'inactive' !== $plugin_data['Status'] ) {
904 continue;
905 }
906
907 $plugin_name = $plugin_data['Name'];
908 $author_name = $plugin_data['Author'];
909
910 // Link the plugin name to the plugin URL if available.
911 if ( ! empty( $plugin_data['PluginURI'] ) ) {
912 $plugin_name = sprintf(
913 '<a href="%s" title="%s">%s</a>',
914 esc_url( $plugin_data['PluginURI'] ),
915 esc_attr__( 'Visit plugin homepage', 'give' ),
916 $plugin_name
917 );
918 }
919
920 // Link the author name to the author URL if available.
921 if ( ! empty( $plugin_data['AuthorURI'] ) ) {
922 $author_name = sprintf(
923 '<a href="%s" title="%s">%s</a>',
924 esc_url( $plugin_data['AuthorURI'] ),
925 esc_attr__( 'Visit author homepage', 'give' ),
926 $author_name
927 );
928 }
929 ?>
930 <tr>
931 <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td>
932 <td class="help">&nbsp;</td>
933 <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>
934 </tr>
935 <?php
936 }
937 ?>
938 </tbody>
939 </table>
940
941 <?php
942 $active_mu_plugins = (array) get_mu_plugins();
943 if ( ! empty( $active_mu_plugins ) ) {
944 ?>
945 <table class="give-status-table widefat" cellspacing="0">
946 <thead>
947 <tr>
948 <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2>
949 </th>
950 </tr>
951 </thead>
952 <tbody>
953 <?php
954
955 foreach ( $active_mu_plugins as $mu_plugin_data ) {
956 if ( ! empty( $mu_plugin_data['Name'] ) ) {
957 // Link the plugin name to the plugin URL if available.
958 $plugin_name = esc_html( $mu_plugin_data['Name'] );
959
960 if ( ! empty( $mu_plugin_data['PluginURI'] ) ) {
961 $plugin_name = sprintf(
962 '<a href="%s" title="%s">%s</a>',
963 esc_url( $mu_plugin_data['PluginURI'] ),
964 esc_attr__( 'Visit plugin homepage', 'give' ),
965 $plugin_name
966 );
967 }
968
969 // Link the author name to the author URL if available.
970 $author_name = esc_html( $mu_plugin_data['Author'] );
971
972 if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) {
973 $author_name = sprintf(
974 '<a href="%s">%s</a>',
975 esc_url( $mu_plugin_data['AuthorURI'] ),
976 $author_name
977 );
978 }
979 ?>
980 <tr>
981 <td><?php echo $plugin_name; ?></td>
982 <td class="help">&nbsp;</td>
983 <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' &ndash; ' . esc_html( $mu_plugin_data['Version'] ); ?></td>
984 </tr>
985 <?php
986 }
987 }
988 ?>
989 </tbody>
990 </table>
991 <?php } ?>
992
993 <table class="give-status-table widefat" cellspacing="0">
994 <thead>
995 <tr>
996 <th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th>
997 </tr>
998 </thead>
999 <?php
1000 require_once ABSPATH . 'wp-admin/includes/theme-install.php';
1001 $active_theme = wp_get_theme();
1002 ?>
1003 <tbody>
1004 <tr>
1005 <td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td>
1006 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the current active theme.', 'give' ) ); ?></td>
1007 <td><?php echo esc_html( $active_theme->Name ); ?></td>
1008 </tr>
1009 <tr>
1010 <td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td>
1011 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the current active theme.', 'give' ) ); ?></td>
1012 <td><?php echo esc_html( $active_theme->Version ); ?></td>
1013 </tr>
1014 <tr>
1015 <td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td>
1016 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The theme developer\'s URL.', 'give' ) ); ?></td>
1017 <td><?php echo $active_theme->{'Author URI'}; ?></td>
1018 </tr>
1019 <tr>
1020 <td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td>
1021 <td class="help"><?php echo Give()->tooltips->render_help( __( 'Whether the current theme is a child theme.', 'give' ) ); ?></td>
1022 <td>
1023 <?php
1024 echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' &ndash; ' . sprintf( __( 'If you\'re modifying GiveWP 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://docs.givewp.com/wp-child-themes' );
1025 ?>
1026 </td>
1027 </tr>
1028 <?php
1029 if ( is_child_theme() ) {
1030 $parent_theme = wp_get_theme( $active_theme->Template );
1031 ?>
1032 <tr>
1033 <td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td>
1034 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The name of the parent theme.', 'give' ) ); ?></td>
1035 <td><?php echo esc_html( $parent_theme->Name ); ?></td>
1036 </tr>
1037 <tr>
1038 <td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td>
1039 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The installed version of the parent theme.', 'give' ) ); ?></td>
1040 <td><?php echo esc_html( $parent_theme->Version ); ?></td>
1041 </tr>
1042 <tr>
1043 <td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td>
1044 <td class="help"><?php echo Give()->tooltips->render_help( __( 'The parent theme developers URL.', 'give' ) ); ?></td>
1045 <td><?php echo $parent_theme->{'Author URI'}; ?></td>
1046 </tr>
1047 <?php } ?>
1048 </tbody>
1049 </table>
1050
1051 <script type="text/javascript">
1052 jQuery('.js-give-debug-report-button').click(function () {
1053 var report = '';
1054 var first_row = true;
1055
1056 jQuery('.give-status-table thead, .give-status-table tbody').each(function () {
1057 if (jQuery(this).is('thead')) {
1058
1059 var label = jQuery(this).find('th:eq(0)').data('export-label') || jQuery(this).text();
1060
1061 if (true === first_row) {
1062 report = '### ' + jQuery.trim(label) + ' ###\n\n';
1063 first_row = false;
1064 } else {
1065 report = report + '\n### ' + jQuery.trim(label) + ' ###\n\n';
1066 }
1067 } else {
1068
1069 jQuery('tr', jQuery(this)).each(function () {
1070
1071 var label = jQuery(this).find('td:eq(0)').data('export-label') || jQuery(this).find('td:eq(0)').text();
1072 var the_name = jQuery.trim(label).replace(/(<([^>]+)>)/ig, ''); // Remove HTML.
1073
1074 // Find value
1075 var $value_html = jQuery(this).find('td:eq(2)').clone();
1076 $value_html.find('.private').remove();
1077 $value_html.find('.dashicons-yes').replaceWith('&#10004;');
1078 $value_html.find('.dashicons-no-alt, .dashicons-warning').replaceWith('&#10060;');
1079
1080 // Format value
1081 var the_value = jQuery.trim($value_html.text());
1082 // var value_array = the_value.split( ', ' );
1083 //
1084 // if ( value_array.length > 1 ) {
1085 // // If value have a list of plugins ','.
1086 // // Split to add new line.
1087 // var temp_line ='';
1088 // jQuery.each( value_array, function( key, line ) {
1089 // temp_line = temp_line + line + '\n';
1090 // });
1091 //
1092 // the_value = temp_line;
1093 // }
1094
1095 report = report + '' + the_name + ': ' + the_value + '\n';
1096 });
1097
1098 }
1099 });
1100
1101 try {
1102 jQuery('.js-give-debug-report').slideDown();
1103 jQuery('.js-give-debug-report').find('textarea').val(report).focus().select();
1104 jQuery(this).hide();
1105 return false;
1106 } catch (e) {
1107 /* jshint devel: true */
1108 console.log(e);
1109 }
1110
1111 return false;
1112 });
1113 </script>
1114