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

About plugin

  • Plugin page: add-to-cart-redirect
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 15, 2021
  • Latest release: Jul 3, 2022
  • Number of updates: 8
  • Update frequency: every 48.0 days
  • Top authors: wpxon (75%)stalukder03 (37.5%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,327 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
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.07ms] Passed 4 tests

Server-side resources used by WooCommerce Add to Cart Redirect - To Any Page
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.95 ▼1.46
Dashboard /wp-admin3.39 ▲0.0445.09 ▼14.35
Posts /wp-admin/edit.php3.50 ▲0.1546.15 ▼10.03
Add New Post /wp-admin/post-new.php5.97 ▲0.0891.26 ▼5.89
Media Library /wp-admin/upload.php3.31 ▲0.0834.91 ▼2.02

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
wcr_version
theysaidso_admin_options
wcr_installed

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Add to Cart Redirect - To Any Page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.34 ▼0.022.11 ▲0.3236.94 ▼6.81
Dashboard /wp-admin2,198 ▲215.63 ▼0.0590.02 ▲2.8242.15 ▲0.26
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0039.39 ▼2.3136.29 ▼2.48
Add New Post /wp-admin/post-new.php1,526 ▼223.65 ▲0.79631.08 ▼14.8959.41 ▲6.05
Media Library /wp-admin/upload.php1,403 ▲94.19 ▼0.0095.24 ▼8.8043.01 ▼2.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • wcr_version
    • theysaidso_admin_options
    • db_upgraded
    • wcr_installed
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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

SRP Passed 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
The SRP test was a success

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, redirect to checkout, redirect to shop, redirect to page, add to cart redirect...

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

This is the main PHP file of "WooCommerce Add to Cart Redirect - To Any Page" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected488 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP10129235467
JSON20021

PHP code Passed 2 tests

A short review 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.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 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin