83% gr8pay-payment-gateway

Code Review | Gr8Pay Payment Gateway

WordPress plugin Gr8Pay Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: gr8pay-payment-ga...
  • Plugin version: 1.1.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 25, 2020
  • Latest release: May 12, 2021
  • Number of updates: 82
  • Update frequency: every 3.9 days
  • Top authors: gr8pay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /914 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.67MB] [CPU: ▼14.87ms] Passed 4 tests

A check of server-side resources used by Gr8Pay Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.96 ▼2.64
Dashboard /wp-admin3.31 ▲0.0150.83 ▼0.66
Posts /wp-admin/edit.php3.36 ▲0.0145.37 ▲2.38
Add New Post /wp-admin/post-new.php3.19 ▼2.7034.76 ▼58.54
Media Library /wp-admin/upload.php3.23 ▲0.0137.09 ▲3.22

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Gr8Pay Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.57 ▼0.861.95 ▼0.4243.65 ▼1.85
Dashboard /wp-admin2,206 ▲185.88 ▲0.9895.87 ▼7.9235.64 ▼2.97
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.0133.98 ▼7.1533.27 ▼3.27
Add New Post /wp-admin/post-new.php1,542 ▲423.09 ▼0.03639.65 ▲21.2857.22 ▲12.06
Media Library /wp-admin/upload.php1,391 ▼04.21 ▲0.0194.59 ▼9.5840.63 ▼1.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gr8pay-payment-gateway/index.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
9 plugin tags: sales, store, sell, cart, shop...

gr8pay-payment-gateway/index.php 85% from 13 tests

The main PHP script in "Gr8Pay Payment Gateway" version 1.1.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("gr8pay-payment-gateway.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected427 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15752349
PO File1303178

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.54MB with 0.28MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Design 1 small.png199.32KB65.92KB▼ 66.93%
Design 1 small amex.png199.32KB65.92KB▼ 66.93%
Payment-options-from-Carus-Jewellery-.png11.55KB11.55KB0.03%
Design 2 small no amex.png144.04KB41.56KB▼ 71.15%