84% truelayer-for-woocommerce

Code Review | TrueLayer for WooCommerce

WordPress plugin TrueLayer for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: truelayer-for-woo...
  • Plugin version: 1.4.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 24, 2022
  • Latest release: Dec 1, 2023
  • Number of updates: 16
  • Update frequency: every 35.6 days
  • Top authors: truelayer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,174 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.27ms] Passed 4 tests

An overview of server-side resources used by TrueLayer for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0345.01 ▲11.06
Dashboard /wp-admin3.34 ▲0.0347.92 ▲1.83
Posts /wp-admin/edit.php3.39 ▲0.0348.56 ▼1.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.94 ▼13.48
Media Library /wp-admin/upload.php3.26 ▲0.0334.28 ▲0.07

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 451 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for TrueLayer for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.32 ▲0.101.94 ▲0.3037.60 ▼3.76
Dashboard /wp-admin2,195 ▲175.60 ▼0.1292.42 ▼21.6742.09 ▼4.67
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0839.20 ▼0.9036.95 ▼1.63
Add New Post /wp-admin/post-new.php1,526 ▼023.60 ▲0.43610.71 ▼6.8653.24 ▲3.09
Media Library /wp-admin/upload.php1,394 ▼34.20 ▼0.0294.24 ▼2.7543.52 ▼0.18

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 205× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/symfony/polyfill-php80/PhpToken.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/psr/http-message/src/RequestInterface.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\Queue' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/ramsey/collection/src/DoubleEndedQueue.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Uuid' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/ramsey/uuid/src/Guid/Guid.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'Jose\\Component\\KeyManagement\\Analyzer\\KeyAnalyzer' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/web-token/jwt-key-mgmt/Analyzer/ES512KeyAnalyzer.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\Universal\\Set' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\AbstractString' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Type\\TypeInterface' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/ramsey/uuid/src/Type/NumberInterface.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractCollection' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/ramsey/collection/src/AbstractSet.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'TrueLayer\\Signing\\AbstractJws' not found in wp-content/plugins/truelayer-for-woocommerce/vendor/truelayer/signing/src/Signer.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: ecommerce, open banking, e-commerce, payments, refunds...

truelayer-for-woocommerce/truelayer-for-woocommerce.php 92% from 13 tests

The principal PHP file in "TrueLayer for WooCommerce" v. 1.4.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "6.0.0")

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
Good job! No executable or dangerous file extensions detected24,049 lines of code in 412 files:
LanguageFilesBlank linesComment linesLines of code
PHP3765,39815,16720,357
Markdown2184602,070
JSON3001,374
JavaScript44324143
CSS28048
make19426
XML10019
SVG1006
Bourne Shell1203
YAML2003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces58
Interfaces57
Traits8
Classes290
▷ Abstract classes196.55%
▷ Concrete classes27193.45%
▷ Final classes6624.35%
Methods1,803
▷ Static methods32918.25%
▷ Public methods1,51884.19%
▷ Protected methods1236.82%
▷ Private methods1628.99%
Functions72
▷ Named functions4663.89%
▷ Anonymous functions2636.11%
Constants230
▷ Global constants62.61%
▷ Class constants22497.39%
▷ Public constants20290.18%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/krokedil-logo.png2.33KB2.33KB0.21%