77% 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 scored77%from 54 tests.

About plugin

  • Plugin page: add-to-cart-direc...
  • Plugin version: 2.1.73.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Mar 4, 2019
  • Latest release: Nov 28, 2023
  • Number of updates: 166
  • Update frequency: every 10.4 days
  • Top authors: rajeshsingh520 (100%)

Code review

54 tests

User reviews

87 reviews

Install metrics

10,000+ active /425,301 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

A check 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.47 ▲0.0033.24 ▼7.45
Dashboard /wp-admin3.31 ▼0.0444.36 ▼14.25
Posts /wp-admin/edit.php3.36 ▲0.0044.26 ▼9.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.73 ▼6.55
Media Library /wp-admin/upload.php3.23 ▲0.0034.86 ▲1.10

Server storage [IO: ▲2.65MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

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
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.34 ▲0.101.54 ▼0.0738.30 ▼4.72
Dashboard /wp-admin2,201 ▲245.59 ▼0.1294.04 ▼6.8538.10 ▼6.29
Posts /wp-admin/edit.php2,110 ▲101.96 ▲0.0040.41 ▼0.2637.54 ▼0.95
Add New Post /wp-admin/post-new.php1,532 ▲623.35 ▲0.48591.85 ▼78.6851.79 ▼0.70
Media Library /wp-admin/upload.php1,409 ▲64.20 ▼0.0794.59 ▼3.3840.14 ▼6.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • 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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via 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 add_action() in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/admin/class-pi-dcw-woo.php:52
    • > 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 Notice
      Undefined variable: percent in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/banner-sample.php on line 114
    • > 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: 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 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:112
    • > 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-add-to-cart.php:137
    • > PHP Notice
      Undefined variable: coupon_code in wp-content/plugins/add-to-cart-direct-checkout-for-woocommerce/includes/banner-sample.php on line 100
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes: You can take inspiration from this readme.txt

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

The entry point to "Direct checkout, Add to cart redirect, Quick purchase button, Buy now button, Quick View button for WooCommerce" version 2.1.73.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-to-cart-direct-checkout-for-woocommerce.php" instead of "pi-dcw.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 214 characters long)
  • Plugin Name: A shorter plugin name is better (currently 81 characters long instead of max. 70)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin14,082 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS62,127249,865
PHP287256312,268
SVG5441,226
JavaScript9185269714
XML1009

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity13.59
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods137
▷ Static methods118.03%
▷ Public methods12893.43%
▷ Protected methods42.92%
▷ Private methods53.65%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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
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%