84% block-controller

Code Review | Block Controller

WordPress plugin Block Controller scored84%from 54 tests.

About plugin

  • Plugin page: block-controller
  • Plugin version: 1.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 27, 2020
  • Latest release: Oct 20, 2023
  • Number of updates: 26
  • Update frequency: every 51.2 days
  • Top authors: thatdevgirl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,656 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.05MB] [CPU: ▼8.08ms] Passed 4 tests

Server-side resources used by Block Controller
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.91 ▼2.04
Dashboard /wp-admin3.38 ▲0.0445.92 ▼18.61
Posts /wp-admin/edit.php3.43 ▲0.0747.96 ▲0.71
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.51 ▼12.36
Media Library /wp-admin/upload.php3.32 ▲0.0940.83 ▲5.64
Usage Summary /wp-admin/admin.php?page=block_controller_summary3.3134.45
Block Controller /wp-admin/admin.php?page=block_controller3.2935.85
Usage Details /wp-admin/admin.php?page=block_controller_details3.2932.69

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Block Controller
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲10614.01 ▼0.391.74 ▼0.2546.43 ▲4.74
Dashboard /wp-admin2,273 ▲965.35 ▼0.1892.68 ▼9.8238.91 ▼5.56
Posts /wp-admin/edit.php2,183 ▲832.46 ▲0.4739.17 ▲2.7354.56 ▲19.34
Add New Post /wp-admin/post-new.php1,567 ▲3923.34 ▲0.38644.14 ▼12.6136.40 ▼16.59
Media Library /wp-admin/upload.php1,483 ▲835.02 ▲0.75115.02 ▲22.3246.70 ▲0.51
Usage Summary /wp-admin/admin.php?page=block_controller_summary9982.3729.4027.64
Block Controller /wp-admin/admin.php?page=block_controller1,7022.5229.2837.21
Usage Details /wp-admin/admin.php?page=block_controller_details9872.3628.5330.54

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

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
Good news, no errors were detected

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 take a closer look at the following
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/block-controller/inc/usage-summary-table.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BlockController\\is_admin() in wp-content/plugins/block-controller/inc/plugins-page.php:48
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/block-controller/inc/usage-summary-table.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/block-controller/inc/usage-summary-table.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'ThreePM\\BlockController\\UsageSummaryTable' not found in wp-content/plugins/block-controller/inc/templates/settings-usage-summary.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/block-controller/inc/templates/settings-usage-details.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BlockController\\add_action() in wp-content/plugins/block-controller/inc/settings.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function maybe_unserialize() in wp-content/plugins/block-controller/inc/templates/settings-main.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BlockController\\add_action() in wp-content/plugins/block-controller/inc/assets.php:20

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: blocks, gutenberg, content

block-controller/block-controller.php Passed 13 tests

The entry point to "Block Controller" version 1.4.1 is a PHP file that has certain tags in its header comment area
69 characters long description:
Allow site administrators to control editor access to content blocks.

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
Everything looks great! No dangerous files found in this plugin855 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP10162301530
Sass115514258
JavaScript5315466
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity3.83
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods1979.17%
▷ Protected methods28.33%
▷ Private methods312.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants125.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