83% woo-products-restricted-users

Code Review | Products Restricted Users for WooCommerce

WordPress plugin Products Restricted Users for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-products-rest...
  • Plugin version: 0.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 21, 2019
  • Latest release: Nov 9, 2023
  • Number of updates: 24
  • Update frequency: every 69.5 days
  • Top authors: carazo (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /8,044 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.26ms] Passed 4 tests

An overview of server-side resources used by Products Restricted Users for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.82 ▼1.76
Dashboard /wp-admin3.33 ▼0.0243.31 ▼28.00
Posts /wp-admin/edit.php3.38 ▲0.0246.36 ▼0.97
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.74 ▼2.31
Media Library /wp-admin/upload.php3.25 ▲0.0231.60 ▲1.88

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Products Restricted Users for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲4714.29 ▼0.021.98 ▼0.0440.77 ▼2.45
Dashboard /wp-admin2,199 ▲224.86 ▼0.7995.04 ▼6.1642.66 ▼3.23
Posts /wp-admin/edit.php2,107 ▲72.24 ▲0.3038.05 ▲2.4333.27 ▲0.10
Add New Post /wp-admin/post-new.php1,530 ▲423.20 ▼0.01594.40 ▼97.8350.32 ▼11.29
Media Library /wp-admin/upload.php1,404 ▲44.33 ▲0.12101.30 ▼7.4840.60 ▼4.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-products-restricted-users/woo-products-restricted-users.php:15

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid url: "ttps://codection.com/go/donate-import-users-from-csv-with-meta"
  • Screenshots: Screenshot #1 (Metabox with data to fill in each products) image required
Please take inspiration from this readme.txt

woo-products-restricted-users/woo-products-restricted-users.php 92% from 13 tests

The main PHP file in "Products Restricted Users for WooCommerce" ver. 0.5.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.4" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin447 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5109190445
CSS1001
JavaScript1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity17.25
▷ Minimum class complexity6.00
▷ Maximum class complexity30.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods3096.77%
▷ Protected methods00.00%
▷ Private methods13.23%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected