90% useful-blocks

Code Review | Useful Blocks

WordPress plugin Useful Blocks scored90%from 54 tests.

About plugin

  • Plugin page: useful-blocks
  • Plugin version: 1.7.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2020
  • Latest release: Apr 10, 2023
  • Number of updates: 25
  • Update frequency: every 40.7 days
  • Top authors: looswebstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active /82,503 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 gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼7.49ms] Passed 4 tests

Analyzing server-side resources used by Useful Blocks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1636.20 ▼0.61
Dashboard /wp-admin3.51 ▲0.1645.39 ▼14.47
Posts /wp-admin/edit.php3.62 ▲0.2643.86 ▼1.51
Add New Post /wp-admin/post-new.php6.15 ▲0.2683.58 ▼13.38
Media Library /wp-admin/upload.php3.43 ▲0.2036.07 ▼0.38

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 157 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Useful Blocks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.35 ▼0.011.67 ▼0.0142.78 ▲2.23
Dashboard /wp-admin2,207 ▲325.49 ▼0.1482.21 ▼15.9536.43 ▼5.94
Posts /wp-admin/edit.php2,112 ▲121.95 ▼0.0835.05 ▼0.8733.23 ▼5.31
Add New Post /wp-admin/post-new.php6,231 ▲4,70519.73 ▼3.89993.90 ▲333.2639.20 ▼16.22
Media Library /wp-admin/upload.php1,406 ▲64.19 ▲0.0294.14 ▼8.8944.63 ▼0.10

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
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
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: useful, ponhiro, block, editor, guternberg

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

The entry point to "Useful Blocks" version 1.7.4 is a PHP file that has certain tags in its header comment area
52 characters long description:
It is a plugin that collects very convenient blocks.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected13,244 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript601,1496488,475
Sass297352072,489
PHP252302201,095
JSON2200795
PO File1170203366
SVG10021
CSS3003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.50
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods27
▷ Static methods2488.89%
▷ Public methods2592.59%
▷ Protected methods00.00%
▷ Private methods27.41%
Functions15
▷ Named functions960.00%
▷ Anonymous functions640.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/a_person.png6.06KB2.45KB▼ 59.58%
assets/img/ub_logo.png7.21KB7.84KB0.00%