Giter Club home page Giter Club logo

ee_debug_toolbar's Introduction

Debug Toolbar

The complete debugging platform for ExpressionEngine. Adds an unobtrusive interface for debugging output on an ExpressionEngine 7.0 site. Replaces default Profiler and Template Debugger provided with ExpressionEngine.

Features

In addition to what the ExpressionEngine Profiler offers, the Debug Toolbar also offers:

Extensible interface for project debug tools

Create custom extensions to expand on debugging capabilities.

Disable and/or Log Email

The Toolbar can be configured to override email delivery, so long as the native ExpressionEngine email service is used, and log the contents to files for easy debugging and quality control.

Custom Error Handler

Control exactly which PHP errors you want to display and log each and every PHP error within every ExpressionEngine request.

View Logs

The Log Panel (included) allows for reading complete log files from within your ExpressionEngine workflow.

Performance Alerts

The Toolbar can be configured for the thresholds to determine when and which SQL query and/or template parse becomes problematic.

Debug Mode for Guests

The Toolbar can be configured to display Debug details to any Member Role(s) you want to. Super Admin no longer required.

Performance Graph

Get a visual heads up on where exactly performance is an issue on all Front End requests.

image

Requirements

  1. ExpressionEngine >= 7.4
  2. PHP >= 7.4
  3. Extensions Enabled

Installation for ExpressionEngine <= 7.3.15

You'll have to manually add the below hook call to ExpressionEngine:

system/ee/legacy/core/Output.php:276 within the _display() method.

if (ee()->extensions->active_hook('before_response_send_output') === true) {
    $output = ee()->extensions->call('before_response_send_output', $output);
    if (ee()->extensions->end_script === true) {
	return;
    }
}

ee_debug_toolbar's People

Contributors

ckimrie avatar leevigraham avatar matthewjohns0n avatar mithra62 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ee_debug_toolbar's Issues

PHP Errors

I uploaded the files and went into Extensions to enable and got the following errors:

A PHP Error was encountered

Severity: Warning

Message: dir() [function.dir]: URL file-access is disabled in the server configuration

Filename: libraries/Toolbar.php

Line Number: 239

A PHP Error was encountered

Severity: Warning

Message: dir(http://DOMAIN/themes/third_party//third_party/ee_debug_toolbar/themes/) [function.dir]: failed to open dir: no suitable wrapper could be found

Filename: libraries/Toolbar.php

Line Number: 239

Fatal error: Call to a member function read() on a non-object in /var/www/web241/html/DOMAIN/SYSTEM/expressionengine/third_party/ee_debug_toolbar/libraries/Toolbar.php on line 242

Warnings and Alerts

What do you think about adding some sort of visual indicator as to how the site performs? For example, a site that takes XX seconds to execute and XX MBs of memory obviously isn't good so let's make the toolbar flash or have a sticky color or whatever if certain thresholds were/are met.

Should be possible to do this at the theme level but having a global option, done with PHP, would be incredibly easier and likely very efficient (just comparing values really).

PHP Error, Severity: Warning. simplexml-load-string, Line 408

Just downloaded and installed on local MAMP install.

Toolbar appears, and provides info (i.e, version numbers, number of files, ram readouts, time, etc.) When clicking any item with the popup that displays more information, all items receive an error message to this effect:

A PHP Error was encountered
Severity: Warning
Message: simplexml_load_string() [function.simplexml-load-string]:
(then some specific error)
Filename: ee_debug_toolbar/ext.ee_debug_toolbar.php
Line Number: 408

I'm using EE 2.5.3, PHP Version 5.2.11

css display issue

I use a css reset in some sites. It was affecting the debug bar display.

I added this to the ee_debug_toolbar css:

EEDebug_debug img{

display: inline;

}

and the error was gone, I suggest to add it to the repo.

Excellent work, really inspired on symfony 2 toolbar =) , but anyway, ultra amazing and really helpful. Thanks a lot for making it open source.

z-index Increase

Yes. Let's. Something absurd too, like 100000000000 or something.

(I work with a designer who freaking loves setting z-index in all sorts of exciting and interesting ways.)

Any downsides?

Fatal Error in 2.5.3

Fatal error: Cannot redeclare class Ee_toolbar_hook in /Users/aaronlax/Sites/weavr/system/expressionengine/third_party/ee_debug_toolbar/libraries/Ee_toolbar_hook.php on line 132

Clicking Memory Option in Toolbar generates firebug error

If the Toolbar is installed and none of the other extensions are installed (particularly the memory history extension) - clicking on the memory option returns the following firebug error:

TypeError: google.load is not a function
callback:function () {

when trying to access:
class=Ee_debug_toolbar_ext&method=get_panel_data&panel=memory&LANG=ENG

MySQL error when trying to install the module

I'm getting this when trying to install the module:

Table 'dbname.exp_ee_debug_toolbar_settings' already exists

CREATE TABLE IF NOT EXISTS exp_ee_debug_toolbar_settings ( id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, setting_key varchar(30) DEFAULT '' NOT NULL, setting_value text NOT NULL, serialized int(1) DEFAULT '0' NULL, PRIMARY KEY id (id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

but the table definitely doesn't exist. If I return to the modules page after trying to install it, there's now a clickable link for the module, but if I click on it, I get:

Table 'dbname.exp_ee_debug_toolbar_settings' doesn't exist

SELECT setting_key, setting_value, serialized FROM (exp_ee_debug_toolbar_settings)

This is on a site I've just updated to EE 2.5.5 and wasn't previously running the debug toolbar extension.

Helper Expansion / Refactor

Let's add helper functions for developers to make life easier for:

  1. Theme URL
  2. Theme Path
  3. Third Party Path
  4. To check if given EE tag was used on page
  5. ???

Basically, I want to add to the library so devs don't have to keep reinventing their own idea of what a wheel is.

Toolbar disappears when '.' is present in URL

So here's a peculiar thing: I have a site where the URL segments consist of one or more category slugs, some of which have periods in them, i.e.:

category-1.1
category-1.2

When these are present in the URL, the EE Debug Toolbar won't show. However, EE's default template debugging output does show.

This is on EE 2.5.5, and EE Debug Toolbar 1.0

Cheers,
John

Memory history profile

What do you think about the idea of showing a small chart of your memory usage for the past 5 or 10 pages? I envision being able to switch it on (or have it on permanently) and then navigate around the site. When done I can look at the history profile and see the memory usage for each page.

This could work really well as a sparkline image in the toolbar itself since you could navigate around your site and only need to check it if you see a spike.

Could achieve this fairly easily using a cookie to track final memory usage & page URI.

?

"Leftovers" upon uninstall seem to cause problems upon reinstall

When you uninstall the module and all accompanying extension, the eedt_memory_history table does not get deleted, nor does the expressionengine/cache/eedt folder.

I went ahead and deleted the table and the cache folder and then reinstalled the extension. I had a warning that the eedt_memory_history table does not exist and that files in the cache folder were missing.

Is the toolbar storing data elsewhere than in that table and folder? Have I forgotten to delete anything. Would like to go back to a blank slate, redownload and reinstall.

Error module settings page EE 2.8.2

Hi There,

Just did a clean install of EE 2.8.2 and the latest Debug Toolbar (1.0).

By visiting the module page i got this error:

Fatal error: Call to undefined method Cp::set_variable() in /Users/reinos/Sites/ee282.local/system/expressionengine/third_party/ee_debug_toolbar/mcp.ee_debug_toolbar.php on line 97

Slim and Extensible Core vs Full Featured and Fat Core?

Curious about any thoughts on whether we should keep the Toolbar focused and narrow in terms of features and just let third party developers create and release some of the more advanced or narrow functionality.

Now that we have theming I really don't see much reason to defer to creative requests on the interface when it's all customizable (and our audience are devs/designers anyway). That got me thinking about function and the upcoming hook branch. I'm thinking that we should start to weigh features in lieu of what works best as a stand alone extension versus what's best for core.

For example, a couple proposed features (Warnings and Alerts & Resource Linking) would be simple enough to implement as extensions (at least in how I'm envisioning the API).

This makes sense to me because it'll allow this project to focus more on building a good debug framework for EE as opposed to features that'll likely add instability to the package over time and steal focus from core debugging functionality. I guess I'm worried about the Toolbar becoming a bloated "thing" instead of something useful by adding lots of interface features to the core. Plus, this being OSS time is a problem right now so, obviously, the more features/function we add to the core is going to require more time (that we both don't really have).

Thoughts?

PHP error on installation re cache_dir

When I install the module I get the following PHP error message when accessing the Extensions screen in EE:

A PHP Error was encountered
Severity: Warning
Message: mkdir() [function.mkdir]: Permission denied
Filename: ee_debug_toolbar/ext.ee_debug_toolbar.php
Line Number: 130

That line is trying to create the cache directory:

        mkdir($this->cache_dir, 0777, true);

In my EE settings, I have set no cache path, i.e. the setting is empty. How can I avoid this error?

Thank you!

Extension Acts to Module Acts

The problem having custom ACTs is no longer valid with how EE removes that pain. Refactor to move all first party Acts to Modules

Memory History Cache Broken

The cache for the Memory History isn't resetting. Looks like just adding delete() on the query chain should fix that up.

Tries to find database content that is not there.

I get this after installing in EE 2.5.5 and press the admin.php frontpage.
channel_id dont exist in my database as a collumn

A Database Error Occurred
Error Number: 1054

Unknown column 'entry_id' in 'field list'

SELECT entry_id, channel_id, setting_key, setting_value, serialized FROM (exp_ee_debug_toolbar_settings) WHERE site_id = '1' ORDER BY entry_date DESC

Filename: third_party/ee_debug_toolbar/models/ee_debug_settings_model.php

Line Number: 78

Wiki Updates

We need to finish sections for:

  1. Memory History
  2. Log Viewer
  3. How to Contribute
  4. ???

Toolbar extension causes file upload modal to 'hang' when uploading files

EE 2.8.1: when uploading a file via the file manager or via an entry, after having selected an image and clicking submit, the modal window goes grey and a spinning icon appears in the bottom right corner. The modal stays this way until you click close and refresh.

The file does actually get uploaded, but the modal window doesn't refresh and continue to the point where you can edit/insert the image you've just uploaded.

Disabling the extension brings the functionality back.

Bookmarklet Error

When you use an ExpressionEngine bookmarklet and have the EE Debug Toolbar on, you get this error:

A PHP Error was encountered

Severity: Warning

Message: parse_url(/admin.php?S=0e80a4f98f478468b4f4abbe7530569248d8f4a8&D=cp&C=content_publish&M=entry_form&Z=1&BK=1&channel_id=6&title=(title was here)&tb_url=(url was here)&field_id_2=): Unable to parse URL

Filename: ee_debug_toolbar/ext.ee_debug_toolbar.php

Line Number: 228

You can still use the bookmarklet. The error just shows up top.

Available Extension Display

One thing that we should at least start thinking about is an easier method of displaying the available extensions installed. Depending on how implementation is done by other devs and their add-ons EEDT extensions may be buried within other extensions so management of EEDT stuff could be an issue.

Christopher had mentioned something about using a Git repo to contain this info though I'm not 100% on what's involved there. Christopher, can you elaborate?

Regardless of how we approach this, I was envisioning a dedicated page within EEDT that would take the "master list", compare it to available extensions on the system, and display anything on the master list and on the system. Simple enough. From there though, we could handle management of EEDT CRUD and keep things organized for users.

Minimum Version Support

I was testing EEDT on an older EE site on 2.2.2 and ran into an where it didn't work and was throwing the below errors.

A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant URL_THIRD_THEMES - assumed 'URL_THIRD_THEMES'
Filename: panels/Eedt_copyright_panel.php
Line Number: 22

A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant URL_THIRD_THEMES - assumed 'URL_THIRD_THEMES'
Filename: panels/Eedt_memory_panel.php
Line Number: 26

A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant URL_THIRD_THEMES - assumed 'URL_THIRD_THEMES'
Filename: panels/Eedt_memory_panel.php
Line Number: 27

A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant URL_THIRD_THEMES - assumed 'URL_THIRD_THEMES'
Filename: panels/Eedt_time_panel.php
Line Number: 22

A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant URL_THIRD_THEMES - assumed 'URL_THIRD_THEMES'
Filename: panels/Eedt_database_panel.php
Line Number: 23

Seemed straightforward enough to fix; the panels aren't abstracting the theme constants since they were introduced in EE 2.4. But when I went to look deeper I noticed a jQuery error about .on:

Timestamp: 3/20/2013 9:28:04 PM
Error: TypeError: this.buttonNode.on is not a function
Source File: http://mysite.com/themes/third_party/ee_debug_toolbar/themes/default/js/eedt.js
Line: 667

Looking into that showed that jQuery didn't have the "on" function until 1.7 and EE 2.2.2 is using jQuery 1.6. That's a bigger problem.

So. We can't use EEDT in older versions of EE. I'm personally ok with not supporting 2.2.2 (even 2.3 is sort of silly) but this begs the question; where do we actually put that flag officially? We know EEDT works gang busters in the 2.5 branch, but what about 2.4? I've never tested it but do we even care?

Has anyone tried EEDT on EE 2.4? What would be an acceptable line to not support a version of EE?

Non Super Admins

Right now EEDT is only available for Super Admins because of how the internal CI debugging mechanism works. Only Super Admins can view the data so why have a Toolbar with no data? So we just jump out early.

That approach doesn't really hold up now that EEDT is a platform though. Instead, I think we should check for the existence of user group, at the panel level before creating the CI panels, and then ensure we actually have panels, at the end of everything, before outputting EEDT. No panels, no output. This way extensions can still be ran (for the front site) even if it's 1 extension.

We'll have to update the documentation to make devs aware they can't rely on Super Admin being set (they'll have to check themselves) but it shouldn't be too bit a deal at this stage anyway.

Thoughts?

Panel Height Fluidity

Ideally, the panels should have a maximum height while being liquid to accommodate variable amounts of content.

The problem is that some panels can have more or less content in them depending on the situation, which causes the panels to either show lots of white space or require scroll bars. Instead, it would be best to have the panel shrink to fit the content or expand to a maximum height (400px for example) where content is displayed scrolling.

EEDT kills other module's settings page

Hello, just wanted to report an issue where EEDT causes a white screen of death on the settings page of another module, Zoo Flexible Admin.

I tracked down the problem to the modify_output() method here, see also issue #48.

Simply returning on the display_override hook seems to obliterate all of the output. With the following addition we get the settings screen back:

$this->EE->output->_display();
return;

FYI, the Zoo extension disables the profiler in its get_js() and get_css() methods with $this->EE->output->enable_profiler(FALSE);.

PHP Notice - Array to string conversion (Hookah Branch)

Running PHP 5.4.4...

Under the Variables tab, my EE Session array contains a nested array, under the key 'is_banned'. When trying to plainly echo the value, it triggers the following:

A PHP ERROR WAS ENCOUNTERED
Severity: Notice
Message: Array to string conversion
Filename: partials/variables.php
Line Number: 67

I can see this happening in other key/val pairs (can't GET and POST values be arrays too?), so might be simplest to create a recursive utility echo function to be used across your views.

Cheers,
John

overflow: hidden on EEDebug_panel?

When one of the panels as more content than fits in the area, it's hidden with no scrollbar, so I can't see the bottom of the info. Is that overflow: hidden intentional?

PHP error (warning) in Hookah branch

Seeing this at the top of each pop-up panel in the toolbar:

A PHP Error was encountered
Severity: Warning
Message: Creating default object from empty value
Filename: ee_debug_toolbar/ext.ee_debug_toolbar.php
Line Number: 390

I'm running PHP 5.3.

MYSQL error saving settings

Downloaded from master branch.

A Database Error Occurred
Error Number: 1364

Field 'setting_value' doesn't have a default value

INSERT INTO `exp_ee_debug_toolbar_settings` (`setting_key`) VALUES ('theme')

Filename: /Users/leevigraham/Sites/Personal/ExpressionEngine2.5.5/third_party/ee_debug_toolbar/models/ee_debug_settings_model.php

Line Number: 91

Error when upgrading to EE 2.6.1

I got this error

Fatal error: Call to undefined function lang() in /ee_debug_toolbar/config.php on line 13

when trying to upgrade to EE 2.6.1 and the update wouldn't complete properly and the CP was broken. I had to jump into the db and delete the rows relating to the toolbar manually.

I'm not entirely sure if it's a problem with the toolbar because the whole update process is broken for me and after completing, I can't actually access the CP at all due to being redirected to /?S=0&D=cpC=homepage even when not logged in, but I thought I should mention it here while I remembered in case anyone else was experiencing a similar thing.

Suppress Debugging on Specific Templates?

I have a site that displays a map and gets data from an EE template that returns JSON. Debugging is quite helpful on the rest of the site, so I'd like to keep it enabled, however, it breaks the JSON response.

Is there some way to disable the display of debugging information on specific templates?

Erik Reagan created a quick plugin to help me called Disable Profiler which pretty much calls these two lines:

    $this->EE->output->enable_profiler = FALSE;
    $this->EE->TMPL->debugging = FALSE;

... but sadly Debug Toolbar doesn't seem to honor that setting.

Fatal error on install

After installing the latest version of EE Debug Toolbar (1.0 [22] RC1) on the latest version of EE (2.6.1) it installs fine but I get the following error on the template pages on the front-end:

Fatal error: Cannot redeclare class Eedt_panel_model in /path/to/system/expressionengine/third_party/ee_debug_toolbar/classes/Eedt_panel_model.php on line 24

Any ideas what the problem is? I've had to remove for now until I can clear this up.

https issue

On a secure URL, the toolbar appears and all panels work fine except the Template debugger (list and graph). Looking at the console there are cross domain errors as it's trying to access resources from the http. Looking at the page source, the JavaScript is rendering out the http: URL instead of https.

The cause is libraries/Toolbar.php line 329 onwards:

public function get_action_url($method, $class = 'Ee_debug_toolbar')
{
    $url = $this->EE->config->config['site_url'];
    return $url.'?ACT='.$this->fetch_action_id($method, $class);
}

The solution is to remove the protocol from the URL, so strip out the protocol completely...

    $url = str_replace("http:", "", $this->EE->config->config['site_url']);

Cache Permissions

Ensure the cache directory and internal files are always set to writable upon creation. Ran into a weird edge case where this not being done is a PITA.

Seeing a lot of exp_developer_log queries on pages with imgSizer plugin

It's not really a problem because it doesn't seem to affect the page at all, but it does give skewed data. On a page that has a lot of images served with the imgSizer plugin, I'm getting 100s of extra queries on the exp_developer_log table that look like:

SELECT *
FROM (`exp_developer_log`)
WHERE `function` =  'remove_double_slashes()'
AND `line` =  42
AND `file` =  '/third_party/imgsizer/pi.imgsizer.php'
AND `deprecated_since` =  '2.6'
AND `use_instead` =  'reduce_double_slashes()'
AND `addon_module` =  'Imgsizer'
AND `addon_method` =  'size'
AND `template_id` =  '36'
AND `template_group` =  '_embeds'
AND `template_name` =  'index'
ORDER BY `log_id` desc 

Total queries for the example page is 544 but queries 145-544 look like the above.

Fatal PHP Error if installing EE Debug Toolbar when installing EE

I've decided to add EE Debug Toolbar to our default install of EE, and during the EE installation process if I select the EEDT module to be installed, the wizard finishes with a fatal PHP error:

Fatal error: Call to undefined function lang() in /path/to/system/expressionengine/third_party/ee_debug_toolbar/config.php on line 13

It doesn't affect the installation of EE, and any other Modules selected to be installed do so, but the EEDT module itself is not installed.

Cheers,
John

PHP Warnings

After enabling the extension, I get 2 PHP warnings.

A PHP Error was encountered
Severity: Warning
Message: Creating default object from empty value
Filename: ee_debug_toolbar/ext.ee_debug_toolbar.php
Line Number: 167

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/Dan/Dropbox/websites/www/.../system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 412

It appears to be working on the frontend and the backend.

PHP Notices

Not a big deal but on my dev sites when I have PHP error reporting set to E_ALL I get some log spew.

ERROR - 2013-05-30 10:51:52 --> Severity: Notice --> Array to string conversion /Users/chris/Sites/third_party/addons/ee_debug_toolbar/views/partials/memory.php 28

ERROR - 2013-05-30 10:28:46 --> Severity: Notice --> Undefined variable: log_dir_writable /Users/chris/Sites/third_party/addons/eedt_log_viewer/views/log_viewer.php 1

ERROR - 2013-05-30 10:28:46 --> Severity: Notice --> Undefined variable: logs_enabled /Users/chris/Sites/third_party/addons/eedt_log_viewer/views/log_viewer.php 6

Upsets JSON data files...

Having a problem where EEDT is adding its access files to the end of a JSON file, and so breaking the page that loads the JSON file.

JSON is generated by an EE template (tagged as JSON in EE), and is called via an html call issued via a javascript ajax command.

The EE built-in debug code is aware of JSON files it seems - as it does not append itself to this file - but EEDT seems to insert its stuff regardless.

What is needed is for EEDT to check to see if template is generating HTML output I think.

I would have a go, but would be helpful to have a pointer or two as to where this test needs to go in add-on. Or if it is easy to implement, perhaps someone can do the necessary...

1.0 Release Todos

  1. Add themeing capabilities
  2. Add option to override PHP error messaging to display in toolbar
  3. Add extension hooks to add additional and custom panels to toolbar
  4. Add quick links for templates, channel entries, and other details from front to CP

Remove from iframes

Just noticed today that the toolbar shows up in File Manager modal windows which are loaded via iframes. With the ability to collapse the toolbar, it's not that much of an issue, but would probably be better if it wasn't there in the first place.

EE3 support

Will there be EE3 support?

Let me know.

Best,
Rein

Escape Disallowed Characters in XML

An edge issue came up recently where a developer had unescaped ETX characters in their templates. This wreaked havoc on the XML mechanism since ETX can't be in XML. Some mechanisms should be put in place to prevent this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.