73% advanced-table-rate-shipping-for-woocommerce

Code Review | WooCommerce Table Rate Shipping

WordPress plugin WooCommerce Table Rate Shipping scored73%from 54 tests.

About plugin

  • Plugin page: advanced-table-ra...
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2021
  • Latest release: May 2, 2023
  • Number of updates: 24
  • Update frequency: every 33.8 days
  • Top authors: acowebscd (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /4,669 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼3.74ms] Passed 4 tests

A check of server-side resources used by WooCommerce Table Rate Shipping
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1141.55 ▼5.60
Dashboard /wp-admin3.45 ▲0.1451.36 ▲1.24
Posts /wp-admin/edit.php3.56 ▲0.2050.25 ▼1.97
Add New Post /wp-admin/post-new.php6.05 ▲0.16101.72 ▼3.01
Media Library /wp-admin/upload.php3.37 ▲0.1437.71 ▼4.36

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: 1 new table, 6 new options
New tables
wp_um_vip_users
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Table Rate Shipping
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.28 ▼0.361.73 ▼0.1943.19 ▼5.93
Dashboard /wp-admin2,198 ▲215.57 ▼0.1187.90 ▼4.6240.90 ▼2.75
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0533.74 ▼5.2636.77 ▼0.71
Add New Post /wp-admin/post-new.php1,534 ▲822.86 ▼0.73673.11 ▼67.8153.81 ▲0.59
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.03102.26 ▼11.1042.86 ▼6.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_um_vip_users
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/advanced-table-rate-shipping-for-woocommerce/aco-table-rate-shipping.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-table-rate-shipping-for-woocommerce/part/acotrs-settingsinfo.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/advanced-table-rate-shipping-for-woocommerce/includes/class-acotrs-shipping.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/advanced-table-rate-shipping-for-woocommerce/includes/class-acotrs-settingsinfo.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

advanced-table-rate-shipping-for-woocommerce/aco-table-rate-shipping.php 85% from 13 tests

The main file in "WooCommerce Table Rate Shipping" v. 2.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 253 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-table-rate-shipping-for-woocommerce.php" instead of "aco-table-rate-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,266 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP116557201,802
PO File1153163323
SVG1820116
CSS116016
JSON2007
JavaScript2012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity53.25
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods79
▷ Static methods33.80%
▷ Public methods7392.41%
▷ Protected methods00.00%
▷ Private methods67.59%
Functions15
▷ Named functions746.67%
▷ Anonymous functions853.33%
Constants13
▷ Global constants646.15%
▷ Class constants753.85%
▷ Public constants7100.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
1 PNG file occupies 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner-772x250.png149.32KB56.63KB▼ 62.07%