84% canada-post-shipping-for-woocommerce

Code Review | Canada Post Shipping For WooCommerce

WordPress plugin Canada Post Shipping For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: canada-post-shipp...
  • Plugin version: 2.9.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 1, 2014
  • Latest release: Sep 11, 2023
  • Number of updates: 73
  • Update frequency: every 44.0 days
  • Top authors: smallfishes (64.38%)canship (36.99%)

Code review

54 tests

User reviews

32 reviews

Install metrics

3,000+ active /56,844 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Server-side resources used by Canada Post Shipping For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.34 ▼0.90
Dashboard /wp-admin3.32 ▲0.0146.09 ▼3.96
Posts /wp-admin/edit.php3.37 ▲0.0147.34 ▲0.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.33 ▼6.08
Media Library /wp-admin/upload.php3.24 ▲0.0136.75 ▲1.45

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Canada Post Shipping For WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.191.72 ▲0.0445.14 ▲7.48
Dashboard /wp-admin2,203 ▲155.81 ▼0.0599.18 ▼4.3538.22 ▼1.98
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0739.22 ▼2.5735.83 ▼2.62
Add New Post /wp-admin/post-new.php1,533 ▲1923.20 ▲5.66694.30 ▲15.3951.93 ▲1.86
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.06104.35 ▼2.0044.98 ▼0.02

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/canada-post-shipping-for-woocommerce/canada-post-shipping-for-woocommerce-shipping-method.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% 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: woocommerce, shipping, shipping rates, canada post shipping, canada post

canada-post-shipping-for-woocommerce/canada-post-shipping-for-woocommerce.php 92% from 13 tests

"Canada Post Shipping For WooCommerce" version 2.9.13's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.0.0")

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
Good job! No executable or dangerous file extensions detected411 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP38616411

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity34.50
▷ Minimum class complexity18.00
▷ Maximum class complexity51.00
Average method complexity6.15
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods646.15%
▷ Protected methods00.00%
▷ Private methods753.85%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
premium_features.png118.65KB34.90KB▼ 70.58%