83% fena-ecommerce

Code Review | Fena Payment Gateway for WooCommerce

WordPress plugin Fena Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: fena-ecommerce
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 6, 2022
  • Latest release: Sep 25, 2023
  • Number of updates: 40
  • Update frequency: every 9.9 days
  • Top authors: fenalabsltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,285 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.91ms] Passed 4 tests

A check of server-side resources used by Fena Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.35 ▼0.72
Dashboard /wp-admin3.31 ▲0.0043.40 ▼4.08
Posts /wp-admin/edit.php3.36 ▲0.0043.09 ▼4.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.50 ▼2.30
Media Library /wp-admin/upload.php3.23 ▲0.0035.09 ▲2.75

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fena Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.38 ▲0.111.73 ▲0.0442.94 ▼2.28
Dashboard /wp-admin2,199 ▲225.56 ▼0.0683.66 ▼3.1739.10 ▲0.02
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0434.28 ▼0.5933.44 ▼2.26
Add New Post /wp-admin/post-new.php1,533 ▲523.11 ▲0.15679.52 ▲30.2758.29 ▼0.19
Media Library /wp-admin/upload.php1,407 ▲104.19 ▲0.01109.87 ▲9.2848.12 ▲3.34

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 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
Almost there! Just fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/ConnectionTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/ProviderTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/fena-ecommerce/src/FenaPaymentGateway.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fena-ecommerce/fena-commerce-gateway.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/DeliveryAddressTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/PaymentTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/NotificationHandlerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/ErrorTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/UserTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fena-ecommerce/vendor/fena/php-payment-sdk/tests/ItemTest.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

fena-ecommerce/fena-commerce-gateway.php 85% from 13 tests

The entry point to "Fena Payment Gateway for WooCommerce" version 1.2.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fena-ecommerce.php" instead of "fena-commerce-gateway.php")

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 plugin2,610 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP375426992,392
JSON30098
Markdown227078
SVG10022
XML10020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.73
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes26.67%
Methods173
▷ Static methods3721.39%
▷ Public methods15891.33%
▷ Protected methods00.00%
▷ Private methods158.67%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants28
▷ Global constants00.00%
▷ Class constants28100.00%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected