78% woocommerce-direct-checkout

Code Review | Direct Checkout for WooCommerce

WordPress plugin Direct Checkout for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-direc...
  • Plugin version: 3.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 13, 2013
  • Latest release: Nov 14, 2023
  • Number of updates: 240
  • Update frequency: every 15.7 days
  • Top authors: quadlayers (86.25%)terrytsang (13.75%)

Code review

54 tests

User reviews

340 reviews

Install metrics

80,000+ active /1,896,718 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▲1.24ms] Passed 4 tests

Server-side resources used by Direct Checkout for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4545.41 ▲6.58
Dashboard /wp-admin3.84 ▲0.4950.14 ▼8.21
Posts /wp-admin/edit.php3.85 ▲0.4955.46 ▲8.63
Add New Post /wp-admin/post-new.php6.32 ▲0.4293.65 ▼2.06
Media Library /wp-admin/upload.php3.66 ▲0.4244.78 ▲10.93
Suggestions /wp-admin/admin.php?page=wc-settings_suggestions4.15494.90

Server storage [IO: ▲0.71MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 104 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
qlwcdc_wcd_imported2
widget_theysaidso_widget

Browser metrics Passed 4 tests

Direct Checkout for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15114.24 ▼0.471.61 ▼0.0040.44 ▼1.31
Dashboard /wp-admin2,318 ▲1405.62 ▼0.2192.01 ▼16.8140.81 ▲4.30
Posts /wp-admin/edit.php2,126 ▲261.96 ▼0.0440.02 ▲0.1336.32 ▼1.41
Add New Post /wp-admin/post-new.php1,548 ▲2223.03 ▼0.18685.82 ▲13.4659.59 ▲10.81
Media Library /wp-admin/upload.php1,428 ▲284.28 ▲0.0998.38 ▼2.0140.86 ▼5.66
Suggestions /wp-admin/admin.php?page=wc-settings_suggestions1,9572.4735.2857.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • qlwcdc_wcd_imported2
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/woocommerce-direct-checkout/woocommerce-direct-checkout.php
  • 20× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-direct-checkout/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/woocommerce-direct-checkout/lib/view/backend/pages/parts/tabs.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woocommerce-direct-checkout/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/view/suggestions.php:21
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActionsLinks' not found in wp-content/plugins/woocommerce-direct-checkout/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/Traits/PluginActions.php on line 20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-direct-checkout/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'QuadLayers\\WCDC\\Install' not found in wp-content/plugins/woocommerce-direct-checkout/lib/class-plugin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/woocommerce-direct-checkout/lib/view/backend/pages/parts/tabs.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/woocommerce-direct-checkout/vendor/automattic/jetpack-composer-plugin/src/class-plugin.php:24
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginDataByFile' not found in wp-content/plugins/woocommerce-direct-checkout/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginByFile.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/woocommerce-direct-checkout/vendor/automattic/jetpack-composer-plugin/src/class-manager.php:18

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: You can look at the official readme.txt

woocommerce-direct-checkout/woocommerce-direct-checkout.php 92% from 13 tests

The main file in "Direct Checkout for WooCommerce" v. 3.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "4.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 detected5,527 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
PHP647582,2223,904
Markdown122700730
JSON100458
JavaScript61322433
CSS2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity12.69
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces0
Traits3
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes13.12%
Methods211
▷ Static methods7133.65%
▷ Public methods18587.68%
▷ Protected methods00.00%
▷ Private methods2612.32%
Functions18
▷ Named functions15.56%
▷ Anonymous functions1794.44%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.12MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/backend/img/checkout.png54.60KB56.63KB0.00%
assets/backend/img/modal.png70.65KB74.62KB0.00%