10% c-h-robinson-shipping

Code Review | C.H. Robinson Shipping

WordPress plugin C.H. Robinson Shipping scored10%from 54 tests.

About plugin

  • Plugin page: c-h-robinson-ship...
  • Plugin version: 1.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.1
  • WordPress version: 6.3.1
  • First release: Dec 12, 2022
  • Latest release: Jun 27, 2023
  • Number of updates: 17
  • Update frequency: every 11.8 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /459 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/c-h-robinson-shipping/hitshipo_chr_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/c-h-robinson-shipping/hitshipo_chr_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(312): hitshipo_woo_chr_plugin_activation()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(720): do_action()

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

Analyzing server-side resources used by C.H. Robinson Shipping
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.95 ▼3.59
Dashboard /wp-admin3.31 ▲0.0147.44 ▼2.79
Posts /wp-admin/edit.php3.42 ▲0.0748.15 ▼2.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.81 ▼4.37
Media Library /wp-admin/upload.php3.23 ▲0.0036.77 ▼4.71

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,338 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for C.H. Robinson Shipping
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.59 ▼0.791.83 ▲0.1143.01 ▼1.05
Dashboard /wp-admin2,221 ▲185.05 ▲0.20111.65 ▲4.3542.03 ▲0.97
Posts /wp-admin/edit.php2,100 ▼02.18 ▲0.1733.83 ▼6.5734.67 ▼0.35
Add New Post /wp-admin/post-new.php1,546 ▼023.19 ▲0.03638.29 ▼38.9765.30 ▲10.47
Media Library /wp-admin/upload.php1,403 ▲34.30 ▲0.16103.50 ▼15.2241.75 ▼8.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 693× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Servicecontrol/V1/QuotaError.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Service.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/cloud-translate/src/V3/SupportedLanguages.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/protobuf/src/Google/Protobuf/Internal/MessageOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Cloud\\Core\\Exception\\ServiceException' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/cloud-core/src/Exception/DeadlineExceededException.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/gax/src/Testing/MockResponse.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/protobuf/src/Google/Protobuf/Int64Value.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Page.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (CHR Account integration settings.), #2 (Shipper address configuration.), #3 (Packing algorithm configurations.), #4 (Shipping rates configuration & shipping services list.), #5 (Shipping label, tracking, pickup configuration.), #6 (Order page where you can easily get labels.), #7 (Cart Page - Shipping rates working.), #8 (Checkout - Order placed with the CHR carrier.), #9 (Create shiping label screen in edit order page. This is for manual usage.), #10 (Shipping label management section - HITShipo.), #11 (Check tracking informations - HITShipo.), #12 (Check tracking informations - In the site my account section.), #13 (Shipping label & Management information.)
The official readme.txt might help

c-h-robinson-shipping/hitshipo_chr_basic.php 77% from 13 tests

Analyzing the main PHP file in "C.H. Robinson Shipping" version 1.1.7
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("c-h-robinson-shipping.php" instead of "hitshipo_chr_basic.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0.1" instead of "2.6")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
These items require your attention
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/c-h-robinson-shipping/controllors/classes/gtrans/vendor/bin/google-cloud-batch.bat
82,615 lines of code in 1,291 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,18916,21671,32873,550
Markdown421,66805,164
JSON36403,250
XSLT22320209
Bourne Shell94681172
YAML410098
Protocol Buffers2143862
XML40551
Python1174346
make1409
DOS Batch1004

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 170)
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity589.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity170.00
Code structure
Namespaces165
Interfaces52
Traits58
Classes1,052
▷ Abstract classes181.71%
▷ Concrete classes1,03498.29%
▷ Final classes151.45%
Methods6,460
▷ Static methods5628.70%
▷ Public methods5,71788.50%
▷ Protected methods2353.64%
▷ Private methods5087.86%
Functions292
▷ Named functions7826.71%
▷ Anonymous functions21473.29%
Constants584
▷ Global constants30.51%
▷ Class constants58199.49%
▷ Public constants56196.56%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/hchr.png3.61KB2.97KB▼ 17.80%
controllors/views/chr.png20.79KB11.76KB▼ 43.44%
chr.png20.79KB11.76KB▼ 43.44%