78% payment-gateway-for-swish-givewp

Code Review | Gateway Addon for Swish Payment for GiveWP

WordPress plugin Gateway Addon for Swish Payment for GiveWP scored78%from 54 tests.

About plugin

  • Plugin page: payment-gateway-f...
  • Plugin version: 1.0.1
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2023
  • Latest release: Feb 12, 2023
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: proloybhaduri (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /203 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
Install script ran successfully

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

Analyzing server-side resources used by Gateway Addon for Swish Payment for GiveWP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.37 ▼11.37
Dashboard /wp-admin3.31 ▲0.0048.72 ▼7.01
Posts /wp-admin/edit.php3.36 ▲0.0049.44 ▼0.63
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.09 ▼9.97
Media Library /wp-admin/upload.php3.23 ▲0.0038.26 ▼4.10

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Gateway Addon for Swish Payment for GiveWP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.37 ▼1.371.69 ▼0.0640.44 ▼5.82
Dashboard /wp-admin2,224 ▲244.87 ▼0.02111.58 ▼6.9940.29 ▼6.98
Posts /wp-admin/edit.php2,097 ▼62.00 ▼0.0440.15 ▲3.7236.09 ▼1.34
Add New Post /wp-admin/post-new.php1,545 ▲323.10 ▲4.72663.36 ▼12.3952.12 ▼18.07
Media Library /wp-admin/upload.php1,397 ▼34.23 ▲0.0295.10 ▼11.7748.38 ▲5.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/payment-gateway-for-swish-givewp/givewp-swish-addon.php
  • 189× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Codec\\StringCodec' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Parse error
      syntax error, unexpected ',' in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php on line 53
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Exception/NodeException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Type\\TypeInterface' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Type/NumberInterface.php:22
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/composer/platform_check.php on line 24
    • > PHP Parse error
      syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE) in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php on line 42
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Converter\\Time\\BigNumberTimeConverter' not found in wp-content/plugins/payment-gateway-for-swish-givewp/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: givewp, payment, swish, gateway, give...

payment-gateway-for-swish-givewp/givewp-swish-addon.php 85% from 13 tests

This is the main PHP file of "Gateway Addon for Swish Payment for GiveWP" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("payment-gateway-for-swish-givewp.php" instead of "givewp-swish-addon.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected26,153 lines of code in 356 files:
LanguageFilesBlank linesComment linesLines of code
PHP3114,87014,31819,335
Markdown201,58404,318
JSON15001,706
CSS211354601
JavaScript3940118
YAML314058
XML10016
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.18
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces49
Interfaces55
Traits13
Classes223
▷ Abstract classes94.04%
▷ Concrete classes21495.96%
▷ Final classes6329.44%
Methods1,656
▷ Static methods24614.86%
▷ Public methods1,45787.98%
▷ Protected methods261.57%
▷ Private methods17310.45%
Functions175
▷ Named functions4425.14%
▷ Anonymous functions13174.86%
Constants161
▷ Global constants53.11%
▷ Class constants15696.89%
▷ Public constants12982.69%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin