79% block-catalog

Code Review | Block Catalog

WordPress plugin Block Catalog scored79%from 54 tests.

About plugin

  • Plugin page: block-catalog
  • Plugin version: 1.5.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 25, 2022
  • Latest release: Nov 24, 2023
  • Number of updates: 24
  • Update frequency: every 15.2 days
  • Top authors: dsawardekar (87.5%)10up (16.67%)

Code review

54 tests

User reviews

1 review

Install metrics

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

A check of server-side resources used by Block Catalog
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0438.71 ▼4.00
Dashboard /wp-admin3.34 ▼0.0146.26 ▼15.95
Posts /wp-admin/edit.php3.39 ▲0.0348.94 ▲0.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0595.41 ▲4.06
Media Library /wp-admin/upload.php3.26 ▲0.0336.77 ▲1.06
Block Catalog /wp-admin/edit-tags.php?taxonomy=block-catalog3.3434.71
Block Catalog /wp-admin/edit-tags.php?taxonomy=block-catalog&post_type=page3.2538.24
Block Catalog /wp-admin/tools.php?page=block-catalog-tools3.2330.80

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-comments
block_catalog_indexed
block_catalog_notice_shown
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Catalog
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.67 ▼0.041.65 ▼0.1039.50 ▼3.91
Dashboard /wp-admin2,212 ▲355.62 ▲0.0396.01 ▼5.9143.07 ▼1.36
Posts /wp-admin/edit.php2,151 ▲511.99 ▲0.0539.58 ▼1.6135.33 ▼0.34
Add New Post /wp-admin/post-new.php1,537 ▲1123.25 ▼0.02710.53 ▲74.1155.74 ▲8.03
Media Library /wp-admin/upload.php1,408 ▲114.13 ▼0.00102.58 ▼7.1242.76 ▼1.02
Block Catalog /wp-admin/edit-tags.php?taxonomy=block-catalog1,2882.1227.8833.17
Block Catalog /wp-admin/edit-tags.php?taxonomy=block-catalog&post_type=page1,2882.1230.1531.34
Block Catalog /wp-admin/tools.php?page=block-catalog-tools9001.7324.8226.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • block_catalog_notice_shown
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • block_catalog_indexed
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=block-catalog
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Please fix the following items
  • 2× 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/block-catalog/block-catalog.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/block-catalog/includes/classes/CatalogCommand.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: custom blocks, gutenberg, blocks, developer

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

The entry point to "Block Catalog" version 1.5.3 is a PHP file that has certain tags in its header comment area
70 characters long description:
Easily keep track of which Gutenberg Blocks are used across your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,304 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP114028091,302
CSS1001
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.43
▷ Minimum class complexity3.00
▷ Maximum class complexity58.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods4779.66%
▷ Protected methods23.39%
▷ Private methods1016.95%
Functions26
▷ Named functions2076.92%
▷ Anonymous functions623.08%
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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/icon-512.png2.82KB2.25KB▼ 20.04%
dist/images/icon-192.png1.13KB1.12KB▼ 0.95%
dist/images/icon-128.png0.75KB0.76KB0.00%