84% payway-custom-payment-gateway

Code Review | Payway Custom Payment Gateway

WordPress plugin Payway Custom Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: payway-custom-pay...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2023
  • Latest release: Jun 12, 2023
  • Number of updates: 12
  • Update frequency: every 0.4 days
  • Top authors: kevinlearynet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /122 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼5.37ms] Passed 4 tests

Server-side resources used by Payway Custom Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.69 ▼2.04
Dashboard /wp-admin3.31 ▼0.0343.67 ▼16.33
Posts /wp-admin/edit.php3.36 ▲0.0146.99 ▲4.91
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.76 ▼4.89
Media Library /wp-admin/upload.php3.24 ▲0.0133.79 ▲1.80

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Payway Custom Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▼0.191.68 ▼0.0836.72 ▼1.83
Dashboard /wp-admin2,189 ▲115.48 ▼0.1779.96 ▼15.0537.38 ▼7.49
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0838.38 ▲3.6838.49 ▼1.30
Add New Post /wp-admin/post-new.php1,526 ▼023.74 ▲0.61606.89 ▼61.9045.55 ▼14.60
Media Library /wp-admin/upload.php1,397 ▼04.23 ▲0.0296.31 ▼7.4244.49 ▼1.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/payway-custom-payment-gateway/payway-payment-gateway.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payway-custom-payment-gateway/src/payway-init.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payway-custom-payment-gateway/src/payway-gateway.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
The official readme.txt is a good inspiration

payway-custom-payment-gateway/payway-payment-gateway.php 92% from 13 tests

The main file in "Payway Custom Payment Gateway" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("payway-custom-payment-gateway.php" instead of "payway-payment-gateway.php")

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
Good job! No executable or dangerous file extensions detected653 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity16.00
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/payway.png11.14KB6.26KB▼ 43.75%