83% block-permissions

Code Review | Block Permissions

WordPress plugin Block Permissions scored83%from 54 tests.

About plugin

  • Plugin page: block-permissions
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Apr 9, 2019
  • Latest release: Oct 25, 2021
  • Number of updates: 22
  • Update frequency: every 42.3 days
  • Top authors: meceware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,702 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by Block Permissions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.08 ▼6.09
Dashboard /wp-admin3.31 ▲0.0151.42 ▲5.33
Posts /wp-admin/edit.php3.36 ▲0.0144.10 ▼4.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.60 ▼23.08
Media Library /wp-admin/upload.php3.24 ▲0.0134.35 ▼1.68

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Block Permissions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.64 ▼0.764.64 ▲2.7141.25 ▼0.28
Dashboard /wp-admin2,203 ▲155.83 ▲0.9397.72 ▼2.9938.91 ▼4.07
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0433.02 ▼4.7134.41 ▼1.81
Add New Post /wp-admin/post-new.php6,186 ▲4,65126.60 ▲3.25949.93 ▲251.5857.60 ▲5.62
Media Library /wp-admin/upload.php1,385 ▼04.23 ▲0.04107.90 ▲6.3247.17 ▲4.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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 | 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/block-permissions/lib/users.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/block-permissions/lib/user-roles.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can look at the official readme.txt

block-permissions/mcw-bp-gutenberg.php 77% from 13 tests

The entry point to "Block Permissions" version 1.0.8 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 181 characters long)
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: The principal plugin file should be the same as the plugin slug ("block-permissions.php" instead of "mcw-bp-gutenberg.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,016 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5233706972
Markdown132041
CSS2002
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.87
Average class complexity51.25
▷ Minimum class complexity4.00
▷ Maximum class complexity134.00
Average method complexity4.87
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods52
▷ Static methods917.31%
▷ Public methods4790.38%
▷ Protected methods23.85%
▷ Private methods35.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.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