84% woo-cart-additional-fee

Code Review | Woocommerce Cart Additional Fee

WordPress plugin Woocommerce Cart Additional Fee scored84%from 54 tests.

About plugin

  • Plugin page: woo-cart-addition...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 17, 2018
  • Latest release: Aug 27, 2023
  • Number of updates: 11
  • Update frequency: every 178.2 days
  • Top authors: sajjad67 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,022 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Woocommerce Cart Additional Fee
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0043.82 ▼0.84
Dashboard /wp-admin3.31 ▼0.0449.68 ▼11.27
Posts /wp-admin/edit.php3.36 ▲0.0045.31 ▼3.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.67 ▼15.78
Media Library /wp-admin/upload.php3.23 ▲0.0036.20 ▼2.30

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Cart Additional Fee
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.70 ▲0.092.03 ▲0.1744.39 ▲0.52
Dashboard /wp-admin2,198 ▲215.60 ▼0.0991.72 ▼2.1837.59 ▼4.64
Posts /wp-admin/edit.php2,100 ▼32.02 ▼0.0036.88 ▼0.2033.51 ▼5.01
Add New Post /wp-admin/post-new.php1,545 ▲2023.24 ▲5.41669.02 ▲20.2658.13 ▲3.77
Media Library /wp-admin/upload.php1,400 ▲94.20 ▲0.02100.37 ▲2.8742.98 ▼2.76

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-cart-additional-fee/includes/wcfee_add_settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-cart-additional-fee/includes/wcfee_apply_fee.php:7

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

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

woo-cart-additional-fee/woo-cart-additional-fee.php 92% from 13 tests

"Woocommerce Cart Additional Fee" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 146 characters long)

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
Everything looks great! No dangerous files found in this plugin296 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP36888233
JavaScript113063

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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