73% b-blocks

Code Review | B Blocks - The ultimate block collection

WordPress plugin B Blocks - The ultimate block collection scored73%from 54 tests.

About plugin

  • Plugin page: b-blocks
  • Plugin version: 1.7.8
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 26, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 114
  • Update frequency: every 8.6 days
  • Top authors: charlescormier (77.19%)abuhayat (23.68%)

Code review

54 tests

User reviews

9 reviews

Install metrics

500+ active /8,795 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.29MB] [CPU: ▲5.21ms] Passed 4 tests

An overview of server-side resources used by B Blocks - The ultimate block collection
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.83 ▲1.3744.11 ▲2.59
Dashboard /wp-admin4.57 ▲1.2762.85 ▲4.04
Posts /wp-admin/edit.php4.63 ▲1.2759.06 ▲8.31
Add New Post /wp-admin/post-new.php7.39 ▲1.50106.38 ▲17.38
Media Library /wp-admin/upload.php4.50 ▲1.2742.37 ▲5.89
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.8639.38
B Blocks /wp-admin/admin.php?page=b-blocks4.7347.73

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 374 new files
Database: no new tables, 9 new options
New WordPress options
fs_accounts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
fs_active_plugins
widget_recent-comments
fs_debug_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for B Blocks - The ultimate block collection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7214.23 ▼0.502.02 ▲0.4031.30 ▼11.74
Dashboard /wp-admin2,212 ▲325.55 ▼0.0388.51 ▼14.1341.63 ▼2.21
Posts /wp-admin/edit.php2,121 ▲211.99 ▲0.0339.76 ▲5.3738.28 ▲2.46
Add New Post /wp-admin/post-new.php6,301 ▲4,77322.90 ▼0.37977.03 ▲254.5536.59 ▼21.65
Media Library /wp-admin/upload.php1,417 ▲204.23 ▼0.0797.46 ▼3.3543.69 ▼3.06
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0851.6926.7531.34
B Blocks /wp-admin/admin.php?page=b-blocks9761.6527.8458.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/b-blocks/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_accounts
    • theysaidso_admin_options
    • fs_debug_mode
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • fs_active_plugins

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)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/video/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/lottie-player/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/section-heading/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/row/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/flip-boxes/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/mailto/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/3d-viewer/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/animated-text/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/pricing-table/block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BBlocks' not found in wp-content/plugins/b-blocks/inc/feature-boxes/block.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

b-blocks/plugin.php 92% from 13 tests

This is the main PHP file of "B Blocks - The ultimate block collection" version 1.7.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("b-blocks.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected42,067 lines of code in 265 files:
LanguageFilesBlank linesComment linesLines of code
PHP1508,31517,27234,914
JSON31004,693
PO File17741,8781,711
JavaScript34841,010693
CSS4814548
SVG1008

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity57.60
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes81
▷ Abstract classes22.47%
▷ Concrete classes7997.53%
▷ Final classes00.00%
Methods1,386
▷ Static methods20915.08%
▷ Public methods99771.93%
▷ Protected methods171.23%
▷ Private methods37226.84%
Functions104
▷ Named functions9995.19%
▷ Anonymous functions54.81%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/b-blocks.png9.65KB5.17KB▼ 46.45%