83% wegetfinancing-payment-gateway

Code Review | WeGetFinancing Payment Gateway

WordPress plugin WeGetFinancing Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: wegetfinancing-pa...
  • Plugin version: 1.3.1
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 22, 2023
  • Latest release: Sep 23, 2023
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: wegetfinancing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /69 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
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.83ms] Passed 4 tests

Server-side resources used by WeGetFinancing Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.20 ▼5.16
Dashboard /wp-admin3.31 ▼0.0451.36 ▼17.64
Posts /wp-admin/edit.php3.36 ▲0.0050.65 ▼4.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.15 ▼12.44
Media Library /wp-admin/upload.php3.23 ▲0.0039.62 ▲4.31

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WeGetFinancing Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.52 ▼1.242.02 ▲0.4041.99 ▼3.88
Dashboard /wp-admin2,224 ▲214.84 ▼1.04101.95 ▼8.9340.19 ▼6.61
Posts /wp-admin/edit.php2,097 ▼01.99 ▲0.0237.31 ▼0.5134.15 ▲0.06
Add New Post /wp-admin/post-new.php1,545 ▲1423.16 ▼0.00697.74 ▲19.6068.85 ▲4.14
Media Library /wp-admin/upload.php1,394 ▼64.20 ▼0.02105.04 ▼6.0941.43 ▼6.98

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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 994× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\DependencyInjection\\Loader\\FileLoader' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/symfony/dependency-injection/Loader/GlobFileLoader.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraint' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/symfony/validator/Constraints/Hostname.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Sentry\\Tracing\\Span' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/sentry/sentry/src/Tracing/Transaction.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Finder' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/php-http/discovery/.php-cs-fixer.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\odeVisitor\odeVisitorInterface' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\AbstractServiceConfigurator' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/symfony/dependency-injection/Loader/Configurator/InstanceofConfigurator.php:19
    • > PHP Fatal error
      Uncaught LogicException: You cannot use "Http\\Message\\MessageFactory\\GuzzleStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead in wp-content/plugins/wegetfinancing-payment-gateway/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Config\\Definition\\BaseNode' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/symfony/config/Definition/ArrayNode.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/wegetfinancing-payment-gateway/vendor/symfony/dependency-injection/Compiler/ResolveDecoratorStackPass.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
3 plugin tags: wegetfinancing, checkout, payment

wegetfinancing-payment-gateway/wegetfinancing-checkout.php 85% from 13 tests

"WeGetFinancing Payment Gateway" version 1.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.9" instead of "5.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wegetfinancing-payment-gateway.php" instead of "wegetfinancing-checkout.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin133,412 lines of code in 1,656 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,43522,94042,81495,372
XML6524522,567
Markdown763,32908,122
JSON49005,700
XSD3621557
Twig7260392
YAML8293322
reStructuredText5229345260
Dockerfile216354
SVG10030
Bourne Shell16018
make16013
INI1003
CSS1051
JavaScript1061

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity11.26
▷ Minimum class complexity1.00
▷ Maximum class complexity585.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces203
Interfaces200
Traits69
Classes1,146
▷ Abstract classes544.71%
▷ Concrete classes1,09295.29%
▷ Final classes35432.42%
Methods6,420
▷ Static methods6089.47%
▷ Public methods5,16980.51%
▷ Protected methods4486.98%
▷ Private methods80312.51%
Functions631
▷ Named functions21133.44%
▷ Anonymous functions42066.56%
Constants996
▷ Global constants111.10%
▷ Class constants98598.90%
▷ Public constants86387.61%

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
21 PNG files occupy 2.24MB with 1.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/setup-11.png245.20KB64.59KB▼ 73.66%
assets/setup-3.png185.43KB62.92KB▼ 66.07%
assets/banner-772x250.png116.90KB40.71KB▼ 65.18%
assets/setup-13.png21.31KB7.85KB▼ 63.15%
assets/install-1.png40.99KB14.36KB▼ 64.97%