10% a2z-ups-shipping

Code Review | Automated UPS Shipping for WooCommerce

WordPress plugin Automated UPS Shipping for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: a2z-ups-shipping
  • Plugin version: 4.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.3
  • WordPress version: 6.3.1
  • First release: Nov 11, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 102
  • Update frequency: every 18.1 days
  • Top authors: hitstacks (94.12%)a2zplugins (6.86%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /14,900 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Error in wp-content/plugins/a2z-ups-shipping/a2zups_basic.php+34
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/a2z-ups-shipping/a2zups_basic.php:34
    Stack trace:
    #0 wp-includes/class-wp-hook.php(312): hit_woo_ups_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.56MB] [CPU: ▲3.90ms] Passed 4 tests

This is a short check of server-side resources used by Automated UPS Shipping for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5637.89 ▲1.75
Dashboard /wp-admin3.87 ▲0.5650.80 ▲2.81
Posts /wp-admin/edit.php3.98 ▲0.6349.48 ▲2.83
Add New Post /wp-admin/post-new.php6.45 ▲0.5694.88 ▲13.18
Media Library /wp-admin/upload.php3.79 ▲0.5638.56 ▲8.19

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

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

Browser metrics Passed 4 tests

Automated UPS Shipping for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.22 ▼0.131.68 ▲0.1139.14 ▼5.30
Dashboard /wp-admin2,198 ▲215.65 ▲0.0191.27 ▼7.7341.85 ▼4.71
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0641.51 ▲2.7639.12 ▲8.83
Add New Post /wp-admin/post-new.php1,540 ▲1423.23 ▲0.12599.77 ▼20.2254.44 ▼2.22
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0496.80 ▼0.5341.58 ▼0.31

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-ups-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-simple.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-ups-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-ups-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php:28

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can take inspiration from this readme.txt

a2z-ups-shipping/a2zups_basic.php 77% from 13 tests

"Automated UPS Shipping for WooCommerce" version 4.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("a2z-ups-shipping.php" instead of "a2zups_basic.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0.1" instead of "2.6")

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
Good job! No executable or dangerous file extensions detected6,386 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP126406635,987
XML300236
HTML1141163

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 159)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity70.00
▷ Minimum class complexity1.00
▷ Maximum class complexity530.00
Average method complexity9.01
▷ Minimum method complexity1.00
▷ Maximum method complexity159.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods113
▷ Static methods00.00%
▷ Public methods10189.38%
▷ Protected methods00.00%
▷ Private methods1210.62%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/ups_logo.png4.57KB2.93KB▼ 35.94%
controllors/views/hups.png7.16KB3.46KB▼ 51.69%