94% additional-fee

Code Review | WooCommerce Additional Fee

WordPress plugin WooCommerce Additional Fee scored 94% from 54 tests.

About plugin

  • Plugin page: additional-fee
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7.0
  • WordPress version: 5.9.2
  • First release: Jun 2, 2018
  • Latest release: Apr 5, 2021
  • Number of updates: 9
  • Update frequency: every 115.3 days
  • Top authors: mingocommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 875 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by WooCommerce Additional Fee
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0254.09 ▲3.59
Dashboard /wp-admin3.43 ▲0.0231.66 ▼0.90
Posts /wp-admin/edit.php3.65 ▲0.0136.05 ▲0.11
Add New Post /wp-admin/post-new.php6.90 ▼0.0795.59 ▼1,161.62
Media Library /wp-admin/upload.php3.30 ▲0.0023.29 ▼7.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Additional Fee
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.86 ▲0.175.76 ▼0.312.43 ▼0.10
Dashboard /wp-admin2,892 ▲316.12 ▼0.06128.34 ▼6.17158.32 ▲5.00
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0164.17 ▼0.92137.99 ▲1.36
Add New Post /wp-admin/post-new.php1,661 ▼016.46 ▲0.34414.42 ▲17.48156.49 ▲3.74
Media Library /wp-admin/upload.php1,701 ▲35.50 ▼0.02137.03 ▲3.34180.95 ▼10.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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
Even though no errors were found, 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/additional-fee/additional-fee.php:20

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)
There were no browser issues found


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: cart fee, custom fee, additional charge, additional fee, custom charge...

additional-fee/additional-fee.php Passed 13 tests

The principal PHP file in "WooCommerce Additional Fee" v. 1.2.1 is loaded by WordPress automatically on each request
41 characters long description:
Add additional fee/ Discount to your cart

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected133 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PO File19937

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods110.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin