84% bs-user-products

Code Review | Woocommerce User Products

WordPress plugin Woocommerce User Products scored84%from 54 tests.

About plugin

  • Plugin page: bs-user-products
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Oct 14, 2019
  • Latest release: Oct 20, 2020
  • Number of updates: 6
  • Update frequency: every 63.7 days
  • Top authors: cmsexpert (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,559 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.40ms] Passed 4 tests

A check of server-side resources used by Woocommerce User Products
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.21 ▼3.09
Dashboard /wp-admin3.42 ▲0.1256.19 ▼0.75
Posts /wp-admin/edit.php3.54 ▲0.1847.79 ▼8.14
Add New Post /wp-admin/post-new.php6.00 ▲0.1285.27 ▼10.83
Media Library /wp-admin/upload.php3.34 ▲0.1236.41 ▼3.53

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
bsup_activate
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce User Products
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲2414.25 ▼0.101.56 ▼0.3538.74 ▼5.71
Dashboard /wp-admin2,216 ▲425.58 ▼0.0388.20 ▼3.1939.06 ▼2.42
Posts /wp-admin/edit.php2,121 ▲212.01 ▲0.0534.49 ▼9.3031.10 ▼8.29
Add New Post /wp-admin/post-new.php1,544 ▲1623.34 ▲0.27671.68 ▼50.3467.89 ▼0.95
Media Library /wp-admin/upload.php1,424 ▲244.22 ▼0.0396.97 ▼21.1441.42 ▼8.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • bsup_activate
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bs-user-products/bs-user-products-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bs-user-products/includes/woo-hooks.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: user products, woocommerce, woocommerce products, woocommerce addon

bs-user-products/bs-user-products.php 92% from 13 tests

The main PHP script in "Woocommerce User Products" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin553 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5212266528
JavaScript19224
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity38.50
▷ Minimum class complexity27.00
▷ Maximum class complexity50.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods1560.00%
▷ Protected methods00.00%
▷ Private methods1040.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin