84% wc-thank-you-page

Code Review | WC Thank You Page

WordPress plugin WC Thank You Page scored84%from 54 tests.

About plugin

  • Plugin page: wc-thank-you-page
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: Dec 22, 2020
  • Latest release: Aug 16, 2023
  • Number of updates: 15
  • Update frequency: every 64.9 days
  • Top authors: richardmallick (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /944 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.13ms] Passed 4 tests

A check of server-side resources used by WC Thank You Page
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.75 ▼2.88
Dashboard /wp-admin3.33 ▲0.0346.45 ▲1.18
Posts /wp-admin/edit.php3.38 ▲0.0348.23 ▲1.92
Add New Post /wp-admin/post-new.php5.93 ▲0.0587.06 ▼4.72
Media Library /wp-admin/upload.php3.26 ▲0.0338.01 ▲3.94

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WC Thank You Page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.20 ▼1.231.82 ▼0.1538.52 ▼2.23
Dashboard /wp-admin2,229 ▲775.89 ▲0.20107.23 ▼1.9537.44 ▼4.32
Posts /wp-admin/edit.php2,111 ▲252.01 ▲0.0235.14 ▼3.7736.26 ▼2.79
Add New Post /wp-admin/post-new.php1,540 ▲2623.49 ▲5.89669.68 ▲63.1652.98 ▼8.19
Media Library /wp-admin/upload.php1,414 ▲294.25 ▲0.0097.03 ▼10.0741.11 ▼4.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • WPTE_thankyou_version
    • db_upgraded
    • WPTE_thankyou_installed
    • widget_recent-comments

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)
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
Please fix the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-tabs.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wc-thank-you-page/wc-thank-you-page.php:15
    • > PHP Warning
      Use of undefined constant WPTE_THANKYOU_MINIMUM_WC_VERSION - assumed 'WPTE_THANKYOU_MINIMUM_WC_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-status.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-tutorial.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-status.php:46
    • > PHP Warning
      Use of undefined constant WP_CACHE - assumed 'WP_CACHE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-status.php on line 5
    • > PHP Warning
      Use of undefined constant WPTE_THANKYOU_MINIMUM_PHP_VERSION - assumed 'WPTE_THANKYOU_MINIMUM_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-status.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-shortcode.php:13
    • > PHP Warning
      Use of undefined constant WC_VERSION - assumed 'WC_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-status.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wc-thank-you-page/includes/Admin/views/wpte-thankyou-general.php:37

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 on the user side

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
9 plugin tags: redirect thank you page, thank you page, woocommerce thanks redirect, woocommerce thank you, wordpress...

wc-thank-you-page/wc-thank-you-page.php Passed 13 tests

The main PHP file in "WC Thank You Page" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
78 characters long description:
This is redirect to thank you page plugin after complete order for Woocommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,572 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP22318398977
CSS411137518
JavaScript232937
HTML11024
SVG13015
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.83
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods58
▷ Static methods58.62%
▷ Public methods5696.55%
▷ Protected methods00.00%
▷ Private methods23.45%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants12
▷ Global constants866.67%
▷ Class constants433.33%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.27MB with 0.14MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/Screenshot_2.png104.55KB62.79KB▼ 39.95%
assets/img/Screenshot_1.png74.85KB29.09KB▼ 61.13%
assets/img/logo.png20.26KB12.06KB▼ 40.47%
assets/img/Screenshot_3.png78.45KB30.51KB▼ 61.10%