78% wc-frontend-manager-direct-paypal

Code Review | WCFM - Direct PayPal Pay for WooCommerce Multivendor Marketplace

WordPress plugin WCFM - Direct PayPal Pay for WooCommerce Multivendor Marketplace scored78%from 54 tests.

About plugin

  • Plugin page: wc-frontend-manag...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 11, 2019
  • Latest release: Jul 26, 2022
  • Number of updates: 14
  • Update frequency: every 77.3 days
  • Top authors: wclovers (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

700+ active /15,513 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.05MB] [CPU: ▼5.11ms] Passed 4 tests

Server-side resources used by WCFM - Direct PayPal Pay for WooCommerce Multivendor Marketplace
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.61 ▲4.81
Dashboard /wp-admin3.36 ▲0.0245.45 ▼15.52
Posts /wp-admin/edit.php3.47 ▲0.1245.74 ▼3.24
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.86 ▼6.15
Media Library /wp-admin/upload.php3.28 ▲0.0636.78 ▲4.46

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WCFM - Direct PayPal Pay for WooCommerce Multivendor Marketplace
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.26 ▼0.381.89 ▲0.1037.05 ▼3.50
Dashboard /wp-admin2,192 ▲145.55 ▼0.1980.20 ▼14.9839.39 ▼4.74
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0740.13 ▼2.4636.00 ▲0.87
Add New Post /wp-admin/post-new.php1,526 ▼023.09 ▼0.45642.47 ▼29.1258.28 ▲1.45
Media Library /wp-admin/upload.php1,400 ▲34.21 ▲0.0694.73 ▼2.8140.77 ▼4.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 77× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/payments/OrderAuthorize.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/notifications/DeleteWebhook.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/lipp/ObtainUserConsent.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/invoice-templates/UpdateInvoiceTemplate.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/payment-experience/GetWebProfile.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/payments/OrderDoVoid.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/lipp/GetUserInfo.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/invoice-templates/CreateInvoiceTemplate.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/invoice/RemindInvoice.php
    • > /wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/sample/notifications/ValidateWebhookEvent.php
  • 378× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/OpenIdAddress.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Credit.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/tests/PayPal/Test/Api/ShippingInfoTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Api\\FundingInstrument' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/FundingSource.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/CurrencyConversion.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Order.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/tests/PayPal/Test/Api/PotentialPayerInfoTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/wc-frontend-manager-direct-paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/BillingAgreementToken.php:15

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

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: vendor, multi vendor, woocommerce marketplace, paypal, wcfm

wc-frontend-manager-direct-paypal/wc-frontend-manager-direct-paypal.php 92% from 13 tests

The principal PHP file in "WCFM - Direct PayPal Pay for WooCommerce Multivendor Marketplace" v. 2.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0.0")

Code Analysis Passed 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 plugin42,614 lines of code in 685 files:
LanguageFilesBlank linesComment linesLines of code
PHP5096,01921,57729,144
JSON652305,108
JavaScript547374,931
HTML84241152,564
Markdown91640614
CSS4238104
XML411080
INI2186731
SVG10130
YAML1006
Ruby1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity2.92
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces38
Interfaces8
Traits2
Classes405
▷ Abstract classes40.99%
▷ Concrete classes40199.01%
▷ Final classes00.00%
Methods3,166
▷ Static methods39912.60%
▷ Public methods3,08997.57%
▷ Protected methods401.26%
▷ Private methods371.17%
Functions19
▷ Named functions1052.63%
▷ Anonymous functions947.37%
Constants29
▷ Global constants517.24%
▷ Class constants2482.76%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.32MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/paypal/rest-api-sdk-php/sample/images/sample_web.png134.77KB42.55KB▼ 68.43%
vendor/paypal/rest-api-sdk-php/sample/images/sample_console.png186.27KB44.73KB▼ 75.98%
vendor/paypal/rest-api-sdk-php/sample/invoice/images/sample.png1.64KB0.59KB▼ 63.79%
vendor/paypal/rest-api-sdk-php/sample/images/pp_v_rgb.png7.53KB4.59KB▼ 39.12%