Plugins to debug, profile & log errors

Plugins to debug, profile & log errors

By profile, I mean - measure performance.

There is a good overview of available tools.

Xenu Link Sleuth and other 7 things you can do with Xenu.

Other desktop tools are:

I also used desktop site downloaders like Teleport Ultra

Online tools

The most beautiful is W3C official online tool called W3C Link Checker available here.

There is also an ancient looking Dead Link Checker.

Wordpress plugins

There is also a very good Wordpress plugin Broken Link Checker that examines database and detects broken links. It can be time consuming, but it clearly shows you if broken links are from WP posts. Broken Link Checker for WordPress | W-Shadow.com

404 logs & redirects

I am using a simple plugin called 404 Error Logger that logs all 404 errors on site.

There is more advanced Redirector plugin that does that same thing plus a lot more about redirecting links.


Log warnings & errors

WP Error Fix WP Error Fix: Track Plugins & Themes Errors in WordPress | WP Solver

We need to /wp-content/plugins/wp-error-fix/application/Service/Model/rest.php line 58 to $response->status = 'success';

Debug

WPEngine (should be experts in speed) recommend for development: Debug Objects now defunct, and Query Monitor

For most of the following plug-ins, besides setting WP_DEBUG we also must set define('SAVEQUERIES', true); in wp-config.php.

Query Monitor with repo at johnbillion/query-monitor and a site at querymonitor.com is an essential plugin for development, particularly for projects that are database intensive.

After successful installation, don’t forget to check the symlink of db.php. It should be done automatically and can be forced with plugin deactivation and reactivation, with the disabled option Database Cache in W3TC__. Manually, you can do it with ln -s wp-content/plugins/query-monitor/wp-content/db.php wp-content/db.php from the WP folder.

I suggest you immediately Set an authentication cookie to access the plugin when not logged in.

How to Silencing Errors from Certain Plugins and Themes in Query Monitor – Query Monitor

  • Debug Bar did not impress me. Everything it does, Query Monitor does better. Despite of that, it seems it has a lot of free extensions: Debug Bar and Add-Ons

    [Debug Bar Slow Actions is a really useful add-on that records timing spent on Actions/Filters. In slows down the site considerably so should be disabled in production environment.

    Note: This interesting add-on conflicts with another plugin - Debug Objects.

    Another add-on, Debug Bar Console adds a PHP/MySQL console to the debug bar.

  • Debug Objects is defunct now but was very interesting, and different. It had a lot of useful things for front-end development, but its interface was outdated.

    Enable the following, interesting options:

    • Chromephp and install the browser extension Chrome Logger
    • Db Query
    • HTML Inspector is perfect as markup quality tool but I believe there are better plugins for that
    • Cache shows the contents of the cache

    How to Debug Performance Problems

Discovering Slow Database Queries

Try installing the WP-CLI package wp package install runcommand/query-debug created by the creator of WP-CLI himself, Daniel Bachhuber, or the package wp-cli/profile-command. After installation, you will be able to use the interesting commands wp profile stage and wp query-debug, which can assist you in identifying slow database queries and improving performance.

Identifying Bottleneck Plugins članak ustvari sadrži dosta koristan script da otrkiješ koji je plugin najsporiji.


Simpler Query Monitor alternative:

UsageDD


Debug plugins BlackBox Debug Bar for WordPress: Track Queries & Errors | WP Solver

Abandoned and depreciated plugins

Articles: 6 WordPress Plugins for Debugging 5 Must See Query Monitors for WordPress


Savršen plugin je ovo, i ne meša se sa WP_DEBUG odnosno radi i bez toga. Ujedno, lepo se

Radi korektno ali mislim da ne ume

Ali ovo me je spaslo: disable-deprecation-notice-logging.php


Development plugins:

WP Page Load Stats

MySQL Monitor PHP/MySQL CPU performance statistics Diagnosis


Show page & post info

show current template, which template, what template

Od sve gomile, samo ova dva rade očekivano, a ja ću koristitit “TempTool”.

TempTool [Show Current Template Info] radi odlično za blok teme i pravilno prikazuje i template parts, a ima i podatak “Load Time” koji je posebno koristan.

What The File odlično radi, baš kao i TempTool, a informacije prikazuje u desnom uglu admin-bar-a.

Show Template Name sa repo na bubuku/show-template-name radi sa Block themama i dodaje kolonu “Template” u post list view što omogućava filtriranje po templates.

Sledeći ne rade adekvatno u blok temama, pa ih preskoči:

Reveal Template lets you view which template file is being used to display the current page, and is published by author I like, daje neke vrlo korisna podešavanja da promeniš, ali nažalost za blok teme daje premalo informacija.

What Template File Am I Viewing? takođe samo najosnovnije što mi nije dovoljno.

Show Current Template je dosta popularan, ali ne radi when using the Block theme, only in Classic themes.

What Template prikazuje praktično ništa kada su u pitanju blok teme

What Template Am I Using ne radi u block temama.

A ovi su jednostavno napušteni:

Helpful Information nije više održavan ali je bio very useful plugin to prikaz osnovnih informacija među kojima je i template ali i scripts, styles, includes, post type.


WordPress plugin for whoops Rarst/wps · GitHub whoops is a nice little library that helps you develop and maintain your projects better whoops! - php errors for cool kids

Another one: WordPress › Pretty PHP Error Pages

Woops has an alternative: kktsvetkov/krumo: Krumo: Structured information display solution for PHP PHP Debug Bar with repo at maximebf/php-debugbar: Debug bar for PHP

raulfraile/ladybug: PHP 5.3+ Extensible Dumper


Log Errors into Console

Log server-side messages in browser’s developer console.

Tracy

Tracy | nette/tracy looks amazing and very active.

Has Wordpress plugin: WP Tracy | hlavacm/WP-Tracy

Chrome Logger

Chrome Logger - Server side application debugging

Most languages include their own logging capabilities, but sometimes it is easier to see your logs right in the browser. Chrome Logger is an open protocol. Chrome Logger used to be known as ChromePHP.

Chrome Logger

And in firefox: Console messages — Firefox Source Docs documentation ChromeLogger | burningmoth/burningmoth-chromelogger-firefox

PHPDebugConsole nije još umro na repo bkdotcom/PHPDebugConsole

Alternatives that are defunct by now


When you need to debug

Code adds a backtrace to PHP errors in gist

Get the gist:

wget https://gist.githubusercontent.com/jrfnl/5925642/raw/684479612fbf6d81cd440205f779ee25d3957710/wp-config-debug.php

Add this at the end of wp-config.php:

require_once(ABSPATH . 'wp-config-debug.php');

Improve debug.log Developer Experience

  1. WP Debugging: Toggle + Tailing

Plugin: Toggle WP_DEBUG + Tailing

The WP Debugging plugin, available at the repository afragen/wp-debugging, already utilizes the robust norcross/debug-quick-look library for debugging purposes. Additionally, the plugin incorporates the wp-cli/wp-config-transformer library to edit the wp-config.php file. Iako pregled log fajla izgleda čudno, on je najbolji od svih za velike fajlove.

The WP Debug Log - Config Tool plugin, available at the repository nkb-bd/wp-debug-log-config-tool, also utilizes the wp-cli/wp-config-transformer library for its operations but in my instance it did not work at all. Izgleda vrlo lepo, ali je kod većih log-ova prikaz baš spor, dok je samo podešavanje odlično. Može da očisti log ali nema automatski clean.

Debug is a quick way to modify the wp-config.php file i služi da izmeni wp-config.php ali ima i prikazivanje debug.log fajla kao i clear-ovanje log-a, međutim nema periodični log-clear. Pošto ne koristi nikakav library već na divlje menja wp-config, nisam siguran koliko da imam poverenja, ali se pokazalo i da onaj govnjivi library pravi svinjac.

WP_DEBUG Toggle plugin would be quite useful if it weren’t for its hasty coding. Specifically, it only performs a search-and-replace operation through the wp-config.php file, changing only the WP_DEBUG constant, and no others. This is poorly executed for a few reasons, the primary of which being that it does not comprehend whether the line containing the constant is commented out or not. Furthermore, it does not use an AJAX call, meaning that changes to the variable are only displayed on the screen after a refresh, which is often nonsensical. By the way, to start the toggle action for WP_DEBUG, one must click on the Admin Bar indicator in the upper right corner, which cannot be removed and serves as an unnecessary eyesore.

Conflict Finder mi se baš sviđa jer možeš da toggle sve pluginove a osim toga da setuje WP_DEBUG ili tailuje Debug Log. Odličan!

Plugin: Tailing Log Viewer

Pošto smatram da niko ne sme da mi čačka po wp-config.php, mnogi odavde otpadaju.

The Debug Log Manager plugin, available at the repository qriouslad/debug-log-manager, is a very nice plugin created by a revered author of plugin Admin and Site Enhancements. It offers the ability to toggle WP_DEBUG, rename the debug.log file (sadly, mandatory), and act as a log file viewer that can parse, filter, and search records. Additionally, it provides an auto-refresh feature (aka “tailing”) that eliminates the need to manually reload the browser tab or use tail -f. The plugin also includes the functionality to clear the log file. The plugin also utilizes the wp-cli/wp-config-transformer library to edit the wp-config.php file. Also inserts a nice Dashboard widget. Nemam pojma gde šta upisuje, ali sa njim kada seliš sajt to je prava agonija. Jednostavno, ako ga ugasiš - on zajebe config fajl.

The brasofilo/view-debug-log) plugin appears to be quite rudimentary and therefore not particularly noteworthy or worth testing.

WP Log Viewer is polished log viewer with included feature to toggle WP_DEBUG.

Error Log Viewer By WP Guru is a new and potentially the best plugin for error log viewing. Initially, I thought it wasn’t working because it wasn’t displaying anything, but it turns out that the reason was that it doesn’t play well if I had already enabled WP_DEBUG in my wp-config.php file. Once I removed my directives, it worked fine. I’m not sure why it changes the location of log files and stores them in the uploads folder. As for usability, I just don’t like the location of the admin menu, but the functionality is decent, and it nicely categorizes log messages. Insistira na tome da pomeri log u /wp-content/uploads/error-log-viewer-wp/ pa ga neću zato koristiti.

error_log File Viewer makes an attempt to load the error_log file from site root folder, which does not exist in WordPress by default. This plugin does not check log file location in any way. It is quite amateurishly written and it is advised not to waste any more time on it.


Plugin: Log File Maintenance

Change Debug Log Location to rename and move file ali na PHP8 nije mogao ni da se aktivira.

LH Clear Debug Log by Cron is, in fact, a highly useful plugin that autonomously clears the debug.log file when it exceeds the specified maximum size. Proverio sam u kodu i pravilno otkriva putanju debug.log fajla poštujući sve moguće izmene od strane ostalih pluginova. Jedino podešavanje je max file size aka threshold that is by default 4194304 bytes (4 MB) and it can be changed by using filter lh_del_dlog_cron_size_threshold.


Function wp_debug_mode() is defined inside wp-includes/load.php, it is called only once in wp-settings.php. It doesn’t do anything special.

Still, it is impossible to override it from wp-config.php as it always sets some value. The only way to change error_reporting is inside mu-plugins folder.

How can I stop PHP notices from appearing in wordpress? - Stack Overflow PHP error_reporting Predefined Constants


error.log as “not-the-same-as-debug-log”

Error Log Monitor is a regularly updated plugin that works inside the “Dashboard > PHP Error Log” widget. It also has the ability to clear logs, send periodic email notifications of errors, and is optimized to work with very large log files. Obična glupost koja se vidi samo u Dashboard a uspeo je već da doda Freemius i da napravi Pro plaćenu verziju od toga.


Freemius/wordpress-menu-slugs-plugin is a simple yet effective idea. This plugin named “Freemius Menu Slugger” displays the admin menu slugs, which is essential when making changes to the Admin menu. Take a look at the screenshot to understand just how handy this plugin is.


Oficijalni plugin Developer nije davno ažuriran Automattic/developer a služi samo da automatski instalira i recommenduje neke pluginove.


The Code Quality Control Tool displays the debug_log in various ways, which I find quite useful. It allows you to specify which warnings to keep and which ones to ignore, based on the plugins or themes from which to display warnings. It generates a file /wp-content/_php_errors.log along with a few others in the same location, all starting with wp-content/_php_*. However, what really bothers me is that it seems poorly written and interferes with set_error_handler, interrupting it and not passing it to any other handler. This means that no other plugin with a similar purpose will work anymore. After an unsuccessful attempt to use it, it turned out to be very confusing and problematic, without being able to pinpoint where and how - so, unfortunately, NEVER install it again, anywhere - unless you want to steal ideas for your own plugin. The author seriously messed things up!


Razne ideje koje imaju nekakve veze sa debug log

Custom Error Log ima i prastari repo od danbahrami/custom-error-log: A Wordpress plugin that allows developers to log custom errors for debugging purposes. ali služi u sasvim drugu svrhu, odnosno kreira paralelni log sistem koji možeš pregledati. Možda i može da bude upotrebljivo.


DecaLog je super-kvalitetan plugin sa repo na Pierre-Lannoy/wp-decalog: Capture and log events, metrics and traces on your site. Make WordPress observable - finally!, DecaLog kao deo suite PerfOps One a suite of free and open source. Plugin omogućuje Capture and log events, metrics and traces on your site, na razne destinations koje uključuju i Browser Console (without any extensions), PHP Error Log, ChromePHP, Google Analytics, remote or local Syslog, Slack, Prometheus (open-source), Tracy (open-source PHP logging), etc.

Full list of services from DecaLog page: WordPress, Google Analytics, Spatie Ray, Zipkin, Tracy, PHP Error Log, Syslog, Pushover, Elastic Cloud, ChromePHP, Grafana Cloud, Google Cloud Logging, Jaeger, Sematext, Datadog, Raygun, InfluxDB 2, Loki, Tempo, Bugsnag, WordPress Mail, Elasticsearch, Rotating Files, Slack, Sumo Logic, Loggly, Logentries & insightOps, Fluentd, Prometheus, Browser Console, New Relic debugger eval code:1:9


Ultimate DebugBar – WordPress plugin | WordPress.org

date 21. Dec 2016 | modified 17. Aug 2024
filename: Plugins » Debug » Log