84% role-wc

Code Review | Role management for WooCommerce

WordPress plugin Role management for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: role-wc
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8.0
  • WordPress version: 6.3.1
  • First release: Jul 20, 2021
  • Latest release: Jul 20, 2021
  • Number of updates: 19
  • Update frequency: N/A
  • Top authors: shohei.tanaka (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /364 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.02MB] [CPU: ▼4.76ms] Passed 4 tests

A check of server-side resources used by Role management for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.68 ▼3.11
Dashboard /wp-admin3.32 ▲0.0247.46 ▼6.10
Posts /wp-admin/edit.php3.37 ▲0.0249.80 ▲4.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.53 ▼12.65
Media Library /wp-admin/upload.php3.25 ▲0.0233.88 ▲2.83

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

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

Browser metrics Passed 4 tests

Role management for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.25 ▼1.331.64 ▼0.2140.63 ▼5.84
Dashboard /wp-admin2,211 ▲235.84 ▲0.99103.66 ▼16.5440.34 ▼1.27
Posts /wp-admin/edit.php2,100 ▲82.03 ▼0.0138.73 ▲1.4836.57 ▲2.17
Add New Post /wp-admin/post-new.php1,542 ▼023.02 ▲4.42677.92 ▲32.2860.35 ▼0.31
Media Library /wp-admin/upload.php1,402 ▲144.22 ▲0.0499.90 ▲4.9343.38 ▲0.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • 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
Even though no errors were found, this is by no means 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/role-wc/includes/admin/views/html-admin-screen.php:2

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: e-commerce, woocommerce, role, ecommerce, creator

role-wc/role-wc.php 92% from 13 tests

The main PHP file in "Role management for WooCommerce" ver. 1.0.4 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: The required version number did not match the one declared in readme.txt ("5.8.0" instead of "5.8")

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
Good job! No executable or dangerous file extensions detected906 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7116483906

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity23.20
▷ Minimum class complexity4.00
▷ Maximum class complexity67.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods66
▷ Static methods913.64%
▷ Public methods6293.94%
▷ Protected methods34.55%
▷ Private methods11.52%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin