78% magical-blocks

Code Review | Magical Blocks – Premium Gutenberg Blocks

WordPress plugin Magical Blocks – Premium Gutenberg Blocks scored 78% from 54 tests.

About plugin

  • Plugin page: magical-blocks
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Aug 12, 2023
  • Number of updates: 13
  • Update frequency: every 93.0 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active / 18,568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲3.00MB] [CPU: ▲11.35ms] Passed 4 tests

A check of server-side resources used by Magical Blocks – Premium Gutenberg Blocks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.41 ▲1.9552.23 ▲6.82
Dashboard /wp-admin6.76 ▲3.4668.98 ▲19.30
Posts /wp-admin/edit.php6.84 ▲3.4968.73 ▲19.79
Add New Post /wp-admin/post-new.php9.07 ▲3.18106.83 ▼0.51
Media Library /wp-admin/upload.php6.65 ▲3.4257.08 ▲22.27

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Magical Blocks – Premium Gutenberg Blocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,094 ▲33720.39 ▲6.0210.70 ▲8.4039.86 ▼6.36
Dashboard /wp-admin2,381 ▲1939.91 ▲5.04231.90 ▲131.9242.67 ▼2.13
Posts /wp-admin/edit.php2,339 ▲2476.81 ▲4.7684.01 ▲44.5329.36 ▼9.36
Add New Post /wp-admin/post-new.php6,652 ▲5,11730.06 ▲6.74940.82 ▲265.2946.76 ▼8.35
Media Library /wp-admin/upload.php1,442 ▲577.21 ▲3.03117.29 ▲5.0050.53 ▲4.35

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 132× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Pimple\\ServiceProviderInterface' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Provider/Container_Condition_Provider.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magical-blocks/includes/block-hvr-card.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Container\\Fulfillable\\Fulfillable' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Fulfillable_Collection.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Service/Legacy_Storage_Service_v_1_5.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magical-blocks/includes/block-carousel.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Datastore\\Datastore_Holder_Interface' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Field/Field.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Field_Icon\\Providers\\Icon_Provider_Interface' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-field-icon/core/Providers/Dashicons_Provider.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Field/Color_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Textarea_Field' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Field/Scripts_Field.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Meta_Datastore' not found in wp-content/plugins/magical-blocks/vendor/htmlburger/carbon-fields/core/Datastore/Term_Meta_Datastore.php:10

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 93% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Screenshots: Please a description for screenshot #3 in magical-blocks/assets to your readme.txt
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

magical-blocks/magical-blocks.php Passed 13 tests

The main file in "Magical Blocks – Premium Gutenberg Blocks" v. 1.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
140 characters long description:
One of the best block addons for Gutenberg editor. Now you can add carousel, slider, card, banner and many more blocks in pages and widgets.

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
Good job! No executable or dangerous file extensions detected44,888 lines of code in 473 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1887,25911,25816,842
PHP1702,9777,43010,809
SVG30129,299
CSS172771,2052,629
PO File299021,1152,432
Sass5139732,052
JSON1000674
Markdown5460151

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.47
▷ Minimum class complexity1.00
▷ Maximum class complexity65.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces27
Interfaces6
Traits0
Classes140
▷ Abstract classes117.86%
▷ Concrete classes12992.14%
▷ Final classes32.33%
Methods983
▷ Static methods11411.60%
▷ Public methods81082.40%
▷ Protected methods16616.89%
▷ Private methods70.71%
Functions116
▷ Named functions2118.10%
▷ Anonymous functions9581.90%
Constants42
▷ Global constants1330.95%
▷ Class constants2969.05%
▷ Public constants29100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/img_148071.png26.19KB9.98KB▼ 61.91%