10% blockprotocol

Code Review | Block Protocol

WordPress plugin Block Protocol scored10%from 54 tests.

About plugin

  • Plugin page: blockprotocol
  • Plugin version: 0.0.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2023
  • Latest release: Jun 27, 2023
  • Number of updates: 23
  • Update frequency: every 5.4 days
  • Top authors: blockprotocol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /896 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/blockprotocol/block-protocol.php+137
    Undefined variable: pagenow

Server metrics [RAM: ▲2.16MB] [CPU: ▲7.45ms] Passed 4 tests

Analyzing server-side resources used by Block Protocol
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.62 ▲2.1658.30 ▲11.21
Dashboard /wp-admin5.46 ▲2.1665.64 ▲7.58
Posts /wp-admin/edit.php5.51 ▲2.1670.11 ▲19.75
Add New Post /wp-admin/post-new.php8.05 ▲2.17100.76 ▼2.66
Media Library /wp-admin/upload.php5.38 ▲2.1654.78 ▲13.65

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 642 new files
Database: 1 new table, 7 new options
New tables
wp_block_protocol_entities
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
block_protocol_view_count

Browser metrics Passed 4 tests

Checking browser requirements for Block Protocol
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,007 ▲24621.82 ▲7.47177.01 ▲175.4550.04 ▲7.91
Dashboard /wp-admin2,246 ▲695.51 ▼0.0384.57 ▼7.0739.23 ▼5.29
Posts /wp-admin/edit.php2,133 ▲302.00 ▲0.0041.86 ▲2.4536.02 ▲1.66
Add New Post /wp-admin/post-new.php1,547 ▲1918.08 ▼4.92626.76 ▼42.6471.22 ▲4.84
Media Library /wp-admin/upload.php1,434 ▲374.14 ▼0.03103.65 ▲5.1945.22 ▲2.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_block_protocol_entities
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • block_protocol_view_count
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 271× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface' not found in wp-content/plugins/blockprotocol/vendor/symfony/http-client-contracts/Exception/ServerExceptionInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/blockprotocol/vendor/symfony/options-resolver/Exception/AccessException.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Sentry\\ClientBuilderInterface' not found in wp-content/plugins/blockprotocol/vendor/sentry/sentry/src/ClientBuilder.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' not found in wp-content/plugins/blockprotocol/vendor/symfony/options-resolver/Exception/MissingOptionsException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' not found in wp-content/plugins/blockprotocol/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Sentry\\Integration\\AbstractErrorListenerIntegration' not found in wp-content/plugins/blockprotocol/vendor/sentry/sentry/src/Integration/FatalErrorListenerIntegration.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Common\\Plugin\\SeekableBodyPlugin' not found in wp-content/plugins/blockprotocol/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/blockprotocol/vendor/sentry/sentry/src/Monolog/Handler.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Stringable' not found in wp-content/plugins/blockprotocol/vendor/sentry/sentry/src/Dsn.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface' not found in wp-content/plugins/blockprotocol/vendor/symfony/http-client-contracts/Exception/RedirectionExceptionInterface.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

blockprotocol/block-protocol.php 92% from 13 tests

This is the main PHP file of "Block Protocol" version 0.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("blockprotocol.php" instead of "block-protocol.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected47,049 lines of code in 591 files:
LanguageFilesBlank linesComment linesLines of code
PHP4657,49315,22129,474
Sass22627,274
Markdown421,99803,592
JSON31003,182
TypeScript313212383,147
CSS3280186
YAML5122132
Bourne Shell16018
XML10016
JavaScript90015
make16013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity9.48
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces70
Interfaces80
Traits25
Classes328
▷ Abstract classes103.05%
▷ Concrete classes31896.95%
▷ Final classes21768.24%
Methods2,190
▷ Static methods29813.61%
▷ Public methods1,88986.26%
▷ Protected methods602.74%
▷ Private methods24111.00%
Functions340
▷ Named functions12937.94%
▷ Anonymous functions21162.06%
Constants111
▷ Global constants43.60%
▷ Class constants10796.40%
▷ Public constants7671.03%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 2.26MB with 1.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
settings/images/blocks.png325.23KB87.16KB▼ 73.20%
build/images/blocks.e3a196f2.png325.23KB87.16KB▼ 73.20%
settings/images/block-trio.png301.32KB78.72KB▼ 73.87%
build/images/block-trio.cc017916.png301.32KB78.72KB▼ 73.87%
settings/images/ai.png528.91KB176.76KB▼ 66.58%