84% asm-wc

Code Review | Advanced Shipping Methods for WooCommerce

WordPress plugin Advanced Shipping Methods for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: asm-wc
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 27, 2021
  • Latest release: Jan 28, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: theritesites (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /386 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Advanced Shipping Methods for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.96 ▼5.63
Dashboard /wp-admin3.31 ▲0.0149.20 ▼0.77
Posts /wp-admin/edit.php3.36 ▲0.0151.04 ▼0.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.26 ▼10.82
Media Library /wp-admin/upload.php3.23 ▲0.0142.65 ▲2.19

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Shipping Methods for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.42 ▲0.071.77 ▼0.0942.75 ▲0.50
Dashboard /wp-admin2,192 ▲155.65 ▲0.0887.43 ▼1.5743.67 ▲1.93
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0435.63 ▼0.6332.72 ▼5.39
Add New Post /wp-admin/post-new.php1,528 ▼023.08 ▲0.12700.87 ▲7.5955.49 ▼6.85
Media Library /wp-admin/upload.php1,397 ▼04.17 ▲0.01119.49 ▲5.2553.83 ▲1.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/asm-wc/admin/partials/asm-wc-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: time based shipping, advanced shipping, woocommerce shipping methods

asm-wc/advanced-shipping-methods-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Advanced Shipping Methods for WooCommerce" version 1.0.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("asm-wc.php" instead of "advanced-shipping-methods-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,842 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6166137881
PHP14200541851
CSS31847110

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity20.62
▷ Minimum class complexity1.00
▷ Maximum class complexity139.00
Average method complexity5.62
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods34
▷ Static methods411.76%
▷ Public methods2676.47%
▷ Protected methods411.76%
▷ Private methods411.76%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected