77% the-courier-guy

Code Review | The Courier Guy Shipping for WooCommerce

WordPress plugin The Courier Guy Shipping for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: the-courier-guy
  • Plugin version: 5.1.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2019
  • Latest release: Nov 14, 2023
  • Number of updates: 219
  • Update frequency: every 6.9 days
  • Top authors: talenttcg (93.61%)lynchclint (6.85%)

Code review

54 tests

User reviews

22 reviews

Install metrics

3,000+ active /49,345 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.78ms] Passed 4 tests

A check of server-side resources used by The Courier Guy Shipping for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.97 ▼0.13
Dashboard /wp-admin3.31 ▲0.0046.57 ▼3.29
Posts /wp-admin/edit.php3.36 ▲0.0047.11 ▲1.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.45 ▼2.64
Media Library /wp-admin/upload.php3.23 ▲0.0032.71 ▼1.05

Server storage [IO: ▲32.13MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Filesystem usage must be lower than 25MB (currently using 32.13MB)
Filesystem: 2,582 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by The Courier Guy Shipping for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.31 ▼0.121.76 ▼0.2043.70 ▼0.78
Dashboard /wp-admin2,195 ▲175.58 ▼0.0190.62 ▼30.8543.26 ▼3.11
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0539.57 ▼0.4836.07 ▲1.24
Add New Post /wp-admin/post-new.php1,527 ▼921.08 ▼2.15581.50 ▼20.1553.96 ▲6.58
Media Library /wp-admin/upload.php1,391 ▼34.16 ▼0.0497.09 ▼0.5041.09 ▼2.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Templates/form-field-number.php
    • > /wp-content/plugins/the-courier-guy/vendor/mtdowling/jmespath.php/bin/jp.php
    • > /wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Templates/form-field-wrapper.php
    • > /wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Templates/form-field-text.php
    • > /wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Templates/form-field-checkbox.php
    • > /wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Templates/form-field-textarea.php
  • 942× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/OpenSearchServerless/OpenSearchServerlessClient.php:71
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/the-courier-guy/Includes/ls-framework-custom/Core/CustomPlugin.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/Braket/Exception/BraketException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/CostExplorer/Exception/CostExplorerException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/GlueDataBrew/Exception/GlueDataBrewException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/Rds/RdsClient.php:296
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/SageMakerMetrics/SageMakerMetricsClient.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/SimSpaceWeaver/SimSpaceWeaverClient.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\MonitoringEventsInterface' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/Exception/IncalculablePayloadException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/the-courier-guy/vendor/aws/aws-sdk-php/src/CloudTrailData/CloudTrailDataClient.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4 in the-courier-guy/assets to your readme.txt
The official readme.txt is a good inspiration

the-courier-guy/TheCourierGuy.php 85% from 13 tests

The primary PHP file in "The Courier Guy Shipping for WooCommerce" version 5.1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("the-courier-guy.php" instead of "TheCourierGuy.php")
  • Requires at least: Required version must match the one declared in readme.txt ("5.6.0" instead of "7.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin76,071 lines of code in 2,560 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,5129,38450,32269,864
Markdown231,30303,847
JSON15701,633
JavaScript23714541
YAML520388
reStructuredText1352959
CSS18229
Dockerfile18010

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity5.96
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces763
Interfaces55
Traits27
Classes1,059
▷ Abstract classes181.70%
▷ Concrete classes1,04198.30%
▷ Final classes403.84%
Methods3,123
▷ Static methods59719.12%
▷ Public methods2,17369.58%
▷ Protected methods1474.71%
▷ Private methods80325.71%
Functions557
▷ Named functions14225.49%
▷ Anonymous functions41574.51%
Constants401
▷ Global constants7919.70%
▷ Class constants32280.30%
▷ Public constants322100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/images/tcg_logo.png41.05KB8.32KB▼ 79.73%