84% user-block-visibility

Code Review | User Block Visibility

WordPress plugin User Block Visibility scored84%from 54 tests.

About plugin

  • Plugin page: user-block-visibi...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Apr 13, 2019
  • Latest release: Apr 13, 2019
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: nateconley (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.24ms] Passed 4 tests

Server-side resources used by User Block Visibility
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.05 ▼3.49
Dashboard /wp-admin3.32 ▲0.0247.13 ▼3.41
Posts /wp-admin/edit.php3.37 ▲0.0248.92 ▼0.39
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.94 ▼19.53
Media Library /wp-admin/upload.php3.24 ▲0.0131.13 ▼6.51

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

User Block Visibility: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.301.69 ▼0.0043.82 ▲3.38
Dashboard /wp-admin2,195 ▲185.63 ▲0.0189.64 ▼1.5538.32 ▼4.61
Posts /wp-admin/edit.php2,103 ▲31.97 ▲0.0238.25 ▲1.3036.94 ▲1.44
Add New Post /wp-admin/post-new.php1,533 ▲423.12 ▼0.13682.13 ▼0.1253.94 ▼2.08
Media Library /wp-admin/upload.php1,403 ▲64.19 ▲0.06104.52 ▼15.6147.30 ▼2.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/user-block-visibility/user-block-visibility.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'UBV_UTILITIES' (include_path='.:/usr/share/php') in wp-content/plugins/user-block-visibility/lib/scripts.php on line 3
    • > PHP Warning
      Use of undefined constant UBV_UTILITIES - assumed 'UBV_UTILITIES' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-block-visibility/lib/scripts.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/user-block-visibility/lib/hide.php:40
    • > PHP Warning
      require_once(UBV_UTILITIES): failed to open stream: No such file or directory in wp-content/plugins/user-block-visibility/lib/scripts.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: blocks, gutenberg, users

user-block-visibility/user-block-visibility.php Passed 13 tests

"User Block Visibility" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
58 characters long description:
Allows authors to restrict access to blocks by user roles.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected7,974 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON2007,757
JavaScript3279120
PHP4395185
Sass12011
CSS1001

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.30
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.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%
Methods2
▷ Static methods150.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
No PNG images were found in this plugin