84% woo-groups-discount

Code Review | Woo Groups Discount

WordPress plugin Woo Groups Discount scored84%from 54 tests.

About plugin

  • Plugin page: woo-groups-discount
  • Plugin version: 3.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7.5
  • WordPress version: 6.3.1
  • First release: May 11, 2016
  • Latest release: Jul 24, 2017
  • Number of updates: 21
  • Update frequency: every 20.9 days
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /3,729 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Woo Groups Discount
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.92 ▲0.31
Dashboard /wp-admin3.31 ▲0.0054.87 ▲2.18
Posts /wp-admin/edit.php3.36 ▲0.0053.19 ▼0.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.07 ▲2.59
Media Library /wp-admin/upload.php3.23 ▲0.0040.43 ▲5.42

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Woo Groups Discount
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.37 ▲0.021.93 ▲0.0252.59 ▲9.83
Dashboard /wp-admin2,198 ▲185.64 ▲0.0091.15 ▼2.5835.58 ▼8.56
Posts /wp-admin/edit.php2,103 ▲62.02 ▲0.0343.67 ▲5.9736.16 ▼0.84
Add New Post /wp-admin/post-new.php1,526 ▼022.96 ▼0.06690.12 ▲49.5560.72 ▲13.02
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.09113.42 ▲6.8050.48 ▲9.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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
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
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to get property 'version' of non-object in wp-content/plugins/woo-groups-discount/core/class-woogroupsdiscount.php on line 32
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-groups-discount/woo-groups-discount.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/woo-groups-discount/woo-groups-discount.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-groups-discount/core/class-woogroupsdiscount.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Settings: Method - Method dashboard section.), #2 (Settings: Groups - Groups dashboard section.), #3 (Prices - Different prices by user's role.)
You can look at the official readme.txt

woo-groups-discount/woo-groups-discount.php Passed 13 tests

The entry point to "Woo Groups Discount" version 3.2.0 is a PHP file that has certain tags in its header comment area
45 characters long description:
Apply discounts according to the user's group

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin858 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3160220769
PO File15611485
CSS1004

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity55.00
▷ Minimum class complexity33.00
▷ Maximum class complexity79.00
Average method complexity6.59
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods29100.00%
▷ Public methods2689.66%
▷ Protected methods26.90%
▷ Private methods13.45%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.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
No PNG files were detected