79% random-image-block-for-block-editor

Code Review | Random Image Block for Block Editor

WordPress plugin Random Image Block for Block Editor scored79%from 54 tests.

About plugin

  • Plugin page: random-image-bloc...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2023
  • Latest release: Nov 22, 2023
  • Number of updates: 6
  • Update frequency: every 28.2 days
  • Top authors: ultradevs (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /628 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▼3.87ms] Passed 4 tests

An overview of server-side resources used by Random Image Block for Block Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6337.14 ▼4.35
Dashboard /wp-admin3.93 ▲0.5852.58 ▼15.57
Posts /wp-admin/edit.php3.98 ▲0.6253.39 ▲7.50
Add New Post /wp-admin/post-new.php6.45 ▲0.5795.30 ▼0.04
Media Library /wp-admin/upload.php3.69 ▲0.4639.82 ▲4.50
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.0141.08

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 192 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
fs_accounts
can_compress_scripts
fs_active_plugins
fs_debug_mode
widget_recent-comments

Browser metrics Passed 4 tests

Random Image Block for Block Editor: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10014.72 ▲0.531.82 ▲0.1328.46 ▼15.35
Dashboard /wp-admin2,224 ▲445.52 ▼0.0597.18 ▲7.1746.38 ▲3.63
Posts /wp-admin/edit.php2,130 ▲302.02 ▲0.0241.64 ▲2.5039.52 ▲6.06
Add New Post /wp-admin/post-new.php6,384 ▲4,85427.53 ▲4.51894.21 ▲284.5940.32 ▼9.15
Media Library /wp-admin/upload.php1,429 ▲354.19 ▼0.06101.97 ▲4.5442.78 ▲1.49
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0941.6623.6627.39

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/random-image-block-for-block-editor/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • fs_debug_mode
    • fs_active_plugins
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_accounts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected 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
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: random image block, gutenberg, random image, image, block...

random-image-block-for-block-editor/random-image-block.php 92% from 13 tests

Analyzing the main PHP file in "Random Image Block for Block Editor" version 1.0.3
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("random-image-block-for-block-editor.php" instead of "random-image-block.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected34,366 lines of code in 143 files:
LanguageFilesBlank linesComment linesLines of code
PHP1218,03417,31333,167
JavaScript4114177803
Markdown1680214
JSON100122
CSS151444
XML13016

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity91.84
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes00.00%
Methods1,264
▷ Static methods19815.66%
▷ Public methods87469.15%
▷ Protected methods171.34%
▷ Private methods37329.51%
Functions106
▷ Named functions10498.11%
▷ Anonymous functions21.89%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/random-image-block-for-block-editor.png1.61KB1.56KB▼ 2.80%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%