78% wc-cash-on-delivery-charges

Code Review | Cash on Delivery Charges for WooCommerce

WordPress plugin Cash on Delivery Charges for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: wc-cash-on-delive...
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 5.9.2
  • First release: Jun 3, 2021
  • Latest release: Feb 4, 2022
  • Number of updates: 8
  • Update frequency: every 30.9 days
  • Top authors: pradeepku041 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active / 2,451 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼291.77ms] Passed 4 tests

This is a short check of server-side resources used by Cash on Delivery Charges for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0160.74 ▲8.37
Dashboard /wp-admin3.41 ▲0.0033.55 ▼3.56
Posts /wp-admin/edit.php3.64 ▲0.0036.28 ▼3.38
Add New Post /wp-admin/post-new.php6.88 ▼0.0997.55 ▼1,159.37
Media Library /wp-admin/upload.php3.29 ▲0.0024.68 ▼0.75
Import COD Price List /wp-admin/admin.php?page=import-cod-pricelist3.1017.77
Add New Price /wp-admin/admin.php?page=add-cod_amount3.1017.36
COD Price /wp-admin/admin.php?page=cod_price_list3.1016.94
COD Setting /wp-admin/admin.php?page=wpcc-cod-charges3.1017.49

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: 1 new table, no new options
New tables
wp_wpcc_cashondelivery

Browser metrics Passed 4 tests

Checking browser requirements for Cash on Delivery Charges for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,835 ▲8115.96 ▼0.015.99 ▼0.232.17 ▼0.28
Dashboard /wp-admin2,895 ▲416.12 ▼0.03124.18 ▼13.17163.16 ▲3.85
Posts /wp-admin/edit.php2,688 ▼33.23 ▲0.0165.50 ▼0.61142.36 ▼2.44
Add New Post /wp-admin/post-new.php1,752 ▲9121.55 ▲4.89429.86 ▲5.89150.80 ▼5.25
Media Library /wp-admin/upload.php1,698 ▼35.51 ▼0.02144.30 ▼2.35184.65 ▼6.26
Import COD Price List /wp-admin/admin.php?page=import-cod-pricelist280.940.0316.42
Add New Price /wp-admin/admin.php?page=add-cod_amount280.940.0417.08
COD Price /wp-admin/admin.php?page=cod_price_list280.940.0416.76
COD Setting /wp-admin/admin.php?page=wpcc-cod-charges280.940.0317.02

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_wpcc_cashondelivery

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-cash-on-delivery-charges/wpcc-woocommerce-cod-charges.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=import-cod-pricelist
    • > Network (severe)
    wp-admin/admin.php?page=import-cod-pricelist - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=add-cod_amount
    • > Network (severe)
    wp-admin/admin.php?page=add-cod_amount - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=cod_price_list
    • > Network (severe)
    wp-admin/admin.php?page=cod_price_list - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wpcc-cod-charges
    • > Network (severe)
    wp-admin/admin.php?page=wpcc-cod-charges - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
  • Screenshots: These screenshots lack descriptions #4, #5 in wc-cash-on-delivery-charges/assets to your readme.txt
The official readme.txt is a good inspiration

wc-cash-on-delivery-charges/wpcc-woocommerce-cod-charges.php 92% from 13 tests

Analyzing the main PHP file in "Cash on Delivery Charges for WooCommerce" version 2.2.2
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-cash-on-delivery-charges.php" instead of "wpcc-woocommerce-cod-charges.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 plugin1,770 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP320928761
CSS287608
JavaScript284147400
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity29.50
▷ Minimum class complexity6.00
▷ Maximum class complexity76.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods36
▷ Static methods411.11%
▷ Public methods3494.44%
▷ Protected methods00.00%
▷ Private methods25.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
6 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/true.png23.41KB12.57KB▼ 46.30%
includes/images/location.png2.88KB1.93KB▼ 32.84%
includes/images/star.png39.75KB10.35KB▼ 73.95%
includes/images/support.png6.44KB5.59KB▼ 13.09%
includes/images/false.png27.71KB11.86KB▼ 57.20%