83% payable-payment-gateway-for-woocommerce

Code Review | PAYable Payment Gateway for WooCommerce

WordPress plugin PAYable Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: payable-payment-g...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 6, 2021
  • Latest release: Oct 10, 2023
  • Number of updates: 43
  • Update frequency: every 18.1 days
  • Top authors: payable (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,067 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by PAYable Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.98 ▼3.17
Dashboard /wp-admin3.32 ▲0.0149.73 ▼1.65
Posts /wp-admin/edit.php3.37 ▲0.0145.08 ▲0.25
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.72 ▼22.86
Media Library /wp-admin/upload.php3.24 ▲0.0137.90 ▲4.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PAYable Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.43 ▲0.081.71 ▼0.1048.23 ▲4.98
Dashboard /wp-admin2,192 ▲215.49 ▼0.1997.69 ▲0.3841.03 ▼2.73
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0033.55 ▼0.8836.83 ▲1.56
Add New Post /wp-admin/post-new.php1,528 ▲223.35 ▲0.08667.29 ▲30.2852.29 ▼10.02
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0497.87 ▲2.9740.91 ▼4.59

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/payable-payment-gateway-for-woocommerce/includes/class-wc-gateway-payable.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Activate the “PAYable Payment Gateway for WooCommerce” Plugin available in the WooCommerce Installed Plugins page), #2 (Enable the “PAYable Online” as the Payment Method in WooCommerce Payment Methods page), #3 (Modify the configurations for the PAYable Payment Gateway for WooCommerce plugin and enter the details provided by PAYable), #4 (PAYable Online will be displayed as a Payment Method to the Customer in the Checkout Page)
You can look at the official readme.txt

payable-payment-gateway-for-woocommerce/payable.php 85% from 13 tests

The main PHP file in "PAYable Payment Gateway for WooCommerce" ver. 1.1.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payable-payment-gateway-for-woocommerce.php" instead of "payable.php")
  • 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 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin4,344 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS20102,332
PHP43352081,178
JavaScript3105834

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity30.00
▷ Minimum class complexity2.00
▷ Maximum class complexity58.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods418.18%
▷ Public methods2195.45%
▷ Protected methods00.00%
▷ Private methods14.55%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/payment-method.png24.14KB3.14KB▼ 87.00%
includes/logo.png26.63KB4.82KB▼ 81.91%