83% ai-image-generator-lab

Code Review | AI Image Lab - Free AI Image Generator

WordPress plugin AI Image Lab - Free AI Image Generator scored83%from 54 tests.

About plugin

  • Plugin page: ai-image-generato...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2023
  • Latest release: Sep 28, 2023
  • Number of updates: 37
  • Update frequency: every 5.8 days
  • Top authors: annaqq (64.86%)aspengrovestudios (37.84%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /8,617 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼1.78ms] Passed 4 tests

This is a short check of server-side resources used by AI Image Lab - Free AI Image Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.98 ▼13.92
Dashboard /wp-admin3.41 ▲0.1149.95 ▲3.42
Posts /wp-admin/edit.php3.53 ▲0.1748.94 ▲0.33
Add New Post /wp-admin/post-new.php6.02 ▲0.14103.15 ▲9.20
Media Library /wp-admin/upload.php3.48 ▲0.2638.75 ▲3.07

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 111 new files
Database: no new tables, 7 new options
New WordPress options
wpz_ai_images_welcomed
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

AI Image Lab - Free AI Image Generator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,479 ▼1,25613.08 ▼1.292.03 ▲0.1245.00 ▲3.39
Dashboard /wp-admin2,220 ▲385.87 ▲0.05104.95 ▼0.0943.47 ▼0.43
Posts /wp-admin/edit.php2,112 ▲262.00 ▲0.0241.69 ▲1.8734.40 ▼2.75
Add New Post /wp-admin/post-new.php1,554 ▲1623.46 ▲0.38624.40 ▼12.4934.08 ▼24.46
Media Library /wp-admin/upload.php1,436 ▲454.35 ▲0.2096.53 ▼10.7147.23 ▲0.64

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • wpz_ai_images_welcomed
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ai-image-generator-lab/includes/prompt_modifiers.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WpzAiImageLab' not found in wp-content/plugins/ai-image-generator-lab/assets/js/block-editor.min.asset.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WpzAiImageLab' not found in wp-content/plugins/ai-image-generator-lab/includes/upload-ui.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WpzAiImageLab' not found in wp-content/plugins/ai-image-generator-lab/assets/css/block-editor.min.asset.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ai-image-generator-lab/includes/admin/admin-page.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ai-image-generator-lab/ai-image-generator-lab.php:66

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6, #7 in ai-image-generator-lab/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

ai-image-generator-lab/ai-image-generator-lab.php 92% from 13 tests

"AI Image Lab - Free AI Image Generator" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected9,336 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
CSS958322,567
Sass14549692,543
JavaScript1023172,018
PHP9195931,315
Markdown11670621
SVG2501221
JSON10051

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity19.33
▷ Minimum class complexity4.00
▷ Maximum class complexity42.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods1257.14%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.33MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/video-thumbnail.png97.05KB26.09KB▼ 73.12%
assets/img/ai-image-lab-1.png174.56KB59.19KB▼ 66.09%
assets/img/wp-zone-logo.png10.08KB5.35KB▼ 46.98%
assets/img/ai-image-lab-images.png27.39KB28.86KB0.00%
assets/img/ai-image-lab-2.png29.91KB15.94KB▼ 46.70%