83% tillit-payment-gateway

Code Review | Two - BNPL for businesses

WordPress plugin Two - BNPL for businesses scored83%from 54 tests.

About plugin

  • Plugin page: tillit-payment-ga...
  • Plugin version: 2.16.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2021
  • Latest release: Nov 22, 2023
  • Number of updates: 92
  • Update frequency: every 9.8 days
  • Top authors: tillit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,046 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.13ms] Passed 4 tests

Analyzing server-side resources used by Two - BNPL for businesses
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.63 ▼2.86
Dashboard /wp-admin3.33 ▲0.0246.66 ▼3.46
Posts /wp-admin/edit.php3.38 ▲0.0248.74 ▼0.80
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.84 ▼5.41
Media Library /wp-admin/upload.php3.25 ▲0.0232.71 ▲0.66

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Two - BNPL for businesses
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.04 ▼0.241.61 ▼0.1741.47 ▼11.05
Dashboard /wp-admin2,195 ▲215.66 ▲0.1392.92 ▼5.0045.19 ▲7.75
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0440.90 ▼0.7439.21 ▲2.72
Add New Post /wp-admin/post-new.php1,526 ▼923.41 ▼1.83669.02 ▲17.9453.40 ▼13.23
Media Library /wp-admin/upload.php1,397 ▼04.21 ▼0.0796.39 ▼6.5740.73 ▼1.23

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/tillit-payment-gateway/views/woocommerce_order_pay.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/tillit-payment-gateway/tillit-payment-gateway.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/tillit-payment-gateway/views/woocommerce_after_checkout_billing_form.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/tillit-payment-gateway/class/WC_Twoinc.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/tillit-payment-gateway/views/woocommerce_checkout.php:5

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

tillit-payment-gateway/tillit-payment-gateway.php 92% from 13 tests

Analyzing the main PHP file in "Two - BNPL for businesses" version 2.16.6
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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 plugin6,648 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP75148172,787
JavaScript44354231,815
CSS112801,224
PO File2254264699
Markdown119076
SVG70032
TOML11015

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity133.33
▷ Minimum class complexity11.00
▷ Maximum class complexity271.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods95
▷ Static methods4244.21%
▷ Public methods7882.11%
▷ Protected methods00.00%
▷ Private methods1717.89%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 1.21MB with 0.76MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner.png998.21KB372.65KB▼ 62.67%
assets/intl-tel-input/17.0.8/img/flags@2x.png170.28KB68.04KB▼ 60.04%
assets/intl-tel-input/17.0.8/img/flags.png69.20KB23.42KB▼ 66.16%