84% stable-diffusion

Code Review | Block Diffusion - Generate images from text prompts

WordPress plugin Block Diffusion - Generate images from text prompts scored84%from 54 tests.

About plugin

  • Plugin page: stable-diffusion
  • Plugin version: 0.7.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2
  • WordPress version: 6.3.1
  • First release: Sep 13, 2022
  • Latest release: Mar 30, 2023
  • Number of updates: 26
  • Update frequency: every 7.6 days
  • Top authors: kbat82 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,894 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
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.94ms] Passed 4 tests

Server-side resources used by Block Diffusion - Generate images from text prompts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.44 ▼3.27
Dashboard /wp-admin3.36 ▲0.0553.22 ▲4.72
Posts /wp-admin/edit.php3.47 ▲0.1150.09 ▲1.31
Add New Post /wp-admin/post-new.php5.95 ▲0.0785.74 ▼5.14
Media Library /wp-admin/upload.php3.28 ▲0.0541.17 ▲3.34

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 78 new files
Database: no new tables, 8 new options
New WordPress options
stable_diffusion_options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
stable_diffusion_settings
db_upgraded

Browser metrics Passed 4 tests

Block Diffusion - Generate images from text prompts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.091.65 ▼0.2243.29 ▼3.81
Dashboard /wp-admin2,192 ▲185.56 ▼0.0189.22 ▼6.2739.38 ▼3.22
Posts /wp-admin/edit.php2,097 ▼62.00 ▲0.0135.47 ▼2.0532.59 ▼1.41
Add New Post /wp-admin/post-new.php6,366 ▲4,83830.73 ▲7.321,007.13 ▲311.9950.21 ▼4.84
Media Library /wp-admin/upload.php1,397 ▼64.18 ▼0.03109.14 ▼4.1147.70 ▼2.02

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • stable_diffusion_options
    • db_upgraded
    • stable_diffusion_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 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/stable-diffusion/stable-diffusion.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: midjourney, pokemon, ai, artificial intelligence, generate...

stable-diffusion/stable-diffusion.php Passed 13 tests

The principal PHP file in "Block Diffusion - Generate images from text prompts" v. 0.7.1 is loaded by WordPress automatically on each request
82 characters long description:
Generate unique images from text prompts using machine learning, all in the cloud.

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 plugin4,106 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
TypeScript43175843,220
JavaScript174338403
PHP51717192
CSS251161
JSON600121
Markdown1509

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity4.00
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.48MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/assets/select.png188.96KB188.97KB0.00%
src/assets/login.png150.21KB150.23KB0.00%
build/images/login.e4389b6f.png150.21KB150.23KB0.00%