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