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.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Apr 1, 2022
  • Latest release: Apr 1, 2022
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: shoroar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 11 total downloads


Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.31MB] [CPU: ▼306.45ms] Passed 4 tests

A check of server-side resources used by Advance Cash On Delivery For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.2961.38 ▲5.87
Dashboard /wp-admin3.76 ▲0.3538.56 ▲0.67
Posts /wp-admin/edit.php3.98 ▲0.3445.28 ▲3.63
Add New Post /wp-admin/post-new.php7.23 ▲0.2698.05 ▼1,225.95
Media Library /wp-admin/upload.php3.63 ▲0.3329.81 ▼4.15

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

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • 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, 1 new option
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Advance Cash On Delivery For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,219 ▼53516.16 ▲0.310.32 ▼5.9030.75 ▲27.72
Dashboard /wp-admin2,933 ▲466.76 ▲0.16143.11 ▲3.34166.63 ▲6.64
Posts /wp-admin/edit.php2,700 ▲63.46 ▲0.0362.77 ▲0.07138.67 ▼4.40
Add New Post /wp-admin/post-new.php1,719 ▲221.11 ▼1.72464.72 ▲24.70178.10 ▲13.70
Media Library /wp-admin/upload.php1,710 ▲126.04 ▲0.31134.57 ▼11.27182.35 ▼17.25

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 1 option in the database
    • coderockz-wc-advance-cod-free-activation-time

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /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
No browser issues were found


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: woocommerce, woocommerce smart cash on delivery, smart cash on delivery, woocommerce advance cash on delivery, cash on delivery...

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

The main PHP file in "Advance Cash On Delivery For WooCommerce" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • 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")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin3,484 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 282)
Cyclomatic complexity
Average complexity per logical line of code0.79
Average class complexity67.38
▷ Minimum class complexity1.00
▷ Maximum class complexity294.00
Average method complexity9.51
▷ Minimum method complexity1.00
▷ Maximum method complexity282.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods23.70%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
▷ Named functions360.00%
▷ Anonymous functions240.00%
▷ Global constants4100.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
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%