89% taxonomy-discounts-woocommerce

Code Review | Taxonomy/Term and Role based Discounts for WooCommerce

WordPress plugin Taxonomy/Term and Role based Discounts for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: taxonomy-discount...
  • Plugin version: 4.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 25, 2016
  • Latest release: Sep 7, 2023
  • Number of updates: 117
  • Update frequency: every 23.3 days
  • Top authors: webdados (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active / 12,291 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.16ms] Passed 4 tests

Analyzing server-side resources used by Taxonomy/Term and Role based Discounts for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.00 ▼5.19
Dashboard /wp-admin3.31 ▲0.0142.87 ▼5.43
Posts /wp-admin/edit.php3.36 ▲0.0045.01 ▼0.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.03 ▼9.69
Media Library /wp-admin/upload.php3.23 ▲0.0033.22 ▲2.65

Server storage [IO: ▲0.13MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Taxonomy/Term and Role based Discounts for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.30 ▼1.105.24 ▲3.4835.68 ▼14.85
Dashboard /wp-admin2,217 ▲295.90 ▲0.98106.12 ▲1.0941.29 ▼1.99
Posts /wp-admin/edit.php2,100 ▲112.01 ▲0.0136.95 ▲1.0633.01 ▼2.60
Add New Post /wp-admin/post-new.php1,549 ▲1623.15 ▲0.18627.81 ▼16.5059.30 ▲5.56
Media Library /wp-admin/upload.php1,402 ▲204.21 ▲0.0597.94 ▲1.5243.10 ▼0.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (26 tag instead of maximum 10)
Please take inspiration from this readme.txt

taxonomy-discounts-woocommerce/taxonomy-discounts-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Taxonomy/Term and Role based Discounts for WooCommerce" version 4.3
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 163 characters long)

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,922 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4811581,582
JavaScript11321251
CSS13089

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity464.00
▷ Minimum class complexity464.00
▷ Maximum class complexity464.00
Average method complexity11.26
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods44
▷ Static methods36.82%
▷ Public methods4397.73%
▷ Protected methods00.00%
▷ Private methods12.27%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants1
▷ Global constants1100.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 are no PNG files in this plugin