• The plugin is very useful, however there are a few formatting items:

    1. The table is a little wide in the widget and runs up against the postbox.

    2. The item list is ordered so that you have to scroll all the way down to see the latest messages.

    3. There’s no title on the table.

    I’ve made the following changes to DashboardWidget.php for each:

    1. Updated line 60 as follows (added the 95% width style):

    '<tr style="width: 95%%;"%s><td style="white-space:nowrap;">%s</td><td>%s</td></tr>',

    2. Add the following line after line 45 which inverts the sort order:

    $lines = array_reverse( $lines );

    3. Replace line 51/52 with the following:

    echo '<table class="widefat">';
    echo '<thead><tr style="width: 95%%;"%s><th style="white-space:nowrap;">Date/Time</th><th>Message</th></tr></thead>';
    $isOddRow = false;
    echo '<tbody>';

    Another suggestion would be to have the PHP error log file name in the widget as a link that would download the log file.

    https://www.ads-software.com/plugins/error-log-monitor/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    2. The item list is ordered so that you have to scroll all the way down to see the latest messages.

    I’ll add that as an option in the next release. Personally, I prefer to keep the original line order since logs sometimes include multi-line messages.

    The table is a little wide in the widget and runs up against the postbox.

    That’s a known issue. Unfortunately, the suggested patch doesn’t seem to work. If one of the log entries is long enough and the browser can’t wrap it properly, the table still gets too wide to fit in the widget.

    As far as I can tell, the only reliable way to force a table to stick to a certain width is to set table-layout: fixed. This, however, introduces other problems like both columns being 50% wide by default. Perhaps setting the timestamp column to a fixed width would work.

    3. There’s no title on the table.

    What would be the benefits of adding a title to this particular table?

    Another suggestion would be to have the PHP error log file name in the widget as a link that would download the log file.

    I’ll add that to the long term to-do list.

    Thread Starter Greg Ross

    (@gregross)

    An optional list order would be great.

    There should be a way to force the wrapping of long lines, I’ll take a second look at it.

    Tables should always have titles ??

    Plugin Author Janis Elsts

    (@whiteshadow)

    Tables should always have titles ??

    I agree in general, but this table is pretty self-explanatory. Anyone who’s looked at a log file before can probably tell what the columns are.

    Thread Starter Greg Ross

    (@gregross)

    True, but I attended a wordcamp a while ago and sat in on an accessibility talk and they made a good point, screen readers often need context to make sense for those whole rely on non visual cues.

    It stuck with me… not a big deal either way though.

    Thread Starter Greg Ross

    (@gregross)

    I couldn’t convince the table to wrap properly so I simply replaced it with div’s, replace line 52 all the way to the <p> in DashboardWidget.php with:

    foreach ($lines as $line) {
    	printf(
    		'<div style="font-size: 14pt; margin-bottom: 5px;">%s</div><div style="margin-bottom: 15px;">%s</div>',
    		!empty($line['timestamp']) ? $this->plugin->formatTimestamp($line['timestamp']) : '',
    		esc_html($line['message'])
    	);
    }
    
    echo '<p>';
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Suggestions/patch’ is closed to new replies.