84% woo-add-to-cart-redirect

Code Review | Add To Cart redirect for WooCommerce

WordPress plugin Add To Cart redirect for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-add-to-cart-r...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.5-6.2
  • WordPress version: 6.3.1
  • First release: Jan 28, 2020
  • Latest release: May 2, 2023
  • Number of updates: 25
  • Update frequency: every 47.6 days
  • Top authors: softsprint (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,040 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.99ms] Passed 4 tests

Analyzing server-side resources used by Add To Cart redirect for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.78 ▼2.14
Dashboard /wp-admin3.36 ▲0.0545.85 ▼6.44
Posts /wp-admin/edit.php3.41 ▲0.0542.35 ▼3.88
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.79 ▼11.50
Media Library /wp-admin/upload.php3.28 ▲0.0541.33 ▲7.57

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Add To Cart redirect for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.30 ▼1.331.94 ▼0.0239.29 ▼9.85
Dashboard /wp-admin2,210 ▲224.94 ▲0.04102.13 ▼14.6539.71 ▼7.07
Posts /wp-admin/edit.php2,093 ▲72.02 ▲0.0234.26 ▼4.2037.62 ▲2.84
Add New Post /wp-admin/post-new.php1,527 ▼718.17 ▼4.85590.41 ▼81.5053.62 ▲6.75
Media Library /wp-admin/upload.php1,389 ▲14.18 ▼0.0994.99 ▼13.9240.86 ▼5.82

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

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

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-add-to-cart-redirect/templates/admin/product-link-tab.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-add-to-cart-redirect/Add-To-Cart-redirect-for-WooCommerce.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: redirect, links, woocommerce, add to cart, cart...

woo-add-to-cart-redirect/Add-To-Cart-redirect-for-WooCommerce.php 92% from 13 tests

The entry point to "Add To Cart redirect for WooCommerce" version 1.0.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-add-to-cart-redirect.php" instead of "Add-To-Cart-redirect-for-WooCommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected349 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3398224
CSS11091
JavaScript12034

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.32
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected