73% payment-fees-for-woocommerce

Code Review | Payment Fees for WooCommerce

WordPress plugin Payment Fees for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: payment-fees-for-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 27, 2022
  • Latest release: Jun 18, 2023
  • Number of updates: 13
  • Update frequency: every 25.1 days
  • Top authors: maxaryus (53.85%)astiges (53.85%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,862 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by Payment Fees for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.88 ▼9.09
Dashboard /wp-admin3.33 ▲0.0355.46 ▼3.82
Posts /wp-admin/edit.php3.38 ▲0.0353.31 ▲10.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0379.30 ▼17.10
Media Library /wp-admin/upload.php3.26 ▲0.0335.06 ▲0.13
Payment Method Fees /wp-admin/admin.php?page=pffw_setup_admin_payment_method_fees_view3.2329.33
Category Fees /wp-admin/admin.php?page=pffw_setup_admin_category_fees_view3.2332.57

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Payment Fees for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.72 ▲0.351.61 ▼0.0740.85 ▼4.51
Dashboard /wp-admin2,218 ▲415.52 ▼0.06102.18 ▲6.2046.89 ▲3.45
Posts /wp-admin/edit.php2,126 ▲261.94 ▼0.0635.03 ▼7.6030.25 ▼8.42
Add New Post /wp-admin/post-new.php1,545 ▲923.58 ▲5.44713.71 ▲84.7153.01 ▼17.74
Media Library /wp-admin/upload.php1,423 ▲204.20 ▲0.0198.91 ▲2.0140.45 ▼0.47
Payment Method Fees /wp-admin/admin.php?page=pffw_setup_admin_payment_method_fees_view7301.126.9723.61
Category Fees /wp-admin/admin.php?page=pffw_setup_admin_category_fees_view8871.9921.5525.10

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=pffw_setup_admin_payment_method_fees_view
    • > Error in wp-content/plugins/payment-fees-for-woocommerce/template/admin_payment_method_fees_view.php+50
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/payment-fees-for-woocommerce/template/admin_payment_method_fees_view.php:50
    Stack trace:
    #0 wp-content/plugins/payment-fees-for-woocommerce/payment-fees-for-woocommerce.php(61): require_once()
    #1 wp-includes/class-wp-hook.php(310): Payment_Fees_For_WooCommerce->pffw_setup_admin_payment_method_fees_view()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pffw_setup_admin_category_fees_view
    • > Notice in wp-content/plugins/payment-fees-for-woocommerce/template/admin_category_fees_view.php+54
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pffw_setup_admin_category_fees_view
    • > Notice in wp-content/plugins/payment-fees-for-woocommerce/template/admin_category_fees_view.php+61
    Trying to get property 'name' of non-object

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/payment-fees-for-woocommerce/template/admin_general_settings_page.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/payment-fees-for-woocommerce/template/admin_payment_method_fees_view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/payment-fees-for-woocommerce/template/admin_category_fees_view.php:2

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: fees, woocommerce, payments

payment-fees-for-woocommerce/payment-fees-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Payment Fees for WooCommerce" version 1.1.0
93 characters long description:
Allows setting fees for categories in WooCommerce based on paymentmethod and general category

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin250 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP65928250

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin