84% paywithterra-payment-gateway

Code Review | PaywithTerra Payment Gateway

WordPress plugin PaywithTerra Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: paywithterra-paym...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1
  • WordPress version: 6.3.1
  • First release: Sep 4, 2021
  • Latest release: Oct 8, 2022
  • Number of updates: 26
  • Update frequency: every 15.4 days
  • Top authors: paywithterra (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,150 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.51ms] Passed 4 tests

This is a short check of server-side resources used by PaywithTerra Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0635.71 ▼8.73
Dashboard /wp-admin3.37 ▲0.0645.11 ▼4.91
Posts /wp-admin/edit.php3.48 ▲0.1249.76 ▲0.81
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.16 ▼17.21
Media Library /wp-admin/upload.php3.29 ▲0.0633.23 ▲0.88

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

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

Browser metrics Passed 4 tests

PaywithTerra Payment Gateway: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.214.77 ▲2.8038.68 ▼13.85
Dashboard /wp-admin2,206 ▲184.88 ▲0.00112.32 ▼7.9242.69 ▼1.37
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0740.40 ▲1.2435.61 ▲3.07
Add New Post /wp-admin/post-new.php1,542 ▼518.15 ▼0.15592.34 ▼57.0058.89 ▼2.81
Media Library /wp-admin/upload.php1,388 ▲34.36 ▲0.1197.12 ▼5.3041.68 ▼2.42

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/tests/Parser/LCDTxParserTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/tests/Cache/FileCacheTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'PaywithTerra\\Parser\\ParserInterface' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Parser/LCDTxParser.php:8
    • > PHP Fatal error
      Trait 'PaywithTerra\\Entity\\TxValidationTrait' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Entity/NormalTx.php on line 11
    • > PHP Fatal error
      Uncaught Error: Interface 'PaywithTerra\\Cache\\CacheInterface' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Cache/FileCache.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/tests/Parser/FCDTxParserTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'PaywithTerra\\Cache\\CacheItemInterface' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Cache/FileCacheItem.php:12
    • > PHP Fatal error
      Trait 'PaywithTerra\\Entity\\TxValidationTrait' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Entity/PaymentMessage.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/tests/TerraTxValidatorTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'PaywithTerra\\Parser\\ParserInterface' not found in wp-content/plugins/paywithterra-payment-gateway/php-backend-library/src/Parser/FCDTxParser.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
4 plugin tags: woocommerce, gateway, crypto, terra

paywithterra-payment-gateway/woocommerce-paywithterra.php 92% from 13 tests

The entry point to "PaywithTerra Payment Gateway" version 2.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("paywithterra-payment-gateway.php" instead of "woocommerce-paywithterra.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,377 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP252662211,162
Markdown3520139
HTML111043
JSON10025
SVG2008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.88
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces8
Interfaces3
Traits1
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods80
▷ Static methods33.75%
▷ Public methods5771.25%
▷ Protected methods1923.75%
▷ Private methods45.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin