83% powercash21-payments-gateway

Code Review | payabl. Payments Gateway

WordPress plugin payabl. Payments Gateway scored83%from 54 tests.

About plugin

  • Plugin page: powercash21-payme...
  • Plugin version: 2.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.3-6.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Apr 4, 2023
  • Number of updates: 18
  • Update frequency: every 63.3 days
  • Top authors: fazley (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,391 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.05MB] [CPU: ▼8.87ms] Passed 4 tests

Server-side resources used by payabl. Payments Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.95 ▼0.5217.13 ▼28.70
Dashboard /wp-admin3.41 ▲0.1146.38 ▼0.90
Posts /wp-admin/edit.php3.46 ▲0.1149.07 ▲1.37
Add New Post /wp-admin/post-new.php5.99 ▲0.1189.57 ▼6.21
Media Library /wp-admin/upload.php3.33 ▲0.1134.18 ▲0.33

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

payabl. Payments Gateway: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,449 ▼29713.94 ▼0.420.53 ▼0.9819.73 ▼19.71
Dashboard /wp-admin2,199 ▲275.64 ▼0.0189.15 ▼15.3643.89 ▲1.31
Posts /wp-admin/edit.php2,104 ▲71.97 ▼0.0640.43 ▲5.4036.45 ▼2.13
Add New Post /wp-admin/post-new.php1,539 ▲1018.04 ▼5.08604.76 ▼56.8283.41 ▲26.00
Media Library /wp-admin/upload.php1,404 ▲104.28 ▲0.1195.67 ▼13.1244.85 ▼3.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/powercash21-payments-gateway/includes/payment-methods/class-wc-gateway-amex.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can look at the official readme.txt

powercash21-payments-gateway/class-wc-gateway-payabl.php 69% from 13 tests

The main PHP script in "payabl. Payments Gateway" version 2.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("powercash21-payments-gateway.php" instead of "class-wc-gateway-payabl.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "3.9.3")

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
Success! There were no dangerous files found in this plugin3,500 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP176618853,500

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity19.69
▷ Minimum class complexity5.00
▷ Maximum class complexity128.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods101
▷ Static methods1514.85%
▷ Public methods8584.16%
▷ Protected methods1615.84%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants30
▷ Global constants30100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/payabl_instant_bank_transfer.png0.76KB0.75KB▼ 1.54%
assets/payabl_paypal.png2.40KB1.69KB▼ 29.54%
assets/payabl_applepay.png2.11KB1.38KB▼ 34.43%
assets/payabl_amex.png3.18KB1.81KB▼ 42.91%
assets/payabl_trustly_80.png1.73KB1.96KB0.00%