78% blocks

Code Review | Blocks

WordPress plugin Blocks scored78%from 54 tests.

About plugin

  • Plugin page: blocks
  • Plugin version: 1.6.42
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.9
  • WordPress version: 6.3.1
  • First release: Aug 13, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 163
  • Update frequency: every 18.6 days
  • Top authors: rnzo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /86,021 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.96MB] [CPU: ▲4.18ms] Passed 4 tests

Analyzing server-side resources used by Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8747.67 ▲6.89
Dashboard /wp-admin4.35 ▲1.0162.08 ▲0.74
Posts /wp-admin/edit.php4.41 ▲1.0554.44 ▲3.51
Add New Post /wp-admin/post-new.php6.87 ▲0.9998.16 ▲5.59
Media Library /wp-admin/upload.php4.22 ▲0.9950.03 ▲8.66
Mercurial /wp-admin/options-general.php?page=mercurial4.1941.60
Add New Block /wp-admin/admin.php?page=block-new4.1938.70
All Blocks /wp-admin/admin.php?page=block4.2542.34
Recommended /wp-admin/plugins.php?page=mercurial-install-plugins4.3942.98

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 152 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
wpcmsb
mercurial_options

Browser metrics Passed 4 tests

Blocks: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,751 ▲414.17 ▼0.111.67 ▲0.0345.37 ▲2.02
Dashboard /wp-admin2,215 ▲385.57 ▼0.0788.09 ▼13.4443.98 ▼1.88
Posts /wp-admin/edit.php2,126 ▲262.14 ▲0.1341.85 ▲2.2940.96 ▲3.96
Add New Post /wp-admin/post-new.php1,569 ▲4323.44 ▲0.24704.43 ▲87.6457.82 ▼0.71
Media Library /wp-admin/upload.php1,428 ▲254.25 ▲0.09111.44 ▲10.7452.82 ▲8.96
Mercurial /wp-admin/options-general.php?page=mercurial8532.0326.5130.29
Add New Block /wp-admin/admin.php?page=block-new8522.0729.2133.14
All Blocks /wp-admin/admin.php?page=block1,2122.2128.8138.94
Recommended /wp-admin/plugins.php?page=mercurial-install-plugins1,1712.0523.2530.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • mercurial_options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • 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
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blocks/admin/edit-cms-block.php
  • 72× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Exception_Parser' not found in wp-content/plugins/blocks/includes/wp-less/vendor/less.php/lib/Less/Exception/Compiler.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Output' not found in wp-content/plugins/blocks/includes/wp-less/vendor/less.php/lib/Less/Output/Mapped.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/blocks/includes/capabilities.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/blocks/includes/shortcodes-mercurial.php:10
    • > PHP Warning
      require_once(wpcmsb_PLUGIN_DIR/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/blocks/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/blocks/includes/wp-less/vendor/less.php/lib/Less/Tree/Condition.php:9
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/blocks/includes/wp-less/vendor/less.php/lib/Less/Exception/Chunk.php on line 99
    • > PHP Fatal error
      Uncaught Error: Class 'Less_Tree' not found in wp-content/plugins/blocks/includes/wp-less/vendor/less.php/lib/Less/Tree/NameValue.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/blocks/includes/controller.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/blocks/admin/includes/class-cms-blocks-list-table.php on line 4

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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (blocks-screenshot-1.png), #2 (blocks-screenshot-2.png)
The official readme.txt is a good inspiration

blocks/blocks.php 92% from 13 tests

"Blocks" version 1.6.42's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected15,232 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
PHP924,1524,21812,345
CSS675901,584
Markdown31500361
SVG1909333
JavaScript1890325
LESS46922247
JSON10037

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity27.65
▷ Minimum class complexity1.00
▷ Maximum class complexity395.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes78
▷ Abstract classes22.56%
▷ Concrete classes7697.44%
▷ Final classes00.00%
Methods777
▷ Static methods658.37%
▷ Public methods62780.69%
▷ Protected methods435.53%
▷ Private methods10713.77%
Functions138
▷ Named functions138100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants1565.22%
▷ Class constants834.78%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.21MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/js/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
includes/js/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
includes/js/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
includes/js/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
admin/images/gsuite.png173.57KB59.70KB▼ 65.60%