78% auto-ai-featured-image

Code Review | KH Featured AI Image Generator

WordPress plugin KH Featured AI Image Generator scored78%from 54 tests.

About plugin

  • Plugin page: auto-ai-featured-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 2, 2023
  • Latest release: Mar 19, 2023
  • Number of updates: 3
  • Update frequency: every 5.7 days
  • Top authors: knowhalim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /369 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.67MB] [CPU: ▼16.09ms] Passed 4 tests

This is a short check of server-side resources used by KH Featured AI Image Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.23 ▼8.79
Dashboard /wp-admin3.33 ▲0.0348.34 ▲1.74
Posts /wp-admin/edit.php3.38 ▲0.0346.62 ▼1.41
Add New Post /wp-admin/post-new.php3.11 ▼2.7734.76 ▼55.89
Media Library /wp-admin/upload.php3.25 ▲0.0336.46 ▲1.80

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by KH Featured AI Image Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17813.62 ▼0.764.85 ▲2.9441.34 ▼3.37
Dashboard /wp-admin2,225 ▲344.85 ▲0.02100.06 ▼15.7839.66 ▼2.85
Posts /wp-admin/edit.php2,105 ▲342.00 ▼0.0039.19 ▲4.0936.73 ▲2.98
Add New Post /wp-admin/post-new.php1,537 ▲418.52 ▼4.84635.91 ▼49.9856.74 ▼2.71
Media Library /wp-admin/upload.php1,404 ▲194.14 ▼0.0894.81 ▼30.0539.76 ▼7.82

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/auto-ai-featured-image/admin/partials/kh-auto-ai-featured-image-admin-display.php
    • > /wp-content/plugins/auto-ai-featured-image/public/partials/kh-auto-ai-featured-image-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/auto-ai-featured-image/admin/class-kh-auto-ai-featured-image-admin.php:279

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: ai, text to image, txt2img, featured image, artificial intelligence

auto-ai-featured-image/kh-auto-ai-featured-image.php 85% from 13 tests

The primary PHP file in "KH Featured AI Image Generator" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("auto-ai-featured-image.php" instead of "kh-auto-ai-featured-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected568 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12195549508
CSS25836
JavaScript2123524

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin