88% woo-conditional-product-fees-for-checkout

Code Review | Extra Fees Plugin for WooCommerce

WordPress plugin Extra Fees Plugin for WooCommerce scored88%from 54 tests.

About plugin

  • Plugin page: woo-conditional-p...
  • Plugin version: 3.9.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 31, 2017
  • Latest release: Oct 31, 2023
  • Number of updates: 160
  • Update frequency: every 15.3 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

7,000+ active /164,280 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Extra Fees Plugin for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.85 ▼0.02
Dashboard /wp-admin3.31 ▼0.0452.78 ▼10.41
Posts /wp-admin/edit.php3.37 ▲0.0050.45 ▲2.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0082.24 ▼2.70
Media Library /wp-admin/upload.php3.24 ▲0.0033.11 ▼1.61

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 291 new files
Database: no new tables, 10 new options
New WordPress options
wcpfc_version
can_compress_scripts
fs_accounts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
fs_active_plugins
fs_debug_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for Extra Fees Plugin for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.25 ▼0.291.73 ▼0.0245.77 ▲2.72
Dashboard /wp-admin2,192 ▲155.52 ▼0.1486.43 ▼11.9337.33 ▼6.62
Posts /wp-admin/edit.php2,100 ▲212.01 ▼0.0138.79 ▲3.6036.36 ▲2.76
Add New Post /wp-admin/post-new.php1,531 ▼423.16 ▲4.90657.13 ▼6.0546.99 ▼32.19
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0399.20 ▼0.8544.41 ▲3.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_accounts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • wcpfc_version
    • fs_active_plugins
    • widget_recent-posts

Smoke tests Passed 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)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
  • Screenshots: These screenshots require images: #9 (Premium - Charge flexible extra fee), #10 (Premium - Extra fee based on the country), #11 (Premium - Extra fee based on specific user/user role), #12 (Premium - Extra fee based on cart total and product quantity), #13 (Premium - Extra fee based on specific payment methods), #14 (Premium - Extra fee based on specific shipping methods), #15 (Premium - Dashboard for check revenue of fee), #16 (Premium - Import/Export of fee's setting)
Please take inspiration from this readme.txt

woo-conditional-product-fees-for-checkout/woocommerce-conditional-product-fees-for-checkout.php 77% from 13 tests

This is the main PHP file of "Extra Fees Plugin for WooCommerce" version 3.9.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "4.5")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-conditional-product-fees-for-checkout.php" instead of "woocommerce-conditional-product-fees-for-checkout.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin50,486 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
PHP1418,93719,05540,447
PO File41,9683,8555,326
JavaScript103764592,921
CSS2461791,033
SVG900702
XML10057

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 208)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity90.68
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.99
▷ Minimum method complexity1.00
▷ Maximum method complexity208.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,422
▷ Static methods21214.91%
▷ Public methods1,01471.31%
▷ Protected methods201.41%
▷ Private methods38827.29%
Functions116
▷ Named functions11599.14%
▷ Anonymous functions10.86%
Constants160
▷ Global constants10968.12%
▷ Class constants5131.87%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
27 PNG files occupy 3.13MB with 1.85MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/Getting_Started_02.png154.32KB45.38KB▼ 70.59%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/images/Getting_Started_03.png147.31KB38.03KB▼ 74.18%
admin/images/list-arrow-icon.png3.56KB2.01KB▼ 43.62%
admin/images/pro-features-img/feature-box-one-img.png347.91KB123.49KB▼ 64.50%