79% wc-add-to-cart-redirection

Code Review | WooCommerce Add To Cart Redirection

WordPress plugin WooCommerce Add To Cart Redirection scored79%from 54 tests.

About plugin

  • Plugin page: wc-add-to-cart-re...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.0.3
  • WordPress version: 6.3.1
  • First release: Jan 19, 2019
  • Latest release: Jan 19, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: harunrrayhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /709 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.05ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Add To Cart Redirection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.59 ▼2.64
Dashboard /wp-admin3.31 ▲0.0043.58 ▼5.04
Posts /wp-admin/edit.php3.36 ▲0.0044.44 ▲1.48
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.60 ▼5.99
Media Library /wp-admin/upload.php3.23 ▲0.0033.66 ▲2.89

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Add To Cart Redirection
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.23 ▼1.191.79 ▼0.5143.56 ▼3.21
Dashboard /wp-admin2,206 ▲214.86 ▼0.12102.54 ▼15.5941.60 ▼0.97
Posts /wp-admin/edit.php2,086 ▼62.00 ▼0.0437.04 ▼3.0732.81 ▼4.53
Add New Post /wp-admin/post-new.php1,519 ▼2623.12 ▼0.12659.19 ▼13.1756.05 ▲7.00
Media Library /wp-admin/upload.php1,385 ▼34.19 ▲0.0396.00 ▼7.4441.38 ▼5.59

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wc-add-to-cart-redirection/tests/bootstrap.php
    • > /wp-content/plugins/wc-add-to-cart-redirection/wc-add-to-cart-redirection.php
    • > /wp-content/plugins/wc-add-to-cart-redirection/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wc-add-to-cart-redirection/tests/test-sample.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: add to cart redirect, redirect to checkout, woocommerc, add to cart redirection, woocommerce redirection...

wc-add-to-cart-redirection/wc-add-to-cart-redirection.php Passed 13 tests

"WooCommerce Add To Cart Redirection" version 0.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
86 characters long description:
Redirect user to any selected page upon product added to cart. You can choose any page

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
Good job! No executable or dangerous file extensions detected366 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP657104167
Bourne Shell12111123
JavaScript19146
XML10016
JSON11011
Markdown1103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.23MB with 0.17MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png237.82KB68.65KB▼ 71.13%