83% torque

Code Review | Torque - Optimise the transport of your Website

WordPress plugin Torque - Optimise the transport of your Website scored83%from 54 tests.

About plugin

  • Plugin page: torque
  • Plugin version: 0.7.3
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 2, 2021
  • Latest release: Jul 18, 2023
  • Number of updates: 51
  • Update frequency: every 13.4 days
  • Top authors: hexydec (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,218 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.18ms] Passed 4 tests

Server-side resources used by Torque - Optimise the transport of your Website
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.36 ▼5.76
Dashboard /wp-admin3.31 ▼0.0450.15 ▼6.90
Posts /wp-admin/edit.php3.36 ▲0.0043.37 ▼4.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.36 ▼7.65
Media Library /wp-admin/upload.php3.23 ▲0.0036.99 ▲4.94

Server storage [IO: ▲0.30MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Torque - Optimise the transport of your Website: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.22 ▼0.381.61 ▼0.1140.46 ▼5.77
Dashboard /wp-admin2,198 ▲245.62 ▼0.0687.11 ▼12.7939.81 ▼9.38
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0735.74 ▼0.9131.56 ▼3.54
Add New Post /wp-admin/post-new.php1,534 ▲618.06 ▼5.21677.55 ▲47.65107.82 ▲48.23
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.03108.63 ▼10.6948.65 ▼1.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'hexydec\\html\\token' not found in wp-content/plugins/torque/packages/htmldoc/tokens/doctype.php:6
    • > PHP Parse error
      syntax error, unexpected '|', expecting ';' or '{' in wp-content/plugins/torque/packages/htmldoc/htmldoc.php on line 189
    • > PHP Fatal error
      Uncaught Error: Class 'hexydec\\jslite\\operator' not found in wp-content/plugins/torque/packages/jslite/tokens/increment.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/torque/torque.php:23
    • > PHP Parse error
      syntax error, unexpected '|', expecting ';' or '{' in wp-content/plugins/torque/assets.php on line 316
    • > PHP Fatal error
      Uncaught Error: Class 'hexydec\\torque\\config' not found in wp-content/plugins/torque/app.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'hexydec\\html\\token' not found in wp-content/plugins/torque/packages/htmldoc/tokens/custom.php:6
    • > PHP Notice
      Undefined variable: violations in wp-content/plugins/torque/templates/csp-recommendations.php on line 25
    • > PHP Warning
      filesize(): stat failed for wp-content/uploads/torque/csp-reports.json in /var/www/wordpress/wp-content/plugins/torque/report.php on line 6
    • > PHP Fatal error
      Uncaught Error: Interface 'hexydec\\html\\token' not found in wp-content/plugins/torque/packages/htmldoc/tokens/comment.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Requires at least: Version format is invalid
  • Screenshots: A description for screenshot #9 is required in torque/assets to your readme.txt
The official readme.txt might help

torque/torque.php 92% from 13 tests

The main file in "Torque - Optimise the transport of your Website" v. 0.7.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 329 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
Everything looks great! No dangerous files found in this plugin5,819 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP468302,1065,595
CSS2380169
JavaScript17753
SVG2002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.75
Average class complexity35.55
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes00.00%
Methods223
▷ Static methods167.17%
▷ Public methods18482.51%
▷ Protected methods3917.49%
▷ Private methods00.00%
Functions59
▷ Named functions00.00%
▷ Anonymous functions59100.00%
Constants13
▷ Global constants00.00%
▷ Class constants13100.00%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin