84% thankyou-coupons-for-wc

Code Review | Thankyou Coupons for WooCommerce

WordPress plugin Thankyou Coupons for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: thankyou-coupons-...
  • Plugin version: 2.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 12, 2019
  • Latest release: Jun 26, 2023
  • Number of updates: 92
  • Update frequency: every 14.4 days
  • Top authors: cmbibby (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /4,110 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by Thankyou Coupons for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.75 ▼0.88
Dashboard /wp-admin3.31 ▼0.0446.65 ▼14.16
Posts /wp-admin/edit.php3.36 ▲0.0047.15 ▲0.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.85 ▼10.09
Media Library /wp-admin/upload.php3.23 ▲0.0034.27 ▼1.35

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Thankyou Coupons for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.66 ▼0.542.04 ▲0.2843.66 ▲5.35
Dashboard /wp-admin2,206 ▲145.84 ▲0.9696.96 ▼16.8539.15 ▼7.07
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0242.50 ▲6.1236.47 ▲1.43
Add New Post /wp-admin/post-new.php1,538 ▲1923.23 ▼0.48682.55 ▼22.8356.97 ▲6.36
Media Library /wp-admin/upload.php1,391 ▲34.19 ▼0.0497.39 ▼10.2248.84 ▲3.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php:14
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 11
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 12
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 12
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/thankyou-coupons-for-wc/templates/basic-coupon.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: dynamic coupon, woocommerce thankyou page, woocommerce discount coupons, woocommerce coupons, coupons...

thankyou-coupons-for-wc/thankyou-coupons-for-wc.php 92% from 13 tests

The principal PHP file in "Thankyou Coupons for WooCommerce" v. 2.2.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.7.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,077 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP13175472922
Markdown1750136
CSS13014
JSON1005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity14.14
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods76
▷ Static methods2431.58%
▷ Public methods6585.53%
▷ Protected methods67.89%
▷ Private methods56.58%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected