78% woo-extra-fee

Code Review | Extra Fee on cart for WooCommerce

WordPress plugin Extra Fee on cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-extra-fee
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-6.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2016
  • Latest release: Aug 7, 2023
  • Number of updates: 18
  • Update frequency: every 144.8 days
  • Top authors: freewebmentor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,361 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.62ms] Passed 4 tests

This is a short check of server-side resources used by Extra Fee on cart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.00 ▲0.82
Dashboard /wp-admin3.32 ▲0.0245.39 ▼8.43
Posts /wp-admin/edit.php3.37 ▲0.0249.50 ▲1.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.11 ▼12.50
Media Library /wp-admin/upload.php3.25 ▲0.0237.94 ▲4.43
Extra Fee Options /wp-admin/admin.php?page=wc-extra-fee3.1930.63

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

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

Browser metrics Passed 4 tests

Extra Fee on cart for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.48 ▲0.071.91 ▼0.0644.44 ▼0.53
Dashboard /wp-admin2,211 ▲264.87 ▼0.05102.98 ▼12.9539.55 ▼6.16
Posts /wp-admin/edit.php2,094 ▲52.03 ▲0.0240.31 ▲3.2535.34 ▲1.37
Add New Post /wp-admin/post-new.php1,540 ▲2318.22 ▲0.56601.22 ▼46.6356.23 ▼0.64
Media Library /wp-admin/upload.php1,384 ▲24.18 ▲0.0398.49 ▲2.1141.14 ▼1.26
Extra Fee Options /wp-admin/admin.php?page=wc-extra-fee8742.0624.7925.07

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wc-extra-fee
    • > Notice in wp-content/plugins/woo-extra-fee/admin/settings.php+68
    Trying to access array offset on value of type bool

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 fix the following
  • 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/woo-extra-fee/admin/settings.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === woo-extra-fee === )
The official readme.txt might help

woo-extra-fee/wc-extra-fee.php 92% from 13 tests

"Extra Fee on cart for WooCommerce" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-extra-fee.php" instead of "wc-extra-fee.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin115 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21619114
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.27MB with 0.14MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png19.56KB6.65KB▼ 66.01%
screenshot-1.png257.73KB59.92KB▼ 76.75%
img/woo_16.png0.49KB0.43KB▼ 11.24%