10% a2z-canada-post-automated-shipping

Code Review | a2z canada post automated shipping for WooCommerce

WordPress plugin a2z canada post automated shipping for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: a2z-canada-post-a...
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 5.8.1
  • First release: Feb 20, 2021
  • Latest release: Jan 8, 2022
  • Number of updates: 13
  • Update frequency: every 25.3 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 794 total downloads


Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/a2z-canada-post-automated-shipping/hit_canadapost_auto_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/a2z-canada-post-automated-shipping/hit_canadapost_auto_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(305): hit_woo_cp_plugin_activation()
    #1 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(470): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(725): do_action()

Server metrics [RAM: ▲0.09MB] [CPU: ▼193.69ms] Passed 4 tests

A check of server-side resources used by a2z canada post automated shipping for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1029.99 ▼0.95
Dashboard /wp-admin3.16 ▲0.0938.75 ▼25.63
Posts /wp-admin/edit.php3.21 ▲0.1037.78 ▼1.28
Add New Post /wp-admin/post-new.php5.52 ▲0.0877.31 ▼746.91
Media Library /wp-admin/upload.php3.11 ▲0.1025.56 ▲0.26

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by a2z canada post automated shipping for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.52 ▼0.125.39 ▼4.7777.82 ▲1.42
Dashboard /wp-admin2,933 ▲376.06 ▼0.06117.74 ▼47.09168.17 ▼43.75
Posts /wp-admin/edit.php2,740 ▼03.24 ▼0.0063.40 ▼4.13135.60 ▼8.45
Add New Post /wp-admin/post-new.php3,704 ▼4118.13 ▼0.55436.59 ▼1.86160.32 ▲6.26
Media Library /wp-admin/upload.php1,752 ▼05.45 ▼0.06148.85 ▲5.00184.45 ▼6.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-canada-post-automated-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-canada-post-automated-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-canada-post-automated-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found


Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: canada post shipping method, canada post woocommerce, canada post shipping, canada post, canada post plugin

a2z-canada-post-automated-shipping/hit_canadapost_auto_basic.php 77% from 13 tests

The principal PHP file in "a2z canada post automated shipping for WooCommerce" v. 2.0.5 is loaded by WordPress automatically on each request
You should first fix the following items:
  • 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: Please use dashes and lowercase characters for text domains
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("a2z-canada-post-automated-shipping.php" instead of "hit_canadapost_auto_basic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin3,218 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity23.92
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods8790.62%
▷ Protected methods00.00%
▷ Private methods99.38%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/hcp.png7.95KB3.74KB▼ 52.91%