90% product-redirection-for-woocommerce

Code Review | Product Redirection for WooCommerce

WordPress plugin Product Redirection for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: product-redirecti...
  • Plugin version: 1.1.9
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2020
  • Latest release: Jan 26, 2023
  • Number of updates: 23
  • Update frequency: every 37.1 days
  • Top authors: polyplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,798 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.70ms] Passed 4 tests

Server-side resources used by Product Redirection for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.04 ▲2.42
Dashboard /wp-admin3.31 ▲0.0140.43 ▼4.37
Posts /wp-admin/edit.php3.36 ▲0.0142.24 ▼3.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0194.43 ▼9.61
Media Library /wp-admin/upload.php3.23 ▲0.0145.56 ▲15.30

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 9 new options
New WordPress options
stock_notice_prfw
can_compress_scripts
theysaidso_admin_options
trash_disable_prfw
widget_recent-posts
trash_warning_prfw
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Product Redirection for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5613.20 ▼1.601.65 ▼0.6139.18 ▼8.93
Dashboard /wp-admin2,219 ▲285.83 ▼0.07104.37 ▼10.3239.07 ▼5.10
Posts /wp-admin/edit.php2,104 ▲152.02 ▼0.0439.06 ▼2.4338.74 ▲1.50
Add New Post /wp-admin/post-new.php1,546 ▲1323.10 ▼0.36577.85 ▼114.9958.51 ▲1.15
Media Library /wp-admin/upload.php1,398 ▲134.28 ▲0.05137.82 ▲36.7053.36 ▲11.30

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • trash_disable_prfw
    • can_compress_scripts
    • trash_warning_prfw
    • db_upgraded
    • stock_notice_prfw
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: woocommerce redirect, product redirection, seo, woocommerce, product...

product-redirection-for-woocommerce/product-redirection-for-woocommerce.php Passed 13 tests

The main PHP script in "Product Redirection for WooCommerce" version 1.1.9 is automatically included on every request by WordPress
106 characters long description:
Instead of deleting products which is bad for SEO, redirect them to their parent category or a custom url.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected674 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP77541341
JavaScript2723166
JSON100153
CSS251914

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.67
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods31
▷ Static methods39.68%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin