84% paytium

Code Review | Paytium: Mollie payment forms & donations

WordPress plugin Paytium: Mollie payment forms & donations scored84%from 54 tests.

About plugin

  • Plugin page: paytium
  • Plugin version: 4.4.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 7, 2016
  • Latest release: Nov 21, 2023
  • Number of updates: 193
  • Update frequency: every 15.5 days
  • Top authors: davdebcom (67.36%)paytiumsupport (33.16%)

Code review

54 tests

User reviews

53 reviews

Install metrics

4,000+ active /91,354 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.54MB] [CPU: ▲18.19ms] Passed 4 tests

A check of server-side resources used by Paytium: Mollie payment forms & donations
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.96 ▲2.4958.77 ▲17.49
Dashboard /wp-admin5.88 ▲2.5366.76 ▲6.67
Posts /wp-admin/edit.php6.00 ▲2.6470.44 ▲26.38
Add New Post /wp-admin/post-new.php8.48 ▲2.59122.07 ▲24.78
Media Library /wp-admin/upload.php5.81 ▲2.5758.45 ▲23.81
Extra features /wp-admin/admin.php?page=pt-extensions5.8048.99
Setup wizard /wp-admin/admin.php?page=pt-setup-wizard5.8462.57
Settings /wp-admin/admin.php?page=paytium5.7948.24
Payments /wp-admin/edit.php?post_type=pt_payment5.8555.74

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 386 new files
Database: no new tables, 12 new options
New WordPress options
paytium_enable_remember
can_compress_scripts
paytium_always_enqueue
theysaidso_admin_options
widget_theysaidso_widget
pt_show_admin_notice_extensions
widget_recent-comments
pt_show_admin_notice_newsletter
paytium_uninstall_save_settings
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paytium: Mollie payment forms & donations
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,041 ▲26913.94 ▼0.3411.35 ▲9.3740.03 ▼8.19
Dashboard /wp-admin2,291 ▲1236.01 ▲0.4695.36 ▼4.8982.77 ▲36.81
Posts /wp-admin/edit.php2,214 ▲1142.33 ▲0.3640.92 ▲2.2434.00 ▲0.55
Add New Post /wp-admin/post-new.php1,605 ▲7923.44 ▲0.18622.24 ▼40.2936.33 ▼25.11
Media Library /wp-admin/upload.php1,499 ▲964.28 ▲0.0595.01 ▼5.2374.19 ▲30.75
Extra features /wp-admin/admin.php?page=pt-extensions1,5242.2845.8341.87
Setup wizard /wp-admin/admin.php?page=pt-setup-wizard1,7682.2534.3034.14
Settings /wp-admin/admin.php?page=paytium1,1182.2634.0834.28
Payments /wp-admin/edit.php?post_type=pt_payment1,3242.4945.9937.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • paytium_enable_remember
    • can_compress_scripts
    • paytium_uninstall_save_settings
    • widget_recent-comments
    • db_upgraded
    • paytium_always_enqueue
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 132× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface '_PhpScoperd8ff184be637\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/paytium/libraries/Mollie/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Resources\\CursorCollection' not found in wp-content/plugins/paytium/libraries/Mollie/src/Resources/OrderCollection.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Endpoints\\CollectionEndpointAbstract' not found in wp-content/plugins/paytium/libraries/Mollie/src/Endpoints/ShipmentEndpoint.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie_API_Resource_Base' not found in wp-content/plugins/paytium/libraries/Mollie/API/Resource/Refunds.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Resources\\BaseResource' not found in wp-content/plugins/paytium/libraries/Mollie/src/Resources/Capture.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Endpoints\\CollectionEndpointAbstract' not found in wp-content/plugins/paytium/libraries/Mollie/src/Endpoints/PaymentEndpoint.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Endpoints\\CollectionEndpointAbstract' not found in wp-content/plugins/paytium/libraries/Mollie/src/Endpoints/CustomerPaymentsEndpoint.php:8
    • > PHP Fatal error
      Uncaught Error: Interface '_PhpScoperd8ff184be637\\GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/paytium/libraries/Mollie/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Mollie\\Api\\Resources\\CursorCollection' not found in wp-content/plugins/paytium/libraries/Mollie/src/Resources/RefundCollection.php:5
    • > PHP Fatal error
      Uncaught Error: Interface '_PhpScoperd8ff184be637\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/paytium/libraries/Mollie/vendor/guzzlehttp/psr7/src/NoSeekStream.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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

paytium/paytium.php Passed 13 tests

The main PHP file in "Paytium: Mollie payment forms & donations" ver. 4.4.2 adds more information about the plugin and also serves as the entry point for this plugin
56 characters long description:
Paytium, making payments in WordPress even more awesome!

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin32,124 lines of code in 346 files:
LanguageFilesBlank linesComment linesLines of code
PHP3013,86614,70422,261
Markdown141,11403,427
CSS102852033,144
JavaScript87093322,163
JSON10001,082
SVG10128
Dockerfile18010
make1409

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity10.73
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces21
Interfaces15
Traits2
Classes215
▷ Abstract classes62.79%
▷ Concrete classes20997.21%
▷ Final classes2311.00%
Methods1,353
▷ Static methods18713.82%
▷ Public methods1,10381.52%
▷ Protected methods977.17%
▷ Private methods15311.31%
Functions281
▷ Named functions18766.55%
▷ Anonymous functions9433.45%
Constants341
▷ Global constants4814.08%
▷ Class constants29385.92%
▷ Public constants293100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 compressed PNG files occupy 0.44MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png180.88KB93.08KB▼ 48.54%
admin/img/setup-wizard/classic-editor.png38.37KB40.83KB0.00%
admin/img/daviddeboer.png81.38KB88.13KB0.00%
admin/img/setup-wizard/block-editor.png73.85KB81.09KB0.00%
admin/img/setup-wizard/elementor-shortcode-widget.png40.20KB42.00KB0.00%