73% ai-image-generator

Code Review | AI Image Generator - Experience the future of image creation with AI

WordPress plugin AI Image Generator - Experience the future of image creation with AI scored73%from 54 tests.

About plugin

  • Plugin page: ai-image-generator
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 18, 2023
  • Latest release: May 22, 2023
  • Number of updates: 22
  • Update frequency: every 4.6 days
  • Top authors: upcasted (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

70+ active /2,129 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.36MB] [CPU: ▲36.79ms] 50% from 4 tests

Server-side resources used by AI Image Generator - Experience the future of image creation with AI
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 2,560.56ms on /wp-admin/upload.php?page=ai-wp-cgntvdnmc)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.36MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.18 ▲5.7177.41 ▲31.77
Dashboard /wp-admin9.20 ▲5.8991.66 ▲38.73
Posts /wp-admin/edit.php9.20 ▲5.8386.98 ▲34.65
Add New Post /wp-admin/post-new.php9.92 ▲4.02144.22 ▲56.97
Media Library /wp-admin/upload.php9.20 ▲5.9676.36 ▲42.01
AI Image Generator /wp-admin/upload.php?page=ai-wp-cgntvdnmc9.202,560.56
Freemius Debug [v.2.5.8] /wp-admin/admin.php?page=freemius9.2066.37

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 225 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_recent-posts
fs_accounts
can_compress_scripts
widget_theysaidso_widget
fs_active_plugins
db_upgraded
theysaidso_admin_options
fs_debug_mode

Browser metrics Passed 4 tests

Checking browser requirements for AI Image Generator - Experience the future of image creation with AI
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲21514.45 ▲0.082.03 ▲0.1733.19 ▼7.18
Dashboard /wp-admin2,357 ▲1836.15 ▲0.54119.28 ▲24.5343.00 ▲1.92
Posts /wp-admin/edit.php2,289 ▲1893.34 ▲1.4054.00 ▲16.4633.14 ▼3.55
Add New Post /wp-admin/post-new.php1,547 ▲2118.04 ▼5.69616.53 ▼94.0246.89 ▼7.18
Media Library /wp-admin/upload.php1,438 ▲384.07 ▼0.0789.84 ▼23.0946.06 ▼4.14
AI Image Generator /wp-admin/upload.php?page=ai-wp-cgntvdnmc1,1534.1587.3791.71
Freemius Debug [v.2.5.8] /wp-admin/admin.php?page=freemius1,2673.1339.4927.23

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/ai-image-generator/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • fs_accounts
    • fs_debug_mode
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% 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 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 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/upload.php?page=ai-wp-cgntvdnmc
    • > Javascript (severe) in unknown
    /wp-content/plugins/ai-image-generator/dist/ai-wp-cgntvdnmc-react.js?ver=1.0.3 1:130206 Uncaught Error: Minified React error #299; visit https://reactjs.o… for full errors and additional helpful warnings.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: image generator, ai image, ai, openai, dall e

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

"AI Image Generator - Experience the future of image creation with AI" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected36,095 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP1388,30718,20134,339
Markdown33210758
CSS1412037632
JavaScript63989224
JSON400141
SVG1001

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,079)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity74.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,079.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods1,392
▷ Static methods23717.03%
▷ Public methods99571.48%
▷ Protected methods171.22%
▷ Private methods38027.30%
Functions98
▷ Named functions9798.98%
▷ Anonymous functions11.02%
Constants153
▷ Global constants9964.71%
▷ Class constants5435.29%
▷ Public constants54100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.48MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/ai-image-generator.png151.51KB41.66KB▼ 72.51%
admin/assets/Icon-Setting.png13.17KB5.58KB▼ 57.64%
admin/assets/opaque.png0.10KB0.09KB▼ 5.00%
admin/assets/Icon-Image-Variations.png8.01KB6.44KB▼ 19.58%