Debug tools is simply a suite of function and variable calls to provide a more useful report when filing a bug. The report provides php, server, user, browser, viewport and system settings to allow the person reporting the bug to provide detailed information to the person or team responsible for addressing the bug. Each section of the report is configurable to enable or disable. A block is provided as well as a admin link and permissions for finer control.

Dependencies:
dblog
browscap.ini will provide additional information if selected.

Debug Tools sandbox link:
click here

Git clone command -

 git clone --branch 7.x-1.x http://git.drupal.org/sandbox/roger.soper/2303945.git debug_tools
cd debug_tools 

Drupal Core Version:
Drupal 7

Comments

PA robot’s picture

Status: Active » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrogersoper2303945git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

roger.soper’s picture

Thank you for the review. I have corrected the pareview errors and warnings,
http://pareview.sh/pareview/httpgitdrupalorgsandboxrogersoper2303945git

roger.soper’s picture

Status: Needs work » Needs review

Setting to needs review.

ayesh’s picture

Hi Roger,
I think I'm the first human one reviewing the code, so before moving into the tech aspects, if you wouldn't mind, I would like to know the intention of this module.
Of course the "tools" suggests it gives some sort of power-user kind of tools to administer any hidden settings or such, but looking at the code, it's more of "info" module. Either way, I personally see a lot of uses of the module, specially for the clients will less technical knowledge but they still want to send a full report to their IT guy, and such.

Do you have any plans to allow other modules to expose some debug info to your module, and probably reuse the data exposed by other modules with hook_requirements?

I'm going through the module and adding my suggestions. They are not in any particular order though.

- in debug_tools_help, I see you have used filter_xss_admin AND check_plain(), which makes any HTML made through the filter_xss_admin filter gets changed to plain text. You only need either of them (check_plain, filter_xss, filter_xss_admin).

- In function debug_tools_admin(), you are using system_settings_form() function which adds a submit handler to save whatever values the form has generated, minus the security tokens the the Form API adds. Use of a prefix is just a tradition to not mess up with other variables; it will not remove the variables when you uninstall the module.
To remove the variables, usually we implement hook_uninstall in the MODULE.install file and remove the variables using a db_delete with a %LIKE query, and variable_del on each individual variables.

- I see you have email functionality in the module. Generally we use drupal_mail() function to send the email, so Drupal can route the emails obeying the configuration. API doc of drupal_mail() has a lot of information on how to send emails with drupal_mail(). Note that you need to implement a hook_mail() in order for drupal_mail() to work.

- Other than above, there are some minor standards problems that one might not really give much attention. When creating links, always use the l() function. It can take care of the base path, URL aliases, etc. Also, use the t() function whenever necessary. I see you have used it almost everywhere, but a few places are missing the t(). (Good job not using t() in the hook_menu() implementation, which in case you should not use it there).

Also, I would personally love a $SESSION and $_COOKIE viewer.

Good luck!

Michael Hodge Jr’s picture

Status: Needs review » Needs work

I'm setting this back to needs work given Ayeshs comments.

roger.soper’s picture

Thank you Ayeshs and Michael. To address your comments Ayeshs.

1) The name debug tools is more about the future on the module, integration with Jira, Teamworkpm etc and idea of using the module as a tool to provided the developers with information needed to be more effective during debug.

2) I think it would be very useful to expose the info to other modules and will go on my to do list.

3) Good point about the help hook, I will adjust.

4) The hook uninstall is also something I will address.

5) I will review the drupal_mail function as well.

6) Lastly the l() and t() funtions will get a review on my end.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

josh.estep’s picture

