84% simple-cod-fee-for-woocommerce

Code Review | Simple COD Fees for WooCommerce

WordPress plugin Simple COD Fees for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: simple-cod-fee-fo...
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: Jun 11, 2023
  • Number of updates: 24
  • Update frequency: every 21.2 days
  • Top authors: asofantzis (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /6,012 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.10ms] Passed 4 tests

This is a short check of server-side resources used by Simple COD Fees for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.79 ▼0.40
Dashboard /wp-admin3.31 ▲0.0046.14 ▼0.76
Posts /wp-admin/edit.php3.36 ▲0.0046.63 ▼4.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.37 ▼30.69
Media Library /wp-admin/upload.php3.23 ▲0.0037.71 ▲2.19

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple COD Fees for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.72 ▼0.001.72 ▼0.0943.01 ▲2.10
Dashboard /wp-admin2,195 ▲155.56 ▼0.0680.23 ▼5.1936.48 ▼3.19
Posts /wp-admin/edit.php2,097 ▼31.99 ▲0.0033.42 ▼6.4535.61 ▼3.14
Add New Post /wp-admin/post-new.php1,526 ▼421.20 ▼1.94669.93 ▲44.4049.07 ▼3.17
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.05110.72 ▲9.0646.79 ▲3.64

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
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-cod-fee-for-woocommerce/includes/admin-menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-cod-fee-for-woocommerce/includes/admin-menu.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #3 (Different cod fee for each shipping method), #4 (Different cod fee for each currency per shipping method)
You can take inspiration from this readme.txt

simple-cod-fee-for-woocommerce/simple-cod-fee-for-woocommerce.php 92% from 13 tests

The entry point to "Simple COD Fees for WooCommerce" version 2.0.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,072 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP317657903
PO File172136166
JavaScript2002
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions1142.31%
▷ Anonymous functions1557.69%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin