93% betterpay

Code Review | Betterpay for WooCommerce

WordPress plugin Betterpay for WooCommerce scored 93% from 53 tests.

About plugin

  • Plugin page: betterpay
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.8
  • WordPress version: 5.8.1
  • First release: Sep 14, 2021
  • Latest release: Sep 14, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: shahrul1995 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 55 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼272.48ms] Passed 4 tests

This is a short check of server-side resources used by Betterpay for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0127.65 ▼1.75
Dashboard /wp-admin3.07 ▲0.0137.23 ▼3.56
Posts /wp-admin/edit.php3.12 ▲0.0138.26 ▼11.31
Add New Post /wp-admin/post-new.php5.43 ▲0.0096.73 ▼1,070.34
Media Library /wp-admin/upload.php3.01 ▲0.0030.22 ▼4.72

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Betterpay for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲6816.24 ▲0.278.10 ▼0.1246.78 ▼1.40
Dashboard /wp-admin2,931 ▲785.93 ▲0.09138.67 ▼0.09102.71 ▼0.94
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0062.66 ▼0.0788.33 ▲1.85
Add New Post /wp-admin/post-new.php1,653 ▼018.78 ▲0.20361.83 ▲4.35105.70 ▼9.22
Media Library /wp-admin/upload.php1,778 ▲65.00 ▲0.01153.70 ▼12.11112.05 ▼0.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/betterpay/src/Betterpay.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #1, #10, #11, #12, #2, #3, #4, #5, #6, #7, #8, #9 in betterpay/assets to your readme.txt
You can look at the official readme.txt

betterpay/index.php 85% from 13 tests

The principal PHP file in "Betterpay for WooCommerce" v. 1.1.0 is loaded by WordPress automatically on each request
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.3" instead of "2.6.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("betterpay.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin523 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP211635523

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity99.00
▷ Minimum class complexity99.00
▷ Maximum class complexity99.00
Average method complexity13.25
▷ Minimum method complexity1.00
▷ Maximum method complexity95.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin