84% user-product-count-woocommerce

Code Review | User Product Count WooCommerce

WordPress plugin User Product Count WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: user-product-coun...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2016
  • Latest release: Aug 26, 2016
  • Number of updates: 4
  • Update frequency: every 3.3 days
  • Top authors: hardikp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /868 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by User Product Count WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.09 ▼2.62
Dashboard /wp-admin3.31 ▲0.0151.09 ▼5.08
Posts /wp-admin/edit.php3.36 ▲0.0048.46 ▼4.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.95 ▼13.36
Media Library /wp-admin/upload.php3.23 ▲0.0037.14 ▲0.73

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by User Product Count WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.34 ▼0.171.69 ▼0.6046.25 ▲1.21
Dashboard /wp-admin2,198 ▲245.62 ▲0.0192.93 ▼5.6742.11 ▼5.26
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0139.41 ▲1.9935.56 ▲1.42
Add New Post /wp-admin/post-new.php1,526 ▼223.00 ▼0.18644.77 ▼49.3661.87 ▲11.55
Media Library /wp-admin/upload.php1,397 ▼64.17 ▼0.0893.76 ▼13.9843.76 ▼3.35

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

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

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/user-product-count-woocommerce/user-product-count-woocommerce.php:25

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: The official readme.txt is a good inspiration

user-product-count-woocommerce/user-product-count-woocommerce.php Passed 13 tests

The primary PHP file in "User Product Count WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
106 characters long description:
Add count custom column in users list. Get total products count of each user/auther/seller in WooCommerce.

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 plugin27 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP181127

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png47.35KB21.82KB▼ 53.93%