78% best2pay-payment-method-visamastercard

Code Review | best2pay payment method

WordPress plugin best2pay payment method scored 78% from 54 tests.

About plugin

  • Plugin page: best2pay-payment-...
  • Plugin version: 1.2.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: May 13, 2021
  • Latest release: Sep 7, 2023
  • Number of updates: 37
  • Update frequency: every 23.2 days
  • Top authors: best2pay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 840 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.09MB] [CPU: ▼4.70ms] Passed 4 tests

An overview of server-side resources used by best2pay payment method
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0935.61 ▼1.89
Dashboard /wp-admin3.39 ▲0.0944.88 ▼5.02
Posts /wp-admin/edit.php3.50 ▲0.1542.56 ▼5.06
Add New Post /wp-admin/post-new.php5.97 ▲0.0991.96 ▼6.84
Media Library /wp-admin/upload.php3.31 ▲0.0932.21 ▲1.18

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for best2pay payment method
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.59 ▼0.811.66 ▼0.0740.83 ▼7.17
Dashboard /wp-admin2,209 ▲215.85 ▲0.96104.72 ▼4.2644.29 ▼1.12
Posts /wp-admin/edit.php2,089 ▲32.03 ▲0.0338.07 ▼0.5134.06 ▲0.30
Add New Post /wp-admin/post-new.php1,533 ▼123.24 ▼0.08608.94 ▼22.9658.57 ▼0.14
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0197.14 ▼1.2041.53 ▼2.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/best2pay-payment-method-visamastercard/best2pay-payment_method.php
    • > /wp-content/plugins/best2pay-payment-method-visamastercard/halva_widget.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined index: amount in wp-content/plugins/best2pay-payment-method-visamastercard/halva_widget.php on line 97

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 Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: e-commerce, payments, best2pay

best2pay-payment-method-visamastercard/best2pay-payment_method.php 85% from 13 tests

"best2pay payment method" version 1.2.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("best2pay-payment-method-visamastercard.php" instead of "best2pay-payment_method.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,308 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP28392614
SVG300377
CSS1170197
PO File1333898
JavaScript12118
Bourne Shell1104

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1473.68%
▷ Protected methods00.00%
▷ Private methods526.32%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png44.10KB15.34KB▼ 65.21%
best2pay.png5.70KB2.74KB▼ 51.99%
assets/icon-256x256.png5.70KB2.74KB▼ 51.99%
assets/banner-772x250.png139.96KB58.91KB▼ 57.91%