89% generateblocks

Code Review | GenerateBlocks

WordPress plugin GenerateBlocks scored89%from 54 tests.

About plugin

  • Plugin page: generateblocks
  • Plugin version: 1.8.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.3
  • WordPress version: 6.3.1
  • First release: May 19, 2020
  • Latest release: Aug 15, 2023
  • Number of updates: 40
  • Update frequency: every 32.5 days
  • Top authors: edge22 (100%)

Code review

54 tests

User reviews

107 reviews

Install metrics

100,000+ active /1,474,375 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.08MB] [CPU: ▲1.74ms] Passed 4 tests

This is a short check of server-side resources used by GenerateBlocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.58 ▲1.1247.29 ▲6.94
Dashboard /wp-admin4.38 ▲1.0748.98 ▼2.48
Posts /wp-admin/edit.php4.43 ▲1.0759.73 ▲17.15
Add New Post /wp-admin/post-new.php7.03 ▲1.1489.90 ▼7.47
Media Library /wp-admin/upload.php4.30 ▲1.0744.36 ▲9.95
Settings /wp-admin/admin.php?page=generateblocks-settings4.2236.59
Dashboard /wp-admin/admin.php?page=generateblocks4.2037.04

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 395 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
generateblocks_dynamic_css_time
widget_recent-posts
db_upgraded
generateblocks_version
generateblocks_dynamic_css_posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for GenerateBlocks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲10813.56 ▼0.735.03 ▲3.3543.52 ▼2.53
Dashboard /wp-admin2,232 ▲445.84 ▲0.9798.83 ▼15.1740.54 ▼5.70
Posts /wp-admin/edit.php2,118 ▲292.04 ▲0.0440.20 ▲1.1238.24 ▲4.19
Add New Post /wp-admin/post-new.php6,209 ▲4,67420.08 ▼3.31966.42 ▲346.9655.89 ▲2.94
Media Library /wp-admin/upload.php1,414 ▲294.19 ▼0.0699.86 ▼1.1942.77 ▼1.09
Settings /wp-admin/admin.php?page=generateblocks-settings1,0137.29170.4341.54
Dashboard /wp-admin/admin.php?page=generateblocks1,0692.0229.4840.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • generateblocks_version
    • widget_recent-posts
    • db_upgraded
    • generateblocks_dynamic_css_time
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • generateblocks_dynamic_css_posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

generateblocks/plugin.php 92% from 13 tests

The main PHP script in "GenerateBlocks" version 1.8.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("generateblocks.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
Everything looks great! No dangerous files found in this plugin37,041 lines of code in 384 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3222,50298319,911
JSON3009,000
PHP241,4031,9166,140
Sass2835251,739
CSS4340216
SVG30035

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 138)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity50.24
▷ Minimum class complexity5.00
▷ Maximum class complexity186.00
Average method complexity7.53
▷ Minimum method complexity1.00
▷ Maximum method complexity138.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods124
▷ Static methods7358.87%
▷ Public methods12298.39%
▷ Protected methods00.00%
▷ Private methods21.61%
Functions79
▷ Named functions6987.34%
▷ Anonymous functions1012.66%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 compressed PNG files occupy 0.08MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/square-image-placeholder.png0.13KB0.13KB0.00%
assets/images/generatepress-sites.png77.45KB77.62KB0.00%
assets/images/image-placeholder.png0.12KB0.13KB0.00%