83% relaypay

Code Review | RelayPay Checkout

WordPress plugin RelayPay Checkout scored83%from 54 tests.

About plugin

  • Plugin page: relaypay
  • Plugin version: 2.0.1
  • PHP compatiblity: 8.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2021
  • Latest release: Dec 1, 2023
  • Number of updates: 5
  • Update frequency: every 165.8 days
  • Top authors: relaypayio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /442 total downloads

Benchmarks

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: ▼3.94ms] Passed 4 tests

This is a short check of server-side resources used by RelayPay Checkout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.29 ▼5.43
Dashboard /wp-admin3.31 ▲0.0045.60 ▼8.73
Posts /wp-admin/edit.php3.36 ▲0.0049.64 ▲2.24
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.22 ▼3.83
Media Library /wp-admin/upload.php3.24 ▲0.0035.71 ▲4.42

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

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

Browser metrics Passed 4 tests

Checking browser requirements for RelayPay Checkout
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.25 ▼0.431.67 ▼0.1143.60 ▼0.10
Dashboard /wp-admin2,192 ▲155.59 ▼0.02102.74 ▲16.0041.19 ▲2.24
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0641.37 ▲2.7735.04 ▼0.04
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.07612.55 ▼23.7558.07 ▲1.09
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.0299.12 ▼1.1543.50 ▲2.07

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 202× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'RelayPayDeps\\Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/relaypay/deps/guzzlehttp/psr7/src/UploadedFile.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'RelayPayDeps\\Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/relaypay/deps/php-di/invoker/src/ParameterResolver/NumericArrayResolver.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'RelayPayDeps\\Wpify\\Model\\Exceptions\\ModelException' not found in wp-content/plugins/relaypay/deps/wpify/model/src/Exceptions/SqlException.php:6
    • > PHP Parse error
      syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in wp-content/plugins/relaypay/src/Api/RelayPayApi.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'RelayPayDeps\\Wpify\\Model\\Exceptions\\ModelException' not found in wp-content/plugins/relaypay/deps/wpify/model/src/Exceptions/PrimaryKeyException.php:6
    • > PHP Fatal error
      Default value for property of type RelayPayDeps\\Wpify\\Model\\mixed may not be null. Use the nullable type ?RelayPayDeps\\Wpify\\Model\\mixed to allow null default value in wp-content/plugins/relaypay/deps/wpify/model/src/Model.php on line 25
    • > PHP Fatal error
      Uncaught Error: Interface 'RelayPayDeps\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/relaypay/deps/guzzlehttp/promises/src/FulfilledPromise.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'RelayPayDeps\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/relaypay/deps/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'RelayPayDeps\\DI\\Definition\\Helper\\CreateDefinitionHelper' not found in wp-content/plugins/relaypay/config.php:10
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/relaypay/deps/relaypay-official/merchant-php-sdk/Examples/GetTransation.php on line 7

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)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

relaypay/relaypay.php 77% from 13 tests

The primary PHP file in "RelayPay Checkout" version 2.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("6.0" instead of "6.0.0")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Requires PHP: Required version does not match the one declared in readme.txt ("8.0" instead of "8.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin29,349 lines of code in 423 files:
LanguageFilesBlank linesComment linesLines of code
PHP35696314,93922,154
Markdown381,80105,101
JSON22001,976
Bourne Shell113831
JavaScript251131
XML11020
SVG10019
Dockerfile18010
Bourne Again Shell1007

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity11.94
▷ Minimum class complexity1.00
▷ Maximum class complexity320.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces61
Interfaces39
Traits2
Classes275
▷ Abstract classes51.82%
▷ Concrete classes27098.18%
▷ Final classes2910.74%
Methods1,906
▷ Static methods26613.96%
▷ Public methods1,67087.62%
▷ Protected methods311.63%
▷ Private methods20510.76%
Functions234
▷ Named functions10243.59%
▷ Anonymous functions13256.41%
Constants267
▷ Global constants8130.34%
▷ Class constants18669.66%
▷ Public constants18498.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin