83% rexpay-payment-gateway

Code Review | RexPay Payment Gateway

WordPress plugin RexPay Payment Gateway scored 83% from 54 tests.

About plugin

  • Plugin page: rexpay-payment-ga...
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 29, 2021
  • Latest release: Mar 16, 2023
  • Number of updates: 30
  • Update frequency: every 24.0 days
  • Top authors: valoni01 (56.67%)globalaccelerex (46.67%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 685 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 gracefully, with no errors

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

A check of server-side resources used by RexPay Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0140.30 ▼3.64
Dashboard /wp-admin3.31 ▲0.0145.32 ▼3.07
Posts /wp-admin/edit.php3.36 ▲0.0048.36 ▲0.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.56 ▼0.25
Media Library /wp-admin/upload.php3.23 ▲0.0033.37 ▲1.35

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

RexPay Payment Gateway: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.151.63 ▼0.1240.00 ▼8.34
Dashboard /wp-admin2,206 ▲154.88 ▼0.01107.93 ▼4.3640.00 ▼4.10
Posts /wp-admin/edit.php2,092 ▲31.98 ▼0.0239.89 ▲5.6836.46 ▼0.16
Add New Post /wp-admin/post-new.php1,536 ▲2223.47 ▲5.81583.42 ▼114.9350.01 ▼5.49
Media Library /wp-admin/upload.php1,388 ▲34.24 ▲0.0395.67 ▼3.1143.73 ▼2.36

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

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
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant REX_WC_DIR_PATH - assumed 'REX_WC_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rexpay-payment-gateway/includes/eventHandler.php on line 2
    • > PHP Warning
      require(REX_WC_DIR_PATHrex-pay-api/rexpayEventHandlerInterface.php): failed to open stream: No such file or directory in wp-content/plugins/rexpay-payment-gateway/includes/eventHandler.php on line 2
    • > PHP Fatal error
      require(): Failed opening required 'REX_WC_DIR_PATHrex-pay-api/rexpayEventHandlerInterface.php' (include_path='.:/usr/share/php') in wp-content/plugins/rexpay-payment-gateway/includes/eventHandler.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: rexpay woocommerce, payments

rexpay-payment-gateway/woo-rexpay.php 77% from 13 tests

This is the main PHP file of "RexPay Payment Gateway" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • 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: It is recommended to name the main PHP file as the plugin slug ("rexpay-payment-gateway.php" instead of "woo-rexpay.php")
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,003 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP6280196790
CSS10084
Markdown131069
JavaScript1251836
SVG30024

PHP code Passed 2 tests

An overview 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 complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods61
▷ Static methods00.00%
▷ Public methods6098.36%
▷ Protected methods11.64%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 1.83MB with 1.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.PNG10.22KB5.93KB▼ 42.01%
assets/img/screen4.png375.10KB148.96KB▼ 60.29%
assets/Banner-1544x500.png.png62.05KB20.99KB▼ 66.18%
assets/img/screen1.png283.08KB87.15KB▼ 69.21%
assets/img/logos.png13.64KB5.93KB▼ 56.55%