87% add-to-cart-direct-checkout-for-woocommerce

Code Review | Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce

WordPress plugin Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce scored 87% from 54 tests.

About plugin

  • Plugin page: add-to-cart-direc...
  • Plugin version: 2.1.24
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9.2
  • WordPress version: 5.9.2
  • First release: Mar 4, 2019
  • Latest release: Mar 24, 2022
  • Number of updates: 128
  • Update frequency: every 8.7 days
  • Top authors: rajeshsingh520 (100%)

Code review

54 tests

User reviews

70 reviews

Install metrics

10,000+ active / 236,036 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0248.52 ▼1.65
Dashboard /wp-admin3.42 ▲0.0133.03 ▼1.25
Posts /wp-admin/edit.php3.66 ▲0.0134.95 ▼2.20
Add New Post /wp-admin/post-new.php6.90 ▼0.0794.25 ▼1,178.99
Media Library /wp-admin/upload.php3.31 ▲0.0024.95 ▼7.11

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 57 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲2015.68 ▼0.035.70 ▼0.052.12 ▼0.38
Dashboard /wp-admin2,898 ▲376.12 ▼0.09122.43 ▼9.28158.41 ▼2.13
Posts /wp-admin/edit.php2,704 ▲133.36 ▼0.0064.00 ▼0.33135.22 ▼5.53
Add New Post /wp-admin/post-new.php1,758 ▼1521.05 ▼0.65441.78 ▼8.85152.94 ▼2.25
Media Library /wp-admin/upload.php1,708 ▲135.52 ▲0.05136.99 ▼21.58186.60 ▼17.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/banner-sample.php
    • > /wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/pisol.class.form.php
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/includes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/public/class-change-quantity-checkout.php:8
    • > PHP Notice
      Undefined variable: date in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/banner-sample.php on line 78
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/plugins.php:89
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/class-pi-dcw-checkout.php:154
    • > PHP Notice
      Undefined variable: percent in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/banner-sample.php on line 114
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/class-pi-dcw-buy-now.php:109
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/public/quickview/class-pi-dcw-quickview.php:110
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/class-pi-dcw-option.php:113
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/class-pi-dcw-woo.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: The official readme.txt might help

add-to-cart-direct-checkout-for-woocommerce/pi-dcw.php 69% from 13 tests

"Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce" version 2.1.24's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Please don't use more than 140 characters for the plugin description (currently 214 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("add-to-cart-direct-checkout-for-woocommerce.php" instead of "pi-dcw.php")
  • Plugin Name: A shorter plugin name is better (currently 81 characters long instead of max. 70)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected13,793 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
CSS62,120249,832
PHP276706192,049
SVG5441,226
JavaScript8178263678
XML1008

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.95
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods122
▷ Static methods108.20%
▷ Public methods11795.90%
▷ Protected methods00.00%
▷ Private methods54.10%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/pi-web-solution.png21.25KB9.42KB▼ 55.67%