84% woo-usps-simple-shipping

Code Review | USPS Simple Shipping for Woocommerce

WordPress plugin USPS Simple Shipping for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-usps-simple-s...
  • Plugin version: 1.9.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Dec 1, 2015
  • Latest release: Nov 21, 2023
  • Number of updates: 71
  • Update frequency: every 41.0 days
  • Top authors: dangoodman (59.15%)SkyWorks85 (42.25%)

Code review

54 tests

User reviews

27 reviews

Install metrics

9,000+ active /181,938 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.39ms] Passed 4 tests

Server-side resources used by USPS Simple Shipping for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0335.74 ▼8.39
Dashboard /wp-admin3.34 ▼0.0149.25 ▼14.05
Posts /wp-admin/edit.php3.39 ▲0.0347.01 ▲0.11
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.40 ▼3.24
Media Library /wp-admin/upload.php3.26 ▲0.0338.57 ▲1.73

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

USPS Simple Shipping for Woocommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.32 ▲0.071.63 ▼0.0537.42 ▼6.34
Dashboard /wp-admin2,201 ▲265.58 ▼0.1392.20 ▼13.6644.21 ▲1.59
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0545.10 ▲6.4637.53 ▼0.94
Add New Post /wp-admin/post-new.php1,532 ▲623.19 ▼0.47669.52 ▲83.5654.16 ▼8.81
Media Library /wp-admin/upload.php1,409 ▲94.22 ▲0.12102.19 ▼1.3648.55 ▲5.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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 take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Dgm\\UspsSimple\\Calc\\Error\\Error' not found in wp-content/plugins/woo-usps-simple-shipping/src/Calc/Error/TransportError.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Dgm\\UspsSimple\\Calc\\Dim' not found in wp-content/plugins/woo-usps-simple-shipping/src/Model/Fitters.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-usps-simple-shipping/vendor/dangoodman/wp-plugin-bootstrap-guard/DgmWpPluginBootstrapGuard.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dgm\\UspsSimple\\add_action() in wp-content/plugins/woo-usps-simple-shipping/src/Plugin.php:89
    • > PHP Fatal error
      Uncaught TypeError: array_map() expects parameter 1 to be a valid callback, class 'Dgm\\UspsSimple\\Calc\umber' not found in wp-content/plugins/woo-usps-simple-shipping/src/Calc/Dim.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'Dgm\\UspsSimple\\Model\\Service' not found in wp-content/plugins/woo-usps-simple-shipping/src/Model/Services.php:235
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-usps-simple-shipping/src/ShippingMethod.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: usps, live usps rates, woocommerce usps shipping

woo-usps-simple-shipping/USPS-simple-shipping.php 92% from 13 tests

This is the main PHP file of "USPS Simple Shipping for Woocommerce" version 1.9.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-usps-simple-shipping.php" instead of "USPS-simple-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,235 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP345766462,186
JavaScript310738
CSS11011

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes36
▷ Abstract classes12.78%
▷ Concrete classes3597.22%
▷ Final classes00.00%
Methods145
▷ Static methods5135.17%
▷ Public methods11579.31%
▷ Protected methods00.00%
▷ Private methods3020.69%
Functions29
▷ Named functions13.45%
▷ Anonymous functions2896.55%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants233.33%

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