66% all-bootstrap-blocks

Code Review | All Bootstrap Blocks

WordPress plugin All Bootstrap Blocks scored66%from 54 tests.

About plugin

  • Plugin page: all-bootstrap-blocks
  • Plugin version: 1.3.12
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 18, 2021
  • Latest release: Nov 27, 2023
  • Number of updates: 110
  • Update frequency: every 7.1 days
  • Top authors: areoimiles (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

2,000+ active /36,608 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.86MB] [CPU: ▲32.19ms] Passed 4 tests

This is a short check of server-side resources used by All Bootstrap Blocks
Normal server usage
Page Memory (MB) CPU Time (ms)
Home / 6.03 ▲2.56 57.66 ▲20.76
Dashboard /wp-admin 6.27 ▲2.96 81.56 ▲34.43
Posts /wp-admin/edit.php 6.27 ▲2.91 88.48 ▲36.38
Add New Post /wp-admin/post-new.php 9.02 ▲3.13 126.56 ▲37.19
Media Library /wp-admin/upload.php 6.27 ▲3.04 73.07 ▲37.23
Layout /wp-admin/admin.php?page=areoi-layout 6.48 78.78
Credits /wp-admin/admin.php?page=areoi-credits 6.27 66.10
Reset Settings /wp-admin/admin.php?page=areoi-reset_settings 6.27 63.03
Forms /wp-admin/admin.php?page=areoi-forms 6.48 80.27
Import / Export /wp-admin/admin.php?page=areoi-import-export 6.27 65.39
Content /wp-admin/admin.php?page=areoi-content 6.48 82.73
Components /wp-admin/admin.php?page=areoi-components 6.48 119.76
Dashboard /wp-admin/admin.php?page=areoi-dashboard 6.48 73.08
Customize /wp-admin/admin.php?page=areoi-customize 6.48 71.86

Server storage [IO: ▲71.94MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 71.94MB)
Filesystem: 994 new files
Database: no new tables, 11 new options
New WordPress options
areoi-dashboard-global-bootstrap-css
areoi-dashboard-global-bootstrap-js
can_compress_scripts
widget_theysaidso_widget
areoi-theme-json-updated
widget_recent-comments
areoi-bootstrap-version
areoi-version
theysaidso_admin_options
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for All Bootstrap Blocks
There were no issues detected in relation to browser resource usage
Page Nodes Memory (MB) Script (ms) Layout (ms)
Home / 3,139 ▲377 15.70 ▲1.46 8.53 ▲6.90 49.43 ▲12.01
Dashboard /wp-admin 2,429 ▲258 6.67 ▲1.09 133.79 ▲37.67 61.45 ▲18.04
Posts /wp-admin/edit.php 2,365 ▲265 3.84 ▲1.83 60.46 ▲21.08 49.96 ▲11.43
Add New Post /wp-admin/post-new.php 1,659 ▲133 20.98 ▼2.20 728.87 ▲147.27 58.57 ▲6.07
Media Library /wp-admin/upload.php 1,500 ▲100 4.65 ▲0.46 86.21 ▼9.79 55.65 ▲15.23
Layout /wp-admin/admin.php?page=areoi-layout 2,479 4.58 102.50 89.44
Credits /wp-admin/admin.php?page=areoi-credits 1,252 3.67 71.78 40.67
Reset Settings /wp-admin/admin.php?page=areoi-reset_settings 1,078 3.57 59.60 43.21
Forms /wp-admin/admin.php?page=areoi-forms 3,941 5.07 160.10 93.87
Import / Export /wp-admin/admin.php?page=areoi-import-export 1,114 3.17 60.09 41.77
Content /wp-admin/admin.php?page=areoi-content 4,183 5.41 181.34 116.46
Components /wp-admin/admin.php?page=areoi-components 5,670 6.28 207.69 106.27
Dashboard /wp-admin/admin.php?page=areoi-dashboard 2,290 4.03 77.13 80.88
Customize /wp-admin/admin.php?page=areoi-customize 2,535 5.09 99.61 71.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/all-bootstrap-blocks/uninstall.php+7
    Constant AREOI__VERSION already defined
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • areoi-theme-json-updated
    • widget_theysaidso_widget
    • areoi-version
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/all-bootstrap-blocks/views/partials/mailchimp.php
    • > /wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/grid.php
  • 562× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function lightspeed_get_block_id() in wp-content/plugins/all-bootstrap-blocks/lightspeed/blocks/content-with-items/templates/accordion.php:3
    • > PHP Warning
      Use of undefined constant AREOI__PLUGIN_LIGHTSPEED_DIR - assumed 'AREOI__PLUGIN_LIGHTSPEED_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/arrow-outline.php on line 7
    • > PHP Notice
      Undefined variable: pattern_color in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/shapey-outline.php on line 3
    • > PHP Warning
      include(AREOI__PLUGIN_LIGHTSPEED_DIRpartials/pattern.php): failed to open stream: No such file or directory in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/bubble-fill-and-outline.php on line 13
    • > PHP Notice
      Undefined variable: pattern_color in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/angle-outline.php on line 11
    • > PHP Warning
      include(): Failed opening 'AREOI__PLUGIN_LIGHTSPEED_DIRpartials/pattern.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/square-angles.php on line 61
    • > PHP Warning
      Use of undefined constant AREOI__PLUGIN_LIGHTSPEED_DIR - assumed 'AREOI__PLUGIN_LIGHTSPEED_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/speech-angles.php on line 62
    • > PHP Warning
      include(): Failed opening 'AREOI__PLUGIN_LIGHTSPEED_DIRpartials/pattern.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/all-bootstrap-blocks/lightspeed/patterns/diagonal-outline.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'ABB\\ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/all-bootstrap-blocks/vendors/scssphp-1.6.0/src/Formatter/Expanded.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'ABB\\ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/all-bootstrap-blocks/vendors/scssphp-1.6.0/src/Formatter/Nested.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
  • Requires php: The plugin version is formatted incorrectly
  • Screenshots: Please add descriptions for these screenshots #6, #8, #9 in all-bootstrap-blocks/assets to your readme.txt
You can take inspiration from this readme.txt

all-bootstrap-blocks/areoi.php 85% from 13 tests

The main PHP script in "All Bootstrap Blocks" version 1.3.12 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("all-bootstrap-blocks.php" instead of "areoi.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 151 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin123,568 lines of code in 791 files:
Language Files Blank lines Comment lines Lines of code
PHP 291 5,289 5,469 32,813
JSON 68 173 0 31,581
JavaScript 161 5,209 4,528 28,051
Sass 174 2,910 2,431 23,537
CSS 53 63 74 5,940
SVG 34 0 33 1,460
HTML 6 7 0 92
Markdown 2 28 0 63
XML 2 9 5 31

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,431)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 199)
Cyclomatic complexity
Average complexity per logical line of code 0.57
Average class complexity 53.54
▷ Minimum class complexity 1.00
▷ Maximum class complexity 1,431.00
Average method complexity 5.73
▷ Minimum method complexity 1.00
▷ Maximum method complexity 199.00
Code structure
Namespaces 9
Interfaces 2
Traits 0
Classes 51
▷ Abstract classes 2 3.92%
▷ Concrete classes 49 96.08%
▷ Final classes 3 6.12%
Methods 576
▷ Static methods 94 16.32%
▷ Public methods 224 38.89%
▷ Protected methods 305 52.95%
▷ Private methods 47 8.16%
Functions 228
▷ Named functions 177 77.63%
▷ Anonymous functions 51 22.37%
Constants 89
▷ Global constants 17 19.10%
▷ Class constants 72 80.90%
▷ Public constants 72 100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
50 PNG files occupy 2.44MB with 1.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
File Size - original Size - compressed Savings
blocks/strip/cover.png 12.85KB 4.21KB ▼ 67.25%
blocks/modal-header/cover.png 42.00KB 16.96KB ▼ 59.62%
blocks/post-grid/cover.png 146.32KB 46.62KB ▼ 68.14%
blocks/row/cover.png 11.64KB 5.45KB ▼ 53.17%
blocks/content-grid/cover.png 146.32KB 46.62KB ▼ 68.14%