78% sargapay

Code Review | Sargapay

WordPress plugin Sargapay scored78%from 54 tests.

About plugin

  • Plugin page: sargapay
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2022
  • Latest release: Jan 20, 2023
  • Number of updates: 25
  • Update frequency: every 2.5 days
  • Top authors: trakadev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /592 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Sargapay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.70 ▲3.39
Dashboard /wp-admin3.31 ▲0.0049.94 ▲1.90
Posts /wp-admin/edit.php3.36 ▲0.0050.33 ▼2.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.18 ▼16.40
Media Library /wp-admin/upload.php3.23 ▲0.0040.20 ▼0.41

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 140 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Sargapay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.11 ▼1.382.16 ▲0.2748.26 ▲1.94
Dashboard /wp-admin2,206 ▲154.83 ▼1.05111.79 ▲4.5041.35 ▼3.17
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0134.55 ▼0.8933.32 ▼0.86
Add New Post /wp-admin/post-new.php1,533 ▼323.28 ▲0.06675.52 ▲28.8960.73 ▲9.00
Media Library /wp-admin/upload.php1,388 ▼34.22 ▼0.01110.41 ▲9.9946.74 ▼2.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/sargapay/public/partials/sargapay-public-display.php
    • > /wp-content/plugins/sargapay/admin/partials/sargapay-admin-display.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/public/qrcode.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Data\\QRDataAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Data/Number.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Data\\QRDataAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Data/Kanji.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'chillerlan\\QRCode\\Data\\QRDataInterface' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Data/QRDataAbstract.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Data\\QRDataAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Data/AlphaNum.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Output\\QROutputAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'chillerlan\\QRCode\\Output\\QROutputInterface' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Output\\QROutputAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Output\\QROutputAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Output/QRString.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'chillerlan\\QRCode\\Data\\QRDataAbstract' not found in wp-content/plugins/sargapay/paymentGateway/cardano/vendor/chillerlan/php-qrcode/src/Data/Byte.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === sargapay === )
The official readme.txt is a good inspiration

sargapay/sargapay.php Passed 13 tests

The primary PHP file in "Sargapay" version 2.1.1 is used by WordPress to initiate all plugin functionality
37 characters long description:
WordPress payment gateway for crypto.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin379,840 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript194,9043,816368,570
PHP631,7267,7925,475
CSS791694,378
Markdown21050473
PO File2188258424
JSON2100283
HTML1260137
XML30072
YAML22028

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.21
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces8
Interfaces3
Traits1
Classes35
▷ Abstract classes38.57%
▷ Concrete classes3291.43%
▷ Final classes825.00%
Methods234
▷ Static methods218.97%
▷ Public methods16269.23%
▷ Protected methods5021.37%
▷ Private methods229.40%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants52
▷ Global constants35.77%
▷ Class constants4994.23%
▷ Public constants4387.76%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
paymentGateway/cardano/assets/img/ada_logo.png2.61KB0.89KB▼ 65.92%
build/admin/images/discord.cc59f4a2.png11.35KB5.97KB▼ 47.35%
build/admin/images/banner.a117014b.png52.23KB20.14KB▼ 61.45%