83% afterpay-payment-gateway-for-woocommerce

Code Review | Riverty Payments for Woocommerce

WordPress plugin Riverty Payments for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: afterpay-payment-...
  • Plugin version: 7.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 5, 2018
  • Latest release: Nov 1, 2023
  • Number of updates: 100
  • Update frequency: every 18.6 days
  • Top authors: afterpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /12,799 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 successfully, without throwing any errors or notices

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

A check of server-side resources used by Riverty Payments for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.55 ▼7.39
Dashboard /wp-admin3.31 ▼0.0442.97 ▼20.60
Posts /wp-admin/edit.php3.36 ▲0.0047.74 ▲4.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.34 ▼25.05
Media Library /wp-admin/upload.php3.23 ▲0.0035.88 ▼0.74

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Riverty Payments for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.66 ▲0.301.91 ▲0.2436.65 ▼9.41
Dashboard /wp-admin2,195 ▲185.63 ▲0.0489.51 ▼11.9839.95 ▼2.76
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0241.86 ▼0.8836.56 ▼1.92
Add New Post /wp-admin/post-new.php1,528 ▲222.95 ▼0.05703.82 ▲68.6558.55 ▼4.43
Media Library /wp-admin/upload.php1,400 ▼04.26 ▲0.0496.96 ▼11.9942.62 ▲0.14

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 108× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp6\\Promise\\PromisorInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor-static/guzzlehttp/guzzle/src/Pool.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/REST/Advanced/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/REST/Advanced/installmentplans_submit.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp6\\Promise\\PromiseInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor-static/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor-static/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Warning
      require_once(wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/SOAP-NL-BE/Advanced/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/SOAP-NL-BE/Advanced/b2c.nl.requestorderstatus.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor-static/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/REST/Simple/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/REST/Simple/b2c.be.openinvoice.php on line 4
    • > PHP Warning
      require_once(wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/SOAP-NL-BE/Advanced/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/payintegrator/afterpay/examples/SOAP-NL-BE/Advanced/b2c.be.push.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/afterpay-payment-gateway-for-woocommerce/vendor/psr/http-message/src/ServerRequestInterface.php:43

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 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

afterpay-payment-gateway-for-woocommerce/class-wc-gateway-afterpay.php 85% from 13 tests

The main PHP file in "Riverty Payments for Woocommerce" ver. 7.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("afterpay-payment-gateway-for-woocommerce.php" instead of "class-wc-gateway-afterpay.php")
  • Description: The description should be shorter than 140 characters (currently 154 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected59,711 lines of code in 265 files:
LanguageFilesBlank linesComment linesLines of code
PHP2194,41310,16648,778
PO File112,40220,6965,805
Markdown141,22103,586
JSON11001,089
CSS1340262
YAML522391
JavaScript28281
Dockerfile18010
make1409

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity27.91
▷ Minimum class complexity1.00
▷ Maximum class complexity234.00
Average method complexity5.41
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces14
Interfaces15
Traits2
Classes128
▷ Abstract classes10.78%
▷ Concrete classes12799.22%
▷ Final classes2318.11%
Methods995
▷ Static methods15915.98%
▷ Public methods83784.12%
▷ Protected methods151.51%
▷ Private methods14314.37%
Functions191
▷ Named functions10052.36%
▷ Anonymous functions9147.64%
Constants199
▷ Global constants7839.20%
▷ Class constants12160.80%
▷ Public constants121100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected