74% user-custom-discount

Code Review | Custom WooCommerce Discount for User

WordPress plugin Custom WooCommerce Discount for User scored 74% from 54 tests.

About plugin

  • Plugin page: user-custom-discount
  • Plugin version: 1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2023
  • Latest release: May 11, 2023
  • Number of updates: 30
  • Update frequency: every 7.1 days
  • Top authors: beeplugindev (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 1,457 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.22ms] Passed 4 tests

This is a short check of server-side resources used by Custom WooCommerce Discount for User
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.02 ▲2.89
Dashboard /wp-admin3.32 ▲0.0247.75 ▼0.93
Posts /wp-admin/edit.php3.37 ▲0.0246.02 ▼2.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.11 ▼43.91
Media Library /wp-admin/upload.php3.25 ▲0.0235.03 ▲2.35

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

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

Browser metrics Passed 4 tests

Custom WooCommerce Discount for User: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.69 ▼0.771.81 ▲0.2243.12 ▼12.17
Dashboard /wp-admin2,233 ▲485.06 ▲0.18114.17 ▲15.0436.96 ▼3.68
Posts /wp-admin/edit.php2,113 ▲242.52 ▲0.5134.69 ▼5.2427.87 ▼7.26
Add New Post /wp-admin/post-new.php1,688 ▲16623.00 ▼0.26650.25 ▲2.0445.15 ▼19.91
Media Library /wp-admin/upload.php1,482 ▲944.41 ▲0.1996.59 ▼5.3639.66 ▼3.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_customer_discount
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/user-custom-discount/user-custom-discount.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: user specific discount, woocommerce discount, discount, category based discount, custom discount woocommerce

user-custom-discount/user-custom-discount.php Passed 13 tests

This is the main PHP file of "Custom WooCommerce Discount for User" version 1.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
37 characters long description:
User specific custom discount option.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin789 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP27545590
JavaScript23130184
CSS20615

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin