78% wc-smart-cod

Code Review | WooCommerce Smart COD

WordPress plugin WooCommerce Smart COD scored78%from 54 tests.

About plugin

  • Plugin page: wc-smart-cod
  • Plugin version: 1.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-6.3
  • WordPress version: 6.3.1
  • First release: Jun 27, 2017
  • Latest release: Oct 29, 2023
  • Number of updates: 74
  • Update frequency: every 31.3 days
  • Top authors: fullstackhouse (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

40,000+ active /171,635 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.11ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Smart COD
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.23 ▼1.38
Dashboard /wp-admin3.37 ▲0.0744.46 ▼4.35
Posts /wp-admin/edit.php3.48 ▲0.1349.34 ▼2.57
Add New Post /wp-admin/post-new.php5.97 ▲0.0880.89 ▼16.14
Media Library /wp-admin/upload.php3.29 ▲0.0637.06 ▲3.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Smart COD
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.36 ▼0.171.79 ▲0.2339.57 ▼9.18
Dashboard /wp-admin2,199 ▲195.63 ▲0.0186.23 ▼1.7737.65 ▼0.65
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0440.17 ▼2.3336.41 ▼1.74
Add New Post /wp-admin/post-new.php1,530 ▲223.19 ▲0.42684.85 ▲62.8453.04 ▼10.81
Media Library /wp-admin/upload.php1,404 ▲104.19 ▼0.0095.17 ▼7.8044.61 ▲2.04

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-smart-cod/public/partials/wc-smart-cod-public-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_COD' not found in wp-content/plugins/wc-smart-cod/admin/class-wc-smart-cod-admin.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Smart_Cod' not found in wp-content/plugins/wc-smart-cod/admin/partials/wc-smart-cod-admin-display.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: woocommerce, woocommerce cod, cod, cod extra fee, cash on delivery...

wc-smart-cod/wc-smart-cod.php 85% from 13 tests

The main PHP file in "WooCommerce Smart COD" ver. 1.7.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "2.7")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,235 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP136255742,036
CSS5474179
JavaScript43020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity49.88
▷ Minimum class complexity1.00
▷ Maximum class complexity218.00
Average method complexity5.20
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods93
▷ Static methods66.45%
▷ Public methods4851.61%
▷ Protected methods2830.11%
▷ Private methods1718.28%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin