84% woo-add-custom-fee

Code Review | Add Custom Fee to WooCommerce

WordPress plugin Add Custom Fee to WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-add-custom-fee
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 11, 2016
  • Latest release: May 24, 2022
  • Number of updates: 48
  • Update frequency: every 47.8 days
  • Top authors: wooexpert (75%)wpexpertsio (27.08%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /14,294 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.00MB] [CPU: ▼6.26ms] Passed 4 tests

Server-side resources used by Add Custom Fee to WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.94 ▲3.10
Dashboard /wp-admin3.31 ▲0.0048.10 ▼1.51
Posts /wp-admin/edit.php3.36 ▲0.0052.11 ▼4.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.36 ▼17.48
Media Library /wp-admin/upload.php3.23 ▲0.0035.87 ▼1.90

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Add Custom Fee to WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.72 ▲0.371.91 ▼0.0342.89 ▲0.68
Dashboard /wp-admin2,195 ▲145.63 ▼0.1089.85 ▼14.9741.43 ▼2.58
Posts /wp-admin/edit.php2,103 ▼02.00 ▲0.0348.05 ▲7.6037.81 ▲2.65
Add New Post /wp-admin/post-new.php1,528 ▼823.01 ▲4.59686.59 ▲8.1062.44 ▼18.70
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.0498.34 ▼23.4242.04 ▼7.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-add-custom-fee/classes/wacf_settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-add-custom-fee/classes/wacf_functions.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-add-custom-fee/classes/wacf_functions.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: woocommerce, cart fee, additional fee, extra fee, woocommerce fee...

woo-add-custom-fee/woo-add-custom-fee.php.php 85% from 13 tests

The entry point to "Add Custom Fee to WooCommerce" version 1.6 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-add-custom-fee.php" instead of "woo-add-custom-fee.php.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin198 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33857184
JavaScript13014

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity8.50
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods9100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin