84% smart-blocks

Code Review | Smart Blocks

WordPress plugin Smart Blocks scored84%from 54 tests.

About plugin

  • Plugin page: smart-blocks
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 1, 2022
  • Latest release: Sep 4, 2023
  • Number of updates: 12
  • Update frequency: every 36.1 days
  • Top authors: hashthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /7,975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.10MB] [CPU: ▼6.50ms] Passed 4 tests

Server-side resources used by Smart Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.60 ▲1.1444.71 ▲3.02
Dashboard /wp-admin4.42 ▲1.0852.44 ▼14.50
Posts /wp-admin/edit.php4.48 ▲1.1250.51 ▼1.18
Add New Post /wp-admin/post-new.php7.31 ▲1.4295.01 ▼13.07
Media Library /wp-admin/upload.php4.28 ▲1.0545.58 ▲2.77

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
smart_blocks_first_activation
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Smart Blocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14713.53 ▼0.9110.25 ▲8.4644.61 ▲0.99
Dashboard /wp-admin2,200 ▲265.62 ▼0.0383.54 ▼9.1540.07 ▼2.81
Posts /wp-admin/edit.php2,102 ▲22.01 ▲0.0536.21 ▲0.2931.96 ▼4.23
Add New Post /wp-admin/post-new.php6,380 ▲4,85423.17 ▲0.09961.40 ▲282.2340.95 ▼8.94
Media Library /wp-admin/upload.php1,402 ▲24.18 ▼0.0598.73 ▼15.2344.37 ▼4.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • smart_blocks_first_activation
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-blocks/inc/generate-css.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2 in smart-blocks/assets to your readme.txt
Please take inspiration from this readme.txt

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

This is the main PHP file of "Smart Blocks" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
77 characters long description:
Collection of advanced blocks to be used with WordPress Gutenberg Pagebuilder

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
Everything looks great! No dangerous files found in this plugin37,051 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS57,8276924,982
PHP2960916710,011
JavaScript34939582,058

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.36
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity5.66
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes13.85%
Methods146
▷ Static methods74.79%
▷ Public methods146100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions36
▷ Named functions3597.22%
▷ Anonymous functions12.78%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin