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.4
  • 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: Nov 13, 2021
  • Number of updates: 12
  • Update frequency: every 22.8 days
  • Top authors: hitstacks (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 559 total downloads

Benchmarks

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.10MB] [CPU: ▼171.44ms] 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.93 ▲0.1033.74 ▼2.85
Dashboard /wp-admin3.16 ▲0.1046.65 ▼1.96
Posts /wp-admin/edit.php3.21 ▲0.1045.80 ▼1.48
Add New Post /wp-admin/post-new.php5.52 ▲0.0886.84 ▼679.45
Media Library /wp-admin/upload.php3.10 ▲0.1038.15 ▲1.96

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,679 ▲8316.13 ▲0.1610.37 ▼0.3045.93 ▼3.89
Dashboard /wp-admin2,973 ▲425.96 ▼0.25141.05 ▼25.34109.41 ▲6.39
Posts /wp-admin/edit.php2,739 ▲32.72 ▲0.0067.74 ▲1.4695.74 ▲1.45
Add New Post /wp-admin/post-new.php1,672 ▲5718.77 ▼2.70384.28 ▲110.73101.94 ▲1.20
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.02158.73 ▲7.42123.33 ▲4.32

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-ascend.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

User-side errors Passed 1 test

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

Optimizations

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, canada post, canada post woocommerce, canada post plugin, canada post shipping method

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.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • 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")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0.1" instead of "2.6")

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,214 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP114106353,100
XML510114

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.75
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods96
▷ Static methods00.00%
▷ Public methods8790.62%
▷ Protected methods00.00%
▷ Private methods99.38%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ 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%
controllors/views/cp_logo.png25.41KB25.40KB0.05%