93% faizpay-commerce

Code Review | Fena Payment Gateway for WooCommerce

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

About plugin

  • Plugin page: faizpay-commerce
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6.2
  • WordPress version: 5.9.2
  • First release: Feb 7, 2021
  • Latest release: Nov 29, 2021
  • Number of updates: 9
  • Update frequency: every 33.0 days
  • Top authors: faizpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 268 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Fena Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1257.13 ▲6.51
Dashboard /wp-admin3.46 ▲0.0535.44 ▼41.16
Posts /wp-admin/edit.php3.69 ▲0.0543.58 ▲3.98
Add New Post /wp-admin/post-new.php6.93 ▼0.0491.02 ▼1,188.98
Media Library /wp-admin/upload.php3.34 ▲0.0532.65 ▲6.23

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Fena Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,807 ▲6315.23 ▼0.435.96 ▲0.032.46 ▲0.32
Dashboard /wp-admin2,907 ▲566.14 ▼0.06118.48 ▼14.92156.45 ▼6.17
Posts /wp-admin/edit.php2,701 ▲143.24 ▲0.0193.96 ▲16.39145.82 ▼1.81
Add New Post /wp-admin/post-new.php1,698 ▼5421.18 ▲0.23483.08 ▲6.29200.44 ▲36.98
Media Library /wp-admin/upload.php1,704 ▲65.52 ▲0.01164.83 ▲13.95241.54 ▲45.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/ErrorTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/DeliveryAddressTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/ItemTest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/faizpay-commerce/faizpay-commerce-gateway.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/ProviderTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/UserTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/NotificationHandlerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/PaymentTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/faizpay-commerce/vendor/faizpay/php-payment-sdk/tests/ConnectionTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/faizpay-commerce/src/FaizPayPaymentGateway.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #1 is required in faizpay-commerce/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

faizpay-commerce/faizpay-commerce-gateway.php 77% from 13 tests

The principal PHP file in "Fena Payment Gateway for WooCommerce" v. 1.0.12 is loaded by WordPress automatically on each request
It is important 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: Please rename the main PHP file in this plugin to the plugin slug ("faizpay-commerce.php" instead of "faizpay-commerce-gateway.php")
  • Git Repository: An alternative Git repository was detected

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
Good job! No executable or dangerous file extensions detected3,277 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP446457252,640
Markdown3700279
JSON400188
SVG606150
XML10020

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.92
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes36
▷ Abstract classes00.00%
▷ Concrete classes36100.00%
▷ Final classes25.56%
Methods185
▷ Static methods5228.11%
▷ Public methods16086.49%
▷ Protected methods00.00%
▷ Private methods2513.51%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin