84% additional-fee

Code Review | WooCommerce Additional Fee

WordPress plugin WooCommerce Additional Fee scored84%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: 6.3.1
  • 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 /1,151 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.60ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Additional Fee
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.06 ▼3.46
Dashboard /wp-admin3.33 ▲0.0344.52 ▼6.81
Posts /wp-admin/edit.php3.39 ▲0.0344.56 ▼0.36
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.13 ▼23.77
Media Library /wp-admin/upload.php3.26 ▲0.0335.33 ▲0.05

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Additional Fee
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.101.83 ▲0.0139.47 ▼9.77
Dashboard /wp-admin2,206 ▲155.80 ▲0.89109.91 ▲9.0040.78 ▼5.70
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0339.82 ▲1.8435.75 ▲2.71
Add New Post /wp-admin/post-new.php1,533 ▼1123.06 ▲4.70681.13 ▲58.6064.55 ▲3.05
Media Library /wp-admin/upload.php1,385 ▲34.25 ▲0.0693.39 ▼4.1944.04 ▲2.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× 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/additional-fee/additional-fee.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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: additional charge, woocommerce additional fee, additional fee, custom fee, cart discount...

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

The entry point to "WooCommerce Additional Fee" version 1.2.1 is a PHP file that has certain tags in its header comment area
41 characters long description:
Add additional fee/ Discount to your cart

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected133 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1201096
PO File19937

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected