77% advance-cash-on-delivery-for-woocommerce

Code Review | Advance Cash On Delivery For WooCommerce

WordPress plugin Advance Cash On Delivery For WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: advance-cash-on-d...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.1
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: Sep 16, 2023
  • Number of updates: 12
  • Update frequency: every 44.6 days
  • Top authors: shoroar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 3,649 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▼3.49ms] Passed 4 tests

A check of server-side resources used by Advance Cash On Delivery For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3329.40 ▼9.89
Dashboard /wp-admin3.65 ▲0.3551.76 ▼1.02
Posts /wp-admin/edit.php3.76 ▲0.4145.64 ▼0.68
Add New Post /wp-admin/post-new.php6.23 ▲0.3486.76 ▼2.36
Media Library /wp-admin/upload.php3.57 ▲0.3436.24 ▲0.45

Server storage [IO: ▲0.35MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • The plugin illegally modified 1 file (0.92KB) outside of "wp-content/plugins/advance-cash-on-delivery-for-woocommerce/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
coderockz-wc-advance-cod-free-activation-time

Browser metrics Passed 4 tests

Checking browser requirements for Advance Cash On Delivery For WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,474 ▼26114.84 ▲0.200.52 ▼1.3219.20 ▼19.29
Dashboard /wp-admin2,215 ▲265.20 ▲0.23115.92 ▲2.9843.28 ▲1.05
Posts /wp-admin/edit.php2,098 ▲92.24 ▲0.2332.93 ▼4.3231.90 ▼7.72
Add New Post /wp-admin/post-new.php1,522 ▼723.46 ▲5.34653.70 ▼6.7846.82 ▼5.29
Media Library /wp-admin/upload.php1,394 ▲64.32 ▲0.1294.25 ▼4.5745.88 ▼3.30

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 did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • coderockz-wc-advance-cod-free-activation-time
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/advance-cash-on-delivery-for-woocommerce/public/partials/coderockz-wc-advance-cod-free-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Zones' not found in wp-content/plugins/advance-cash-on-delivery-for-woocommerce/admin/partials/coderockz-wc-advance-cod-free-admin-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: smart cash on delivery, cash on delivery, woocommerce smart cash on delivery, woocommerce, woocommerce cash on delivery...

advance-cash-on-delivery-for-woocommerce/coderockz-wc-advance-cod-free.php 85% from 13 tests

Analyzing the main PHP file in "Advance Cash On Delivery For WooCommerce" version 1.0.5
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advance-cash-on-delivery-for-woocommerce.php" instead of "coderockz-wc-advance-cod-free.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected3,484 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP136865661,947
CSS433971,503
JavaScript51534

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 286)
Cyclomatic complexity
Average complexity per logical line of code0.80
Average class complexity67.88
▷ Minimum class complexity1.00
▷ Maximum class complexity298.00
Average method complexity9.58
▷ Minimum method complexity1.00
▷ Maximum method complexity286.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods54
▷ Static methods23.70%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants4
▷ Global constants4100.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ui-icons_454545_256x240.png6.91KB4.18KB▼ 39.44%
admin/images/cod-logo.png6.34KB6.45KB0.00%