84% gtmetrix-for-wordpress

Code Review | GTmetrix for WordPress

WordPress plugin GTmetrix for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: gtmetrix-for-word...
  • Plugin version: 0.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2012
  • Latest release: Aug 25, 2023
  • Number of updates: 63
  • Update frequency: every 65.0 days
  • Top authors: GTmetrix (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

10,000+ active /242,464 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▼0.49ms] Passed 4 tests

Server-side resources used by GTmetrix for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4237.13 ▼2.70
Dashboard /wp-admin3.73 ▲0.4248.17 ▼0.55
Posts /wp-admin/edit.php3.84 ▲0.4848.34 ▲3.45
Add New Post /wp-admin/post-new.php6.31 ▲0.4286.38 ▼2.18
Media Library /wp-admin/upload.php3.65 ▲0.4238.93 ▲5.81

Server storage [IO: ▲0.46MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 39 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
gfw_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for GTmetrix for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲9113.30 ▼0.871.66 ▲0.1140.63 ▼5.02
Dashboard /wp-admin2,232 ▲585.07 ▼0.78108.28 ▲8.0943.02 ▼12.81
Posts /wp-admin/edit.php2,114 ▲282.06 ▲0.0641.39 ▲4.8635.56 ▲4.52
Add New Post /wp-admin/post-new.php1,538 ▲523.67 ▲5.55670.37 ▲28.9256.98 ▲0.65
Media Library /wp-admin/upload.php1,411 ▲294.23 ▲0.0498.93 ▼4.1540.02 ▼2.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gtmetrix-for-wordpress/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gtmetrix-for-wordpress/widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: monitoring, page speed, statistics, gtmetrix, performance...

gtmetrix-for-wordpress/gtmetrix-for-wordpress.php 92% from 13 tests

The entry point to "GTmetrix for WordPress" version 0.4.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin3,376 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP42551981,805
CSS4152901,224
JavaScript5295347

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity91.67
▷ Minimum class complexity11.00
▷ Maximum class complexity216.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods89
▷ Static methods00.00%
▷ Public methods7887.64%
▷ Protected methods1112.36%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1292.31%
▷ Class constants17.69%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 PNG files occupy 0.22MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.37KB9.46KB0.00%
lib/smoothness/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
images/letter-grades.png4.71KB4.83KB0.00%
images/scanner.png0.16KB0.15KB▼ 6.79%
lib/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%