10% payment-gateway-for-fio-with-wc

Code Review | Payment Gateway for FIO with WooCommerce

WordPress plugin Payment Gateway for FIO with WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: payment-gateway-f...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 5.8.1
  • First release: Nov 18, 2020
  • Latest release: Jan 13, 2021
  • Number of updates: 6
  • Update frequency: every 10.7 days
  • Top authors: eosbarcelona (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 190 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, class '\WSB\Activator' not found

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

A check of server-side resources used by Payment Gateway for FIO with WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0433.68 ▼1.09
Dashboard /wp-admin3.09 ▲0.0443.58 ▼1.38
Posts /wp-admin/edit.php3.15 ▲0.0443.43 ▼1.94
Add New Post /wp-admin/post-new.php5.45 ▲0.0289.47 ▼560.83
Media Library /wp-admin/upload.php3.04 ▲0.0433.81 ▲0.83

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Payment Gateway for FIO with WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲10116.27 ▲0.379.54 ▼0.8845.96 ▲1.24
Dashboard /wp-admin2,974 ▲435.85 ▼0.13138.44 ▼10.57106.76 ▼2.70
Posts /wp-admin/edit.php2,743 ▲42.72 ▲0.0065.24 ▼0.8086.74 ▼5.66
Add New Post /wp-admin/post-new.php1,607 ▼7618.61 ▲0.01386.23 ▼3.29113.32 ▲3.64
Media Library /wp-admin/upload.php1,811 ▲45.00 ▼0.02165.74 ▲7.92121.04 ▲11.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payment-gateway-for-fio-with-wc/includes/class-fio-ajax.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payment-gateway-for-fio-with-wc/includes/class-wc-gateway-fio.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: digital currency, fio, woocommerce, bitcoin, payment gateway...

payment-gateway-for-fio-with-wc/woocommerce-gateway-fio.php 92% from 13 tests

The main PHP file in "Payment Gateway for FIO with WooCommerce" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payment-gateway-for-fio-with-wc.php" instead of "woocommerce-gateway-fio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,199 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP6168204628
PO File4168168450
Sass17068
CSS114449
JavaScript4094

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.80
▷ Minimum class complexity7.00
▷ Maximum class complexity28.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods51
▷ Static methods2345.10%
▷ Public methods4282.35%
▷ Protected methods11.96%
▷ Private methods815.69%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/pay_with_fio.png1.33KB0.71KB▼ 46.41%
assets/img/copy.png0.42KB0.34KB▼ 19.59%