89% payfi-bnpl-payment-gateway

Code Review | Payfi BNPL Payment Gateway

WordPress plugin Payfi BNPL Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: payfi-bnpl-paymen...
  • Plugin version: 1.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 13, 2022
  • Latest release: Feb 2, 2023
  • Number of updates: 39
  • Update frequency: every 5.2 days
  • Top authors: mypayfi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /994 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: ▼4.64ms] Passed 4 tests

Server-side resources used by Payfi BNPL Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.87 ▼5.66
Dashboard /wp-admin3.31 ▲0.0148.58 ▼1.31
Posts /wp-admin/edit.php3.36 ▲0.0046.56 ▼1.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.93 ▼9.65
Media Library /wp-admin/upload.php3.23 ▲0.0040.83 ▲4.01

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Payfi BNPL Payment Gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.131.73 ▼0.2240.49 ▼2.40
Dashboard /wp-admin2,198 ▲215.52 ▼0.0788.44 ▼13.3739.18 ▼4.28
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0133.34 ▼6.8332.71 ▼1.71
Add New Post /wp-admin/post-new.php1,526 ▼223.10 ▲0.02689.79 ▲0.0952.03 ▼5.79
Media Library /wp-admin/upload.php1,403 ▲64.25 ▼0.12105.48 ▲2.8444.61 ▼1.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% 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
These attributes need to be fixed:
  • Requires php: Invalid plugin version format
  • Screenshots: Please add images for these screenshots: #1 (Payfi BNPL Payment Gateway for Woocommerce settings page), #2 (Payfi payment popup on the website)
The official readme.txt might help

payfi-bnpl-payment-gateway/woo-payfi.php 85% from 13 tests

The main PHP script in "Payfi BNPL Payment Gateway" version 1.7.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.0.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("payfi-bnpl-payment-gateway.php" instead of "woo-payfi.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
Everything looks great! No dangerous files found in this plugin965 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4370242789
JavaScript4298176

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity54.50
▷ Minimum class complexity9.00
▷ Maximum class complexity100.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/payfi.png57.78KB21.06KB▼ 63.55%
assets/images/payfi-banner.png6.36KB3.60KB▼ 43.49%
assets/images/payfi-logo.png1.85KB1.02KB▼ 44.53%