68% wc-thanks-redirect

Code Review | Thank You Page for WooCommerce

WordPress plugin Thank You Page for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: wc-thanks-redirect
  • Plugin version: 4.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 26, 2017
  • Latest release: Nov 20, 2023
  • Number of updates: 154
  • Update frequency: every 15.9 days
  • Top authors: nitin247 (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

10,000+ active /77,072 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼3.20ms] Passed 4 tests

A check of server-side resources used by Thank You Page for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.31 ▼0.1522.03 ▼21.72
Dashboard /wp-admin3.90 ▲0.5653.53 ▼6.82
Posts /wp-admin/edit.php3.96 ▲0.6055.81 ▲13.50
Add New Post /wp-admin/post-new.php6.42 ▲0.5497.74 ▲11.10
Media Library /wp-admin/upload.php3.66 ▲0.4338.66 ▲4.63
Thank You Page for WooCommerce /wp-admin/admin.php?page=wc-thanks-redirect3.8941.89
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius3.9937.89

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Thank You Page for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,465 ▼28214.26 ▼0.090.44 ▼1.197.64 ▼36.64
Dashboard /wp-admin2,215 ▲405.47 ▼0.2298.27 ▼6.9746.86 ▲6.67
Posts /wp-admin/edit.php2,124 ▲242.10 ▲0.1642.09 ▲1.7436.55 ▲2.22
Add New Post /wp-admin/post-new.php1,534 ▼023.69 ▼1.45609.01 ▼1.1453.40 ▼26.89
Media Library /wp-admin/upload.php1,423 ▲264.18 ▲0.0296.38 ▼2.1945.81 ▲3.31
Thank You Page for WooCommerce /wp-admin/admin.php?page=wc-thanks-redirect9741.6928.6458.14
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0691.6527.5827.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wc-thanks-redirect/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_active_plugins
    • db_upgraded
    • widget_recent-posts
    • fs_accounts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_debug_mode
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wc-thanks-redirect
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wc-thanks-redirect/wc-thanks-redirect.php

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: thank you page woocommerce, thanks redirect, woocommerce thank you redirect, thank you redirect, thank you page...

wc-thanks-redirect/wc-thanks-redirect.php 92% from 13 tests

Analyzing the main PHP file in "Thank You Page for WooCommerce" version 4.1.0
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)

Code Analysis 97% from 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 detected51,572 lines of code in 158 files:
LanguageFilesBlank linesComment linesLines of code
PHP1228,19517,48234,181
PO File177,5849,19916,927
Markdown1680214
JavaScript33459194
JSON10027
XML13016
CSS130013

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity87.19
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes00.00%
Methods1,277
▷ Static methods19915.58%
▷ Public methods87768.68%
▷ Protected methods171.33%
▷ Private methods38329.99%
Functions114
▷ Named functions11399.12%
▷ Anonymous functions10.88%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.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
5 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wc-place-order-without-payment.png7.50KB4.32KB▼ 42.41%
freemius/assets/img/wc-thanks-redirect.png23.38KB10.44KB▼ 55.36%
freemius/assets/img/wc-thanks-redirect-pro.png23.38KB10.44KB▼ 55.36%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%