Status: Closed (won't fix) » Needs review

Changes have been applied according to feedback on this page:

https://www.drupal.org/node/2316001

Thank you to those who recommended those changes.

nickdickinsonwilde’s picture

Title: Debug Tools » [D7] Debug Tools
nickdickinsonwilde’s picture

Issue summary: View changes
nickdickinsonwilde’s picture

h3>Automated Review

PAReview did see a few problems but quite minor; see the report

Manual Review

No duplication
Fine Couldn't find any similar modules -- does not cause module duplication and/or fragmentation. Devel has a similarly named developer tool but not actually similar functionality.
Master Branch
Good, follows the guidelines for master branch.
Licensing
Good, follows the licensing requirements.
3rd party assets/code
Good, matches the guidelines for 3rd party assets/code.
README.txt/README.md
Bad, empty readme.txt so doesn't meet the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Fine, more than meets the guidelines for project length and complexity.
Secure code
Okay No identified security issues; meets the security requirements.
Coding style & Drupal API usage
Nothing important, couple minor/very minor things:
  1. There are a few translation issues - quite minor but anyways
    • line 102
    • line 185
  2. excruciatingly minor:
    • line 337 could be time() -60 instead and delete line 336 - save one variable.
    • line 446: comment typo - word two: 'funciton'

This review uses the Project Application Review Template.

I'll have to test this out but I think I'm likely to recommend it to my clients in the future once it is out of sandbox and easy for them to install.

ayesh’s picture

On a slightly irrelevant question, why is this called Debug tools? This is actually providing information and not a tool per se. Do you plan to add any specific tools?

roger.soper’s picture

The module was debated between debug tools and qa report. We settled on debug tools because the primary use case for us is to debug assigned issues that regular users didn't have the capabilities to provide detailed enough information to help the developers debug as quickly as possible. The team decided that because there are a number of options (tools) available in the module we would settle with debug tools. The idea is to eventually add in some drush integration to allow elevated users to run drush commands based on the information returned from the module. Hope that helps a little bit. We will get on the issues you found asap as well.

roger.soper’s picture

I have made all the adjustments noted above. I also added README.txt content. Please review at your connivence.

nickdickinsonwilde’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me now - marked as RTBC
Works as advertised (though haven't tried browserscape.ini).
All errors identified above fixed.

I did find two very minor issues:

  • .module line 58: capitalization: drupal is used instead of Drupal
  • readme has a trailing space on a line... extremely minor as well.
  • Line 446 still has funicton instead of function but nothing to hold release
roger.soper’s picture

Thanks for all the help, I did not see the function misspelling in the latest version or either of the other issues. What is the next step to promote this project live? I read here: https://www.drupal.org/node/1068952 but do not see that option.

nickdickinsonwilde’s picture

Now you have to wait for someone with the appropriate permissions to review the application - step 4 in this list:

1. community members review application
2. resolve issues and back to 1
3. all issues resolved, mark as RTBC
4. review by core team member
5. if they think it looks okay, give you permission to promote it.

roger.soper’s picture

Thanks for the process update.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Non-blocking issues:

  • debug_tools_help() has some duplicate code, checking for slightly different file names, and 2 clauses for the pre tags
  • You could move debug_tools_admin() to a separate debug_tools.admin.inc file for slightly better performance (Drupal will then only load that function when actually on your admin page)
  • Also in debug_tools_admin(), try not to include any html inside of t(), it makes things much easier for translators
  • Also in debug_tools_admin(), use single quotes when possible, they're slightly faster and called for by Drupal code standards
  • Consider using Browscap as a dependency
  • In debug_tools_create(), calling date() and time() separately should result in very slightly different values. Probably not an issue unless someone files a bug report at midnight
  • Also in debug_tools_create() consider putting all the report elements into a keyed array. Then you can build the outgoing message with a foreach(), instead of one line at a time
  • Consider making the recipient email an admin configuration. Generally I wouldn't want my users to make that choice when filing a bug report

Thanks for your contribution, roger.soper!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

roger.soper’s picture

Thank you so much kscheirer however I still don't see the ability on the project edit to promote the project. Is there something I may be missing? Thanks again for all the effort.

roger.soper’s picture

Just checking back in on the status of this application. It appears to be approved but I still can not promote the project.

klausi’s picture

do you see a "Promote" tag at https://www.drupal.org/node/2303945/edit ?

roger.soper’s picture

klausi’s picture

Ah, you project is of type "Drupal.org project", but it should be of type "module". You need to delete that sandbox and create a new one of 'Module project' type. https://www.drupal.org/node/add/project-module

roger.soper’s picture

Thanks sooooo much. I'll give that a try boss.

wuxiaogu’s picture

function debug_tools_block_info() {
  $blocks['debug_tools'] = array(
    'info' => t('Debug Tools Block'),
  );
  return $blocks;
}

I think you'd better write like this:

function debug_tools_block_info() {
  $blocks['debug_tools'] = array(
    'info' => t('Debug Tools Block'),
    'cache' => DRUPAL_NO_CACHE,
  );
  return $blocks;
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.