84% woo-custom-fee

Code Review | Custom Fee Woocommerce

WordPress plugin Custom Fee Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-custom-fee
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 15, 2015
  • Latest release: Dec 9, 2022
  • Number of updates: 47
  • Update frequency: every 54.9 days
  • Top authors: vidishp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /8,403 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.91ms] Passed 4 tests

This is a short check of server-side resources used by Custom Fee Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.48 ▼8.69
Dashboard /wp-admin3.31 ▲0.0146.25 ▼2.16
Posts /wp-admin/edit.php3.36 ▲0.0143.41 ▼2.91
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.33 ▼9.88
Media Library /wp-admin/upload.php3.23 ▲0.0134.19 ▲1.04

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Custom Fee Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.165.63 ▲3.3543.34 ▼0.87
Dashboard /wp-admin2,209 ▲215.83 ▲0.9397.17 ▼20.6640.38 ▼2.46
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0236.06 ▼4.2532.62 ▼1.26
Add New Post /wp-admin/post-new.php1,514 ▼017.64 ▼0.06693.64 ▼2.6956.61 ▲2.68
Media Library /wp-admin/upload.php1,391 ▲64.17 ▼0.0194.56 ▼13.8540.76 ▼7.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-custom-fee/woo-custom-fee.php:18

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can look at the official readme.txt

woo-custom-fee/woo-custom-fee.php Passed 13 tests

This is the main PHP file of "Custom Fee Woocommerce" version 1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
130 characters long description:
This plugin allows user to add custom fee to user's order total. It allows admin to change fees description and amount from admin.

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
Everything looks great! No dangerous files found in this plugin133 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11926133

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.11MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png42.04KB16.81KB▼ 60.02%
screenshot-1.png71.77KB27.73KB▼ 61.36%