Description

The GTmetrix module allows the user to test a specific URL for performance using gtmetrix.com. After configuring the module to use the correct username/api_key, the configured URL will be tested on cron run following the configured interval. The results of the latest test is available on the Drupal status report page and is displayed as error or warning depending on the configured thresholds. All test runs are logged to Watchdog.

Project link

https://www.drupal.org/project/gtmetrix

Repository Setup

git clone --branch 1.0.x https://git.drupalcode.org/project/gtmetrix.git
cd gtmetrix

Comments

jvandooren created an issue. See original summary.

mrweiner’s picture

Status: Needs review » Needs work

You've got a few standards warnings/errors that should be fairly easy to clean up.

FILE: /app/web/modules/contrib/gtmetrix/src/Form/SettingsForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/web/modules/contrib/gtmetrix/src/Form/SettingsForm.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
94 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/web/modules/contrib/gtmetrix/src/Helper/GtMetrixHelper.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
30 | WARNING | Line exceeds 80 characters; contains 81 characters
----------------------------------------------------------------------

mrweiner’s picture

Status: Needs work » Needs review

Sorry, just took a look through https://groups.drupal.org/node/427683 and the above doesn't warrant Needs Work.

avpaderno’s picture

Status: Needs review » Needs work

Actually, since this is the first review, the status was correct.

jvandooren’s picture

Status: Needs work » Needs review

Thanks for the review! The requested changes have been pushed to the 1.0.x branch.

bramdriesen’s picture

Priority: Normal » Major
bramdriesen’s picture

Status: Needs review » Reviewed & tested by the community

Automated Review

Still some sniffs. But no show blocker. (Posted as a separate comment).

Manual Review

Individual user account
Follows the guidelines for individual user accounts.
No duplication
Does not cause module duplication and/or fragmentation.
Master Branch
Follows the guidelines for master branch.
Licensing
Follows the licensing requirements.
3rd party assets/code
Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Follows the guidelines for in-project documentation and/or the README Template. Although some more information could be added.
Code long/complex enough for review
Follows the guidelines for project length and complexity. Seems to be well written and easy to understand to me.
Secure code
Meets the security requirements.

This review uses the Project Application Review Template.

bramdriesen’s picture

❯ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor gtmetrix

FILE: /Users/bram.driesen/DrupalContrib/web/modules/contrib/gtmetrix/gtmetrix.install
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------


FILE: /Users/bram.driesen/DrupalContrib/web/modules/contrib/gtmetrix/gtmetrix.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
 67 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 70 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 78 | ERROR   | [x] Array indentation error, expected 8 spaces but found 10
 79 | ERROR   | [x] Array closing indentation error, expected 6 spaces but found 8
 86 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for
    |         |     xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
 88 | ERROR   | [ ] Missing parameter comment
 90 | ERROR   | [ ] Description for the @return value is missing
 91 | ERROR   | [x] Separate the @return and @throws sections by a blank line.
 94 | ERROR   | [ ] gtmetrix_requirements() is an installation hook and must be declared in an install file
------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/bram.driesen/DrupalContrib/web/modules/contrib/gtmetrix/README.md
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------
 2 | WARNING | Line exceeds 80 characters; contains 110 characters
 3 | WARNING | Line exceeds 80 characters; contains 113 characters
 4 | WARNING | Line exceeds 80 characters; contains 114 characters
------------------------------------------------------------------------------

Time: 152ms; Memory: 8MB
avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

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