Debugbar by kevdev

Debugbar by kevdev
A small tool that will help you debug your site.

Main advantages:
- Light
- Relatively easy to install
- Changes only 3 files (header.php, loader.php, db.php)
- Very informative
- It works only if there is an active admin session
- Ability to switch between the last 10 requests

Disadvantages:
- The module was tested only on clean Opencart and OcStore 3rd version, there is no information about conflicts with templates, modules, etc. (but since there is not much code, there should not be any)
- Calculation of the execution time of requests in the database is not real, the difference in time before and after the start of the request is calculated.

Details:
- Longest - display of all requests in the database sorted by approximate execution time (I emphasize that it is precisely by approximate time, not exact time)
- Duplicates - collects all duplicate requests in the database
- Queries - display of all requests according to the actual order of execution, and with the display of traces
- Controllers - display of all controllers that participated in displaying the page
- Models - display of all models that participated in the display of the page
- Views - display of all templates that took part in displaying the page
- Languages - display of all localization files that took part in displaying the page
- Data - a complete array of data that was transferred to the final template

Installation:
- I recommend starting with a backup of the system folder
- install the debugbar.ocmod.zip module through the admin panel
- update the modifiers
- open the system/framework.php file and enter some code:

First, we look for a term with the code:

$registry->set('log', $log)

And after it, write the following code:

if(file_exists(DIR_SYSTEM . 'library/debugbar.php')){ require_once(DIR_SYSTEM . 'library/debugbar.php'); $debugbar = new Debugbar($config); }else{ $debugbar = null; } $registry->set('debugbar', $debugbar);

Next, we look for a term with the code:

$db = new DB($config->get('db_engine'), $config->get('db_hostname'), $config->get('db_username'), $config->get('db_password'), $config->get('db_database'), $config->get('db_port'));

And replace it with:

$db = new DB($config->get('db_engine'), $config->get('db_hostname'), $config->get('db_username'), $config->get('db_password'), $config->get('db_database'), $config->get('db_port'), $debugbar);

And the last step, we are looking for a deadline:

$response->output();

And before it, write the following code:

if(!is_null($debugbar)){ $debugbar->end($registry); }

That's all! Another instruction would be in plugin archive.

DEMO




Download
  • Developed by OpenCart Community
  • Documentation Included

Rating

Compatibility
3.0.0.0, 3.0.1.1, 3.0.1.2, 3.0.2.0, 3.0.3.0, 3.0.3.1, 3.0.3.2, 3.0.3.3, 3.0.3.5, 3.0.3.6, 3.0.3.7, 3.0.3.8, 3.0.3.9

Last Update
5 Nov 2023

Created
5 Nov 2023
52 Downloads
0 Comments
kevdev
kevdev
Member since: 28 Mar 2023

View all extensions Get Support