PluginProbe
wpForo Forum / 3.0.7
wpForo Forum v3.0.7
3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 All 137 releases
wpforo / admin / tools-tabs / debug.php

debug.php in wpForo Forum 3.0.7, at admin/tools-tabs/debug.php

392 lines 23.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( ! defined( 'ABSPATH' ) ) exit;
4 if( ! current_user_can( 'administrator' ) ) exit;
5 $view = ( wpfval( $_GET, 'view' ) ) ? sanitize_text_field( $_GET['view'] ) : '';
6 ?>
7
8 <form method="POST" class="validate">
9 <div class="wpf-tool-box" style="margin-top: 15px;">
10 <h3>
11 <?php _e( 'Debug Information', 'wpforo' ); ?> &nbsp;&nbsp;&nbsp; - &nbsp;&nbsp;&nbsp;
12
13 <?php if( $view == 'user' || $view == '' ): ?>
14 [ <?php _e( 'User Data', 'wpforo' ); ?> ]
15 <?php else: ?>
16 [ <a href="<?php echo admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=debug&view=user' ) ?>" style="text-decoration: none; outline: none;box-shadow:none;"><?php _e( 'User Data', 'wpforo' ); ?></a> ]
17 <?php endif; ?>
18
19 <?php if( $view == 'server' ): ?>
20 [ <?php _e( 'Server', 'wpforo' ); ?> ]
21 <?php else: ?>
22 [ <a href="<?php echo admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=debug&view=server' ) ?>" style="text-decoration: none; outline: none;box-shadow:none;"><?php _e( 'Server', 'wpforo' ); ?></a> ]
23 <?php endif; ?>
24
25 <?php if( $view == 'issues' ): ?>
26 [ <?php _e( 'Errors & Issues', 'wpforo' ); ?> ]
27 <?php else: ?>
28 [ <a href="<?php echo admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'tools' ) . '&tab=debug&view=issues' ) ?>" style="text-decoration: none; outline: none;box-shadow:none;"><?php _e( 'Errors & Issues', 'wpforo' ); ?></a> ]
29 <?php endif; ?>
30 </h3>
31 <div style="margin-top:10px; clear:both;">
32
33 <table style="width:100%;">
34 <tbody style="padding:10px;">
35 <?php if( $view == 'user' || $view == '' ): ?>
36 <tr>
37 <td>
38 <h4>
39 <?php _e( 'User Data', 'wpforo' ) ?> &nbsp;&nbsp; | &nbsp;&nbsp;
40 <?php
41 $wpfu = ( wpfval( $_POST, 'wpfu' ) ) ? intval( $_POST['wpfu'] ) : WPF()->current_userid;
42 $user = WPF()->member->get_member( $wpfu );
43 $usermeta = get_user_meta( $wpfu );
44 ?>
45 <form method="POST" style="display: inline-block">
46 <?php _e( 'User ID', 'wpforo' ) ?>: &nbsp; <input style="display: inline-block; font-size: 12px; padding: 3px 10px; width: 80px; vertical-align: middle;" type="text" name="wpfu" placeholder="<?php _e( 'User ID', 'wpforo' ) ?>" value="<?php echo intval( $wpfu ) ?>">
47 <input style="display: inline-block; font-size: 12px; line-height: 20px; height: auto; vertical-align:middle;" type="submit" class="button" value="<?php _e( 'Display User Data', 'wpforo' ); ?>"/>
48 </form>
49 </h4>
50 </td>
51 </tr>
52 <?php if( ! empty( $user ) ): ?>
53 <tr>
54 <td><?php echo wpforo_display_array_data( $user ); ?></td>
55 </tr>
56 <tr>
57 <td><h4><?php _e( 'User Meta Data', 'wpforo' ) ?></h4></td>
58 </tr>
59 <tr>
60 <td>
61 <?php
62 $keys = [ 'nickname', 'rich_editing', 'show_admin_bar_front', 'locale', WPF()->blog_prefix . 'capabilities', WPF()->blog_prefix . 'user_level', 'last_activity', wpforo_prefix( 'read_topics' ), 'session_tokens' ];
63 echo wpforo_display_array_data( $usermeta, $keys );
64 ?>
65 </td>
66 </tr>
67 <?php if( $wpfu == WPF()->current_userid ): ?>
68 <tr>
69 <td><h4><?php _e( 'User Cookies', 'wpforo' ) ?></h4></td>
70 </tr>
71 <tr>
72 <td>
73 <?php
74 $keys = [ wpforo_prefix( 'all_read' ), wpforo_prefix( 'read_topics' ), wpforo_prefix( 'read_forums' ) ];
75 echo wpforo_display_array_data( $_COOKIE, $keys );
76 ?>
77 </td>
78 </tr>
79 <?php endif; ?>
80 <?php else: ?>
81 <tr>
82 <td><p style="padding: 0px 20px;"><?php _e( 'No user found.', 'wpforo' ) ?></p></td>
83 </tr>
84 <?php endif; ?>
85 <?php endif; ?>
86 <?php if( $view == 'server' ): ?>
87 <tr>
88 <td><h4><?php _e( 'Server Information', 'wpforo' ) ?></h4></td>
89 </tr>
90 <tr>
91 <td>
92 <table class="wpf-table-data" style="margin: 10px; width: 98%;">
93 <tr class="wpf-dw-tr">
94 <td class="wpf-dw-td">USER AGENT</td>
95 <td class="wpf-dw-td-value"><?php echo esc_html( $_SERVER['HTTP_USER_AGENT'] ) ?></td>
96 </tr>
97 <tr class="wpf-dw-tr">
98 <td class="wpf-dw-td">Web Server</td>
99 <td class="wpf-dw-td-value"><?php echo $_SERVER['SERVER_SOFTWARE'] ?></td>
100 </tr>
101 <tr class="wpf-dw-tr">
102 <td class="wpf-dw-td">PHP Version</td>
103 <td class="wpf-dw-td-value"><?php echo phpversion(); ?></td>
104 </tr>
105 <tr class="wpf-dw-tr">
106 <td class="wpf-dw-td">MySQL Version</td>
107 <td class="wpf-dw-td-value"><?php echo WPF()->db->get_var( "SELECT VERSION()" ); ?></td>
108 </tr>
109 <tr class="wpf-dw-tr">
110 <td class="wpf-dw-td">PHP Max Post Size</td>
111 <td class="wpf-dw-td-value"><?php echo ini_get( 'post_max_size' ); ?></td>
112 </tr>
113 <tr class="wpf-dw-tr">
114 <td class="wpf-dw-td">PHP Max Upload Size</td>
115 <td class="wpf-dw-td-value"><?php echo ini_get( 'upload_max_filesize' ); ?></td>
116 </tr>
117 <tr class="wpf-dw-tr">
118 <td class="wpf-dw-td">PHP Memory Limit</td>
119 <td class="wpf-dw-td-value"><?php echo ini_get( 'memory_limit' ); ?></td>
120 </tr>
121 <tr class="wpf-dw-tr">
122 <td class="wpf-dw-td">PHP DateTime Class</td>
123 <td class="wpf-dw-td-value" style="line-height: 18px!important;">
124 <?php echo ( class_exists( 'DateTime' ) && class_exists( 'DateTimeZone' ) && method_exists( 'DateTime', 'setTimestamp' ) ) ? '<span class="wpf-green">' . __( 'Available', 'wpforo' ) . '</span>' : '<span class="wpf-red">' . __(
125 'The setTimestamp() method of PHP DateTime class is not available. Please make sure you use PHP 5.4 and higher version on your hosting service.',
126 'wpforo'
127 ) . '</span> | <a href="http://php.net/manual/en/datetime.settimestamp.php" target="_blank">more info&raquo;</a>'; ?> </td>
128 </tr>
129 <tr class="wpf-dw-tr">
130 <td class="wpf-dw-td">PHP cURL Module</td>
131 <td class="wpf-dw-td-value" style="line-height: 18px!important;">
132 <?php echo ( function_exists( 'curl_version' ) || extension_loaded( 'curl' ) || in_array( 'curl', get_loaded_extensions() ) ) ? '<span class="wpf-green">' . __( 'Available', 'wpforo' ) . '</span>' : '<span class="wpf-red">' . __( 'Not available', 'wpforo' ) . '</span> <span style="font-size: smaller; color: gray;">( ' . __(
133 'Please contact to your hosting service support team and ask them enable PHP cURL module'
134 ) . ' )</span> | <a href="https://deliciousbrains.com/php-curl-how-wordpress-makes-http-requests/" target="_blank">more info&raquo;</a>'; ?> </td>
135 </tr>
136 <?php if( function_exists( 'apache_get_modules' ) ): ?>
137 <tr class="wpf-dw-tr">
138 <td class="wpf-dw-td">Permalinks / mod_rewrite</td>
139 <td class="wpf-dw-td-value" style="line-height: 18px!important;">
140 <?php echo ( in_array( 'mod_rewrite', apache_get_modules() ) ) ? '<span class="wpf-green">' . __( 'Available', 'wpforo' ) . '</span>' : '<span class="wpf-red">' . __( 'Not enabled', 'wpforo' ) . '</span> <span style="font-size: smaller; color: gray;">( ' . __(
141 'Please enable mod_rewrite on your server, this is required for wpForo forum'
142 ) . ' )</span> | <a href="https://codex.wordpress.org/Using_Permalinks#mod_rewrite:_.22Pretty_Permalinks.22" target="_blank">more info&raquo;</a>'; ?>
143 </td>
144 </tr>
145 <?php endif; ?>
146 <?php do_action( 'wpforo_dashboard_widget_server' ) ?>
147 </table>
148 </td>
149 </tr>
150 <?php endif; ?>
151 <?php if( $view == 'issues' ): ?>
152 <tr>
153 <td><h4><?php _e( 'Issues and Recommendations', 'wpforo' ) ?></h4></td>
154 </tr>
155 <tr>
156 <td>
157 <?php wpforo_issues() ?>
158 </td>
159 </tr>
160 <tr>
161 <td><h4><?php _e( 'Error Logs', 'wpforo' ) ?></h4></td>
162 </tr>
163 <tr>
164 <td>
165 <?php
166 $error_log_file = rtrim( ABSPATH, '/' ) . '/' . 'error_log';
167 if( file_exists( $error_log_file ) ) {
168 wpforo_read_file_revers( $error_log_file );
169 }
170 ?>
171 <?php
172 $error_log_file = rtrim( ABSPATH, '/' ) . '/wp-content/' . 'debug.log';
173 if( file_exists( $error_log_file ) ) {
174 wpforo_read_file_revers( $error_log_file );
175 }
176 ?>
177 <?php
178 $error_log_file = rtrim( ABSPATH, '/' ) . '/wp-admin/' . 'error_log';
179 if( file_exists( $error_log_file ) ) {
180 wpforo_read_file_revers( $error_log_file );
181 }
182 ?>
183 &nbsp;
184 </td>
185 </tr>
186 <?php endif; ?>
187 </tbody>
188 </table>
189 </div>
190 </div>
191 </form>
192 <?php
193 function wpforo_display_array_data( $array, $keys = [] ) {
194 $html = '';
195 foreach( $array as $k => $v ) {
196 if( ( ! empty( $keys ) && ! in_array( $k, $keys ) && strpos( (string) $k, 'capabilities' ) === false ) || $k == 'user_pass' ) continue;
197 if( is_serialized( $v ) || is_array( $v ) ) {
198 $v = ( is_array( $v ) ) ? $v : @unserialize( $v, [ 'allowed_classes' => false ] );
199 $v_html = '';
200 if( is_array( $v ) && ! empty( $v ) ) {
201 foreach( $v as $kk => $vv ) {
202 if( is_serialized( $vv ) || is_array( $vv ) ) {
203 $v_html = '';
204 $vv = ( is_array( $vv ) ) ? $vv : unserialize( $vv, [ 'allowed_classes' => false ] );
205 if( $k === wpforo_prefix( 'read_topics' ) ) {
206 $v_html .= "<span class='wpf-sb-data'>" . count( $vv ) . "</span> ";
207 } else {
208 if( is_array( $vv ) && ! empty( $vv ) ) {
209 foreach( $vv as $kkk => $vvv ) {
210 if( is_array( $vvv ) ) $vvv = implode( ' &nbsp; | &nbsp; ', $vvv );
211 $v_html .= "<span class='wpf-sb-data'><key>" . $kkk . ':</key> <value>' . wp_unslash( $vvv ) . "</value></span> &nbsp; | &nbsp; ";
212 }
213 }
214 }
215 } else {
216 $v_html .= "<span class='wpf-sb-data'><key>" . $kk . ':</key> <value>' . $vv . "</value></span> &nbsp; | &nbsp; ";
217 }
218 }
219 }
220 $v = $v_html;
221 }
222 if( $v == '' ) $v = 'null';
223 $html .= "<div class='wpf-data'><key>" . $k . ':</key> <value>' . wp_unslash( $v ) . "</value></div>";
224 }
225
226 return $html . "<div style='clear:both'></div>";
227 }
228
229 function wpforo_issues() {
230
231 $issues = [];
232 ##########################################################
233 //Usergroups//////////////////////////////////////////////
234 $guest_exists = WPF()->db->get_var( "SELECT `groupid` FROM `" . WPF()->tables->usergroups . "` WHERE `groupid` = 4" );
235 if( ! $guest_exists ) {
236 $issues['usergroup']['guest']['level'] = 3;
237 $issues['usergroup']['guest']['message'] = __( 'The default Guest usergroup is not found!', 'wpforo' );
238 $issues['usergroup']['guest']['solution'] = __( 'Please execute this SQL in your Website Hosting cPanel > phpMyAdmin Database Manager', 'wpforo' ) . ": <br><pre style='white-space: pre-line; word-break: break-all; color:#006600'>" . 'INSERT INTO `' . WPF()->tables->usergroups . '` (`groupid`, `name`, `cans`, `description`, `utitle`, `role`, `access`, `color`, `visible`, `secondary`) VALUES
239 (4, \'Guest\', \'a:32:{s:2:\"mf\";s:1:\"0\";s:2:\"ms\";s:1:\"0\";s:2:\"mt\";s:1:\"0\";s:2:\"mp\";s:1:\"0\";s:3:\"mth\";s:1:\"0\";s:2:\"vm\";s:1:\"0\";s:3:\"aum\";s:1:\"0\";s:2:\"em\";s:1:\"0\";s:3:\"vmg\";s:1:\"0\";s:3:\"aup\";s:1:\"0\";s:4:\"vmem\";s:1:\"1\";s:4:\"vprf\";s:1:\"1\";s:4:\"vpra\";s:1:\"1\";s:4:\"vprs\";s:1:\"0\";s:2:\"bm\";s:1:\"0\";s:2:\"dm\";s:1:\"0\";s:3:\"upa\";s:1:\"0\";s:3:\"ups\";s:1:\"0\";s:2:\"va\";s:1:\"1\";s:3:\"vmu\";s:1:\"0\";s:3:\"vmm\";s:1:\"0\";s:3:\"vmt\";s:1:\"1\";s:4:\"vmct\";s:1:\"1\";s:3:\"vmr\";s:1:\"1\";s:3:\"vmw\";s:1:\"0\";s:4:\"vmsn\";s:1:\"1\";s:4:\"vmrd\";s:1:\"1\";s:3:\"vml\";s:1:\"1\";s:3:\"vmo\";s:1:\"1\";s:3:\"vms\";s:1:\"1\";s:4:\"vmam\";s:1:\"1\";s:4:\"vwpm\";s:1:\"0\";}\', \'\', \'Guest\', \'\', \'read_only\', \'#222222\', 0, 0);
240 ' . "</pre>";
241 }
242
243 $perms = [];
244 $nonsec = [
245 'mf' => __( 'Dashboard - Manage Boards & Forums', 'wpforo' ),
246 'ms' => __( 'Dashboard - Manage Settings', 'wpforo' ),
247 'mt' => __( 'Dashboard - Manage Tools', 'wpforo' ),
248 'vm' => __( 'Dashboard - Manage Members', 'wpforo' ),
249 'aum' => __( 'Dashboard - Moderate Topics & Posts', 'wpforo' ),
250 'vmg' => __( 'Dashboard - Manage Usergroups', 'wpforo' ),
251 'mp' => __( 'Dashboard - Manage Phrases', 'wpforo' ),
252 'mth' => __( 'Dashboard - Manage Themes', 'wpforo' ),
253 'em' => __( 'Dashboard - Can edit member', 'wpforo' ),
254 'bm' => __( 'Dashboard - Can ban member', 'wpforo' ),
255 'dm' => __( 'Dashboard - Can delete member', 'wpforo' ),
256 'vmu' => __( 'Front - Can view member username', 'wpforo' ),
257 ];
258 $default_ug = WPF()->usergroup->default_groupid;
259 $default_ug_cans = WPF()->db->get_var( "SELECT `cans` FROM `" . WPF()->tables->usergroups . "` WHERE `groupid` = " . intval( $default_ug ) );
260 $default_ug_cans = unserialize( $default_ug_cans );
261 if( ! empty( $default_ug_cans ) ) {
262 foreach( $default_ug_cans as $key => $value ) {
263 if( wpfkey( $nonsec, $key ) && $value == 1 ) {
264 $perms[] = $nonsec[ $key ];
265 }
266 }
267 if( ! empty( $perms ) ) {
268 $cans = '<ul style="list-style:disc; margin:10px 20px; font-size:12px; line-height:14px;"><li>' . implode( '</li><li>', $perms ) . '</li></ul>';
269 $issues['usergroup']['default_perm']['level'] = 3;
270 $issues['usergroup']['default_perm']['message'] = __( 'New registered users get access to forum settings!', 'wpforo' );
271 $issues['usergroup']['default_perm']['solution'] = __( sprintf( 'Please navigate to Forums > Usergroups admin page, edit the "Default" usergroup (ID = %s) and uncheck/disable following permission(s):', $default_ug ), 'wpforo' ) . $cans;
272 }
273 }
274 #########################################################
275 //Plugin Conflicts///////////////////////////////////////
276 if( class_exists( 'autoptimizeCache' ) ) {
277 $autopt = get_option( 'autoptimize_js_exclude' );
278 if( $autopt && strpos( (string) $autopt, 'wp-includes/js/tinymce' ) === false ) {
279 $issues['conflicts']['autoptimize']['level'] = 3;
280 $issues['conflicts']['autoptimize']['message'] = __( 'Conflict with Autoptimize plugin!', 'wpforo' );
281 $issues['conflicts']['autoptimize']['solution'] = __( 'Please navigate to Settings > Autoptimize > Main Tab, click on top right [Show advanced settings] button, find "Exclude scripts from Autoptimize" option, add this JS path <code>,wp-includes/js/tinymce</code>, than click on [Save Changes and Empty Cache] button bellow.', 'wpforo' );
282 }
283 }
284 #########################################################
285 //Email Issues //////////////////////////////////////////
286 $subject = "Email Test";
287 $message = "This is a mail testing email function on server";
288 $send_to = apply_filters( 'wpforo_check_wp_mail_send_to', "test@example.com" );
289 $check_mail = apply_filters( 'wpforo_check_wp_mail', false );
290 if( $check_mail && ! wp_mail( $send_to, $subject, $message ) ) {
291 $issues['email']['wp_mail']['level'] = 3;
292 $issues['email']['wp_mail']['message'] = __( 'WordPress Email sending function wp_mail() doesn\'t work!', 'wpforo' );
293 $issues['email']['wp_mail']['solution'] = __( 'In most cases this is a server issue. We recommend you contact to your hosting service support team or open a support topic in wordpress.org support forum. Also there are many good articles regarding this issue in web. For example ', 'wpforo' ) . ' - <a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-not-sending-email-issue/">' . __( 'How to Fix WordPress Not Sending Email Issue', 'wpforo' ) . '</a>';
294 }
295 #########################################################
296 //Custom Template Files Detected ////////////////////////
297 if( is_dir(get_stylesheet_directory(). '/wpforo/' ) ){
298 $issues['theme']['custom_theme']['level'] = 1;
299 $issues['theme']['custom_theme']['message'] = "Potential Conflict with wpForo Template Files";
300 $issues['theme']['custom_theme']['solution'] = "Please make sure the <code style='color:red;'>/wpforo/</code> folder in the current WordPress active theme directory contains wpForo v2.0 template files. If the template files have been moved to this folder from the old v1.x version you should delete them to avoid lots of errors and problems on the forum front-end. You can use an FTP client or the File Manager of your Hosting cPanel to rename or remove the <code style='color:red;'>/wpforo/</code> folder from <code style='color:blue;'>/wp-content/themes/" . basename((string) get_stylesheet_directory()) . "</code> directory";
301 }
302
303 #########################################################
304 //Check Rewrite Rules ////////////////////////
305 if( $pageid = WPF()->board->get_current( 'pageid' ) ){
306 $rr_issue = [];
307 if( $rewrite_rules = get_option('rewrite_rules') ){
308 $rules = [ ')?' . wpforo_settings_get_slug('member') . '(?',
309 ')?sign-out(?',
310 ')?' . wpforo_settings_get_slug('lostpassword') . '(?',
311 ')?' . wpforo_settings_get_slug('login') . '(?',
312 ')?' . wpforo_settings_get_slug('register') . '(?',
313 ')?' . wpforo_settings_get_slug('members') . '(?',
314 ')?' . WPF()->board->get_current( 'slug' ) . '(?'
315 ];
316 foreach( $rewrite_rules as $r_key => $r_value ){
317 $r_key = stripslashes((string) $r_key);
318 foreach( $rules as $rule ){
319 if( strpos( $r_key, $rule ) !== FALSE ){
320 if( strpos( (string) $r_value, '&page_id=' ) !== FALSE
321 && strpos( (string) $r_value, '&page_id=' . $pageid ) === FALSE
322 ) {
323 $rr_issue[] = '<li style="list-style: disc; margin: 0 20px;">' . $r_key . ' &nbsp;|&nbsp; ' . $r_value . '<li>';
324 }
325 }
326 }
327
328 if($rr_issue){
329 $admin_page = ( is_wpforo_multiboard() ) ? 'wpForo > Dashbaord admin page' : 'wpForo > Overview admin page, scroll down';
330 $issues['pages']['rewrite_rules']['level'] = 3;
331 $issues['pages']['rewrite_rules']['message'] = "Action Required!<br>Some forum pages may be not accessible";
332 $issues['pages']['rewrite_rules']['solution'] = "wpForo detected wrong rewrite rules, please navigate to $admin_page, click the [Soft Flush Permalinks] button, if the issue is not fixed, please click the [Hard Flush Permalinks] button. <br /><br /> Wrong revrite rules (current pageid is " . $pageid . "): <ul style='margin: 0;'>" . implode('', $rr_issue) . "</ul>";
333 }
334 }
335 }
336 } else {
337 $issues['board']['page']['level'] = 3;
338 $issues['board']['page']['message'] = "wpForo Base Page is Not Found";
339 $issues['board']['page']['solution'] = "Please check pageid column in the list of boards in wpForo > Boards admin page and make sure this board is connected to a page with [wpforo] shortcode. The documentation: " . "<a href='https://wpforo.com/docs/wpforo-v2/categories-and-forums/forum-boards/' target='_blank'>boards and forum page</a>";
340 }
341
342 #########################################################
343 //Other Issues //////////////////////////////////////////
344 $phrases = WPF()->db->get_var( "SELECT COUNT(*) FROM `" . WPF()->tables->phrases . "`" );
345 if( ! $phrases ) {
346 $issues['other']['empty_phrase_table']['level'] = 3;
347 $issues['other']['empty_phrase_table']['message'] = __( 'wpForo phrases are missing!', 'wpforo' );
348 $issues['other']['empty_phrase_table']['solution'] = __( 'Please navigate to wpForo > Overview admin page and click the [Rebuild Phrases] button', 'wpforo');
349 }
350
351 echo '<table class="wpf-table-data" style="margin: 10px; width: 98%;">';
352 if( ! empty( $issues ) ) {
353 foreach( $issues as $key => $issue ) {
354 if( ! empty( $issue ) ) {
355 echo '<tr><td colspan="6" style="background:#d86868; color: #ffffff;font-size:14px; line-height:26px"><b>' . strtoupper( (string) $key ) . '</b></td></tr>';
356 foreach( $issue as $data ) {
357 echo '<tr>';
358 echo '<td class="wpf-ilevel-' . intval( $data['level'] ) . '" style="vertical-align: top;width:25%; font-size:15px; padding:10px; line-height: 22px;">' . $data['message'] . '</td>';
359 echo '<td style="vertical-align: top;font-size:13px;line-height:20px;padding:10px;">' . $data['solution'] . '</td>';
360 echo '</tr>';
361 }
362 }
363 }
364 } else {
365 echo '<tr><td><p>&nbsp;&nbsp;&nbsp;' . __( 'No issues found', 'wpforo' ) . '<p></td></tr>';
366 }
367 echo '</table>';
368 }
369
370 function wpforo_read_file_revers( $file ) {
371 $result = [];
372 $numRows = 100;
373 $handle = fopen( $file, "r" );
374 while( ! feof( $handle ) ) {
375 array_push( $result, fgets( $handle, 4096 ) );
376 if( count( $result ) > $numRows ) array_shift( $result );
377 }
378 $result = array_filter( $result );
379 $result = array_reverse( $result );
380 if( ! empty( $result ) ) {
381 echo '<h3 style="padding:5px 20px;">' . __( 'Error Log File', 'wpforo' ) . ': <code style="font-size:14px;">' . $file . '</code><h3>';
382 echo '<ul style="list-style:disc; margin:20px 30px;">';
383 foreach( $result as $error ) {
384 echo '<li style="border-bottom:1px dotted #cccccc; font-size:12px;line-height:16px; padding:0px 0px 3px 0px">' . $error . '</li>';
385 }
386 echo '</ul>';
387 } else {
388 echo '<p>' . __( 'No errors found', 'wpforo' ) . '</p>';
389 }
390
391 }
392