Resource icon

Enable Debug Mode From AdminCP 1.1a

No permission to download

Chris D

XenForo developer
Staff member
Chris Deeming submitted a new resource:

Enable Debug Mode From AdminCP (version 1.0) - Provides a new Admin permission to make an "Enable Debug" switch appear on the AdminCP home.

Thank you so much for donating. It is always appreciated!

Read more about this resource...

EDIT: Just a note on this. The default behaviour of this add-on is to create the Debug Switch and the default state is "OFF".

This means, if you currently have Debug mode enabled, installing this add-on will effectively disable it until you flick the switch to ON.
 
I've been waiting for this for a long time! I hate having to turn it on and off manually. Great add on Chris.
 
I just keep my forum in debug mode all the time using:
Code:
$debugs = array('MY IP ADDRESS');
$config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $debugs));
Is there really a downside to this?
 
I just keep my forum in debug mode all the time using:
Code:
$debugs = array('MY IP ADDRESS');
$config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $debugs));
Is there really a downside to this?
only if you have dynamic IP addresses like mine... for that I use:
PHP:
$config['debug'] = strpos($_SERVER['REMOTE_ADDR'], 'xxx.xxx') !== false ? true : false;

btw Chris, I've posted a fix in my review (and I am too lazy to re-post it here :P ): http://xenforo.com/community/resour...-admincp.1356/reviews?resource_rating_id=3017 ;)
 
Yes there is a downside to staying in debug for the less experienced. It can be too easy to make changes to the defaults and so on.
In fact for a protective extra I'd suggest this has a timeout Chris. So if inactive for a period, or logged out, it defaults to standard mode. (Which itself could be overridden by a more experienced admin)
 
Yes there is a downside to staying in debug for the less experienced. It can be too easy to make changes to the defaults and so on.
In fact for a protective extra I'd suggest this has a timeout Chris. So if inactive for a period, or logged out, it defaults to standard mode. (Which itself could be overridden by a more experienced admin)

Nice suggestion!
 
I just keep my forum in debug mode all the time using:
Code:
$debugs = array('MY IP ADDRESS');
$config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $debugs));
Is there really a downside to this?
Resources

Debug mode uses resource (both memory and database queries) ..... If I recall correctly.

*cpu as well (by it varies on what you're doing and what you may have installed)
 
The resources are relevant when it's enabled for every single person browsing the site.
If its effectively enabled for only one user then it's not too much of a problem.

Also I think some people think "meh it only takes a second to edit the config file" but as ever you'd be surprised at how many people would be unable to do this.

This is designed for them, and also power users. I mean I needed to enable debug mode the other day and I didn't have FTP access.

So I just installed this using my add on installer :-D
 
Chris Deeming updated Enable Debug Mode From AdminCP with a new update entry:

Now displays query count and disables debug mode upon uninstall.


Thank you so much for donating. It is always appreciated!


This update is with special thanks to Mr.Goodie2Shoes who provided an excellent solution to the query count not displaying.

The add-on now displays the query count regardless of the debug mode set in the config.php file.

Also, when the add-on is uninstalled, the cached setting enabling the debug mode is removed. This doesn't override what is in your config, but is there for a more "cleaner" uninstall (should it be required).

Read the rest of this update entry...
 
Yes there is a downside to staying in debug for the less experienced. It can be too easy to make changes to the defaults and so on.
In fact for a protective extra I'd suggest this has a timeout Chris. So if inactive for a period, or logged out, it defaults to standard mode. (Which itself could be overridden by a more experienced admin)
As far as I know, its not possible (at least directly) because the Visitor object is available a lot later, at which point enabling debug mode is more or less useless...
 
So I noticed this was making my site slower. Even when disabled.

so I was going to un-install this....


PHP:
Missing argument 2 for XenForo_Application::setSimpleCacheData(), called in /home/***/public_html/forums/library/EnableDebugFromAdminHome/Install.php on line 7 and defined
 
    XenForo_Application::handlePhpError() in XenForo/Application.php at line 746
    XenForo_Application::setSimpleCacheData() in EnableDebugFromAdminHome/Install.php at line 7
    EnableDebugFromAdminHome_Install::uninstaller()
    call_user_func() in XenForo/DataWriter/AddOn.php at line 193
    XenForo_DataWriter_AddOn->_postDelete() in XenForo/DataWriter.php at line 1738
    XenForo_DataWriter->delete() in XenForo/ControllerAdmin/AddOn.php at line 116
    XenForo_ControllerAdmin_AddOn->actionDelete() in XenForo/FrontController.php at line 310
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    XenForo_FrontController->run() in /home/***/public_html/forums/admin.php at line 13

It doesn't like me. :(
 
This is the full error log from "tools"


PHP:
ErrorException: Missing argument 2 for XenForo_Application::setSimpleCacheData(), called in /home/***/public_html/forums/library/EnableDebugFromAdminHome/Install.php on line 7 and defined - library/XenForo/Application.php:746
Generated By: Adam, 32 minutes ago
Stack Trace

PHP:
#0 /home/***/public_html/forums/library/XenForo/Application.php(746): XenForo_Application::handlePhpError(2, 'Missing argumen...', '/home/sociall1/...', 746, Array)
#1 /home/sociall1/public_html/forums/library/EnableDebugFromAdminHome/Install.php(7): XenForo_Application::setSimpleCacheData(false)
#2 [internal function]: EnableDebugFromAdminHome_Install::uninstaller(Array)
#3 /home/sociall1/public_html/forums/library/XenForo/DataWriter/AddOn.php(193): call_user_func(Array, Array)
#4 /home/sociall1/public_html/forums/library/XenForo/DataWriter.php(1738): XenForo_DataWriter_AddOn->_postDelete()
#5 /home/sociall1/public_html/forums/library/XenForo/ControllerAdmin/AddOn.php(116): XenForo_DataWriter->delete()
#6 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(310): XenForo_ControllerAdmin_AddOn->actionDelete()
#7 /home/sociall1/public_html/forums/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#8 /home/***/public_html/forums/admin.php(13): XenForo_FrontController->run()
#9 {main}

Request State

PHP:
array(3) {
  ["url"] => string(89) "http://www.sociallyuncensored.eu/forums/admin.php?add-ons/EnableDebugFromAdminHome/delete"
  ["_GET"] => array(1) {
    ["add-ons/EnableDebugFromAdminHome/delete"] => string(0) ""
  }
  ["_POST"] => array(2) {
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(53) "1,1357755239,8a8a55911da6cf1d18482e1024b53eef3a6026ab"
  }
}
 
So I noticed this was making my site slower. Even when disabled.
That simply isn't possible.

As for the uninstall error, there's a bug in the installer. I will release a fix right now.

EDIT: With Debug mode disabled? Or with the add-on disabled? The latter 100% isn't possible... the former shouldn't be possible.
 
Top Bottom