84% woocommerce-add-to-cart-custom-redirect

Code Review | WooCommerce Add to Cart Custom Redirect

WordPress plugin WooCommerce Add to Cart Custom Redirect scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-add-t...
  • Plugin version: 1.2.13
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Nov 30, 2023
  • Number of updates: 56
  • Update frequency: every 60.4 days
  • Top authors: EngageWP (60.71%)forwardflip (21.43%)renventura (21.43%)

Code review

54 tests

User reviews

12 reviews

Install metrics

3,000+ active /47,816 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

This is a short check of server-side resources used by WooCommerce Add to Cart Custom Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.24 ▼4.88
Dashboard /wp-admin3.31 ▲0.0044.33 ▼7.14
Posts /wp-admin/edit.php3.36 ▲0.0045.81 ▼3.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.77 ▼10.40
Media Library /wp-admin/upload.php3.23 ▲0.0032.50 ▼2.38

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Add to Cart Custom Redirect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.22 ▼0.491.67 ▼0.0441.56 ▼6.69
Dashboard /wp-admin2,198 ▲215.62 ▼0.0392.79 ▲4.2745.54 ▲0.78
Posts /wp-admin/edit.php2,103 ▲32.07 ▼0.0840.84 ▲1.6135.54 ▲3.52
Add New Post /wp-admin/post-new.php1,526 ▼322.99 ▼0.11579.66 ▼118.3855.49 ▲6.16
Media Library /wp-admin/upload.php1,394 ▼64.21 ▲0.0197.57 ▲2.0841.55 ▼2.56

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
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-add-to-cart-custom-redirect/templates/product-data-tab-target.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-add-to-cart-custom-redirect/templates/product-data-tab-upgrade-notice.php:19
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/woocommerce-add-to-cart-custom-redirect/templates/product-data-tab-target.php on line 26
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/woocommerce-add-to-cart-custom-redirect/templates/product-data-tab-target.php on line 15

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: woocommerce, redirect

woocommerce-add-to-cart-custom-redirect/woocommerce-custom-redirect.php 85% from 13 tests

The main PHP script in "WooCommerce Add to Cart Custom Redirect" version 1.2.13 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-add-to-cart-custom-redirect.php" instead of "woocommerce-custom-redirect.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected271 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6115139271

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/wcr-link.png4.88KB3.02KB▼ 38.10%