83% trustap-payment-gateway

Code Review | Trustap Payment Gateway

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

About plugin

  • Plugin page: trustap-payment-g...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Sep 29, 2022
  • Latest release: Apr 25, 2023
  • Number of updates: 25
  • Update frequency: every 8.6 days
  • Top authors: renatotrustap (76%)dinotrustap (24%)mladentrustap (8%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active / 487 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Trustap Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.22 ▼5.47
Dashboard /wp-admin3.31 ▲0.0046.06 ▼3.74
Posts /wp-admin/edit.php3.36 ▲0.0049.10 ▲2.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.44 ▼11.42
Media Library /wp-admin/upload.php3.23 ▲0.0034.60 ▲2.51

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 426 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Trustap Payment Gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.64 ▼0.761.62 ▼0.6142.23 ▼3.50
Dashboard /wp-admin2,206 ▲185.80 ▼0.0997.39 ▼9.4439.70 ▼6.68
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0036.96 ▼0.8230.48 ▼3.41
Add New Post /wp-admin/post-new.php1,528 ▼823.48 ▲0.58646.77 ▼22.2053.63 ▼7.10
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.03100.57 ▼5.1943.25 ▼3.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • 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 | 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
The following issues need your attention
  • 171× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\PHP\\Reductions\\Montgomery' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\secp224r1' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp224.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\DSA' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PublicKey.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\PHP\\Base' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Rijndael' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\sect409k1' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistk409.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\Common\\FiniteField' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Math/BinaryField.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\secp384r1' not found in wp-content/plugins/trustap-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp384.php:18

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

trustap-payment-gateway/trustap-gateway.php 92% from 13 tests

The principal PHP file in "Trustap Payment Gateway" v. 1.2.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("trustap-payment-gateway.php" instead of "trustap-gateway.php")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin37,925 lines of code in 411 files:
LanguageFilesBlank linesComment linesLines of code
PHP3817,10125,11236,477
JSON700488
Markdown61450367
CSS294234
JavaScript2166141
YAML372129
XML20047
SVG70139
Bourne Shell1203

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity662.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces47
Interfaces3
Traits4
Classes356
▷ Abstract classes20557.58%
▷ Concrete classes15142.42%
▷ Final classes149.27%
Methods1,595
▷ Static methods47129.53%
▷ Public methods1,12470.47%
▷ Protected methods23314.61%
▷ Private methods23814.92%
Functions30
▷ Named functions26.67%
▷ Anonymous functions2893.33%
Constants317
▷ Global constants82.52%
▷ Class constants30997.48%
▷ Public constants309100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/supported_cards.png32.02KB10.18KB▼ 68.21%