84% whols

Code Review | Whols - WooCommerce Wholesale Prices and WooCommerce B2B Store Solution

WordPress plugin Whols - WooCommerce Wholesale Prices and WooCommerce B2B Store Solution scored84%from 54 tests.

About plugin

  • Plugin page: whols
  • Plugin version: 1.2.8
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 13, 2021
  • Latest release: Nov 6, 2023
  • Number of updates: 60
  • Update frequency: every 16.6 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /24,589 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.48MB] [CPU: ▲8.79ms] 75% from 4 tests

An overview of server-side resources used by Whols - WooCommerce Wholesale Prices and WooCommerce B2B Store Solution
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,162.57ms on /wp-admin/admin.php?page=whols_recommendations)
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4847.94 ▲8.27
Dashboard /wp-admin4.78 ▲1.4852.54 ▲4.96
Posts /wp-admin/edit.php4.90 ▲1.5460.20 ▲12.30
Add New Post /wp-admin/post-new.php7.36 ▲1.48101.00 ▲12.99
Media Library /wp-admin/upload.php4.70 ▲1.4843.45 ▲9.64
Recommendations /wp-admin/admin.php?page=whols_recommendations9.082,162.57

Server storage [IO: ▲2.00MB] [DB: ▲0.70MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Whols - WooCommerce Wholesale Prices and WooCommerce B2B Store Solution: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6114.31 ▼0.041.89 ▼0.0241.96 ▲0.51
Dashboard /wp-admin2,203 ▲235.62 ▲0.0185.44 ▼2.4639.43 ▼0.40
Posts /wp-admin/edit.php2,108 ▲111.95 ▼0.0639.50 ▲2.3739.95 ▲6.00
Add New Post /wp-admin/post-new.php1,533 ▲723.18 ▲0.07609.25 ▼17.9050.36 ▼1.71
Media Library /wp-admin/upload.php1,405 ▲54.27 ▲0.0498.99 ▼3.7642.47 ▼1.45
Recommendations /wp-admin/admin.php?page=whols_recommendations1,3192.1825.9731.28

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'CSF_Fields' not found in wp-content/plugins/whols/includes/Admin/CSF_Field_whols_image.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Whols\\add_action() in wp-content/plugins/whols/includes/Email_Notifications.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please describe screenshot #10 in whols/assets to your readme.txt
You can look at the official readme.txt

whols/whols.php Passed 13 tests

The main PHP script in "Whols - WooCommerce Wholesale Prices and WooCommerce B2B Store Solution" version 1.2.8 is automatically included on every request by WordPress
134 characters long description:
This plugin provides all the necessary features that you will ever need to sell wholesale products from your WooCommerce online store.

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
No dangerous file extensions were detected38,017 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1074,0682,38717,832
PO File203,1973,5946,490
Sass1595234,803
CSS83184974,632
JavaScript91,3254244,258
SVG2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity23.09
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity6.05
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes80
▷ Abstract classes22.50%
▷ Concrete classes7897.50%
▷ Final classes11.28%
Methods350
▷ Static methods4512.86%
▷ Public methods34799.14%
▷ Protected methods00.00%
▷ Private methods30.86%
Functions47
▷ Named functions4697.87%
▷ Anonymous functions12.13%
Constants5
▷ Global constants5100.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
9 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/Admin/recommended-plugins/assets/images/extensions/hashbar-pro.png4.01KB2.16KB▼ 46.22%
includes/Admin/recommended-plugins/assets/images/extensions/just-tables-pro.png1.02KB1.05KB0.00%
assets/images/woolentor-logo.png8.23KB8.96KB0.00%
includes/Admin/recommended-plugins/assets/images/extensions/email-candy-pro.png5.27KB2.53KB▼ 52.04%
includes/Admin/recommended-plugins/assets/images/extensions/wc-builder-pro.png15.60KB10.08KB▼ 35.39%