90% add-to-cart-redirect

Code Review | WooCommerce Add to Cart Redirect - To Any Page

WordPress plugin WooCommerce Add to Cart Redirect - To Any Page scored 90% from 53 tests.

About plugin

  • Plugin page: add-to-cart-redirect
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-5.7.2
  • WordPress version: 5.8.1
  • First release: Jun 15, 2021
  • Latest release: Jun 26, 2021
  • Number of updates: 6
  • Update frequency: every 2.0 days
  • Top authors: wpxon (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 719 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.10MB] [CPU: ▼257.37ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Add to Cart Redirect - To Any Page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1841.86 ▲18.11
Dashboard /wp-admin3.14 ▲0.0943.70 ▼1.17
Posts /wp-admin/edit.php3.25 ▲0.1542.55 ▲0.76
Add New Post /wp-admin/post-new.php5.50 ▲0.0791.14 ▼1,023.55
Media Library /wp-admin/upload.php3.08 ▲0.0832.95 ▼5.50

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 2 new options
New WordPress options
wcr_installed
wcr_version

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Add to Cart Redirect - To Any Page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲9115.96 ▲0.5010.47 ▲2.1947.17 ▼1.16
Dashboard /wp-admin2,934 ▲825.88 ▲0.05135.03 ▼18.23103.82 ▼2.07
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0072.87 ▲5.2485.41 ▼11.94
Add New Post /wp-admin/post-new.php1,653 ▲218.86 ▲1.47371.54 ▲3.06106.45 ▲2.89
Media Library /wp-admin/upload.php1,772 ▼35.03 ▲0.02149.16 ▼3.53106.85 ▼3.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 2 options
    • wcr_version
    • wcr_installed

Smoke tests Passed 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 everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: redirect to page, add to cart redirect, redirect, redirect to product, redirect to shop...

add-to-cart-redirect/add-to-cart-redirect.php Passed 13 tests

The main PHP file in "WooCommerce Add to Cart Redirect - To Any Page" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
85 characters long description:
After Add to Cart a Product it enables you to redirect to any specific page you want.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected488 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP10129235467
JSON20021

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods40
▷ Static methods820.00%
▷ Public methods3997.50%
▷ Protected methods00.00%
▷ Private methods12.50%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected