PHP Error Log Viewer for ClassicPress
The PHP Error Log Viewer plugin for ClassicPress brings your error log straight into your dashboard. Color-coding helps you to quickly scan even the longest of error logs. Or, just filter out the errors you don't want to see. No more wall-of-text error messages – this plugin turns your PHP error log into an incredibly useful display.
Fast, Lightweight, and User-Friendly
There are lots of debugging plugins out there – debugging suites, really. This plugin isn't intended to become one of them. The PHP Error Log Viewer plugin handles a very specific task and that is to display the PHP error log in a user-friendly, human-readable format that can be easily filtered.
More Debugging, Less Clicking
If you have grown tired of flipping back and forth between screens/browsers/apps/whatever to check and recheck your PHP error log as you're writing code, this will be incredibly handy for you. There's a link to the error log within reach at all times and it doesn't require any special configuration.
Screenshots
Frequently Asked Questions
My error log is huge…can the plugin handle it?
The plugin has been successfully tested with error logs up to 20Mb (100,000+ entries). With an error log that huge, it took about 15 seconds to finish rendering the (stylized) error log on the screen. However, for error logs with tens of thousands of entries (or less,) it only takes a second or two. Of course, your results will vary with your server configuration.Why don’t I see the purge button?
If your error log is not writable by the web server, thePurge Error Log
button will not appear in the interface.How big should my error log be?
You should always aim to run a site that produces no notices, warnings, or errors. Your target file size for the error log should be exactly0 bytes
.How can I change the error colors?
See the Styling section for specific details.Why are there sometimes more errors than stack traces?
While many errors do produce a stack trace, some do not. This is the reason for the difference.My error log wasn’t found? What now?
If your error log isn’t automatically detected by the plugin, you will see a screen that offers three possible solutions. Most likely, one of the solutions will work for you.
Changelog
2.1.0 | 2020-03-19
2.0.1 | 2020-02-14
- Fix undefined index
reverse_sort
; issue #12.
- Fix undefined index
2.0.0 | 2020-02-13
- Fix assets not loaded in certain edge-case scenarios; issue #1.
- Fix link to error log showing to all users; issue #2.
- Add error count alert bubbles to admin bar; issue #3.
- Update labels used in the repository; issue #4.
- Improve inline documentation for error screen; issue #5.
- Add buttons for refresh/purge at the end of longer logs; issue #6.
- Fix untranslatable texts in skip links; issue #7.
- Add reverse sorting to the display; issue #8.
- Add visual indicators to better group option menu items; issue #9.
- Remove counts from stack trace checkbox; issue #10.
- Remove vendor prefix from admin URL; issue #11.
1.3.0 | 2020-01-06
- Add alt/title to admin bar menu item which reveals current PHP version.
1.2.0 | 2019-12-24
- Remove fx-updater client.
- Add Update Manager client.
- Fix footer text not returned in all instances.
1.1.0 | 2019-10-28
- Fix plugin header to reflect correct text domain.
- Add quicklink to admin bar for faster access to the error log on both front and back end.
1.0.1 | 2019-08-17
- Fix issue that produces error message, "The plugin does not have a valid header"
1.0.0 | 2019-08-16
- Initial release.
License
The PHP Error Log Viewer plugin is released under the General Public License.
Installation Requirements
- ClassicPress 1.0.0 or later
- PHP 5.6 or later
Manual Installation
- Download the zip file to your local computer
- Login to your ClassicPress website.
- Navigate to
Dashboard > Plugins > Add New > Upload Plugin
- Upload the plugin zip file to your site
- Click to
Install
the plugin - Click to
Activate
the plugin - See the documentation for next steps
Standard Installation
- Login to your ClassicPress website.
- Navigate to
Dashboard > Plugins > Add New
- Search for
Code Potent
orPHP Error Log Viewer
- Find the
PHP Error Log Viewer
plugin in the results - Click to
Install
the plugin - Click to
Activate
the plugin - See the documentation for next steps
Note: This method will be available when the official ClassicPress plugin directory is ready.
Checksums – Coming Soon
Checksums allow you to verify the integrity of the plugin file.
Conflicts
There are no reported conflicts between the PHP Error Log Viewer plugin and other ClassicPress plugins or themes. If you experience something unexpected, please send an email!
Usage
Viewing the Error Log
Click the PHP Errors
menu item in your admin bar. Hover the menu item momentarily and it will reveal your current PHP version. Alternatively, you can access the error log by navigating to Dashboard > Tools > PHP Error Log
.
Filtering the Error Log
The checkboxes across the top of the display allow you to show and hide each of the various types of errors: Deprecated
, Notice
, Warning
, Error
, and Other
. There are also checkboxes to show and hide the time/date, stack traces, and to sort the error log in reverse. Tick your preferred boxes and click the Apply Filters
button to update the display.
Refreshing the Error Log
When viewing the error log, you will find a button to Refresh Error Log
at the right side of the page. Clicking this button has the same effect as clicking your browser’s refresh button. The error log will be re-read and displayed fresh.
Purging the Error Log
When viewing the error log, you will find a button to Purge Error Log
at the right side of the page. Clicking this button will purge all messages from the error log. A confirmation dialog prevents accidental deletion. If your error log is not writable by the PHP process, you will not see this button.
Settings
Display Options
The checkboxes at the top of the error log display allow you to choose which types of error messages you want to see. Check any of the boxes and click the Apply Filter
button to update the display.
- Date/Time
Check this box to show dates, times, and other meta data. - Notice
Check this box to show non-critical PHP notices. - Warning
Check this box to show non-critical PHP warnings. - Error
Check this box to show critical PHP errors. - Other
Check this box to show any other errors that didn’t meet the above criteria. - Show Stack Traces
Check this box to show stack traces for critical errors. Note that not all critical errors will generate a stack trace. - Reverse Sort
Check this box to display the error log with latest errors at the top.
Filters
Primary Alert Bubble
This filter allows you to hide or redesign the primary (red) alert bubble in the admin bar. This filter accepts a single argument, the markup of the primary alert bubble.
function yourprefix_hide_primary_alert($alert) { return ''; } add_filter('codepotent_php_errror_log_viewer_primary_alert', 'yourprefix_hide_primary_alert');
Secondary Alert Bubble
This filter will allow you to hide or redesign the secondary (gray) alert bubble in the admin bar. This filter accepts a single argument, the markup of the secondary alert bubble.
function yourprefix_hide_secondary_alert($alert) { return ''; } add_filter('codepotent_php_errror_log_viewer_primary_alert', 'yourprefix_hide_secondary_alert');
Add Content Before Legend
In cases where you need to insert some contextual information, either of the following filters can be used to place the content before or after the legend. These filters receive an empty string as an argument.
function yourprefix_before_error_log_legend($markup) { $markup = '<p>This content appears before the legend.</p>'; return $markup; } add_filter('codepotent_php_errror_log_viewer_before_legend', 'yourprefix_before_error_log_legend');
Add Content After Legend
Identical to the filter above, except this filter places your contextual content below the legend.
function yourprefix_after_error_log_legend($markup) { $markup = '<p>This content appears after the legend.</p>'; return $markup; } add_filter('codepotent_php_errror_log_viewer_after_legend', 'yourprefix_after_error_log_legend');
Styling
Using Custom Error Colors
To override the color-coding for the error messages and legend, copy the following styles into your theme's style.css
file and make your changes there.
/* Deprecated code. */ #codepotent-php-error-log-viewer .php-deprecated, .codepotent-php-error-log-viewer-legend-box.item-php-deprecated { border-left:10px solid #847545; } /* Notices. */ #codepotent-php-error-log-viewer .php-notice, .codepotent-php-error-log-viewer-legend-box.item-php-notice { border-left:10px solid #ccc; } /* Warnings. */ #codepotent-php-error-log-viewer .php-warning, .codepotent-php-error-log-viewer-legend-box.item-php-warning { border-left:10px solid #ffee58; } /* Errors. */ #codepotent-php-error-log-viewer .php-error, .codepotent-php-error-log-viewer-legend-box.item-php-error { border-left:10px solid #e53935; } /* Stack traces. */ #codepotent-php-error-log-viewer .php-stack-trace-title, #codepotent-php-error-log-viewer .php-stack-trace-step, #codepotent-php-error-log-viewer .php-stack-trace-origin, .codepotent-php-error-log-viewer-legend-box.item-php-stack-trace-title { border-left:10px solid #ef9a9a; } /* Any other messages. */ #codepotent-php-error-log-viewer .php-other, .codepotent-php-error-log-viewer-legend-box.item-php-other { border-left:10px solid #00bcd4; }
Share Your Experience
Had a great experience with the PHP Error Log Viewer plugin for ClassicPress? Share your thoughts and get a link back to your site! Emails are not shared or published.