84% wc-coupon-for-highest-priced-item

Code Review | Coupon for Highest Priced Item for WooCommerce

WordPress plugin Coupon for Highest Priced Item for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wc-coupon-for-hig...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7.2
  • WordPress version: 6.3.1
  • First release: Dec 3, 2020
  • Latest release: May 27, 2021
  • Number of updates: 9
  • Update frequency: every 19.6 days
  • Top authors: marcellobachechi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /501 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Analyzing server-side resources used by Coupon for Highest Priced Item for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.64 ▲0.09
Dashboard /wp-admin3.33 ▲0.0248.27 ▼5.54
Posts /wp-admin/edit.php3.38 ▲0.0249.05 ▲0.46
Add New Post /wp-admin/post-new.php5.91 ▲0.0183.63 ▼15.37
Media Library /wp-admin/upload.php3.25 ▲0.0133.01 ▼8.08

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Coupon for Highest Priced Item for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.35 ▼0.001.73 ▲0.0443.77 ▼0.38
Dashboard /wp-admin2,201 ▲215.63 ▼0.0390.63 ▲1.9143.70 ▼3.82
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0036.53 ▼2.9334.07 ▼3.12
Add New Post /wp-admin/post-new.php1,529 ▲123.19 ▲0.09683.83 ▼15.1059.76 ▼13.01
Media Library /wp-admin/upload.php1,406 ▲64.32 ▲0.19101.02 ▼10.8244.54 ▼2.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-coupon-for-highest-priced-item/settings-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-coupon-for-highest-priced-item/ValidateCoupon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-coupon-for-highest-priced-item/ApplyDiscount.php:3
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/wc-coupon-for-highest-priced-item/RegisterCoupon.php on line 48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-coupon-for-highest-priced-item/KoFi.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: woocommerce, coupons, discounts

wc-coupon-for-highest-priced-item/index.php 85% from 13 tests

This is the main PHP file of "Coupon for Highest Priced Item for WooCommerce" version 1.0.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "5.3")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-coupon-for-highest-priced-item.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin344 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP64962292
Markdown135052

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.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
There are no PNG files in this plugin