68% weeconnectpay

Code Review | WeeConnectPay - Clover Payment Gateway

WordPress plugin WeeConnectPay - Clover Payment Gateway scored68%from 54 tests.

About plugin

  • Plugin page: weeconnectpay
  • Plugin version: 3.6.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: May 3, 2022
  • Latest release: Nov 25, 2023
  • Number of updates: 92
  • Update frequency: every 6.2 days
  • Top authors: weeconnectpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /4,707 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
Installer ran successfully

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

An overview of server-side resources used by WeeConnectPay - Clover Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.14 ▼2.09
Dashboard /wp-admin3.31 ▼0.0445.51 ▼14.19
Posts /wp-admin/edit.php3.36 ▲0.0046.32 ▲0.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.14 ▼0.77
Media Library /wp-admin/upload.php3.23 ▲0.0031.45 ▼0.34

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 482 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WeeConnectPay - Clover Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.431.73 ▲0.1635.65 ▼2.90
Dashboard /wp-admin2,192 ▲185.56 ▼0.1691.76 ▼4.8542.36 ▼1.51
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0539.29 ▼0.7336.48 ▼1.61
Add New Post /wp-admin/post-new.php1,526 ▼023.41 ▲0.28589.67 ▼43.1545.83 ▼11.61
Media Library /wp-admin/upload.php1,400 ▼34.16 ▼0.0092.85 ▼7.2242.12 ▲0.54

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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/weeconnectpay/site/partials/weeconnectpayPublicDisplay.php
  • 175× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Flysystem\\Plugin\\AbstractPlugin' not found in wp-content/plugins/weeconnectpay/vendor/league/flysystem/src/Plugin/ForcedRename.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/weeconnectpay/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' not found in wp-content/plugins/weeconnectpay/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WeeConnectPay\\Api\\ApiClient' not found in wp-content/plugins/weeconnectpay/includes/modules/WeeConnectPay/Api/Requests/CreateCloverCustomerRequest.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WeeConnectPay\\Integrations\\plugin_dir_path() in wp-content/plugins/weeconnectpay/includes/modules/WeeConnectPay/Integration/IntegrationSettings.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Flysystem\\Handler' not found in wp-content/plugins/weeconnectpay/vendor/league/flysystem/src/File.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WeeConnectPay\\Dependencies\\GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/weeconnectpay/packages/GuzzleHttp/Promise/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WeeConnectPay\\Dependencies\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/weeconnectpay/packages/GuzzleHttp/Promise/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'WeeConnectPay\\Dependencies\\GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/weeconnectpay/packages/GuzzleHttp/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'WeeConnectPay\\Dependencies\\GuzzleHttp\\ClientInterface' not found in wp-content/plugins/weeconnectpay/packages/GuzzleHttp/Client.php:26

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === WeeConnectPay - Clover Payment Gateway === )
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

weeconnectpay/weeconnectpay.php Passed 13 tests

Analyzing the main PHP file in "WeeConnectPay - Clover Payment Gateway" version 3.6.0
61 characters long description:
Integrate Clover Payments with your WooCommerce online store.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/weeconnectpay/vendor/symfony/console/Resources/bin/hiddeninput.exe
185,217 lines of code in 448 files:
LanguageFilesBlank linesComment linesLines of code
CSS438,10815133,401
PHP3927,25617,08848,258
JSON15001,937
JavaScript660159706
Markdown161430405
PO File1106154385
SVG80043
YAML23143
XML20122
HTML20117

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity12.59
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces61
Interfaces43
Traits13
Classes293
▷ Abstract classes155.12%
▷ Concrete classes27894.88%
▷ Final classes3311.87%
Methods2,330
▷ Static methods34014.59%
▷ Public methods1,90381.67%
▷ Protected methods1235.28%
▷ Private methods30413.05%
Functions326
▷ Named functions16249.69%
▷ Anonymous functions16450.31%
Constants321
▷ Global constants8526.48%
▷ Class constants23673.52%
▷ Public constants22997.03%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
site/img/card-logos.png13.30KB5.05KB▼ 62.05%
site/img/secured-by-logos.png7.37KB3.79KB▼ 48.61%
admin/img/logo.png33.58KB20.10KB▼ 40.15%